summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-31 14:06:24 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-10 16:45:49 +0100
commit3d79617742628525f86fe3a1f123a903cfde13d9 (patch)
treedc4a96237be83bb7696c72488f8c9e5355018ef6 /meta
parent7e78b41667c6003d2e36f8b90af1089b44fab43c (diff)
downloadpoky-3d79617742628525f86fe3a1f123a903cfde13d9.tar.gz
autotools.bbclass: Factor out aclocal copying function
Some recipes may need to manually call the aclocal copying functionality so factor this out into a function. (From OE-Core master rev: a5a08543c8cec43d993b2bba0ad6a9357c0a5e04) (From OE-Core rev: edf5a7fd6da804588fcc4f2687a7b05ecfda3beb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/autotools.bbclass37
1 files changed, 22 insertions, 15 deletions
diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index b19a871827..66c0f5d10a 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -127,6 +127,26 @@ EXTRACONFFUNCS ??= ""
127do_configure[prefuncs] += "autotools_preconfigure ${EXTRACONFFUNCS}" 127do_configure[prefuncs] += "autotools_preconfigure ${EXTRACONFFUNCS}"
128do_configure[postfuncs] += "autotools_postconfigure" 128do_configure[postfuncs] += "autotools_postconfigure"
129 129
130ACLOCALDIR = "${B}/aclocal-copy"
131
132autotools_copy_aclocal () {
133 # Remove any previous copy of the m4 macros
134 rm -rf ${ACLOCALDIR}/
135
136 # The aclocal directory could get modified by other processes
137 # uninstalling data from the sysroot. See Yocto #861 for details.
138 # We avoid this by taking a copy here and then files cannot disappear.
139 # We copy native first, then target. This avoids certain races since cp-noerror
140 # won't overwrite existing files.
141 mkdir -p ${ACLOCALDIR}/
142 if [ -d ${STAGING_DATADIR_NATIVE}/aclocal ]; then
143 cp-noerror ${STAGING_DATADIR_NATIVE}/aclocal/ ${ACLOCALDIR}/
144 fi
145 if [ -d ${STAGING_DATADIR}/aclocal -a "${STAGING_DATADIR_NATIVE}/aclocal" != "${STAGING_DATADIR}/aclocal" ]; then
146 cp-noerror ${STAGING_DATADIR}/aclocal/ ${ACLOCALDIR}/
147 fi
148}
149
130autotools_do_configure() { 150autotools_do_configure() {
131 # WARNING: gross hack follows: 151 # WARNING: gross hack follows:
132 # An autotools built package generally needs these scripts, however only 152 # An autotools built package generally needs these scripts, however only
@@ -142,9 +162,8 @@ autotools_do_configure() {
142 if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then 162 if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then
143 olddir=`pwd` 163 olddir=`pwd`
144 cd ${S} 164 cd ${S}
145 # Remove any previous copy of the m4 macros 165 autotools_copy_aclocal
146 rm -rf ${B}/aclocal-copy/ 166 ACLOCAL="aclocal --system-acdir=${ACLOCALDIR}/"
147 ACLOCAL="aclocal --system-acdir=${B}/aclocal-copy/"
148 if [ x"${acpaths}" = xdefault ]; then 167 if [ x"${acpaths}" = xdefault ]; then
149 acpaths= 168 acpaths=
150 for i in `find ${S} -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \ 169 for i in `find ${S} -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
@@ -160,18 +179,6 @@ autotools_do_configure() {
160 if [ -d ${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV ]; then 179 if [ -d ${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV ]; then
161 ACLOCAL="$ACLOCAL --automake-acdir=${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV" 180 ACLOCAL="$ACLOCAL --automake-acdir=${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV"
162 fi 181 fi
163 # The aclocal directory could get modified by other processes
164 # uninstalling data from the sysroot. See Yocto #861 for details.
165 # We avoid this by taking a copy here and then files cannot disappear.
166 # We copy native first, then target. This avoids certain races since cp-noerror
167 # won't overwrite existing files.
168 mkdir -p ${B}/aclocal-copy/
169 if [ -d ${STAGING_DATADIR_NATIVE}/aclocal ]; then
170 cp-noerror ${STAGING_DATADIR_NATIVE}/aclocal/ ${B}/aclocal-copy/
171 fi
172 if [ -d ${STAGING_DATADIR}/aclocal -a "${STAGING_DATADIR_NATIVE}/aclocal" != "${STAGING_DATADIR}/aclocal" ]; then
173 cp-noerror ${STAGING_DATADIR}/aclocal/ ${B}/aclocal-copy/
174 fi
175 # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look 182 # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look
176 # like it was auto-generated. Work around this by blowing it away 183 # like it was auto-generated. Work around this by blowing it away
177 # by hand, unless the package specifically asked not to run aclocal. 184 # by hand, unless the package specifically asked not to run aclocal.