summaryrefslogtreecommitdiff
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
commitad77a6174e74ed78ac9b378e38083ac2e1ef8c07 (patch)
tree9c360c8083fc860184b38895e1208b91e92e3781 /eclass/autotools.eclass
parentDisable sha256.h on *BSD, bug #545714. https://github.com/gentoo/gentoo-porta... (diff)
downloadgentoo-2-ad77a6174e74ed78ac9b378e38083ac2e1ef8c07.tar.gz
gentoo-2-ad77a6174e74ed78ac9b378e38083ac2e1ef8c07.tar.bz2
gentoo-2-ad77a6174e74ed78ac9b378e38083ac2e1ef8c07.zip
set the default m4 system dir to the SYSROOT when it is available
Diffstat (limited to 'eclass/autotools.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