summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/autotools.bbclass22
1 files changed, 13 insertions, 9 deletions
diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index e4e034b623..7c99bbdbac 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -127,10 +127,11 @@ autotools_do_configure() {
127 cd ${S} 127 cd ${S}
128 # Remove any previous copy of the m4 macros 128 # Remove any previous copy of the m4 macros
129 rm -rf ${B}/aclocal-copy/ 129 rm -rf ${B}/aclocal-copy/
130 ACLOCAL="aclocal --system-acdir=${B}/aclocal-copy/"
130 if [ x"${acpaths}" = xdefault ]; then 131 if [ x"${acpaths}" = xdefault ]; then
131 acpaths= 132 acpaths=
132 for i in `find ${S} -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \ 133 for i in `find ${S} -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
133 grep -v 'acinclude.m4' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do 134 grep -v 'acinclude.m4' | grep -v 'aclocal-copy' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
134 acpaths="$acpaths -I $i" 135 acpaths="$acpaths -I $i"
135 done 136 done
136 else 137 else
@@ -140,16 +141,19 @@ autotools_do_configure() {
140 automake --version 141 automake --version
141 echo "AUTOV is $AUTOV" 142 echo "AUTOV is $AUTOV"
142 if [ -d ${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV ]; then 143 if [ -d ${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV ]; then
143 acpaths="$acpaths -I${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV" 144 ACLOCAL="$ACLOCAL --automake-acdir=${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV"
144 fi 145 fi
145 # The aclocal directory could get modified by other processes 146 # The aclocal directory could get modified by other processes
146 # uninstalling data from the sysroot. See Yocto #861 for details. 147 # uninstalling data from the sysroot. See Yocto #861 for details.
147 # We avoid this by taking a copy here and then files cannot disappear. 148 # We avoid this by taking a copy here and then files cannot disappear.
148 if [ -d ${STAGING_DATADIR}/aclocal ]; then 149 # We copy native first, then target. This avoids certain races since cp-noerror
149 # for scratch build this directory can be empty 150 # won't overwrite existing files.
150 # so avoid cp's no files to copy error 151 mkdir -p ${B}/aclocal-copy/
151 cp-noerror ${STAGING_DATADIR}/aclocal ${B}/aclocal-copy/ 152 if [ -d ${STAGING_DATADIR_NATIVE}/aclocal ]; then
152 acpaths="$acpaths -I ${B}/aclocal-copy/" 153 cp-noerror ${STAGING_DATADIR_NATIVE}/aclocal/ ${B}/aclocal-copy/
154 fi
155 if [ -d ${STAGING_DATADIR}/aclocal -a "${STAGING_DATADIR_NATIVE}/aclocal" != "${STAGING_DATADIR}/aclocal" ]; then
156 cp-noerror ${STAGING_DATADIR}/aclocal/ ${B}/aclocal-copy/
153 fi 157 fi
154 # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look 158 # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look
155 # like it was auto-generated. Work around this by blowing it away 159 # like it was auto-generated. Work around this by blowing it away
@@ -184,8 +188,8 @@ autotools_do_configure() {
184 bbnote Executing intltoolize --copy --force --automake 188 bbnote Executing intltoolize --copy --force --automake
185 intltoolize --copy --force --automake 189 intltoolize --copy --force --automake
186 fi 190 fi
187 bbnote Executing autoreconf --verbose --install --force ${EXTRA_AUTORECONF} $acpaths 191 bbnote Executing ACLOCAL=\"$ACLOCAL\" autoreconf --verbose --install --force ${EXTRA_AUTORECONF} $acpaths
188 autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || bbfatal "autoreconf execution failed." 192 ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || bbfatal "autoreconf execution failed."
189 cd $olddir 193 cd $olddir
190 fi 194 fi
191 if [ -e ${S}/configure ]; then 195 if [ -e ${S}/configure ]; then