X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Configure;h=0c92dcbbc66b4243b5aec0a3ed95b894af301692;hb=bbbf5d77f86bf2c0500b791adc75e990b503ac14;hp=d6a3062f6bf26501091dbb107abb8cda50d1f54e;hpb=d56c570797c673478b3a116a0ec3f47317f46643;p=p5sagit%2Fp5-mst-13.2.git diff --git a/Configure b/Configure index d6a3062..0c92dcb 100755 --- a/Configure +++ b/Configure @@ -20,10 +20,10 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Wed Oct 11 00:32:36 EET DST 2000 [metaconfig 3.0 PL70] +# Generated on Sun Jan 21 21:08:33 EET 2001 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) -cat >/tmp/c1$$ <c1$$ </tmp/c2$$ <c2$$ <&4 + $lns blurfl sym + if $test "X$issymlink" = X; then + sh -c "PATH= test -h sym" >/dev/null 2>&1 + if test $? = 0; then + issymlink="test -h" + fi + fi + if $test "X$issymlink" = X; then + if $test -h >/dev/null 2>&1; then + issymlink="$test -h" + echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4 + fi + fi + if $test "X$issymlink" = X; then + if $test -L sym 2>/dev/null; then + issymlink="$test -L" + fi + fi + if $test "X$issymlink" != X; then + echo "You can test for symbolic links with '$issymlink'." >&4 + else + echo "I do not know how you can test for symbolic links." >&4 + fi + $rm -f blurfl sym + ;; +*) echo "No symbolic links, so not testing for their testing..." >&4 + ;; +esac +echo " " + + +case "$mksymlinks" in +$define|true|[yY]*) + case "$src" in + ''|'.') echo "Cannot create symlinks in the original directory." >&4 + exit 1 + ;; + *) case "$lns:$issymlink" in + *"ln -s:"*"test -"?) + echo "Creating the symbolic links..." >&4 + echo "(First creating the subdirectories...)" >&4 + cd .. + awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do + read directory + test -z "$directory" && break + mkdir -p $directory + done + # Sanity check 1. + if test ! -d t/base; then + echo "Failed to create the subdirectories. Aborting." >&4 + exit 1 + fi + echo "(Then creating the symlinks...)" >&4 + awk '{print $1}' $src/MANIFEST | while true; do + read filename + test -z "$filename" && break + if test -f $filename; then + if $issymlink $filename; then + rm -f $filename + fi + fi + if test -f $filename; then + echo "$filename already exists, not symlinking." + else + ln -s $src/$filename $filename + fi + done + # Sanity check 2. + if test ! -f t/base/commonsense.t; then + echo "Failed to create the symlinks. Aborting." >&4 + exit 1 + fi + cd UU + ;; + *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4 + ;; + esac + ;; + esac + ;; +esac + : see whether [:lower:] and [:upper:] are supported character classes echo " " case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in @@ -2261,7 +2361,10 @@ if test -f config.sh; then rp="I see a config.sh file. Shall I use it to set the defaults?" . UU/myread case "$ans" in - n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;; + n*|N*) echo "OK, I'll ignore it." + mv config.sh config.sh.old + myuname="$newmyuname" + ;; *) echo "Fetching default answers from your old config.sh file..." >&4 tmp_n="$n" tmp_c="$c" @@ -2426,6 +2529,7 @@ EOM esac ;; next*) osname=next ;; + nonstop-ux) osname=nonstopux ;; POSIX-BC | posix-bc ) osname=posix-bc osvers="$3" ;; @@ -2671,7 +2775,6 @@ cd UU ;; esac test "$override" && . ./optdef.sh -myuname="$newmyuname" : Restore computed paths for file in $loclist $trylist; do @@ -2905,7 +3008,7 @@ if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1 then echo "Looks kind of like an OSF/1 system, but we'll see..." echo exit 0 >osf1 -elif test `echo abc | tr a-z A-Z` = Abc ; then +elif test `echo abc | $tr a-z A-Z` = Abc ; then xxx=`./loc addbib blurfl $pth` if $test -f $xxx; then echo "Looks kind of like a USG system with BSD features, but we'll see..." @@ -3285,7 +3388,7 @@ esac case "$fn" in *\(*) - expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok + expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok fn=`echo $fn | sed 's/(.*)//'` ;; esac @@ -3662,7 +3765,8 @@ esac cat <&4 @@ -4040,8 +4148,8 @@ and I got the following output: EOM dflt=y -if sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then - if sh -c './try' >>try.msg 2>&1; then +if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then + if $sh -c './try' >>try.msg 2>&1; then xxx=`./try` case "$xxx" in "Ok") dflt=n ;; @@ -4738,7 +4846,7 @@ unknown) s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g G s/\n/ /' | \ - sort | $sed -e 's/^.* //'` + $sort | $sed -e 's/^.* //'` eval set \$$# done $test -r $1 || set /usr/ccs/lib/libc.$so @@ -4798,7 +4906,7 @@ compiler, or your machine supports multiple models), you can override it here. EOM else dflt='' - echo $libpth | tr ' ' $trnl | sort | uniq > libpath + echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath cat >&4 < libnames +echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames set X `cat libnames` shift xxx=files @@ -6375,13 +6483,13 @@ EOM hpux) dflt='+z' ;; next) dflt='none' ;; irix*) dflt='-KPIC' ;; - svr4*|esix*|solaris) dflt='-KPIC' ;; + svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;; sunos) dflt='-pic' ;; *) dflt='none' ;; esac ;; *) case "$osname" in - svr4*|esix*|solaris) dflt='-fPIC' ;; + svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;; *) dflt='-fpic' ;; esac ;; esac ;; @@ -6457,7 +6565,7 @@ EOM next) dflt='none' ;; solaris) dflt='-G' ;; sunos) dflt='-assert nodefinitions' ;; - svr4*|esix*) dflt="-G $ldflags" ;; + svr4*|esix*|nonstopux) dflt="-G $ldflags" ;; *) dflt='none' ;; esac ;; @@ -6532,7 +6640,7 @@ $undef) ;; *) case "$useshrplib" in '') case "$osname" in - svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*) + svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*) dflt=y also='Building a shared libperl is required for dynamic loading to work on your system.' ;; @@ -7265,6 +7373,25 @@ rp='Perl administrator e-mail address' . ./myread perladmin="$ans" +: determine whether to only install version-specific parts. +echo " " +$cat <. Versions 5.003_02 and later of perl allow alternate IO -mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still -the default. This abstraction layer can use AT&T's sfio (if you already -have sfio installed) or regular stdio. Using PerlIO with sfio may cause -problems with some extension modules. Using PerlIO with stdio is safe, -but it is slower than plain stdio and therefore is not the default. +Previous version of $package used the standard IO mechanisms as +defined in . Versions 5.003_02 and later of perl allow +alternate IO mechanisms via the PerlIO abstraction layer, but the +stdio mechanism is still the default. This abstraction layer can +use AT&T's sfio (if you already have sfio installed) or regular stdio. +Using PerlIO with sfio may cause problems with some extension modules. If this doesn't make any sense to you, just accept the default '$dflt'. EOM @@ -7412,13 +7541,29 @@ y|Y) val="$define" ;; *) - echo "Ok, doing things the stdio way" + echo "Ok, doing things the stdio way." val="$undef" ;; esac set useperlio eval $setvar +case "$usesocks" in +$define|true|[yY]*) + case "$useperlio" in + $define|true|[yY]*) ;; + *) cat >&4 <try.c <<'EOCP' +#include +#include +#include +int main() { +#if defined(F_SETLK) && defined(F_SETLKW) + struct flock flock; + int retval, fd; + fd = open("try.c", O_RDONLY); + flock.l_type = F_RDLCK; + flock.l_whence = SEEK_SET; + flock.l_start = flock.l_len = 0; + retval = fcntl(fd, F_SETLK, &flock); + close(fd); + (retval < 0 ? exit(2) : exit(0)); +#else + exit(2); +#endif +} +EOCP +echo "Checking if fcntl-based file locking works... " +case "$d_fcntl" in +"$define") + set try + if eval $compile_ok; then + if ./try; then + echo "Yes, it seems to work." + val="$define" + else + echo "Nope, it didn't work." + val="$undef" + fi + else + echo "I'm unable to compile the test program, so I'll assume not." + val="$undef" + fi + ;; +*) val="$undef"; + echo "Nope, since you don't even have fcntl()." + ;; +esac +set d_fcntl_can_lock +eval $setvar +$rm -f try* + + hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift; while $test $# -ge 2; do case "$1" in @@ -9218,6 +9396,10 @@ set fstatvfs d_fstatvfs eval $inlibc +: see if fsync exists +set fsync d_fsync +eval $inlibc + : see if ftello exists set ftello d_ftello eval $inlibc @@ -9377,6 +9559,10 @@ echo " " set d_getnetprotos getnetent $i_netdb netdb.h eval $hasproto +: see if getpagesize exists +set getpagesize d_getpagsz +eval $inlibc + : see if getprotobyname exists set getprotobyname d_getpbyname @@ -10039,6 +10225,37 @@ rp="What is the size of a character (in bytes)?" charsize="$ans" $rm -f try.c try +: check for volatile keyword +echo " " +echo 'Checking to see if your C compiler knows about "volatile"...' >&4 +$cat >try.c <<'EOCP' +int main() +{ + typedef struct _goo_struct goo_struct; + goo_struct * volatile goo = ((goo_struct *)0); + struct _goo_struct { + long long_int; + int reg_int; + char char_var; + }; + typedef unsigned short foo_t; + char *volatile foo; + volatile int bar; + volatile foo_t blech; + foo = foo; +} +EOCP +if $cc -c $ccflags try.c >/dev/null 2>&1 ; then + val="$define" + echo "Yup, it does." +else + val="$undef" + echo "Nope, it doesn't." +fi +set d_volatile +eval $setvar +$rm -f try.* + echo " " $echo "Choosing the C types to be used for Perl's internal types..." >&4 @@ -10217,67 +10434,68 @@ case "$i64type" in ;; esac -$echo "Checking whether your NVs can preserve your UVs..." >&4 +$echo "Checking how many bits of your UVs your NVs can preserve..." >&4 +: volatile so that the compiler has to store it out to memory. +if test X"$d_volatile" = X"$define"; then + volatile=volatile +fi $cat <try.c #include -int main() { - $uvtype k = ($uvtype)~0, l; - $nvtype d; - l = k; - d = ($nvtype)l; - l = ($uvtype)d; - if (l == k) - printf("preserve\n"); - exit(0); -} -EOP -set try -if eval $compile; then - case "`./try$exe_ext`" in - preserve) d_nv_preserves_uv="$define" ;; - esac -fi -case "$d_nv_preserves_uv" in -$define) $echo "Yes, they can." 2>&1 ;; -*) $echo "No, they can't." 2>&1 - d_nv_preserves_uv="$undef" - ;; -esac - -$rm -f try.* try - -case "$d_nv_preserves_uv" in -"$define") d_nv_preserves_uv_bits=`expr $uvsize \* 8` ;; -*) $echo "Checking how many bits of your UVs your NVs can preserve..." >&4 - $cat <try.c -#include +#include +#include +#ifdef SIGFPE +$volatile int bletched = 0; +$signal_t blech(s) int s; { bletched = 1; } +#endif int main() { $uvtype u = 0; + $nvtype d; int n = 8 * $uvsize; int i; +#ifdef SIGFPE + signal(SIGFPE, blech); +#endif + for (i = 0; i < n; i++) { u = u << 1 | ($uvtype)1; - if (($uvtype)($nvtype)u != u) + d = ($nvtype)u; + if (($uvtype)d != u) break; + if (d <= 0) + break; + d = ($nvtype)(u - 1); + if (($uvtype)d != (u - 1)) + break; +#ifdef SIGFPE + if (bletched) { + break; +#endif + } } - printf("%d\n", i); + printf("%d\n", ((i == n) ? -n : i)); exit(0); } EOP - set try - if eval $compile; then - d_nv_preserves_uv_bits="`./try$exe_ext`" - fi - case "$d_nv_preserves_uv_bits" in - [1-9]*) $echo "Your NVs can preserve $d_nv_preserves_uv_bits bits of your UVs." 2>&1 ;; - *) $echo "Can't figure out how many bits your NVs preserve." 2>&1 - d_nv_preserves_uv_bits="$undef" - ;; - esac - $rm -f try.* try +set try + +d_nv_preserves_uv="$undef" +if eval $compile; then + d_nv_preserves_uv_bits="`./try$exe_ext`" +fi +case "$d_nv_preserves_uv_bits" in +\-[1-9]*) + d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits` + $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1 + d_nv_preserves_uv="$define" ;; +[1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1 + d_nv_preserves_uv="$undef" ;; +*) $echo "Can't figure out how many bits your NVs preserve." 2>&1 + d_nv_preserves_uv_bits="$undef" ;; esac +$rm -f try.* try + : check for off64_t echo " " @@ -10791,6 +11009,11 @@ $rm -f try.* try core set d_sanemcmp eval $setvar +: see if prototype for sbrk is available +echo " " +set d_sbrkproto sbrk $i_unistd unistd.h +eval $hasproto + : see if select exists set select d_select eval $inlibc @@ -11287,6 +11510,10 @@ fi set d_sigaction; eval $setvar $rm -f try try$_o try.c +: see if sigprocmask exists +set sigprocmask d_sigprocmask +eval $inlibc + : see if sigsetjmp exists echo " " case "$d_sigsetjmp" in @@ -11389,7 +11616,28 @@ esac : see if _ptr and _cnt from stdio act std echo " " -if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then + +if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then + echo "(Looks like you have stdio.h from BSD.)" + case "$stdio_ptr" in + '') stdio_ptr='((fp)->_p)' + ptr_lval=$define + ;; + *) ptr_lval=$d_stdio_ptr_lval;; + esac + case "$stdio_cnt" in + '') stdio_cnt='((fp)->_r)' + cnt_lval=$define + ;; + *) cnt_lval=$d_stdio_cnt_lval;; + esac + case "$stdio_base" in + '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';; + esac + case "$stdio_bufsiz" in + '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';; + esac +elif $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)' @@ -11429,6 +11677,7 @@ else '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';; esac fi + : test whether _ptr and _cnt really work echo "Checking how std your stdio is..." >&4 $cat >try.c <&4 +$cat >try.c < +/* Can we scream? */ +/* Eat dust sed :-) */ +/* In the buffer space, no one can hear you scream. */ +#define FILE_ptr(fp) $stdio_ptr +#define FILE_cnt(fp) $stdio_cnt +#include +int main() { + FILE *fp = fopen("try.c", "r"); + int c; + char *ptr; + size_t cnt; + if (!fp) { + puts("Fail even to read"); + exit(1); + } + c = getc(fp); /* Read away the first # */ + if (c == EOF) { + puts("Fail even to read"); + exit(1); + } + if (!( + 18 <= FILE_cnt(fp) && + strncmp(FILE_ptr(fp), "include \n", 18) == 0 + )) { + puts("Fail even to read"); + exit (1); + } + ptr = (char*) FILE_ptr(fp); + cnt = (size_t)FILE_cnt(fp); + + FILE_ptr(fp) += 42; + + if ((char*)FILE_ptr(fp) != (ptr + 42)) { + printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42)); + exit (1); + } + if (FILE_cnt(fp) <= 20) { + printf ("Fail (<20 chars to test)"); + exit (1); + } + if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) { + puts("Fail compare"); + exit (1); + } + if (cnt == FILE_cnt(fp)) { + puts("Pass_unchanged"); + exit (0); + } + if (FILE_cnt(fp) == (cnt - 42)) { + puts("Pass_changed"); + exit (0); + } + printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp)); + return 1; + +} +EOP + set try + if eval $compile; then + case `./try$exe_ext` in + Pass_changed) + echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4 + d_stdio_ptr_lval_sets_cnt="$define" ;; + Pass_unchanged) + echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4 + d_stdio_ptr_lval_nochange_cnt="$define" ;; + Fail*) + echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;; + *) + echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;; + esac + else + echo "It seems we can't set ptr in your stdio. Nevermind." >&4 + fi + $rm -f try.c try + ;; +esac + : see if _base is also standard val="$undef" case "$d_stdstdio" in @@ -11687,24 +12023,101 @@ EOM ;; esac -: see if strtoul exists -set strtoul d_strtoul +: see if strtoq exists +set strtoq d_strtoq eval $inlibc -: see if strtoull exists -set strtoull d_strtoull +: see if strtoul exists +set strtoul d_strtoul eval $inlibc -case "$d_longlong-$d_strtoull" in -"$define-$define") +case "$d_strtoul" in +"$define") $cat <try.c <<'EOCP' #include -#ifdef __hpux -#define strtoull __strtoull -#endif +#include +extern unsigned long int strtoul(char *s, char **, int); +static int bad = 0; +void check(char *s, unsigned long eul, int een) { + unsigned long gul; + errno = 0; + gul = strtoul(s, 0, 10); + if (!((gul == eul) && (errno == een))) + bad++; +} +int main() { + check(" 1", 1L, 0); + check(" 0", 0L, 0); +EOCP + case "$longsize" in + 8) + $cat >>try.c <<'EOCP' + check("18446744073709551615", 18446744073709551615UL, 0); + check("18446744073709551616", 18446744073709551615UL, ERANGE); +#if 0 /* strtoul() for /^-/ strings is undefined. */ + check("-1", 18446744073709551615UL, 0); + check("-18446744073709551614", 2, 0); + check("-18446744073709551615", 1, 0); + check("-18446744073709551616", 18446744073709551615UL, ERANGE); + check("-18446744073709551617", 18446744073709551615UL, ERANGE); +#endif +EOCP + ;; + 4) + $cat >>try.c <<'EOCP' + check("4294967295", 4294967295UL, 0); + check("4294967296", 4294967295UL, ERANGE); +#if 0 /* strtoul() for /^-/ strings is undefined. */ + check("-1", 4294967295UL, 0); + check("-4294967294", 2, 0); + check("-4294967295", 1, 0); + check("-4294967296", 4294967295UL, ERANGE); + check("-4294967297", 4294967295UL, ERANGE); +#endif +EOCP + ;; + *) +: Should we write these tests to be more portable by sprintf-ing +: ~0 and then manipulating that char string as input for strtol? + ;; + esac + $cat >>try.c <<'EOCP' + if (!bad) + printf("ok\n"); + return 0; +} +EOCP + set try + if eval $compile; then + case "`./try`" in + ok) echo "Your strtoul() seems to be working okay." ;; + *) cat <&4 +Your strtoul() doesn't seem to be working okay. +EOM + d_strtoul="$undef" + ;; + esac + fi + ;; +esac + +: see if strtoull exists +set strtoull d_strtoull +eval $inlibc + +case "$d_longlong-$d_strtoull" in +"$define-$define") + $cat <try.c <<'EOCP' +#include +#ifdef __hpux +#define strtoull __strtoull +#endif #include extern unsigned long long int strtoull(char *s, char **, int); static int bad = 0; @@ -11716,10 +12129,17 @@ int check(char *s, long long eull, int een) { bad++; } int main() { - check(" 1", 1LL, 0); - check(" 0", 0LL, 0); - check("18446744073709551615", 18446744073709551615ULL, 0); - check("18446744073709551616", 18446744073709551615ULL, ERANGE); + check(" 1", 1LL, 0); + check(" 0", 0LL, 0); + check("18446744073709551615", 18446744073709551615ULL, 0); + check("18446744073709551616", 18446744073709551615ULL, ERANGE); +#if 0 /* strtoull() for /^-/ strings is undefined. */ + check("-1", 18446744073709551615ULL, 0); + check("-18446744073709551614", 2LL, 0); + check("-18446744073709551615", 1LL, 0); + check("-18446744073709551616", 18446744073709551615ULL, ERANGE); + check("-18446744073709551617", 18446744073709551615ULL, ERANGE); +#endif if (!bad) printf("ok\n"); } @@ -11742,6 +12162,54 @@ esac set strtouq d_strtouq eval $inlibc +case "$d_strtouq" in +"$define") + $cat <try.c <<'EOCP' +#include +#include +extern unsigned long long int strtouq(char *s, char **, int); +static int bad = 0; +void check(char *s, unsigned long long eull, int een) { + unsigned long long gull; + errno = 0; + gull = strtouq(s, 0, 10); + if (!((gull == eull) && (errno == een))) + bad++; +} +int main() { + check(" 1", 1LL, 0); + check(" 0", 0LL, 0); + check("18446744073709551615", 18446744073709551615ULL, 0); + check("18446744073709551616", 18446744073709551615ULL, ERANGE); +#if 0 /* strtouq() for /^-/ strings is undefined. */ + check("-1", 18446744073709551615ULL, 0); + check("-18446744073709551614", 2LL, 0); + check("-18446744073709551615", 1LL, 0); + check("-18446744073709551616", 18446744073709551615ULL, ERANGE); + check("-18446744073709551617", 18446744073709551615ULL, ERANGE); +#endif + if (!bad) + printf("ok\n"); + return 0; +} +EOCP + set try + if eval $compile; then + case "`./try`" in + ok) echo "Your strtouq() seems to be working okay." ;; + *) cat <&4 +Your strtouq() doesn't seem to be working okay. +EOM + d_strtouq="$undef" + ;; + esac + fi + ;; +esac + : see if strxfrm exists set strxfrm d_strxfrm eval $inlibc @@ -11933,37 +12401,6 @@ esac set d_void_closedir eval $setvar $rm -f closedir* -: check for volatile keyword -echo " " -echo 'Checking to see if your C compiler knows about "volatile"...' >&4 -$cat >try.c <<'EOCP' -int main() -{ - typedef struct _goo_struct goo_struct; - goo_struct * volatile goo = ((goo_struct *)0); - struct _goo_struct { - long long_int; - int reg_int; - char char_var; - }; - typedef unsigned short foo_t; - char *volatile foo; - volatile int bar; - volatile foo_t blech; - foo = foo; -} -EOCP -if $cc -c $ccflags try.c >/dev/null 2>&1 ; then - val="$define" - echo "Yup, it does." -else - val="$undef" - echo "Nope, it doesn't." -fi -set d_volatile -eval $setvar -$rm -f try.* - : see if there is a wait4 set wait4 d_wait4 eval $inlibc @@ -13273,6 +13710,168 @@ rp="What is the type used for file modes for system calls (e.g. fchmod())?" set mode_t modetype int stdio.h sys/types.h eval $typedef_ask +: see if stdarg is available +echo " " +if $test `./findhdr stdarg.h`; then + echo " found." >&4 + valstd="$define" +else + echo " NOT found." >&4 + valstd="$undef" +fi + +: see if varags is available +echo " " +if $test `./findhdr varargs.h`; then + echo " found." >&4 +else + echo " NOT found, but that's ok (I hope)." >&4 +fi + +: set up the varargs testing programs +$cat > varargs.c < +#endif +#ifdef I_VARARGS +#include +#endif + +#ifdef I_STDARG +int f(char *p, ...) +#else +int f(va_alist) +va_dcl +#endif +{ + va_list ap; +#ifndef I_STDARG + char *p; +#endif +#ifdef I_STDARG + va_start(ap,p); +#else + va_start(ap); + p = va_arg(ap, char *); +#endif + va_end(ap); +} +EOP +$cat > varargs </dev/null 2>&1; then + echo "true" +else + echo "false" +fi +$rm -f varargs$_o +EOP +chmod +x varargs + +: now check which varargs header should be included +echo " " +i_varhdr='' +case "$valstd" in +"$define") + if `./varargs I_STDARG`; then + val='stdarg.h' + elif `./varargs I_VARARGS`; then + val='varargs.h' + fi + ;; +*) + if `./varargs I_VARARGS`; then + val='varargs.h' + fi + ;; +esac +case "$val" in +'') +echo "I could not find the definition for va_dcl... You have problems..." >&4 + val="$undef"; set i_stdarg; eval $setvar + val="$undef"; set i_varargs; eval $setvar + ;; +*) + set i_varhdr + eval $setvar + case "$i_varhdr" in + stdarg.h) + val="$define"; set i_stdarg; eval $setvar + val="$undef"; set i_varargs; eval $setvar + ;; + varargs.h) + val="$undef"; set i_stdarg; eval $setvar + val="$define"; set i_varargs; eval $setvar + ;; + esac + echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;; +esac +$rm -f varargs* + +: see if we need va_copy +echo " " +case "$i_stdarg" in +"$define") + $cat >try.c < +#include +#$i_stdlib I_STDLIB +#ifdef I_STDLIB +#include +#endif +#include + +int +ivfprintf(FILE *f, const char *fmt, va_list *valp) +{ + return vfprintf(f, fmt, *valp); +} + +int +myvfprintf(FILE *f, const char *fmt, va_list val) +{ + return ivfprintf(f, fmt, &val); +} + +int +myprintf(char *fmt, ...) +{ + va_list val; + va_start(val, fmt); + return myvfprintf(stdout, fmt, val); +} + +int +main(int ac, char **av) +{ + signal(SIGSEGV, exit); + + myprintf("%s%cs all right, then\n", "that", '\''); + exit(0); +} +EOCP + set try + if eval $compile && ./try 2>&1 >/dev/null; then + case "`./try`" in + "that's all right, then") + okay=yes + ;; + esac + fi + case "$okay" in + yes) echo "It seems that you don't need va_copy()." >&4 + need_va_copy="$undef" + ;; + *) echo "It seems that va_copy() or similar will be needed." >&4 + need_va_copy="$define" + ;; + esac + $rm -f try.* core core.* *.core *.core.* + ;; +*) echo "You don't have , not checking for va_copy()." >&4 + ;; +esac + : define a fucntion to check prototypes $cat > protochk </dev/null 2>&1 ; then +echo '#include ' | $cppstdin $cppminus > stdioh +if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then echo "Your stdio uses unsigned chars." >&4 stdchar="unsigned char" else echo "Your stdio uses signed chars." >&4 stdchar="char" fi +$rm -f stdioh + + : see if time exists echo " " @@ -14480,7 +15096,7 @@ mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900 news3700 -news700 news800 news900 NeXT NLS ns16000 ns32000 +news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000 ns32016 ns32332 ns32k nsc32000 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc @@ -14513,7 +15129,7 @@ EOSH ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b $cat Cppsym.know > Cppsym.c -$cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | sort | uniq > Cppsym.know +$cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know $rm -f Cppsym.a Cppsym.b Cppsym.c cat < Cppsym $startsh @@ -14696,108 +15312,6 @@ val=$val3; set i_termios; eval $setvar 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 - echo " found." >&4 - valstd="$define" -else - echo " NOT found." >&4 - valstd="$undef" -fi - -: see if varags is available -echo " " -if $test `./findhdr varargs.h`; then - echo " found." >&4 -else - echo " NOT found, but that's ok (I hope)." >&4 -fi - -: set up the varargs testing programs -$cat > varargs.c < -#endif -#ifdef I_VARARGS -#include -#endif - -#ifdef I_STDARG -int f(char *p, ...) -#else -int f(va_alist) -va_dcl -#endif -{ - va_list ap; -#ifndef I_STDARG - char *p; -#endif -#ifdef I_STDARG - va_start(ap,p); -#else - va_start(ap); - p = va_arg(ap, char *); -#endif - va_end(ap); -} -EOP -$cat > varargs </dev/null 2>&1; then - echo "true" -else - echo "false" -fi -$rm -f varargs$_o -EOP -chmod +x varargs - -: now check which varargs header should be included -echo " " -i_varhdr='' -case "$valstd" in -"$define") - if `./varargs I_STDARG`; then - val='stdarg.h' - elif `./varargs I_VARARGS`; then - val='varargs.h' - fi - ;; -*) - if `./varargs I_VARARGS`; then - val='varargs.h' - fi - ;; -esac -case "$val" in -'') -echo "I could not find the definition for va_dcl... You have problems..." >&4 - val="$undef"; set i_stdarg; eval $setvar - val="$undef"; set i_varargs; eval $setvar - ;; -*) - set i_varhdr - eval $setvar - case "$i_varhdr" in - stdarg.h) - val="$define"; set i_stdarg; eval $setvar - val="$undef"; set i_varargs; eval $setvar - ;; - varargs.h) - val="$undef"; set i_stdarg; eval $setvar - val="$define"; set i_varargs; eval $setvar - ;; - esac - echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;; -esac -$rm -f varargs* - : see if stddef is available set stddef.h i_stddef eval $inhdr @@ -15171,14 +15685,21 @@ extensions="$*" : Remove libraries needed only for extensions : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary. -case "$usedl" in -$define|true|[yY]*) - set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'` - shift - perllibs="$*" - ;; -*) perllibs="$libs" - ;; +: The exception is SunOS 4.x, which needs them. +case "${osname}X${osvers}" in +sunos*X4*) + perllibs="$libs" + ;; +*) case "$usedl" in + $define|true|[yY]*) + set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'` + shift + perllibs="$*" + ;; + *) perllibs="$libs" + ;; + esac + ;; esac : Remove build directory name from cppstdin so it can be used from @@ -15335,6 +15856,7 @@ d_PRIo64='$d_PRIo64' d_PRIu64='$d_PRIu64' d_PRIx64='$d_PRIx64' d_SCNfldbl='$d_SCNfldbl' +d__fwalk='$d__fwalk' d_access='$d_access' d_accessx='$d_accessx' d_alarm='$d_alarm' @@ -15381,6 +15903,7 @@ d_eunice='$d_eunice' d_fchmod='$d_fchmod' d_fchown='$d_fchown' d_fcntl='$d_fcntl' +d_fcntl_can_lock='$d_fcntl_can_lock' d_fd_macros='$d_fd_macros' d_fd_set='$d_fd_set' d_fds_bits='$d_fds_bits' @@ -15396,6 +15919,7 @@ d_fseeko='$d_fseeko' d_fsetpos='$d_fsetpos' d_fstatfs='$d_fstatfs' d_fstatvfs='$d_fstatvfs' +d_fsync='$d_fsync' d_ftello='$d_ftello' d_ftime='$d_ftime' d_getcwd='$d_getcwd' @@ -15415,6 +15939,7 @@ d_getnbyaddr='$d_getnbyaddr' d_getnbyname='$d_getnbyname' d_getnent='$d_getnent' d_getnetprotos='$d_getnetprotos' +d_getpagsz='$d_getpagsz' d_getpbyname='$d_getpbyname' d_getpbynumber='$d_getpbynumber' d_getpent='$d_getpent' @@ -15518,6 +16043,7 @@ d_rmdir='$d_rmdir' d_safebcpy='$d_safebcpy' d_safemcpy='$d_safemcpy' d_sanemcmp='$d_sanemcmp' +d_sbrkproto='$d_sbrkproto' d_sched_yield='$d_sched_yield' d_scm_rights='$d_scm_rights' d_seekdir='$d_seekdir' @@ -15560,6 +16086,7 @@ d_shmctl='$d_shmctl' d_shmdt='$d_shmdt' d_shmget='$d_shmget' d_sigaction='$d_sigaction' +d_sigprocmask='$d_sigprocmask' d_sigsetjmp='$d_sigsetjmp' d_socket='$d_socket' d_socklen_t='$d_socklen_t' @@ -15572,6 +16099,8 @@ d_statfs_s='$d_statfs_s' d_statvfs='$d_statvfs' d_stdio_cnt_lval='$d_stdio_cnt_lval' d_stdio_ptr_lval='$d_stdio_ptr_lval' +d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt' +d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt' d_stdio_stream_array='$d_stdio_stream_array' d_stdiobase='$d_stdiobase' d_stdstdio='$d_stdstdio' @@ -15584,6 +16113,7 @@ d_strtod='$d_strtod' d_strtol='$d_strtol' d_strtold='$d_strtold' d_strtoll='$d_strtoll' +d_strtoq='$d_strtoq' d_strtoul='$d_strtoul' d_strtoull='$d_strtoull' d_strtouq='$d_strtouq' @@ -15775,6 +16305,7 @@ installvendorarch='$installvendorarch' installvendorbin='$installvendorbin' installvendorlib='$installvendorlib' intsize='$intsize' +issymlink='$issymlink' ivdformat='$ivdformat' ivsize='$ivsize' ivtype='$ivtype' @@ -15837,6 +16368,7 @@ mydomain='$mydomain' myhostname='$myhostname' myuname='$myuname' n='$n' +need_va_copy='$need_va_copy' netdb_hlen_type='$netdb_hlen_type' netdb_host_type='$netdb_host_type' netdb_name_type='$netdb_name_type' @@ -15929,6 +16461,7 @@ sig_name='$sig_name' sig_name_init='$sig_name_init' sig_num='$sig_num' sig_num_init='$sig_num_init' +sig_size='$sig_size' signal_t='$signal_t' sitearch='$sitearch' sitearchexp='$sitearchexp' @@ -16049,9 +16582,9 @@ echo "CONFIGDOTSH=true" >>config.sh : propagate old symbols if $test -f UU/config.sh; then - UU/oldconfig.sh + UU/oldconfig.sh sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\ - sort | uniq -u >UU/oldsyms + $sort | $uniq -u >UU/oldsyms set X `cat UU/oldsyms` shift case $# in