summaryrefslogtreecommitdiffstats
path: root/meta/classes/autotools.bbclass
diff options
context:
space:
mode:
authorJens Rehsack <rehsack@gmail.com>2015-10-13 22:35:52 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-11-24 15:55:40 +0000
commit753f31e3d1e56ece0820f6a03e4a8a5ffe1a18cd (patch)
treebbf759e57d10000e3178d20e40a396af562b4ecc /meta/classes/autotools.bbclass
parente28179101c5debe8cd0e90edf7bf905112e018f3 (diff)
downloadpoky-753f31e3d1e56ece0820f6a03e4a8a5ffe1a18cd.tar.gz
autotools: Allow recipe-individual configure scripts
OpenJDK-8 has it's configure script at common/autotools - which will cause the entire assumption of ${S}/configure is regenerated by autoreconf, intltoolize or alike fails heavily. Also - other configure mechanisms can be supported more similar (see how pkgsrc manages different ones ...) (From OE-Core rev: fe506eddb0790e37ac1e50f37fa2e32ad81d5493) Signed-off-by: Jens Rehsack <sno@netbsd.org> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/autotools.bbclass')
-rw-r--r--meta/classes/autotools.bbclass43
1 files changed, 22 insertions, 21 deletions
diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index 078f58fad3..d546a5c028 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -77,16 +77,20 @@ CONFIGUREOPTS = " --build=${BUILD_SYS} \
77 ${@append_libtool_sysroot(d)}" 77 ${@append_libtool_sysroot(d)}"
78CONFIGUREOPT_DEPTRACK ?= "--disable-dependency-tracking" 78CONFIGUREOPT_DEPTRACK ?= "--disable-dependency-tracking"
79 79
80AUTOTOOLS_SCRIPT_PATH ?= "${S}"
81CONFIGURE_SCRIPT ?= "${AUTOTOOLS_SCRIPT_PATH}/configure"
82
83AUTOTOOLS_AUXDIR ?= "${AUTOTOOLS_SCRIPT_PATH}"
80 84
81oe_runconf () { 85oe_runconf () {
82 cfgscript="${S}/configure" 86 cfgscript="${CONFIGURE_SCRIPT}"
83 if [ -x "$cfgscript" ] ; then 87 if [ -x "$cfgscript" ] ; then
84 bbnote "Running $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} $@" 88 bbnote "Running $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} $@"
85 set +e 89 set +e
86 ${CACHED_CONFIGUREVARS} $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} "$@" 90 ${CACHED_CONFIGUREVARS} $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} "$@"
87 if [ "$?" != "0" ]; then 91 if [ "$?" != "0" ]; then
88 echo "Configure failed. The contents of all config.log files follows to aid debugging" 92 echo "Configure failed. The contents of all config.log files follows to aid debugging"
89 find ${S} -ignore_readdir_race -name config.log -print -exec cat {} \; 93 find ${B} -ignore_readdir_race -name config.log -print -exec cat {} \;
90 die "oe_runconf failed" 94 die "oe_runconf failed"
91 fi 95 fi
92 set -e 96 set -e
@@ -95,8 +99,6 @@ oe_runconf () {
95 fi 99 fi
96} 100}
97 101
98AUTOTOOLS_AUXDIR ?= "${S}"
99
100CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate" 102CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate"
101 103
102autotools_preconfigure() { 104autotools_preconfigure() {
@@ -134,7 +136,7 @@ do_configure[postfuncs] += "autotools_postconfigure"
134ACLOCALDIR = "${B}/aclocal-copy" 136ACLOCALDIR = "${B}/aclocal-copy"
135 137
136python autotools_copy_aclocals () { 138python autotools_copy_aclocals () {
137 s = d.getVar("S", True) 139 s = d.getVar("AUTOTOOLS_SCRIPT_PATH", True)
138 if not os.path.exists(s + "/configure.in") and not os.path.exists(s + "/configure.ac"): 140 if not os.path.exists(s + "/configure.in") and not os.path.exists(s + "/configure.ac"):
139 if not d.getVar("AUTOTOOLS_COPYACLOCAL", False): 141 if not d.getVar("AUTOTOOLS_COPYACLOCAL", False):
140 return 142 return
@@ -228,13 +230,13 @@ autotools_do_configure() {
228 ( for ac in `find ${S} -ignore_readdir_race -name configure.in -o -name configure.ac`; do 230 ( for ac in `find ${S} -ignore_readdir_race -name configure.in -o -name configure.ac`; do
229 rm -f `dirname $ac`/configure 231 rm -f `dirname $ac`/configure
230 done ) 232 done )
231 if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then 233 if [ -e ${AUTOTOOLS_SCRIPT_PATH}/configure.in -o -e ${AUTOTOOLS_SCRIPT_PATH}/configure.ac ]; then
232 olddir=`pwd` 234 olddir=`pwd`
233 cd ${S} 235 cd ${AUTOTOOLS_SCRIPT_PATH}
234 ACLOCAL="aclocal --system-acdir=${ACLOCALDIR}/" 236 ACLOCAL="aclocal --system-acdir=${ACLOCALDIR}/"
235 if [ x"${acpaths}" = xdefault ]; then 237 if [ x"${acpaths}" = xdefault ]; then
236 acpaths= 238 acpaths=
237 for i in `find ${S} -ignore_readdir_race -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \ 239 for i in `find ${AUTOTOOLS_SCRIPT_PATH} -ignore_readdir_race -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
238 grep -v 'acinclude.m4' | grep -v 'aclocal-copy' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do 240 grep -v 'acinclude.m4' | grep -v 'aclocal-copy' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
239 acpaths="$acpaths -I $i" 241 acpaths="$acpaths -I $i"
240 done 242 done
@@ -265,21 +267,20 @@ autotools_do_configure() {
265 bbnote Executing glib-gettextize --force --copy 267 bbnote Executing glib-gettextize --force --copy
266 echo "no" | glib-gettextize --force --copy 268 echo "no" | glib-gettextize --force --copy
267 fi 269 fi
268 else if grep "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then 270 elif grep "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
269 # We'd call gettextize here if it wasn't so broken... 271 # We'd call gettextize here if it wasn't so broken...
270 cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/ 272 cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/
271 if [ -d ${S}/po/ ]; then 273 if [ -d ${S}/po/ ]; then
272 cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po/ 274 cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po/
273 if [ ! -e ${S}/po/remove-potcdate.sin ]; then 275 if [ ! -e ${S}/po/remove-potcdate.sin ]; then
274 cp ${STAGING_DATADIR_NATIVE}/gettext/po/remove-potcdate.sin ${S}/po/ 276 cp ${STAGING_DATADIR_NATIVE}/gettext/po/remove-potcdate.sin ${S}/po/
275 fi
276 fi 277 fi
277 for i in gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4; do
278 for j in `find ${S} -ignore_readdir_race -name $i | grep -v aclocal-copy`; do
279 rm $j
280 done
281 done
282 fi 278 fi
279 for i in gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4; do
280 for j in `find ${S} -ignore_readdir_race -name $i | grep -v aclocal-copy`; do
281 rm $j
282 done
283 done
283 fi 284 fi
284 mkdir -p m4 285 mkdir -p m4
285 if grep "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then 286 if grep "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
@@ -290,7 +291,7 @@ autotools_do_configure() {
290 ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || die "autoreconf execution failed." 291 ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || die "autoreconf execution failed."
291 cd $olddir 292 cd $olddir
292 fi 293 fi
293 if [ -e ${S}/configure ]; then 294 if [ -e ${CONFIGURE_SCRIPT} ]; then
294 oe_runconf 295 oe_runconf
295 else 296 else
296 bbnote "nothing to configure" 297 bbnote "nothing to configure"