From: Brian Fraser Date: Wed, 22 Jan 2014 22:33:51 +0000 (-0300) Subject: Linux hints: Improve the code that looks for libc.so X-Git-Tag: upstream/5.20.0~614^2~63 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3b23fcb13d39c0c5249be5a0a886edeacfc914f2;p=platform%2Fupstream%2Fperl.git Linux hints: Improve the code that looks for libc.so --- diff --git a/hints/linux.sh b/hints/linux.sh index 5f92bba..4c2c5f5 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -60,17 +60,6 @@ libswanted="$*" # Debian 4.0 puts ndbm in the -lgdbm_compat library. libswanted="$libswanted gdbm_compat" -# If you have glibc, then report the version for ./myconfig bug reporting. -# (Configure doesn't need to know the specific version since it just uses -# gcc to load the library for all tests.) -# We don't use __GLIBC__ and __GLIBC_MINOR__ because they -# are insufficiently precise to distinguish things like -# libc-2.0.6 and libc-2.0.7. -if test -L /lib/libc.so.6; then - libc=`ls -l /lib/libc.so.6 | awk '{print $NF}'` - libc=/lib/$libc -fi - # Configure may fail to find lstat() since it's a static/inline # function in . d_lstat=define @@ -185,6 +174,32 @@ case "$plibpth" in ;; esac +case "$libc" in +'') +# If you have glibc, then report the version for ./myconfig bug reporting. +# (Configure doesn't need to know the specific version since it just uses +# gcc to load the library for all tests.) +# We don't use __GLIBC__ and __GLIBC_MINOR__ because they +# are insufficiently precise to distinguish things like +# libc-2.0.6 and libc-2.0.7. + for p in $plibpth + do + for trylib in libc.so.6 libc.so + do + if $test -e $p/$trylib; then + libc=`ls -l $p/$trylib | awk '{print $NF}'` + if $test "X$libc" != X; then + break + fi + fi + done + if $test "X$libc" != X; then + break + fi + done + ;; +esac + # Are we using ELF? Thanks to Kenneth Albanowski # for this test. cat >try.c <<'EOM'