2008-03-19 15:35:13 +00:00
|
|
|
# use autotools_stage_all for native packages
|
|
|
|
AUTOTOOLS_NATIVE_STAGE_INSTALL = "1"
|
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
def autotools_dep_prepend(d):
|
|
|
|
if bb.data.getVar('INHIBIT_AUTOTOOLS_DEPS', d, 1):
|
|
|
|
return ''
|
|
|
|
|
|
|
|
pn = bb.data.getVar('PN', d, 1)
|
|
|
|
deps = ''
|
|
|
|
|
|
|
|
if pn in ['autoconf-native', 'automake-native']:
|
|
|
|
return deps
|
|
|
|
deps += 'autoconf-native automake-native '
|
|
|
|
|
|
|
|
if not pn in ['libtool', 'libtool-native', 'libtool-cross']:
|
2007-05-09 09:55:38 +00:00
|
|
|
deps += 'libtool-native '
|
|
|
|
if not bb.data.inherits_class('native', d) \
|
2007-08-08 20:41:55 +00:00
|
|
|
and not bb.data.inherits_class('cross', d) \
|
|
|
|
and not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, 1):
|
|
|
|
deps += 'libtool-cross '
|
2005-08-31 10:45:47 +00:00
|
|
|
|
|
|
|
return deps + 'gnu-config-native '
|
|
|
|
|
|
|
|
EXTRA_OEMAKE = ""
|
2009-11-09 14:45:57 +00:00
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
DEPENDS_prepend = "${@autotools_dep_prepend(d)}"
|
2009-11-09 14:45:57 +00:00
|
|
|
DEPENDS_virtclass-native_prepend = "${@autotools_dep_prepend(d)}"
|
|
|
|
DEPENDS_virtclass-nativesdk_prepend = "${@autotools_dep_prepend(d)}"
|
|
|
|
|
2010-03-19 18:08:35 +00:00
|
|
|
inherit siteinfo
|
|
|
|
|
|
|
|
# Space separated list of shell scripts with variables defined to supply test
|
|
|
|
# results for autoconf tests we cannot run at build time.
|
|
|
|
export CONFIG_SITE = "${@siteinfo_get_files(d)}"
|
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
acpaths = "default"
|
|
|
|
EXTRA_AUTORECONF = "--exclude=autopoint"
|
|
|
|
|
|
|
|
def autotools_set_crosscompiling(d):
|
|
|
|
if not bb.data.inherits_class('native', d):
|
|
|
|
return " cross_compiling=yes"
|
|
|
|
return ""
|
|
|
|
|
|
|
|
# EXTRA_OECONF_append = "${@autotools_set_crosscompiling(d)}"
|
|
|
|
|
2010-03-29 16:04:13 +00:00
|
|
|
CONFIGUREOPTS = " --build=${BUILD_SYS} \
|
|
|
|
--host=${HOST_SYS} \
|
|
|
|
--target=${TARGET_SYS} \
|
|
|
|
--prefix=${prefix} \
|
|
|
|
--exec_prefix=${exec_prefix} \
|
|
|
|
--bindir=${bindir} \
|
|
|
|
--sbindir=${sbindir} \
|
|
|
|
--libexecdir=${libexecdir} \
|
|
|
|
--datadir=${datadir} \
|
|
|
|
--sysconfdir=${sysconfdir} \
|
|
|
|
--sharedstatedir=${sharedstatedir} \
|
|
|
|
--localstatedir=${localstatedir} \
|
|
|
|
--libdir=${libdir} \
|
|
|
|
--includedir=${includedir} \
|
|
|
|
--oldincludedir=${oldincludedir} \
|
|
|
|
--infodir=${infodir} \
|
|
|
|
--mandir=${mandir}"
|
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
oe_runconf () {
|
|
|
|
if [ -x ${S}/configure ] ; then
|
|
|
|
cfgcmd="${S}/configure \
|
2010-03-29 16:04:13 +00:00
|
|
|
${CONFIGUREOPTS} \
|
2005-08-31 10:45:47 +00:00
|
|
|
${EXTRA_OECONF} \
|
|
|
|
$@"
|
|
|
|
oenote "Running $cfgcmd..."
|
|
|
|
$cfgcmd || oefatal "oe_runconf failed"
|
|
|
|
else
|
|
|
|
oefatal "no configure script found"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
autotools_do_configure() {
|
|
|
|
case ${PN} in
|
|
|
|
autoconf*)
|
|
|
|
;;
|
|
|
|
automake*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# WARNING: gross hack follows:
|
|
|
|
# An autotools built package generally needs these scripts, however only
|
|
|
|
# automake or libtoolize actually install the current versions of them.
|
|
|
|
# This is a problem in builds that do not use libtool or automake, in the case
|
|
|
|
# where we -need- the latest version of these scripts. e.g. running a build
|
|
|
|
# for a package whose autotools are old, on an x86_64 machine, which the old
|
|
|
|
# config.sub does not support. Work around this by installing them manually
|
|
|
|
# regardless.
|
|
|
|
( for ac in `find ${S} -name configure.in -o -name configure.ac`; do
|
|
|
|
rm -f `dirname $ac`/configure
|
|
|
|
done )
|
|
|
|
if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then
|
|
|
|
olddir=`pwd`
|
|
|
|
cd ${S}
|
|
|
|
if [ x"${acpaths}" = xdefault ]; then
|
|
|
|
acpaths=
|
|
|
|
for i in `find ${S} -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
|
|
|
|
grep -v 'acinclude.m4' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
|
|
|
|
acpaths="$acpaths -I $i"
|
|
|
|
done
|
|
|
|
else
|
|
|
|
acpaths="${acpaths}"
|
|
|
|
fi
|
|
|
|
AUTOV=`automake --version |head -n 1 |sed "s/.* //;s/\.[0-9]\+$//"`
|
|
|
|
automake --version
|
|
|
|
echo "AUTOV is $AUTOV"
|
2007-10-29 15:09:46 +00:00
|
|
|
install -d ${STAGING_DATADIR}/aclocal
|
|
|
|
install -d ${STAGING_DATADIR}/aclocal-$AUTOV
|
|
|
|
acpaths="$acpaths -I${STAGING_DATADIR}/aclocal-$AUTOV -I ${STAGING_DATADIR}/aclocal"
|
2005-08-31 10:45:47 +00:00
|
|
|
# autoreconf is too shy to overwrite aclocal.m4 if it doesn't look
|
|
|
|
# like it was auto-generated. Work around this by blowing it away
|
|
|
|
# by hand, unless the package specifically asked not to run aclocal.
|
|
|
|
if ! echo ${EXTRA_AUTORECONF} | grep -q "aclocal"; then
|
|
|
|
rm -f aclocal.m4
|
|
|
|
fi
|
|
|
|
if [ -e configure.in ]; then
|
|
|
|
CONFIGURE_AC=configure.in
|
|
|
|
else
|
|
|
|
CONFIGURE_AC=configure.ac
|
|
|
|
fi
|
2009-07-16 14:54:47 +00:00
|
|
|
if grep "^[[:space:]]*AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
|
2005-08-31 10:45:47 +00:00
|
|
|
if grep "sed.*POTFILES" $CONFIGURE_AC >/dev/null; then
|
|
|
|
: do nothing -- we still have an old unmodified configure.ac
|
|
|
|
else
|
|
|
|
oenote Executing glib-gettextize --force --copy
|
|
|
|
echo "no" | glib-gettextize --force --copy
|
|
|
|
fi
|
2009-11-30 17:03:38 +00:00
|
|
|
else if grep "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
|
|
|
|
cp ${STAGING_DATADIR}/gettext/config.rpath ${S}/
|
|
|
|
fi
|
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
fi
|
2009-07-16 14:54:47 +00:00
|
|
|
mkdir -p m4
|
|
|
|
if grep "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
|
2005-08-31 10:45:47 +00:00
|
|
|
oenote Executing intltoolize --copy --force --automake
|
|
|
|
intltoolize --copy --force --automake
|
|
|
|
fi
|
|
|
|
oenote Executing autoreconf --verbose --install --force ${EXTRA_AUTORECONF} $acpaths
|
|
|
|
autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || oefatal "autoreconf execution failed."
|
|
|
|
cd $olddir
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if [ -e ${S}/configure ]; then
|
|
|
|
oe_runconf
|
|
|
|
else
|
|
|
|
oenote "nothing to configure"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
autotools_do_install() {
|
|
|
|
oe_runmake 'DESTDIR=${D}' install
|
2009-10-30 00:39:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
PACKAGE_PREPROCESS_FUNCS += "autotools_prepackage_lamangler"
|
2007-08-08 20:41:55 +00:00
|
|
|
|
2009-10-30 00:39:07 +00:00
|
|
|
autotools_prepackage_lamangler () {
|
|
|
|
for i in `find ${PKGD} -name "*.la"` ; do \
|
2009-10-30 00:44:23 +00:00
|
|
|
sed -i -e 's:${STAGING_LIBDIR}:${libdir}:g;' \
|
|
|
|
-e 's:${D}::g;' \
|
|
|
|
-e 's:-I${WORKDIR}\S*: :g;' \
|
|
|
|
-e 's:-L${WORKDIR}\S*: :g;' \
|
|
|
|
$i
|
2007-08-08 20:41:55 +00:00
|
|
|
done
|
2005-08-31 10:45:47 +00:00
|
|
|
}
|
|
|
|
|
2009-06-11 13:45:52 +00:00
|
|
|
# STAGE_TEMP_PREFIX is used for a speedup by packaged-staging
|
2005-08-31 10:45:47 +00:00
|
|
|
STAGE_TEMP="${WORKDIR}/temp-staging"
|
2009-06-11 13:45:52 +00:00
|
|
|
STAGE_TEMP_PREFIX = ""
|
2005-08-31 10:45:47 +00:00
|
|
|
|
|
|
|
autotools_stage_includes() {
|
|
|
|
if [ "${INHIBIT_AUTO_STAGE_INCLUDES}" != "1" ]
|
|
|
|
then
|
|
|
|
rm -rf ${STAGE_TEMP}
|
|
|
|
mkdir -p ${STAGE_TEMP}
|
|
|
|
make DESTDIR="${STAGE_TEMP}" install
|
2005-09-20 07:04:35 +00:00
|
|
|
cp -pPR ${STAGE_TEMP}/${includedir}/* ${STAGING_INCDIR}
|
2005-08-31 10:45:47 +00:00
|
|
|
rm -rf ${STAGE_TEMP}
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2008-03-20 10:52:05 +00:00
|
|
|
autotools_stage_dir() {
|
2009-11-03 22:02:34 +00:00
|
|
|
sysroot_stage_dir $1 ${STAGE_TEMP_PREFIX}$2
|
2008-03-20 10:52:05 +00:00
|
|
|
}
|
|
|
|
|
2008-11-04 15:40:56 +00:00
|
|
|
autotools_stage_libdir() {
|
2009-11-02 17:10:51 +00:00
|
|
|
sysroot_stage_libdir $1 ${STAGE_TEMP_PREFIX}$2
|
2008-11-04 15:40:56 +00:00
|
|
|
}
|
|
|
|
|
2005-10-10 10:41:35 +00:00
|
|
|
autotools_stage_all() {
|
2006-02-10 11:38:23 +00:00
|
|
|
if [ "${INHIBIT_AUTO_STAGE}" = "1" ]
|
2005-10-10 10:41:35 +00:00
|
|
|
then
|
2006-02-10 11:38:23 +00:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
rm -rf ${STAGE_TEMP}
|
|
|
|
mkdir -p ${STAGE_TEMP}
|
|
|
|
oe_runmake DESTDIR="${STAGE_TEMP}" install
|
2009-11-03 22:02:34 +00:00
|
|
|
rm -rf ${STAGE_TEMP}/${mandir} || true
|
|
|
|
rm -rf ${STAGE_TEMP}/${infodir} || true
|
2009-11-02 17:10:51 +00:00
|
|
|
sysroot_stage_dirs ${STAGE_TEMP} ${STAGE_TEMP_PREFIX}
|
2009-11-03 22:02:34 +00:00
|
|
|
rm -rf ${STAGE_TEMP}
|
2005-10-10 10:41:35 +00:00
|
|
|
}
|
|
|
|
|
2010-04-26 16:41:05 +00:00
|
|
|
do_stage () {
|
|
|
|
autotools_stage_all
|
|
|
|
}
|
2009-11-03 22:02:34 +00:00
|
|
|
|
2010-04-26 16:41:05 +00:00
|
|
|
EXPORT_FUNCTIONS do_configure do_install
|