configure.in
changeset 451 1b767145cf8d
parent 435 4b5aa99968ea
child 452 78188b7061be
equal deleted inserted replaced
450:9d5e6ab8ddfc 451:1b767145cf8d
   139 $srcdir/load_aiff.c \
   139 $srcdir/load_aiff.c \
   140 $srcdir/load_voc.c \
   140 $srcdir/load_voc.c \
   141 $srcdir/mixer.c \
   141 $srcdir/mixer.c \
   142 $srcdir/music.c"
   142 $srcdir/music.c"
   143 
   143 
       
   144 dnl set this to use on systems that use lib64 instead of lib
       
   145 base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
       
   146 
       
   147 dnl Function to find a library in the compiler search path
   144 find_lib()
   148 find_lib()
   145 {
   149 {
   146     gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
   150     gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
   147     gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
   151     gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
   148     env_lib_path=[`echo $LIBS $LDFLAGS | sed 's/-L[ ]*//g'`]
   152     env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
   149     if test "$cross_compiling" = yes; then
   153     if test "$cross_compiling" = yes; then
   150         host_lib_path=""
   154         host_lib_path=""
   151     else
   155     else
   152         host_lib_path="/usr/lib /usr/local/lib"
   156         host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
   153     fi
   157     fi
   154     for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
   158     for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
   155         lib=[`ls -- $path/$1 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   159         lib=[`ls -- $path/$1 2>/dev/null | sort | sed 's/.*\/\(.*\)/\1/; q'`]
   156         if test x$lib != x; then
   160         if test x$lib != x; then
   157             echo $lib
   161             echo $lib
   158             return
   162             return
   159         fi
   163         fi
   160     done
   164     done