aboutsummaryrefslogtreecommitdiffstats
path: root/drop-ld-no-undefined-for-shared-lib-modules-in-libtool
diff options
context:
space:
mode:
authorThomas Backlund <tmb@mageia.org>2011-02-05 19:36:23 +0000
committerThomas Backlund <tmb@mageia.org>2011-02-05 19:36:23 +0000
commitacffc72f16c13a81f622f9353a5da40a35ebb5ee (patch)
tree78ba5ee52ec2b72caca4df8846ac6d31a533e4c0 /drop-ld-no-undefined-for-shared-lib-modules-in-libtool
parent9f5ce6a5be6bc9679ad32dd2a80e3a3eaada3cfd (diff)
downloadrpm-setup-acffc72f16c13a81f622f9353a5da40a35ebb5ee.tar
rpm-setup-acffc72f16c13a81f622f9353a5da40a35ebb5ee.tar.gz
rpm-setup-acffc72f16c13a81f622f9353a5da40a35ebb5ee.tar.bz2
rpm-setup-acffc72f16c13a81f622f9353a5da40a35ebb5ee.tar.xz
rpm-setup-acffc72f16c13a81f622f9353a5da40a35ebb5ee.zip
merge under/overlinking scripts from rpm-manbo-setup
Diffstat (limited to 'drop-ld-no-undefined-for-shared-lib-modules-in-libtool')
-rwxr-xr-xdrop-ld-no-undefined-for-shared-lib-modules-in-libtool47
1 files changed, 47 insertions, 0 deletions
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";
+}
+