aboutsummaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/autotools.bbclass61
-rw-r--r--classes/base.bbclass1
-rw-r--r--classes/native.bbclass13
3 files changed, 55 insertions, 20 deletions
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 () {