# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Fri May 14 10:24:50 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
d_endpent=''
d_endpwent=''
d_endsent=''
+d_endspent=''
d_fchmod=''
d_fchown=''
d_fcntl=''
d_getpwent=''
d_getsent=''
d_getservprotos=''
+d_getspent=''
+d_getspnam=''
d_getsbyname=''
d_getsbyport=''
d_gnulibc=''
d_setruid=''
d_setsent=''
d_setsid=''
+d_setspent=''
d_setvbuf=''
d_sfio=''
usesfio=''
d_pwquota=''
i_pwd=''
i_sfio=''
+i_shadow=''
+i_socks=''
i_stddef=''
i_stdlib=''
i_string=''
runnm=''
usenm=''
useperlio=''
+usesocks=''
d_oldpthreads=''
usethreads=''
incpath=''
: 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.
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
. ./use64bits.cbu
fi
case "$osname" in
- dec_osf|hpux|irix|solaris|unicos)
+ aix|dec_osf|hpux|irix|solaris|unicos)
# Known 64-bit capable platforms.
;;
*)
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." ;;
'') 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
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`;
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=' ';;
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";;
while read cline; do
name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
case "\$name" in
- *[/\\\\]\$wanted) echo "\$name"; exit 0;;
- *[\\\\/]\$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
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'
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
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
: 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)'
set ebcdic
eval $setvar
-# SunOS has a <unistd.h> which we generally avoid, but need for this test.
-# For everyone else, we'll trust i_unistd.
-t_unistd=$i_unistd
-case "$osname" in
-sunos) $test -f /usr/include/unistd.h && t_unistd=$define ;;
-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>
-#$t_unistd I_UNISTD
+#$i_unistd I_UNISTD
#ifdef I_UNISTD
-#include <unistd.h>
+# include <unistd.h>
#endif
#$d_sysconf HAS_SYSCONF
-#$stdio_stream_array
+#$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
#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
if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
output=''
set try -DTRY_FPUTC
- $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_FPUTC
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
: check for fflush NULL behaviour
case "$fflushNULL" in
'') set try -DTRY_FFLUSH_NULL $output
- $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
+ 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
fi
$rm -f core try.core core.try.*
fflushNULL="$undef"
;;
esac
-: check for fflush all behaviour
-case "$fflushall" in
-'') set try -DTRY_FFLUSH_ALL $output
- $rm -f try.out
- if eval $compile; then
- ./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.*
+: check explicit looping only if NULL did not work
+case "$fflushNULL" in
+"$undef")
+ : check for fflush all behaviour
case "$fflushall" in
- x) $cat >&4 <<EOM
-Flushing explicitly all the stdio streams works.
+ '') 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
- fflushall="$define"
- ;;
- '') $cat >&4 <<EOM
-Flushing explicitly all the stdio streams doesn't work.
+ $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.*
+ case "$fflushall" in
+ x) $cat >&4 <<EOM
+Whew. Flushing explicitly all the stdio streams works.
EOM
- fflushall="$undef"
- ;;
- *) $cat >&4 <<EOM
+ 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 streams explicitly works or not.
I'm assuming it doesn't.
EOM
- fflushall="$undef"
+ fflushall="$undef"
+ ;;
+ esac
;;
- esac
- case "$fflushall$fflushNULL" in
- undefdefine)
- $cat >&4 <<EOM
-(That's ok. I'll use fflush(NULL) instead.)
-EOM
+ "$define"|true|[yY]*)
+ fflushall="$define"
+ ;;
+ *)
+ fflushall="$undef"
;;
esac
;;
-$define|true|[yY]*)
- fflushall="$define"
- ;;
-*)
- fflushall="$undef"
+*) fflushall="$undef"
;;
esac
case "$fflushNULL$fflushall" in
#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))
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
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'
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'
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'
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'
useposix='$useposix'
usesfio='$usesfio'
useshrplib='$useshrplib'
+usesocks='$usesocks'
usethreads='$usethreads'
usevfork='$usevfork'
usrinc='$usrinc'