[OE-core] [PATCH 1/1] autotools.bbclass: use relative path for acpaths whenever possible
Qi.Chen at windriver.com
Qi.Chen at windriver.com
Fri Nov 9 05:47:21 UTC 2012
From: Chen Qi <Qi.Chen at windriver.com>
When the TMPDIR is very long, say, 410 characters, aclocal would
fail because the argument list is too long. This patch is an effort
to use relative path for acpaths whenever possible, aiming at
making the build system work correctly when the sanity check says OK.
With the current implementation of autoreconf, it's impossible to
thoroughly replace absolute path with relative path. Therefore, we
use relative path when there's on subdirectory to configure; otherwise,
we use absolute path.
[YOCTO #2766]
Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
---
meta/classes/autotools.bbclass | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index b97d74b..86d8939 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -123,8 +123,11 @@ autotools_do_configure() {
rm -f `dirname $ac`/configure
done )
if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then
+ [ -e configure.in ] && CONFIGURE_AC=configure.in || CONFIGURE_AC=configure.ac
olddir=`pwd`
cd ${S}
+ # Determine whether there's subdirs to configure
+ grep -q -m 1 AC_CONFIG_SUBDIRS $CONFIGURE_AC && sub_cfg=1 || sub_cfg=0
# Remove any previous copy of the m4 macros
rm -rf ${B}/aclocal-copy/
ACLOCAL="aclocal --system-acdir=${B}/aclocal-copy/"
@@ -132,6 +135,11 @@ autotools_do_configure() {
acpaths=
for i in `find ${S} -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
grep -v 'acinclude.m4' | grep -v 'aclocal-copy' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
+ # If no subdirs to configure, we use relative path
+ # This is used for supporting long TMPDIR in Yocto
+ if [ $sub_cfg == 0 ]; then
+ i=`echo $i | sed -e 's#${S}#\.#'`
+ fi
acpaths="$acpaths -I $i"
done
else
@@ -161,11 +169,7 @@ autotools_do_configure() {
if ! echo ${EXTRA_AUTORECONF} | grep -q "aclocal"; then
rm -f aclocal.m4
fi
- if [ -e configure.in ]; then
- CONFIGURE_AC=configure.in
- else
- CONFIGURE_AC=configure.ac
- fi
+
if grep "^[[:space:]]*AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
if grep "sed.*POTFILES" $CONFIGURE_AC >/dev/null; then
: do nothing -- we still have an old unmodified configure.ac
--
1.7.9.5
More information about the Openembedded-core
mailing list