Fix #if/#else bug introduced with MACOS_TRADITIONAL patches in change 9479.
[p5sagit/p5-mst-13.2.git] / hints / freebsd.sh
index 7461207..7d543be 100644 (file)
@@ -138,22 +138,11 @@ case "$osvers" in
 *)
        ccflags="${ccflags} -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H"
        if /usr/bin/file -L /usr/lib/libc.so | /usr/bin/grep -vq "not stripped" ; then
-           # Respect a command-line override
-           test -z "$usenm" && usenm=false
+           usenm=false
        fi
         ;;
 esac
 
-
-# If we are using g++ we must use nm and force ourselves to use
-# the /usr/lib/libc.a because the symbol scanning tricks of 
-# Configure will crash and burn horribly.
-case "$cc" in
-*g++*) usenm=true
-       libc='/usr/lib/libc.a'
-       ;;
-esac
-
 cat <<'EOM' >&4
 
 Some users have reported that Configure halts when testing for
@@ -222,7 +211,7 @@ EOM
              exit 1
              ;;
 
-       *)
+       [3-5].*)
              if [ ! -r "$lc_r" ]; then
              cat <<EOM >&4
 POSIX threads should be supported by FreeBSD $osvers --
@@ -254,6 +243,14 @@ EOM
              d_gethostbyaddr_r_proto="0"
              ;;
 
+       *)
+             # 7.x doesn't install libc_r by default, and Configure
+             # would fail in the code following
+             #
+             # gethostbyaddr_r() appears to have been implemented in 6.x+
+             ldflags="-pthread $ldflags"
+             ;;
+
        esac
 
         case "$osvers" in
@@ -295,3 +292,12 @@ EOCBU
 case "$usemallocwrap" in
 '') usemallocwrap='define' ;;
 esac
+
+# XXX Under FreeBSD 6.0 (and probably most other similar versions)
+# Perl_die(NULL) generates a warning:
+#    pp_sys.c:491: warning: null format string
+# Configure supposedely tests for this, but apparently the test doesn't
+# work.  Volunteers with FreeBSD are needed to improving the Configure test.
+# Meanwhile, the following workaround should be safe on all versions
+# of FreeBSD.
+d_printf_format_null='undef'