Avoid issues with APR package detecting Libtool
The configure script was failing for APR, I think because it was trying to hack Libtool internals and wasn't compatible with newer Libtool 2.4. Fixed for me with attached patch.
-Martin
From bcabb119df06cb55a7db782ee5c147726415e9f9 Mon Sep 17 00:00:00 2001
From: Martin Panter <vadmium à gmail.com>
Date: Fri, 24 Dec 2010 05:39:15 +0000
Subject: [PATCH 2/3] APR: Avoid issues with Libtool modification script
Fixes issue with detecting Libtool script location by taking change from upstream 1.3 branch. Original complaint from buildconf script:
/libtool.m4 not found
Also avoids issue with libtool.m4 modification by explicitly setting the top_ builddir Make variable
--- recipes/apr/apr/libtool-detect.patch | 152 ++++++++++++++++++++++++++++++++++ recipes/apr/apr_1.3.5.bb | 10 ++- 2 files changed, 161 insertions(+), 1 deletions(-) create mode 100644 recipes/apr/apr/libtool-detect.patch
recipes/apr/apr/libtool-detect.patch new file +152 -0
@@ -0,0 +1,152 @@ +Taken from the following change, which has been merged into 1.3 and 1.4 +but not released yet +------------------------------------------------------------------------ +r748902 | jerenkrantz | 2009-02-28 18:32:55 +0000 (Sat, 28 Feb 2009) | 12 lines +Changed paths: + M /apr/apr/trunk/build/buildcheck.sh + M /apr/apr/trunk/buildconf + M /apr/apr/trunk/configure.in + +Go back around and clean up GNU libtool 2.x detection and usage. + +(Tested with GNU libtool 2.2.6, 1.5.26, and jlibtool; and GNU autoconf 2.63.) + +* configure.in + (AC_CONFIG_MACRO_DIR): Define so that glibtoolize2 knows where to plop things. + (AC_PROG_SED): Always find sed. + (Xsed): Define to work around libtool 2.x brokenness. +* build/buildcheck.sh: Re-activate libtool 2.x +* buildconf: Clean up and rationalize the entire process of importing libtool + autoconf macros. + +------------------------------------------------------------------------ +Index: configure.in +=================================================================== +--- configure.in (revision 748901) ++++ configure.in (revision 748902) +@@ -9,6 +9,7 @@ AC_PREREQ(2.50) + AC_INIT(build/apr_common.m4) + AC_CONFIG_HEADER(include/arch/unix/apr_private.h) + AC_CONFIG_AUX_DIR(build) ++AC_CONFIG_MACRO_DIR(build) + + dnl + dnl Include our own M4 macros along with those for libtool +@@ -121,6 +122,8 @@ dnl can only be used once within a configure scrip + dnl preload section from invoking the macro to get compiler info. + AC_PROG_CC + ++AC_PROG_SED ++ + dnl Preload + APR_PRELOAD + +@@ -164,6 +167,11 @@ echo "performing libtool configuration..." + AC_ARG_ENABLE(experimental-libtool,[ --enable-experimental-libtool Use experimental custom libtool], + [experimental_libtool=$enableval],[experimental_libtool=no]) + ++dnl Workarounds for busted Libtool 2.x when we don't call AC_PROG_LIBTOOL ++if test "x$Xsed" = "x"; then ++ Xsed="$SED -e 1s/^X//" ++fi ++ + case $host in + *-os2*) + # Use a custom-made libtool replacement +Index: buildconf +=================================================================== +--- buildconf (revision 748901) ++++ buildconf (revision 748902) +@@ -35,25 +35,20 @@ fi + # Note: APR supplies its own config.guess and config.sub -- we do not + # rely on libtool's versions + # +-echo "Copying libtool helper files ..." ++echo "buildconf: copying libtool helper files using $libtoolize" + + # Remove any libtool files so one can switch between libtool 1.3 + # and libtool 1.4 by simply rerunning the buildconf script. +-(cd build ; rm -f ltconfig ltmain.sh libtool.m4) ++(cd build ; rm -f ltconfig ltmain.sh libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4) + +-$libtoolize --copy --automake +- +-if [ -f libtool.m4 ]; then +- ltfile=`pwd`/libtool.m4 +-elif grep all_pkgmacro_files $libtoolize > /dev/null; then +- # libtool 2.x +- aclocal_dir=`sed -n '/^aclocaldir=/{s/.*=//;p;q;}' < $libtoolize` +- ltfiles=`sed -n '/^all_pkgmacro_files=/{s/.*=//;;s/"//;p;q;}' < $libtoolize` +- for f in $ltfiles; do +- test -f "$aclocal_dir/$f" && cp "$aclocal_dir/$f" build +- done +- ltfile=$aclocal_dir/libtool.m4 +-else ++lt_pversion=`$libtoolize --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'` ++lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` ++IFS=.; set $lt_version; IFS=' ' ++if test "$1" = "1"; then ++ $libtoolize --copy --automake ++ if [ -f libtool.m4 ]; then ++ ltfile=`pwd`/libtool.m4 ++ else + ltfindcmd="`sed -n \"/=[^\\\`]/p;/libtool_m4=/{s/.*=/echo /p;q;}\" \ + < $libtoolize`" + ltfile=${LIBTOOL_M4-`eval "$ltfindcmd"`} +@@ -62,21 +57,17 @@ fi + ltpath=`dirname $libtoolize` + ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 + fi +-fi +- +-if [ ! -f $ltfile ]; then ++ fi ++ if [ ! -f $ltfile ]; then + echo "$ltfile not found" + exit 1 ++ fi ++ # Do we need this anymore? ++ echo "buildconf: Using libtool.m4 at ${ltfile}." ++ cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 + fi +- +-echo "buildconf: Using libtool.m4 at ${ltfile}." +- +-cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 +- +-# libtool.m4 from 1.6 requires ltsugar.m4 +-if [ -f ltsugar.m4 ]; then +- rm -f build/ltsugar.m4 +- mv ltsugar.m4 build/ltsugar.m4 ++if test "$1" = "2"; then ++ $libtoolize --copy + fi + + # Clean up any leftovers +@@ -85,22 +76,22 @@ rm -f aclocal.m4 libtool.m4 + # + # Generate the autoconf header and ./configure + # +-echo "Creating include/arch/unix/apr_private.h.in ..." ++echo "buildconf: creating include/arch/unix/apr_private.h.in ..." + ${AUTOHEADER:-autoheader} + +-echo "Creating configure ..." ++echo "buildconf: creating configure ..." + ### do some work to toss config.cache? + ${AUTOCONF:-autoconf} + + # Remove autoconf 2.5x's cache directory + rm -rf autom4te*.cache + +-echo "Generating 'make' outputs ..." ++echo "buildconf: generating 'make' outputs ..." + build/gen-build.py make + + # Create RPM Spec file + if [ -f `which cut` ]; then +- echo rebuilding rpm spec file ++ echo "buildconf: rebuilding rpm spec file" + ( REVISION=`build/get-version.sh all include/apr_version.h APR` + VERSION=`echo $REVISION | cut -d- -s -f1` + RELEASE=`echo $REVISION | cut -d- -s -f2`
recipes/apr/apr_1.3.5.bb +9 -1
@@ -7,7 +7,9 @@ PR = "r5" SRC_URI = "${APACHE_MIRROR}/apr/${P}.tar.bz2;name=apr135tarbz2 \ file://configure_fixes.patch \ file://cleanup.patch \ - file://configfix.patch" + file://configfix.patch \ + file://libtool-detect.patch;striplevel=0 \ +" inherit autotools lib_package binconfig
@@ -18,6 +20,12 @@ do_configure_prepend() { ./buildconf } +# The buildconf script tries to change build/libtool.m4 to use the apr_ +# builddir Make variable instead of top_builddir, but it's not working very +# well. So explicitly set top_builddir to reference the apr_builddir variable +# as a workaround. +EXTRA_OEMAKE += "top_builddir='$(apr_builddir)'" + do_stage() { autotools_stage_all install -d ${STAGING_DATADIR}/apr
Signature · 1 line
1.7.1
Quoted 4 lines · Martin Panter
The configure script was failing for APR, I think because it was trying to hack Libtool internals and wasn't compatible with newer Libtool 2.4. Fixed for me with attached patch.
-Martin
FYI I stumbled across another solution to apparently the same problem. Gotta love independently reinventing the wheel!
"apr: Update to 1.4.2"
https://lists.yoctoproject.org/pipermail/poky/2011-January/002014.html
PATCH 1/1 apr: add version 1.3.12 and fix build with libtool-2.4
--- recipes/apr/apr_1.3.12.bb | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-) create mode 100644 recipes/apr/apr_1.3.12.bb
recipes/apr/apr_1.3.12.bb new file +36 -0
@@ -0,0 +1,36 @@ +DESCRIPTION = "Apache Portable Runtime (APR) library" +SECTION = "libs" +LICENSE = "Apache License, Version 2.0" + +SRC_URI = "${APACHE_MIRROR}/apr/${P}.tar.bz2 \ + file://configure_fixes.patch \ +# file://cleanup.patch \ + file://configfix.patch" + +SRC_URI[md5sum] = "6f19af60a161480cc16bb6adb9820040" +SRC_URI[sha256sum] = "cdc5eff894239344cb35e06f10e8d39a5b46d4250750c6c4ac4058ffbfb6ae80" + +inherit autotools lib_package binconfig + +OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'" + +do_configure_prepend() { + cd ${S} + echo "top_builddir=@apr_builddir@" >> build/apr_rules.mk.in + cp build/libtool.m4 . + ./buildconf +} + +FILES_${PN}-dev += "${datadir}/build-1/* ${libdir}/apr.exp" + +do_install_append() { + install -d ${D}${datadir}/apr + cp ${S}/build/apr_rules.mk ${D}${datadir}/apr/ + sed -i s,apr_builddir=.*,apr_builddir=,g ${D}${datadir}/apr/apr_rules.mk + sed -i s,apr_builders=.*,apr_builders=,g ${D}${datadir}/apr/apr_rules.mk + sed -i s,LIBTOOL=.*,LIBTOOL=\$\(SHELL\)\ ${TARGET_PREFIX}libtool,g ${D}${datadir}/apr/apr_rules.mk + sed -i s,\$\(apr_builders\),${D}${datadir}/apr/,g ${D}${datadir}/apr/apr_rules.mk + cp ${S}/build/mkdir.sh ${D}${datadir}/apr/ + cp ${S}/build/make_exports.awk ${D}${datadir}/apr/ + cp ${S}/build/make_var_export.awk ${D}${datadir}/apr/ +}
Signature · 1 line
1.7.4.rc2
Hi all
Quoted 3 lines · Martin Panter
The configure script was failing for APR, I think because it was trying to hack Libtool internals and wasn't compatible with newer Libtool 2.4. Fixed for me with attached patch.
That with the recent APR 1.3.12 commit b1ae47c by Martin Jansa it compiles so my change is no longer necessary.
For reference the full error was like this:
| buildconf: checking installation... | buildconf: python version 2.6.5 (ok) | build/buildcheck.sh: line 26: test: 65-: integer expression expected | buildconf: autoconf version 2.65- (ok) | Copying libtool helper files ... | /libtool.m4 not found | ERROR: Function do_configure failed