warn on C<my($foo,$foo)>
[p5sagit/p5-mst-13.2.git] / Configure
index 938b4fb..9a11052 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -71,6 +71,9 @@ if test X"$trnl" = X; then
                ;;
        esac
 fi
+if test -n "$DJGPP"; then
+       trnl='\012'
+fi
 if test X"$trnl" = X; then
        cat <<EOM >&2
 
@@ -388,7 +391,7 @@ d_getservprotos=''
 d_getsbyname=''
 d_getsbyport=''
 d_gnulibc=''
-i_arpa_inet=''
+i_arpainet=''
 d_htonl=''
 d_inetaton=''
 d_isascii=''
@@ -758,7 +761,7 @@ al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
 al="$al VMS Xenix286"
-al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI"
+al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI _POWER"
 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
@@ -1476,7 +1479,7 @@ while expr "X\$ans" : "X!" >/dev/null; do
                y)
                        echo "*** Substitution done -- please confirm."
                        xxxm="\$ans"
-                       ans=\`echo $n "\$ans$c" | tr $trnl ' '\`
+                       ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
                        xxxm="\$ans"
                        ans=!
                        ;;
@@ -1820,14 +1823,14 @@ ABYZ)
 *)     # There is a discontinuity in EBCDIC between 'I' and 'J'
         # (0xc9 and 0xd1), therefore that is a nice testing point.
         if test "X$up" = X -o "X$low" = X; then
-           case "`echo IJ | tr '[I-J]' '[i-j]' 2>/dev/null`" in
+           case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
            ij) up='[A-Z]'
                low='[a-z]'
                ;;
            esac
         fi
        if test "X$up" = X -o "X$low" = X; then
-           case "`echo IJ | tr I-J i-j 2>/dev/null`" in
+           case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
            ij) up='A-Z'
                low='a-z'
                ;;
@@ -1855,7 +1858,7 @@ ABYZ)
            esac
        fi
 esac
-case "`echo IJ | tr \"$up\" \"$low\" 2>/dev/null`" in
+case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
 ij)
     echo "Using $up and $low to convert case." >&4
     ;;
@@ -1884,7 +1887,7 @@ myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
 # because the A-Z/a-z are not consecutive.
 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
-       ./tr '[A-Z]' '[a-z]' | tr $trnl ' '`
+       ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
 newmyuname="$myuname"
 dflt=n
 case "$knowitall" in
@@ -1953,7 +1956,7 @@ EOM
        $test -d /usr/apollo/bin && osname=apollo
        $test -f /etc/saf/_sactab && osname=svr4
        $test -d /usr/include/minix && osname=minix
-       if $test -d /MachTen; then
+       if $test -d /MachTen -o -d /MachTen_Folder; then
                osname=machten
                if $test -x /sbin/version; then
                        osvers=`/sbin/version | $awk '{print $2}' |
@@ -1965,6 +1968,12 @@ EOM
                        osvers="$2.$3"
                fi
        fi
+       $test -f /sys/posix.dll &&
+               $test -f /usr/bin/what &&
+               set X `/usr/bin/what /sys/posix.dll` &&
+               $test "$3" = UWIN &&
+               osname=uwin &&
+               osvers="$5"
        if $test -f $uname; then
                set X $myuname
                shift
@@ -3977,7 +3986,7 @@ rmlist="$rmlist pdp11"
 : coherency check
 echo " "
 echo "Checking your choice of C compiler and flags for coherency..." >&4
-set X $cc $optimize $ccflags $ldflags -o try try.c $libs
+set X $cc $optimize $ccflags -o try $ldflags try.c $libs
 shift
 $cat >try.msg <<EOM
 I've tried to compile and run a simple program with:
@@ -4313,16 +4322,20 @@ int main()
   return 1;
 }
 EOM
-$cc $ccflags $ldflags -o tebcdic tebcdic.c $libs >/dev/null 2>&1
-if ./tebcdic; then
-  echo "You have EBCDIC.  Adding -DEBCDIC to ccflags." >&4
-  ccflags="$ccflags -DEBCDIC"
-  val="$define"
+val=$undef
+set tebcdic
+if eval $compile_ok; then
+       if ./tebcdic; then
+               echo "You have EBCDIC." >&4
+               val="$define"
+       else
+               echo "Nope, no EBCDIC.  Assuming ASCII or some ISO Latin." >&4
+       fi
 else
-  echo "Nope, no EBCDIC.  Assuming ASCII or some ISO Latin." >&4
-  val="$undef"
+       echo "I'm unable to compile the test program." >&4
+       echo "I'll asuume ASCII or some ISO Latin." >&4
 fi
-rm -f tebcdic.c tebcdic
+$rm -f tebcdic.c tebcdic
 set ebcdic
 eval $setvar
 
@@ -6858,7 +6871,7 @@ EOM
        if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 && 
                mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 && 
                $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 && 
-               $cc $ccflags $ldflags $cccdlflags $ccdlflags -o fred fred.c $libs > /dev/null 2>&1; then
+               $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
                xxx=`./fred`
                case $xxx in
                1)      echo "Test program failed using dlopen." >&4
@@ -7299,7 +7312,7 @@ set netinet/in.h i_niin sys/in.h i_sysin
 eval $inhdr
 
 : see if this is an arpa/inet.h
-set arpa/inet.h i_arpa_inet
+set arpa/inet.h i_arpainet
 eval $inhdr
 
 : see if htonl --and friends-- exists
@@ -7624,6 +7637,25 @@ echo " "
 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
 *"$undef"*) h_msg=false;;
 esac
+case "$osname" in
+freebsd)
+    case "`ipcs 2>&1`" in
+    "SVID messages"*"not configured"*)
+       echo "But your FreeBSD kernel does not have the msg*(2) configured." >&4
+        h_msg=false
+       val="$undef"
+       set msgctl d_msgctl
+       eval $setvar
+       set msgget d_msgget
+       eval $setvar
+       set msgsnd d_msgsnd
+       eval $setvar
+       set msgrcv d_msgrcv
+       eval $setvar
+       ;;
+    esac
+    ;;
+esac
 : we could also check for sys/ipc.h ...
 if $h_msg && $test `./findhdr sys/msg.h`; then
        echo "You have the full msg*(2) library." >&4
@@ -8106,6 +8138,23 @@ echo " "
 case "$d_semctl$d_semget$d_semop" in
 *"$undef"*) h_sem=false;;
 esac
+case "$osname" in
+freebsd)
+    case "`ipcs 2>&1`" in
+    "SVID messages"*"not configured"*)
+       echo "But your FreeBSD kernel does not have the sem*(2) configured." >&4
+        h_sem=false
+       val="$undef"
+       set semctl d_semctl
+       eval $setvar
+       set semget d_semget
+       eval $setvar
+       set semop d_semop
+       eval $setvar
+       ;;
+    esac
+    ;;
+esac
 : we could also check for sys/ipc.h ...
 if $h_sem && $test `./findhdr sys/sem.h`; then
        echo "You have the full sem*(2) library." >&4
@@ -8452,6 +8501,25 @@ echo " "
 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
 *"$undef"*) h_shm=false;;
 esac
+case "$osname" in
+freebsd)
+    case "`ipcs 2>&1`" in
+    "SVID shared memory"*"not configured"*)
+       echo "But your FreeBSD kernel does not have the shm*(2) configured." >&4
+        h_shm=false
+       val="$undef"
+       set shmctl d_shmctl
+       evat $setvar
+       set shmget d_shmget
+       evat $setvar
+       set shmat d_shmat
+       evat $setvar
+       set shmdt d_shmdt
+       evat $setvar
+       ;;
+    esac
+    ;;
+esac
 : we could also check for sys/ipc.h ...
 if $h_shm && $test `./findhdr sys/shm.h`; then
        echo "You have the full shm*(2) library." >&4
@@ -11133,8 +11201,8 @@ for xxx in $known_extensions ; do
                esac
                ;;
        IPC/SysV|ipc/sysv)
-               case "$d_sem" in 
-               $define) avail_ext="$avail_ext $xxx" ;;
+               case "${d_msg}${d_sem}${d_shm}" in 
+               *"${define}"*) avail_ext="$avail_ext $xxx" ;;
                esac
                ;;
        *)      avail_ext="$avail_ext $xxx"
@@ -11658,7 +11726,7 @@ h_sysfile='$h_sysfile'
 hint='$hint'
 hostcat='$hostcat'
 huge='$huge'
-i_arpa_inet='$i_arpa_inet'
+i_arpainet='$i_arpainet'
 i_bsdioctl='$i_bsdioctl'
 i_db='$i_db'
 i_dbm='$i_dbm'
@@ -11963,23 +12031,46 @@ esac
 
 case "$ebcdic" in
 $define)
-    if test -d ebcdic; then
-        echo "This is an EBCDIC system, moving the right parser files in place." >&4
-        # Try to save the ASCII versions, just in case.
-        test -f perly.c.ascii || mv perly.c perly.c.ascii
-        test -f perly.h.ascii || mv perly.h perly.h.ascii
-
-        cp -pf ebcdic/perly.c perly.c
-        cp -pf ebcdic/perly.h perly.h
-
-        test -f x2p/a2p.c.ascii || mv x2p/a2p.c x2p/a2p.c.ascii
-
-        cp -pf ebcdic/a2p.c x2p/a2p.c
+    xxx=''
+    echo "This is an EBCDIC system, checking if any parser files need regenerating." >&4
+    rm -f y.tab.c y.tab.h
+    yacc -d perly.y >/dev/null 2>&1
+    if cmp -s y.tab.c perly.c; then
+        rm -f y.tab.c
     else
-        echo "This is an EBCDIC system but there's no ebcdic directory." >&4
-        echo "This will not do." >&4
-        exit 1
+        echo "perly.y -> perly.c" >&4
+        mv -f y.tab.c perly.c
+        chmod u+w perly.c
+        sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
+            -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
+        xxx="$xxx perly.c"
     fi
+    if cmp -s y.tab.h perly.h; then
+        rm -f y.tab.h
+    else
+        echo "perly.y -> perly.h" >&4
+        mv -f y.tab.h perly.h
+        xxx="$xxx perly.h"
+    fi
+    echo "x2p/a2p.y" >&4
+    cd x2p
+    rm -f y.tab.c
+    yacc a2p.y >/dev/null 2>&1
+    if cmp -s y.tab.c a2p.c
+    then
+        rm -f y.tab.c
+    else
+        echo "a2p.y -> a2p.c" >&4
+        mv -f y.tab.c a2p.c
+        chmod u+w a2p.c
+        sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
+            -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c
+        xxx="$xxx a2p.c"
+    fi
+    cd ..
+    case "$xxx" in
+    '') echo "No parser files were regenerated.  That's okay." >&4 ;;
+    esac
     ;;
 esac