summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-06-03 04:06:08 +0000
committerMike Frysinger <vapier@gentoo.org>2015-06-03 04:06:08 +0000
commit1a25da5110deaf5a74ecbeb8fcc2876f2fa15010 (patch)
treec2ff8a922d08d7da561fc3e1596cd5c837bed1b2 /eclass
parentDisable sha256.h on *BSD, bug #545714. https://github.com/gentoo/gentoo-porta... (diff)
downloadhistorical-1a25da5110deaf5a74ecbeb8fcc2876f2fa15010.tar.gz
historical-1a25da5110deaf5a74ecbeb8fcc2876f2fa15010.tar.bz2
historical-1a25da5110deaf5a74ecbeb8fcc2876f2fa15010.zip
set the default m4 system dir to the SYSROOT when it is available
Diffstat (limited to 'eclass')
-rw-r--r--eclass/autotools.eclass15
1 files changed, 13 insertions, 2 deletions
diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index 36b3ff06c3bc..481a18a19002 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -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 @@ _autotools_m4dir_include() {
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