This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
dynixptx updates for osvers='4.5.2'
[perl5.git] / hints / aix.sh
index a85c213..10d5d64 100644 (file)
@@ -54,12 +54,20 @@ esac
 # AIX 4.3.* and above default to using nm for symbol extraction
 case "$osvers" in
    3.*|4.1.*|4.2.*)
-      usenm='undef'
-      usenativedlopen='false'
+      case "$usenm" in
+         '') usenm='undef'
+         esac
+      case "$usenativedlopen" in
+         '') usenativedlopen='false'
+         esac
       ;;
    *)
-      usenm='true'
-      usenativedlopen='true'
+      case "$usenm" in
+         '') usenm='true'
+         esac
+      case "$usenativedlopen" in
+         '') usenativedlopen='true'
+         esac
       ;;
 esac
 
@@ -249,11 +257,11 @@ EOM
        lddlflags="$*"
 
        # Insert pthreads to libswanted, before any libc or libC.
-       set `echo X "$libswanted "| sed -e 's/ \([cC]\) / pthreads \1 /'`
+       set `echo X "$libswanted "| sed -e 's/ \([cC]_r\) / pthreads \1 /'`
        shift
        libswanted="$*"
        # Insert pthreads to lddlflags, before any libc or libC.
-       set `echo X "$lddlflags " | sed -e 's/ \(-l[cC]\) / -lpthreads \1 /'`
+       set `echo X "$lddlflags " | sed -e 's/ \(-l[cC]_r\) / -lpthreads \1 /'`
        shift
        lddlflags="$*"
 
@@ -461,8 +469,11 @@ EOCBU
 
 if test $usenativedlopen = 'true'
 then
-        ccflags="$ccflags -DUSE_NATIVE_DLOPEN"
-       ldflags="$ldflags -brtl"
+    ccflags="$ccflags -DUSE_NATIVE_DLOPEN"
+    case "$cc" in
+      *gcc*) ldflags="$ldflags -Wl,-brtl" ;;
+      *)     ldflags="$ldflags -brtl" ;;
+      esac
 else
     # If the C++ libraries, libC and libC_r, are available we will prefer them
     # over the vanilla libc, because the libC contain loadAndInit() and