Better NetInfo behaviour.
[p5sagit/p5-mst-13.2.git] / hints / freebsd.sh
index f1bbd60..0dbe323 100644 (file)
 # Andy Dougherty <doughera@lafcol.lafayette.edu>
 # Date: Tue Mar 10 16:07:00 EST 1998
 #
+# Support for FreeBSD/ELF
+# Ollivier Robert <roberto@keltia.freenix.fr>
+# Date: Wed Sep  2 16:22:12 CEST 1998
+#
 # The two flags "-fpic -DPIC" are used to indicate a
 # will-be-shared object.  Configure will guess the -fpic, (and the
 # -DPIC is not used by perl proper) but the full define is included to 
@@ -94,6 +98,23 @@ esac
 # out here to avoid duplicating them everywhere.
 case "$osvers" in
 0.*|1.0*) ;;
+
+3.0*)   objformat=`/usr/bin/objformat`
+        if [ x$objformat = xelf ]; then
+            libpth="/usr/lib /usr/local/lib"
+            glibpth="/usr/lib /usr/local/lib"
+            ldflags="-Wl,-E "
+            lddlflags="-shared "
+        else
+            if [ -e /usr/lib/aout ]; then
+                libpth="/usr/lib/aout /usr/local/lib /usr/lib"
+                glibpth="/usr/lib/aout /usr/local/lib /usr/lib"
+            fi
+            lddlflags='-Bshareable'
+        fi
+        cccdlflags='-DPIC -fpic'
+        ;;
+
 *)     cccdlflags='-DPIC -fpic'
        lddlflags="-Bshareable $lddlflags"
        ;;
@@ -115,31 +136,30 @@ EOM
 cat > UU/usethreads.cbu <<'EOSH'
 case "$usethreads" in
 $define)
-    if [ ! -r /usr/lib/libc_r.a ]; then
-        cat <<'EOM' >&4
-
-The re-entrant C library /usr/lib/libc_r.a does not exist; cannot build
-threaded Perl.  Consider upgrading to a newer FreeBSD snapshot or release:
-at least the FreeBSD 3.0-971225-SNAP is known to have the libc_r.a.
-
+    case "$osvers" in  
+        3.0*) ldflags="-pthread $ldflags"
+              ;;
+        2.2*) if [ ! -r /usr/lib/libc_r ]; then
+                cat <<'EOM' >&4
+POSIX threads are not supported by default on FreeBSD $uname_r.  Follow the
+instructions in 'man pthread' to build and install the needed libraries.
 EOM
-        exit 1
-    fi
-    # Patches to libc_r may be required.
-    # Print out a note about them here.
-
-    # These checks by Andy Dougherty <doughera@lafcol.lafayette.edu>
-    # Please update or change them as you learn more!
-    # -lc_r must REPLACE -lc.  AD  03/10/1998
-    set `echo X "$libswanted "| sed -e 's/ c / c_r /'`
-    shift
-    libswanted="$*"
-    # Configure will probably pick the wrong libc to use for nm scan.
-    # The safest quick-fix is just to not use nm at all.
-    usenm=false
-    # Is vfork buggy in 3.0?
-    case "$osvers" in
-       3.0) usevfork=false ;;
+                 exit 1
+              fi
+              set `echo X "$libswanted "| sed -e 's/ c / c_r /'`
+              shift
+              libswanted="$*"
+              # Configure will probably pick the wrong libc to use for nm
+              # scan.
+              # The safest quick-fix is just to not use nm at all.
+              usenm=false
+              ;;
+         *)   cat <<'EOM' >&4
+It is not known if FreeBSD $uname_r supports POSIX threads or not.  Consider
+upgrading to the latest STABLE release.
+EOM
+              exit 1
+              ;;
     esac
     ;;
 esac