Put back the cygwin32 Configure fix of 3582 undone by 3597.
[p5sagit/p5-mst-13.2.git] / Configure
index 4a9ea70..22f6dd8 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 Thu May 13 15:54:16 EET DST 1999 [metaconfig 3.0 PL70]
+# Generated on Tue Jul  6 11:02:34 EET DST 1999 [metaconfig 3.0 PL70]
 # (with additional metaconfig patches by perlbug@perl.com)
 
 cat >/tmp/c1$$ <<EOF
@@ -338,6 +338,7 @@ d_endnent=''
 d_endpent=''
 d_endpwent=''
 d_endsent=''
+d_endspent=''
 d_fchmod=''
 d_fchown=''
 d_fcntl=''
@@ -383,6 +384,8 @@ d_getprotoprotos=''
 d_getpwent=''
 d_getsent=''
 d_getservprotos=''
+d_getspent=''
+d_getspnam=''
 d_getsbyname=''
 d_getsbyport=''
 d_gnulibc=''
@@ -404,6 +407,7 @@ d_madvise=''
 d_mblen=''
 d_mbstowcs=''
 d_mbtowc=''
+d_memchr=''
 d_memcmp=''
 d_memcpy=''
 d_memmove=''
@@ -473,6 +477,7 @@ d_setrgid=''
 d_setruid=''
 d_setsent=''
 d_setsid=''
+d_setspent=''
 d_setvbuf=''
 d_sfio=''
 usesfio=''
@@ -622,6 +627,8 @@ d_pwpasswd=''
 d_pwquota=''
 i_pwd=''
 i_sfio=''
+i_shadow=''
+i_socks=''
 i_stddef=''
 i_stdlib=''
 i_string=''
@@ -798,6 +805,7 @@ d_fsetpos64=''
 d_ftell64=''
 d_ftello64=''
 d_tmpfile64=''
+d_stdio_stream_array=''
 stdio_stream_array=''
 sysman=''
 trnl=''
@@ -810,6 +818,7 @@ nm_so_opt=''
 runnm=''
 usenm=''
 useperlio=''
+usesocks=''
 d_oldpthreads=''
 usethreads=''
 incpath=''
@@ -943,12 +952,13 @@ useposix=true
 : set useopcode=false in your hint file to disable the Opcode extension.
 useopcode=true
 : set usemultiplicity on the Configure command line to enable multiplicity.
+: set usesocks on the Configure command line to enable socks.
 : set usethreads on the Configure command line to enable threads.
 : List of libraries we want.
 : If anyone needs -lnet, put it in a hint file.
 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
 libswanted="$libswanted dld ld sun m rt c cposix posix"
-libswanted="$libswanted ndir dir crypt"
+libswanted="$libswanted ndir dir crypt sec"
 libswanted="$libswanted ucb bsd BSD PW x"
 : We probably want to search /usr/shlib before most other libraries.
 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
@@ -2101,7 +2111,7 @@ EOM
                                osvers=$tmp
                        elif $test -f /etc/kconfig; then
                                osname=isc
-                               if test "$lns" = "ln -s"; then
+                               if test "$lns" = "$ln -s"; then
                                        osvers=4
                                elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
                                        osvers=3
@@ -2620,7 +2630,7 @@ case "$use64bits" in
                . ./use64bits.cbu
        fi
        case "$osname" in
-       dec_osf|hpux|irix|solaris|unicos)
+       aix|dec_osf|hpux|irix|solaris|unicos)
                # Known 64-bit capable platforms.
                ;;
        *)
@@ -3618,7 +3628,7 @@ int main() {
        exit(0);
 }
 EOM
-if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
+if $cc -o gccvers gccvers.c; then
        gccversion=`./gccvers`
        case "$gccversion" in
        '') echo "You are not using GNU cc." ;;
@@ -3938,6 +3948,27 @@ case "$firstmakefile" in
 '') firstmakefile='makefile';;
 esac
 
+cat <<EOM
+
+Perl can be built to use the SOCKS proxy protocol library.  To do so,
+Configure must be run with -Dusesocks.
+
+Normally you do not need this and you should answer no.
+
+EOM
+case "$usesocks" in
+$define|true|[yY]*)    dflt='y';;
+*) dflt='n';;
+esac
+rp='Build Perl for SOCKS?'
+. ./myread
+case "$ans" in
+y|Y)   val="$define" ;;     
+*)      val="$undef" ;;
+esac
+set usesocks
+eval $setvar
+
 : Looking for optional libraries
 echo " "
 echo "Checking for optional libraries..." >&4
@@ -3948,6 +3979,11 @@ esac
 case "$libswanted" in
 '') libswanted='c_s';;
 esac
+case "$usesocks" in
+$define)
+       libswanted="$libswanted socks5 socks5_sh"
+       ;;
+esac
 for thislib in $libswanted; do
        
        if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
@@ -4003,20 +4039,14 @@ case "$dflt" in
 esac
 
 $cat <<EOM
-Some versions of Unix support shared libraries, which make executables smaller
-but make load time slightly longer.
-
-On some systems, mostly System V Release 3's, the shared library is included
-by putting the option "-lc_s" as the last thing on the cc command line when
-linking.  Other systems use shared libraries by default.  There may be other
-libraries needed to compile $package on your machine as well.  If your system
-needs the "-lc_s" option, include it here.  Include any other special libraries
-here as well.  Say "none" for none.
+
+In order to compile $package on your machine, a number of libraries
+are usually needed.  Include any other special libraries here as well.
+Say "none" for none.  The default list is almost always right.
 EOM
 
 echo " "
-rp="Any additional libraries?"
+rp="What libraries to use?"
 . ./myread
 case "$ans" in
 none) libs=' ';;
@@ -4098,6 +4128,12 @@ fi'
 
 set signal.h LANGUAGE_C; eval $inctest
 
+case "$usesocks" in
+$define)
+       ccflags="$ccflags -DSOCKS"
+       ;;
+esac
+
 case "$hint" in
 none|recommended) dflt="$ccflags $dflt" ;;
 *) dflt="$ccflags";;
@@ -4361,14 +4397,22 @@ $grep "^[       ]*#.*\$wanted" | \
 while read cline; do
        name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
        case "\$name" in
-       *[/\\\\]\$wanted) echo "\$name"; exit 0;;
-       *) name='';;
+       *[/\\\\]\$wanted) echo "\$name"; exit 1;;
+       *[\\\\/]\$wanted) echo "\$name"; exit 1;;
+       *) exit 2;;
        esac;
 done;
+#
+# status = 0: grep returned 0 lines, case statement not executed
+# status = 1: headerfile found
+# status = 2: while loop executed, no headerfile found
+#
+status=\$?
 $rm -f foo\$\$.c;
-case "\$name" in
-'') exit 1;;
-esac
+if test \$status -eq 1; then
+       exit 0;
+fi
+exit 1
 EOF
 chmod +x findhdr
 
@@ -7563,6 +7607,10 @@ eval $inlibc
 set endservent d_endsent
 eval $inlibc
 
+: see if endspent exists
+set endspent d_endspent
+eval $inlibc
+
 : Locate the flags for 'open()'
 echo " "
 $cat >open3.c <<'EOCP'
@@ -8264,6 +8312,14 @@ echo " "
 set d_getservprotos getservent $i_netdb netdb.h
 eval $hasproto
 
+: see if getspent exists
+set getspent d_getspent
+eval $inlibc
+
+: see if getspnam exists
+set getspnam d_getspnam
+eval $inlibc
+
 : see if gettimeofday or ftime exists
 set gettimeofday d_gettimeod
 eval $inlibc
@@ -8680,6 +8736,10 @@ eval $inlibc
 set mbtowc d_mbtowc
 eval $inlibc
 
+: see if memchr exists
+set memchr d_memchr
+eval $inlibc
+
 : see if memcmp exists
 set memcmp d_memcmp
 eval $inlibc
@@ -9612,6 +9672,10 @@ eval $inlibc
 set setsid d_setsid
 eval $inlibc
 
+: see if setspent exists
+set setspent d_setspent
+eval $inlibc
+
 : see if setvbuf exists
 set setvbuf d_setvbuf
 eval $inlibc
@@ -9829,7 +9893,7 @@ eval $hasfield
 
 : see if _ptr and _cnt from stdio act std
 echo " "
-if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
+if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
        echo "(Looks like you have stdio.h from Linux.)"
        case "$stdio_ptr" in
        '') stdio_ptr='((fp)->_IO_read_ptr)'
@@ -9954,6 +10018,41 @@ esac
 set d_stdiobase
 eval $setvar
 
+$cat >&4 <<EOM
+Checking how to access stdio streams by file descriptor number...
+EOM
+case "$stdio_stream_array" in
+'')    $cat >try.c <<EOCP
+#include <stdio.h>
+int main() {
+  if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
+    printf("yes\n");
+}
+EOCP
+       for s in _iob __iob __sF
+       do
+               set try -DSTDIO_STREAM_ARRAY=$s
+               if eval $compile; then
+                       case "`./try$exe_ext`" in
+                       yes)    stdio_stream_array=$s; break ;;
+                       esac
+               fi
+       done
+       $rm -f try.* try$exe_ext
+esac
+case "$stdio_stream_array" in
+'')    $cat >&4 <<EOM
+I can't figure out how to access stdio streams by file descriptor number.
+EOM
+       d_stdio_stream_array="$undef"
+       ;;
+*)     $cat >&4 <<EOM
+You can access stdio streams by file descriptor number by the $stdio_stream_array array.
+EOM
+       d_stdio_stream_array="$define"
+       ;;
+esac
+
 : see if strcoll exists
 set strcoll d_strcoll
 eval $inlibc
@@ -10920,160 +11019,194 @@ $rm -f tebcdic.c tebcdic
 set ebcdic
 eval $setvar
 
-$cat >&4 <<EOM
-Checking how to access stdio streams by file descriptor number...
-EOM
-case "$stdio_stream_array" in
-'')    $cat >try.c <<EOCP
-#include <stdio.h>
-int main() {
-  if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
-    printf("yes\n");
-}
-EOCP
-       for s in _iob __iob __sF
-       do
-               set try -DSTDIO_STREAM_ARRAY=$s
-               if eval $compile_ok; then
-                       case "`./try$exe_ext`" in
-                       yes)    stdio_stream_array=$s; break ;;
-                       esac
-               fi
-       done
-       $rm -f try.* try$exe_ext
-esac
-case "$stdio_stream_array" in
-'')    $cat >&4 <<EOM
-I can't figure out how to access stdio streams by file descriptor number.
-EOM
-       ;;
-*)     $cat >&4 <<EOM
-You can access stdio streams by file descriptor number by using $stdio_stream_array.
-EOM
-       ;;
-esac
-
+echo " "
 $cat >&4 <<EOM
 Checking how to flush all pending stdio output...
 EOM
-$cat >try.c <<EOCP
+# I only know how to find the first 32 possibly open files on SunOS.
+# See also hints/sunos_4_1.sh and util.c  --AD
+case "$osname" in
+sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
+esac
+$cat >>try.c <<EOCP
 #include <stdio.h>
 #$i_unistd I_UNISTD
 #ifdef I_UNISTD
-#include <unistd.h>
+# include <unistd.h>
 #endif
 #$d_sysconf HAS_SYSCONF
+#$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
+#ifdef HAS_STDIO_STREAM_ARRAY
+# define STDIO_STREAM_ARRAY $stdio_stream_array
+#endif
 int main() {
   FILE* p = fopen("try.out", "w");
+#ifdef TRY_FPUTC
   fputc('x', p);
+#else
+# ifdef TRY_FPRINTF
+  fprintf(p, "x");
+# endif
+#endif
 #ifdef TRY_FFLUSH_NULL
   fflush(NULL);
 #endif
 #ifdef TRY_FFLUSH_ALL
   {
     long open_max = -1;
-# if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
-    open_max = sysconf(_SC_OPEN_MAX);
+# ifdef PERL_FFLUSH_ALL_FOPEN_MAX
+    open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
 # else
-#  ifdef FOPEN_MAX
-#   open_max = FOPEN_MAX;
+#  if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
+    open_max = sysconf(_SC_OPEN_MAX);
 #  else
-#   ifdef OPEN_MAX
-#   open_max = OPEN_MAX;
+#   ifdef FOPEN_MAX
+    open_max = FOPEN_MAX;
 #   else
-#    ifdef _NFILE
-#   open_max = _NFILE;
+#    ifdef OPEN_MAX
+    open_max = OPEN_MAX;
+#    else
+#     ifdef _NFILE
+    open_max = _NFILE;
+#     endif
 #    endif
 #   endif
 #  endif
-# endif
+# endif 
+# ifdef HAS_STDIO_STREAM_ARRAY
     if (open_max > 0) {
       long i;
       for (i = 0; i < open_max; i++)
-         fflush(&$stdio_stream_array[i]);
+           if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
+               STDIO_STREAM_ARRAY[i]._file < open_max &&
+               STDIO_STREAM_ARRAY[i]._flag)
+               fflush(&STDIO_STREAM_ARRAY[i]);
     }  
   }
+# endif
 #endif
   _exit(42);
 }
 EOCP
+: first we have to find out how _not_ to flush
+if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
+    output=''
+    set try -DTRY_FPUTC
+    if eval $compile; then
+           $rm -f try.out
+           ./try$exe_ext 2>/dev/null
+           if $test ! -s try.out -a "X$?" = X42; then
+               output=-DTRY_FPUTC
+           fi
+    fi
+    case "$output" in
+    '')
+           set try -DTRY_FPRINTF
+           $rm -f try.out
+           if eval $compile; then
+                   $rm -f try.out
+                   ./try$exe_ext 2>/dev/null
+                   if $test ! -s try.out -a "X$?" = X42; then
+                       output=-DTRY_FPRINTF
+                   fi
+           fi
+       ;;
+    esac
+fi
 : check for fflush NULL behaviour
 case "$fflushNULL" in
-'')    set try -DTRY_FFLUSH_NULL
-       $rm -f try.out
-       if eval $compile_ok; then
+'')    set try -DTRY_FFLUSH_NULL $output
+       if eval $compile; then
+               $rm -f try.out
                ./try$exe_ext 2>/dev/null
-               if $test -s try.out -a "X$?" = X42; then
+               code="$?"
+               if $test -s try.out -a "X$code" = X42; then
                        fflushNULL="`$cat try.out`"
+               else
+                       if $test "X$code" != X42; then
+                               $cat >&4 <<EOM
+(If this test failed, don't worry, we'll try another method shortly.)
+EOM
+                       fi
                fi
-               $rm -f core try.core core.try.*
        fi
+       $rm -f core try.core core.try.*
        case "$fflushNULL" in
-       x)      cat >&4 <<EOM
+       x)      $cat >&4 <<EOM
 Your fflush(NULL) works okay.
 EOM
-               fflushNULL=define
+               fflushNULL="$define"
                ;;
-       '')     cat >&4 <<EOM
+       '')     $cat >&4 <<EOM
 Your fflush(NULL) isn't working (contrary to ANSI C).
 EOM
-               fflushNULL=undef
+               fflushNULL="$undef"
                ;;
-       *)      cat >&4 <<EOM
+       *)      $cat >&4 <<EOM
 Cannot figure out whether your fflush(NULL) works or not.
 I'm assuming it doesn't (contrary to ANSI C).
 EOM
-               fflushNULL=undef
+               fflushNULL="$undef"
                ;;
        esac
        ;;
 $define|true|[yY]*)
-       fflushNULL=define
+       fflushNULL="$define"
        ;;
 *)
-       fflushNULL=undef
+       fflushNULL="$undef"
        ;;
 esac
-: check for fflush all behaviour
-case "$fflushall" in
-'')    set try -DTRY_FFLUSH_ALL
-       $rm -f try.out
-       if eval $compile_ok; then
-               ./try$exe_ext 2>/dev/null
-               if $test -s try.out -a "X$?" = X42; then
-                       fflushall="`$cat try.out`"
+: check explicit looping only if NULL did not work
+case "$fflushNULL" in
+"$undef")
+       : check for fflush all behaviour
+       case "$fflushall" in
+       '')     set try -DTRY_FFLUSH_ALL $output
+               if eval $compile; then
+                       $cat >&4 <<EOM
+(Now testing the other method--but note that also this may fail.)
+EOM
+                       $rm -f try.out
+                       ./try$exe_ext 2>/dev/null
+                       if $test -s try.out -a "X$?" = X42; then
+                               fflushall="`$cat try.out`"
+                       fi
                fi
                $rm -f core try.core core.try.*
-       fi
-       case "$fflushall" in
-       x)      cat >&4 <<EOM
-Flushing explicitly all the stdio streams works.
+               case "$fflushall" in
+               x)      $cat >&4 <<EOM
+Whew. Flushing explicitly all the stdio streams works.
 EOM
-               fflushall=define
-               ;;
-       '')     cat >&4 <<EOM
-Flushing explicitly all the stdio streams doesn't work.
+                       fflushall="$define"
+                       ;;
+               '')     $cat >&4 <<EOM
+Sigh. Flushing explicitly all the stdio streams doesn't work.
 EOM
-               fflushall=undef
-               ;;
-       *)      cat >&4 <<EOM
-Cannot figure out whether flushing stdio stream explicitly works or not.
+                       fflushall="$undef"
+                       ;;
+               *)      $cat >&4 <<EOM
+Cannot figure out whether flushing stdio streams explicitly works or not.
 I'm assuming it doesn't.
 EOM
-               fflushall=undef
+                       fflushall="$undef"
+                       ;;
+               esac
+               ;;
+       "$define"|true|[yY]*)
+               fflushall="$define"
+               ;;
+       *)
+               fflushall="$undef"
                ;;
        esac
        ;;
-$define|true|[yY]*)
-       fflushall=define
-       ;;
-*)
-       fflushall=undef
+*)     fflushall="$undef"      
        ;;
 esac
 case "$fflushNULL$fflushall" in
 undefundef)
-       cat <<EOM
+       $cat <<EOM
 I cannot figure out how to flush pending stdio output.
 EOM
        ;;
@@ -11558,6 +11691,10 @@ EOM
 #ifdef I_SYS_SELECT
 #include <sys/select.h>
 #endif
+#$d_socket HAS_SOCKET
+#ifdef HAS_SOCKET
+#   include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
+#endif
 #include <stdio.h>
 $selecttype b;
 #define S sizeof(*(b))
@@ -12313,6 +12450,14 @@ set i_termio; eval $setvar
 val=$val2; set i_sgtty; eval $setvar
 val=$val3; set i_termios; eval $setvar
 
+: see if this is a shadow.h system
+set shadow.h i_shadow
+eval $inhdr
+
+: see if this is a socks.h system
+set socks.h i_socks
+eval $inhdr
+
 : see if stdarg is available
 echo " "
 if $test `./findhdr stdarg.h`; then
@@ -12905,6 +13050,7 @@ d_endnent='$d_endnent'
 d_endpent='$d_endpent'
 d_endpwent='$d_endpwent'
 d_endsent='$d_endsent'
+d_endspent='$d_endspent'
 d_eofnblk='$d_eofnblk'
 d_eunice='$d_eunice'
 d_fchmod='$d_fchmod'
@@ -12964,6 +13110,8 @@ d_getsbyname='$d_getsbyname'
 d_getsbyport='$d_getsbyport'
 d_getsent='$d_getsent'
 d_getservprotos='$d_getservprotos'
+d_getspent='$d_getspent'
+d_getspnam='$d_getspnam'
 d_gettimeod='$d_gettimeod'
 d_gnulibc='$d_gnulibc'
 d_grpasswd='$d_grpasswd'
@@ -12991,6 +13139,7 @@ d_madvise='$d_madvise'
 d_mblen='$d_mblen'
 d_mbstowcs='$d_mbstowcs'
 d_mbtowc='$d_mbtowc'
+d_memchr='$d_memchr'
 d_memcmp='$d_memcmp'
 d_memcpy='$d_memcpy'
 d_memmove='$d_memmove'
@@ -13084,6 +13233,7 @@ d_setrgid='$d_setrgid'
 d_setruid='$d_setruid'
 d_setsent='$d_setsent'
 d_setsid='$d_setsid'
+d_setspent='$d_setspent'
 d_setvbuf='$d_setvbuf'
 d_sfio='$d_sfio'
 d_shm='$d_shm'
@@ -13103,6 +13253,7 @@ d_statfsflags='$d_statfsflags'
 d_statvfs='$d_statvfs'
 d_stdio_cnt_lval='$d_stdio_cnt_lval'
 d_stdio_ptr_lval='$d_stdio_ptr_lval'
+d_stdio_stream_array='$d_stdio_stream_array'
 d_stdiobase='$d_stdiobase'
 d_stdstdio='$d_stdstdio'
 d_store64='$d_store64'
@@ -13219,6 +13370,8 @@ i_pwd='$i_pwd'
 i_rpcsvcdbm='$i_rpcsvcdbm'
 i_sfio='$i_sfio'
 i_sgtty='$i_sgtty'
+i_shadow='$i_shadow'
+i_socks='$i_socks'
 i_stdarg='$i_stdarg'
 i_stddef='$i_stddef'
 i_stdlib='$i_stdlib'
@@ -13444,6 +13597,7 @@ useperlio='$useperlio'
 useposix='$useposix'
 usesfio='$usesfio'
 useshrplib='$useshrplib'
+usesocks='$usesocks'
 usethreads='$usethreads'
 usevfork='$usevfork'
 usrinc='$usrinc'