autotools.bbclass: adding do_install_append() to autotools.bbclass
authorJulian_chu <julian_chu@openmoko.com>
Sun, 27 Jul 2008 14:56:58 +0000 (22:56 +0800)
committerJohn Lee <john_lee@openmoko.org>
Mon, 12 Jan 2009 06:04:29 +0000 (14:04 +0800)
This function is used to correct .la files.  Many bb files use their
own do_install so just adding this into the original
autoclass_do_install won't work.  This ensures the .la files contain
correct path.

classes/autotools.bbclass

index adb57f6..fd8687e 100644 (file)
@@ -142,13 +142,20 @@ autotools_do_configure() {
 
 autotools_do_install() {
        oe_runmake 'DESTDIR=${D}' install
+}
 
+do_install_append() {
         for i in `find ${D} -name "*.la"` ; do \
-            sed -i -e s:${STAGING_LIBDIR}:${libdir}:g $i
-            sed -i -e s:${D}::g $i
-            sed -i -e 's:-I${WORKDIR}\S*: :g' $i
-            sed -i -e 's:-L${WORKDIR}\S*: :g' $i
-       done
+                sed -i -e '/^dependency_libs=/s,${WORKDIR}[[:alnum:]/\._+-]*/\([[:alnum:]\._+-]*\),${libdir}/\1,g' $i
+                sed -i -e s:${CROSS_DIR}/${HOST_SYS}::g $i
+                sed -i -e s:${CROSS_DIR}::g $i
+                sed -i -e s:${STAGING_LIBDIR}:${libdir}:g $i
+                sed -i -e s:${STAGING_DIR_HOST}::g $i
+                sed -i -e s:${STAGING_DIR}::g $i
+                sed -i -e s:${S}::g $i
+                sed -i -e s:${T}::g $i
+                sed -i -e s:${D}::g $i
+        done
 }
 
 STAGE_TEMP="${WORKDIR}/temp-staging"