X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/ab900c531c1e8d7aefac3b0c5e42704bfb913d3e..dcd60b1214190609cb0713369c8795a0986fab72:/Configure diff --git a/Configure b/Configure index 201dedb..d3da667 100755 --- a/Configure +++ b/Configure @@ -17,10 +17,16 @@ # comp.sources.misc and is available on CPAN under authors/id/RAM so # you may fetch it yourself from your nearest archive site.) # +# +# Though this script was generated by metaconfig, it is OK to send +# patches against it. It's up to the Configure pumpkin to backport +# the patch to the metaunits if it is accepted. +# See Porting/pumpkin.pod for more information on metaconfig. +# # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Wed May 7 23:33:48 EET DST 2003 [metaconfig 3.0 PL70] +# Generated on Tue Jun 6 20:32:43 CEST 2006 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ </dev/null`" in - ij) up='[A-Z]' - low='[a-z]' +*) # There is a discontinuity in EBCDIC between 'R' and 'S' + # (0xd9 and 0xe2), therefore that is a nice testing point. + if test "X$up" = X -o "X$low" = X; then + case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in + rs) up='[A-Z]' + low='[a-z]' ;; esac - fi + fi if test "X$up" = X -o "X$low" = X; then - case "`echo IJ | $tr I-J i-j 2>/dev/null`" in - ij) up='A-Z' + case "`echo RS | $tr R-S r-s 2>/dev/null`" in + rs) up='A-Z' low='a-z' ;; esac - fi + fi if test "X$up" = X -o "X$low" = X; then - case "`echo IJ | od -x 2>/dev/null`" in - *C9D1*|*c9d1*) + case "`echo RS | od -x 2>/dev/null`" in + *D9E2*|*d9e2*) echo "Hey, this might be EBCDIC." >&4 if test "X$up" = X -o "X$low" = X; then - case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in - ij) up='[A-IJ-RS-Z]' - low='[a-ij-rs-z]' + case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in + rs) up='[A-IJ-RS-Z]' + low='[a-ij-rs-z]' ;; esac fi if test "X$up" = X -o "X$low" = X; then - case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in - ij) up='A-IJ-RS-Z' - low='a-ij-rs-z' + case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in + rs) up='A-IJ-RS-Z' + low='a-ij-rs-z' ;; esac fi @@ -2915,8 +2953,8 @@ ABYZ) esac fi esac -case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in -ij) +case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in +rs) echo "Using $up and $low to convert case." >&4 ;; *) @@ -3082,7 +3120,9 @@ EOM aix) osname=aix tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1` case "$tmp" in - 'not found') osvers="$4"."$3" ;; + # oslevel can fail with: + # oslevel: Unable to acquire lock. + *not\ found) osvers="$4"."$3" ;; '<3240'|'<>3240') osvers=3.2.0 ;; '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;; '=3250'|'>3250') osvers=3.2.5 ;; @@ -3104,31 +3144,36 @@ 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 ;; - hp*) osname=hpux + genix) osname=genix ;; + gnu) osname=gnu + osvers="$3" ;; + hp*) osname=hpux osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'` ;; - irix*) osname=irix + irix*) osname=irix case "$3" in 4*) osvers=4 ;; 5*) osvers=5 ;; *) osvers="$3" ;; esac ;; - linux) osname=linux + linux) osname=linux case "$3" in *) osvers="$3" ;; esac ;; - MiNT) osname=mint + MiNT) osname=mint ;; netbsd*) osname=netbsd osvers="$3" @@ -3209,7 +3254,7 @@ EOM *freebsd*) ;; svr*) : svr4.x or possibly later - case "svr$3" in + case "svr$3" in ${osname}*) osname=svr$3 osvers=$4 @@ -3272,7 +3317,7 @@ EOM osvers="$5" fi fi - + case "$targetarch" in '') ;; *) hostarch=$osname @@ -3340,8 +3385,13 @@ EOM $cat <&1` -cf_by=`(logname) 2>/dev/null` case "$cf_by" in "") - cf_by=`(whoami) 2>/dev/null` + cf_by=`(logname) 2>/dev/null` case "$cf_by" in - "") cf_by=unknown ;; + "") + cf_by=`(whoami) 2>/dev/null` + case "$cf_by" in + "") cf_by=unknown ;; + esac ;; esac ;; esac -: set up the script used to warn in case of inconsistency -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 + none) + value='' + ansexp='' + case "$none_ok" in + true) type='';; esac ;; - *) dflt='n';; - esac - ;; -esac -cat <&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 -Perl can be built to take advantage of threads on some systems. -To do so, Configure can be run with -Dusethreads. + case "$skip" in + true) type=''; + esac -Note that Perl built with threading support runs slightly slower -and uses more memory than plain Perl. The current implementation -is believed to be stable, but it is fairly new, and so should be -treated with caution. + 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 +done +cd UU +ans="$value" +rp="$orig_rp" +dflt="$orig_dflt" +rm -f getfile.ok +test "X$gfpthkeep" != Xy && gfpth="" +EOSC -If this doesn't make any sense to you, just accept the default '$dflt'. -EOM -rp='Build a threading Perl?' -. ./myread -case "$ans" in -y|Y) val="$define" ;; -*) val="$undef" ;; +: 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 -set usethreads -eval $setvar - -case "$usethreads" in -$define) - $cat <&4 <&4 <&4 +else + echo "AFS does not seem to be running..." >&4 fi -case "$d_oldpthreads" in -'') : Configure tests would be welcome here. For now, assume undef. +: 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 +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;; +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" + ;; +*) + echo "Ok, doing things the stdio way." + val="$undef" + ;; +esac +set useperlio +eval $setvar + +case "$usesocks" in +$define|true|[yY]*) + case "$useperlio" in + $define|true|[yY]*) ;; + *) cat >&4 <&4 <&4 <&4 $cat >try.c < int main() { -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) #ifdef __VERSION__ printf("%s\n", __VERSION__); #else @@ -3865,355 +4323,73 @@ if $cc -o try $ccflags $ldflags try.c; then 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 + 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 " " @@ -4547,21 +4723,21 @@ case "$uselongdouble" in true|[yY]*) uselongdouble="$define" ;; esac -case "$uselongdouble" in -$define) : Look for a hint-file generated 'call-back-unit'. If the : user has specified that long doubles should be used, : we may need to set or change some other defaults. - if $test -f uselongdouble.cbu; then - echo "Your platform has some specific hints for long doubles, using them..." - . ./uselongdouble.cbu - else +if $test -f uselongdouble.cbu; then + echo "Your platform has some specific hints regarding long doubles, using them..." + . ./uselongdouble.cbu +else + case "$uselongdouble" in + $define) $cat </dev/null 2>&1 then + # Interactive Systems (ISC) POSIX mode. dflt="$dflt -posix" fi ;; @@ -4718,7 +4925,7 @@ default|recommended) if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then echo "Yes, it does." 2>&1 case "$ccflags" in - *strict-aliasing*) + *strict-aliasing*) echo "Leaving current flags $ccflags alone." 2>&1 ;; *) dflt="$dflt -fno-strict-aliasing" ;; @@ -4728,6 +4935,40 @@ default|recommended) fi ;; esac + # For gcc, adding -pipe speeds up compilations for some, but apparently + # some assemblers can't read from stdin. (It also slows down compilations + # in other cases, but those are apparently rarer these days.) AD 5/2004. + case "$gccversion" in + ?*) echo " " + echo "Checking if your compiler accepts -pipe" 2>&1 + echo 'int main(void) { return 0; }' > gcctest.c + if $cc -pipe -o gcctest gcctest.c; then + echo "Yes, it does." 2>&1 + case "$ccflags" in + *-pipe*) + echo "Leaving current flags $ccflags alone." 2>&1 + ;; + *) dflt="$dflt -pipe" ;; + esac + 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 ;; esac @@ -4739,8 +4980,8 @@ for thisincl in $inclwanted; do if $test -d $thisincl; then if $test x$thisincl != x$usrinc; then case "$dflt" in - *" -I$thisincl "*);; - *) dflt="$dflt -I$thisincl ";; + *" -I$thisincl "*);; + *) dflt="$dflt -I$thisincl ";; esac fi fi @@ -4871,7 +5112,7 @@ esac for thislibdir in $libpth; do case " $loclibpth " in *" $thislibdir "*) - case "$dflt " in + case "$dflt " in *"-L$thislibdir "*) ;; *) dflt="$dflt -L$thislibdir" ;; esac @@ -5448,15 +5689,15 @@ EOM ;; esac -case "$use64bitint" in -"$define"|true|[yY]*) : Look for a hint-file generated 'call-back-unit'. If the : user has specified that a 64-bit perl is to be built, : we may need to set or change some other defaults. - if $test -f use64bitint.cbu; then - echo "Your platform has some specific hints for 64-bit integers, using them..." - . ./use64bitint.cbu - fi +if $test -f use64bitint.cbu; then + echo "Your platform has some specific hints regarding 64-bit integers, using them..." + . ./use64bitint.cbu +fi +case "$use64bitint" in +"$define"|true|[yY]*) case "$longsize" in 4) case "$archname64" in '') archname64=64int ;; @@ -5466,15 +5707,15 @@ case "$use64bitint" in ;; esac -case "$use64bitall" in -"$define"|true|[yY]*) : Look for a hint-file generated 'call-back-unit'. If the : user has specified that a maximally 64-bit perl is to be built, : we may need to set or change some other defaults. - if $test -f use64bitall.cbu; then - echo "Your platform has some specific hints for 64-bit builds, using them..." - . ./use64bitall.cbu - fi +if $test -f use64bitall.cbu; then + echo "Your platform has some specific hints regarding 64-bit builds, using them..." + . ./use64bitall.cbu +fi +case "$use64bitall" in +"$define"|true|[yY]*) case "$longsize" in 4) case "$archname64" in ''|64int) archname64=64all ;; @@ -5489,7 +5730,7 @@ $undef:$define) cat >&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 </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' +# 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 <malloc.c < #endif #ifdef TRY_MALLOC -void *malloc(); -#endif -#ifdef TRY_FREE -void free(); -#endif -END -case "$malloctype" in -'') - if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then - malloctype='void *' - else - malloctype='char *' - fi - ;; -esac -echo "Your system wants malloc to return '$malloctype', it would seem." >&4 - -case "$freetype" in -'') - if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then - freetype='void' - else - freetype='int' - fi - ;; -esac -echo "Your system uses $freetype free(), it would seem." >&4 -$rm -f malloc.[co] -$cat </dev/null 2>&1; then + malloctype='void *' + else + malloctype='char *' + fi ;; esac -siteprefix="$ans" -siteprefixexp="$ansexp" +echo "Your system wants malloc to return '$malloctype', it would seem." >&4 -: determine where site specific libraries go. -: Usual default is /usr/local/lib/perl5/site_perl/$version -: The default "style" setting is made in installstyle.U -: XXX No longer works with Prefixit stuff. -prog=`echo $package | $sed 's/-*[0-9.]*$//'` -case "$sitelib" in -'') case "$installstyle" in - *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;; - *) dflt=$siteprefix/lib/site_$prog/$version ;; - esac - ;; -*) dflt="$sitelib" +case "$freetype" in +'') + if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then + freetype='void' + else + freetype='int' + fi ;; esac -$cat <&4 +$rm -f malloc.[co] : determine where site specific architecture-dependent libraries go. : sitelib default is /usr/local/lib/perl5/site_perl/$version : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname @@ -6429,13 +6753,12 @@ EOM fn=d~+ rp='Pathname for the site-specific architecture-dependent library files?' . ./getfile -sitearch="$ans" -sitearchexp="$ansexp" -: Change installation prefix, if necessary. -if $test X"$prefix" != X"$installprefix"; then - installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"` +prefixvar=sitearch +. ./setprefixvar +if $test X"$sitearch" = X"$sitelib"; then + d_sitearch="$undef" else - installsitearch="$sitearchexp" + d_sitearch="$define" fi $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 < /dev/null 2>&1; then nm_so_opt='--dynamic' fi @@ -7355,9 +7520,9 @@ eval $inhdr : is a C symbol defined? csym='tlook=$1; case "$3" in --v) tf=libc.tmp; tc=""; tdc="";; --a) tf=libc.tmp; tc="[0]"; tdc="[]";; -*) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";; +-v) tf=libc.tmp; tdc="";; +-a) tf=libc.tmp; tdc="[]";; +*) tlook="^$1\$"; tf=libc.list; tdc="()";; esac; tx=yes; case "$reuseval-$4" in @@ -7367,14 +7532,19 @@ esac; case "$tx" in yes) tval=false; - if $test "$runnm" = "true" && $contains $tlook $tf >/dev/null 2>&1; then - tval=true; - else - echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c; - if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1; then + 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; + $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; fi; - $rm -f t t.c; + else + echo "void *(*(p()))$tdc { extern void *$1$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; fi; ;; *) @@ -7570,7 +7740,7 @@ EOM '') dflt="$dflt +vnocompatwarnings" ;; esac ;; - linux|irix*) dflt='-shared' ;; + linux|irix*|gnu*) dflt='-shared' ;; next) dflt='none' ;; solaris) dflt='-G' ;; sunos) dflt='-assert nodefinitions' ;; @@ -7617,11 +7787,9 @@ say "none". EOM case "$ccdlflags" in '') case "$osname" in - hpux) dflt='-Wl,-E' ;; - linux) dflt='-rdynamic' ;; - next) dflt='none' ;; - sunos) dflt='none' ;; - *) dflt='none' ;; + linux|hpux|gnu*) dflt='-Wl,-E' ;; + next|sunos) dflt='none' ;; + *) dflt='none' ;; esac ;; ' ') dflt='none' ;; *) dflt="$ccdlflags" ;; @@ -7680,7 +7848,7 @@ any other libraries needed on this system (such as -lm, etc.). Since your system supports dynamic loading, it is probably possible to build a shared libperl.$so. If you will have more than one executable linked to libperl.$so, this will significantly reduce the size of each -executable, but it may have a noticeable affect on performance. The +executable, but it may have a noticeable effect on performance. The default is probably sensible for your system. $also @@ -7716,7 +7884,7 @@ true) dflt=libperl.5.$so # XXX How handle the --version stuff for MAB? ;; - linux*) # ld won't link with a bare -lperl otherwise. + linux*|gnu*) # ld won't link with a bare -lperl otherwise. dflt=libperl.$so ;; cygwin*) # ld links against an importlib @@ -7800,10 +7968,10 @@ if "$useshrplib"; then solaris) xxx="-R $shrpdir" ;; - freebsd|netbsd|openbsd) + freebsd|netbsd|openbsd|interix|dragonfly) xxx="-Wl,-R$shrpdir" ;; - bsdos|linux|irix*|dec_osf) + bsdos|linux|irix*|dec_osf|gnu*) xxx="-Wl,-rpath,$shrpdir" ;; next) @@ -7914,20 +8082,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 @@ -8002,7 +8164,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";; @@ -8017,8 +8179,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' @@ -8039,20 +8201,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 ' ') @@ -8418,6 +8574,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 @@ -8427,13 +8586,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 @@ -8462,8 +8621,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 *!*) ;; @@ -8473,10 +8632,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" @@ -8508,12 +8667,12 @@ case "$scriptdir" in ;; esac $cat <&4 $cat >try.c <&4 +$cat >attrib.c <<'EOCP' +#include +void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2))); +EOCP +if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then + if $contains 'warning' attrib.out >/dev/null 2>&1; then + echo "Your C compiler doesn't support __attribute__((format))." + val="$undef" + else + echo "Your C compiler supports __attribute__((format))." + val="$define" + fi +else + echo "Your C compiler doesn't seem to understand __attribute__ at all." + val="$undef" +fi +;; +*) val="$d_attribute_format" ;; +esac +set d_attribute_format +eval $setvar +$rm -f attrib* + +: Look for GCC-style attribute malloc +case "$d_attribute_malloc" in +'') +echo " " +echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4 +$cat >attrib.c <<'EOCP' +#include +char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc)); +EOCP +if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then + if $contains 'warning' attrib.out >/dev/null 2>&1; then + echo "Your C compiler doesn't support __attribute__((malloc))." + val="$undef" + else + echo "Your C compiler supports __attribute__((malloc))." + val="$define" + fi +else + echo "Your C compiler doesn't seem to understand __attribute__ at all." + val="$undef" +fi +;; +*) val="$d_attribute_malloc" ;; +esac +set d_attribute_malloc +eval $setvar +$rm -f attrib* + +: Look for GCC-style attribute nonnull +case "$d_attribute_nonnull" in +'') +echo " " +echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4 +$cat >attrib.c <<'EOCP' +#include +void do_something (char *some_pointer,...) __attribute__((nonnull(1))); +EOCP +if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then + if $contains 'warning' attrib.out >/dev/null 2>&1; then + echo "Your C compiler doesn't support __attribute__((nonnull))." + val="$undef" + else + echo "Your C compiler supports __attribute__((nonnull))." + val="$define" + fi +else + echo "Your C compiler doesn't seem to understand __attribute__ at all." + val="$undef" +fi +;; +*) val="$d_attribute_nonnull" ;; +esac +set d_attribute_nonnull +eval $setvar +$rm -f attrib* + +: Look for GCC-style attribute noreturn +case "$d_attribute_noreturn" in +'') +echo " " +echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4 +$cat >attrib.c <<'EOCP' +#include +void fall_over_dead( void ) __attribute__((noreturn)); +EOCP +if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then + if $contains 'warning' attrib.out >/dev/null 2>&1; then + echo "Your C compiler doesn't support __attribute__((noreturn))." + val="$undef" + else + echo "Your C compiler supports __attribute__((noreturn))." + val="$define" + fi +else + echo "Your C compiler doesn't seem to understand __attribute__ at all." + val="$undef" +fi +;; +*) val="$d_attribute_noreturn" ;; +esac +set d_attribute_noreturn +eval $setvar +$rm -f attrib* + +: Look for GCC-style attribute pure +case "$d_attribute_pure" in +'') +echo " " +echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4 +$cat >attrib.c <<'EOCP' +#include +int square( int n ) __attribute__((pure)); +EOCP +if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then + if $contains 'warning' attrib.out >/dev/null 2>&1; then + echo "Your C compiler doesn't support __attribute__((pure))." + val="$undef" + else + echo "Your C compiler supports __attribute__((pure))." + val="$define" + fi +else + echo "Your C compiler doesn't seem to understand __attribute__ at all." + val="$undef" +fi +;; +*) val="$d_attribute_pure" ;; +esac +set d_attribute_pure +eval $setvar +$rm -f attrib* + +: Look for GCC-style attribute unused +case "$d_attribute_unused" in +'') +echo " " +echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4 +$cat >attrib.c <<'EOCP' +#include +int do_something( int dummy __attribute__((unused)), int n ); +EOCP +if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then + if $contains 'warning' attrib.out >/dev/null 2>&1; then + echo "Your C compiler doesn't support __attribute__((unused))." + val="$undef" + else + echo "Your C compiler supports __attribute__((unused))." + val="$define" + fi +else + echo "Your C compiler doesn't seem to understand __attribute__ at all." + val="$undef" +fi +;; +*) val="$d_attribute_unused" ;; +esac +set d_attribute_unused +eval $setvar +$rm -f attrib* + +: Look for GCC-style attribute warn_unused_result +case "$d_attribute_warn_unused_result" in +'') echo " " -echo "Checking whether your compiler can handle __attribute__ ..." >&4 +echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4 $cat >attrib.c <<'EOCP' #include -void croak (char* pat,...) __attribute__((__format__(__printf__,1,2),noreturn)); +int I_will_not_be_ignored(void) __attribute__((warn_unused_result)); EOCP if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then if $contains 'warning' attrib.out >/dev/null 2>&1; then - echo "Your C compiler doesn't fully support __attribute__." + echo "Your C compiler doesn't support __attribute__((warn_unused_result))." val="$undef" else - echo "Your C compiler supports __attribute__." + echo "Your C compiler supports __attribute__((warn_unused_result))." val="$define" fi else echo "Your C compiler doesn't seem to understand __attribute__ at all." val="$undef" fi -set d_attribut +;; +*) val="$d_attribute_warn_unused_result" ;; +esac +set d_attribute_warn_unused_result eval $setvar $rm -f attrib* @@ -9923,60 +10186,264 @@ case "$d_setpgrp" in #ifdef I_UNISTD # include #endif -#$i_stdlib I_STDLIB -#ifdef I_STDLIB -#include +#$i_stdlib I_STDLIB +#ifdef I_STDLIB +#include +#endif +int main() +{ + if (getuid() == 0) { + printf("(I see you are running Configure as super-user...)\n"); + setuid(1); + } +#ifdef TRY_BSD_PGRP + if (-1 == setpgrp(1, 1)) + exit(0); +#else + if (setpgrp() != -1) + exit(0); +#endif + exit(1); +} +EOP + if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then + echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4 + val="$define" + elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then + echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4 + val="$undef" + else + echo "(I can't seem to compile and run the test program.)" + if ./usg; then + xxx="a USG one, i.e. you use setpgrp()." + else + # SVR4 systems can appear rather BSD-ish. + case "$i_unistd" in + $undef) + xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)." + val="$define" + ;; + $define) + xxx="probably a USG one, i.e. you use setpgrp()." + val="$undef" + ;; + esac + fi + echo "Assuming your setpgrp is $xxx" >&4 + fi + ;; +*) val="$undef";; +esac +set d_bsdsetpgrp +eval $setvar +$rm -f try 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 -f try.* try core core.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 -f try.* try core core.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 -int main() { - if (getuid() == 0) { - printf("(I see you are running Configure as super-user...)\n"); - setuid(1); - } -#ifdef TRY_BSD_PGRP - if (-1 == setpgrp(1, 1)) - exit(0); + va_list ap; +#ifndef I_STDARG + char *p; +#endif +#ifdef I_STDARG + va_start(ap,p); #else - if (setpgrp() != -1) - exit(0); + va_start(ap); + p = va_arg(ap, char *); #endif - exit(1); + va_end(ap); } EOP - if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then - echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4 - val="$define" - elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then - echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4 - val="$undef" - else - echo "(I can't seem to compile and run the test program.)" - if ./usg; then - xxx="a USG one, i.e. you use setpgrp()." - else - # SVR4 systems can appear rather BSD-ish. - case "$i_unistd" in - $undef) - xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)." - val="$define" - ;; - $define) - xxx="probably a USG one, i.e. you use setpgrp()." - val="$undef" - ;; - esac - fi - echo "Assuming your setpgrp is $xxx" >&4 +$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 ;; -*) val="$undef";; esac -set d_bsdsetpgrp -eval $setvar -$rm -f try try.* -: see if bzero exists -set bzero d_bzero -eval $inlibc +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 -f try.* try core core.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 " " @@ -10056,7 +10523,7 @@ int main() i32 = ($xxx) g; /* x86 processors will probably give 0x8000 0000, which is a - sign change. We don't want that. We want to mimic SPARC + sign change. We don't want that. We want to mimic SPARC behavior here, which is to preserve the sign and give back 0x7fff ffff. */ @@ -10245,6 +10712,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 @@ -10775,6 +11246,7 @@ int main() { exit(1); } EOM +val=$undef set dirfd if eval $compile; then val="$define" @@ -12289,6 +12761,41 @@ case "$longsize" in 8) echo "(Your long is 64 bits, so you could use ftell.)" ;; esac +d_futimes="$undef" +: check for a working futimes +echo " " +echo "Checking for a working futimes()" >&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, it does" >&4 + d_futimes="$define" + ;; + *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4 + ;; + esac +else + echo "No, it does not (probably harmless)\n" >&4 +fi +$rm -f try.* try core core.try.* + : see if getcwd exists set getcwd d_getcwd eval $inlibc @@ -13888,6 +14395,38 @@ $rm -f ldbl_dig.? set d_ldbl_dig eval $setvar +: see if this is a math.h system +set math.h i_math +eval $inhdr + +d_libm_lib_version="$undef" +case $i_math in + $define) + : check to see if math.h defines _LIB_VERSION + echo " " + echo "Checking to see if your libm supports _LIB_VERSION..." >&4 + $cat >try.c < +#include +int main (int argc, char *argv[]) +{ + printf ("%d\n", _LIB_VERSION); + return (0); + } /* main */ +EOCP + set try + if eval $compile; then + foo=`$run ./try` + echo "Yes, it does ($foo)" >&4 + d_libm_lib_version="$define" + else + echo "No, it does not (probably harmless)\n" >&4 + fi + $rm -f try.* try core core.try.* + ;; + + esac + : see if link exists set link d_link eval $inlibc @@ -13958,6 +14497,14 @@ eval $inlibc set madvise d_madvise eval $inlibc +: see if malloc_size exists +set malloc_size d_malloc_size +eval $inlibc + +: see if malloc_size_good exists +set malloc_good_size d_malloc_good_size +eval $inlibc + : see if mblen exists set mblen d_mblen eval $inlibc @@ -14055,7 +14602,7 @@ eval $inlibc : see if prototype for modfl is available echo " " -set d_modflproto modfl math.h +set d_modflproto modfl $i_math math.h eval $hasproto d_modfl_pow32_bug="$undef" @@ -14231,10 +14778,6 @@ eval $inlibc set munmap d_munmap eval $inlibc -: see if nanosleep exists -set nanosleep d_nanosleep -eval $inlibc - : see if nice exists set nice d_nice eval $inlibc @@ -14542,17 +15085,139 @@ d_nv_preserves_uv="$undef" if eval $compile; then nv_preserves_uv_bits="`$run ./try`" fi -case "$nv_preserves_uv_bits" in -\-[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" - ;; -[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" ;; -esac +case "$nv_preserves_uv_bits" in +\-[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" + ;; +[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" ;; +esac + +$rm -f try.* 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. +if test X"$d_volatile" = X"$define"; then + volatile=volatile +fi +$cat <try.c +#include +#$i_stdlib I_STDLIB +#ifdef I_STDLIB +#include +#endif +#$i_string I_STRING +#ifdef I_STRING +# include +#else +# include +#endif +#include +#include +#ifdef SIGFPE +$volatile int bletched = 0; +$signal_t blech(s) int s; { bletched = 1; } +#endif + +int checkit($nvtype d, char *where) { + unsigned char *p = (char *)&d; + unsigned char *end = p + sizeof(d); + int fail = 0; + + while (p < end) + fail += *p++; + + if (!fail) + return 0; + + p = (char *)&d; + printf("No - %s: 0x", where); + while (p < end) + printf ("%02X", *p++); + printf("\n"); + return 1; +} + +int main(int argc, char **argv) { + $nvtype d = 0.0; + int fail = 0; + fail += checkit(d, "0.0"); + + /* The compiler shouldn't be assuming that bletched is 0 */ + d = bletched; + + fail += checkit(d, "bleched"); + +#ifdef SIGFPE + signal(SIGFPE, blech); +#endif + + /* Paranoia - the compiler should have no way of knowing that ANSI says + that argv[argc] will always be NULL. Actually, if it did assume this it + would be buggy, as this is C and main() can be called from elsewhere in + the program. */ + d = argv[argc] ? 1 : 0; + + if (d) { + printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d); + } + + fail += checkit(d, "ternary"); + + memset(&d, sizeof(d), argv[argc] ? 1 : 0); + + if (d != 0.0) { + printf("No - memset doesn't give 0.0\n"); + /* This might just blow up: */ + printf("(gives %g)\n", d); + return 1; + } + +#ifdef SIGFPE + if (bletched) { + printf("No - something bleched\n"); + return 1; + } +#endif + if (fail) { + printf("No - %d fail(s)\n", fail); + return 1; + } + printf("Yes\n"); + return 0; +} +EOP +set try + +d_nv_zero_is_allbits_zero="$undef" +if eval $compile; then + xxx="`$run ./try`" + case "$?" in + 0) + case "$xxx" in + Yes) cat >&4 <&4 <&4 <try.c <." >&4 val="$undef" fi -$rm -f try try.c try.h +$rm -f try try.c set d_union_semun eval $setvar : see how to do semctl IPC_STAT case "$d_sem" in $define) - : see whether semctl IPC_STAT can use union semun echo " " $cat > try.h < try.c < try.c < #include #include @@ -15317,7 +15988,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 && ... */ @@ -15325,17 +15996,18 @@ int main() { return 0; } END - val="$undef" - set try - if eval $compile; then - xxx=`$run ./try` - case "$xxx" in - semun) val="$define" ;; - esac - fi - $rm -f try try.c - set d_semctl_semun - eval $setvar + set try + if eval $compile; then + xxx=`$run ./try` + case "$xxx" in + semun) val="$define" ;; + esac + fi + $rm -f try try.c + set d_semctl_semun + eval $setvar + ;; + esac case "$d_semctl_semun" in $define) echo "You can use union semun for semctl IPC_STAT." >&4 @@ -15347,7 +16019,10 @@ END esac : see whether semctl IPC_STAT can use struct semid_ds pointer - $cat > try.c <<'END' + case "$d_semctl_semid_ds" in + '') + val="$undef" + $cat > try.c <<'END' #include #include #include @@ -15383,17 +16058,18 @@ int main() { return 0; } END - val="$undef" - set try - if eval $compile; then - xxx=`$run ./try` - case "$xxx" in - semid_ds) val="$define" ;; - esac - fi - $rm -f try try.c - set d_semctl_semid_ds - eval $setvar + set try + if eval $compile; then + xxx=`$run ./try` + case "$xxx" in + semid_ds) val="$define" ;; + esac + fi + $rm -f try try.c + set d_semctl_semid_ds + eval $setvar + ;; + esac case "$d_semctl_semid_ds" in $define) echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4 @@ -16065,6 +16741,71 @@ set d_sigsetjmp eval $setvar $rm -f try.c 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 -f try.* try core core.try.* + ;; +esac + : see if sockatmark exists set sockatmark d_sockatmark eval $inlibc @@ -16078,6 +16819,68 @@ 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 case "$make_set_make" in @@ -18304,104 +19152,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 @@ -18636,12 +19386,6 @@ rp="What is the type of process ids on this system?" set pid_t pidtype int stdio.h sys/types.h eval $typedef_ask -: Find earliest binary compatible site_perl subdirectory perl can use. -xs_apiversion=$version # The current site_perl version. -: Find earliest pure perl site_perl subdirectory perl can use. -: The versioned directories started at 5.005. -pm_apiversion='5.005' - : see if ar generates random libraries by itself echo " " echo "Checking how to generate random libraries on your machine..." >&4 @@ -18662,7 +19406,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 @@ -18687,7 +19439,7 @@ else ranlib=":" fi fi -$rm -f foo* bar* +$rm -f foo* bar* : check for type of arguments to select. case "$selecttype" in @@ -18917,6 +19669,12 @@ int main() { #endif #ifndef NSIG +# ifdef _SIG_MAX +# define NSIG (_SIG_MAX+1) +# endif +#endif + +#ifndef NSIG # ifdef MAXSIG # define NSIG (MAXSIG+1) # endif @@ -18930,7 +19688,7 @@ int main() { #ifndef NSIG # ifdef SIGARRAYSIZE -# define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */ +# define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */ # endif #endif @@ -19269,7 +20027,8 @@ $rm -f try 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" @@ -19277,9 +20036,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 " " @@ -19415,6 +20172,16 @@ case "$uidsign" in ;; esac + +case "$usesitecustomize" in + $define|true|[Yy]*) + usesitecustomize="$define" + ;; + *) + usesitecustomize="$undef" + ;; + esac + : determine compiler compiler case "$yacc" in '') @@ -19475,10 +20242,6 @@ fi -: see if this is a math.h system -set math.h i_math -eval $inhdr - : see if this is a mntent.h system set mntent.h i_mntent eval $inhdr @@ -19559,17 +20322,17 @@ 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 -alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX +alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi bull c cadmus clipper CMU COFF COMPILER_VERSION concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX -CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO +CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR @@ -19621,7 +20384,7 @@ USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 -Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286 +Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED z8000 @@ -19656,16 +20419,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 @@ -19675,11 +20448,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 @@ -19711,11 +20499,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 @@ -20138,8 +20924,8 @@ case "$noextensions" in *) keepextensions='' echo "You have requested that certain extensions be ignored..." >&4 for i in $avail_ext; do - case " $i " in - " $noextensions ") echo "Ignoring extension $i." ;; + case " $noextensions " in + *" $i "*) echo "Ignoring extension $i." ;; *) echo "Keeping extension $i."; keepextensions="$keepextensions $i" ;; @@ -20509,13 +21295,22 @@ d_archlib='$d_archlib' d_asctime_r='$d_asctime_r' d_atolf='$d_atolf' d_atoll='$d_atoll' -d_attribut='$d_attribut' +d_attribute_format='$d_attribute_format' +d_attribute_malloc='$d_attribute_malloc' +d_attribute_nonnull='$d_attribute_nonnull' +d_attribute_noreturn='$d_attribute_noreturn' +d_attribute_pure='$d_attribute_pure' +d_attribute_unused='$d_attribute_unused' +d_attribute_warn_unused_result='$d_attribute_warn_unused_result' d_bcmp='$d_bcmp' d_bcopy='$d_bcopy' d_bsd='$d_bsd' d_bsdgetpgrp='$d_bsdgetpgrp' d_bsdsetpgrp='$d_bsdsetpgrp' +d_builtin_choose_expr='$d_builtin_choose_expr' +d_builtin_expect='$d_builtin_expect' d_bzero='$d_bzero' +d_c99_variadic_macros='$d_c99_variadic_macros' d_casti32='$d_casti32' d_castneg='$d_castneg' d_charvspr='$d_charvspr' @@ -20523,6 +21318,7 @@ d_chown='$d_chown' d_chroot='$d_chroot' d_chsize='$d_chsize' d_class='$d_class' +d_clearenv='$d_clearenv' d_closedir='$d_closedir' d_cmsghdr_s='$d_cmsghdr_s' d_const='$d_const' @@ -20591,6 +21387,7 @@ d_fstatvfs='$d_fstatvfs' d_fsync='$d_fsync' d_ftello='$d_ftello' d_ftime='$d_ftime' +d_futimes='$d_futimes' d_getcwd='$d_getcwd' d_getespwnam='$d_getespwnam' d_getfsstat='$d_getfsstat' @@ -20653,6 +21450,7 @@ d_grpasswd='$d_grpasswd' d_hasmntopt='$d_hasmntopt' d_htonl='$d_htonl' d_ilogbl='$d_ilogbl' +d_inc_version_list='$d_inc_version_list' d_index='$d_index' d_inetaton='$d_inetaton' d_int64_t='$d_int64_t' @@ -20664,6 +21462,7 @@ d_isnanl='$d_isnanl' d_killpg='$d_killpg' d_lchown='$d_lchown' d_ldbl_dig='$d_ldbl_dig' +d_libm_lib_version='$d_libm_lib_version' d_link='$d_link' d_localtime_r='$d_localtime_r' d_locconv='$d_locconv' @@ -20673,6 +21472,8 @@ d_longlong='$d_longlong' d_lseekproto='$d_lseekproto' d_lstat='$d_lstat' d_madvise='$d_madvise' +d_malloc_good_size='$d_malloc_good_size' +d_malloc_size='$d_malloc_size' d_mblen='$d_mblen' d_mbstowcs='$d_mbstowcs' d_mbtowc='$d_mbtowc' @@ -20706,10 +21507,10 @@ d_msgsnd='$d_msgsnd' d_msync='$d_msync' d_munmap='$d_munmap' d_mymalloc='$d_mymalloc' -d_nanosleep='$d_nanosleep' d_nice='$d_nice' d_nl_langinfo='$d_nl_langinfo' d_nv_preserves_uv='$d_nv_preserves_uv' +d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero' d_off64_t='$d_off64_t' d_old_pthread_create_joinable='$d_old_pthread_create_joinable' d_oldpthreads='$d_oldpthreads' @@ -20724,6 +21525,7 @@ d_poll='$d_poll' d_portable='$d_portable' d_procselfexe='$d_procselfexe' d_pthread_atfork='$d_pthread_atfork' +d_pthread_attr_setscope='$d_pthread_attr_setscope' d_pthread_yield='$d_pthread_yield' d_pwage='$d_pwage' d_pwchange='$d_pwchange' @@ -20803,12 +21605,15 @@ d_shmget='$d_shmget' d_sigaction='$d_sigaction' d_sigprocmask='$d_sigprocmask' d_sigsetjmp='$d_sigsetjmp' +d_sitearch='$d_sitearch' +d_snprintf='$d_snprintf' d_sockatmark='$d_sockatmark' d_sockatmarkproto='$d_sockatmarkproto' d_socket='$d_socket' d_socklen_t='$d_socklen_t' d_sockpair='$d_sockpair' d_socks5_init='$d_socks5_init' +d_sprintf_returns_strlen='$d_sprintf_returns_strlen' d_sqrtl='$d_sqrtl' d_srand48_r='$d_srand48_r' d_srandom_r='$d_srandom_r' @@ -20832,6 +21637,8 @@ d_strerrm='$d_strerrm' d_strerror='$d_strerror' d_strerror_r='$d_strerror_r' d_strftime='$d_strftime' +d_strlcat='$d_strlcat' +d_strlcpy='$d_strlcpy' d_strtod='$d_strtod' d_strtol='$d_strtol' d_strtold='$d_strtold' @@ -20867,6 +21674,7 @@ d_umask='$d_umask' d_uname='$d_uname' d_union_semun='$d_union_semun' d_unordered='$d_unordered' +d_unsetenv='$d_unsetenv' d_usleep='$d_usleep' d_usleepproto='$d_usleepproto' d_ustat='$d_ustat' @@ -20880,6 +21688,7 @@ d_voidsig='$d_voidsig' d_voidtty='$d_voidtty' d_volatile='$d_volatile' d_vprintf='$d_vprintf' +d_vsnprintf='$d_vsnprintf' d_wait4='$d_wait4' d_waitpid='$d_waitpid' d_wcstombs='$d_wcstombs' @@ -21066,6 +21875,7 @@ inc_version_list='$inc_version_list' inc_version_list_init='$inc_version_list_init' incpath='$incpath' inews='$inews' +initialinstalllocation='$initialinstalllocation' installarchlib='$installarchlib' installbin='$installbin' installhtml1dir='$installhtml1dir' @@ -21078,21 +21888,21 @@ installprivlib='$installprivlib' installscript='$installscript' installsitearch='$installsitearch' installsitebin='$installsitebin' -installsitehtml1='$installsitehtml1' -installsitehtml3='$installsitehtml3' +installsitehtml1dir='$installsitehtml1dir' +installsitehtml3dir='$installsitehtml3dir' installsitelib='$installsitelib' -installsiteman1='$installsiteman1' -installsiteman3='$installsiteman3' +installsiteman1dir='$installsiteman1dir' +installsiteman3dir='$installsiteman3dir' installsitescript='$installsitescript' installstyle='$installstyle' installusrbinperl='$installusrbinperl' installvendorarch='$installvendorarch' installvendorbin='$installvendorbin' -installvendorhtml1='$installvendorhtml1' -installvendorhtml3='$installvendorhtml3' +installvendorhtml1dir='$installvendorhtml1dir' +installvendorhtml3dir='$installvendorhtml3dir' installvendorlib='$installvendorlib' -installvendorman1='$installvendorman1' -installvendorman3='$installvendorman3' +installvendorman1dir='$installvendorman1dir' +installvendorman3dir='$installvendorman3dir' installvendorscript='$installvendorscript' intsize='$intsize' issymlink='$issymlink' @@ -21134,6 +21944,10 @@ lpr='$lpr' ls='$ls' lseeksize='$lseeksize' lseektype='$lseektype' +mad='$mad' +madlyh='$madlyh' +madlyobj='$madlyobj' +madlysrc='$madlysrc' mail='$mail' mailx='$mailx' make='$make' @@ -21148,6 +21962,7 @@ man3dir='$man3dir' man3direxp='$man3direxp' man3ext='$man3ext' mips_type='$mips_type' +mistrustnm='$mistrustnm' mkdir='$mkdir' mmaptype='$mmaptype' modetype='$modetype' @@ -21201,7 +22016,6 @@ pg='$pg' phostname='$phostname' pidtype='$pidtype' plibpth='$plibpth' -pm_apiversion='$pm_apiversion' pmake='$pmake' pr='$pr' prefix='$prefix' @@ -21272,17 +22086,17 @@ sitearch='$sitearch' sitearchexp='$sitearchexp' sitebin='$sitebin' sitebinexp='$sitebinexp' -sitehtml1='$sitehtml1' -sitehtml1exp='$sitehtml1exp' -sitehtml3='$sitehtml3' -sitehtml3exp='$sitehtml3exp' +sitehtml1dir='$sitehtml1dir' +sitehtml1direxp='$sitehtml1direxp' +sitehtml3dir='$sitehtml3dir' +sitehtml3direxp='$sitehtml3direxp' sitelib='$sitelib' sitelib_stem='$sitelib_stem' sitelibexp='$sitelibexp' -siteman1='$siteman1' -siteman1exp='$siteman1exp' -siteman3='$siteman3' -siteman3exp='$siteman3exp' +siteman1dir='$siteman1dir' +siteman1direxp='$siteman1direxp' +siteman3dir='$siteman3dir' +siteman3direxp='$siteman3direxp' siteprefix='$siteprefix' siteprefixexp='$siteprefixexp' sitescript='$sitescript' @@ -21356,6 +22170,7 @@ usefaststdio='$usefaststdio' useithreads='$useithreads' uselargefiles='$uselargefiles' uselongdouble='$uselongdouble' +usemallocwrap='$usemallocwrap' usemorebits='$usemorebits' usemultiplicity='$usemultiplicity' usemymalloc='$usemymalloc' @@ -21364,8 +22179,10 @@ useopcode='$useopcode' useperlio='$useperlio' useposix='$useposix' usereentrant='$usereentrant' +userelocatableinc='$userelocatableinc' usesfio='$usesfio' useshrplib='$useshrplib' +usesitecustomize='$usesitecustomize' usesocks='$usesocks' usethreads='$usethreads' usevendorprefix='$usevendorprefix' @@ -21382,17 +22199,17 @@ vendorarch='$vendorarch' vendorarchexp='$vendorarchexp' vendorbin='$vendorbin' vendorbinexp='$vendorbinexp' -vendorhtml1='$vendorhtml1' -vendorhtml1exp='$vendorhtml1exp' -vendorhtml3='$vendorhtml3' -vendorhtml3exp='$vendorhtml3exp' +vendorhtml1dir='$vendorhtml1dir' +vendorhtml1direxp='$vendorhtml1direxp' +vendorhtml3dir='$vendorhtml3dir' +vendorhtml3direxp='$vendorhtml3direxp' vendorlib='$vendorlib' vendorlib_stem='$vendorlib_stem' vendorlibexp='$vendorlibexp' -vendorman1='$vendorman1' -vendorman1exp='$vendorman1exp' -vendorman3='$vendorman3' -vendorman3exp='$vendorman3exp' +vendorman1dir='$vendorman1dir' +vendorman1direxp='$vendorman1direxp' +vendorman3dir='$vendorman3dir' +vendorman3direxp='$vendorman3direxp' vendorprefix='$vendorprefix' vendorprefixexp='$vendorprefixexp' vendorscript='$vendorscript' @@ -21403,7 +22220,6 @@ versiononly='$versiononly' vi='$vi' voidflags='$voidflags' xlibpth='$xlibpth' -xs_apiversion='$xs_apiversion' yacc='$yacc' yaccflags='$yaccflags' zcat='$zcat'