This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
A little better comments.
[perl5.git] / Configure
index 540d90c..c69d35a 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -20,7 +20,7 @@
 
 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
 #
-# Generated on Mon Dec 10 05:02:24 EET 2001 [metaconfig 3.0 PL70]
+# Generated on Sun Dec 30 19:31:52 EET 2001 [metaconfig 3.0 PL70]
 # (with additional metaconfig patches by perlbug@perl.org)
 
 cat >c1$$ <<EOF
@@ -81,6 +81,7 @@ paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
 paths="$paths /sbin /usr/sbin /usr/libexec"
+paths="$paths /system/gnu_library/bin"
 
 for p in $paths
 do
@@ -164,6 +165,7 @@ esac
 test -d UU || mkdir UU
 cd UU && rm -f ./*
 
+
 ccname=''
 ccversion=''
 ccsymbols=''
@@ -210,6 +212,7 @@ emacs=''
 expr=''
 find=''
 flex=''
+gmake=''
 grep=''
 gzip=''
 inews=''
@@ -1033,6 +1036,10 @@ if test -f /etc/unixtovms.exe; then
        eunicefix=/etc/unixtovms.exe
 fi
 
+if test -f "/system/gnu_library/bin/ar.pm"; then
+     _exe=".pm"
+fi
+
 i_whoami=''
 ccname=''
 ccversion=''
@@ -1042,7 +1049,6 @@ useposix=true
 : set useopcode=false in your hint file to disable the Opcode extension.
 useopcode=true
 : Trailing extension.  Override this in a hint file, if needed.
-_exe=''
 : Extra object files, if any, needed on this platform.
 archobjs=''
 archname=''
@@ -1122,6 +1128,9 @@ case "$sh" in
                        if test -f "$xxx"; then
                                sh="$xxx";
                                break
+                       elif test "X$_exe" != X -a -f "$xxx$_exe"; then
+                               sh="$xxx";
+                               break
                        elif test -f "$xxx.exe"; then
                                sh="$xxx";
                                break
@@ -1148,7 +1157,19 @@ if `$sh -c '#' >/dev/null 2>&1`; then
        shsharp=true
        spitshell=cat
        xcat=/bin/cat
-       test -f $xcat || xcat=/usr/bin/cat
+       test -f $xcat$_exe || xcat=/usr/bin/cat
+       if test ! -f $xcat$_exe; then
+               for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
+                       if test -f $p/cat$_exe; then
+                               xcat=$p/cat
+                               break
+                       fi
+               done
+               if test ! -f $xcat$_exe; then
+                       echo "Can't find cat anywhere!"
+                       exit 1
+               fi
+       fi
        echo "#!$xcat" >sharp
        $eunicefix sharp
        chmod +x sharp
@@ -2011,6 +2032,9 @@ for dir in \$*; do
        if test -f \$thisthing; then
                echo \$thisthing
                exit 0
+       elif test "X$_exe" != X -a -f \$thisthing$_exe; then
+               echo \$thisthing
+               exit 0
        elif test -f \$dir/\$thing.exe; then
                if test -n "$DJGPP"; then
                        echo \$dir/\$thing.exe
@@ -2038,7 +2062,6 @@ echo
 expr
 grep
 ls
-make
 mkdir
 rm
 sed
@@ -2056,9 +2079,11 @@ cpp
 csh
 date
 egrep
+gmake
 gzip
 less
 ln
+make
 more
 nm
 nroff
@@ -2083,7 +2108,7 @@ for file in $loclist; do
        '') xxx=`./loc $file $file $pth`;;
        *) xxx=`./loc $xxx $xxx $pth`;;
        esac
-       eval $file=$xxx
+       eval $file=$xxx$_exe
        eval _$file=$xxx
        case "$xxx" in
        /*)
@@ -2135,12 +2160,37 @@ case "$egrep" in
 egrep)
        echo "Substituting grep for egrep."
        egrep=$grep
+       _egrep=$grep
        ;;
 esac
 case "$ln" in
 ln)
        echo "Substituting cp for ln."
        ln=$cp
+       _ln=$cp
+       ;;
+esac
+case "$make" in
+make)  
+       case "$gmake" in
+       gmake)
+       echo "I can't find make or gmake, and my life depends on it." >&4
+       echo "Go find a public domain implementation or fix your PATH setting!" >&4
+       exit 1
+       ;;
+       esac
+       ;;
+esac   
+case "$gmake" in
+gmake) ;;
+*)     # We can't have osname yet.
+       if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
+               # Assume that gmake, if found, is definitely GNU make
+               # and prefer it over the system make.
+               echo "Substituting gmake for make."
+               make=$gmake
+               _make=$gmake
+       fi
        ;;
 esac
 case "$test" in
@@ -2290,7 +2340,7 @@ case "$lns" in
                                echo "Trying external '$test -h'." >&4
                                issymlink="$test -h"
                                if $test ! -h sym >/dev/null 2>&1; then
-                                       echo "External '$test -h' is broken, too." >& 4
+                                       echo "External '$test -h' is broken, too." >&4
                                        issymlink=''
                                fi
                                ;;
@@ -2762,6 +2812,7 @@ EOM
        $test -d /usr/apollo/bin && osname=apollo
        $test -f /etc/saf/_sactab && osname=svr4
        $test -d /usr/include/minix && osname=minix
+       $test -f /system/gnu_library/bin/ar.pm && osname=vos
        if $test -d /MachTen -o -d /MachTen_Folder; then
                osname=machten
                if $test -x /sbin/version; then
@@ -2934,9 +2985,11 @@ EOM
                unixware) osname=svr5
                        osvers="$4"
                        ;;
-               uts) osname=uts
+               uts)    osname=uts
                        osvers="$3"
                        ;;
+               vos) osvers="$3"
+                       ;;
                $2) case "$osname" in
                        *isc*) ;;
                        *freebsd*) ;;
@@ -4109,7 +4162,7 @@ so="$ans"
 : or the new name.
 case "$_exe" in
 '')    case "$exe_ext" in
-    '')        ;;
+       '')     ;;
        *)      _exe="$exe_ext" ;;
        esac
        ;;
@@ -4823,6 +4876,10 @@ $rm -f try.* try
 : determine filename position in cpp output
 echo " "
 echo "Computing filename position in cpp output for #include directives..." >&4
+case "$osname" in
+vos) testaccess=-e ;;
+*)   testaccess=-r ;;
+esac
 echo '#include <stdio.h>' > foo.c
 $cat >fieldn <<EOF
 $startsh
@@ -4832,7 +4889,7 @@ while read cline; do
        pos=1
        set \$cline
        while $test \$# -gt 0; do
-               if $test -r \`echo \$1 | $tr -d '"'\`; then
+               if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
                        echo "\$pos"
                        exit 0
                fi
@@ -4853,6 +4910,10 @@ case $fieldn in
 esac
 echo "Your cpp writes the filename in the $pos field of the line."
 
+case "$osname" in
+vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
+*)   cppfilter='' ;;
+esac
 : locate header file
 $cat >findhdr <<EOF
 $startsh
@@ -4868,7 +4929,7 @@ done
 awkprg='{ print \$$fieldn }'
 echo "#include <\$wanted>" > foo\$\$.c
 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
-$grep "^[      ]*#.*\$wanted" | \
+$cppfilter $grep "^[   ]*#.*\$wanted" | \
 while read cline; do
        name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
        case "\$name" in
@@ -6364,7 +6425,7 @@ val="$undef"
 case "$d_suidsafe" in
 "$define")
        val="$undef"
-       echo "No need to emulate SUID scripts since they are secure here." >& 4
+       echo "No need to emulate SUID scripts since they are secure here." >&4
        ;;
 *)
        $cat <<EOM
@@ -7668,7 +7729,7 @@ case "$man3dir" in
 esac
 
 : see if we have to deal with yellow pages, now NIS.
-if $test -d /usr/etc/yp || $test -d /etc/yp; then
+if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
        if $test -f /usr/etc/nibindd; then
                echo " "
                echo "I'm fairly confident you're on a NeXT."
@@ -8037,7 +8098,10 @@ echo "I'll use $startperl to start perl scripts."
 : figure best path for perl in scripts
 case "$perlpath" in
 '')
-       perlpath="$binexp/perl"
+       case "$versiononly" in
+       "$define")      perlpath="$binexp/perl$version";;
+       *)              perlpath="$binexp/perl";;
+       esac
        case "$startperl" in
        *!*) ;;
        *)
@@ -9230,7 +9294,7 @@ else
                                                        sockethdr="-I/usr/netinclude"
                                                        ;;
                                                esac
-                                               echo "Found Berkeley sockets interface in lib$net." >& 
+                                               echo "Found Berkeley sockets interface in lib$net." >&4 
                                                if $contains setsockopt libc.list >/dev/null 2>&1; then
                                                        d_oldsock="$undef"
                                                else
@@ -9256,7 +9320,7 @@ eval $inlibc
 
 
 echo " "
-echo "Checking the availability of certain socket constants..." >& 4
+echo "Checking the availability of certain socket constants..." >&4
 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
        enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
        $cat >try.c <<EOF
@@ -9312,36 +9376,42 @@ eval $setvar
 
 : see if crypt exists
 echo " "
-if set crypt val -f d_crypt; eval $csym; $val; then
-       echo 'crypt() found.' >&4
-       val="$define"
-       cryptlib=''
-else
-       cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
-       if $test -z "$cryptlib"; then
-               cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
-       else
-               cryptlib=-lcrypt
-       fi
-       if $test -z "$cryptlib"; then
-               cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
-       else
-               cryptlib=-lcrypt
-       fi
-       if $test -z "$cryptlib"; then
-               cryptlib=`./loc libcrypt$_a "" $libpth`
-       else
-               cryptlib=-lcrypt
-       fi
-       if $test -z "$cryptlib"; then
-               echo 'crypt() NOT found.' >&4
-               val="$undef"
-       else
+set crypt d_crypt
+eval $inlibc
+case "$d_crypt" in
+$define) cryptlib='' ;;
+*)     if set crypt val -f d_crypt; eval $csym; $val; then
+               echo 'crypt() found.' >&4
                val="$define"
+               cryptlib=''
+       else
+               cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
+               if $test -z "$cryptlib"; then
+                       cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
+               else
+                       cryptlib=-lcrypt
+               fi
+               if $test -z "$cryptlib"; then
+                       cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
+               else
+                       cryptlib=-lcrypt
+               fi
+               if $test -z "$cryptlib"; then
+                       cryptlib=`./loc libcrypt$_a "" $libpth`
+               else
+                       cryptlib=-lcrypt
+               fi
+               if $test -z "$cryptlib"; then
+                       echo 'crypt() NOT found.' >&4
+                       val="$undef"
+               else
+                       val="$define"
+               fi
        fi
-fi
-set d_crypt
-eval $setvar
+       set d_crypt
+       eval $setvar
+       ;;
+esac
 
 : get csh whereabouts
 case "$csh" in
@@ -9689,7 +9759,7 @@ EOM
        ;;
 esac
                
-$rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
+$rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
 
 set d_dlsymun
 eval $setvar
@@ -9803,6 +9873,59 @@ case "$i_string" in
 *)       strings=`./findhdr string.h`;;
 esac
 
+: see if this is a sys/file.h system
+val=''
+set sys/file.h val
+eval $inhdr
+
+: do we need to include sys/file.h ?
+case "$val" in
+"$define")
+       echo " "
+       if $h_sysfile; then
+               val="$define"
+               echo "We'll be including <sys/file.h>." >&4
+       else
+               val="$undef"
+               echo "We won't be including <sys/file.h>." >&4
+       fi
+       ;;
+*)
+       h_sysfile=false
+       ;;
+esac
+set i_sysfile
+eval $setvar
+
+: see if fcntl.h is there
+val=''
+set fcntl.h val
+eval $inhdr
+
+: see if we can include fcntl.h
+case "$val" in
+"$define")
+       echo " "
+       if $h_fcntl; then
+               val="$define"
+               echo "We'll be including <fcntl.h>." >&4
+       else
+               val="$undef"
+               if $h_sysfile; then
+       echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
+               else
+                       echo "We won't be including <fcntl.h>." >&4
+               fi
+       fi
+       ;;
+*)
+       h_fcntl=false
+       val="$undef"
+       ;;
+esac
+set i_fcntl
+eval $setvar
+
 : check for non-blocking I/O stuff
 case "$h_sysfile" in
 true) echo "#include <sys/file.h>" > head.c;;
@@ -9818,9 +9941,13 @@ echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
 case "$o_nonblock" in
 '')
        $cat head.c > try.c
-       $cat >>try.c <<'EOCP'
+       $cat >>try.c <<EOCP
 #include <stdio.h>
 #include <stdlib.h>
+#$i_fcntl I_FCNTL
+#ifdef I_FCNTL
+#include <fcntl.h>
+#endif
 int main() {
 #ifdef O_NONBLOCK
        printf("O_NONBLOCK\n");
@@ -9863,6 +9990,10 @@ case "$eagain" in
 #include <signal.h>
 #include <stdio.h> 
 #include <stdlib.h> 
+#$i_fcntl I_FCNTL
+#ifdef I_FCNTL
+#include <fcntl.h>
+#endif
 #define MY_O_NONBLOCK $o_nonblock
 #ifndef errno  /* XXX need better Configure test */
 extern int errno;
@@ -9923,7 +10054,7 @@ int main()
                ret = read(pd[0], buf, 1);      /* Should read EOF */
                alarm(0);
                sprintf(string, "%d\n", ret);
-               write(3, string, strlen(string));
+               write(4, string, strlen(string));
                exit(0);
        }
 
@@ -9937,7 +10068,7 @@ EOCP
        set try
        if eval $compile_ok; then
                echo "$startsh" >mtry
-               echo "$run ./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
+               echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
                chmod +x mtry
                ./mtry >/dev/null 2>&1
                case $? in
@@ -10257,30 +10388,6 @@ eval $inlibc
 set flock d_flock
 eval $inlibc
 
-: see if this is a sys/file.h system
-val=''
-set sys/file.h val
-eval $inhdr
-
-: do we need to include sys/file.h ?
-case "$val" in
-"$define")
-       echo " "
-       if $h_sysfile; then
-               val="$define"
-               echo "We'll be including <sys/file.h>." >&4
-       else
-               val="$undef"
-               echo "We won't be including <sys/file.h>." >&4
-       fi
-       ;;
-*)
-       h_sysfile=false
-       ;;
-esac
-set i_sysfile
-eval $setvar
-
 : see if prototype for flock is available
 echo " "
 set d_flockproto flock $i_sysfile sys/file.h
@@ -13370,7 +13477,12 @@ EOM
 $cat >try.c <<EOCP
 #include <stdio.h>
 #define U32 $u32type
-#define BYTEORDER $byteorder
+#define BYTEORDER 0x$byteorder
+#define U8 $u8type
+#include <signal.h>
+#ifdef SIGBUS
+$signal_t bletch(s) int s; { exit(4); }
+#endif
 int main() {
 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
     U8 buf[] = "\0\0\0\1\0\0\0\0";
@@ -13384,6 +13496,10 @@ int main() {
 
     fflush(stdout);
 
+#ifdef SIGBUS
+    signal(SIGBUS, bletch);
+#endif
+
     for (i = 0; i < 4; i++) {
        up = (U32*)(buf + i);
        if (! ((*up == 1 << (8*i)) ||   /* big-endian */
@@ -13416,7 +13532,7 @@ int main() {
 EOCP
 set try
 if eval $compile_ok; then
-       echo "(Testing for character data alignment may dump core.)" >&4
+       echo "(Testing for character data alignment may crash the test.  That's okay.)" >&4
        $run ./try 2>&1 >/dev/null
        case "$?" in
        0)      cat >&4 <<EOM
@@ -13430,7 +13546,6 @@ EOM
                d_u32align="$define"
                ;;
        esac
-       $rm -f core core.try.* try.core
 else
        rp='Can you access character data at unaligned addresses?'
        dflt='n'
@@ -13440,6 +13555,7 @@ else
        *)      d_u32align="$define" ;;
        esac
 fi
+$rm -f core core.try.* try.core
 
 : see if ualarm exists
 set ualarm d_ualarm
@@ -14623,7 +14739,7 @@ else
 fi
 
 case "$ivdformat" in
-'') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
+'') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
     exit 1
     ;;
 esac
@@ -15869,11 +15985,11 @@ case "$yacc" in
 esac
 echo " "
 comp='yacc'
-if $test -f "$byacc"; then
+if $test -f "$byacc$_exe"; then
        dflt="$byacc"
        comp="byacc or $comp"
 fi
-if $test -f "$bison"; then
+if $test -f "$bison$_exe"; then
        comp="$comp or bison -y"
 fi
 rp="Which compiler compiler ($comp) shall I use?"
@@ -15891,35 +16007,6 @@ case "$yacc" in
        ;;
 esac
 
-: see if fcntl.h is there
-val=''
-set fcntl.h val
-eval $inhdr
-
-: see if we can include fcntl.h
-case "$val" in
-"$define")
-       echo " "
-       if $h_fcntl; then
-               val="$define"
-               echo "We'll be including <fcntl.h>." >&4
-       else
-               val="$undef"
-               if $h_sysfile; then
-       echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
-               else
-                       echo "We won't be including <fcntl.h>." >&4
-               fi
-       fi
-       ;;
-*)
-       h_fcntl=false
-       val="$undef"
-       ;;
-esac
-set i_fcntl
-eval $setvar
-
 : see if this is a fp.h system
 set fp.h i_fp
 eval $inhdr
@@ -16520,7 +16607,12 @@ for xxx in $known_extensions ; do
                ;;
        Socket|socket)
                case "$d_socket" in 
-               true|$define|y) avail_ext="$avail_ext $xxx" ;;
+               true|$define|y)
+                   case "$osname" in
+                   beos) ;; # not unless BONE
+                   *) avail_ext="$avail_ext $xxx" ;;
+                   esac
+                   ;;
                esac
                ;;
        Sys/Syslog|sys/syslog)
@@ -17237,6 +17329,7 @@ gidsign='$gidsign'
 gidsize='$gidsize'
 gidtype='$gidtype'
 glibpth='$glibpth'
+gmake='$gmake'
 grep='$grep'
 groupcat='$groupcat'
 groupstype='$groupstype'