aboutsummaryrefslogtreecommitdiffstats
path: root/classes/autotools.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'classes/autotools.bbclass')
-rw-r--r--classes/autotools.bbclass61
1 files changed, 45 insertions, 16 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}
}