aboutsummaryrefslogtreecommitdiffstats
path: root/fix-dlsearch-path-in-libtool-for-multilib
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 /fix-dlsearch-path-in-libtool-for-multilib
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 'fix-dlsearch-path-in-libtool-for-multilib')
-rw-r--r--fix-dlsearch-path-in-libtool-for-multilib23
1 files changed, 23 insertions, 0 deletions
diff --git a/fix-dlsearch-path-in-libtool-for-multilib b/fix-dlsearch-path-in-libtool-for-multilib
new file mode 100644
index 0000000..6872ee5
--- /dev/null
+++ b/fix-dlsearch-path-in-libtool-for-multilib
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# If configure was generated with libtool that did not have support for
+# run-time library search path (sys_lib_dlsearch_path_spec) autodetection,
+# we replace the hardcoded search path with "/usr/%{_lib} /%{_lib}".
+
+# Our libtool has autodetection in form of lib64.patch, though it does not
+# handle cases (e.g. Debian) where /usr/lib is valid for multilib archs.
+
+# Without the correct search path defined, binaries would wrongly get rpath even
+# when the libraries are located in a standard directory.
+
+CONFIGURE_TOP="${1:-.}"
+LIB="${2:-lib}"
+if [ -e $CONFIGURE_TOP/configure ] && grep -q 'sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"' $CONFIGURE_TOP/configure; then
+ echo "Forcing run-time library search path definition in configure to prevent libtool from adding rpath for standard directories (configure was generated with libtool without support for autodetection)"
+
+ sed -i \
+ -e "s,^[ \t]*# Append ld.so.conf contents to the search path, sys_lib_dlsearch_path_spec=\"/usr/${LIB} /${LIB}\"\n\0," \
+ -e 's,sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra",sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra",' \
+ $CONFIGURE_TOP/configure
+fi
+