aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2008-03-25 23:25:10 +0000
committerKoen Kooi <koen@openembedded.org>2008-03-25 23:25:10 +0000
commit3065447af3da848f4b385781d1df338ef547b9cf (patch)
tree4e00c902e022c5ebb8b9295bdcef2538c7e814b5
parentc159c9467d048e85e1a9bd787a6270b0611215d6 (diff)
downloadopenembedded-3065447af3da848f4b385781d1df338ef547b9cf.tar.gz
native bbclass: use autotools_stage_all where appropriate
-rw-r--r--BACKPORTS.txt5
-rw-r--r--classes/autotools.bbclass61
-rw-r--r--classes/base.bbclass1
-rw-r--r--classes/native.bbclass13
4 files changed, 59 insertions, 21 deletions
diff --git a/BACKPORTS.txt b/BACKPORTS.txt
index 418cfce9b0..a6c5d713de 100644
--- a/BACKPORTS.txt
+++ b/BACKPORTS.txt
@@ -227,4 +227,7 @@ a3b18a00a09e716f4b3d5bfced86fea0439953a0 h2200: load g_ether on boot (PaulS, Koe
a6d2d41d484ef7827260add2c94d270077592a01 db_4.3.29: fix packaging QA <xjqian koen>
578f199bc6b531a09543f38044f98199ef5f49ad db: sync with poky <xjqian koen>
847c6e3f16104e7b87568edf06d0d9cc79b5e860 db: fix upstream SRC_URI, unify db4. <xjqian koen>
-a99dc9b34551aa3889d7057538bf2e37b0471af1 patch.bbclass: Show full path of a patch <koen, xjqian>
+a99dc9b34551aa3889d7057538bf2e37b0471af1 patch.bbclass: Show full path of a patch <koen, xjqian>
+complicated : use autotools_stage_all for native packages <koen, xjqian>
+
+
diff --git a/classes/autotools.bbclass b/classes/autotools.bbclass
index 991e472b14..ba0afc3b22 100644
--- a/classes/autotools.bbclass
+++ b/classes/autotools.bbclass
@@ -1,5 +1,8 @@
inherit base
+# use autotools_stage_all for native packages
+AUTOTOOLS_NATIVE_STAGE_INSTALL = "1"
+
def autotools_dep_prepend(d):
import bb;
@@ -55,6 +58,7 @@ oe_runconf () {
--oldincludedir=${oldincludedir} \
--infodir=${infodir} \
--mandir=${mandir} \
+ --enable-mainainer-mode \
${EXTRA_OECONF} \
$@"
oenote "Running $cfgcmd..."
@@ -161,6 +165,17 @@ autotools_stage_includes() {
fi
}
+autotools_stage_dir() {
+ from="$1"
+ to="$2"
+ # This will remove empty directories so we can ignore them
+ rmdir "$from" 2> /dev/null || true
+ if [ -d "$from" ]; then
+ mkdir -p "$to"
+ cp -fpPR -t "$to" "$from"/*
+ fi
+}
+
autotools_stage_all() {
if [ "${INHIBIT_AUTO_STAGE}" = "1" ]
then
@@ -169,26 +184,40 @@ autotools_stage_all() {
rm -rf ${STAGE_TEMP}
mkdir -p ${STAGE_TEMP}
oe_runmake DESTDIR="${STAGE_TEMP}" install
- if [ -d ${STAGE_TEMP}/${includedir} ]; then
- cp -fpPR ${STAGE_TEMP}/${includedir}/* ${STAGING_INCDIR}
+ autotools_stage_dir ${STAGE_TEMP}/${includedir} ${STAGING_INCDIR}
+ if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then
+ autotools_stage_dir ${STAGE_TEMP}/${bindir} ${STAGING_BINDIR_NATIVE}
+ autotools_stage_dir ${STAGE_TEMP}/${sbindir} ${STAGING_BINDIR_NATIVE}
+ autotools_stage_dir ${STAGE_TEMP}/${base_bindir} ${STAGING_BINDIR_NATIVE}
+ autotools_stage_dir ${STAGE_TEMP}/${base_sbindir} ${STAGING_BINDIR_NATIVE}
+ autotools_stage_dir ${STAGE_TEMP}/${libexecdir} ${STAGING_DIR_HOST}${layout_libexecdir}
fi
if [ -d ${STAGE_TEMP}/${libdir} ]
then
- find ${STAGE_TEMP}/${libdir} -name '*.la' -exec sed -i s,installed=yes,installed=no, {} \;
-
- for i in ${STAGE_TEMP}/${libdir}/*.la
- do
- if [ ! -f "$i" ]; then
- cp -fpPR ${STAGE_TEMP}/${libdir}/* ${STAGING_LIBDIR}
- break
- fi
- oe_libinstall -so $(basename $i .la) ${STAGING_LIBDIR}
- done
- fi
- if [ -d ${STAGE_TEMP}/${datadir}/aclocal ]; then
- install -d ${STAGING_DATADIR}/aclocal
- cp -fpPR ${STAGE_TEMP}/${datadir}/aclocal/* ${STAGING_DATADIR}/aclocal
+ olddir=`pwd`
+ cd ${STAGE_TEMP}/${libdir}
+ las=$(find . -name \*.la -type f)
+ cd $olddir
+ echo "Found la files: $las"
+ if [ -n "$las" ]; then
+ # If there are .la files then libtool was used in the
+ # build, so install them with magic mangling.
+ for i in $las
+ do
+ dir=$(dirname $i)
+ echo "oe_libinstall -C ${S} -so $(basename $i .la) ${STAGING_LIBDIR}/${dir}"
+ oe_libinstall -C ${S} -so $(basename $i .la) ${STAGING_LIBDIR}/${dir}
+ done
+ else
+ # Otherwise libtool wasn't used, and lib/ can be copied
+ # directly.
+ echo "cp -fpPR ${STAGE_TEMP}/${libdir}/* ${STAGING_LIBDIR}"
+ cp -fpPR ${STAGE_TEMP}/${libdir}/* ${STAGING_LIBDIR}
+ fi
fi
+ rm -rf ${STAGE_TEMP}/${mandir} || true
+ rm -rf ${STAGE_TEMP}/${infodir} || true
+ autotools_stage_dir ${STAGE_TEMP}/${datadir} ${STAGING_DATADIR}
rm -rf ${STAGE_TEMP}
}
diff --git a/classes/base.bbclass b/classes/base.bbclass
index 844ef26da4..d9ba201571 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -325,6 +325,7 @@ oe_libinstall() {
__runcmd rm -f $destpath/$libname.la
__runcmd sed -e 's/^installed=yes$/installed=no/' \
-e '/^dependency_libs=/s,${WORKDIR}[[:alnum:]/\._+-]*/\([[:alnum:]\._+-]*\),${STAGING_LIBDIR}/\1,g' \
+ -e "/^dependency_libs=/s,\([[:space:]']+\)${libdir},\1${STAGING_LIBDIR},g" \
$dotlai >$destpath/$libname.la
else
__runcmd install -m 0644 $dotlai $destpath/$libname.la
diff --git a/classes/native.bbclass b/classes/native.bbclass
index d51c675909..18e3a600a9 100644
--- a/classes/native.bbclass
+++ b/classes/native.bbclass
@@ -82,10 +82,15 @@ oldincludedir = "${exec_prefix}/include"
datadir = "${exec_prefix}/share"
do_stage () {
- if [ "${INHIBIT_NATIVE_STAGE_INSTALL}" != "1" ]
- then
- oe_runmake install
- fi
+ if [ "${INHIBIT_NATIVE_STAGE_INSTALL}" != "1" ]
+ then
+ if [ "${AUTOTOOLS_NATIVE_STAGE_INSTALL}" != "1" ]
+ then
+ oe_runmake install
+ else
+ autotools_stage_all
+ fi
+ fi
}
do_install () {