X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/b68c599a1231c4d11ec0b0a667ce0c407c357eab..9c3f0156b51bc2984d1bae9a562cf5a8f98b6aab:/Configure diff --git a/Configure b/Configure index 5b21d0e..1a17a7e 100755 --- a/Configure +++ b/Configure @@ -16,16 +16,19 @@ # The dist package (which contains metaconfig) is available via SVN: # svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist # +# Though this script was generated by metaconfig from metaunits, it is +# OK to send patches against Configure itself. It's up to the Configure +# pumpkin to backport the patch to the metaunits if it is accepted. +# For more information on patching Configure, see pod/perlhack.pod +# +# The metaunits are also available from the public git repository: +# http://perl5.git.perl.org/metaconfig.git/ or +# $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig # -# Though this script was generated by metaconfig, it is OK to send -# patches against it. It's up to the Configure pumpkin to backport -# the patch to the metaunits if it is accepted. # See Porting/pumpkin.pod for more information on metaconfig. # -# $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $ -# -# Generated on Tue Jan 22 17:46:32 CET 2008 [metaconfig 3.0 PL70] +# Generated on Sat Oct 1 12:33:17 CEST 2011 [metaconfig 3.5 PL0] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ <&4 <&4 </dev/null 2>&1`; then echo "#!$xcat" >sharp $eunicefix sharp chmod +x sharp - ./sharp > today + ./sharp > today 2>/dev/null if test -s today; then sharpbang='#!' else echo "#! $xcat" > sharp $eunicefix sharp chmod +x sharp - ./sharp > today + ./sharp > today 2>/dev/null if test -s today; then sharpbang='#! ' else @@ -1646,7 +1690,7 @@ while test $# -gt 0; do esac shift ;; - -V) echo "$me generated by metaconfig 3.0 PL70." >&2 + -V) echo "$me generated by metaconfig 3.5 PL0." >&2 exit 0;; --) break;; -*) echo "$me: unknown option $1" >&2; shift; error=true;; @@ -1934,7 +1978,7 @@ rm -f .echotmp echo " " if test -f "$rsrc/MANIFEST"; then echo "First let's make sure your kit is complete. Checking..." >&4 - awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" |\ + awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \ (split -l 50 2>/dev/null || split -50) rm -f missing tmppwd=`pwd` @@ -2122,7 +2166,8 @@ EOF : See if we are using a devel version and want that xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` case "$usedevel" in -$define|true|[yY]*) ;; +$define|true|[yY]*) + usedevel="$define" ;; *) case "$xversion" in *[13579]) cat >&4 </dev/null; then + echo "Substituting less -R for less." + less="$less -R" + _less=$less + fi + ;; +esac case "$ln" in ln) echo "Substituting cp for ln." @@ -3589,10 +3645,10 @@ cat >filexp <. Versions 5.003_02 and later of $package allow -alternate IO mechanisms via the PerlIO abstraction layer, but the -stdio mechanism is still available if needed. The 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 -rp='Use the PerlIO abstraction layer?' -. ./myread -case "$ans" in -y|Y) - val="$define" - ;; -*) - 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 <&4 @@ -4112,16 +4097,13 @@ else perl_patchlevel=0 $echo "(You do not have patchlevel.h. Eek.)" fi -if $test -r $rsrc/.patch ; then - if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then - perl_patchlevel=`cat $rsrc/.patch` - fi -fi : Define a handy string here to avoid duplication in myconfig.SH and configpm. version_patchlevel_string="version $patchlevel subversion $subversion" case "$perl_patchlevel" in 0|'') ;; -*) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;; +*) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'` + version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" + ;; esac $echo "(You have $package $version_patchlevel_string.)" @@ -4153,13 +4135,8 @@ $define|true|[yY]*) dflt='y';; *) # Catch case where user specified ithreads or 5005threads but # forgot -Dusethreads (A.D. 4/2002) case "$useithreads$use5005threads" in - *$define*) - case "$useperlio" in - "$define") dflt='y' ;; - *) dflt='n' ;; - esac - ;; - *) dflt='n';; + *$define*) dflt='y';; + *) dflt='n';; esac ;; esac @@ -4261,16 +4238,6 @@ EOM useithreads="$usethreads" fi -if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then - cat >&4 < libc.ptf xscan='eval "libc.list"; $echo $n ".$c" >&4' xrun='eval "libc.list"; echo "done." >&4' -xxx='[ADTSIW]' +xxx='[ADTSIWi]' if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\ eval $xscan;\ $contains '^fprintf$' libc.list >/dev/null 2>&1; then @@ -7645,31 +7666,31 @@ else echo " " echo "$nm didn't seem to work right. Trying $ar instead..." >&4 com='' - if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then + if $ar t $libc > libc.tmp && \ + $contains '^fprintf$' libc.tmp >/dev/null 2>&1 + then for thisname in $libnames $libc; do $ar t $thisname >>libc.tmp done $sed -e "s/\\$_o\$//" < libc.tmp > libc.list echo "Ok." >&4 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then - # Repeat libc to extract forwarders to DLL entries too for thisname in $libnames $libc; do $ar tv $thisname >>libc.tmp - # Revision 50 of EMX has bug in $ar. - # it will not extract forwarders to DLL entries - # Use emximp which will extract exactly them. emximp -o tmp.imp $thisname \ 2>/dev/null && \ $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \ < tmp.imp >>libc.tmp - $rm tmp.imp + $rm -f tmp.imp done $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list echo "Ok." >&4 else echo "$ar didn't seem to work right." >&4 echo "Maybe this is a Cray...trying bld instead..." >&4 - if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list + if bld t $libc | \ + $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list && + $test -s libc.list then for thisname in $libnames; do bld t $libnames | \ @@ -7694,7 +7715,8 @@ define) *) if $test -f /lib/syscalls.exp; then echo " " echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4 - $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list + $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \ + /lib/syscalls.exp >>libc.list fi ;; esac @@ -7739,6 +7761,10 @@ case "$3" in -a) tf=libc.tmp; tdc="[]";; *) tlook="^$1\$"; tf=libc.list; tdc="()";; esac; +case "$d_cplusplus" in + $define) extern_C="extern \"C\"" ;; + *) extern_C="extern" ;; +esac; tx=yes; case "$reuseval-$4" in true-) ;; @@ -7747,20 +7773,17 @@ esac; case "$tx" in yes) tval=false; - case "$d_cplusplus" in - $define) extern_C=\"C\";; - esac; if $test "$runnm" = true; then if $contains $tlook $tf >/dev/null 2>&1; then tval=true; elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then - echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c; + echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c; $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true; $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; }; $rm_try; fi; else - echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c; + echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c; $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true; $rm_try; fi; @@ -7849,6 +7872,7 @@ esac rp="Do you wish to use dynamic loading?" . ./myread usedl="$ans" +bin_ELF="$undef" case "$ans" in y*) usedl="$define" case "$dlsrc" in @@ -7945,6 +7969,7 @@ EOM You appear to have ELF support. I'll use $cc to build dynamic libraries. EOM dflt="$cc" + bin_ELF="$define" else echo "I'll use ld to build dynamic libraries." dflt='ld' @@ -7971,6 +7996,7 @@ EOM case "$lddlflags" in '') case "$osname" in beos) dflt='-nostart' ;; + haiku) dflt='-shared' ;; hpux) dflt='-b'; case "$gccversion" in '') dflt="$dflt +vnocompatwarnings" ;; @@ -8007,6 +8033,16 @@ EOM ''|' ') dflt='none' ;; esac + case "$ldflags" in + *-fstack-protector*) + case "$dflt" in + *-fstack-protector*) ;; # Don't add it again + *) dflt="$dflt -fstack-protector" ;; + esac + ;; + esac + + rp="Any special flags to pass to $ld to create a dynamically loaded library?" . ./myread case "$ans" in @@ -8054,7 +8090,7 @@ $undef) ;; *) case "$useshrplib" in '') case "$osname" in - svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*) + svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*) dflt=y also='Building a shared libperl is required for dynamic loading to work on your system.' ;; @@ -8102,15 +8138,22 @@ esac case "$useshrplib" in true) + case "$userelocatableinc" in + true|define) + echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4 + echo "See INSTALL for an explanation why that won't work." >&4 + exit 4 + ;; + esac case "$libperl" in '') # Figure out a good name for libperl.so. Since it gets stored in # a version-specific architecture-dependent library, the version # number isn't really that important, except for making cc/ld happy. # - # A name such as libperl.so.3.1 + # A name such as libperl.so.10.1 majmin="libperl.$so.$patchlevel.$subversion" - # A name such as libperl.so.301 + # A name such as libperl.so.100 majonly=`echo $patchlevel $subversion | $awk '{printf "%d%02d", $1, $2}'` majonly=libperl.$so.$majonly @@ -8124,8 +8167,12 @@ true) linux*|gnu*) # ld won't link with a bare -lperl otherwise. dflt=libperl.$so ;; - cygwin*) # ld links against an importlib - dflt=libperl$lib_ext + cygwin*) # ld links now against the dll directly + majmin="cygperl5_${patchlevel}_${subversion}.${so}" + majonly=`echo $patchlevel $subversion | + $awk '{printf "%03d%03d", $1, $2}'` + majonly=cygperl5.$majonly.$so + dflt=$majmin ;; *) # Try to guess based on whether libc has major.minor. case "$libc" in @@ -8205,7 +8252,7 @@ if "$useshrplib"; then solaris) xxx="-R $shrpdir" ;; - freebsd|netbsd|openbsd|interix|dragonfly) + freebsd|mirbsd|netbsd|openbsd|interix|dragonfly) xxx="-Wl,-R$shrpdir" ;; bsdos|linux|irix*|dec_osf|gnu*) @@ -8217,10 +8264,16 @@ if "$useshrplib"; then beos) # beos doesn't like the default, either. ;; + haiku) + # Haiku doesn't like the default, either. + ;; hpux*) # hpux doesn't like the default, either. tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\"" ;; + cygwin) + # cygwin needs only ldlibpth + ;; *) tmp_shrpenv="env LD_RUN_PATH=$shrpdir" ;; @@ -8660,11 +8713,11 @@ case "$myhostname" in echo "(Attempting domain name extraction from $tans)" dflt=.`$sed -n -e 's/ / /g' \ -e 's/^search *\([^ ]*\).*/\1/p' $tans \ - | ./tr '[A-Z]' '[a-z]' 2>/dev/null` + -e 1q 2>/dev/null` case "$dflt" in .) dflt=.`$sed -n -e 's/ / /g' \ -e 's/^domain *\([^ ]*\).*/\1/p' $tans \ - | ./tr '[A-Z]' '[a-z]' 2>/dev/null` + -e 1q 2>/dev/null` ;; esac fi @@ -9283,6 +9336,9 @@ EOCP ;; esac +: Check if we want perlio +useperlio="$define" + : Set the vendorbin variables case "$vendorprefix" in '') d_vendorbin="$undef" @@ -9440,6 +9496,46 @@ esac prefixvar=vendorscript . ./installprefix +: script used to emit important warnings +cat >warn <msg +else + cat >msg +fi +echo "*** WARNING:" >&4 +sed -e 's/^/*** /' &4 +echo "*** " >&4 +cat msg >>config.msg +echo " " >>config.msg +rm -f msg +EOS +chmod +x warn +$eunicefix warn + +: see which of string.h or strings.h is needed +echo " " +strings=`./findhdr string.h` +if $test "$strings" && $test -r "$strings"; then + echo "Using instead of ." >&4 + val="$define" +else + val="$undef" + strings=`./findhdr strings.h` + if $test "$strings" && $test -r "$strings"; then + echo "Using instead of ." >&4 + else + ./warn "No string header found -- You'll surely have problems." + fi +fi +set i_string +eval $setvar +case "$i_string" in +"$undef") strings=`./findhdr strings.h`;; +*) strings=`./findhdr string.h`;; +esac + : see if qgcvt exists set qgcvt d_qgcvt eval $inlibc @@ -9613,15 +9709,18 @@ char *myname = "sprintf"; #include -#define I_STDLIB $i_stdlib +#$i_stdlib I_STDLIB #ifdef I_STDLIB #include #endif +#$i_string I_STRING +#ifdef I_STRING +# include +#else +# include +#endif -int -checkit(expect, got) -char *expect; -char *got; +int checkit(char *expect, char *got) { if (strcmp(expect, got)) { printf("%s oddity: Expected %s, got %s\n", @@ -9727,7 +9826,7 @@ done case "$d_longdbl$uselongdouble" in "$define$define") - : again, add prefered functions to our list first + : again, add preferred functions to our list first xxx_ld_list="" for xxx_convert in $gconvert_ld_preference; do case $xxx_convert in @@ -9864,11 +9963,31 @@ eval $inlibc set alarm d_alarm eval $inlibc +: see if 64bit time functions exists + +set ctime64 d_ctime64 +eval $inlibc + +set localtime64 d_localtime64 +eval $inlibc + +set gmtime64 d_gmtime64 +eval $inlibc + +set mktime64 d_mktime64 +eval $inlibc + +set difftime64 d_difftime64 +eval $inlibc + +set asctime64 d_asctime64 +eval $inlibc + : see if POSIX threads are available set pthread.h i_pthread eval $inhdr -: define a fucntion to check prototypes +: define a function to check prototypes $cat > protochk <&4 +$cat >attrib.c <<'EOCP' +#include +int I_am_deprecated(void) __attribute__((deprecated)); +EOCP +if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then + if $contains 'warning' attrib.out >/dev/null 2>&1; then + echo "Your C compiler doesn't support __attribute__((deprecated))." + val="$undef" + else + echo "Your C compiler supports __attribute__((deprecated))." + val="$define" + fi +else + echo "Your C compiler doesn't seem to understand __attribute__ at all." + val="$undef" +fi +;; +*) val="$d_attribute_deprecated" ;; +esac +set d_attribute_deprecated +eval $setvar +$rm -f attrib* + : Look for GCC-style attribute warn_unused_result case "$d_attribute_warn_unused_result" in '') @@ -10553,7 +10700,7 @@ int main(void) { EOCP set try - if eval $compile; then + if eval $compile && $run ./try; then echo "Your C compiler supports __builtin_choose_expr." val="$define" else @@ -10573,18 +10720,20 @@ case "$d_builtin_expect" in '') echo " " echo "Checking whether your compiler can handle __builtin_expect ..." >&4 - $cat >builtin.c <<'EOCP' + $cat >try.c <<'EOCP' int main(void) { int n = 50; if ( __builtin_expect(n, 0) ) n = 1; + /* Remember shell exit code truth is 0, C truth is non-zero */ + return !(n == 1); } EOCP set try - if eval $compile; then - echo "Your C compiler supports __builtin_choose_expr." + if eval $compile && $run ./try; then + echo "Your C compiler supports __builtin_expect." val="$define" else - echo "Your C compiler doesn't seem to understand __builtin_choose_expr." + echo "Your C compiler doesn't seem to understand __builtin_expect." val="$undef" fi ;; @@ -10809,7 +10958,7 @@ int main() signal(SIGFPE, blech); /* Don't let compiler optimize the test away. Store the number - in a writable string for gcc to pass to sscanf under HP/UX. + in a writable string for gcc to pass to sscanf under HP-UX. */ sprintf(str, "2147483647"); sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */ @@ -10876,7 +11025,7 @@ int main() optimized the whole file away */ /* Store the number in a writable string for gcc to pass to - sscanf under HP/UX. + sscanf under HP-UX. */ sprintf(str, "-123"); sscanf(str, "%lf", &f); /* f = -123.; */ @@ -11131,20 +11280,55 @@ eval $inlibc echo " " -echo "Checking the availability of certain socket constants..." >&4 -for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do - enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'` - $cat >try.c <&4 +$cat >try.c < #include int main() { - int i = $ENUM; +struct sockaddr sa; +return (sa.sa_len); } EOF - val="$undef" - set try; if eval $compile; then - val="$define" - fi +val="$undef" +set try; if eval $compile; then + val="$define" +fi +set d_sockaddr_sa_len; eval $setvar +$rm_try + +echo " " +echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4 +$cat >try.c < +#include +#include +int main() { +struct sockaddr_in6 sin6; +return (sin6.sin6_scope_id); +} +EOF +val="$undef" +set try; if eval $compile; then + val="$define" +fi +set d_sin6_scope_id; eval $setvar +$rm_try + +echo " " +echo "Checking the availability of certain socket constants..." >&4 +for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do + enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'` + $cat >try.c < +#include +int main() { + int i = $ENUM; +} +EOF + val="$undef" + set try; if eval $compile; then + val="$define" + fi set d_${enum}; eval $setvar $rm_try done @@ -11248,11 +11432,11 @@ case "$d_crypt_r" in define) case "$crypt_r_proto" in ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);' - ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;; + ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;; esac case "$crypt_r_proto" in ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);' - ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;; + ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;; esac case "$crypt_r_proto" in ''|0) d_crypt_r=undef @@ -11309,7 +11493,7 @@ case "$d_ctermid_r" in define) case "$ctermid_r_proto" in ''|0) try='char* ctermid_r(char*);' - ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;; + ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;; esac case "$ctermid_r_proto" in ''|0) d_ctermid_r=undef @@ -11350,19 +11534,19 @@ case "$d_ctime_r" in define) case "$ctime_r_proto" in ''|0) try='char* ctime_r(const time_t*, char*);' - ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;; + ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;; esac case "$ctime_r_proto" in ''|0) try='char* ctime_r(const time_t*, char*, int);' - ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;; + ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;; esac case "$ctime_r_proto" in ''|0) try='int ctime_r(const time_t*, char*);' - ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;; + ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;; esac case "$ctime_r_proto" in ''|0) try='int ctime_r(const time_t*, char*, int);' - ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;; + ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;; esac case "$ctime_r_proto" in ''|0) d_ctime_r=undef @@ -11768,7 +11952,7 @@ case "$d_drand48_r" in define) case "$drand48_r_proto" in ''|0) try='int drand48_r(struct drand48_data*, double*);' - ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;; + ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;; esac case "$drand48_r_proto" in ''|0) d_drand48_r=undef @@ -11851,11 +12035,11 @@ case "$d_endgrent_r" in define) case "$endgrent_r_proto" in ''|0) try='int endgrent_r(FILE**);' - ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;; + ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;; esac case "$endgrent_r_proto" in ''|0) try='void endgrent_r(FILE**);' - ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;; + ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;; esac case "$endgrent_r_proto" in ''|0) d_endgrent_r=undef @@ -11904,11 +12088,11 @@ case "$d_endhostent_r" in define) case "$endhostent_r_proto" in ''|0) try='int endhostent_r(struct hostent_data*);' - ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;; + ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;; esac case "$endhostent_r_proto" in ''|0) try='void endhostent_r(struct hostent_data*);' - ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;; + ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;; esac case "$endhostent_r_proto" in ''|0) d_endhostent_r=undef @@ -11953,11 +12137,11 @@ case "$d_endnetent_r" in define) case "$endnetent_r_proto" in ''|0) try='int endnetent_r(struct netent_data*);' - ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;; + ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;; esac case "$endnetent_r_proto" in ''|0) try='void endnetent_r(struct netent_data*);' - ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;; + ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;; esac case "$endnetent_r_proto" in ''|0) d_endnetent_r=undef @@ -12002,11 +12186,11 @@ case "$d_endprotoent_r" in define) case "$endprotoent_r_proto" in ''|0) try='int endprotoent_r(struct protoent_data*);' - ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;; + ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;; esac case "$endprotoent_r_proto" in ''|0) try='void endprotoent_r(struct protoent_data*);' - ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;; + ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;; esac case "$endprotoent_r_proto" in ''|0) d_endprotoent_r=undef @@ -12139,11 +12323,11 @@ case "$d_endpwent_r" in define) case "$endpwent_r_proto" in ''|0) try='int endpwent_r(FILE**);' - ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;; + ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;; esac case "$endpwent_r_proto" in ''|0) try='void endpwent_r(FILE**);' - ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;; + ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;; esac case "$endpwent_r_proto" in ''|0) d_endpwent_r=undef @@ -12188,11 +12372,11 @@ case "$d_endservent_r" in define) case "$endservent_r_proto" in ''|0) try='int endservent_r(struct servent_data*);' - ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;; + ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;; esac case "$endservent_r_proto" in ''|0) try='void endservent_r(struct servent_data*);' - ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;; + ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;; esac case "$endservent_r_proto" in ''|0) d_endservent_r=undef @@ -12271,28 +12455,6 @@ set d_open3 eval $setvar $rm_try -: see which of string.h or strings.h is needed -echo " " -strings=`./findhdr string.h` -if $test "$strings" && $test -r "$strings"; then - echo "Using instead of ." >&4 - val="$define" -else - val="$undef" - strings=`./findhdr strings.h` - if $test "$strings" && $test -r "$strings"; then - echo "Using instead of ." >&4 - else - echo "No string header found -- You'll surely have problems." >&4 - fi -fi -set i_string -eval $setvar -case "$i_string" in -"$undef") strings=`./findhdr strings.h`;; -*) strings=`./findhdr string.h`;; -esac - : see if this is a sys/file.h system val='' set sys/file.h val @@ -13176,6 +13338,64 @@ else fi $rm_try +: see if ndbm.h is available +set ndbm.h i_ndbm +eval $inhdr +: Compatibility location for RedHat 7.1 +set gdbm/ndbm.h i_gdbmndbm +eval $inhdr +: Compatibility location for Debian 4.0 +set gdbm-ndbm.h i_gdbm_ndbm +eval $inhdr + +val="$undef" +if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then + : see if dbm_open exists + set dbm_open d_dbm_open + eval $inlibc + case "$d_dbm_open" in + $undef) + i_ndbm="$undef" + i_gdbmndbm="$undef" + i_gdbm_ndbm="$undef" + echo "We won't be including " + val="$undef" + ;; + *) val="$define" + ;; + esac +fi +set d_ndbm +eval $setvar + +ndbm_hdr_protochk='name=$1; hdr=$2; +eval "ihdr=\$""i_$name"; +val="$undef"; +if $test "$ihdr" = "$define"; then + $echo "Checking if your <$hdr> uses prototypes..." >&4; + case "$d_cplusplus" in + $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;; + *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;; + esac; + case "$val" in + $define) $echo "Your <$hdr> seems to have prototypes";; + *) $echo "Your <$hdr> does not seem to have prototypes";; + esac; +fi; +set "d_${name}_h_uses_prototypes"; +eval $setvar' + +set ndbm ndbm.h +eval $ndbm_hdr_protochk +set gdbmndbm gdbm/ndbm.h +eval $ndbm_hdr_protochk +set gdbm_ndbm gdbm-ndbm.h +eval $ndbm_hdr_protochk + +: see if getaddrinfo exists +set getaddrinfo d_getaddrinfo +eval $inlibc + : see if getcwd exists set getcwd d_getcwd eval $inlibc @@ -13208,27 +13428,27 @@ case "$d_getgrent_r" in define) case "$getgrent_r_proto" in ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);' - ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;; + ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;; esac case "$getgrent_r_proto" in ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);' - ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;; + ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;; esac case "$getgrent_r_proto" in ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);' - ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;; + ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;; esac case "$getgrent_r_proto" in ''|0) try='struct group* getgrent_r(struct group*, char*, int);' - ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;; + ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;; esac case "$getgrent_r_proto" in ''|0) try='int getgrent_r(struct group*, char*, int);' - ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;; + ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;; esac case "$getgrent_r_proto" in ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);' - ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;; + ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;; esac case "$getgrent_r_proto" in ''|0) d_getgrent_r=undef @@ -13269,19 +13489,19 @@ case "$d_getgrgid_r" in define) case "$getgrgid_r_proto" in ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);' - ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;; + ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;; esac case "$getgrgid_r_proto" in ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);' - ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;; + ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;; esac case "$getgrgid_r_proto" in ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);' - ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;; + ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;; esac case "$getgrgid_r_proto" in ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);' - ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;; + ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;; esac case "$getgrgid_r_proto" in ''|0) d_getgrgid_r=undef @@ -13322,23 +13542,23 @@ case "$d_getgrnam_r" in define) case "$getgrnam_r_proto" in ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);' - ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;; + ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;; esac case "$getgrnam_r_proto" in ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);' - ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;; + ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;; esac case "$getgrnam_r_proto" in ''|0) try='struct group* getgrnam_r(const char*, char*, int);' - ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;; + ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;; esac case "$getgrnam_r_proto" in ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);' - ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;; + ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;; esac case "$getgrnam_r_proto" in ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);' - ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;; + ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;; esac case "$getgrnam_r_proto" in ''|0) d_getgrnam_r=undef @@ -13476,47 +13696,47 @@ case "$d_gethostbyaddr_r" in define) case "$gethostbyaddr_r_proto" in ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);' - ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;; + ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;; esac case "$gethostbyaddr_r_proto" in ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);' - ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;; + ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;; esac case "$gethostbyaddr_r_proto" in ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);' - ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;; + ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;; esac case "$gethostbyaddr_r_proto" in ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);' - ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;; + ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;; esac case "$gethostbyaddr_r_proto" in ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);' - ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;; + ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;; esac case "$gethostbyaddr_r_proto" in ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);' - ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;; + ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;; esac case "$gethostbyaddr_r_proto" in ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);' - ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;; + ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;; esac case "$gethostbyaddr_r_proto" in ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);' - ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;; + ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;; esac case "$gethostbyaddr_r_proto" in ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);' - ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;; + ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;; esac case "$gethostbyaddr_r_proto" in ''|0) try='int gethostbyaddr_r(const char*, int, int);' - ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;; + ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;; esac case "$gethostbyaddr_r_proto" in ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);' - ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;; + ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;; esac case "$gethostbyaddr_r_proto" in ''|0) d_gethostbyaddr_r=undef @@ -13557,15 +13777,15 @@ case "$d_gethostbyname_r" in define) case "$gethostbyname_r_proto" in ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);' - ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;; + ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;; esac case "$gethostbyname_r_proto" in ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);' - ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;; + ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;; esac case "$gethostbyname_r_proto" in ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);' - ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;; + ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;; esac case "$gethostbyname_r_proto" in ''|0) d_gethostbyname_r=undef @@ -13606,27 +13826,27 @@ case "$d_gethostent_r" in define) case "$gethostent_r_proto" in ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);' - ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;; + ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;; esac case "$gethostent_r_proto" in ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);' - ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;; + ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;; esac case "$gethostent_r_proto" in ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);' - ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;; + ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;; esac case "$gethostent_r_proto" in ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);' - ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;; + ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;; esac case "$gethostent_r_proto" in ''|0) try='int gethostent_r(struct hostent*, char*, int);' - ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;; + ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;; esac case "$gethostent_r_proto" in ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);' - ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;; + ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;; esac case "$gethostent_r_proto" in ''|0) d_gethostent_r=undef @@ -13680,19 +13900,19 @@ case "$d_getlogin_r" in define) case "$getlogin_r_proto" in ''|0) try='int getlogin_r(char*, size_t);' - ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;; + ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;; esac case "$getlogin_r_proto" in ''|0) try='int getlogin_r(char*, int);' - ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;; + ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;; esac case "$getlogin_r_proto" in ''|0) try='char* getlogin_r(char*, size_t);' - ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;; + ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;; esac case "$getlogin_r_proto" in ''|0) try='char* getlogin_r(char*, int);' - ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;; + ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;; esac case "$getlogin_r_proto" in ''|0) d_getlogin_r=undef @@ -13725,6 +13945,10 @@ eval $inlibc set getmntent d_getmntent eval $inlibc +: see if getnameinfo exists +set getnameinfo d_getnameinfo +eval $inlibc + : see if getnetbyaddr exists set getnetbyaddr d_getnbyaddr eval $inlibc @@ -13753,35 +13977,35 @@ case "$d_getnetbyaddr_r" in define) case "$getnetbyaddr_r_proto" in ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);' - ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;; + ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;; esac case "$getnetbyaddr_r_proto" in ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);' - ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;; + ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;; esac case "$getnetbyaddr_r_proto" in ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);' - ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;; + ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;; esac case "$getnetbyaddr_r_proto" in ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);' - ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;; + ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;; esac case "$getnetbyaddr_r_proto" in ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);' - ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;; + ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;; esac case "$getnetbyaddr_r_proto" in ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);' - ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;; + ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;; esac case "$getnetbyaddr_r_proto" in ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);' - ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;; + ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;; esac case "$getnetbyaddr_r_proto" in ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);' - ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;; + ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;; esac case "$getnetbyaddr_r_proto" in ''|0) d_getnetbyaddr_r=undef @@ -13822,19 +14046,19 @@ case "$d_getnetbyname_r" in define) case "$getnetbyname_r_proto" in ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);' - ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;; + ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;; esac case "$getnetbyname_r_proto" in ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);' - ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;; + ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;; esac case "$getnetbyname_r_proto" in ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);' - ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;; + ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;; esac case "$getnetbyname_r_proto" in ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);' - ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;; + ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;; esac case "$getnetbyname_r_proto" in ''|0) d_getnetbyname_r=undef @@ -13875,27 +14099,27 @@ case "$d_getnetent_r" in define) case "$getnetent_r_proto" in ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);' - ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;; + ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;; esac case "$getnetent_r_proto" in ''|0) try='int getnetent_r(struct netent*, char*, int, int*);' - ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;; + ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;; esac case "$getnetent_r_proto" in ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);' - ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;; + ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;; esac case "$getnetent_r_proto" in ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);' - ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;; + ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;; esac case "$getnetent_r_proto" in ''|0) try='int getnetent_r(struct netent*, char*, int);' - ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;; + ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;; esac case "$getnetent_r_proto" in ''|0) try='int getnetent_r(struct netent*, struct netent_data*);' - ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;; + ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;; esac case "$getnetent_r_proto" in ''|0) d_getnetent_r=undef @@ -13975,15 +14199,15 @@ case "$d_getprotobyname_r" in define) case "$getprotobyname_r_proto" in ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);' - ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;; + ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;; esac case "$getprotobyname_r_proto" in ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);' - ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;; + ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;; esac case "$getprotobyname_r_proto" in ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);' - ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;; + ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;; esac case "$getprotobyname_r_proto" in ''|0) d_getprotobyname_r=undef @@ -14024,15 +14248,15 @@ case "$d_getprotobynumber_r" in define) case "$getprotobynumber_r_proto" in ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);' - ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;; + ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;; esac case "$getprotobynumber_r_proto" in ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);' - ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;; + ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;; esac case "$getprotobynumber_r_proto" in ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);' - ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;; + ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;; esac case "$getprotobynumber_r_proto" in ''|0) d_getprotobynumber_r=undef @@ -14073,19 +14297,19 @@ case "$d_getprotoent_r" in define) case "$getprotoent_r_proto" in ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);' - ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;; + ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;; esac case "$getprotoent_r_proto" in ''|0) try='int getprotoent_r(struct protoent*, char*, int);' - ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;; + ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;; esac case "$getprotoent_r_proto" in ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);' - ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;; + ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;; esac case "$getprotoent_r_proto" in ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);' - ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;; + ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;; esac case "$getprotoent_r_proto" in ''|0) d_getprotoent_r=undef @@ -14139,27 +14363,27 @@ case "$d_getpwent_r" in define) case "$getpwent_r_proto" in ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);' - ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;; + ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;; esac case "$getpwent_r_proto" in ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);' - ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;; + ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;; esac case "$getpwent_r_proto" in ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);' - ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;; + ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;; esac case "$getpwent_r_proto" in ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);' - ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;; + ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;; esac case "$getpwent_r_proto" in ''|0) try='int getpwent_r(struct passwd*, char*, int);' - ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;; + ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;; esac case "$getpwent_r_proto" in ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);' - ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;; + ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;; esac case "$getpwent_r_proto" in ''|0) d_getpwent_r=undef @@ -14200,19 +14424,19 @@ case "$d_getpwnam_r" in define) case "$getpwnam_r_proto" in ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);' - ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;; + ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;; esac case "$getpwnam_r_proto" in ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);' - ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;; + ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;; esac case "$getpwnam_r_proto" in ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);' - ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;; + ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;; esac case "$getpwnam_r_proto" in ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);' - ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;; + ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;; esac case "$getpwnam_r_proto" in ''|0) d_getpwnam_r=undef @@ -14253,19 +14477,19 @@ case "$d_getpwuid_r" in define) case "$getpwuid_r_proto" in ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);' - ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;; + ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;; esac case "$getpwuid_r_proto" in ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);' - ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;; + ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;; esac case "$getpwuid_r_proto" in ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);' - ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;; + ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;; esac case "$getpwuid_r_proto" in ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);' - ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;; + ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;; esac case "$getpwuid_r_proto" in ''|0) d_getpwuid_r=undef @@ -14320,15 +14544,15 @@ case "$d_getservbyname_r" in define) case "$getservbyname_r_proto" in ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);' - ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;; + ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;; esac case "$getservbyname_r_proto" in ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);' - ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;; + ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;; esac case "$getservbyname_r_proto" in ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);' - ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;; + ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;; esac case "$getservbyname_r_proto" in ''|0) d_getservbyname_r=undef @@ -14369,15 +14593,15 @@ case "$d_getservbyport_r" in define) case "$getservbyport_r_proto" in ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);' - ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;; + ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;; esac case "$getservbyport_r_proto" in ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);' - ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;; + ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;; esac case "$getservbyport_r_proto" in ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);' - ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;; + ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;; esac case "$getservbyport_r_proto" in ''|0) d_getservbyport_r=undef @@ -14418,19 +14642,19 @@ case "$d_getservent_r" in define) case "$getservent_r_proto" in ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);' - ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;; + ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;; esac case "$getservent_r_proto" in ''|0) try='int getservent_r(struct servent*, char*, int);' - ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;; + ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;; esac case "$getservent_r_proto" in ''|0) try='struct servent* getservent_r(struct servent*, char*, int);' - ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;; + ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;; esac case "$getservent_r_proto" in ''|0) try='int getservent_r(struct servent*, struct servent_data*);' - ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;; + ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;; esac case "$getservent_r_proto" in ''|0) d_getservent_r=undef @@ -14484,11 +14708,11 @@ case "$d_getspnam_r" in define) case "$getspnam_r_proto" in ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);' - ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;; + ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;; esac case "$getspnam_r_proto" in ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);' - ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;; + ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;; esac case "$getspnam_r_proto" in ''|0) d_getspnam_r=undef @@ -14548,11 +14772,11 @@ case "$d_gmtime_r" in define) case "$gmtime_r_proto" in ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);' - ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;; + ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;; esac case "$gmtime_r_proto" in ''|0) try='int gmtime_r(const time_t*, struct tm*);' - ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;; + ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;; esac case "$gmtime_r_proto" in ''|0) d_gmtime_r=undef @@ -14668,6 +14892,14 @@ set d_index; eval $setvar set inet_aton d_inetaton eval $inlibc +: see if inet_ntop exists +set inet_ntop d_inetntop +eval $inlibc + +: see if inet_pton exists +set inet_pton d_inetpton +eval $inlibc + : Look for isascii echo " " $cat >isascii.c < -#include -#include -#include -#include +#$i_systypes I_SYS_TYPES +#$i_unistd I_UNISTD +#$i_time I_TIME +#$i_stdlib I_STDLIB +#$i_string I_STRING +#$i_malloc I_MALLOC +#ifdef I_SYS_TYPES +# include +#endif +#ifdef I_UNISTD +# include +#endif +#ifdef I_TIME +# include +#endif +#ifdef I_STDLIB +#include +#endif +#ifdef I_STRING +# include +#else +# include +#endif +#ifdef I_MALLOC +# include +#endif int main() { time_t t = time(0L); @@ -15760,6 +16013,31 @@ eval $inlibc set poll d_poll eval $inlibc +: see if prctl exists +set prctl d_prctl +eval $inlibc + +: see if prctl supports PR_SET_NAME +d_prctl_set_name=$undef +case $d_prctl in + $define) + $cat >try.c < + +int main (int argc, char *argv[]) +{ + return (prctl (PR_SET_NAME, "Test")); + } /* main */ +EOM + set try + if eval $compile_ok && $run ./try; then + echo "Your prctl (PR_SET_NAME, ...) works" + d_prctl_set_name=$define + fi + $rm_try + ;; + esac + : see if readlink exists set readlink d_readlink eval $inlibc @@ -15769,23 +16047,24 @@ echo " " procselfexe='' val="$undef" case "$d_readlink" in -"$define") - if $issymlink /proc/self/exe ; then - $ls -l /proc/self/exe > reflect + "$define") + : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels + : more tidy to avoid an extra level of symlink + set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out + while test $# -gt 0; do + type=$1; try=$2 + shift; shift + if $issymlink $try; then + $ls -l $try > reflect if $contains /`basename $ls` reflect >/dev/null 2>&1; then - echo "You have Linux-like /proc/self/exe." - procselfexe='"/proc/self/exe"' - val="$define" - fi - fi - if $issymlink /proc/curproc/file ; then - $ls -l /proc/curproc/file > reflect - if $contains /`basename $ls` reflect >/dev/null 2>&1; then - echo "You have BSD-like /proc/curproc/file." - procselfexe='"/proc/curproc/file"' - val="$define" + echo "You have $type-like $try." + procselfexe='"'$try'"' + val="$define" + : This will break out of the loop + set X; shift fi - fi + fi + done ;; esac $rm -f reflect @@ -15957,15 +16236,15 @@ case "$d_random_r" in define) case "$random_r_proto" in ''|0) try='int random_r(int*, struct random_data*);' - ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;; + ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;; esac case "$random_r_proto" in ''|0) try='int random_r(long*, struct random_data*);' - ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;; + ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;; esac case "$random_r_proto" in ''|0) try='int random_r(struct random_data*, int32_t*);' - ./protochk "extern $try" $hdrs && random_r_proto=I_St ;; + ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;; esac case "$random_r_proto" in ''|0) d_random_r=undef @@ -16016,11 +16295,11 @@ case "$d_readdir64_r" in define) case "$readdir64_r_proto" in ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);' - ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;; + ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;; esac case "$readdir64_r_proto" in ''|0) try='int readdir64_r(DIR*, struct dirent64*);' - ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;; + ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;; esac case "$readdir64_r_proto" in ''|0) d_readdir64_r=undef @@ -16061,11 +16340,11 @@ case "$d_readdir_r" in define) case "$readdir_r_proto" in ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);' - ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;; + ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;; esac case "$readdir_r_proto" in ''|0) try='int readdir_r(DIR*, struct dirent*);' - ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;; + ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;; esac case "$readdir_r_proto" in ''|0) d_readdir_r=undef @@ -16617,11 +16896,11 @@ case "$d_setgrent_r" in define) case "$setgrent_r_proto" in ''|0) try='int setgrent_r(FILE**);' - ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;; + ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;; esac case "$setgrent_r_proto" in ''|0) try='void setgrent_r(FILE**);' - ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;; + ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;; esac case "$setgrent_r_proto" in ''|0) d_setgrent_r=undef @@ -16666,11 +16945,11 @@ case "$d_sethostent_r" in define) case "$sethostent_r_proto" in ''|0) try='int sethostent_r(int, struct hostent_data*);' - ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;; + ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;; esac case "$sethostent_r_proto" in ''|0) try='void sethostent_r(int, struct hostent_data*);' - ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;; + ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;; esac case "$sethostent_r_proto" in ''|0) d_sethostent_r=undef @@ -16727,7 +17006,7 @@ case "$d_setlocale_r" in define) case "$setlocale_r_proto" in ''|0) try='int setlocale_r(int, const char*, char*, int);' - ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;; + ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;; esac case "$setlocale_r_proto" in ''|0) d_setlocale_r=undef @@ -16772,11 +17051,11 @@ case "$d_setnetent_r" in define) case "$setnetent_r_proto" in ''|0) try='int setnetent_r(int, struct netent_data*);' - ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;; + ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;; esac case "$setnetent_r_proto" in ''|0) try='void setnetent_r(int, struct netent_data*);' - ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;; + ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;; esac case "$setnetent_r_proto" in ''|0) d_setnetent_r=undef @@ -16837,11 +17116,11 @@ case "$d_setprotoent_r" in define) case "$setprotoent_r_proto" in ''|0) try='int setprotoent_r(int, struct protoent_data*);' - ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;; + ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;; esac case "$setprotoent_r_proto" in ''|0) try='void setprotoent_r(int, struct protoent_data*);' - ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;; + ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;; esac case "$setprotoent_r_proto" in ''|0) d_setprotoent_r=undef @@ -16886,11 +17165,11 @@ case "$d_setpwent_r" in define) case "$setpwent_r_proto" in ''|0) try='int setpwent_r(FILE**);' - ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;; + ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;; esac case "$setpwent_r_proto" in ''|0) try='void setpwent_r(FILE**);' - ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;; + ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;; esac case "$setpwent_r_proto" in ''|0) d_setpwent_r=undef @@ -16955,11 +17234,11 @@ case "$d_setservent_r" in define) case "$setservent_r_proto" in ''|0) try='int setservent_r(int, struct servent_data*);' - ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;; + ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;; esac case "$setservent_r_proto" in ''|0) try='void setservent_r(int, struct servent_data*);' - ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;; + ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;; esac case "$setservent_r_proto" in ''|0) d_setservent_r=undef @@ -17015,17 +17294,10 @@ $define) *) dflt='n';; esac echo "$package can use the sfio library, but it is experimental." - case "$useperlio" in - "$undef") - echo "For sfio also the PerlIO abstraction layer is needed." - echo "Earlier you said you wouldn't want that." - ;; - esac rp="You seem to have sfio available, do you want to try using it?" . ./myread case "$ans" in - y|Y) echo "Ok, turning on both sfio and PerlIO, then." - useperlio="$define" + y|Y) echo "Ok, turning on sfio then." val="$define" ;; *) echo "Ok, avoiding sfio this time. I'll use stdio instead." @@ -17399,7 +17671,6 @@ int main(int argc, char **argv) { EOP set try -d_sprintf_returns_strlen="$undef" if eval $compile; then xxx="`$run ./try`" case "$?" in @@ -17414,6 +17685,9 @@ EOM d_sprintf_returns_strlen="$undef" ;; esac +else + echo "(I can't seem to compile the test program--assuming it doesn't)" >&4 + d_sprintf_returns_strlen="$undef" fi $rm_try @@ -17433,7 +17707,7 @@ case "$d_srand48_r" in define) case "$srand48_r_proto" in ''|0) try='int srand48_r(long, struct drand48_data*);' - ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;; + ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;; esac case "$srand48_r_proto" in ''|0) d_srand48_r=undef @@ -17474,7 +17748,7 @@ case "$d_srandom_r" in define) case "$srandom_r_proto" in ''|0) try='int srandom_r(unsigned int, struct random_data*);' - ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;; + ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;; esac case "$srandom_r_proto" in ''|0) d_srandom_r=undef @@ -17556,6 +17830,112 @@ case "$d_statfs_f_flags" in *) echo "No, it doesn't." ;; esac +: see what flavor, if any, of static inline is supported +echo " " +echo "Checking to see if your system supports static inline..." +$cat > try.c <<'EOCP' +#include +extern int f_via_a(int x); +extern int f_via_b(int x); +int main(int argc, char **argv) +{ + int y; + + y = f_via_a(0); +#ifdef USE_B + y = f_via_b(0); +#endif + if (y == 42) { + return EXIT_SUCCESS; + } + else { + return EXIT_FAILURE; + } +} +EOCP +$cat > a.c <<'EOCP' +static INLINE int f(int x) { + int y; + y = x + 42; + return y; +} + +int f_via_a(int x) +{ + return f(x); +} +EOCP +$cat > b.c <<'EOCP' +extern int f(int x); + +int f_via_b(int x) +{ + return f(x); +} +EOCP + +# Respect a hint (or previous) value for perl_static_inline, if there is one. +case "$perl_static_inline" in +'') # Check the various possibilities, and break out on success. + # For gcc, prefer __inline__, which will still permit + # cflags.SH to add in -ansi. + case "$gccversion" in + '') xxx="inline __inline__ __inline _inline";; + *) xxx="__inline__ inline __inline _inline";; + esac + for inline in $xxx; do + set try -DINLINE=$inline a.c + if eval $compile && $run ./try; then + # Now make sure there is no external linkage of static + # functions + set try -DINLINE=$inline -DUSE_B a.c b.c + if eval $compile && $run ./try; then + $echo "Your compiler supports static $inline, " >&4 + $echo "but it also creates an external definition," >&4 + $echo "so I won't use it." >&4 + val=$undef + else + $echo "Your compiler supports static $inline." >&4 + val=$define + perl_static_inline="static $inline"; + break; + fi + else + $echo "Your compiler does NOT support static $inline." >&4 + val="$undef" + fi + done + ;; +*inline*) # Some variant of inline exists. + echo "Keeping your $hint value of $perl_static_inline." + val=$define + ;; +static) # No inline capabilities + echo "Keeping your $hint value of $perl_static_inline." + val=$undef + ;; +*) # Unrecognized previous value -- blindly trust the supplied + # value and hope it makes sense. Use old value for + # d_static_inline, if there is one. + echo "Keeping your $hint value of $perl_static_inline." + case "$d_static_inline" in + '') val=$define ;; + *) val=$d_static_inline ;; + esac + ;; +esac +# Fallback to plain 'static' if nothing worked. +case "$perl_static_inline" in +'') + perl_static_inline="static" + val=$undef + ;; +esac +set d_static_inline +eval $setvar +$rm -f a.[co] b.[co] +$rm_try + : Check stream access $cat >&4 <&4 + $cat >try.c < +int main () +{ + int n; + unsigned char c; + for (c = 1, n = 0; c; c <<= 1, n++) ; + printf ("%d\n", n); + return (0); + } +EOCP + set try + if eval $compile_ok; then + dflt=`$run ./try` + else + dflt='8' + echo "(I can't seem to compile the test program. Guessing...)" + fi + ;; +*) + dflt="$charbits" + ;; +esac +rp="What is the length of a character (in bits)?" +. ./myread +charbits="$ans" +$rm_try +case "$charbits" in +8) ;; +*) cat >&4 << EOM +Your system has an unsigned character size of $charbits bits, which +is rather unusual (normally it is 8 bits). Perl likely will not work +correctly on your system, with subtle bugs in various places. +EOM + rp='Do you really want to continue?' + dflt='n' + . ./myread + case "$ans" in + [yY]) echo >&4 "Okay, continuing." ;; + *) exit 1 ;; + esac +esac + : how do we concatenate cpp tokens here? echo " " echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4 @@ -19035,7 +19469,7 @@ EOM fi fi fi - $rm_try + $rm -f core try.core core.try.* case "$fflushNULL" in x) $cat >&4 <&4 case "$make_set_make" in @@ -19741,7 +20176,7 @@ EOM for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do for yyy in size_t long int; do case "$netdb_host_type" in - '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);" + '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);" if ./protochk "$try" $hdrs; then echo "Your system accepts $xxx for the first arg." echo "...and $yyy for the second arg." @@ -19790,7 +20225,7 @@ EOM $i_unistd unistd.h" for xxx in "const char *" "char *"; do case "$netdb_name_type" in - '') try="extern struct hostent *gethostbyname($xxx);" + '') try="$extern_C struct hostent *gethostbyname($xxx);" if ./protochk "$try" $hdrs; then echo "Your system accepts $xxx." netdb_name_type="$xxx" @@ -19828,7 +20263,7 @@ EOM $i_unistd unistd.h" for xxx in in_addr_t "unsigned long" long "unsigned int" int; do case "$netdb_net_type" in - '') try="extern struct netent *getnetbyaddr($xxx, int);" + '') try="$extern_C struct netent *getnetbyaddr($xxx, int);" if ./protochk "$try" $hdrs; then echo "Your system accepts $xxx." netdb_net_type="$xxx" @@ -19872,9 +20307,6 @@ case "$pager" in esac ;; *) dflt="$pager" - : Instruct ./getfile to trust the hinted or previous pager value, - : even if it does not begin with a slash. For example, on os2, - : pager might be cmd /c more. See comments in UU/getfile. fn="f/($pager)" ;; esac @@ -19943,6 +20375,176 @@ else fi $rm -f foo* bar* +: see if this is a values.h system +set values.h i_values +eval $inhdr + +: Check the max offset that gmtime and localtime accept +echo "Checking max offsets that gmtime () accepts" + +case $i_values in + define) yyy="#include " ;; + *) yyy="" ;; + esac + +case "$sGMTIME_min/$sGMTIME_max" in + 0/0|/) + $cat >try.c < +#include +#include +$yyy + +int i; +struct tm *tmp; +time_t pt; + +void gm_check (time_t t, int min_year, int max_year) +{ + tmp = gmtime (&t); + if ( tmp == NULL || + /* Check tm_year overflow */ + tmp->tm_year < min_year || tmp->tm_year > max_year) + tmp = NULL; + else + pt = t; + } /* gm_check */ + +int check_max () +{ + tmp = NULL; + pt = 0; +#ifdef MAXLONG + gm_check (MAXLONG, 69, 0x7fffffff); +#endif + if (tmp == NULL || tmp->tm_year < 0) { + for (i = 63; i >= 0; i--) { + time_t x = pt | ((time_t)1 << i); + if (x < 0 || x < pt) continue; + gm_check (x, 69, 0x7fffffff); + } + } + printf ("sGMTIME_max=%ld\n", pt); + return (0); + } /* check_max */ + +int check_min () +{ + tmp = NULL; + pt = 0; +#ifdef MINLONG + gm_check (MINLONG, -1900, 70); +#endif + if (tmp == NULL) { + for (i = 36; i >= 0; i--) { + time_t x = pt - ((time_t)1 << i); + if (x > 0) continue; + gm_check (x, -1900, 70); + } + } + printf ("sGMTIME_min=%ld\n", pt); + return (0); + } /* check_min */ + +int main (int argc, char *argv[]) +{ + fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); + check_max (); + check_min (); + return (0); + } /* main */ +EOCP + set try + if eval $compile; then + eval `$run ./try` + else + echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4 + fi + $rm_try + ;; + esac + +echo "Checking max offsets that localtime () accepts" + +case "$sLOCALTIME_min/$sLOCALTIME_max" in + 0/0|/) + $cat >try.c < +#include +#include +$yyy + +int i; +struct tm *tmp; +time_t pt; + +void local_check (time_t t, int min_year, int max_year) +{ + if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL) + tmp = NULL; + else + tmp = localtime (&t); + if ( tmp == NULL || + /* Check tm_year overflow */ + tmp->tm_year < min_year || tmp->tm_year > max_year) + tmp = NULL; + else + pt = t; + } /* local_check */ + +int check_max () +{ + tmp = NULL; + pt = 0; +#ifdef MAXLONG + local_check (MAXLONG, 69, 0x7fffffff); +#endif + if (tmp == NULL || tmp->tm_year < 0) { + for (i = 63; i >= 0; i--) { + time_t x = pt | ((time_t)1 << i); + if (x < 0 || x < pt) continue; + local_check (x, 69, 0x7fffffff); + } + } + printf ("sLOCALTIME_max=%ld\n", pt); + return (0); + } /* check_max */ + +int check_min () +{ + tmp = NULL; + pt = 0; +#ifdef MINLONG + local_check (MINLONG, -1900, 70); +#endif + if (tmp == NULL) { + for (i = 36; i >= 0; i--) { + time_t x = pt - ((time_t)1 << i); + if (x > 0) continue; + local_check (x, -1900, 70); + } + } + printf ("sLOCALTIME_min=%ld\n", pt); + return (0); + } /* check_min */ + +int main (int argc, char *argv[]) +{ + check_max (); + check_min (); + return (0); + } /* main */ +EOCP + set try + if eval $compile; then + eval `$run ./try` + else + echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4 + fi + $rm_try + ;; + esac + : check for type of arguments to select. case "$selecttype" in '') case "$d_select" in @@ -19964,7 +20566,7 @@ EOM for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do for tmo in 'struct timeval *' 'const struct timeval *'; do case "$val" in - '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));" + '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));" if ./protochk "$try" $hdrs; then echo "Your system accepts $xxx." val="$xxx" @@ -20445,7 +21047,7 @@ EOM yyy="$yyy $sizetype int long unsigned" for xxx in $yyy; do case "$socksizetype" in - '') try="extern int accept(int, struct sockaddr *, $xxx *);" + '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);" case "$usesocks" in "$define") if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then @@ -20521,10 +21123,77 @@ EOM fi $rm_try +: Check the size of st_ino +$echo " " +$echo "Checking the size of st_ino..." >&4 +$cat > try.c < +#include +#$i_stdlib I_STDLIB +#ifdef I_STDLIB +#include +#endif +int main() { + struct stat st; + printf("%d\n", (int)sizeof(st.st_ino)); + exit(0); +} +EOCP +set try +if eval $compile_ok; then + val=`$run ./try` + case "$val" in + '') st_ino_size=4 + $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4 + ;; + *) st_ino_size=$val + $echo "Your st_ino is $st_ino_size bytes long." + ;; + esac +else + st_ino_size=4 + $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4 +fi +$rm_try + +: Check if st_ino is signed +$echo " " +$echo "Checking the sign of st_ino..." >&4 +$cat > try.c < +#include +int main() { + struct stat foo; + foo.st_ino = -1; + if (foo.st_ino < 0) + printf("-1\n"); + else + printf("1\n"); +} +EOCP +set try +if eval $compile; then + val=`$run ./try` + case "$val" in + '') st_ino_sign=1 + $echo "(I can't execute the test program--guessing unsigned.)" >&4 + ;; + *) st_ino_sign=$val + case "$st_ino_sign" in + 1) $echo "Your st_ino is unsigned." ;; + -1) $echo "Your st_ino is signed." ;; + esac + ;; + esac +else + st_ino_sign=1 + $echo "(I can't compile the test program--guessing unsigned.)" >&4 +fi +$rm_try + : see what type of char stdio uses. echo " " -echo '#include ' > stdio.c -$cppstdin $cppminus < stdio.c > stdioh +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" @@ -20532,7 +21201,7 @@ else echo "Your stdio uses signed chars." >&4 stdchar="char" fi -$rm -f stdio.* stdioh +$rm -f stdioh : see what type uids are declared as in the kernel echo " " @@ -20670,6 +21339,221 @@ case "$uidsign" in ;; esac +: Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program +echo " " +echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4 +$cat >try.c <<'EOM' +/* Intentionally a long probe as I'd like to sanity check that the exact + approach is going to work, as thinking it will work, but only having it + part working at runtime is worse than not having it. */ + +#include +#include +#include +#include +#include +#include +#include + +int +main(int argc, char **argv) { + char *buffer; + char *argv_leaf = strrchr(argv[0], '/'); + char *buffer_leaf; + size_t size = 0; + int mib[4]; + + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PATHNAME; + mib[3] = -1; + + if (!argv_leaf) { + fprintf(stderr, "Can't locate / in '%s'\n", argv[0]); + return 1; + } + + if (sysctl(mib, 4, NULL, &size, NULL, 0)) { + perror("sysctl"); + return 2; + } + + if (size < strlen(argv_leaf) + 1) { + fprintf(stderr, "size %lu is too short for a path\n", + (unsigned long) size); + return 3; + } + + if (size > MAXPATHLEN * MAXPATHLEN) { + fprintf(stderr, "size %lu is too long for a path\n", + (unsigned long) size); + return 4; + } + + buffer = malloc(size); + if (!buffer) { + perror("malloc"); + return 5; + } + + if (sysctl(mib, 4, buffer, &size, NULL, 0)) { + perror("sysctl"); + return 6; + } + + if (strlen(buffer) + 1 != size) { + fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n", + (unsigned long)size, (unsigned long)strlen(buffer) + 1); + return 7; + } + + + if (*buffer != '/') { + fprintf(stderr, "Not an absolute path: '%s'\n", buffer); + return 8; + } + + if (strstr(buffer, "/./")) { + fprintf(stderr, "Contains /./: '%s'\n", buffer); + return 9; + } + + if (strstr(buffer, "/../")) { + fprintf(stderr, "Contains /../: '%s'\n", buffer); + return 10; + } + + buffer_leaf = strrchr(buffer, '/'); + if (strcmp(buffer_leaf, argv_leaf) != 0) { + fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer); + return 11; + } + + free(buffer); + + return 0; +} +EOM + +val=$undef +set try +if eval $compile_ok; then + if $run ./try; then + echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4 + val="$define" + else + echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4 + val="$undef" + fi +else + echo "I'm unable to compile the test program." >&4 + echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4 + val="$undef" +fi +$rm_try +set usekernprocpathname +eval $setvar + +: Determine if we can use _NSGetExecutablePath to find executing program +echo " " +echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4 +$cat >try.c <<'EOM' +/* Intentionally a long probe as I'd like to sanity check that the exact + approach is going to work, as thinking it will work, but only having it + part working at runtime is worse than not having it. */ +#include +#include +#include +#include +#include + +int +main(int argc, char **argv) { + char buf[1]; + uint32_t size = sizeof(buf); + int result; + char *buffer; + char *tidied; + char *argv_leaf = strrchr(argv[0], '/'); + char *tidied_leaf; + + if (!argv_leaf) { + fprintf(stderr, "Can't locate / in '%s'\n", argv[0]); + return 1; + } + + _NSGetExecutablePath(buf, &size); + if (size > MAXPATHLEN * MAXPATHLEN) { + fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n", + (unsigned int) size); + return 2; + } + + buffer = malloc(size); + if (!buffer) { + perror("malloc"); + return 3; + } + + result = _NSGetExecutablePath(buffer, &size); + if (result != 0) { + fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n", + result, (unsigned int) size); + return 4; + } + + tidied = realpath(buffer, NULL); + if (!tidied) { + perror("realpath"); + return 5; + } + + free(buffer); + + if (*tidied != '/') { + fprintf(stderr, "Not an absolute path: '%s'\n", tidied); + return 6; + } + + if (strstr(tidied, "/./")) { + fprintf(stderr, "Contains /./: '%s'\n", tidied); + return 7; + } + + if (strstr(tidied, "/../")) { + fprintf(stderr, "Contains /../: '%s'\n", tidied); + return 8; + } + + tidied_leaf = strrchr(tidied, '/'); + if (strcmp(tidied_leaf, argv_leaf) != 0) { + fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied); + return 9; + } + + free(tidied); + + return 0; +} +EOM + +val=$undef +set try +if eval $compile_ok; then + if $run ./try; then + echo "You can use _NSGetExecutablePath to find the executing program." >&4 + val="$define" + else + echo "Nope, _NSGetExecutablePath doesn't work here." >&4 + fi +else + echo "I'm unable to compile the test program." >&4 + echo "I'll assume no _NSGetExecutablePath here." >&4 +fi +$rm_try +set usensgetexecutablepath +eval $setvar + : Check if site customization support was requested case "$usesitecustomize" in $define|true|[Yy]*) @@ -20680,6 +21564,21 @@ case "$usesitecustomize" in ;; esac +: see if prototypes support variable argument declarations +echo " " +case "$prototype$i_stdarg" in +$define$define) + echo "It appears we'll be able to prototype varargs functions." >&4 + val="$define" + ;; +*) + echo "Too bad... We won't be using prototyped varargs functions..." >&4 + val="$undef" + ;; +esac +set vaproto +eval $setvar + : determine compiler compiler case "$yacc" in '') @@ -20766,40 +21665,6 @@ fi set mntent.h i_mntent eval $inhdr -: see if ndbm.h is available -set ndbm.h t_ndbm -eval $inhdr - -case "$t_ndbm" in -$undef) - # Some Linux distributions such as RedHat 7.1 put the - # ndbm.h header in /usr/include/gdbm/ndbm.h. - if $test -f /usr/include/gdbm/ndbm.h; then - echo ' found.' - ccflags="$ccflags -I/usr/include/gdbm" - cppflags="$cppflags -I/usr/include/gdbm" - t_ndbm=$define - fi - ;; -esac - -case "$t_ndbm" in -$define) - : see if dbm_open exists - set dbm_open d_dbm_open - eval $inlibc - case "$d_dbm_open" in - $undef) - t_ndbm="$undef" - echo "We won't be including " - ;; - esac - ;; -esac -val="$t_ndbm" -set i_ndbm -eval $setvar - : see if net/errno.h is available val='' set net/errno.h val @@ -20976,11 +21841,11 @@ $eunicefix Cppsym.try ./Cppsym < Cppsym.know > Cppsym.true : Add in any linux cpp "predefined macros": case "$osname::$gccversion" in - *linux*::*.*) + *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*) tHdrH=_tmpHdr rm -f $tHdrH'.h' $tHdrH touch $tHdrH'.h' - if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then + if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real' if [ -s $tHdrH'_cppsym.real' ]; then cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true @@ -21082,14 +21947,14 @@ case "$val3" in echo " found." >&4 else echo "System is pyramid with BSD universe." - echo " not found--you could have problems." >&4 + ./warn " not found--you could have problems." fi;; *) if $test `./findhdr termio.h`; then val="$define" echo " found." >&4 else echo "System is pyramid with USG universe." - echo " not found--you could have problems." >&4 + ./warn " not found--you could have problems." fi;; esac elif ./usg; then @@ -21100,7 +21965,7 @@ case "$val3" in echo " found." >&4 val2="$define" else -echo "Neither nor found--you could have problems." >&4 + ./warn "Neither nor found--cross fingers!" fi else if $test `./findhdr sgtty.h`; then @@ -21110,7 +21975,7 @@ echo "Neither nor found--you could have problems." >&4 echo " found." >&4 val="$define" else -echo "Neither nor found--you could have problems." >&4 + ./warn "Neither nor found--cross fingers!" fi fi;; esac @@ -21118,6 +21983,35 @@ set i_termio; eval $setvar val=$val2; set i_sgtty; eval $setvar val=$val3; set i_termios; eval $setvar +: see if stdbool is available +: we want a real compile instead of Inhdr because some Solaris systems +: have stdbool.h, but it can only be used if the compiler indicates it +: is sufficiently c99-compliant. +echo " " +$cat >try.c < +#include +int func(bool x) +{ + return x ? 1 : 0; +} +int main(int argc, char **argv) +{ + return func(0); +} +EOCP +set try +if eval $compile; then + echo " found." >&4 + val="$define" +else + echo " NOT found." >&4 + val="$undef" +fi +$rm_try +set i_stdbool +eval $setvar + : see if stddef is available set stddef.h i_stddef eval $inhdr @@ -21175,6 +22069,10 @@ eval $inhdr set sys/mode.h i_sysmode eval $inhdr +: see if there is a sys/poll.h file +set sys/poll.h i_syspoll +eval $inhdr + : see if sys/resource.h has to be included set sys/resource.h i_sysresrc eval $inhdr @@ -21207,10 +22105,6 @@ eval $inhdr set utime.h i_utime eval $inhdr -: see if this is a values.h system -set values.h i_values -eval $inhdr - : see if this is a vfork system case "$d_vfork" in "$define") @@ -21236,44 +22130,72 @@ nonxs_extensions='' : Function to recursively find available extensions, ignoring DynaLoader : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness +: In 5.10.1 and later, extensions are stored in directories +: like File-Glob instead of the older File/Glob/. find_extensions=' for xxx in *; do case "$xxx" in DynaLoader|dynaload) ;; *) - if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then - known_extensions="$known_extensions $1$xxx"; - elif $test -f $xxx/Makefile.PL; then - nonxs_extensions="$nonxs_extensions $1$xxx"; + this_ext=`echo $xxx | $sed -e s/-/\\\//g`; + leaf=`echo $xxx | $sed -e s/.*-//`; + if $test -d File; then + if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then + known_extensions="$known_extensions $1$this_ext"; + elif $test -f $xxx/Makefile.PL; then + nonxs_extensions="$nonxs_extensions $1$this_ext"; + else + if $test -d $xxx -a $# -lt 10; then + set $1$xxx/ $*; + cd "$xxx"; + eval $find_extensions; + cd ..; + shift; + fi; + fi; else - if $test -d $xxx -a $# -lt 10; then - set $1$xxx/ $*; - cd "$xxx"; - eval $find_extensions; - cd ..; - shift; + $ls -1 $xxx > $$.tmp; + if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then + known_extensions="$known_extensions $this_ext"; + elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then + known_extensions="$known_extensions $this_ext"; + elif $test -d $xxx; then + nonxs_extensions="$nonxs_extensions $this_ext"; fi; + $rm -f $$.tmp; fi ;; esac; done' tdir=`pwd` +cd "$rsrc/cpan" +set X +shift +eval $find_extensions +cd "$rsrc/dist" +set X +shift +eval $find_extensions cd "$rsrc/ext" set X shift eval $find_extensions -# Special case: Add in modules that nest beyond the first level. -# Currently threads/shared and Hash/Util/FieldHash, since they are -# not picked up by the recursive find above (and adding in general -# recursive finding breaks SDBM_File/sdbm). -# A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash) -known_extensions="$known_extensions threads/shared Hash/Util/FieldHash" +if $test -d File-Glob; then + : All ext/ flattened +else + # Special case: Add in modules that nest beyond the first level. + # Currently threads/shared and Hash/Util/FieldHash, since they are + # not picked up by the recursive find above (and adding in general + # recursive finding breaks SDBM_File/sdbm). + # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash) + known_extensions="$known_extensions threads/shared Hash/Util/FieldHash" +fi set X $known_extensions shift -known_extensions="$*" +known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '` set X $nonxs_extensions shift -nonxs_extensions="$*" +nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '` cd "$tdir" : Now see which are supported on this system. @@ -21302,7 +22224,7 @@ for xxx in $known_extensions ; do esac ;; NDBM_File|ndbm_fil) - case "$i_ndbm" in + case "$d_ndbm" in $define) case "$osname-$use64bitint" in hpux-define) @@ -21381,6 +22303,8 @@ for xxx in $known_extensions ; do # --jhi avail_ext="$avail_ext $xxx" ;; + VMS*) + ;; Win32*) case "$osname" in cygwin) avail_ext="$avail_ext $xxx" ;; @@ -21411,7 +22335,7 @@ avail_ext="$*" case "$onlyextensions" in '') ;; *) keepextensions='' - echo "You have requested that only certains extensions be included..." >&4 + echo "You have requested that only certain extensions be included..." >&4 for i in $onlyextensions; do case " $avail_ext " in *" $i "*) @@ -21581,7 +22505,7 @@ esac # the appropriate Makefile.PL. case " $static_ext " in *" Encode "*) # Add the subextensions of Encode - cd "$rsrc/ext" + cd "$rsrc/cpan" for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do static_ext="$static_ext Encode/$xxx" done @@ -21619,7 +22543,7 @@ sunos*X4*) ;; *) case "$usedl" in $define|true|[yY]*) - set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'` + set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'` shift perllibs="$*" ;; @@ -21703,7 +22627,9 @@ $startsh # Target system : $myuname EOT +: Add in command line options if available $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh + $spitshell <>config.sh Author='$Author' @@ -21739,6 +22665,7 @@ awk='$awk' baserev='$baserev' bash='$bash' bin='$bin' +bin_ELF='$bin_ELF' binexp='$binexp' bison='$bison' byacc='$byacc' @@ -21757,6 +22684,8 @@ ccversion='$ccversion' cf_by='$cf_by' cf_email='$cf_email' cf_time='$cf_time' +charbits='$charbits' +charsize='$charsize' chgrp='$chgrp' chmod='$chmod' chown='$chown' @@ -21800,9 +22729,11 @@ d_accessx='$d_accessx' d_aintl='$d_aintl' d_alarm='$d_alarm' d_archlib='$d_archlib' +d_asctime64='$d_asctime64' d_asctime_r='$d_asctime_r' d_atolf='$d_atolf' d_atoll='$d_atoll' +d_attribute_deprecated='$d_attribute_deprecated' d_attribute_format='$d_attribute_format' d_attribute_malloc='$d_attribute_malloc' d_attribute_nonnull='$d_attribute_nonnull' @@ -21837,10 +22768,12 @@ d_crypt_r='$d_crypt_r' d_csh='$d_csh' d_ctermid='$d_ctermid' d_ctermid_r='$d_ctermid_r' +d_ctime64='$d_ctime64' d_ctime_r='$d_ctime_r' d_cuserid='$d_cuserid' d_dbl_dig='$d_dbl_dig' d_dbminitproto='$d_dbminitproto' +d_difftime64='$d_difftime64' d_difftime='$d_difftime' d_dir_dd_fd='$d_dir_dd_fd' d_dirfd='$d_dirfd' @@ -21899,6 +22832,9 @@ d_fsync='$d_fsync' d_ftello='$d_ftello' d_ftime='$d_ftime' d_futimes='$d_futimes' +d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes' +d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes' +d_getaddrinfo='$d_getaddrinfo' d_getcwd='$d_getcwd' d_getespwnam='$d_getespwnam' d_getfsstat='$d_getfsstat' @@ -21920,6 +22856,7 @@ d_getlogin='$d_getlogin' d_getlogin_r='$d_getlogin_r' d_getmnt='$d_getmnt' d_getmntent='$d_getmntent' +d_getnameinfo='$d_getnameinfo' d_getnbyaddr='$d_getnbyaddr' d_getnbyname='$d_getnbyname' d_getnent='$d_getnent' @@ -21955,6 +22892,7 @@ d_getservprotos='$d_getservprotos' d_getspnam='$d_getspnam' d_getspnam_r='$d_getspnam_r' d_gettimeod='$d_gettimeod' +d_gmtime64='$d_gmtime64' d_gmtime_r='$d_gmtime_r' d_gnulibc='$d_gnulibc' d_grpasswd='$d_grpasswd' @@ -21964,6 +22902,8 @@ d_ilogbl='$d_ilogbl' d_inc_version_list='$d_inc_version_list' d_index='$d_index' d_inetaton='$d_inetaton' +d_inetntop='$d_inetntop' +d_inetpton='$d_inetpton' d_int64_t='$d_int64_t' d_isascii='$d_isascii' d_isfinite='$d_isfinite' @@ -21975,6 +22915,7 @@ d_lchown='$d_lchown' d_ldbl_dig='$d_ldbl_dig' d_libm_lib_version='$d_libm_lib_version' d_link='$d_link' +d_localtime64='$d_localtime64' d_localtime_r='$d_localtime_r' d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset' d_locconv='$d_locconv' @@ -21999,6 +22940,7 @@ d_mkdtemp='$d_mkdtemp' d_mkfifo='$d_mkfifo' d_mkstemp='$d_mkstemp' d_mkstemps='$d_mkstemps' +d_mktime64='$d_mktime64' d_mktime='$d_mktime' d_mmap='$d_mmap' d_modfl='$d_modfl' @@ -22019,6 +22961,8 @@ d_msgsnd='$d_msgsnd' d_msync='$d_msync' d_munmap='$d_munmap' d_mymalloc='$d_mymalloc' +d_ndbm='$d_ndbm' +d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes' d_nice='$d_nice' d_nl_langinfo='$d_nl_langinfo' d_nv_preserves_uv='$d_nv_preserves_uv' @@ -22035,6 +22979,8 @@ d_phostname='$d_phostname' d_pipe='$d_pipe' d_poll='$d_poll' d_portable='$d_portable' +d_prctl='$d_prctl' +d_prctl_set_name='$d_prctl_set_name' d_printf_format_null='$d_printf_format_null' d_procselfexe='$d_procselfexe' d_pseudofork='$d_pseudofork' @@ -22120,8 +23066,10 @@ d_sigaction='$d_sigaction' d_signbit='$d_signbit' d_sigprocmask='$d_sigprocmask' d_sigsetjmp='$d_sigsetjmp' +d_sin6_scope_id='$d_sin6_scope_id' d_sitearch='$d_sitearch' d_snprintf='$d_snprintf' +d_sockaddr_sa_len='$d_sockaddr_sa_len' d_sockatmark='$d_sockatmark' d_sockatmarkproto='$d_sockatmarkproto' d_socket='$d_socket' @@ -22137,6 +23085,7 @@ d_sresuproto='$d_sresuproto' d_statblks='$d_statblks' d_statfs_f_flags='$d_statfs_f_flags' d_statfs_s='$d_statfs_s' +d_static_inline='$d_static_inline' d_statvfs='$d_statvfs' d_stdio_cnt_lval='$d_stdio_cnt_lval' d_stdio_ptr_lval='$d_stdio_ptr_lval' @@ -22176,6 +23125,7 @@ d_tcsetpgrp='$d_tcsetpgrp' d_telldir='$d_telldir' d_telldirproto='$d_telldirproto' d_time='$d_time' +d_timegm='$d_timegm' d_times='$d_times' d_tm_tm_gmtoff='$d_tm_tm_gmtoff' d_tm_tm_zone='$d_tm_tm_zone' @@ -22240,6 +23190,7 @@ eunicefix='$eunicefix' exe_ext='$exe_ext' expr='$expr' extensions='$extensions' +extern_C='$extern_C' extras='$extras' fflushNULL='$fflushNULL' fflushall='$fflushall' @@ -22318,6 +23269,8 @@ i_float='$i_float' i_fp='$i_fp' i_fp_class='$i_fp_class' i_gdbm='$i_gdbm' +i_gdbm_ndbm='$i_gdbm_ndbm' +i_gdbmndbm='$i_gdbmndbm' i_grp='$i_grp' i_ieeefp='$i_ieeefp' i_inttypes='$i_inttypes' @@ -22327,6 +23280,7 @@ i_limits='$i_limits' i_locale='$i_locale' i_machcthr='$i_machcthr' i_malloc='$i_malloc' +i_mallocmalloc='$i_mallocmalloc' i_math='$i_math' i_memory='$i_memory' i_mntent='$i_mntent' @@ -22345,6 +23299,7 @@ i_sgtty='$i_sgtty' i_shadow='$i_shadow' i_socks='$i_socks' i_stdarg='$i_stdarg' +i_stdbool='$i_stdbool' i_stddef='$i_stddef' i_stdlib='$i_stdlib' i_string='$i_string' @@ -22361,6 +23316,7 @@ i_sysmode='$i_sysmode' i_sysmount='$i_sysmount' i_sysndir='$i_sysndir' i_sysparam='$i_sysparam' +i_syspoll='$i_syspoll' i_sysresrc='$i_sysresrc' i_syssecrt='$i_syssecrt' i_sysselct='$i_sysselct' @@ -22527,6 +23483,7 @@ path_sep='$path_sep' perl5='$perl5' perl='$perl' perl_patchlevel='$perl_patchlevel' +perl_static_inline='$perl_static_inline' perladmin='$perladmin' perllibs='$perllibs' perlpath='$perlpath' @@ -22559,6 +23516,10 @@ rm_try='$rm_try' rmail='$rmail' run='$run' runnm='$runnm' +sGMTIME_max='$sGMTIME_max' +sGMTIME_min='$sGMTIME_min' +sLOCALTIME_max='$sLOCALTIME_max' +sLOCALTIME_min='$sLOCALTIME_min' sPRIEUldbl='$sPRIEUldbl' sPRIFUldbl='$sPRIFUldbl' sPRIGUldbl='$sPRIGUldbl' @@ -22635,6 +23596,8 @@ srand48_r_proto='$srand48_r_proto' srandom_r_proto='$srandom_r_proto' src='$src' ssizetype='$ssizetype' +st_ino_sign='$st_ino_sign' +st_ino_size='$st_ino_size' startperl='$startperl' startsh='$startsh' static_ext='$static_ext' @@ -22684,10 +23647,12 @@ use5005threads='$use5005threads' use64bitall='$use64bitall' use64bitint='$use64bitint' usecrosscompile='$usecrosscompile' +usedevel='$usedevel' usedl='$usedl' usedtrace='$usedtrace' usefaststdio='$usefaststdio' useithreads='$useithreads' +usekernprocpathname='$usekernprocpathname' uselargefiles='$uselargefiles' uselongdouble='$uselongdouble' usemallocwrap='$usemallocwrap' @@ -22695,6 +23660,7 @@ usemorebits='$usemorebits' usemultiplicity='$usemultiplicity' usemymalloc='$usemymalloc' usenm='$usenm' +usensgetexecutablepath='$usensgetexecutablepath' useopcode='$useopcode' useperlio='$useperlio' useposix='$useposix' @@ -22715,6 +23681,7 @@ uvsize='$uvsize' uvtype='$uvtype' uvuformat='$uvuformat' uvxformat='$uvxformat' +vaproto='$vaproto' vendorarch='$vendorarch' vendorarchexp='$vendorarchexp' vendorbin='$vendorbin' @@ -22746,13 +23713,10 @@ zcat='$zcat' zip='$zip' EOT -: Add in command line options if available -$test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh - : add special variables $test -f $src/patchlevel.h && \ awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh -echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh +echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh echo "PERL_CONFIG_SH=true" >>config.sh : propagate old symbols @@ -22761,16 +23725,16 @@ if $test -f UU/config.sh; then $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \ config.sh config.sh UU/oldconfig.sh |\ $sort | $uniq -u >UU/oldsyms - set X `cat UU/oldsyms` + set X `$cat UU/oldsyms` shift case $# in 0) ;; *) - cat <>config.sh - for sym in `cat UU/oldsyms`; do + for sym in `$cat UU/oldsyms`; do echo " Propagating $hint variable "'$'"$sym..." eval 'tmp="$'"${sym}"'"' echo "$tmp" | \