Patch for perl to compile/work on DragonFlyBSD
authorRobert Sebastian Gerus <arachnist@gmail.com>
Tue, 14 Feb 2006 17:27:52 +0000 (18:27 +0100)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Wed, 15 Feb 2006 09:07:43 +0000 (09:07 +0000)
Message-ID: <4a1e16420602140827w17fd6595w@mail.gmail.com>

p4raw-id: //depot/perl@27189

Configure
Makefile.SH
hints/dragonfly.sh [new file with mode: 0644]

index 6b9732a..d1d4f70 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -26,7 +26,7 @@
 
 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
 #
-# Generated on Sun Jan 29 11:12:44 CET 2006 [metaconfig 3.0 PL70]
+# Generated on Wed Feb 15 09:59:58 CET 2006 [metaconfig 3.0 PL70]
 # (with additional metaconfig patches by perlbug@perl.org)
 
 cat >c1$$ <<EOF
@@ -3130,18 +3130,21 @@ EOM
                domainos) osname=apollo
                        osvers="$3"
                        ;;
-               dgux)   osname=dgux 
+               dgux)   osname=dgux
+                       osvers="$3"
+                       ;;
+               dragonfly) osname=dragonfly
                        osvers="$3"
                        ;;
                dynixptx*) osname=dynixptx
                        osvers=`echo "$4"|sed 's/^v//'`
                        ;;
-               freebsd) osname=freebsd 
+               freebsd) osname=freebsd
                        osvers="$3" ;;
                genix)  osname=genix ;;
                gnu)    osname=gnu
                        osvers="$3" ;;
-               hp*)    osname=hpux 
+               hp*)    osname=hpux
                        osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
                        ;;
                irix*)  osname=irix
@@ -3237,7 +3240,7 @@ EOM
                        *freebsd*) ;;
                        svr*)
                                : svr4.x or possibly later
-                               case "svr$3" in 
+                               case "svr$3" in
                                ${osname}*)
                                        osname=svr$3
                                        osvers=$4
@@ -3300,7 +3303,7 @@ EOM
                        osvers="$5"
                fi
        fi
-       
+
         case "$targetarch" in
         '') ;;
         *)  hostarch=$osname
@@ -7892,7 +7895,7 @@ if "$useshrplib"; then
        solaris)
                xxx="-R $shrpdir"
                ;;
-       freebsd|netbsd|openbsd|interix)
+       freebsd|netbsd|openbsd|interix|dragonfly)
                xxx="-Wl,-R$shrpdir"
                ;;
        bsdos|linux|irix*|dec_osf|gnu*)
index 354fa80..e45d66c 100644 (file)
@@ -73,7 +73,7 @@ true)
        sunos*)
                linklibperl="-lperl"
                ;;
-       netbsd*|freebsd[234]*|openbsd*)
+       netbsd*|freebsd[234]*|openbsd*|dragonfly*)
                linklibperl="-L. -lperl"
                ;;
        interix*)
@@ -972,6 +972,10 @@ s_dummy $(static_ext):     miniperl$(EXE_EXT) preplibrary $(DYNALOADER) FORCE
 n_dummy $(nonxs_ext):  miniperl$(EXE_EXT) preplibrary $(DYNALOADER) FORCE
        @$(LDLIBPTH) sh ext/util/make_ext nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
 
+.PHONY: printconfig
+printconfig:
+       @eval `$(LDLIBPTH) ./perl -Ilib -V:$(CONFIGVAR)`; echo $$$(CONFIGVAR)
+
 .PHONY: clean _tidy _mopup _cleaner1 _cleaner2 \
        realclean _realcleaner clobber _clobber \
        distclean veryclean _verycleaner
diff --git a/hints/dragonfly.sh b/hints/dragonfly.sh
new file mode 100644 (file)
index 0000000..150e162
--- /dev/null
@@ -0,0 +1,114 @@
+# hints/dragonfly.sh
+#
+# This file is mostly copied from hints/freebsd.sh with the OS version
+# information taken out and only the FreeBSD-4 information intact.
+# Please check with Todd Willey <xtoddx@gmail.com> before making
+# modifications to this file. See http://www.dragonflybsd.org/main/
+
+case "$osvers" in
+*)  usevfork='true'
+    case "$usemymalloc" in
+       "") usemymalloc='n'
+           ;;
+    esac
+    libswanted=`echo $libswanted | sed 's/ malloc / /'`
+    ;;
+esac
+
+# Dynamic Loading flags have not changed much, so they are separated
+# out here to avoid duplicating them everywhere.
+case "$osvers" in
+*)  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'
+    ;;
+esac
+
+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
+       usenm=false
+    fi
+    ;;
+esac
+
+cat <<'EOM' >&4
+
+Some users have reported that Configure halts when testing for
+the O_NONBLOCK symbol with a syntax error.  This is apparently a
+sh error.  Rerunning Configure with ksh apparently fixes the
+problem.  Try
+       ksh Configure [your options]
+
+EOM
+
+# From: Anton Berezin <tobez@plab.ku.dk>
+# To: perl5-porters@perl.org
+# Subject: [PATCH 5.005_54] Configure - hints/freebsd.sh signal handler type
+# Date: 30 Nov 1998 19:46:24 +0100
+# Message-ID: <864srhhvcv.fsf@lion.plab.ku.dk>
+
+signal_t='void'
+d_voidsig='define'
+
+# This script UU/usethreads.cbu will get 'called-back' by Configure
+# after it has prompted the user for whether to use threads.
+cat > UU/usethreads.cbu <<'EOCBU'
+case "$usethreads" in
+$define|true|[yY]*)
+    lc_r=`/sbin/ldconfig -r|grep ':-lc_r'|awk '{print $NF}'|sed -n '$p'`
+    case "$osvers" in
+    *)  if [ ! -r "$lc_r" ]; then
+           cat <<EOM >&4
+POSIX threads should be supported by FreeBSD $osvers --
+but your system is missing the shared libc_r.
+(/sbin/ldconfig -r doesn't find any).
+
+Consider using the latest STABLE release.
+EOM
+           exit 1
+       fi
+       case "$osvers" in
+           *)  ldflags="-pthread $ldflags"
+               ;;
+       esac
+       # Both in 4.x and 5.x gethostbyaddr_r exists but
+       # it is "Temporary function, not threadsafe"...
+       # Presumably earlier it didn't even exist.
+       d_gethostbyaddr_r="undef"
+       d_gethostbyaddr_r_proto="0"
+       ;;
+    esac
+
+    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
+
+    unset lc_r
+
+    # Even with the malloc mutexes the Perl malloc does not
+    # seem to be threadsafe in FreeBSD?
+    case "$usemymalloc" in
+    '')  usemymalloc=n ;;
+    esac
+esac
+EOCBU
+
+# malloc wrap works
+case "$usemallocwrap" in
+'') usemallocwrap='define' ;;
+esac