diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-31 14:06:24 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-06-04 11:50:24 +0100 |
commit | 1808552a86c83b53e7f3fa7d88890f661bb98264 (patch) | |
tree | b50c979077e751afe61289155fdd4c67a2eefb9a /meta/classes/autotools.bbclass | |
parent | 96edb2002a014b4644da974444e8fa479dda427f (diff) | |
download | poky-1808552a86c83b53e7f3fa7d88890f661bb98264.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 rev: a5a08543c8cec43d993b2bba0ad6a9357c0a5e04)
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/classes/autotools.bbclass')
-rw-r--r-- | meta/classes/autotools.bbclass | 37 |
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 ??= "" | |||
127 | do_configure[prefuncs] += "autotools_preconfigure ${EXTRACONFFUNCS}" | 127 | do_configure[prefuncs] += "autotools_preconfigure ${EXTRACONFFUNCS}" |
128 | do_configure[postfuncs] += "autotools_postconfigure" | 128 | do_configure[postfuncs] += "autotools_postconfigure" |
129 | 129 | ||
130 | ACLOCALDIR = "${B}/aclocal-copy" | ||
131 | |||
132 | autotools_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 | |||
130 | autotools_do_configure() { | 150 | autotools_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. |