From 5fec055b3cbbe0e5090d49766a126e6bdfefc2e7 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 13 Oct 2009 06:54:16 +0000 Subject: [PATCH] Updated find_lib to use $base_libdir --- configure.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index ac1f0c9d..d7bfcb04 100644 --- a/configure.in +++ b/configure.in @@ -141,18 +141,22 @@ $srcdir/load_voc.c \ $srcdir/mixer.c \ $srcdir/music.c" +dnl set this to use on systems that use lib64 instead of lib +base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'` + +dnl Function to find a library in the compiler search path find_lib() { gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`] gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`] - env_lib_path=[`echo $LIBS $LDFLAGS | sed 's/-L[ ]*//g'`] + env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`] if test "$cross_compiling" = yes; then host_lib_path="" else - host_lib_path="/usr/lib /usr/local/lib" + host_lib_path="/usr/$base_libdir /usr/local/$base_libdir" fi for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do - lib=[`ls -- $path/$1 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`] + lib=[`ls -- $path/$1 2>/dev/null | sort | sed 's/.*\/\(.*\)/\1/; q'`] if test x$lib != x; then echo $lib return