X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Configure;h=b54ff9d70691d2e91f5ec559c564e297e05e79d2;hb=dce40316f42a4668ccea2765cda9168a586b4ffc;hp=e5dd7055b87b61fcbb87a15a321e2d1e66414686;hpb=7dd121aefd69a3ba2201a35698deaeda3a8a77ad;p=p5sagit%2Fp5-mst-13.2.git diff --git a/Configure b/Configure index e5dd705..b54ff9d 100755 --- a/Configure +++ b/Configure @@ -26,7 +26,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Mon Sep 12 15:44:06 CEST 2005 [metaconfig 3.0 PL70] +# Generated on Sat Jun 16 07:55:39 CEST 2007 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ <&4 <&1`" in - *gcc*) trygcc=no ;; - esac + # Skip this test because it gives a false match on output like: + # ./trygcc: line 23: cc: command not found + # case "`$cc -v -c try.c 2>&1`" in + # *gcc*) trygcc=no ;; + # esac if $test X"$trygcc" = Xyes; then if gcc -o try -c try.c; then echo " " echo "You seem to have a working gcc, though." >&4 - rp="Would you like to use it?" - dflt=y + # Switching compilers may undo the work of hints files. + # The most common problem is -D_REENTRANT for threads. + # This heuristic catches that case, but gets false positives + # if -Dusethreads was not actually specified. Better to + # bail out here with a useful message than fail + # mysteriously later. Should we perhaps just try to + # re-invoke Configure -Dcc=gcc config_args ? + if $test -f usethreads.cbu; then + $cat >&4 <&4 </dev/null` $test -z "$myuname" && myuname=`hostname 2>/dev/null` # tr '[A-Z]' '[a-z]' would not work in EBCDIC # because the A-Z/a-z are not consecutive. -myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \ +myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \ ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '` newmyuname="$myuname" dflt=n @@ -3124,18 +3188,21 @@ EOM domainos) osname=apollo osvers="$3" ;; - dgux) osname=dgux + dgux) osname=dgux + osvers="$3" + ;; + dragonfly) osname=dragonfly osvers="$3" ;; dynixptx*) osname=dynixptx osvers=`echo "$4"|sed 's/^v//'` ;; - freebsd) osname=freebsd + freebsd) osname=freebsd osvers="$3" ;; genix) osname=genix ;; gnu) osname=gnu osvers="$3" ;; - hp*) osname=hpux + hp*) osname=hpux osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'` ;; irix*) osname=irix @@ -3231,7 +3298,7 @@ EOM *freebsd*) ;; svr*) : svr4.x or possibly later - case "svr$3" in + case "svr$3" in ${osname}*) osname=svr$3 osvers=$4 @@ -3294,7 +3361,7 @@ EOM osvers="$5" fi fi - + case "$targetarch" in '') ;; *) hostarch=$osname @@ -3362,8 +3429,13 @@ EOM $cat <whoa -$startsh -EOS -cat <<'EOSC' >>whoa -dflt=y -echo " " -echo "*** WHOA THERE!!! ***" >&4 -echo " The $hint value for \$$var on this machine was \"$was\"!" >&4 -rp=" Keep the $hint value?" -. ./myread -case "$ans" in -y) td=$was; tu=$was;; +: decide how portable to be. Allow command line overrides. +case "$d_portable" in +"$undef") ;; +*) d_portable="$define" ;; esac -EOSC - -: function used to set $1 to $val -setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef; -case "$val$was" in -$define$undef) . ./whoa; eval "$var=\$td";; -$undef$define) . ./whoa; eval "$var=\$tu";; -*) eval "$var=$val";; -esac' -case "$usesocks" in -$define|true|[yY]*) dflt='y';; -*) dflt='n';; +: set up shell script to do ~ expansion +cat >filexp <&2 + exit 1 + fi + case "\$1" in + */*) + echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\` + ;; + *) + echo \$dir + ;; + esac + fi + ;; +*) + echo \$1 + ;; esac -cat <getfile +$startsh +EOS +cat <<'EOSC' >>getfile +tilde='' +fullpath='' +already='' +skip='' +none_ok='' +exp_file='' +nopath_ok='' +orig_rp="$rp" +orig_dflt="$dflt" +case "$gfpth" in +'') gfpth='.' ;; esac -set usesocks -eval $setvar -case "$usesocks" in -$define|true|[yY]*) useperlio="$define";; +case "$fn" in +*\(*) + : getfile will accept an answer from the comma-separated list + : enclosed in parentheses even if it does not meet other criteria. + expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok + fn=`echo $fn | sed 's/(.*)//'` + ;; esac -case "$useperlio" in -$define|true|[yY]*|'') dflt='y';; -*) dflt='n';; +case "$fn" in +*:*) + loc_file=`expr $fn : '.*:\(.*\)'` + fn=`expr $fn : '\(.*\):.*'` + ;; esac -cat <. 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" - ;; +case "$fn" in +*~*) tilde=true;; +esac +case "$fn" in +*/*) fullpath=true;; +esac +case "$fn" in +*+*) skip=true;; +esac +case "$fn" in +*n*) none_ok=true;; +esac +case "$fn" in +*e*) exp_file=true;; +esac +case "$fn" in +*p*) nopath_ok=true;; esac -set useperlio -eval $setvar -case "$usesocks" in -$define|true|[yY]*) - case "$useperlio" in - $define|true|[yY]*) ;; - *) cat >&4 </dev/null 2>&1 + then + value="$ans" + ansexp="$ans" + break + fi case "$ans" in - y|Y) val="$define" ;; - *) val="$undef" ;; - esac - set useithreads - eval $setvar - : Now set use5005threads to the opposite value. - case "$useithreads" in - $define) val="$undef" ;; - *) val="$define" ;; + none) + value='' + ansexp='' + case "$none_ok" in + true) type='';; + esac + ;; + *) + case "$tilde" in + '') value="$ans" + ansexp="$ans";; + *) + value=`UU/filexp $ans` + case $? in + 0) + if test "$ans" != "$value"; then + echo "(That expands to $value on this system.)" + fi + ;; + *) value="$ans";; + esac + ansexp="$value" + case "$exp_file" in + '') value="$ans";; + esac + ;; + esac + case "$fullpath" in + true) + case "$ansexp" in + /*) value="$ansexp" ;; + [a-zA-Z]:/*) value="$ansexp" ;; + *) + redo=true + case "$already" in + true) + echo "I shall only accept a full path name, as in /bin/ls." >&4 + echo "Use a ! shell escape if you wish to check pathnames." >&4 + ;; + *) + echo "Please give a full path name, starting with slash." >&4 + case "$tilde" in + true) + echo "Note that using ~name is ok provided it expands well." >&4 + already=true + ;; + esac + esac + ;; + esac + ;; + esac + case "$redo" in + '') + case "$type" in + File) + for fp in $gfpth; do + if test "X$fp" = X.; then + pf="$ansexp" + else + pf="$fp/$ansexp" + fi + if test -f "$pf"; then + type='' + elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1 + then + echo "($value is not a plain file, but that's ok.)" + type='' + fi + if test X"$type" = X; then + value="$pf" + break + fi + done + ;; + Directory) + for fp in $gfpth; do + if test "X$fp" = X.; then + dir="$ans" + direxp="$ansexp" + else + dir="$fp/$ansexp" + direxp="$fp/$ansexp" + fi + if test -d "$direxp"; then + type='' + value="$dir" + break + fi + done + ;; + Locate) + if test -d "$ansexp"; then + echo "(Looking for $loc_file in directory $value.)" + value="$value/$loc_file" + ansexp="$ansexp/$loc_file" + fi + if test -f "$ansexp"; then + type='' + fi + case "$nopath_ok" in + true) case "$value" in + */*) ;; + *) echo "Assuming $value will be in people's path." + type='' + ;; + esac + ;; + esac + ;; + esac + + case "$skip" in + true) type=''; + esac + + case "$type" in + '') ;; + *) + if test "$fastread" = yes; then + dflt=y + else + dflt=n + fi + rp="$what $value doesn't exist. Use that name anyway?" + . UU/myread + dflt='' + case "$ans" in + y*) type='';; + *) echo " ";; + esac + ;; + esac + ;; + esac + ;; esac - set use5005threads - eval $setvar +done +cd UU +ans="$value" +rp="$orig_rp" +dflt="$orig_dflt" +rm -f getfile.ok +test "X$gfpthkeep" != Xy && gfpth="" +EOSC + +: determine root of directory hierarchy where package will be installed. +case "$prefix" in +'') + dflt=`./loc . /usr/local /usr/local /local /opt /usr` + ;; +*?/) + dflt=`echo "$prefix" | sed 's/.$//'` ;; *) - useithreads="$undef" - use5005threads="$undef" + dflt="$prefix" ;; esac +$cat <&4 <&4 <&4 +else + echo "AFS does not seem to be running..." >&4 +fi +: determine installation prefix for where package is to be installed. +if $afs; then +$cat <installprefix +$startsh +EOS +cat <<'EOSC' >>installprefix +: Change installation prefix, if necessary. +if $test X"$prefix" != X"$installprefix"; then + eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`" +else + eval "install${prefixvar}=\"\$${prefixvar}exp\"" fi +EOSC +chmod +x installprefix +$eunicefix installprefix + +: Set variables such as privlib and privlibexp from the output of ./getfile +: performing the prefixexp/installprefixexp correction if necessary. +cat <setprefixvar +$startsh +EOS +cat <<'EOSC' >>setprefixvar +eval "${prefixvar}=\"\$ans\"" +eval "${prefixvar}exp=\"\$ansexp\"" +. ./installprefix +EOSC +chmod +x setprefixvar +$eunicefix setprefixvar + +: set up the script used to warn in case of inconsistency +cat <whoa +$startsh +EOS +cat <<'EOSC' >>whoa +dflt=y +case "$hint" in + recommended) + case "$hintfile" in + '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4 + ;; + *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4 + echo "the $hint value for \$$var on this machine was \"$was\"!" >&4 + ;; + esac + ;; + *) echo " " + echo "*** WHOA THERE!!! ***" >&4 + echo " The $hint value for \$$var on this machine was \"$was\"!" >&4 + ;; +esac +rp=" Keep the $hint value?" +. ./myread +case "$ans" in +y) td=$was; tu=$was;; +esac +EOSC + +: function used to set $1 to $val +setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef; +case "$val$was" in +$define$undef) . ./whoa; eval "$var=\$td";; +$undef$define) . ./whoa; eval "$var=\$tu";; +*) eval "$var=$val";; +esac' +case "$usesocks" in +$define|true|[yY]*) dflt='y';; +*) dflt='n';; +esac cat <. 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" ;; -*) case "$usemultiplicity" in - $define|true|[yY]*) dflt='y';; - *) dflt='n';; - esac - echo " " - echo "If this doesn't make any sense to you, just accept the default '$dflt'." - rp='Build Perl for multiplicity?' - . ./myread - case "$ans" in - y|Y) val="$define" ;; - *) val="$undef" ;; - esac +*) + echo "Ok, doing things the stdio way." + val="$undef" ;; esac -set usemultiplicity -eval $setvar +set useperlio +eval $setvar +case "$usesocks" in +$define|true|[yY]*) + case "$useperlio" in + $define|true|[yY]*) ;; + *) cat >&4 <bsd -echo exit 1 >usg -echo exit 1 >v7 -echo exit 1 >osf1 -echo exit 1 >eunice -echo exit 1 >xenix -echo exit 1 >venix -echo exit 1 >os2 -d_bsd="$undef" -$cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null -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 - 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..." - echo exit 0 >bsd - echo exit 0 >usg - else - if $contains SIGTSTP foo >/dev/null 2>&1 ; then - echo "Looks kind of like an extended USG system, but we'll see..." - else - echo "Looks kind of like a USG system, but we'll see..." - fi - echo exit 0 >usg - fi -elif $contains SIGTSTP foo >/dev/null 2>&1 ; then - echo "Looks kind of like a BSD system, but we'll see..." - d_bsd="$define" - echo exit 0 >bsd +echo "Getting the current patchlevel..." >&4 +if $test -r $rsrc/patchlevel.h;then + revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h` + patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` + subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` + api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h` + api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h` + api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` + perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'` else - echo "Looks kind of like a Version 7 system, but we'll see..." - echo exit 0 >v7 + revision=0 + patchlevel=0 + subversion=0 + api_revision=0 + api_version=0 + api_subversion=0 + perl_patchlevel=0 + $echo "(You do not have patchlevel.h. Eek.)" fi -case "$eunicefix" in -*unixtovms*) +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" ;; +esac + +$echo "(You have $package $version_patchlevel_string.)" + +case "$osname" in +dos|vms) + : XXX Should be a Configure test for double-dots in filenames. + version=`echo $revision $patchlevel $subversion | \ + $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` + api_versionstring=`echo $api_revision $api_version $api_subversion | \ + $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` + ;; +*) + version=`echo $revision $patchlevel $subversion | \ + $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` + api_versionstring=`echo $api_revision $api_version $api_subversion | \ + $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` + ;; +esac +: Special case the 5.005_xx maintenance series, which used 5.005 +: without any subversion label as a subdirectory in $sitelib +if test "${api_revision}${api_version}${api_subversion}" = "550"; then + api_versionstring='5.005' +fi + +case "$usethreads" in +$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';; + esac + ;; +esac +cat <&4 <&4 <&4 <bsd +echo exit 1 >usg +echo exit 1 >v7 +echo exit 1 >osf1 +echo exit 1 >eunice +echo exit 1 >xenix +echo exit 1 >venix +echo exit 1 >os2 +d_bsd="$undef" +$cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null +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 + 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..." + echo exit 0 >bsd + echo exit 0 >usg + else + if $contains SIGTSTP foo >/dev/null 2>&1 ; then + echo "Looks kind of like an extended USG system, but we'll see..." + else + echo "Looks kind of like a USG system, but we'll see..." + fi + echo exit 0 >usg + fi +elif $contains SIGTSTP foo >/dev/null 2>&1 ; then + echo "Looks kind of like a BSD system, but we'll see..." + d_bsd="$define" + echo exit 0 >bsd +else + echo "Looks kind of like a Version 7 system, but we'll see..." + echo exit 0 >v7 +fi +case "$eunicefix" in +*unixtovms*) $cat <<'EOI' There is, however, a strange, musty smell in the air that reminds me of something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit. @@ -3875,370 +4440,88 @@ echo "Checking for GNU cc in disguise and/or its version number..." >&4 $cat >try.c < int main() { -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) #ifdef __VERSION__ printf("%s\n", __VERSION__); #else printf("%s\n", "1"); #endif #endif - return(0); -} -EOM -if $cc -o try $ccflags $ldflags try.c; then - gccversion=`$run ./try` - case "$gccversion" in - '') echo "You are not using GNU cc." ;; - *) echo "You are using GNU cc $gccversion." - ccname=gcc - ;; - esac -else - echo " " - echo "*** WHOA THERE!!! ***" >&4 - echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4 - case "$knowitall" in - '') - echo " You'd better start hunting for one and let me know about it." >&4 - exit 1 - ;; - esac -fi -$rm -f try try.* -case "$gccversion" in -1*) cpp=`./loc gcc-cpp $cpp $pth` ;; -esac -case "$gccversion" in -'') gccosandvers='' ;; -*) gccshortvers=`echo "$gccversion"|sed 's/ .*//'` - gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"` - gccshortvers='' - case "$gccosandvers" in - $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr - $osname$osvers) ;; # looking good - $osname*) cat <&4 - -*** WHOA THERE!!! *** - - Your gcc has not been compiled for the exact release of - your operating system ($gccosandvers versus $osname$osvers). - - In general it is a good idea to keep gcc synchronized with - the operating system because otherwise serious problems - may ensue when trying to compile software, like Perl. - - I'm trying to be optimistic here, though, and will continue. - If later during the configuration and build icky compilation - problems appear (headerfile conflicts being the most common - manifestation), I suggest reinstalling the gcc to match - your operating system release. - -EOM - ;; - *) gccosandvers='' ;; # failed to parse, better be silent - esac - ;; -esac -case "$ccname" in -'') ccname="$cc" ;; -esac - -# gcc 3.* complain about adding -Idirectories that they already know about, -# so we will take those off from locincpth. -case "$gccversion" in -3*) - echo "main(){}">try.c - for incdir in $locincpth; do - warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \ - grep '^c[cp]p*[01]: warning: changing search order '` - if test "X$warn" != X; then - locincpth=`echo " $locincpth " | sed "s! $incdir ! !"` - fi - done - $rm -f try try.* -esac - -: decide how portable to be. Allow command line overrides. -case "$d_portable" in -"$undef") ;; -*) d_portable="$define" ;; -esac - -: set up shell script to do ~ expansion -cat >filexp <&2 - exit 1 - fi - case "\$1" in - */*) - echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\` - ;; - *) - echo \$dir - ;; - esac - fi - ;; -*) - echo \$1 - ;; -esac -EOSS -chmod +x filexp -$eunicefix filexp - -: now set up to get a file name -cat <getfile -$startsh -EOS -cat <<'EOSC' >>getfile -tilde='' -fullpath='' -already='' -skip='' -none_ok='' -exp_file='' -nopath_ok='' -orig_rp="$rp" -orig_dflt="$dflt" -case "$gfpth" in -'') gfpth='.' ;; -esac - -case "$fn" in -*\(*) - : getfile will accept an answer from the comma-separated list - : enclosed in parentheses even if it does not meet other criteria. - expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok - fn=`echo $fn | sed 's/(.*)//'` - ;; -esac - -case "$fn" in -*:*) - loc_file=`expr $fn : '.*:\(.*\)'` - fn=`expr $fn : '\(.*\):.*'` - ;; -esac - -case "$fn" in -*~*) tilde=true;; -esac -case "$fn" in -*/*) fullpath=true;; -esac -case "$fn" in -*+*) skip=true;; -esac -case "$fn" in -*n*) none_ok=true;; -esac -case "$fn" in -*e*) exp_file=true;; -esac -case "$fn" in -*p*) nopath_ok=true;; -esac - -case "$fn" in -*f*) type='File';; -*d*) type='Directory';; -*l*) type='Locate';; -esac - -what="$type" -case "$what" in -Locate) what='File';; -esac - -case "$exp_file" in -'') - case "$d_portable" in - "$define") ;; - *) exp_file=true;; - esac - ;; -esac - -cd .. -while test "$type"; do - redo='' - rp="$orig_rp" - dflt="$orig_dflt" - case "$tilde" in - true) rp="$rp (~name ok)";; - esac - . UU/myread - if test -f UU/getfile.ok && \ - $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1 - then - value="$ans" - ansexp="$ans" - break - fi - case "$ans" in - none) - value='' - ansexp='' - case "$none_ok" in - true) type='';; - esac - ;; - *) - case "$tilde" in - '') value="$ans" - ansexp="$ans";; - *) - value=`UU/filexp $ans` - case $? in - 0) - if test "$ans" != "$value"; then - echo "(That expands to $value on this system.)" - fi - ;; - *) value="$ans";; - esac - ansexp="$value" - case "$exp_file" in - '') value="$ans";; - esac - ;; - esac - case "$fullpath" in - true) - case "$ansexp" in - /*) value="$ansexp" ;; - [a-zA-Z]:/*) value="$ansexp" ;; - *) - redo=true - case "$already" in - true) - echo "I shall only accept a full path name, as in /bin/ls." >&4 - echo "Use a ! shell escape if you wish to check pathnames." >&4 - ;; - *) - echo "Please give a full path name, starting with slash." >&4 - case "$tilde" in - true) - echo "Note that using ~name is ok provided it expands well." >&4 - already=true - ;; - esac - esac - ;; - esac - ;; - esac - case "$redo" in - '') - case "$type" in - File) - for fp in $gfpth; do - if test "X$fp" = X.; then - pf="$ansexp" - else - pf="$fp/$ansexp" - fi - if test -f "$pf"; then - type='' - elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1 - then - echo "($value is not a plain file, but that's ok.)" - type='' - fi - if test X"$type" = X; then - value="$pf" - break - fi - done - ;; - Directory) - for fp in $gfpth; do - if test "X$fp" = X.; then - dir="$ans" - direxp="$ansexp" - else - dir="$fp/$ansexp" - direxp="$fp/$ansexp" - fi - if test -d "$direxp"; then - type='' - value="$dir" - break - fi - done - ;; - Locate) - if test -d "$ansexp"; then - echo "(Looking for $loc_file in directory $value.)" - value="$value/$loc_file" - ansexp="$ansexp/$loc_file" - fi - if test -f "$ansexp"; then - type='' - fi - case "$nopath_ok" in - true) case "$value" in - */*) ;; - *) echo "Assuming $value will be in people's path." - type='' - ;; - esac - ;; - esac - ;; - esac - - case "$skip" in - true) type=''; - esac - - case "$type" in - '') ;; - *) - if test "$fastread" = yes; then - dflt=y - else - dflt=n - fi - rp="$what $value doesn't exist. Use that name anyway?" - . UU/myread - dflt='' - case "$ans" in - y*) type='';; - *) echo " ";; - esac - ;; - esac - ;; - esac + return(0); +} +EOM +if $cc -o try $ccflags $ldflags try.c; then + gccversion=`$run ./try` + case "$gccversion" in + '') echo "You are not using GNU cc." ;; + *) echo "You are using GNU cc $gccversion." + ccname=gcc + ;; + esac +else + echo " " + echo "*** WHOA THERE!!! ***" >&4 + echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4 + case "$knowitall" in + '') + echo " You'd better start hunting for one and let me know about it." >&4 + exit 1 ;; esac -done -cd UU -ans="$value" -rp="$orig_rp" -dflt="$orig_dflt" -rm -f getfile.ok -test "X$gfpthkeep" != Xy && gfpth="" -EOSC +fi +$rm -f try try.* +case "$gccversion" in +1*) cpp=`./loc gcc-cpp $cpp $pth` ;; +esac +case "$gccversion" in +'') gccosandvers='' ;; +*) gccshortvers=`echo "$gccversion"|sed 's/ .*//'` + gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"` + gccshortvers='' + case "$gccosandvers" in + $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr + $osname$osvers) ;; # looking good + $osname*) cat <&4 + +*** WHOA THERE!!! *** + + Your gcc has not been compiled for the exact release of + your operating system ($gccosandvers versus $osname$osvers). + + In general it is a good idea to keep gcc synchronized with + the operating system because otherwise serious problems + may ensue when trying to compile software, like Perl. + + I'm trying to be optimistic here, though, and will continue. + If later during the configuration and build icky compilation + problems appear (headerfile conflicts being the most common + manifestation), I suggest reinstalling the gcc to match + your operating system release. + +EOM + ;; + *) gccosandvers='' ;; # failed to parse, better be silent + esac + ;; +esac +case "$ccname" in +'') ccname="$cc" ;; +esac + +# gcc 3.* complain about adding -Idirectories that they already know about, +# so we will take those off from locincpth. +case "$gccversion" in +3*) + echo "main(){}">try.c + for incdir in $locincpth; do + warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \ + grep '^c[cp]p*[01]: warning: changing search order '` + if test "X$warn" != X; then + locincpth=`echo " $locincpth " | sed "s! $incdir ! !"` + fi + done + $rm -f try try.* +esac : What should the include directory be ? echo " " @@ -4539,6 +4822,8 @@ lib_ext=$_a obj_ext=$_o path_sep=$p_ +rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*" + : Which makefile gets called first. This is used by make depend. case "$firstmakefile" in '') firstmakefile='makefile';; @@ -4715,16 +5000,46 @@ case "$optimize" in 'none') optimize=" ";; esac +: Check what DEBUGGING is required from the command line +: -DEBUGGING or -DDEBUGGING or +: -DEBUGGING=both = -g + -DDEBUGGING +: -DEBUGGING=-g or -Doptimize=-g = -g +: -DEBUGGING=none or -UDEBUGGING = +: -DEBUGGING=old or -DEBUGGING=default = ? $optimize +case "$EBUGGING" in +'') ;; +*) DEBUGGING=$EBUGGING ;; +esac + +case "$DEBUGGING" in +-g|both|$define) + case "$optimize" in + *-g*) ;; + *) optimize="$optimize -g" ;; + esac ;; +none|$undef) + case "$optimize" in + *-g*) set `echo "X $optimize " | sed 's/ -g / /'` + shift + optimize="$*" + ;; + esac ;; +esac + dflt='' +case "$DEBUGGING" in +both|$define) dflt='-DDEBUGGING' +esac + : We will not override a previous value, but we might want to : augment a hint file case "$hint" in default|recommended) case "$gccversion" in - 1*) dflt='-fpcc-struct-return' ;; + 1*) dflt="$dflt -fpcc-struct-return" ;; esac - case "$optimize" in - *-g*) dflt="$dflt -DDEBUGGING";; + case "$optimize:$DEBUGGING" in + *-g*:old) dflt="$dflt -DDEBUGGING";; esac case "$gccversion" in 2*) if test -d /etc/conf/kconfig.d && @@ -4772,20 +5087,6 @@ default|recommended) else echo "Nope, it doesn't, but that's ok." 2>&1 fi - - echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1 - echo 'int main(void) { return 0; }' > gcctest.c - if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then - echo "Yes, it does." 2>&1 - case "$ccflags" in - *-Wdeclaration-after-statement*) - echo "Leaving current flags $ccflags alone." 2>&1 - ;; - *) dflt="$dflt -Wdeclaration-after-statement" ;; - esac - else - echo "Nope, it doesn't, but that's ok." 2>&1 - fi ;; esac ;; @@ -5041,7 +5342,7 @@ y) ;; n) echo "OK, that should do.";; esac -$rm -f try try.* core +$rm_try : define a shorthand compile call compile=' @@ -5216,7 +5517,7 @@ EOM fi ;; esac -$rm -f try try.* +$rm_try : check for long long echo " " @@ -5230,7 +5531,7 @@ else val="$undef" echo "You do not have long long." fi -$rm try.* +$rm_try set d_longlong eval $setvar @@ -5261,10 +5562,10 @@ EOCP fi if $test "X$longsize" = "X$longlongsize"; then echo "(That isn't any different from an ordinary long.)" - fi + fi ;; esac -$rm -f try.* try +$rm_try : see if inttypes.h is available : we want a real compile instead of Inhdr because some systems @@ -5284,7 +5585,7 @@ else echo " NOT found." >&4 val="$undef" fi -$rm -f try.c try +$rm_try set i_inttypes eval $setvar @@ -5307,7 +5608,7 @@ else val="$undef" echo "You do not have int64_t." fi -$rm -f try try.* +$rm_try set d_int64_t eval $setvar @@ -5588,7 +5889,7 @@ EOCP fi ;; esac -$rm -f try.c try +$rm_try : check for long doubles echo " " @@ -5602,7 +5903,7 @@ else val="$undef" echo "You do not have long double." fi -$rm try.* +$rm_try set d_longdbl eval $setvar @@ -5635,10 +5936,10 @@ EOCP echo "That isn't any different from an ordinary double." echo "I'll keep your setting anyway, but you may see some" echo "harmless compilation warnings." - fi + fi ;; esac -$rm -f try.* try +$rm_try : determine the architecture name echo " " @@ -5760,101 +6061,6 @@ if $test -f archname.cbu; then . ./archname.cbu fi -: determine root of directory hierarchy where package will be installed. -case "$prefix" in -'') - dflt=`./loc . /usr/local /usr/local /local /opt /usr` - ;; -*?/) - dflt=`echo "$prefix" | sed 's/.$//'` - ;; -*) - dflt="$prefix" - ;; -esac -$cat <&4 -else - echo "AFS does not seem to be running..." >&4 -fi - -: determine installation prefix for where package is to be installed. -if $afs; then -$cat <&4 -if $test -r $rsrc/patchlevel.h;then - revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h` - patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` - subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` - api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h` - api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h` - api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` - perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'` -else - revision=0 - patchlevel=0 - subversion=0 - api_revision=0 - api_version=0 - api_subversion=0 - perl_patchlevel=0 - $echo "(You do not have patchlevel.h. Eek.)" -fi -if $test -r $rsrc/.patch ; then - if $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" ;; -esac - -$echo "(You have $package $version_patchlevel_string.)" - -case "$osname" in -dos|vms) - : XXX Should be a Configure test for double-dots in filenames. - version=`echo $revision $patchlevel $subversion | \ - $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` - api_versionstring=`echo $api_revision $api_version $api_subversion | \ - $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` - ;; + *) eval "$1=";; + esac;; + esac;; + esac;; *) - version=`echo $revision $patchlevel $subversion | \ - $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` - api_versionstring=`echo $api_revision $api_version $api_subversion | \ - $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` - ;; -esac -: Special case the 5.005_xx maintenance series, which used 5.005 -: without any subversion label as a subdirectory in $sitelib -if test "${api_revision}${api_version}${api_subversion}" = "550"; then - api_versionstring='5.005' -fi + eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\""; + case "$tp" in + --|/*--|\~*--) eval "$1=\"$prefix/$3\"";; + /*-$oldprefix/*|\~*-$oldprefix/*) + eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";; + *) eval "$1=\"\$$2\"";; + esac;; +esac' : determine installation style : For now, try to deduce it from prefix unless it is already set. @@ -5953,9 +6103,59 @@ esac : confusing anyway. installstyle=$dflt +: determine where public executables go +echo " " +set dflt bin bin +eval $prefixit +fn=d~ +rp='Pathname where the public executables will reside?' +. ./getfile +if $test "X$ansexp" != "X$binexp"; then + installbin='' +fi +prefixvar=bin +: XXX Bug? -- ignores Configure -Dinstallprefix setting. +: XXX If this is fixed, also fix the "start perl" hunk below, which relies on +: this via initialinstalllocation +. ./setprefixvar + +case "$userelocatableinc" in +$define|true|[yY]*) dflt='y' ;; +*) dflt='n' ;; +esac +cat <reflect + chmod +x,u+s reflect + ./reflect >flect 2>&1 + if $contains "/dev/fd" flect >/dev/null; then + echo "Congratulations, your kernel has secure setuid scripts!" >&4 + val="$define" + else + $cat <&4 + dflt=n;; + "$undef") + echo "Well, the $hint value is *not* secure." >&4 + dflt=n;; + *) echo "Well, the $hint value *is* secure." >&4 + dflt=y;; + esac + ;; + *) + $rm -f reflect flect + echo "#!$ls" >reflect + chmod +x,u+s reflect + echo >flect + chmod a+w flect + echo '"su" will (probably) prompt you for '"$ans's password." + su $ans -c './reflect >flect' + if $contains "/dev/fd" flect >/dev/null; then + echo "Okay, it looks like setuid scripts are secure." >&4 + dflt=y + else + echo "I don't think setuid scripts are secure." >&4 + dflt=n + fi + ;; + esac + rp='Does your kernel have *secure* setuid scripts?' + . ./myread + case "$ans" in + [yY]*) val="$define";; + *) val="$undef";; + esac + fi +else + echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4 + echo "(That's for file descriptors, not floppy disks.)" + val="$undef" +fi +set d_suidsafe +eval $setvar + +$rm -f reflect flect + +: now see if they want to do setuid emulation +echo " " +val="$undef" +case "$d_suidsafe" in +"$define") + val="$undef" + echo "No need to emulate SUID scripts since they are secure here." >&4 + ;; +*) + $cat </dev/null 2>&1; then + perl5=$tdir/perl + break; + elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then + perl5=$tdir/perl5 + break; + fi + done + ;; +*) perl5="$perl5" + ;; +esac +case "$perl5" in +'') echo "None found. That's ok.";; +*) echo "Using $perl5." ;; +esac + +$cat < getverlist <> getverlist <<'EOPL' +# The list found is store twice for each entry: the original name, and +# the binary broken down version as pack "sss", so sorting is easy and +# unambiguous. This will work for all versions that have a maximum of +# three digit groups, separate by '.'s or '_'s. Names are extended with +# ".0.0" to ensure at least three elements for the pack. +# -- H.Merijn Brand (m)'06 23-10-2006 + +# Can't have leading @ because metaconfig interprets it as a command! +;@inc_version_list=(); +# XXX Redo to do opendir/readdir? +if (-d $stem) { + chdir($stem); + ;@candidates = map { + [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*"); +} +else { + ;@candidates = (); +} -EOM +($pversion, $aversion, $vsn5005) = map { + pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005"; +foreach $d (@candidates) { + if ($d->[1] lt $pversion) { + if ($d->[1] ge $aversion) { + unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]); + } + elsif ($d->[1] ge $vsn5005) { + unshift(@inc_version_list, grep { -d } $d->[0]); + } + } + else { + # Skip newer version. I.e. don't look in + # 5.7.0 if we're installing 5.6.1. + } +} -val="$undef" -if $test -d /dev/fd; then - echo "#!$ls" >reflect - chmod +x,u+s reflect - ./reflect >flect 2>&1 - if $contains "/dev/fd" flect >/dev/null; then - echo "Congratulations, your kernel has secure setuid scripts!" >&4 - val="$define" +if (@inc_version_list) { + print join(' ', @inc_version_list); +} +else { + # Blank space to preserve value for next Configure run. + print " "; +} +EOPL +chmod +x getverlist +case "$inc_version_list" in +'') if test -x "$perl5$exe_ext"; then + dflt=`$perl5 getverlist` else - $cat <&4 - dflt=n;; - "$undef") - echo "Well, the $hint value is *not* secure." >&4 - dflt=n;; - *) echo "Well, the $hint value *is* secure." >&4 - dflt=y;; - esac - ;; - *) - $rm -f reflect flect - echo "#!$ls" >reflect - chmod +x,u+s reflect - echo >flect - chmod a+w flect - echo '"su" will (probably) prompt you for '"$ans's password." - su $ans -c './reflect >flect' - if $contains "/dev/fd" flect >/dev/null; then - echo "Okay, it looks like setuid scripts are secure." >&4 - dflt=y - else - echo "I don't think setuid scripts are secure." >&4 - dflt=n - fi - ;; - esac - rp='Does your kernel have *secure* setuid scripts?' - . ./myread - case "$ans" in - [yY]*) val="$define";; - *) val="$undef";; - esac fi -else - echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4 - echo "(That's for file descriptors, not floppy disks.)" - val="$undef" -fi -set d_suidsafe -eval $setvar - -$rm -f reflect flect - -: now see if they want to do setuid emulation -echo " " -val="$undef" -case "$d_suidsafe" in -"$define") - val="$undef" - echo "No need to emulate SUID scripts since they are secure here." >&4 ;; -*) - $cat < NOT found." >&4 val="$undef" fi -$rm -f try.c try +$rm_try set i_malloc eval $setvar @@ -6251,7 +6631,7 @@ EOM voidflags="$ans" ;; esac -$rm -f try.* .out +$rm_try : check for length of pointer echo " " @@ -6288,7 +6668,7 @@ EOCP fi ;; esac -$rm -f try.c try +$rm_try case "$use64bitall" in "$define"|true|[yY]*) case "$ptrsize" in @@ -6419,77 +6799,6 @@ case "$freetype" in esac echo "Your system uses $freetype free(), it would seem." >&4 $rm -f malloc.[co] -$cat <. - -Aborting Configure now. -EOM - exit 2 - ;; -esac - -: determine where public executables go -echo " " -set dflt bin bin -eval $prefixit -fn=d~ -rp='Pathname where the public executables will reside?' -. ./getfile -if $test "X$ansexp" != "X$binexp"; then - installbin='' -fi -bin="$ans" -binexp="$ansexp" -: Change installation prefix, if necessary. -: XXX Bug? -- ignores Configure -Dinstallprefix setting. -if $test X"$prefix" != X"$installprefix"; then - installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"` -else - installbin="$binexp" -fi +Eventually, we hope to support building Perl with pre-ANSI compilers. +If you would like to help in that effort, please contact . + +Aborting Configure now. +EOM + exit 2 + ;; +esac echo " " case "$extras" in @@ -6798,7 +7078,7 @@ set html1dir html1dir none eval $prefixit $cat </dev/null 2>&1; then - perl5=$tdir/perl - break; - elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then - perl5=$tdir/perl5 - break; - fi - done - ;; -*) perl5="$perl5" - ;; -esac -case "$perl5" in -'') echo "None found. That's ok.";; -*) echo "Using $perl5." ;; -esac - -: Determine list of previous versions to include in @INC -$cat > getverlist <> getverlist <<'EOPL' -# Can't have leading @ because metaconfig interprets it as a command! -;@inc_version_list=(); -# XXX Redo to do opendir/readdir? -if (-d $stem) { - chdir($stem); - ;@candidates = glob("5.*"); -} -else { - ;@candidates = (); -} - -# XXX ToDo: These comparisons must be reworked when two-digit -# subversions come along, so that 5.7.10 compares as greater than -# 5.7.3! By that time, hope that 5.6.x is sufficiently -# widespread that we can use the built-in version vectors rather -# than reinventing them here. For 5.6.0, however, we must -# assume this script will likely be run by 5.005_0x. --AD 1/2000. -foreach $d (@candidates) { - if ($d lt $version) { - if ($d ge $api_versionstring) { - unshift(@inc_version_list, grep { -d } "$d/$archname", $d); - } - elsif ($d ge "5.005") { - unshift(@inc_version_list, grep { -d } $d); - } - } - else { - # Skip newer version. I.e. don't look in - # 5.7.0 if we're installing 5.6.1. - } -} - -if (@inc_version_list) { - print join(' ', @inc_version_list); -} -else { - # Blank space to preserve value for next Configure run. - print " "; -} -EOPL -chmod +x getverlist -case "$inc_version_list" in -'') if test -x "$perl5$exe_ext"; then - dflt=`$perl5 getverlist` - else - dflt='none' - fi - ;; -$undef) dflt='none' ;; -*) eval dflt=\"$inc_version_list\" ;; -esac -case "$dflt" in -''|' ') dflt=none ;; -esac -case "$dflt" in -5.005) dflt=none ;; -esac -$cat <= 2 && __GLIBC_MINOR__ >= 1 +# if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus) # include printf("%s\n", gnu_get_libc_version()); # else @@ -7050,7 +7200,7 @@ else gnulibc_version='' echo "You are not using the GNU C Library" fi -$rm -f try try.* glibc.ver +$rm_try glibc.ver set d_gnulibc eval $setvar @@ -7435,6 +7585,32 @@ $rm -f libnames libpath set dld.h i_dld eval $inhdr + +echo " " +echo "Checking for C++..." >&4 +$cat >try.c <<'EOCP' +#include +int main(void) +{ +#ifdef __cplusplus + return 0; +#else + return 1; +#endif +} +EOCP +set try +if eval $compile_ok && $run ./try; then + val="$define" + echo "You are using a C++ compiler." +else + val="$undef" + echo "You are not using a C++ compiler." +fi +$rm_try cplusplus$$ +set d_cplusplus +eval $setvar + : is a C symbol defined? csym='tlook=$1; case "$3" in @@ -7450,19 +7626,22 @@ 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 "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c; + echo "extern $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 -f try$_exe try.c core core.* try.core; + $rm_try; fi; else - echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c; + echo "extern $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 -f try$_exe try.c; + $rm_try; fi; ;; *) @@ -7503,10 +7682,24 @@ esac' : see if dlopen exists xxx_runnm="$runnm" +xxx_ccflags="$ccflags" runnm=false +: with g++ one needs -shared to get is-in-libc to work for dlopen +case "$gccversion" in +'') ;; +*) case "$d_cplusplus" in + "$define") ccflags="$ccflags -shared" ;; + esac + ;; +esac set dlopen d_dlopen eval $inlibc runnm="$xxx_runnm" +ccflags="$xxx_ccflags" + +: see if this is a unistd.h system +set unistd.h i_unistd +eval $inhdr : determine which dynamic loading, if any, to compile in echo " " @@ -7520,7 +7713,7 @@ $undef|n|false) dflt='n' usedl="$undef" ;; -*) +*) dflt='n' case "$d_dlopen" in $define) dflt='y' ;; @@ -7583,7 +7776,7 @@ EOM ;; *) case "$osname" in darwin) dflt='none' ;; - svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;; + linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;; *) dflt='-fpic' ;; esac ;; esac ;; @@ -7611,10 +7804,14 @@ EOM #ifdef I_STDLIB #include #endif +#$i_unistd I_UNISTD +#ifdef I_UNISTD +#include +#endif int main() { char b[4]; int i = open("a.out",O_RDONLY); - if(i == -1) + if(i == -1) exit(1); /* fail */ if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F') exit(0); /* succeed (yes, it's ELF) */ @@ -7631,7 +7828,7 @@ EOM echo "I'll use ld to build dynamic libraries." dflt='ld' fi - rm -f try.c a.out + $rm_try ;; *) dflt="$ld" ;; @@ -7657,8 +7854,8 @@ EOM case "$gccversion" in '') dflt="$dflt +vnocompatwarnings" ;; esac - ;; - linux|irix*|gnu*) dflt='-shared' ;; + ;; + linux|irix*|gnu*) dflt="-shared $optimize" ;; next) dflt='none' ;; solaris) dflt='-G' ;; sunos) dflt='-assert nodefinitions' ;; @@ -7886,7 +8083,7 @@ if "$useshrplib"; then solaris) xxx="-R $shrpdir" ;; - freebsd|netbsd|openbsd|interix) + freebsd|netbsd|openbsd|interix|dragonfly) xxx="-Wl,-R$shrpdir" ;; bsdos|linux|irix*|dec_osf|gnu*) @@ -8000,20 +8197,14 @@ rp="Where do the main $spackage manual pages (source) go?" if $test "X$man1direxp" != "X$ansexp"; then installman1dir='' fi -man1dir="$ans" -man1direxp="$ansexp" +prefixvar=man1dir +. ./setprefixvar + case "$man1dir" in '') man1dir=' ' installman1dir='';; esac -: Change installation prefix, if necessary. -if $test X"$prefix" != X"$installprefix"; then - installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"` -else - installman1dir="$man1direxp" -fi - : What suffix to use on installed man pages case "$man1dir" in @@ -8088,7 +8279,7 @@ esac case "$d_flexfnam" in undef) $cat <<'EOM' -However, your system can't handle the long file names like File::Basename.3. +However, your system can't handle the long file names like File::Basename.3. EOM case "$man3dir" in '') man3dir="none";; @@ -8103,8 +8294,8 @@ case "$man3dir" in cat <&4 WARNING: Previous versions of perl installed man3 pages into -$privlib/man/man3. This version will suggest a -new default of $dflt. +$privlib/man/man3. This version will suggest a +new default of $dflt. EOM tdflt=$dflt dflt='n' @@ -8125,20 +8316,14 @@ echo " " fn=dn+~ rp="Where do the $package library man pages (source) go?" . ./getfile -man3dir="$ans" -man3direxp="$ansexp" +prefixvar=man3dir +. ./setprefixvar + case "$man3dir" in '') man3dir=' ' installman3dir='';; esac -: Change installation prefix, if necessary. -if $test X"$prefix" != X"$installprefix"; then - installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"` -else - installman3dir="$man3direxp" -fi - : What suffix to use on installed man pages case "$man3dir" in ' ') @@ -8504,6 +8689,9 @@ case "$versiononly" in esac : figure out how to guarantee perl startup +: XXX Note that this currently takes advantage of the bug that binexp ignores +: the Configure -Dinstallprefix setting, which in turn means that under +: relocatable @INC, initialinstalllocation is what binexp started as. case "$startperl" in '') case "$sharpbang" in @@ -8513,13 +8701,13 @@ case "$startperl" in I can use the #! construct to start perl on your system. This will make startup of perl scripts faster, but may cause problems if you want to share those scripts and perl is not in a standard place -($binexp/perl) on all your platforms. The alternative is to force -a shell by starting the script with a single ':' character. +($initialinstalllocation/perl) on all your platforms. The alternative +is to force a shell by starting the script with a single ':' character. EOH case "$versiononly" in - "$define") dflt="$binexp/perl$version";; - *) dflt="$binexp/perl";; + "$define") dflt="$initialinstalllocation/perl$version";; + *) dflt="$initialinstalllocation/perl";; esac rp='What shall I put after the #! to start up perl ("none" to not use #!)?' . ./myread @@ -8548,8 +8736,8 @@ echo "I'll use $startperl to start perl scripts." case "$perlpath" in '') case "$versiononly" in - "$define") perlpath="$binexp/perl$version";; - *) perlpath="$binexp/perl";; + "$define") perlpath="$initialinstalllocation/perl$version";; + *) perlpath="$initialinstalllocation/perl";; esac case "$startperl" in *!*) ;; @@ -8559,10 +8747,10 @@ case "$perlpath" in I will use the "eval 'exec'" idiom to start Perl on your system. I can use the full path of your Perl binary for this purpose, but doing so may cause problems if you want to share those scripts and -Perl is not always in a standard place ($binexp/perl). +Perl is not always in a standard place ($initialinstalllocation/perl). EOH - dflt="$binexp/perl" + dflt="$initialinstalllocation/perl" rp="What path shall I use in \"eval 'exec'\"?" . ./myread perlpath="$ans" @@ -8594,12 +8782,12 @@ case "$scriptdir" in ;; esac $cat <try.c <&4 + $echo $n "Rechecking the size of $zzz...$c" >&4 $cat > try.c < #include @@ -9002,16 +9151,11 @@ EOCP . ./myread fpossize="$ans" fi - $rm -f try.c try + $rm_try fi ;; esac -# probably will refer to -# $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib -need_relocation=0 -userelocatableinc=undef - case "$vendorprefix" in '') d_vendorbin="$undef" vendorbin='' @@ -9030,12 +9174,8 @@ case "$vendorprefix" in vendorbinexp="$ansexp" ;; esac -: Change installation prefix, if necessary. -if $test X"$prefix" != X"$installprefix"; then - installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"` -else - installvendorbin="$vendorbinexp" -fi +prefixvar=vendorbin +. ./installprefix case "$vendorprefix" in '') vendorhtml1dir='' @@ -9061,12 +9201,8 @@ case "$vendorprefix" in esac : Use ' ' for none so value is preserved next time through Configure $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' ' -: Change installation prefix, if necessary. -if $test X"$prefix" != X"$installprefix"; then - installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"` -else - installvendorhtml1dir="$vendorhtml1direxp" -fi +prefixvar=vendorhtml1dir +. ./installprefix case "$vendorprefix" in '') vendorhtml3dir='' @@ -9092,12 +9228,8 @@ case "$vendorprefix" in esac : Use ' ' for none so value is preserved next time through Configure $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' ' -: Change installation prefix, if necessary. -if $test X"$prefix" != X"$installprefix"; then - installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"` -else - installvendorhtml3dir="$vendorhtml3direxp" -fi +prefixvar=vendorhtml3dir +. ./installprefix case "$vendorprefix" in '') vendorman1dir='' @@ -9120,12 +9252,8 @@ case "$vendorprefix" in esac : Use ' ' for none so value is preserved next time through Configure $test X"$vendorman1dir" = "X" && vendorman1dir=' ' -: Change installation prefix, if necessary. -if $test X"$prefix" != X"$installprefix"; then - installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"` -else - installvendorman1dir="$vendorman1direxp" -fi +prefixvar=vendorman1dir +. ./installprefix case "$vendorprefix" in '') vendorman3dir='' @@ -9148,12 +9276,8 @@ case "$vendorprefix" in esac : Use ' ' for none so value is preserved next time through Configure $test X"$vendorman3dir" = "X" && vendorman3dir=' ' -: Change installation prefix, if necessary. -if $test X"$prefix" != X"$installprefix"; then - installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"` -else - installvendorman3dir="$vendorman3direxp" -fi +prefixvar=vendorman3dir +. ./installprefix case "$vendorprefix" in '') d_vendorscript="$undef" @@ -9169,7 +9293,7 @@ case "$vendorprefix" in esac $cat <&4 ;; - esac + esac done : then add any others for xxx_convert in gconvert gcvt sprintf; do case "$xxx_list" in *$xxx_convert*) ;; *) xxx_list="$xxx_list $xxx_convert" ;; - esac + esac done case "$d_longdbl$uselongdouble" in @@ -9503,7 +9623,7 @@ esac for xxx_convert in $xxx_list; do echo "Trying $xxx_convert..." - $rm -f try try$_o + $rm -f try try$_o core set try -DTRY_$xxx_convert if eval $compile; then echo "$xxx_convert() found." >&4 @@ -9536,10 +9656,11 @@ qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;; d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;; *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;; esac - ;; + ;; esac fi +$rm_try : see if _fwalk exists set fwalk d__fwalk @@ -9621,7 +9742,7 @@ optimize="$optimize" ccflags="$ccflags" prototype="$prototype" define="$define" -rm=$rm +rm_try="$rm_try" usethreads=$usethreads i_pthread=$i_pthread pthread_h_first=$pthread_h_first @@ -9629,7 +9750,7 @@ EOSH $cat >> protochk <<'EOSH' -$rm -f try.c +$rm_try foo="$1" shift while test $# -ge 2; do @@ -9659,7 +9780,7 @@ echo "$foo" >> try.c echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c $cc $optimize $ccflags -c try.c > /dev/null 2>&1 status=$? -$rm -f try.[co] +$rm_try exit $status EOSH chmod +x protochk @@ -9682,7 +9803,7 @@ else fi; set $varname; eval $setvar; -$rm -f try.c tryout.c' +$rm_try tryout.c' : see if sys/types.h has to be included set sys/types.h i_systypes @@ -9708,7 +9829,7 @@ else fi; set $varname; eval $setvar; -$rm -f try.c try.o' +$rm_try' : see if we should include time.h, sys/time.h, or both echo " " @@ -9795,11 +9916,11 @@ EOCP echo "We'll include ." >&4;; *) i_systime="$undef";; esac - $rm -f try.c try + $rm_try fi : see if struct tm knows about tm_zone case "$i_systime$i_time" in -*$define*) +*$define*) echo " " echo "Checking to see if your struct tm has tm_zone field..." >&4 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h @@ -9816,7 +9937,7 @@ case "$d_tm_tm_zone" in esac : see if struct tm knows about tm_gmtoff case "$i_systime$i_time" in -*$define*) +*$define*) echo " " echo "Checking to see if your struct tm has tm_gmtoff field..." >&4 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h @@ -9915,9 +10036,53 @@ else val="$undef" fi ;; -*) val="$d_attribute_format" ;; +*) val="$d_attribute_format" ;; +esac +set d_attribute_format +eval $setvar +$rm -f attrib* + +: Look for GCC-style attribute format with null format allowed +case "$d_printf_format_null" in +'') case "$d_attribute_format" in + $define) + echo " " + echo "Checking whether your compiler allows __printf__ format to be null ..." >&4 +$cat >attrib.c < +#$i_stdlib I_STDLIB +#ifdef I_STDLIB +#include +#endif +int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2))); +int null_printf (char* pat,...) { return (int)pat; } +int main () { exit(null_printf(NULL)); } +EOCP + if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then + : run the executable in case it produces a run-time warning + if $run ./attrib >>attrib.out 2>&1; then + if $contains 'warning' attrib.out >/dev/null 2>&1; then + echo "Your C compiler doesn't allow __printf__ format to be null." + val="$undef" + else + echo "Your C compiler allows __printf__ format to be null." + val="$define" + fi + else + echo "Your C compiler executable failed with __printf__ format null." + val="$undef" + fi + else + echo "Your C compiler fails with __printf__ format null." + val="$undef" + fi + ;; + *) val="$undef" ;; + esac +;; +*) val="$d_printf_format_null" ;; esac -set d_attribute_format +set d_printf_format_null eval $setvar $rm -f attrib* @@ -10097,10 +10262,6 @@ eval $inlibc set bcopy d_bcopy eval $inlibc -: see if this is a unistd.h system -set unistd.h i_unistd -eval $inhdr - : see if getpgrp exists set getpgrp d_getpgrp eval $inlibc @@ -10165,7 +10326,7 @@ EOP esac set d_bsdgetpgrp eval $setvar -$rm -f try try.* +$rm_try : see if setpgrp exists set setpgrp d_setpgrp @@ -10231,11 +10392,217 @@ EOP esac set d_bsdsetpgrp eval $setvar -$rm -f try try.* +$rm_try + +: Look for GCC-style __builtin_choose_expr +case "$d_builtin_choose_expr" in +'') + echo " " + echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4 + $cat >try.c <<'EOCP' +#include +#include +#include + +#define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) ) + +int main(void) { + assert( SYRINX(1) == 2112 ); + assert( SYRINX(1) != 5150 ); + assert( SYRINX(0) == 5150 ); + assert( SYRINX(0) != 2112 ); + puts( "All good!" ); + exit(0); +} + +EOCP + set try + if eval $compile; then + echo "Your C compiler supports __builtin_choose_expr." + val="$define" + else + echo "Your C compiler doesn't seem to understand __builtin_choose_expr." + val="$undef" + fi +;; +*) val="$d_builtin_choose_expr" ;; +esac + +set d_builtin_choose_expr +eval $setvar +$rm_try + +: Look for GCC-style __builtin_expect +case "$d_builtin_expect" in +'') + echo " " + echo "Checking whether your compiler can handle __builtin_expect ..." >&4 + $cat >builtin.c <<'EOCP' +int main(void) { + int n = 50; + if ( __builtin_expect(n, 0) ) n = 1; +} +EOCP + set try + if eval $compile; then + echo "Your C compiler supports __builtin_choose_expr." + val="$define" + else + echo "Your C compiler doesn't seem to understand __builtin_choose_expr." + val="$undef" + fi + ;; +*) val="$d_builtin_expect" ;; +esac + +set d_builtin_expect +eval $setvar +$rm_try + : see if bzero exists set bzero d_bzero eval $inlibc +: 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); + return 0; +} +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 the Compiler supports C99 variadic macros +case "$i_stdarg$i_stdlib" in + "$define$define") + echo "You have and , so checking for C99 variadic macros." >&4 + $cat >try.c < +#include + +#define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__) + +int main() { + char buf[20]; + foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail"); + puts(buf); + return 0; +} +EOCP + set try + if eval $compile && $run ./try 2>&1 >/dev/null; then + case "`$run ./try`" in + "123 456 789") + echo "You have C99 variadic macros." >&4 + d_c99_variadic_macros="$define" + ;; + *) + echo "You don't have functional C99 variadic macros." >&4 + d_c99_variadic_macros="$undef" + ;; + esac + else + echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4 + d_c99_variadic_macros="$undef" + fi + $rm_try + ;; + *) + echo "You don't have and , so not checking for C99 variadic macros." >&4 + d_c99_variadic_macros="$undef" + ;; +esac + : see if signal is declared as pointer to function returning int or void echo " " xxx=`./findhdr signal.h` @@ -10296,7 +10663,7 @@ $cat >try.c < #include -$signal_t blech(s) int s; { exit(3); } +$signal_t blech(int s) { exit(3); } int main() { $xxx i32; @@ -10305,7 +10672,7 @@ int main() char str[16]; signal(SIGFPE, blech); - /* Don't let compiler optimize the test away. Store the number + /* Don't let compiler optimize the test away. Store the number in a writable string for gcc to pass to sscanf under HP/UX. */ sprintf(str, "2147483647"); @@ -10341,7 +10708,7 @@ case "$yyy" in esac set d_casti32 eval $setvar -$rm -f try try.* +$rm_try : check for ability to cast negative floats to unsigned echo " " @@ -10354,11 +10721,11 @@ $cat >try.c < #include -$signal_t blech(s) int s; { exit(7); } -$signal_t blech_in_list(s) int s; { exit(4); } -unsigned long dummy_long(p) unsigned long p; { return p; } -unsigned int dummy_int(p) unsigned int p; { return p; } -unsigned short dummy_short(p) unsigned short p; { return p; } +$signal_t blech(int s) { exit(7); } +$signal_t blech_in_list(int s) { exit(4); } +unsigned long dummy_long(unsigned long p) { return p; } +unsigned int dummy_int(unsigned int p) { return p; } +unsigned short dummy_short(unsigned short p) { return p; } int main() { double f; @@ -10367,12 +10734,12 @@ int main() unsigned short ashort; int result = 0; char str[16]; - + /* Frustrate gcc-2.7.2's optimizer which failed this test with a direct f = -123. assignment. gcc-2.8.0 reportedly optimized the whole file away */ - /* Store the number in a writable string for gcc to pass to + /* Store the number in a writable string for gcc to pass to sscanf under HP/UX. */ sprintf(str, "-123"); @@ -10441,7 +10808,7 @@ case "$castflags" in esac set d_castneg eval $setvar -$rm -f try.* +$rm_try : see if vprintf exists echo " " @@ -10449,38 +10816,75 @@ if set vprintf val -f d_vprintf; eval $csym; $val; then echo 'vprintf() found.' >&4 val="$define" $cat >try.c < +#$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */ +#$i_varargs I_VARARGS + #$i_stdlib I_STDLIB +#$i_unistd I_UNISTD + +#ifdef I_STDARG +# include +#else /* I_VARARGS */ +# include +#endif + +#ifdef I_UNISTD +# include +#endif + #ifdef I_STDLIB -#include +# include #endif -int main() { xxx("foo"); } +#include /* vsprintf prototype */ + +#ifdef I_STDARG +void xxx(int n, ...) +{ + va_list args; + char buf[10]; + va_start(args, n); + exit((unsigned long)vsprintf(buf,"%s",args) > 10L); +} +int main() { xxx(1, "foo"); } + +#else /* I_VARARGS */ xxx(va_alist) va_dcl { - va_list args; - char buf[10]; - - va_start(args); - exit((unsigned long)vsprintf(buf,"%s",args) > 10L); + va_list args; + char buf[10]; + va_start(args); + exit((unsigned long)vsprintf(buf,"%s",args) > 10L); } +int main() { xxx("foo"); } + +#endif + EOF set try - if eval $compile && $run ./try; then - echo "Your vsprintf() returns (int)." >&4 - val2="$undef" + if eval $compile_ok; then + if $run ./try; then + echo "Your vsprintf() returns (int)." >&4 + val2="$undef" + else + echo "Your vsprintf() returns (char*)." >&4 + val2="$define" + fi else - echo "Your vsprintf() returns (char*)." >&4 - val2="$define" + echo 'I am unable to compile the vsprintf() test program.' >&4 + # We shouldn't get here. If we do, assume the standard signature, + # not the old BSD one. + echo 'Guessing that vsprintf() returns (int).' >&4 + val2="$undef" fi else echo 'vprintf() NOT found.' >&4 - val="$undef" - val2="$undef" + val="$undef" + val2="$undef" fi -$rm -f try try.* +$rm_try set d_vprintf eval $setvar val=$val2 @@ -10503,6 +10907,10 @@ eval $inlibc set class d_class eval $inlibc +: see if clearenv exists +set clearenv d_clearenv +eval $inlibc + hasstruct='varname=$1; struct=$2; shift; shift; while $test $# -ge 2; do case "$1" in @@ -10519,7 +10927,7 @@ else fi; set $varname; eval $setvar; -$rm -f try.c try.o' +$rm_try' socketlib='' sockethdr='' @@ -10560,7 +10968,7 @@ else sockethdr="-I/usr/netinclude" ;; esac - echo "Found Berkeley sockets interface in lib$net." >&4 + echo "Found Berkeley sockets interface in lib$net." >&4 if $contains setsockopt libc.list >/dev/null 2>&1; then d_oldsock="$undef" else @@ -10601,7 +11009,7 @@ EOF val="$define" fi set d_${enum}; eval $setvar - $rm -f try.c try + $rm_try done : see if this is a sys/uio.h system @@ -10627,7 +11035,7 @@ typedef struct spug { int drokk; } spug; int main() { const char *foo; - const spug y; + const spug y = { 0 }; } EOCP if $cc -c $ccflags const.c >/dev/null 2>&1 ; then @@ -10744,6 +11152,10 @@ case "$full_csh" in '') full_csh=$csh ;; esac +: see if ctermid exists +set ctermid d_ctermid +eval $inlibc + : see if ctermid_r exists set ctermid_r d_ctermid_r eval $inlibc @@ -10953,7 +11365,7 @@ case "$guess1" in 'struct dirent') guess2='struct direct' ;; *) guess2='struct dirent' ;; esac - + if $contains "$guess1" try.c >/dev/null 2>&1; then direntrytype="$guess1" echo "Your directory entries are $direntrytype." >&4 @@ -10967,8 +11379,7 @@ else . ./myread direntrytype="$ans" fi -$rm -f try.c - +$rm_try : see if the directory entry stores field length echo " " @@ -10982,7 +11393,43 @@ else fi set d_dirnamlen eval $setvar -$rm -f try.c +$rm_try + +: Look for DIR.dd_fd +case "$i_dirent" in +"$define") + echo "Checking to see if DIR has a dd_fd member variable" >&4 + $cat >try.c < +#endif +#include + +int main() { + DIR dir; + dir.dd_fd = 1; + return 0; +} +EOCP + val=$undef + set try + if eval $compile; then + echo "Yes, it does." + val="$define" + else + echo "No, it does not." + val="$undef" + fi + ;; +*) + echo "You don't have a , so not checking for dd_fd." >&4 + val="$undef" + ;; +esac +set d_dir_dd_fd +eval $setvar +$rm_try : see if this is an sysdir system set sys/dir.h i_sysdir @@ -11684,7 +12131,7 @@ else fi set d_open3 eval $setvar -$rm -f try try.* +$rm_try : see which of string.h or strings.h is needed echo " " @@ -11761,6 +12208,14 @@ esac set i_fcntl eval $setvar +: see if fork exists +set fork d_fork +eval $inlibc + +: see if pipe exists +set pipe d_pipe +eval $inlibc + : check for non-blocking I/O stuff case "$h_sysfile" in true) echo "#include " > head.c;; @@ -11815,18 +12270,20 @@ EOCP ;; *) echo "Using $hint value $o_nonblock.";; esac -$rm -f try try.* .out core +$rm_try echo " " echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4 case "$eagain" in '') + case "$d_fork:$d_pipe" in + define:define) $cat head.c > try.c $cat >>try.c < #include #include -#include +#include #$i_stdlib I_STDLIB #ifdef I_STDLIB #include @@ -11849,7 +12306,7 @@ extern int errno; #else #include #endif -$signal_t blech(x) int x; { exit(3); } +$signal_t blech(int x) { exit(3); } EOCP $cat >> try.c <<'EOCP' int main() @@ -11953,6 +12410,12 @@ EOCP echo "I can't compile the test program--assuming errno EAGAIN will do." eagain=EAGAIN fi + ;; + *) echo "Can't figure out how to test this--assuming errno EAGAIN will do." + eagain=EAGAIN + val="$define" + ;; + esac set d_eofnblk eval $setvar ;; @@ -11969,7 +12432,7 @@ EOCP esac ;; esac -$rm -f try try.* .out core head.c mtry +$rm_try head.c mtry : see if _ptr and _cnt from stdio act std echo " " @@ -12068,7 +12531,7 @@ if eval $compile && $to try.c; then else echo "Your stdio doesn't appear very std." fi -$rm -f try.c try +$rm_try # glibc 2.2.90 and above apparently change stdio streams so Perl's # direct buffer manipulation no longer works. The Configure tests @@ -12168,7 +12631,7 @@ int main() { if (cnt == FILE_cnt(fp)) { puts("Pass_unchanged"); exit (0); - } + } if (FILE_cnt(fp) == (cnt - 42)) { puts("Pass_changed"); exit (0); @@ -12195,7 +12658,7 @@ EOP else echo "It seems we can't set ptr in your stdio. Nevermind." >&4 fi - $rm -f try.c try + $rm_try ;; esac @@ -12233,7 +12696,7 @@ EOP else echo "However, it seems to be lacking the _base field." fi - $rm -f try.c try + $rm_try ;; esac set d_stdiobase @@ -12282,7 +12745,7 @@ $cat >try.c < #include #include -$signal_t blech(x) int x; { exit(3); } +$signal_t blech(int x) { exit(3); } int main() { #if defined(F_SETLK) && defined(F_SETLKW) struct flock flock; @@ -12336,8 +12799,7 @@ EOM esac set d_fcntl_can_lock eval $setvar -$rm -f try* - +$rm_try : check for fd_set items $cat <&4 +$cat >try.c < +#include +#include +#include + +int main () +{ + int fd, rv; + fd = open ("try.c", O_RDWR); + if (-1 == fd) exit (1); + rv = futimes (fd, NULL); + exit (rv == -1 ? errno : 0); +} +EOCP +set try +if eval $compile; then + `$run ./try` + rc=$? + case "$rc" in + 0) echo "Yes, you have" >&4 + d_futimes="$define" + ;; + *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4 + ;; + esac +else + echo "No, it does not (probably harmless)" >&4 +fi +$rm_try + : see if getcwd exists set getcwd d_getcwd eval $inlibc @@ -14172,9 +14665,9 @@ EOCP echo "Yes, it does ($foo)" >&4 d_libm_lib_version="$define" else - echo "No, it does not (probably harmless)\n" >&4 + echo "No, it does not (probably harmless)" >&4 fi - $rm -f try.* try core core.try.* + $rm_try ;; esac @@ -14228,6 +14721,59 @@ case "$d_localtime_r" in ;; esac +: see if localtime_r calls tzset +case "$localtime_r_proto" in +REENTRANT_PROTO*) + $cat >try.c < +#include +#include +#include +#include +int main() +{ + time_t t = time(0L); + char w_tz[]="TZ" "=GMT+5", + e_tz[]="TZ" "=GMT-5", + *tz_e = (char*)malloc(16), + *tz_w = (char*)malloc(16); + struct tm tm_e, tm_w; + memset(&tm_e,'\0',sizeof(struct tm)); + memset(&tm_w,'\0',sizeof(struct tm)); + strcpy(tz_e,e_tz); + strcpy(tz_w,w_tz); + + putenv(tz_e); + localtime_r(&t, &tm_e); + + putenv(tz_w); + localtime_r(&t, &tm_w); + + if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 ) + return 1; + return 0; +} +EOCP + set try + if eval $compile; then + if $run ./try; then + d_localtime_r_needs_tzset=undef; + else + d_localtime_r_needs_tzset=define; + fi; + else + d_localtime_r_needs_tzset=undef; + fi; + ;; + *) + d_localtime_r_needs_tzset=undef; + ;; +esac +$rm_try + : see if localeconv exists set localeconv d_locconv eval $inlibc @@ -14365,12 +14911,12 @@ $define$define) Checking to see whether your modfl() is okay for large values... EOM $cat >try.c < +#include #include EOCP if $test "X$d_modflproto" != "X$define"; then $cat >>try.c <>try.c <try.c #include #ifdef SIGFPE $volatile int bletched = 0; -$signal_t blech(s) int s; { bletched = 1; } +$signal_t blech(int s) { bletched = 1; } #endif int main() { $uvtype u = 0; @@ -14822,10 +15368,9 @@ int main() { if (($uvtype)d != (u - 1)) break; #ifdef SIGFPE - if (bletched) { + if (bletched) break; #endif - } } printf("%d\n", ((i == n) ? -n : i)); exit(0); @@ -14838,7 +15383,7 @@ if eval $compile; then nv_preserves_uv_bits="`$run ./try`" fi case "$nv_preserves_uv_bits" in -\-[1-9]*) +\-[1-9]*) nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits` $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1 d_nv_preserves_uv="$define" @@ -14846,10 +15391,9 @@ case "$nv_preserves_uv_bits" in [1-9]*) $echo "Your NVs can preserve only $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 - nv_preserves_uv_bits="$undef" ;; + nv_preserves_uv_bits="0" ;; esac - -$rm -f try.* try +$rm_try $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4 : volatile so that the compiler has to store it out to memory. @@ -14872,7 +15416,7 @@ $cat <try.c #include #ifdef SIGFPE $volatile int bletched = 0; -$signal_t blech(s) int s; { bletched = 1; } +$signal_t blech(int s) { bletched = 1; } #endif int checkit($nvtype d, char *where) { @@ -14928,7 +15472,7 @@ int main(int argc, char **argv) { printf("(gives %g)\n", d); return 1; } - + #ifdef SIGFPE if (bletched) { printf("No - something bleched\n"); @@ -14970,9 +15514,7 @@ EOM ;; esac fi - -$rm -f try.* try - +$rm_try : check for off64_t echo " " @@ -14993,14 +15535,14 @@ else 8) echo "(Your off_t is 64 bits, so you could use that.)" ;; esac fi -$rm -f try.* try +$rm_try set d_off64_t eval $setvar : how to create joinable pthreads if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then echo " " - echo "Checking what constant to use for creating joinable pthreads..." >&4 + echo "Checking what constant to use for creating joinable pthreads..." >&4 $cat >try.c <<'EOCP' #include int main() { @@ -15026,7 +15568,7 @@ EOCP val=PTHREAD_CREATE_UNDETACHED set old_pthread_create_joinable eval $setvar - else + else set try -DJOINABLE=__UNDETACHED if eval $compile; then echo "You seem to use __UNDETACHED." >&4 @@ -15047,7 +15589,7 @@ EOCP fi fi fi - $rm -f try try.* + $rm_try else d_old_pthread_create_joinable="$undef" old_pthread_create_joinable="" @@ -15057,10 +15599,6 @@ fi set pause d_pause eval $inlibc -: see if pipe exists -set pipe d_pipe -eval $inlibc - : see if poll exists set poll d_poll eval $inlibc @@ -15096,6 +15634,54 @@ $rm -f reflect set d_procselfexe eval $setvar +: backward compatibility for d_hvfork +if test X$d_hvfork != X; then + d_vfork="$d_hvfork" + d_hvfork='' +fi +: see if there is a vfork +val='' +set vfork val +eval $inlibc + +d_pseudofork=$undef + +: Ok, but do we want to use it. vfork is reportedly unreliable in +: perl on Solaris 2.x, and probably elsewhere. +case "$val" in +$define) + echo " " + case "$usevfork" in + false) dflt='n';; + *) dflt='y';; + esac + cat <<'EOM' + +Perl can only use a vfork() that doesn't suffer from strict +restrictions on calling functions or modifying global data in +the child. For example, glibc-2.1 contains such a vfork() +that is unsuitable. If your system provides a proper fork() +call, chances are that you do NOT want perl to use vfork(). + +EOM + rp="Do you still want to use vfork()?" + . ./myread + case "$ans" in + y|Y) ;; + *) + echo "Ok, we won't use vfork()." + val="$undef" + ;; + esac + ;; +esac +set d_vfork +eval $setvar +case "$d_vfork" in +$define) usevfork='true';; +*) usevfork='false';; +esac + : see whether the pthread_atfork exists $cat >try.c < @@ -15193,12 +15779,10 @@ $define) esac set d_pthread_yield eval $setvar - case "$sched_yield" in '') sched_yield=undef ;; esac - -$rm -f try try.* +$rm_try : see if random_r exists set random_r d_random_r @@ -15448,7 +16032,7 @@ exit(0); EOCP set try if eval $compile_ok; then - if ./try 2>/dev/null; then + if $run ./try 2>/dev/null; then echo "Yes, it can." val="$define" else @@ -15459,7 +16043,7 @@ EOCP fi ;; esac - $rm -f try.* try core + $rm_try ;; esac set d_safebcpy @@ -15524,7 +16108,7 @@ exit(0); EOCP set try if eval $compile_ok; then - if ./try 2>/dev/null; then + if $run ./try 2>/dev/null; then echo "Yes, it can." val="$define" else @@ -15535,7 +16119,7 @@ EOCP fi ;; esac - $rm -f try.* try core + $rm_try ;; esac set d_safemcpy @@ -15591,7 +16175,7 @@ EOCP fi ;; esac -$rm -f try.* try core +$rm_try set d_sanemcmp eval $setvar @@ -15666,7 +16250,7 @@ else echo "You do not have union semun in ." >&4 val="$undef" fi -$rm -f try try.c +$rm_try set d_union_semun eval $setvar @@ -15674,7 +16258,7 @@ eval $setvar case "$d_sem" in $define) echo " " - $cat > try.h < tryh.h < try.c < #include @@ -15709,7 +16293,7 @@ END #include #include #include -#include "try.h" +#include "tryh.h" #ifndef errno extern int errno; #endif @@ -15740,7 +16324,7 @@ int main() { printf("semctl IPC_STAT failed: errno = %d\n", errno); # ifdef IPC_RMID if (semctl(sem, 0, IPC_RMID, arg) != 0) -# endif /* IPC_RMID */ +# endif /* IPC_RMID */ printf("semctl IPC_RMID failed: errno = %d\n", errno); } else #endif /* IPC_PRIVATE && ... */ @@ -15755,11 +16339,11 @@ END semun) val="$define" ;; esac fi - $rm -f try try.c + $rm_try + set d_semctl_semun + eval $setvar ;; esac - set d_semctl_semun - eval $setvar case "$d_semctl_semun" in $define) echo "You can use union semun for semctl IPC_STAT." >&4 @@ -15771,15 +16355,15 @@ END esac : see whether semctl IPC_STAT can use struct semid_ds pointer - val="$undef" case "$d_semctl_semid_ds" in '') + val="$undef" $cat > try.c <<'END' #include #include #include #include -#include "try.h" +#include "tryh.h" #include #include #ifndef errno @@ -15817,11 +16401,11 @@ END semid_ds) val="$define" ;; esac fi - $rm -f try try.c + $rm_try + set d_semctl_semid_ds + eval $setvar ;; esac - set d_semctl_semid_ds - eval $setvar case "$d_semctl_semid_ds" in $define) echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4 @@ -15829,7 +16413,6 @@ END *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4 ;; esac - $rm -f try.h ;; *) val="$undef" @@ -15843,6 +16426,7 @@ END eval $setvar ;; esac +$rm_try tryh.h : see if sendmsg exists set sendmsg d_sendmsg @@ -16438,7 +17022,52 @@ else val="$undef" fi set d_sigaction; eval $setvar -$rm -f try try$_o try.c +$rm_try + +: see if this is a sunmath.h system +set sunmath.h i_sunmath +eval $inhdr + +: see if signbit exists +$echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4 +$cat >try.c < +#endif +#ifdef I_SUNMATH /* Solaris special math library */ +# include +#endif +#define NV $nvtype +int main(int argc, char **argv) +{ + NV x = 0.0; + NV y = -0.0; + if ((signbit(x) == 0) && (signbit(y) != 0)) + return 0; + else + return 1; +} +EOCP +val="$undef" +set try +if eval $compile; then + if $run ./try; then + $echo "Yes." >&4 + val="$define" + else + $echo "Signbit seems to be available, but doesn't work as I expected." + $echo "I won't use it." >&4 + val="$undef" + fi +else + $echo "Nope." >&4 + dflt="$undef" +fi +set d_signbit +eval $setvar +$rm_try : see if sigprocmask exists set sigprocmask d_sigprocmask @@ -16491,7 +17120,72 @@ EOM esac set d_sigsetjmp eval $setvar -$rm -f try.c try +$rm_try + +: see if snprintf exists +set snprintf d_snprintf +eval $inlibc + +: see if vsnprintf exists +set vsnprintf d_vsnprintf +eval $inlibc + +case "$d_snprintf-$d_vsnprintf" in +"$define-$define") + $cat <try.c <<'EOCP' +/* v?snprintf testing logic courtesy of Russ Allbery. + * According to C99: + * - if the buffer is too short it still must be \0-terminated + * - if the buffer is too short the potentially required length + * must be returned and not -1 + * - if the buffer is NULL the potentially required length + * must be returned and not -1 or core dump + */ +#include +#include + +char buf[2]; + +int test (char *format, ...) +{ + va_list args; + int count; + + va_start (args, format); + count = vsnprintf (buf, sizeof buf, format, args); + va_end (args); + return count; +} + +int main () +{ + return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0' + && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1); +} +EOCP + set try + if eval $compile; then + `$run ./try` + case "$?" in + 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;; + *) cat <&4 +Your snprintf() and snprintf() don't seem to be working okay. +EOM + d_snprintf="$undef" + d_vsnprintf="$undef" + ;; + esac + else + echo "(I can't seem to compile the test program--assuming they don't)" + d_snprintf="$undef" + d_vsnprintf="$undef" + fi + $rm_try + ;; +esac : see if sockatmark exists set sockatmark d_sockatmark @@ -16506,6 +17200,67 @@ eval $hasproto set socks5_init d_socks5_init eval $inlibc +: see if sprintf returns the length of the string in the buffer as per ANSI +$echo "Checking whether sprintf returns the length of the string..." >&4 +$cat <try.c +#include +#$i_stdlib I_STDLIB +#ifdef I_STDLIB +#include +#endif +#$i_string I_STRING +#ifdef I_STRING +# include +#else +# include +#endif +#$i_math I_MATH +#ifdef I_MATH +#include +#endif + +char buffer[256]; + +int check (size_t expect, int test) { + size_t got = strlen(buffer); + if (expect == got) + return 0; + + printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got, + test, buffer); + exit (test); +} + +int main(int argc, char **argv) { + int test = 0; + + check(sprintf(buffer, ""), ++test); + check(sprintf(buffer, "%s %s", "perl", "rules"), ++test); + check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test); + + return 0; +} +EOP +set try + +d_sprintf_returns_strlen="$undef" +if eval $compile; then + xxx="`$run ./try`" + case "$?" in + 0) cat >&4 <&4 <&4 < /dev/null; then + if eval $compile && $run ./try > /dev/null; then dflt=`$run ./try` case "$dflt" in [1-4][1-4][1-4][1-4]|12345678|87654321) @@ -17340,11 +18104,10 @@ EOM esac ;; esac - $rm -f try.c try + $rm_try ;; esac - $cat < #ifdef SIGBUS -$signal_t bletch(s) int s; { exit(4); } +$signal_t bletch(int s) { exit(4); } #endif int main() { #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321 @@ -17444,7 +18207,7 @@ else *) d_u32align="$define" ;; esac fi -$rm -f core core.try.* try.core +$rm_try ;; esac @@ -17460,64 +18223,22 @@ eval $inlibc set unordered d_unordered eval $inlibc -: see if usleep exists -set usleep d_usleep -eval $inlibc - -: see if prototype for usleep is available -echo " " -set d_usleepproto usleep $i_unistd unistd.h -eval $hasproto - -: see if ustat exists -set ustat d_ustat +: see if unsetenv exists +set unsetenv d_unsetenv eval $inlibc -: backward compatibility for d_hvfork -if test X$d_hvfork != X; then - d_vfork="$d_hvfork" - d_hvfork='' -fi -: see if there is a vfork -val='' -set vfork val +: see if usleep exists +set usleep d_usleep eval $inlibc -: Ok, but do we want to use it. vfork is reportedly unreliable in -: perl on Solaris 2.x, and probably elsewhere. -case "$val" in -$define) - echo " " - case "$usevfork" in - false) dflt='n';; - *) dflt='y';; - esac - cat <<'EOM' - -Perl can only use a vfork() that doesn't suffer from strict -restrictions on calling functions or modifying global data in -the child. For example, glibc-2.1 contains such a vfork() -that is unsuitable. If your system provides a proper fork() -call, chances are that you do NOT want perl to use vfork(). - -EOM - rp="Do you still want to use vfork()?" - . ./myread - case "$ans" in - y|Y) ;; - *) - echo "Ok, we won't use vfork()." - val="$undef" - ;; - esac - ;; -esac -set d_vfork -eval $setvar -case "$d_vfork" in -$define) usevfork='true';; -*) usevfork='false';; -esac +: see if prototype for usleep is available +echo " " +set d_usleepproto usleep $i_unistd unistd.h +eval $hasproto + +: see if ustat exists +set ustat d_ustat +eval $inlibc : see if closedir exists set closedir d_closedir @@ -17553,7 +18274,7 @@ case "$d_closedir" in #endif #endif #endif -#endif +#endif int main() { return closedir(opendir(".")); } EOM set try @@ -17576,7 +18297,8 @@ EOM esac set d_void_closedir eval $setvar -$rm -f try try.* +$rm_try + : see if there is a wait4 set wait4 d_wait4 eval $inlibc @@ -17655,7 +18377,7 @@ EOCP rp="Doubles must be aligned on a how-many-byte boundary?" . ./myread alignbytes="$ans" - $rm -f try.c try + $rm_try ;; esac @@ -17734,7 +18456,7 @@ int main(int argc, char *argv[]) /* check that db.h & libdb are compatible */ if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) { printf("db.h and libdb are incompatible.\n") ; - exit(3); + exit(3); } printf("db.h and libdb are compatible.\n") ; @@ -17746,7 +18468,7 @@ int main(int argc, char *argv[]) if (Version < 2003004) { /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */ printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ; - exit(2); + exit(2); } exit(0); @@ -17785,13 +18507,13 @@ EOCP ;; esac fi - $rm -f try.* + $rm_try ;; esac case "$i_db" in define) - : Check the return type needed for hash + : Check the return type needed for hash echo " " echo "Checking return type needed for hash for Berkeley DB ..." >&4 $cat >try.c <&4 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4 fi - $rm -f try.* + $rm_try echo "Your version of Berkeley DB uses $db_hashtype for hash." ;; *) db_hashtype=u_int32_t @@ -17836,7 +18558,7 @@ EOCP esac case "$i_db" in define) - : Check the return type needed for prefix + : Check the return type needed for prefix echo " " echo "Checking return type needed for prefix for Berkeley DB ..." >&4 cat >try.c <&4 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4 fi - $rm -f try.* + $rm_try echo "Your version of Berkeley DB uses $db_prefixtype for prefix." ;; *) db_prefixtype='size_t' ;; esac - : How can we generate normalized random numbers ? echo " " echo "Looking for a random number function..." >&4 @@ -17986,7 +18707,7 @@ EOCP rp="How many bits does your $randfunc() function produce?" . ./myread randbits="$ans" - $rm -f try.c try + $rm_try drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))" seedfunc="s$randfunc" randseedtype=unsigned @@ -18034,7 +18755,7 @@ else echo "I'm unable to compile the test program." >&4 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4 fi -$rm -f try try.* +$rm_try set ebcdic eval $setvar @@ -18097,7 +18818,7 @@ int main() { # endif # endif # endif -# endif +# endif # ifdef HAS_STDIO_STREAM_ARRAY if (open_max > 0) { long i; @@ -18106,7 +18827,7 @@ int main() { STDIO_STREAM_ARRAY[i]._file < open_max && STDIO_STREAM_ARRAY[i]._flag) fflush(&STDIO_STREAM_ARRAY[i]); - } + } } # endif #endif @@ -18157,7 +18878,7 @@ EOM fi fi fi - $rm -f core try.core core.try.* + $rm_try case "$fflushNULL" in x) $cat >&4 <&4 <&4 fi - -$rm -f try try.* +$rm_try fi case "$sPRId64" in -'') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef"; - d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef"; +'') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef"; + d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef"; ;; -*) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define"; - d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define"; +*) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define"; + d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define"; ;; esac @@ -18715,6 +19435,39 @@ EOM *) groupstype="$gidtype";; esac + +if $test $patchlevel -lt 9; then +: MAD is not available in 5.8.x or earlier. + ans=n; +else + case "$mad" in + $define|true|[yY]*) dflt='y' ;; + *) dflt='n' ;; + esac + cat <&4 case "$make_set_make" in @@ -18740,104 +19493,6 @@ 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 @@ -18856,28 +19511,28 @@ ivfprintf(FILE *f, const char *fmt, va_list *valp) { return vfprintf(f, fmt, *valp); } - -int + +int myvfprintf(FILE *f, const char *fmt, va_list val) { return ivfprintf(f, fmt, &val); } - + int -myprintf(char *fmt, ...) +myprintf(char *fmt, ...) { va_list val; va_start(val, fmt); - return myvfprintf(stdout, fmt, val); -} + return myvfprintf(stdout, fmt, val); +} int main(int ac, char **av) { signal(SIGSEGV, exit); - myprintf("%s%cs all right, then\n", "that", '\''); - exit(0); + myprintf("%s%cs all right, then\n", "that", '\''); + exit(0); } EOCP set try @@ -18896,7 +19551,7 @@ EOCP need_va_copy="$define" ;; esac - $rm -f try.* core core.* *.core *.core.* + $rm_try ;; *) echo "You don't have , not checking for va_copy()." >&4 ;; @@ -19092,7 +19747,15 @@ if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 && $run ./foobar >/dev/null 2>&1; then echo "$ar appears to generate random libraries itself." orderlib=false - ranlib=":" + if [ "X$ranlib" = "X" ]; then + ranlib=":" + fi +elif $ar s bar$_a >/dev/null 2>&1 && + $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 && + $run ./foobar >/dev/null 2>&1; then + echo "a table of contents needs to be added with '$ar s'." + orderlib=false + ranlib="$ar s" elif $ar ts bar$_a >/dev/null 2>&1 && $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 && $run ./foobar >/dev/null 2>&1; then @@ -19117,7 +19780,7 @@ else ranlib=":" fi fi -$rm -f foo* bar* +$rm -f foo* bar* : check for type of arguments to select. case "$selecttype" in @@ -19214,7 +19877,7 @@ $selecttype b; #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8) #define NBITS (NBYTES * 8) int main() { - char *s = malloc(NBYTES); + char *s = (char *)malloc(NBYTES); struct timeval t; int i; FILE* fp; @@ -19267,7 +19930,7 @@ EOM val=$ans selectminbits="$val" fi - $rm -f try.* try + $rm_try ;; *) : no select, so pick a harmless default selectminbits=$safebits @@ -19605,7 +20268,7 @@ else size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;; esac fi -$rm -f try try.* +$rm_try set d_socklen_t eval $setvar @@ -19677,7 +20340,7 @@ int main() printf("$dflt\n"); else if (sizeof(Size_t) == sizeof(int)) printf("int\n"); - else + else printf("long\n"); exit(0); } @@ -19701,11 +20364,12 @@ EOM . ./myread ssizetype="$ans" fi -$rm -f try try.* +$rm_try : see what type of char stdio uses. echo " " -echo '#include ' | $cppstdin $cppminus > stdioh +echo '#include ' > stdio.c +$cppstdin $cppminus < stdio.c > stdioh if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then echo "Your stdio uses unsigned chars." >&4 stdchar="unsigned char" @@ -19713,9 +20377,7 @@ else echo "Your stdio uses signed chars." >&4 stdchar="char" fi -$rm -f stdioh - - +$rm -f stdio.* stdioh : see what type uids are declared as in the kernel echo " " @@ -19900,6 +20562,26 @@ eval $inhdr set fp_class.h i_fp_class eval $inhdr +: see if gdbm.h is available +set gdbm.h t_gdbm +eval $inhdr +case "$t_gdbm" in +$define) + : see if gdbm_open exists + set gdbm_open d_gdbm_open + eval $inlibc + case "$d_gdbm_open" in + $undef) + t_gdbm="$undef" + echo "We won't be including " + ;; + esac + ;; +esac +val="$t_gdbm" +set i_gdbm +eval $setvar + : see if this is a ieeefp.h system case "$i_ieeefp" in '' ) set ieeefp.h i_ieeefp @@ -19982,7 +20664,7 @@ EOM echo "We won't be including ." >&4 val="$undef" fi - $rm -f try.* try + $rm_try ;; esac set i_neterrno @@ -20001,7 +20683,7 @@ set prot.h i_prot eval $inhdr echo " " -$echo "Guessing which symbols your C compiler and preprocessor define..." >&4 +$echo "Guessing which symbols your C compiler and preprocessor define..." >&4 $cat <<'EOSH' > Cppsym.know a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE @@ -20098,16 +20780,26 @@ cat < Cppsym.try $startsh cat <<'EOCP' > try.c #include +#if cpp_stuff == 1 +#define STRINGIFY(a) "a" +#endif +#if cpp_stuff == 42 +#define StGiFy(a) #a +#define STRINGIFY(a) StGiFy(a) +#endif +#if $cpp_stuff != 1 && $cpp_stuff != 42 +# include "Bletch: How does this C preprocessor stringify macros?" +#endif int main() { EOCP $awk \\ EOSH cat <<'EOSH' >> Cppsym.try 'length($1) > 0 { - printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", (long)%s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 - printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", (long)_%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 - printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", (long)__%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 - printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", (long)__%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 + printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1 + printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1 + printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1 + printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1 }' >> try.c echo 'return 0;}' >> try.c EOSH @@ -20117,11 +20809,26 @@ case "$osname-$gccversion" in irix-) ccflags="\$ccflags -woff 1178" ;; os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;; esac -$cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try +$cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g' EOSH chmod +x Cppsym.try $eunicefix Cppsym.try ./Cppsym < Cppsym.know > Cppsym.true +: Add in any linux cpp "predefined macros": +case "$osname::$gccversion" in + *linux*::*.*) + tHdrH=_tmpHdr + rm -f $tHdrH'.h' $tHdrH + touch $tHdrH'.h' + 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 + fi + fi + rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real' + ;; +esac : now check the C compiler for additional symbols postprocess_cc_v='' case "$osname" in @@ -20139,7 +20846,7 @@ do -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';; esac done -$rm -f try.c +$rm_try EOS postprocess_cc_v='' chmod +x ccsym @@ -20153,11 +20860,9 @@ fi $awk '/\=/ { print $0; next } { print $0"=1" }' ccsym.raw >ccsym.list -$awk '/\=/ { print $0; next } - { print $0"=1" }' Cppsym.true >ccsym.true -$comm -13 ccsym.true ccsym.list >ccsym.own -$comm -12 ccsym.true ccsym.list >ccsym.com -$comm -23 ccsym.true ccsym.list >ccsym.cpp +$comm -13 Cppsym.true ccsym.list >ccsym.own +$comm -12 Cppsym.true ccsym.list >ccsym.com +$comm -23 Cppsym.true ccsym.list >ccsym.cpp also='' if $test -z ccsym.raw; then echo "Your C compiler doesn't seem to define any symbols!" >&4 @@ -20257,10 +20962,6 @@ val=$val3; set i_termios; eval $setvar set stddef.h i_stddef eval $inhdr -: see if this is a sunmath.h system -set sunmath.h i_sunmath -eval $inhdr - : see if sys/access.h is available set sys/access.h i_sysaccess eval $inhdr @@ -20364,26 +21065,6 @@ case "$d_vfork" in ;; esac -: see if gdbm.h is available -set gdbm.h t_gdbm -eval $inhdr -case "$t_gdbm" in -$define) - : see if gdbm_open exists - set gdbm_open d_gdbm_open - eval $inlibc - case "$d_gdbm_open" in - $undef) - t_gdbm="$undef" - echo "We won't be including " - ;; - esac - ;; -esac -val="$t_gdbm" -set i_gdbm -eval $setvar - echo " " echo "Looking for extensions..." >&4 : If we are using the old config.sh, known_extensions may contain @@ -20399,24 +21080,24 @@ nonxs_extensions='' : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness find_extensions=' for xxx in *; do - case "$xxx" in - DynaLoader|dynaload) ;; - *) - if $test -f $xxx/$xxx.xs; then - known_extensions="$known_extensions $1$xxx"; - elif $test -f $xxx/Makefile.PL; then - nonxs_extensions="$nonxs_extensions $1$xxx"; - else - if $test -d $xxx -a $# -lt 10; then - set $1$xxx/ $*; - cd "$xxx"; - eval $find_extensions; - cd ..; - shift; - fi; - fi - ;; - esac; + 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"; + else + if $test -d $xxx -a $# -lt 10; then + set $1$xxx/ $*; + cd "$xxx"; + eval $find_extensions; + cd ..; + shift; + fi; + fi + ;; + esac; done' tdir=`pwd` cd "$rsrc/ext" @@ -20427,12 +21108,12 @@ eval $find_extensions # recursive find above (and adding in general recursive finding breaks # SDBM_File/sdbm). A.D. 10/25/2001. known_extensions="$known_extensions threads/shared" -set X $nonxs_extensions -shift -nonxs_extensions="$*" set X $known_extensions shift known_extensions="$*" +set X $nonxs_extensions +shift +nonxs_extensions="$*" cd "$tdir" : Now see which are supported on this system. @@ -20445,15 +21126,21 @@ for xxx in $known_extensions ; do esac ;; GDBM_File|gdbm_fil) - case "$i_gdbm" in + case "$i_gdbm" in $define) avail_ext="$avail_ext $xxx" ;; esac ;; I18N/Langinfo|i18n_lan) - case "$i_langinfo$d_nl_langinfo" in + case "$i_langinfo$d_nl_langinfo" in $define$define) avail_ext="$avail_ext $xxx" ;; esac ;; + IPC/SysV|ipc/sysv) + : XXX Do we need a useipcsysv variable here + case "${d_msg}${d_sem}${d_shm}" in + *"${define}"*) avail_ext="$avail_ext $xxx" ;; + esac + ;; NDBM_File|ndbm_fil) case "$i_ndbm" in $define) @@ -20468,32 +21155,36 @@ for xxx in $known_extensions ; do ;; esac ;; - ODBM_File|odbm_fil) + ODBM_File|odbm_fil) case "${i_dbm}${i_rpcsvcdbm}" in *"${define}"*) - case "$osname-$use64bitint" in - hpux-define) - case "$libs" in - *-ldbm*) avail_ext="$avail_ext $xxx" ;; + case "$d_cplusplus" in + define) ;; # delete as a function name will not work + *) case "$osname-$use64bitint" in + hpux-define) + case "$libs" in + *-ldbm*) avail_ext="$avail_ext $xxx" ;; + esac + ;; + *) avail_ext="$avail_ext $xxx" ;; esac ;; - *) avail_ext="$avail_ext $xxx" ;; esac ;; esac ;; - POSIX|posix) - case "$useposix" in + Opcode|opcode) + case "$useopcode" in true|define|y) avail_ext="$avail_ext $xxx" ;; esac ;; - Opcode|opcode) - case "$useopcode" in + POSIX|posix) + case "$useposix" in true|define|y) avail_ext="$avail_ext $xxx" ;; esac ;; Socket|socket) - case "$d_socket" in + case "$d_socket" in true|$define|y) case "$osname" in beos) ;; # not unless BONE @@ -20504,31 +21195,18 @@ for xxx in $known_extensions ; do ;; Sys/Syslog|sys/syslog) : XXX syslog requires socket - case "$d_socket" in + case "$d_socket" in true|$define|y) avail_ext="$avail_ext $xxx" ;; esac ;; Thread|thread) case "$usethreads" in true|$define|y) - case "$useithreads" in - $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;; + case "$use5005threads" in + $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;; esac esac ;; - XS/APItest|xs/apitest) - # This is just for testing. Skip it unless we have dynamic loading. - - case "$usedl" in - $define) avail_ext="$avail_ext $xxx" ;; - esac - ;; - XS/Typemap|xs/typemap) - # This is just for testing. Skip it unless we have dynamic loading. - case "$usedl" in - $define) avail_ext="$avail_ext $xxx" ;; - esac - ;; threads|threads/shared) # threads and threads::shared are special cases. # To stop people from asking "Perl 5.8.0 was supposed @@ -20543,10 +21221,22 @@ for xxx in $known_extensions ; do # --jhi avail_ext="$avail_ext $xxx" ;; - IPC/SysV|ipc/sysv) - : XXX Do we need a useipcsysv variable here - case "${d_msg}${d_sem}${d_shm}" in - *"${define}"*) avail_ext="$avail_ext $xxx" ;; + Win32*) + case "$osname" in + cygwin) avail_ext="$avail_ext $xxx" ;; + esac + ;; + XS/APItest|xs/apitest) + # This is just for testing. Skip it unless we have dynamic loading. + + case "$usedl" in + $define) avail_ext="$avail_ext $xxx" ;; + esac + ;; + XS/Typemap|xs/typemap) + # This is just for testing. Skip it unless we have dynamic loading. + case "$usedl" in + $define) avail_ext="$avail_ext $xxx" ;; esac ;; *) avail_ext="$avail_ext $xxx" @@ -20635,11 +21325,11 @@ EOM previous) if test X"$dynamic_ext" != X"$avail_ext"; then $cat <