]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
autotools: clean up aclocal/ search path assignments
authorRoss Burton <ross.burton@arm.com>
Wed, 15 Jan 2025 16:33:16 +0000 (16:33 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 20 Jan 2025 13:38:56 +0000 (13:38 +0000)
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".

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/autotools.bbclass

index 4e7bf6696d70b79f31e0da8fa4bfac31dec6b543..99d3cb758334ba9972fa626e2de18d9a5c423d56 100644 (file)
@@ -139,11 +139,6 @@ do_compile[prefuncs] += "autotools_aclocals"
 do_install[prefuncs] += "autotools_aclocals"
 do_configure[postfuncs] += "autotools_postconfigure"
 
-ACLOCALDIR = "${STAGING_DATADIR}/aclocal"
-ACLOCALEXTRAPATH = ""
-ACLOCALEXTRAPATH:class-target = " -I ${STAGING_DATADIR_NATIVE}/aclocal/"
-ACLOCALEXTRAPATH:class-nativesdk = " -I ${STAGING_DATADIR_NATIVE}/aclocal/"
-
 python autotools_aclocals () {
     sitefiles, searched = siteinfo_get_files(d, sysrootcache=True)
     d.setVar("CONFIG_SITE", " ".join(sitefiles))
@@ -171,8 +166,8 @@ autotools_do_configure() {
        if [ -e ${AUTOTOOLS_SCRIPT_PATH}/configure.in -o -e ${AUTOTOOLS_SCRIPT_PATH}/configure.ac ]; then
                olddir=`pwd`
                cd ${AUTOTOOLS_SCRIPT_PATH}
-               mkdir -p ${ACLOCALDIR}
-               ACLOCAL="aclocal --system-acdir=${ACLOCALDIR}/"
+               # aclocal looks in the native sysroot by default, so tell it to also look in the target sysroot.
+               ACLOCAL="aclocal --aclocal-path=${STAGING_DATADIR}/aclocal/"
                if [ x"${acpaths}" = xdefault ]; then
                        acpaths=
                        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() {
                else
                        acpaths="${acpaths}"
                fi
-               acpaths="$acpaths ${ACLOCALEXTRAPATH}"
                # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look
                # like it was auto-generated.  Work around this by blowing it away
                # by hand, unless the package specifically asked not to run aclocal.