From 1a25da5110deaf5a74ecbeb8fcc2876f2fa15010 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 3 Jun 2015 04:06:08 +0000 Subject: set the default m4 system dir to the SYSROOT when it is available --- eclass/autotools.eclass | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'eclass/autotools.eclass') 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 -- cgit v1.2.3-65-gdbad