From acffc72f16c13a81f622f9353a5da40a35ebb5ee Mon Sep 17 00:00:00 2001 From: Thomas Backlund Date: Sat, 5 Feb 2011 19:36:23 +0000 Subject: merge under/overlinking scripts from rpm-manbo-setup --- ...-no-undefined-for-shared-lib-modules-in-libtool | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 drop-ld-no-undefined-for-shared-lib-modules-in-libtool (limited to 'drop-ld-no-undefined-for-shared-lib-modules-in-libtool') diff --git a/drop-ld-no-undefined-for-shared-lib-modules-in-libtool b/drop-ld-no-undefined-for-shared-lib-modules-in-libtool new file mode 100755 index 0000000..e2d8e67 --- /dev/null +++ b/drop-ld-no-undefined-for-shared-lib-modules-in-libtool @@ -0,0 +1,47 @@ +#!/usr/bin/perl + +# applies patch: +# --- ltmain.sh.pix 2008-05-23 13:51:52.000000000 +0200 +# +++ ltmain.sh 2008-05-23 13:52:16.000000000 +0200 +# @@ -1948,6 +1948,11 @@ +# fi +# done # argument parsing loop +# +# + if test "$module" = yes ; then +# + # [Manbo-labs] dropping ld option "--no-undefined" which is wrong for plugins +# + linker_flags=`echo "X $linker_flags" | $Xsed -e 's/ --no-undefined//'` +# + compiler_flags=`echo "X $compiler_flags" | $Xsed -e 's/ -Wl,--no-undefined//'` +# + fi +# + +# if test -n "$prev"; then +# $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 +# $echo "$help" 1>&2 + +# a similar patch has been applied in ltmain.sh in libtool package +# but this works even if autoreconf is not called + +foreach my $ltmain ('ltmain.sh', glob("*/ltmain.sh")) { + open(my $F, '<', $ltmain) or next; + + print "Modifying $ltmain underlinking for plugins (cf http://wiki.mandriva.com/en/Underlinking)\n"; + + open(my $G, '>', "$ltmain.new") or exit; + while (<$F>) { + print $G $_; + + if ($_ eq " done # argument parsing loop\n") { + $modified = 1; + print $G <<'EOF'; + + if test "$module" = yes ; then + linker_flags=`echo "X $linker_flags" | $Xsed -e 's/ --no-undefined//'` + compiler_flags=`echo "X $compiler_flags" | $Xsed -e 's/ -Wl,--no-undefined//'` + fi +EOF + } + } + + rename $ltmain, "$ltmain.drop" + and rename "$ltmain.new", $ltmain or print STDERR "modifying $ltmain failed: $!\n"; +} + -- cgit v1.2.1