This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Updated perldelta for some older changes that hadn't been included yet
[perl5.git] / hints / linux.sh
index d47439c..d0ac9fa 100644 (file)
@@ -18,6 +18,9 @@
 # No version of Linux supports setuid scripts.
 d_suidsafe='undef'
 
+# No version of Linux needs libutil for perl.
+i_libutil='undef'
+
 # Debian and Red Hat, and perhaps other vendors, provide both runtime and
 # development packages for some libraries.  The runtime packages contain shared
 # libraries with version information in their names (e.g., libgdbm.so.1.7.3);
@@ -160,13 +163,22 @@ esac
 # This unconditionally uses gcc because even if the user is using another
 # compiler, we still need to find the math library and friends, and I don't
 # know how other compilers will cope with that situation.
+# Morever, if the user has their own gcc earlier in $PATH than the system gcc,
+# we don't want its libraries. So we try to prefer the system gcc
 # Still, as an escape hatch, allow Configure command line overrides to
 # plibpth to bypass this check.
+if [ -x /usr/bin/gcc ] ; then
+    gcc=/usr/bin/gcc
+else
+    gcc=gcc
+fi
+
 case "$plibpth" in
-'') plibpth=`gcc -print-search-dirs | grep libraries |
-       cut -f2- -d= | tr ':' $trnl | grep -v 'gcc'`
-    set $plibpth
-    plibpth="$@"  # Collapse all entries on one line
+'') plibpth=`$gcc -print-search-dirs | grep libraries |
+       cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'`
+    set X $plibpth # Collapse all entries on one line
+    shift
+    plibpth="$*"
     ;;
 esac