3
0
forked from pool/util-linux
util-linux/which-lib64.patch

35 lines
1.3 KiB
Diff

--- acinclude.m4
+++ acinclude.m4
@@ -3,21 +3,26 @@ dnl [, ACTION-IF-NOT-FOUND [, OTHER-L
dnl Like AC_CHECK_LIB but looking for static libraries.
dnl LIBRARY must be of the form libxxx.a.
dnl The current language must be C (AC_LANG_C).
-AC_DEFUN(AC_CHECK_STATICLIB,
+AC_DEFUN([AC_CHECK_STATICLIB],
[AC_MSG_CHECKING([for $2 in $1])
dnl Use a cache variable name containing both the library and function name,
dnl because the test really is for library $1 defining function $2, not
dnl just for library $1. Separate tests with the same $1 and different $2s
dnl may have different results.
ac_lib_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
-AC_CACHE_VAL(ac_cv_lib_static_$ac_lib_var,
+AC_CACHE_VAL(ac_cv_lib_static_$ac_lib_var, [
+if test "$libdir" != "${exec_prefix}/lib"; then
+ case $libdir in *64)
+ libsuffix=64
+ esac
+fi
if test -r /etc/ld.so.conf ; then
- ld_so_paths="/lib /usr/lib `cat /etc/ld.so.conf`"
+ ld_so_paths="/lib${libsuffix} /usr/lib${libsuffix} `cat /etc/ld.so.conf`"
else
- ld_so_paths="/lib /usr/lib"
+ ld_so_paths="/lib${libsuffix} /usr/lib${libsuffix}"
fi
for path in $ld_so_paths; do
- [ac_save_LIBS="$LIBS"
+ ac_save_LIBS="$LIBS"
LIBS="$path/$1 $5 $LIBS"
AC_TRY_LINK(dnl
ifelse([$2], [main], , dnl Avoid conflicting decl of main.