X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Configure;h=52ec43971b06b4906dfb52cfc320f3cdf723955a;hb=3e3318e754fa4289ad1c682811dbe6a31cd59e26;hp=67ed607f7b9bca0b0faaa6f4b4cae29bb9fbe7d3;hpb=4619340914cc8b5438e9411eca00b9f6a4805995;p=p5sagit%2Fp5-mst-13.2.git diff --git a/Configure b/Configure index 67ed607..52ec439 100755 --- 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 Tue Feb 2 12:38:43 EET 1999 [metaconfig 3.0 PL70] +# Generated on Tue Jul 6 18:36:05 EET DST 1999 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <extract <<'EOS' -CONFIG=true +CONFIGDOTSH=true echo "Doing variable substitutions on .SH files..." if test -f $src/MANIFEST; then set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'` @@ -1752,7 +1794,6 @@ more nm nroff pg -tee test uname zip @@ -2064,9 +2105,13 @@ EOM [23]100) osname=mips ;; next*) osname=next ;; i386*) - if $test -f /etc/kconfig; then + tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'` + if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then + osname='sco' + 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 @@ -2074,6 +2119,7 @@ EOM osvers=2 fi fi + tmp='' ;; pc*) if test -n "$DJGPP"; then @@ -2471,7 +2517,12 @@ cat <&4 <&4 <&4 if $test -r $rsrc/patchlevel.h;then - patchlevel=`awk '/define[ ]+PATCHLEVEL/ {print $3}' $rsrc/patchlevel.h` - subversion=`awk '/define[ ]+SUBVERSION/ {print $3}' $rsrc/patchlevel.h` + patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` + subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` else patchlevel=0 subversion=0 @@ -3025,12 +3076,10 @@ echo ".)" if test 0 -eq "$subversion"; then version=`LC_ALL=C; export LC_ALL; \ - LANGUAGE=C; export LANGUAGE; \ echo $baserev $patchlevel | \ $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'` else version=`LC_ALL=C; export LC_ALL; \ - LANGUAGE=C; export LANGUAGE; \ echo $baserev $patchlevel $subversion | \ $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'` fi @@ -3371,7 +3420,7 @@ fi case "$models" in '') $cat >pdp11.c <<'EOP' -main() { +int main() { #ifdef pdp11 exit(0); #else @@ -3579,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." ;; @@ -3784,7 +3833,7 @@ false) esac case "$cppstdin" in -"$wrapper") ;; +"$wrapper"|'cppstdin') ;; *) $rm -f $wrapper;; esac $rm -f testcpp.c testcpp.out @@ -3899,6 +3948,27 @@ case "$firstmakefile" in '') firstmakefile='makefile';; esac +cat <&4 @@ -3909,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`; @@ -3964,20 +4039,14 @@ case "$dflt" in esac $cat <&4 $cat > try.c <<'EOF' #include -main() { printf("Ok\n"); exit(0); } +int main() { printf("Ok\n"); exit(0); } EOF set X $cc $optimize $ccflags -o try $ldflags try.c $libs shift @@ -4312,10 +4383,13 @@ $cat >findhdr <" > foo\$\$.c $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \ @@ -4323,17 +4397,26 @@ $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 + : define an alternate in-header-list? function inhdr='echo " "; td=$define; tu=$undef; yyy=$@; cont=true; xxf="echo \"<\$1> found.\" >&4"; @@ -4524,27 +4607,25 @@ fi : determine whether to install perl also as /usr/bin/perl echo " " -case "$installusrbinperl" in -'') if test -d /usr/bin -a "X$installbin" != X/usr/bin; then +if test -d /usr/bin -a "X$installbin" != X/usr/bin; then $cat <&4 - $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list + $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list fi ;; esac @@ -4979,7 +5060,7 @@ yes) else tval=false; fi;; *) - echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c; + echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c; if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1; then tval=true; else tval=false; @@ -5293,24 +5374,12 @@ EOM useshrplib='true' # Why does next4 have to be so different? case "${osname}${osvers}" in - next4*) xxx='DYLD_LIBRARY_PATH' ;; + next4*|rhapsody*) + xxx='DYLD_LIBRARY_PATH' ;; os2*) xxx='' ;; # Nothing special needed. beos*) xxx='' ;; *) xxx='LD_LIBRARY_PATH' ;; esac - if test X"$xxx" != "X"; then - $cat <&4 - -To build perl, you must add the current working directory to your -$xxx environment variable before running make. You can do -this with - $xxx=\`pwd\`:\$$xxx; export $xxx -for Bourne-style shells, or - setenv $xxx \`pwd\` -for Csh-style shells. You *MUST* do this before running make. - -EOM - fi ;; *) useshrplib='false' ;; esac @@ -5431,6 +5500,10 @@ if "$useshrplib"; then beos) # beos doesn't like the default, either. ;; + hpux*) + # hpux doesn't like the default, either. + tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\"" + ;; *) tmp_shrpenv="env LD_RUN_PATH=$shrpdir" ;; @@ -6130,8 +6203,8 @@ $cat < #endif -main() { +int main() { exit(R_OK); } EOCP @@ -6558,7 +6631,7 @@ case "$intsize" in echo "Checking to see how big your integers are..." >&4 $cat >intsize.c <<'EOCP' #include -main() +int main() { printf("intsize=%d;\n", sizeof(int)); printf("longsize=%d;\n", sizeof(long)); @@ -6654,7 +6727,7 @@ $cat >try.c < #include $signal_t blech(s) int s; { exit(3); } -main() +int main() { $xxx i32; double f, g; @@ -6712,7 +6785,7 @@ $signal_t blech_in_list(s) int s; { exit(4); } unsigned long dummy_long(p) unsigned long p; { return p; } unsigned int dummy_int(p) unsigned int p; { return p; } unsigned short dummy_short(p) unsigned short p; { return p; } -main() +int main() { double f; unsigned long along; @@ -6804,7 +6877,7 @@ if set vprintf val -f d_vprintf; eval $csym; $val; then $cat >vprintf.c <<'EOF' #include -main() { xxx("foo"); } +int main() { xxx("foo"); } xxx(va_alist) va_dcl @@ -6855,7 +6928,7 @@ while $test $# -ge 2; do shift 2; done > try.c; echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c; -if eval $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then +if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then val="$define"; else val="$undef"; @@ -7221,6 +7294,10 @@ if $test X"$use64bits" = X"$define"; then set lockf64 d_lockf64 eval $inlibc + : see if llseek exists + set llseek d_llseek + eval $inlibc + : see if lseek64 exists set lseek64 d_lseek64 eval $inlibc @@ -7262,6 +7339,7 @@ if $test X"$use64bits" = X"$define"; then echo $n "Checking to see if your system supports off64_t...$c" >&4 $cat >try.c < +#include off64_t foo() { off64_t x; x = 7; return x; }' EOCP if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then @@ -7272,7 +7350,26 @@ EOCP echo " Nope, it doesn't." >&4 fi $rm -f try.* - set d_off64t + set d_off64_t + eval $setvar + + : check for offset_t + echo " " + echo $n "Checking to see if your system supports offset_t...$c" >&4 + $cat >try.c < +#include +offset_t foo() { offset_t x; x = 7; return x; }' +EOCP + if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then + val="$define" + echo " Yup, it does." >&4 + else + val="$undef" + echo " Nope, it doesn't." >&4 + fi + $rm -f try.* + set d_offset_t eval $setvar : check for ino64_t @@ -7297,7 +7394,7 @@ EOCP else echo " Nope, it doesn't." >&4 fi - set d_ino64t + set d_ino64_t eval $setvar : check for struct flock64 @@ -7332,7 +7429,7 @@ EOCP else val="$undef" - for xxx in d_fstat64 d_ftruncate64 d_lockf64 d_lseek64 d_lstat64 d_open64 d_opendir64 d_readdir64 d_seekdir64 d_stat64 d_telldir64 d_truncate64 d_off64t d_ino64t d_flock64_s d_dirent64_s + for xxx in d_fstat64 d_ftruncate64 d_lockf64 d_lseek64 d_lstat64 d_open64 d_opendir64 d_readdir64 d_seekdir64 d_stat64 d_telldir64 d_truncate64 d_off64_t d_offset_t d_ino64_t d_flock64_s d_dirent64_s do set $xxx eval $setvar @@ -7511,6 +7608,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' @@ -7521,7 +7622,7 @@ $cat >open3.c <<'EOCP' #ifdef I_SYS_FILE #include #endif -main() { +int main() { if(O_RDONLY); #ifdef O_TRUNC exit(0); @@ -7577,7 +7678,7 @@ case "$o_nonblock" in '') $cat head.c > try.c $cat >>try.c <<'EOCP' -main() { +int main() { #ifdef O_NONBLOCK printf("O_NONBLOCK\n"); exit(0); @@ -7624,7 +7725,7 @@ extern int errno; $signal_t blech(x) int x; { exit(3); } EOCP $cat >> try.c <<'EOCP' -main() +int main() { int pd[2]; int pu[2]; @@ -7773,7 +7874,7 @@ if test "X$timeincl" = X; then #ifdef I_SYSSELECT #include #endif -main() +int main() { struct tm foo; #ifdef S_TIMEVAL @@ -7857,7 +7958,7 @@ $cat >fd_set.c < #endif -main() { +int main() { fd_set fds; #ifdef TRYBITS @@ -8039,13 +8140,13 @@ eval $inlibc : see how we will look up host name echo " " -if false; then - : dummy stub to allow use of elif -elif set gethostname val -f d_gethname; eval $csym; $val; then +call='' +if set gethostname val -f d_gethname; eval $csym; $val; then echo 'gethostname() found.' >&4 d_gethname="$define" call=gethostname -elif set uname val -f d_uname; eval $csym; $val; then +fi +if set uname val -f d_uname; eval $csym; $val; then if ./xenix; then $cat <<'EOM' uname() was found, but you're running xenix, and older versions of xenix @@ -8065,7 +8166,9 @@ EOM else echo 'uname() found.' >&4 d_uname="$define" - call=uname + case "$call" in + '') call=uname ;; + esac fi fi case "$d_gethname" in @@ -8133,6 +8236,10 @@ eval $hasproto set getlogin d_getlogin eval $inlibc +: see if getmntent exists +set getmntent d_getmntent +eval $inlibc + : see if getnetbyaddr exists set getnetbyaddr d_getnbyaddr eval $inlibc @@ -8206,6 +8313,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 @@ -8250,6 +8365,10 @@ $define) ;; esac +: see if hasmntopt exists +set hasmntopt d_hasmntopt +eval $inlibc + : see if this is a netinet/in.h or sys/in.h system set netinet/in.h i_niin sys/in.h i_sysin eval $inhdr @@ -8411,7 +8530,7 @@ echo " " $cat >isascii.c <<'EOCP' #include #include -main() { +int main() { int c = 'A'; if (isascii(c)) exit(0); @@ -8486,7 +8605,7 @@ case "$doublesize" in $echo $n "Checking to see how big your double precision numbers are...$c" >&4 $cat >try.c <<'EOCP' #include -main() +int main() { printf("%d\n", sizeof(double)); } @@ -8602,6 +8721,10 @@ $rm -f try.c try set lstat d_lstat eval $inlibc +: see if madvise exists +set madvise d_madvise +eval $inlibc + : see if mblen exists set mblen d_mblen eval $inlibc @@ -8614,6 +8737,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 @@ -8642,6 +8769,37 @@ eval $inlibc set mktime d_mktime eval $inlibc +: see if this is a sys/mman.h system +set sys/mman.h i_sysmman +eval $inhdr + +: see if mmap exists +set mmap d_mmap +eval $inlibc +: see what shmat returns +: default to something harmless +mmaptype='void *' +case "$i_sysmman$d_mmap" in +"$define$define") + $cat >mmap.c <<'END' +#include +void *mmap(); +END + if $cc $ccflags -c mmap.c >/dev/null 2>&1; then + mmaptype='void *' + else + mmaptype='caddr_t' + fi + echo "and it returns ($mmaptype)." >&4 + ;; +esac + + + +: see if mprotect exists +set mprotect d_mprotect +eval $inlibc + : see if msgctl exists set msgctl d_msgctl eval $inlibc @@ -8694,12 +8852,30 @@ fi set d_msg eval $setvar +: see if msync exists +set msync d_msync +eval $inlibc + +: see if munmap exists +set munmap d_munmap +eval $inlibc + : see if nice exists set nice d_nice eval $inlibc -: how to create joinable pthreads +: see if POSIX threads are available if test "X$usethreads" = "X$define"; then + set pthread.h i_pthread + eval $inhdr +else + i_pthread="$undef" +fi + + + +: how to create joinable pthreads +if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then echo " " echo "Checking what constant to use for creating joinable pthreads..." >&4 $cat >try.c <<'EOCP' @@ -8710,7 +8886,7 @@ int main() { EOCP set try -DJOINABLE=PTHREAD_CREATE_JOINABLE if eval $compile; then - echo "You seem to use PTHREAD_CREATE_JOINABLE." >&2 + echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4 val="$undef" # Yes, undef. set d_old_pthread_create_joinable eval $setvar @@ -8720,7 +8896,7 @@ EOCP else set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED if eval $compile; then - echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&2 + echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4 val="$define" set d_old_pthread_create_joinable eval $setvar @@ -8730,7 +8906,7 @@ EOCP else set try -DJOINABLE=__UNDETACHED if eval $compile; then - echo "You seem to use __UNDETACHED." >&2 + echo "You seem to use __UNDETACHED." >&4 val="$define" set d_old_pthread_create_joinable eval $setvar @@ -8738,7 +8914,7 @@ EOCP set old_pthread_create_joinable eval $setvar else - echo "Egads, nothing obvious found. Guessing that you use 0." >&2 + echo "Egads, nothing obvious found. Guessing that you use 0." >&4 val="$define" set d_old_pthread_create_joinable eval $setvar @@ -9004,7 +9180,7 @@ EOCP #ifdef I_UNISTD # include /* Needed for NetBSD */ #endif -main() +int main() { char buf[128], abc[128]; char *b; @@ -9080,7 +9256,7 @@ EOCP #ifdef I_UNISTD # include /* Needed for NetBSD */ #endif -main() +int main() { char buf[128], abc[128]; char *b; @@ -9158,7 +9334,7 @@ EOCP #ifdef I_UNISTD # include /* Needed for NetBSD */ #endif -main() +int main() { char a = -1; char b = 0; @@ -9497,6 +9673,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 @@ -9643,7 +9823,7 @@ if set sigaction val -f d_sigaction; eval $csym; $val; then #include #include #include -main() +int main() { struct sigaction act, oact; } @@ -9670,7 +9850,7 @@ case "$d_sigsetjmp" in #include sigjmp_buf env; int set = 1; -main() +int main() { if (sigsetjmp(env,1)) exit(set); @@ -9714,7 +9894,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)' @@ -9760,7 +9940,7 @@ $cat >try.c < #define FILE_ptr(fp) $stdio_ptr #define FILE_cnt(fp) $stdio_cnt -main() { +int main() { FILE *fp = fopen("try.c", "r"); char c = getc(fp); if ( @@ -9811,7 +9991,7 @@ $define) #include #define FILE_base(fp) $stdio_base #define FILE_bufsiz(fp) $stdio_bufsiz -main() { +int main() { FILE *fp = fopen("try.c", "r"); char c = getc(fp); if ( @@ -9839,6 +10019,41 @@ esac set d_stdiobase eval $setvar +$cat >&4 <try.c < +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 <&4 <&4 - $cat >try.c <<'EOCP' +case "$crosscompile$multiarch" in +*$define*) + $cat <&4 + $cat >try.c <<'EOCP' struct foobar { char foo; double bar; -} try; -main() +} try_algn; +int main() { - printf("%d\n", (char *)&try.bar - (char *)&try.foo); + printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo); } EOCP - set try - if eval $compile_ok; then - dflt=`./try` - else - dflt='8' - echo "(I can't seem to compile the test program...)" - fi - ;; -*) dflt="$alignbytes" + set try + if eval $compile_ok; then + dflt=`./try` + else + dflt='8' + echo "(I can't seem to compile the test program...)" + fi + ;; + *) dflt="$alignbytes" + ;; + esac + rp="Doubles must be aligned on a how-many-byte boundary?" + . ./myread + alignbytes="$ans" + $rm -f try.c try ;; esac -rp="Doubles must be aligned on a how-many-byte boundary?" -. ./myread -alignbytes="$ans" -$rm -f try.c try + : check for ordering of bytes in a long -case "$byteorder" in -'') - $cat <<'EOM' - +echo " " +case "$crosscompile$multiarch" in +*$define*) + $cat <try.c <<'EOCP' + $cat >try.c <<'EOCP' #include -main() +int main() { int i; union { @@ -10271,37 +10536,40 @@ main() exit(0); } EOCP - xxx_prompt=y - set try - if eval $compile && ./try > /dev/null; then - dflt=`./try` - case "$dflt" in - [1-4][1-4][1-4][1-4]|12345678|87654321) - echo "(The test program ran ok.)" - echo "byteorder=$dflt" - xxx_prompt=n + xxx_prompt=y + set try + if eval $compile && ./try > /dev/null; then + dflt=`./try` + case "$dflt" in + [1-4][1-4][1-4][1-4]|12345678|87654321) + echo "(The test program ran ok.)" + echo "byteorder=$dflt" + xxx_prompt=n ;; - ????|????????) echo "(The test program ran ok.)" ;; - *) echo "(The test program didn't run right for some reason.)" ;; - esac - else - dflt='4321' - cat <<'EOM' + ????|????????) echo "(The test program ran ok.)" ;; + *) echo "(The test program didn't run right for some reason.)" ;; + esac + else + dflt='4321' + cat <<'EOM' (I can't seem to compile the test program. Guessing big-endian...) EOM - fi - case "$xxx_prompt" in - y) - rp="What is the order of bytes in a long?" - . ./myread - byteorder="$ans" - ;; - *) byteorder=$dflt + fi + case "$xxx_prompt" in + y) + rp="What is the order of bytes in a long?" + . ./myread + byteorder="$ans" + ;; + *) byteorder=$dflt + ;; + esac ;; esac + $rm -f try.c try ;; esac -$rm -f try.c try + : how do we catenate cpp tokens here? echo " " @@ -10348,7 +10616,7 @@ $define) #include #include #include -main() +int main() { #ifdef DB_VERSION_MAJOR /* DB version >= 2 */ int Major, Minor, Patch ; @@ -10431,7 +10699,7 @@ size_t size; { } HASHINFO info; -main() +int main() { info.hash = hash_cb; } @@ -10476,7 +10744,7 @@ const DBT *key2; { } BTREEINFO info; -main() +int main() { info.prefix = prefix_cb; } @@ -10529,7 +10797,7 @@ sub() { #endif exit(0); } -main() { sub(); } +int main() { sub(); } EOCP if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then voidflags=$defvoidused @@ -10670,7 +10938,7 @@ echo "Checking to see how many bits your $randfunc() function produces..." >&4 #ifdef I_STDLIB # include #endif -main() +int main() { register int i; register unsigned long tmp; @@ -10752,11 +11020,211 @@ $rm -f tebcdic.c tebcdic set ebcdic eval $setvar +echo " " +$cat >&4 < try.c ;; +esac +$cat >>try.c < +#$i_unistd I_UNISTD +#ifdef I_UNISTD +# include +#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; +# ifdef PERL_FFLUSH_ALL_FOPEN_MAX + open_max = PERL_FFLUSH_ALL_FOPEN_MAX; +# else +# if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX) + open_max = sysconf(_SC_OPEN_MAX); +# else +# ifdef FOPEN_MAX + open_max = FOPEN_MAX; +# else +# ifdef OPEN_MAX + open_max = OPEN_MAX; +# else +# ifdef _NFILE + open_max = _NFILE; +# endif +# endif +# endif +# endif +# endif +# ifdef HAS_STDIO_STREAM_ARRAY + if (open_max > 0) { + long i; + for (i = 0; i < open_max; 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 $output + if eval $compile; then + $rm -f try.out + ./try$exe_ext 2>/dev/null + code="$?" + if $test -s try.out -a "X$code" = X42; then + fflushNULL="`$cat try.out`" + else + if $test "X$code" != X42; then + $cat >&4 <&4 <&4 <&4 <&4 </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 <&4 <&4 <>try.c <<'EOCP' #include -main() +int main() { printf("%d\n", sizeof(VOID_PTR)); exit(0); @@ -11109,7 +11577,7 @@ echo "Checking how to generate random libraries on your machine..." >&4 echo 'int bar1() { return bar2(); }' > bar1.c echo 'int bar2() { return 2; }' > bar2.c $cat > foo.c <<'EOP' -main() { printf("%d\n", bar1()); exit(0); } +int main() { printf("%d\n", bar1()); exit(0); } EOP $cc $ccflags -c bar1.c >/dev/null 2>&1 $cc $ccflags -c bar2.c >/dev/null 2>&1 @@ -11224,6 +11692,10 @@ EOM #ifdef I_SYS_SELECT #include #endif +#$d_socket HAS_SOCKET +#ifdef HAS_SOCKET +# include /* Might include */ +#endif #include $selecttype b; #define S sizeof(*(b)) @@ -11291,6 +11763,8 @@ esac : Trace out the files included by signal.h, then look for SIGxxx names. : Remove SIGARRAYSIZE used by HPUX. +: Remove SIGSTKSIZE used by Linux. +: Remove SIGSTKSZ used by Posix. : Remove SIGTYP void lines used by OS2. xxx=`echo '#include ' | $cppstdin $cppminus $cppflags 2>/dev/null | @@ -11308,7 +11782,7 @@ case "$xxxfiles" in '') xxxfiles=`./findhdr signal.h` ;; esac xxx=`awk ' -$1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ { +$1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ { print substr($2, 4, 20) } $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ { @@ -11408,20 +11882,22 @@ $1 ~ /^NSIG$/ { nsig = $2 } sig_name[$2] = $1 sig_num[$2] = $2 } - } END { - if (nsig == 0) { nsig = maxsig + 1 } - for (n = 1; n < nsig; n++) { - if (sig_name[n]) { - printf("%s %d\n", sig_name[n], sig_num[n]) - } - else { - printf("NUM%d %d\n", n, n) - } + if (nsig == 0) { + nsig = maxsig + 1 + } + printf("NSIG %d\n", nsig); + for (n = 1; n < nsig; n++) { + if (sig_name[n]) { + printf("%s %d\n", sig_name[n], sig_num[n]) } + else { + printf("NUM%d %d\n", n, n) + } + } for (n = 0; n < ndups; n++) { - printf("%s %d\n", dup_name[n], dup_num[n]) + printf("%s %d\n", dup_name[n], dup_num[n]) } } EOP @@ -11487,7 +11963,8 @@ else 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;; esac echo $@ | $tr ' ' $trnl | \ - $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst + $awk '{ printf "%s %d\n", $1, ++s; } + END { printf "NSIG %d\n", ++s }' >signal.lst fi $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1 EOS @@ -11506,19 +11983,20 @@ case "$doinit" in yes) echo "Generating a list of signal names and numbers..." >&4 . ./signal_cmd - sig_name=`$awk '{printf "%s ", $1}' signal.lst` - sig_name="ZERO $sig_name" - sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " } - { printf "\"%s\", ", $1 } - END { printf "0\n" }' signal.lst` - sig_num=`$awk '{printf "%d ", $2}' signal.lst` - sig_num="0 $sig_num" - sig_num_init=`$awk 'BEGIN { printf "0, " } - { printf "%d, ", $2} - END { printf "0\n"}' signal.lst` - ;; -esac -echo "The following signals are available:" + sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst` + sig_name=`$awk 'BEGIN { printf "ZERO " } + !/^NSIG/ { printf "%s ", $1 }' signal.lst` + sig_num=`$awk 'BEGIN { printf "0 " } + !/^NSIG/ { printf "%d ", $2 }' signal.lst` + sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " } + !/^NSIG/ { printf "\"%s\", ", $1 } + END { printf "0\n" }' signal.lst` + sig_num_init=`$awk 'BEGIN { printf "0, " } + !/^NSIG/ { printf "%d, ", $2} + END { printf "0\n"}' signal.lst` + ;; +esac +echo "The following $sig_count signals are available:" echo " " echo $sig_name | $awk \ 'BEGIN { linelen = 0 } @@ -11545,7 +12023,7 @@ $cat > ssize.c < #define Size_t $sizetype #define SSize_t $dflt -main() +int main() { if (sizeof(Size_t) == sizeof(SSize_t)) printf("$dflt\n"); @@ -11783,6 +12261,10 @@ esac set i_neterrno eval $setvar +: see if netinet/tcp.h is available +set netinet/tcp.h i_netinettcp +eval $inhdr + : see if this is a poll.h system set poll.h i_poll eval $inhdr @@ -11839,12 +12321,16 @@ $eunicefix Cppsym ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true : now check the C compiler for additional symbols +postprocess_cc_v='' +case "$osname" in +aix) postprocess_cc_v="|$tr , ' '" ;; +esac $cat >ccsym <tmp.c <&1\` +for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\` do case "\$i" in -D*) echo "\$i" | $sed 's/^-D//';; @@ -11853,6 +12339,7 @@ do done $rm -f try.c EOS +postprocess_cc_v='' chmod +x ccsym $eunicefix ccsym ./ccsym > ccsym1.raw @@ -11869,32 +12356,41 @@ $comm -13 ccsym.true ccsym.list >ccsym.own $comm -12 ccsym.true ccsym.list >ccsym.com $comm -23 ccsym.true ccsym.list >ccsym.cpp also='' -symbols='symbols' if $test -z ccsym.raw; then - echo "Your C compiler doesn't seem to define any symbol!" >&4 + echo "Your C compiler doesn't seem to define any symbols!" >&4 echo " " - echo "However, your C preprocessor defines the following ones:" + echo "However, your C preprocessor defines the following symbols:" $cat Cppsym.true + ccsymbols='' + cppsymbols=`$cat Cppsym.true` + cppsymbols=`echo $cppsymbols` + cppccsymbols="$cppsymbols" else if $test -s ccsym.com; then echo "Your C compiler and pre-processor define these symbols:" $sed -e 's/\(.*\)=.*/\1/' ccsym.com also='also ' symbols='ones' + cppccsymbols=`$cat ccsym.com` + cppccsymbols=`echo $cppccsymbols` $test "$silent" || sleep 1 fi if $test -s ccsym.cpp; then $test "$also" && echo " " - echo "Your C pre-processor ${also}defines the following $symbols:" + echo "Your C pre-processor ${also}defines the following symbols:" $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp also='further ' + cppsymbols=`$cat ccsym.cpp` + cppsymbols=`echo $cppsymbols` $test "$silent" || sleep 1 fi if $test -s ccsym.own; then $test "$also" && echo " " - echo "Your C compiler ${also}defines the following cpp variables:" + echo "Your C compiler ${also}defines the following cpp symbols:" $sed -e 's/\(.*\)=1/\1/' ccsym.own $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true + ccsymbols=`$cat ccsym.own` + ccsymbols=`echo $ccsymbols` $test "$silent" || sleep 1 fi fi @@ -11955,6 +12451,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 @@ -12143,8 +12647,6 @@ eval $setvar echo " " echo "Looking for extensions..." >&4 -tdir=`pwd` -cd $rsrc/ext : If we are using the old config.sh, known_extensions may contain : old or inaccurate or duplicate values. known_extensions='' @@ -12153,30 +12655,35 @@ nonxs_extensions='' : We do not just use MANIFEST because the user may have dropped : some additional extensions into the source tree and expect them : to be built. -for xxx in * ; do - case "$xxx" in - DynaLoader|dynaload) ;; - *) if $test -f $xxx/$xxx.xs; then - known_extensions="$known_extensions $xxx" - elif $test -f $xxx/Makefile.PL; then - nonxs_extensions="$nonxs_extensions $xxx" - else - if $test -d $xxx; then - # Look for nested extensions, eg. Devel/Dprof. - cd $xxx - for yyy in * ; do - if $test -f $yyy/$yyy.xs; then - known_extensions="$known_extensions $xxx/$yyy" - elif $test -f $yyy/Makefile.PL; then - nonxs_extensions="$nonxs_extensions $xxx/$yyy" - fi - done - cd .. - fi - fi - ;; - esac -done + +: Function to recursively find available extensions, ignoring DynaLoader +: NOTE: recursion limit of 10 to prevent runaway in case of symlink madness +find_extensions=' + for xxx in *; do + case "$xxx" in + DynaLoader|dynaload) ;; + *) + if $test -f $xxx/$xxx.xs; then + known_extensions="$known_extensions $1$xxx"; + elif $test -f $xxx/Makefile.PL; then + nonxs_extensions="$nonxs_extensions $1$xxx"; + else + if $test -d $xxx -a $# -lt 10; then + set $1$xxx/ $*; + cd $xxx; + eval $find_extensions; + cd ..; + shift; + fi + fi + ;; + esac + done' +tdir=`pwd` +cd $rsrc/ext +set +shift +eval $find_extensions set X $nonxs_extensions shift nonxs_extensions="$*" @@ -12478,6 +12985,7 @@ cc='$cc' cccdlflags='$cccdlflags' ccdlflags='$ccdlflags' ccflags='$ccflags' +ccsymbols='$ccsymbols' cf_by='$cf_by' cf_email='$cf_email' cf_time='$cf_time' @@ -12492,11 +13000,14 @@ cp='$cp' cpio='$cpio' cpp='$cpp' cpp_stuff='$cpp_stuff' +cppccsymbols='$cppccsymbols' cppflags='$cppflags' cpplast='$cpplast' cppminus='$cppminus' cpprun='$cpprun' cppstdin='$cppstdin' +cppsymbols='$cppsymbols' +crosscompile='$crosscompile' cryptlib='$cryptlib' csh='$csh' d_Gconvert='$d_Gconvert' @@ -12543,6 +13054,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' @@ -12583,6 +13095,7 @@ d_gethent='$d_gethent' d_gethname='$d_gethname' d_gethostprotos='$d_gethostprotos' d_getlogin='$d_getlogin' +d_getmntent='$d_getmntent' d_getnbyaddr='$d_getnbyaddr' d_getnbyname='$d_getnbyname' d_getnent='$d_getnent' @@ -12601,19 +13114,23 @@ 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' +d_hasmntopt='$d_hasmntopt' d_htonl='$d_htonl' d_index='$d_index' d_inetaton='$d_inetaton' -d_ino64t='$d_ino64t' +d_ino64_t='$d_ino64_t' d_int64t='$d_int64t' d_iovec_s='$d_iovec_s' d_isascii='$d_isascii' d_killpg='$d_killpg' d_lchown='$d_lchown' d_link='$d_link' +d_llseek='$d_llseek' d_locconv='$d_locconv' d_lockf64='$d_lockf64' d_lockf='$d_lockf' @@ -12622,9 +13139,11 @@ d_longlong='$d_longlong' d_lseek64='$d_lseek64' d_lstat64='$d_lstat64' d_lstat='$d_lstat' +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' @@ -12632,6 +13151,8 @@ d_memset='$d_memset' d_mkdir='$d_mkdir' d_mkfifo='$d_mkfifo' d_mktime='$d_mktime' +d_mmap='$d_mmap' +d_mprotect='$d_mprotect' d_msg='$d_msg' d_msg_ctrunc='$d_msg_ctrunc' d_msg_dontroute='$d_msg_dontroute' @@ -12643,10 +13164,13 @@ d_msgget='$d_msgget' d_msghdr_s='$d_msghdr_s' d_msgrcv='$d_msgrcv' d_msgsnd='$d_msgsnd' +d_msync='$d_msync' +d_munmap='$d_munmap' d_mymalloc='$d_mymalloc' d_nextkey64='$d_nextkey64' d_nice='$d_nice' -d_off64t='$d_off64t' +d_off64_t='$d_off64_t' +d_offset_t='$d_offset_t' d_old_pthread_create_joinable='$d_old_pthread_create_joinable' d_oldpthreads='$d_oldpthreads' d_oldsock='$d_oldsock' @@ -12713,6 +13237,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' @@ -12732,6 +13257,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' @@ -12755,6 +13281,7 @@ d_tcgetpgrp='$d_tcgetpgrp' d_tcsetpgrp='$d_tcsetpgrp' d_telldir64='$d_telldir64' d_telldir='$d_telldir' +d_telldirproto='$d_telldirproto' d_time='$d_time' d_times='$d_times' d_tmpfile64='$d_tmpfile64' @@ -12795,11 +13322,14 @@ eunicefix='$eunicefix' exe_ext='$exe_ext' expr='$expr' extensions='$extensions' +fflushNULL='$fflushNULL' +fflushall='$fflushall' find='$find' firstmakefile='$firstmakefile' flex='$flex' fpostype='$fpostype' freetype='$freetype' +full_ar='$full_ar' full_csh='$full_csh' full_sed='$full_sed' gccversion='$gccversion' @@ -12836,12 +13366,16 @@ i_mntent='$i_mntent' i_ndbm='$i_ndbm' i_netdb='$i_netdb' i_neterrno='$i_neterrno' +i_netinettcp='$i_netinettcp' i_niin='$i_niin' i_poll='$i_poll' +i_pthread='$i_pthread' 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' @@ -12852,6 +13386,7 @@ i_sysfile='$i_sysfile' i_sysfilio='$i_sysfilio' i_sysin='$i_sysin' i_sysioctl='$i_sysioctl' +i_sysmman='$i_sysmman' i_sysmount='$i_sysmount' i_sysndir='$i_sysndir' i_sysparam='$i_sysparam' @@ -12935,9 +13470,11 @@ medium='$medium' mips='$mips' mips_type='$mips_type' mkdir='$mkdir' +mmaptype='$mmaptype' models='$models' modetype='$modetype' more='$more' +multiarch='$multiarch' mv='$mv' myarchname='$myarchname' mydomain='$mydomain' @@ -13003,6 +13540,7 @@ shmattype='$shmattype' shortsize='$shortsize' shrpenv='$shrpenv' shsharp='$shsharp' +sig_count='$sig_count' sig_name='$sig_name' sig_name_init='$sig_name_init' sig_num='$sig_num' @@ -13034,6 +13572,7 @@ stdio_bufsiz='$stdio_bufsiz' stdio_cnt='$stdio_cnt' stdio_filbuf='$stdio_filbuf' stdio_ptr='$stdio_ptr' +stdio_stream_array='$stdio_stream_array' strings='$strings' submit='$submit' subversion='$subversion' @@ -13062,6 +13601,7 @@ useperlio='$useperlio' useposix='$useposix' usesfio='$usesfio' useshrplib='$useshrplib' +usesocks='$usesocks' usethreads='$usethreads' usevfork='$usevfork' usrinc='$usrinc' @@ -13079,8 +13619,8 @@ $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh : add special variables $test -f $src/patchlevel.h && \ -awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh -echo "CONFIG=true" >>config.sh +awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh +echo "CONFIGDOTSH=true" >>config.sh : propagate old symbols if $test -f UU/config.sh; then