diff options
author | Brian Fraser <fraserbn@gmail.com> | 2014-01-22 19:33:51 -0300 |
---|---|---|
committer | Brian Fraser <fraserbn@gmail.com> | 2014-01-26 14:44:18 -0300 |
commit | 3b23fcb13d39c0c5249be5a0a886edeacfc914f2 (patch) | |
tree | 7b6ae04c1e79fa5f7eb0066be7a95db0e8dca366 /hints/linux.sh | |
parent | 70e1ff592acb463186885eb4d6d3de4fb9a1be6f (diff) | |
download | perl-3b23fcb13d39c0c5249be5a0a886edeacfc914f2.tar.gz |
Linux hints: Improve the code that looks for libc.so
Diffstat (limited to 'hints/linux.sh')
-rw-r--r-- | hints/linux.sh | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/hints/linux.sh b/hints/linux.sh index 5f92bbae1f..4c2c5f57a8 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 <sys/stat.h>. 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 <kjahds@kjahds.com> # for this test. cat >try.c <<'EOM' |