cpan.bbclass: If a module attempts to use LDDFLAGS to link then it will be
authorJamie Lenehan <lenehan@twibble.org>
Tue, 3 Oct 2006 22:44:31 +0000 (22:44 +0000)
committerJamie Lenehan <lenehan@twibble.org>
Tue, 3 Oct 2006 22:44:31 +0000 (22:44 +0000)
linking against the host libraries. Modify LDDFLAGS as part of the other
modifications that already occur.

classes/cpan.bbclass

index f883867..74bbebf 100644 (file)
@@ -11,8 +11,12 @@ cpan_do_configure () {
        perl Makefile.PL ${EXTRA_CPANFLAGS}
        if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
                . ${STAGING_DIR}/${TARGET_SYS}/perl/config.sh
-               sed -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:; s:\(SITEARCHEXP = \).*:\1${sitearchexp}:; s:\(INSTALLVENDORLIB = \).*:\1${D}${libdir}/perl5/site_perl/${version}:; s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" < Makefile > Makefile.new
-               mv Makefile.new Makefile
+                sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \
+                       -e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \
+                       -e "s:\(INSTALLVENDORLIB = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \
+                       -e "s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \
+                       -e "s:\(LDDLFLAGS.*\)${STAGING_DIR}/${BUILD_SYS}/lib:\1${STAGING_LIBDIR}:" \
+                       Makefile
        fi
 }