6b3f076
Patch by Robert Scheck <robert@fedoraproject.org> for libidn2 >= 0.3, which works
6b3f076
around the broken libtool of Debian. Multilib/multiarch systems like Fedora or Red
6b3f076
Hat Enterprise Linux are using /usr/lib64 for 64 bit libraries and /usr/lib is used
6b3f076
for 32 bit libraries. That allows to run 32 bit software on 64 bit systems. Debian
6b3f076
systems only use /usr/lib which contains only 32 or 64 bit systems depending on the
6b3f076
architecture.
6b3f076
6b3f076
Libtool hardcodes the runtime search path in a library (rpath), if the library that
6b3f076
is used for linking is not within the default system library path. The result is,
6b3f076
that if libtool.m4/configure files are generated by a Debian system, but used on a
6b3f076
Fedora or Red Hat Enterprise Linux 64 bit system for compiling, "-rpath /usr/lib64"
6b3f076
makes it into the binary.
6b3f076
6b3f076
Fedora and EPEL (for Red Hat Enterprise Linux) do not allow binaries with rpath, as
6b3f076
the Linux dynamic linker is usually smarter than the hardcoded path.
6b3f076
6b3f076
The fix for this issue is to add the optional /lib64 and /usr/lib64 directories at/
6b3f076
within libtool in front of the regular /lib and /usr/lib directories at the system
6b3f076
library path. These libtool information are hold in libtool.m4, which is generated
6b3f076
by running aclocal. As the content of libtool.m4 is included into configure during
6b3f076
a run of autoconf, libtool.m4 needs to be modified within the upstream build system
6b3f076
each time after a aclocal run - until Debian's libtool is fixed at Debian upstream.
6b3f076
6b3f076
Applying the fix is either possible by using the last hunk of the patch (the other
6b3f076
hunks are runtime-only if configure file has been already generated) or by running
6b3f076
the following sed command after each aclocal run within the upstream build system:
6b3f076
6b3f076
  sed -e 's@\(# Append ld.so.conf contents to the search path\)@# Add ABI-specific directories to the system library path.\n  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"\n\n  \1@' \
6b3f076
      -e 's@/lib /usr/lib $lt_ld_extra@$sys_lib_dlsearch_path_spec $lt_ld_extra@' -i libidn2-0.3/m4/libtool.m4
6b3f076
6b3f076
More information regarding this topic can be found for example at:
6b3f076
6b3f076
 - http://osdir.com/ml/bug-libtool-gnu/2009-12/msg00034.html
6b3f076
 - http://lists.gnu.org/archive/html/libtool/2009-01/msg00039.html
6b3f076
 - http://thread.gmane.org/gmane.comp.gnu.libtool.general/8339/focus=8345
6b3f076
6b3f076
--- libidn2-0.3/configure		2011-04-20 01:23:30.000000000 +0200
6b3f076
+++ libidn2-0.3/configure.rpath		2011-05-07 20:23:02.606829209 +0200
6b3f076
@@ -10703,10 +10703,13 @@
6b3f076
   # before this can be enabled.
6b3f076
   hardcode_into_libs=yes
6b3f076
 
6b3f076
+  # Add ABI-specific directories to the system library path.
6b3f076
+  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
6b3f076
+
6b3f076
   # Append ld.so.conf contents to the search path
6b3f076
   if test -f /etc/ld.so.conf; then
6b3f076
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
6b3f076
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
6b3f076
+    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
6b3f076
   fi
6b3f076
 
6b3f076
   # We used to test for /lib/ld.so.1 and disable shared libraries on
6b3f076
--- libidn2-0.3/src/configure		2011-04-20 01:23:54.000000000 +0200
6b3f076
+++ libidn2-0.3/src/configure.rpath	2011-05-07 20:24:25.959753622 +0200
6b3f076
@@ -10486,10 +10486,13 @@
6b3f076
   # before this can be enabled.
6b3f076
   hardcode_into_libs=yes
6b3f076
 
6b3f076
+  # Add ABI-specific directories to the system library path.
6b3f076
+  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
6b3f076
+
6b3f076
   # Append ld.so.conf contents to the search path
6b3f076
   if test -f /etc/ld.so.conf; then
6b3f076
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
6b3f076
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
6b3f076
+    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
6b3f076
   fi
6b3f076
 
6b3f076
   # We used to test for /lib/ld.so.1 and disable shared libraries on
6b3f076
--- libidn2-0.3/m4/libtool.m4		2011-04-20 01:23:26.000000000 +0200
6b3f076
+++ libidn2-0.3/m4/libtool.m4.rpath	2011-05-07 20:23:47.214717341 +0200
6b3f076
@@ -2474,10 +2474,13 @@
6b3f076
   # before this can be enabled.
6b3f076
   hardcode_into_libs=yes
6b3f076
 
6b3f076
+  # Add ABI-specific directories to the system library path.
6b3f076
+  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
6b3f076
+
6b3f076
   # Append ld.so.conf contents to the search path
6b3f076
   if test -f /etc/ld.so.conf; then
6b3f076
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
6b3f076
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
6b3f076
+    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
6b3f076
   fi
6b3f076
 
6b3f076
   # We used to test for /lib/ld.so.1 and disable shared libraries on