summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2025-01-15 16:33:16 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-01-20 13:38:59 +0000
commit3bb1ccd9450026e2084aac291ca3d82c4ed949a1 (patch)
tree4cc043126b0849e734c062209eae68ac7e4d3ad6 /meta
parent41bec49c54db13c60cdd0869049b658a4e2ec638 (diff)
downloadpoky-3bb1ccd9450026e2084aac291ca3d82c4ed949a1.tar.gz
autotools: clean up aclocal/ search path assignments
We need aclocal to look in two different $datadir/aclocal/ directories: the native (eg, for pkg.m4 from pkgconfig) and the target (eg, for alsa.m4 from alsa-lib). aclocal doesn't directly support this pattern, currently we use --system-acdir to specify the target directory and then add the native directory to the user include list. However, since automake 1.17 there is also an --aclocal-path option to augument the search list. As the relocated aclocal from automake-native already knows the correct path for the native aclocal directory we can use --aclocal-path to add the correct target aclocal directory. For simplicity I don't bother only doing this in non-native builds as this just adds the same path to the search twice. This removes ACLOCALDIR and ACLOCALEXTRAPATH. Recipes using these to add search paths should instead use EXTRA_AUTORECONF += "-I path". (From OE-Core rev: 878e1517d4890b31332a506ce903d57e1d7dff87) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes-recipe/autotools.bbclass10
1 files changed, 2 insertions, 8 deletions
diff --git a/meta/classes-recipe/autotools.bbclass b/meta/classes-recipe/autotools.bbclass
index 4e7bf6696d..99d3cb7583 100644
--- a/meta/classes-recipe/autotools.bbclass
+++ b/meta/classes-recipe/autotools.bbclass
@@ -139,11 +139,6 @@ do_compile[prefuncs] += "autotools_aclocals"
139do_install[prefuncs] += "autotools_aclocals" 139do_install[prefuncs] += "autotools_aclocals"
140do_configure[postfuncs] += "autotools_postconfigure" 140do_configure[postfuncs] += "autotools_postconfigure"
141 141
142ACLOCALDIR = "${STAGING_DATADIR}/aclocal"
143ACLOCALEXTRAPATH = ""
144ACLOCALEXTRAPATH:class-target = " -I ${STAGING_DATADIR_NATIVE}/aclocal/"
145ACLOCALEXTRAPATH:class-nativesdk = " -I ${STAGING_DATADIR_NATIVE}/aclocal/"
146
147python autotools_aclocals () { 142python autotools_aclocals () {
148 sitefiles, searched = siteinfo_get_files(d, sysrootcache=True) 143 sitefiles, searched = siteinfo_get_files(d, sysrootcache=True)
149 d.setVar("CONFIG_SITE", " ".join(sitefiles)) 144 d.setVar("CONFIG_SITE", " ".join(sitefiles))
@@ -171,8 +166,8 @@ autotools_do_configure() {
171 if [ -e ${AUTOTOOLS_SCRIPT_PATH}/configure.in -o -e ${AUTOTOOLS_SCRIPT_PATH}/configure.ac ]; then 166 if [ -e ${AUTOTOOLS_SCRIPT_PATH}/configure.in -o -e ${AUTOTOOLS_SCRIPT_PATH}/configure.ac ]; then
172 olddir=`pwd` 167 olddir=`pwd`
173 cd ${AUTOTOOLS_SCRIPT_PATH} 168 cd ${AUTOTOOLS_SCRIPT_PATH}
174 mkdir -p ${ACLOCALDIR} 169 # aclocal looks in the native sysroot by default, so tell it to also look in the target sysroot.
175 ACLOCAL="aclocal --system-acdir=${ACLOCALDIR}/" 170 ACLOCAL="aclocal --aclocal-path=${STAGING_DATADIR}/aclocal/"
176 if [ x"${acpaths}" = xdefault ]; then 171 if [ x"${acpaths}" = xdefault ]; then
177 acpaths= 172 acpaths=
178 for i in `find ${AUTOTOOLS_SCRIPT_PATH} -ignore_readdir_race -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \ 173 for i in `find ${AUTOTOOLS_SCRIPT_PATH} -ignore_readdir_race -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
@@ -182,7 +177,6 @@ autotools_do_configure() {
182 else 177 else
183 acpaths="${acpaths}" 178 acpaths="${acpaths}"
184 fi 179 fi
185 acpaths="$acpaths ${ACLOCALEXTRAPATH}"
186 # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look 180 # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look
187 # like it was auto-generated. Work around this by blowing it away 181 # like it was auto-generated. Work around this by blowing it away
188 # by hand, unless the package specifically asked not to run aclocal. 182 # by hand, unless the package specifically asked not to run aclocal.