Skip to content

Commit

Permalink
Updated find_lib to use $base_libdir
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 13, 2009
1 parent e00b9e9 commit 5fec055
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions configure.in
Expand Up @@ -141,18 +141,22 @@ $srcdir/load_voc.c \
$srcdir/mixer.c \ $srcdir/mixer.c \
$srcdir/music.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() find_lib()
{ {
gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`] 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'`] 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 if test "$cross_compiling" = yes; then
host_lib_path="" host_lib_path=""
else else
host_lib_path="/usr/lib /usr/local/lib" host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
fi fi
for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do 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 if test x$lib != x; then
echo $lib echo $lib
return return
Expand Down

0 comments on commit 5fec055

Please sign in to comment.