vapier      15/06/03 04:06:08

  Modified:             autotools.eclass
  Log:
  set the default m4 system dir to the SYSROOT when it is available

Revision  Changes    Path
1.176                eclass/autotools.eclass

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/autotools.eclass?rev=1.176&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/autotools.eclass?rev=1.176&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/autotools.eclass?r1=1.175&r2=1.176

Index: autotools.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v
retrieving revision 1.175
retrieving revision 1.176
diff -u -r1.175 -r1.176
--- autotools.eclass    20 May 2015 05:57:38 -0000      1.175
+++ autotools.eclass    3 Jun 2015 04:06:08 -0000       1.176
@@ -1,6 +1,6 @@
 # Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.175 2015/05/20 
05:57:38 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.176 2015/06/03 
04:06:08 vapier Exp $
 
 # @ECLASS: autotools.eclass
 # @MAINTAINER:
@@ -591,6 +591,17 @@
        echo ${include_opts}
 }
 autotools_m4dir_include()    { _autotools_m4dir_include ${AT_M4DIR} ; }
-autotools_m4sysdir_include() { _autotools_m4dir_include $(eval echo 
${AT_SYS_M4DIR}) ; }
+autotools_m4sysdir_include() {
+       # First try to use the paths the system integrator has set up.
+       local paths=( $(eval echo ${AT_SYS_M4DIR}) )
+
+       if [[ ${#paths[@]} -eq 0 && -n ${SYSROOT} ]] ; then
+               # If they didn't give us anything, then default to the SYSROOT.
+               # This helps when cross-compiling.
+               local path="${SYSROOT}/usr/share/aclocal"
+               [[ -d ${path} ]] && paths+=( "${path}" )
+       fi
+       _autotools_m4dir_include "${paths[@]}"
+}
 
 fi




Reply via email to