X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Configure;h=79d3ad90ffe10bc1302270e15c2bb3d6c3fddbbe;hb=1d68d6cd5ca16f48de9798b0758052a6de564551;hp=c70242f658e4f5aa05641fc09b597be4a18b25ef;hpb=3141530c492792a17327a0ff80df3353f97c80ea;p=p5sagit%2Fp5-mst-13.2.git diff --git a/Configure b/Configure index c70242f..79d3ad9 100755 --- a/Configure +++ b/Configure @@ -20,8 +20,8 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Wed Mar 1 01:33:58 EET 2000 [metaconfig 3.0 PL70] -# (with additional metaconfig patches by perlbug@perl.com) +# Generated on Sat Oct 14 17:18:06 EET DST 2000 [metaconfig 3.0 PL70] +# (with additional metaconfig patches by perlbug@perl.org) cat >/tmp/c1$$ <&4 @@ -1729,6 +1770,40 @@ persist across sessions for $package. You may safely delete it if you wish. EOF +xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` +case "$usedevel" in +$define|true|[yY]*) ;; +*) case "$xversion" in + *[13579]) + cat >&4 <&4 "Okay, continuing." ;; + *) echo >&4 "Okay, bye." + exit 1 + ;; + esac + ;; + esac + ;; +esac + : general instructions needman=true firsttime=true @@ -1791,7 +1866,7 @@ Much effort has been expended to ensure that this shell script will run on any Unix system. If despite that it blows up on yours, your best bet is to edit Configure and run it again. If you can't run Configure for some reason, you'll have to generate a config.sh file by hand. Whatever problems you -have, let me (perlbug@perl.com) know how I blew it. +have, let me (perlbug@perl.org) know how I blew it. This installation script affects things in two ways: @@ -2012,6 +2087,66 @@ FOO ;; esac +cat <checkcc +$startsh +EOS +cat <<'EOSC' >>checkcc +case "$cc" in +'') ;; +*) $rm -f try try.* + $cat >try.c <&4 + despair=yes + trygcc=yes + case "$cc" in + *gcc*) trygcc=no ;; + esac + 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 + if $test -f myread; then + . ./myread + else + if $test -f UU/myread; then + . ./UU/myread + else + echo "Cannot find myread, sorry. Aborting." >&2 + exit 1 + fi + fi + case "$ans" in + [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;; + esac + fi + fi + if $test X"$despair" = Xyes; then + $cat >&4 <&4 dflt='' : Half the following guesses are probably wrong... If you have better - : tests or hints, please send them to perlbug@perl.com + : tests or hints, please send them to perlbug@perl.org : The metaconfig authors would also appreciate a copy... $test -f /irix && osname=irix $test -f /xenix && osname=sco_xenix @@ -2328,7 +2464,11 @@ EOM osf1|mls+) case "$5" in alpha) osname=dec_osf - osvers=`echo "$3" | sed 's/^[xvt]//'` + osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'` + case "$osvers" in + [1-9].[0-9]*) ;; + *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;; + esac ;; hp*) osname=hp_osf1 ;; mips) osname=mips_osf1 ;; @@ -2748,170 +2888,6 @@ esac set usemultiplicity eval $setvar -: determine where manual pages are on this system -echo " " -case "$sysman" in -'') - syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1' - syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1" - syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1" - syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1" - syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1" - sysman=`./loc . /usr/man/man1 $syspath` - ;; -esac -if $test -d "$sysman"; then - echo "System manual is in $sysman." >&4 -else - echo "Could not find manual pages in source form." >&4 -fi - -: see what memory models we can support -case "$models" in -'') - $cat >pdp11.c <<'EOP' -int main() { -#ifdef pdp11 - exit(0); -#else - exit(1); -#endif -} -EOP - ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1 - if $test -f pdp11 && ./pdp11 2>/dev/null; then - dflt='unsplit split' - else - tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge` - case "$tans" in - X) dflt='none';; - *) if $test -d /lib/small || $test -d /usr/lib/small; then - dflt='small' - else - dflt='' - fi - if $test -d /lib/medium || $test -d /usr/lib/medium; then - dflt="$dflt medium" - fi - if $test -d /lib/large || $test -d /usr/lib/large; then - dflt="$dflt large" - fi - if $test -d /lib/huge || $test -d /usr/lib/huge; then - dflt="$dflt huge" - fi - esac - fi;; -*) dflt="$models";; -esac -$cat </dev/null 2>&1 || \ - $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then - dflt='-i' - else - dflt='none' - fi;; - *) dflt="$split";; - esac - rp="What flag indicates separate I and D space?" - . ./myread - tans="$ans" - case "$tans" in - none) tans='';; - esac - split="$tans" - unsplit='';; -*large*|*small*|*medium*|*huge*) - case "$models" in - *large*) - case "$large" in - '') dflt='-Ml';; - *) dflt="$large";; - esac - rp="What flag indicates large model?" - . ./myread - tans="$ans" - case "$tans" in - none) tans=''; - esac - large="$tans";; - *) large='';; - esac - case "$models" in - *huge*) case "$huge" in - '') dflt='-Mh';; - *) dflt="$huge";; - esac - rp="What flag indicates huge model?" - . ./myread - tans="$ans" - case "$tans" in - none) tans=''; - esac - huge="$tans";; - *) huge="$large";; - esac - case "$models" in - *medium*) case "$medium" in - '') dflt='-Mm';; - *) dflt="$medium";; - esac - rp="What flag indicates medium model?" - . ./myread - tans="$ans" - case "$tans" in - none) tans=''; - esac - medium="$tans";; - *) medium="$large";; - esac - case "$models" in - *small*) case "$small" in - '') dflt='none';; - *) dflt="$small";; - esac - rp="What flag indicates small model?" - . ./myread - tans="$ans" - case "$tans" in - none) tans=''; - esac - small="$tans";; - *) small='';; - esac - ;; -*) - echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4 - ;; -esac -$rm -f pdp11.* pdp11 - : make some quick guesses about what we are up against echo " " $echo $n "Hmm... $c" @@ -2968,12 +2944,15 @@ EOI ;; esac : Detect OS2. The p_ variable is set above in the Head.U unit. +: Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses +: semicolon as a patch separator case "$p_" in :) ;; *) $cat <<'EOI' I have the feeling something is not exactly right, however...don't tell me... lemme think...does HAL ring a bell?...no, of course, you're only running OS/2! +(Or you may be running DOS with DJGPP.) EOI echo exit 0 >os2 ;; @@ -3004,57 +2983,21 @@ chmod +x bsd usg v7 osf1 eunice xenix venix os2 $eunicefix bsd usg v7 osf1 eunice xenix venix os2 $rm -f foo -: see if we need a special compiler -echo " " -if ./usg; then - case "$cc" in - '') case "$Mcc" in - /*) dflt='Mcc';; - *) case "$large" in - -M*) dflt='cc';; - *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then - if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then - dflt='cc' - else - dflt='cc -M' - fi - else - dflt='cc' - fi;; - esac;; - esac;; - *) dflt="$cc";; - esac - case "$dflt" in - *M*) $cat <<'EOM' -On some older systems the default C compiler will not resolve multiple global -references that happen to have the same name. On some such systems the "Mcc" -command may be used to force these to be resolved. On other systems a "cc -M" -command is required. (Note that the -M flag on other systems indicates a -memory model to use!) If you have the Gnu C compiler, you might wish to use -that instead. - -EOM - ;; - esac - rp="Use which C compiler?" - . ./myread - cc="$ans" -else - case "$cc" in - '') dflt=cc;; - *) dflt="$cc";; - esac - rp="Use which C compiler?" - . ./myread - cc="$ans" -fi +case "$cc" in +'') dflt=cc;; +*) dflt="$cc";; +esac +rp="Use which C compiler?" +. ./myread +cc="$ans" : Look for a hint-file generated 'call-back-unit'. Now that the : user has specified the compiler, we may need to set or change some : other defaults. if $test -f cc.cbu; then . ./cc.cbu fi +. ./checkcc + echo " " echo "Checking for GNU cc in disguise and/or its version number..." >&4 $cat >gccvers.c <&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 -: 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 -*\(*) - expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok - fn=`echo $fn | sed 's/(.*)//'` - ;; -esac +*** WHOA THERE!!! *** -case "$fn" in -*:*) - loc_file=`expr $fn : '.*:\(.*\)'` - fn=`expr $fn : '\(.*\):.*'` - ;; -esac + Your gcc has not been compiled for the exact release of + your operating system ($gccosandvers versus $osname$osvers). -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 + 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. -case "$fn" in -*f*) type='File';; -*d*) type='Directory';; -*l*) type='Locate';; -esac + 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. -what="$type" -case "$what" in -Locate) what='File';; +EOM + ;; + *) gccosandvers='' ;; # failed to parse, better be silent + esac + ;; esac - -case "$exp_file" in -'') - case "$d_portable" in - "$define") ;; - *) exp_file=true;; - esac - ;; +case "$ccname" in +'') ccname="$cc" ;; 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" ;; - *) - 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 - pf="$ansexp" - else - pf="$fp/$ansexp" - fi - if test -d "$pf"; then - type='' - value="$pf" - 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 -done -cd UU -ans="$value" -rp="$orig_rp" -dflt="$orig_dflt" -rm -f getfile.ok -test "X$gfpthkeep" != Xy && gfpth="" -EOSC - -: What should the include directory be ? -echo " " -$echo $n "Hmm... $c" -dflt='/usr/include' -incpath='' -mips_type='' -if $test -f /bin/mips && /bin/mips; then - echo "Looks like a MIPS system..." - $cat >usr.c <<'EOCP' -#ifdef SYSTYPE_BSD43 -/bsd43 -#endif -EOCP - if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then - dflt='/bsd43/usr/include' - incpath='/bsd43' - mips_type='BSD 4.3' - else - mips_type='System V' - fi - $rm -f usr.c usr.out - echo "and you're compiling with the $mips_type compiler and libraries." - xxx_prompt=y - echo "exit 0" >mips -else - echo "Doesn't look like a MIPS system." - xxx_prompt=n - echo "exit 1" >mips -fi -chmod +x mips -$eunicefix mips -case "$usrinc" in -'') ;; -*) dflt="$usrinc";; -esac -case "$xxx_prompt" in -y) fn=d/ - echo " " - rp='Where are the include files you want to use?' - . ./getfile - usrinc="$ans" - ;; -*) usrinc="$dflt" - ;; -esac - -: see how we invoke the C preprocessor -echo " " -echo "Now, how can we feed standard input to your C preprocessor..." >&4 -cat <<'EOT' >testcpp.c -#define ABC abc -#define XYZ xyz -ABC.XYZ -EOT +: see how we invoke the C preprocessor +echo " " +echo "Now, how can we feed standard input to your C preprocessor..." >&4 +cat <<'EOT' >testcpp.c +#define ABC abc +#define XYZ xyz +ABC.XYZ +EOT cd .. if test ! -f cppstdin; then if test "X$osname" = "Xaix" -a "X$gccversion" = X; then @@ -3564,2120 +3219,1435 @@ case "$cppstdin" in esac $rm -f testcpp.c testcpp.out -: Set private lib path -case "$plibpth" in -'') if ./mips; then - plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib" - fi;; -esac -case "$libpth" in -' ') dlist='';; -'') dlist="$loclibpth $plibpth $glibpth";; -*) dlist="$libpth";; +: decide how portable to be. Allow command line overrides. +case "$d_portable" in +"$undef") ;; +*) d_portable="$define" ;; esac -: Now check and see which directories actually exist, avoiding duplicates -libpth='' -for xxx in $dlist -do - if $test -d $xxx; then - case " $libpth " in - *" $xxx "*) ;; - *) libpth="$libpth $xxx";; - esac - fi -done -$cat <<'EOM' - -Some systems have incompatible or broken versions of libraries. Among -the directories listed in the question below, please remove any you -know not to be holding relevant libraries, and add any that are needed. -Say "none" for none. - -EOM -case "$libpth" in -'') dflt='none';; -*) - set X $libpth - shift - dflt=${1+"$@"} +: 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 ;; -*) dflt="$so";; -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 -case "$usesocks" in -$define|true|[yY]*) dflt='y';; -*) dflt='n';; +case "$fn" in +*\(*) + expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok + fn=`echo $fn | sed 's/(.*)//'` + ;; esac -cat <&4 -case "$libs" in -' '|'') dflt='';; -*) dflt="$libs";; +case "$fn" in +*~*) tilde=true;; esac -case "$libswanted" in -'') libswanted='c_s';; +case "$fn" in +*/*) fullpath=true;; esac -case "$usesocks" in -"$define") libswanted="$libswanted socks5 socks5_sh" ;; +case "$fn" in +*+*) skip=true;; esac -libsfound='' -libsfiles='' -libsdirs='' -libspath='' -for thisdir in $libpth $xlibpth; do - test -d $thisdir && libspath="$libspath $thisdir" -done -for thislib in $libswanted; do - for thisdir in $libspath; do - xxx='' - if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then - xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1` - $test -f "$xxx" && eval $libscheck - $test -f "$xxx" && libstyle=shared - fi - if test ! -f "$xxx"; then - xxx=$thisdir/lib$thislib.$so - $test -f "$xxx" && eval $libscheck - $test -f "$xxx" && libstyle=shared - fi - if test ! -f "$xxx"; then - xxx=$thisdir/lib$thislib$_a - $test -f "$xxx" && eval $libscheck - $test -f "$xxx" && libstyle=static - fi - if test ! -f "$xxx"; then - xxx=$thisdir/$thislib$_a - $test -f "$xxx" && eval $libscheck - $test -f "$xxx" && libstyle=static - fi - if test ! -f "$xxx"; then - xxx=$thisdir/lib${thislib}_s$_a - $test -f "$xxx" && eval $libscheck - $test -f "$xxx" && libstyle=static - $test -f "$xxx" && thislib=${thislib}_s - fi - if test ! -f "$xxx"; then - xxx=$thisdir/Slib$thislib$_a - $test -f "$xxx" && eval $libscheck - $test -f "$xxx" && libstyle=static - fi - if $test -f "$xxx"; then - case "$libstyle" in - shared) echo "Found -l$thislib (shared)." ;; - static) echo "Found -l$thislib." ;; - *) echo "Found -l$thislib ($libstyle)." ;; - esac - case " $dflt " in - *"-l$thislib "*);; - *) dflt="$dflt -l$thislib" - libsfound="$libsfound $xxx" - yyy=`basename $xxx` - libsfiles="$libsfiles $yyy" - yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"` - case " $libsdirs " in - *" $yyy "*) ;; - *) libsdirs="$libsdirs $yyy" ;; - esac - ;; - esac - break - fi - done - if $test ! -f "$xxx"; then - echo "No -l$thislib." - fi -done -set X $dflt -shift -dflt="$*" -case "$libs" in -'') dflt="$dflt";; -*) dflt="$libs";; +case "$fn" in +*n*) none_ok=true;; esac -case "$dflt" in -' '|'') dflt='none';; +case "$fn" in +*e*) exp_file=true;; +esac +case "$fn" in +*p*) nopath_ok=true;; esac -$cat </dev/null 2>&1 - then - dflt="$dflt -posix" - fi + . 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 ;; - esac - case "$gccversion" in - 1*) ;; - 2.[0-8]*) ;; - ?*) echo " " - echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1 - echo 'int main(void) { return 0; }' > gcctest.c - if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then - echo "Yes, it does." 2>&1 - case "$ccflags" in - *strict-aliasing*) - echo "Leaving current flags $ccflags alone." 2>&1 + *) + 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 ;; - *) dflt="$dflt -fno-strict-aliasing" ;; + *) value="$ans";; esac - else - echo "Nope, it doesn't, but that's ok." 2>&1 - fi + 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 +done +cd UU +ans="$value" +rp="$orig_rp" +dflt="$orig_dflt" +rm -f getfile.ok +test "X$gfpthkeep" != Xy && gfpth="" +EOSC + +: What should the include directory be ? +echo " " +$echo $n "Hmm... $c" +dflt='/usr/include' +incpath='' +mips_type='' +if $test -f /bin/mips && /bin/mips; then + echo "Looks like a MIPS system..." + $cat >usr.c <<'EOCP' +#ifdef SYSTYPE_BSD43 +/bsd43 +#endif +EOCP + if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then + dflt='/bsd43/usr/include' + incpath='/bsd43' + mips_type='BSD 4.3' + else + mips_type='System V' + fi + $rm -f usr.c usr.out + echo "and you're compiling with the $mips_type compiler and libraries." + xxx_prompt=y + echo "exit 0" >mips +else + echo "Doesn't look like a MIPS system." + xxx_prompt=n + echo "exit 1" >mips +fi +chmod +x mips +$eunicefix mips +case "$usrinc" in +'') ;; +*) dflt="$usrinc";; +esac +case "$xxx_prompt" in +y) fn=d/ + echo " " + rp='Where are the include files you want to use?' + . ./getfile + usrinc="$ans" + ;; +*) usrinc="$dflt" ;; esac -case "$mips_type" in -*BSD*|'') inclwanted="$locincpth $usrinc";; -*) inclwanted="$locincpth $inclwanted $usrinc/bsd";; +: Set private lib path +case "$plibpth" in +'') if ./mips; then + plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib" + fi;; +esac +case "$libpth" in +' ') dlist='';; +'') dlist="$loclibpth $plibpth $glibpth";; +*) dlist="$libpth";; esac -for thisincl in $inclwanted; do - if $test -d $thisincl; then - if $test x$thisincl != x$usrinc; then - case "$dflt" in - *$thisincl*);; - *) dflt="$dflt -I$thisincl";; - esac - fi - fi -done -inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then - xxx=true; -elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then - xxx=true; -else - xxx=false; -fi; -if $xxx; then - case "$dflt" in - *$2*);; - *) dflt="$dflt -D$2";; - esac; -fi' +: Now check and see which directories actually exist, avoiding duplicates +libpth='' +for xxx in $dlist +do + if $test -d $xxx; then + case " $libpth " in + *" $xxx "*) ;; + *) libpth="$libpth $xxx";; + esac + fi +done +$cat <<'EOM' -set signal.h LANGUAGE_C; eval $inctest +Some systems have incompatible or broken versions of libraries. Among +the directories listed in the question below, please remove any you +know not to be holding relevant libraries, and add any that are needed. +Say "none" for none. -case "$usesocks" in -$define) - ccflags="$ccflags -DSOCKS" +EOM +case "$libpth" in +'') dflt='none';; +*) + set X $libpth + shift + dflt=${1+"$@"} ;; esac - -case "$hint" in -default|recommended) dflt="$ccflags $dflt" ;; -*) dflt="$ccflags";; +rp="Directories to use for library searches?" +. ./myread +case "$ans" in +none) libpth=' ';; +*) libpth="$ans";; esac -case "$dflt" in -''|' ') dflt=none;; +: compute shared library extension +case "$so" in +'') + if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then + dflt='sl' + else + dflt='so' + fi + ;; +*) dflt="$so";; esac -$cat <&4 - set X $cppflags - shift - cppflags='' - $cat >cpp.c <<'EOM' -#define BLURFL foo - -BLURFL xx LFRULB -EOM - previous='' - for flag in $* - do - case "$flag" in - -*) ftry="$flag";; - *) ftry="$previous $flag";; - esac - if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus cpp1.out 2>/dev/null && \ - $cpprun -DLFRULB=bar $cppflags $ftry $cpplast cpp2.out 2>/dev/null && \ - $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \ - $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1 - then - cppflags="$cppflags $ftry" - previous='' - else - previous="$flag" - fi - done - set X $cppflags - shift - cppflags=${1+"$@"} - case "$cppflags" in - *-*) echo "They appear to be: $cppflags";; +case "$_a" in +'') case "$lib_ext" in + '') _a='.a';; + *) _a="$lib_ext" ;; esac - $rm -f cpp.c cpp?.out ;; esac - -: flags used in final linking phase -case "$ldflags" in -'') if ./venix; then - dflt='-i -z' - else - dflt='' - fi - case "$ccflags" in - *-posix*) dflt="$dflt -posix" ;; +case "$_o" in +'') case "$obj_ext" in + '') _o='.o';; + *) _o="$obj_ext";; esac ;; -*) dflt="$ldflags";; esac - -: Try to guess additional flags to pick up local libraries. -for thislibdir in $libpth; do - case " $loclibpth " in - *" $thislibdir "*) - case "$dflt " in - *"-L$thislibdir "*) ;; - *) dflt="$dflt -L$thislibdir" ;; - esac - ;; +case "$p_" in +'') case "$path_sep" in + '') p_=':';; + *) p_="$path_sep";; esac -done - -case "$dflt" in -'') dflt='none' ;; + ;; esac +exe_ext=$_exe +lib_ext=$_a +obj_ext=$_o +path_sep=$p_ -$cat <&4 -$cat > try.c <<'EOF' -#include -int main() { printf("Ok\n"); exit(0); } -EOF -set X $cc $optimize $ccflags -o try $ldflags try.c $libs -shift -$cat >try.msg <<'EOM' -I've tried to compile and run the following simple program: - -EOM -$cat try.c >> try.msg - -$cat >> try.msg <>try.msg 2>&1; then - if sh -c './try' >>try.msg 2>&1; then - xxx=`./try` - case "$xxx" in - "Ok") dflt=n ;; - *) echo 'The program compiled OK, but produced no output.' >> try.msg - case " $libs " in - *" -lsfio "*) - cat >> try.msg <<'EOQS' -If $libs contains -lsfio, and sfio is mis-configured, then it -sometimes (apparently) runs and exits with a 0 status, but with no -output! It may have to do with sfio's use of _exit vs. exit. - -EOQS - rp="You have a big problem. Shall I abort Configure" - dflt=y - ;; - esac - ;; +echo "Checking for optional libraries..." >&4 +case "$libs" in +' '|'') dflt='';; +*) dflt="$libs";; +esac +case "$libswanted" in +'') libswanted='c_s';; +esac +case "$usesocks" in +"$define") libswanted="$libswanted socks5 socks5_sh" ;; +esac +libsfound='' +libsfiles='' +libsdirs='' +libspath='' +for thisdir in $libpth $xlibpth; do + test -d $thisdir && libspath="$libspath $thisdir" +done +for thislib in $libswanted; do + for thisdir in $libspath; do + xxx='' + if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then + xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1` + $test -f "$xxx" && eval $libscheck + $test -f "$xxx" && libstyle=shared + fi + if test ! -f "$xxx"; then + xxx=$thisdir/lib$thislib.$so + $test -f "$xxx" && eval $libscheck + $test -f "$xxx" && libstyle=shared + fi + if test ! -f "$xxx"; then + xxx=$thisdir/lib$thislib$_a + $test -f "$xxx" && eval $libscheck + $test -f "$xxx" && libstyle=static + fi + if test ! -f "$xxx"; then + xxx=$thisdir/$thislib$_a + $test -f "$xxx" && eval $libscheck + $test -f "$xxx" && libstyle=static + fi + if test ! -f "$xxx"; then + xxx=$thisdir/lib${thislib}_s$_a + $test -f "$xxx" && eval $libscheck + $test -f "$xxx" && libstyle=static + $test -f "$xxx" && thislib=${thislib}_s + fi + if test ! -f "$xxx"; then + xxx=$thisdir/Slib$thislib$_a + $test -f "$xxx" && eval $libscheck + $test -f "$xxx" && libstyle=static + fi + if $test -f "$xxx"; then + case "$libstyle" in + shared) echo "Found -l$thislib (shared)." ;; + static) echo "Found -l$thislib." ;; + *) echo "Found -l$thislib ($libstyle)." ;; esac - else - echo "The program compiled OK, but exited with status $?." >>try.msg - rp="You have a problem. Shall I abort Configure" - dflt=y + case " $dflt " in + *"-l$thislib "*);; + *) dflt="$dflt -l$thislib" + libsfound="$libsfound $xxx" + yyy=`basename $xxx` + libsfiles="$libsfiles $yyy" + yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"` + case " $libsdirs " in + *" $yyy "*) ;; + *) libsdirs="$libsdirs $yyy" ;; + esac + ;; + esac + break + fi + done + if $test ! -f "$xxx"; then + echo "No -l$thislib." fi -else - echo "I can't compile the test program." >>try.msg - rp="You have a BIG problem. Shall I abort Configure" - dflt=y -fi +done +set X $dflt +shift +dflt="$*" +case "$libs" in +'') dflt="$dflt";; +*) dflt="$libs";; +esac case "$dflt" in -y) - $cat try.msg >&4 - case "$knowitall" in - '') - echo "(The supplied flags or libraries might be incorrect.)" - ;; - *) dflt=n;; - esac - echo " " - . ./myread - case "$ans" in - n*|N*) ;; - *) echo "Ok. Stopping Configure." >&4 - exit 1 - ;; - esac - ;; -n) echo "OK, that should do.";; +' '|'') dflt='none';; esac -$rm -f try try.* core - -: define an is-a-typedef? function -typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; -case "$inclist" in -"") inclist="sys/types.h";; -esac; -eval "varval=\$$var"; -case "$varval" in -"") - $rm -f temp.c; - for inc in $inclist; do - echo "#include <$inc>" >>temp.c; - done; - echo "#ifdef $type" >> temp.c; - echo "printf(\"We have $type\");" >> temp.c; - echo "#endif" >> temp.c; - $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null; - if $contains $type temp.E >/dev/null 2>&1; then - eval "$var=\$type"; - else - eval "$var=\$def"; - fi; - $rm -f temp.?;; -*) eval "$var=\$varval";; -esac' -: define an is-a-typedef? function that prompts if the type is not available. -typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; -case "$inclist" in -"") inclist="sys/types.h";; -esac; -eval "varval=\$$var"; -case "$varval" in -"") - $rm -f temp.c; - for inc in $inclist; do - echo "#include <$inc>" >>temp.c; - done; - echo "#ifdef $type" >> temp.c; - echo "printf(\"We have $type\");" >> temp.c; - echo "#endif" >> temp.c; - $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null; - echo " " ; - echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./"; - if $contains $type temp.E >/dev/null 2>&1; then - echo "$type found." >&4; - eval "$var=\$type"; - else - echo "$type NOT found." >&4; - dflt="$def"; - . ./myread ; - eval "$var=\$ans"; - fi; - $rm -f temp.?;; -*) eval "$var=\$varval";; -esac' +$cat <&4 - $cat >intsize.c <<'EOCP' -#include -int main() -{ - printf("intsize=%d;\n", (int)sizeof(int)); - printf("longsize=%d;\n", (int)sizeof(long)); - printf("shortsize=%d;\n", (int)sizeof(short)); - exit(0); -} -EOCP - set intsize - if eval $compile_ok && ./intsize > /dev/null; then - eval `./intsize` - echo "Your integers are $intsize bytes long." - echo "Your long integers are $longsize bytes long." - echo "Your short integers are $shortsize bytes long." - else - $cat >&4 <&4 -$cat >try.c < -#include -int main() -{ - printf("%d\n", (int)sizeof($lseektype)); - return(0); -} -EOCP -set try -if eval $compile_ok; then - lseeksize=`./try` - echo "Your file offsets are $lseeksize bytes long." -else - dflt=$longsize - echo " " - echo "(I can't seem to compile the test program. Guessing...)" - rp="What is the size of your file offsets (in bytes)?" - . ./myread - lseeksize="$ans" -fi -$rm -f try.c try - -: see what type file positions are declared as in the library -rp="What is the type for file position used by fsetpos()?" -set fpos_t fpostype long stdio.h sys/types.h -eval $typedef_ask +By default, $package compiles with the -O flag to use the optimizer. +Alternately, you might want to use the symbolic debugger, which uses +the -g flag (on traditional Unix systems). Either flag can be +specified here. To use neither flag, specify the word "none". -echo " " -case "$fpostype" in -*_t) zzz="$fpostype" ;; -*) zzz="fpos_t" ;; +EOH +rp="What optimizer/debugger flag should be used?" +. ./myread +optimize="$ans" +case "$optimize" in +'none') optimize=" ";; esac -echo "Checking the size of $zzz..." >&4 -cat > try.c < -#include -int main() { - printf("%d\n", (int)sizeof($fpostype)); - exit(0); -} -EOCP -set try -if eval $compile_ok; then - yyy=`./try` - case "$yyy" in - '') fpossize=4 - echo "(I can't execute the test program--guessing $fpossize.)" >&4 + +dflt='' +: 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' ;; + esac + case "$optimize" in + *-g*) dflt="$dflt -DDEBUGGING";; + esac + case "$gccversion" in + 2*) if test -d /etc/conf/kconfig.d && + $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1 + then + dflt="$dflt -posix" + fi ;; - *) fpossize=$yyy - echo "Your $zzz is $fpossize bytes long." + esac + case "$gccversion" in + 1*) ;; + 2.[0-8]*) ;; + ?*) echo " " + echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1 + echo 'int main(void) { return 0; }' > gcctest.c + if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then + echo "Yes, it does." 2>&1 + case "$ccflags" in + *strict-aliasing*) + echo "Leaving current flags $ccflags alone." 2>&1 + ;; + *) dflt="$dflt -fno-strict-aliasing" ;; + esac + else + echo "Nope, it doesn't, but that's ok." 2>&1 + fi ;; esac -else - dflt="$longsize" - echo " " >&4 - echo "(I can't compile the test program. Guessing...)" >&4 - rp="What is the size of your file positions (in bytes)?" - . ./myread - fpossize="$ans" -fi - - - -# Backward compatibility (uselfs is deprecated). -case "$uselfs" in -"$define"|true|[yY]*) - cat <&4 - -*** Configure -Duselfs is deprecated, using -Duselargefiles instead. -EOM - uselargefiles="$define" ;; -esac - -case "$lseeksize:$fpossize" in -8:8) cat <&4 - $cat >try.c < -#include -int main() -{ - printf("%d\n", (int)sizeof($lseektype)); - return(0); -} -EOCP - set try - if eval $compile_ok; then - lseeksize=`./try` - $echo "Your file offsets are now $lseeksize bytes long." - else - dflt="$lseeksize" - echo " " - echo "(I can't seem to compile the test program. Guessing...)" - rp="What is the size of your file offsets (in bytes)?" - . ./myread - lseeksize="$ans" - fi - case "$fpostype" in - *_t) zzz="$fpostype" ;; - *) zzz="fpos_t" ;; - esac - $echo $n "Rechecking the size of $zzz...$c" >&4 - $cat > try.c < -#include -int main() { - printf("%d\n", (int)sizeof($fpostype)); - exit(0); -} -EOCP - set try - if eval $compile_ok; then - yyy=`./try` - dflt="$lseeksize" - case "$yyy" in - '') echo " " - echo "(I can't execute the test program--guessing $fpossize.)" >&4 - ;; - *) fpossize=$yyy - echo " $fpossize bytes." >&4 - ;; +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 ";; esac - else - dflt="$fpossize" - echo " " - echo "(I can't compile the test program. Guessing...)" >&4 - rp="What is the size of your file positions (in bytes)?" - . ./myread - fpossize="$ans" fi - $rm -f try.c try fi - ;; -esac +done +inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then + xxx=true; +elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then + xxx=true; +else + xxx=false; +fi; +if $xxx; then + case "$dflt" in + *$2*);; + *) dflt="$dflt -D$2";; + esac; +fi' -case "$usemorebits" in -"$define"|true|[yY]*) - use64bitint="$define" - uselongdouble="$define" - usemorebits="$define" - ;; -*) usemorebits="$undef" +set signal.h LANGUAGE_C; eval $inctest + +case "$usesocks" in +$define) + ccflags="$ccflags -DSOCKS" ;; esac +case "$hint" in +default|recommended) dflt="$ccflags $dflt" ;; +*) dflt="$ccflags";; +esac -case "$uselonglong" in -"$define"|true|[yY]*) - cat <&4 +case "$dflt" in +''|' ') dflt=none;; +esac -*** Configure -Duselonglong is deprecated, using -Duse64bitint instead. -EOM - use64bitint="$define" - ;; -esac -case "$use64bits" in -"$define"|true|[yY]*) - cat <&4 +$cat <&4 +Your C compiler may want other flags. For this question you should include +-I/whatever and -DWHATEVER flags and any other flags used by the C compiler, +but you should NOT include libraries or ld flags like -lwhatever. If you +want $package to honor its debug switch, you should include -DDEBUGGING here. +Your C compiler might also need additional flags, such as -D_POSIX_SOURCE. -*** There is no Configure -Duse64bitints, using -Duse64bitint instead. -EOM - use64bitint="$define" - ;; -esac -case "$use64bitsint" in -"$define"|true|[yY]*) - cat <&4 +To use no flags, specify the word "none". -*** There is no Configure -Duse64bitsint, using -Duse64bitint instead. -EOM - use64bitint="$define" - ;; -esac -case "$uselonglongs" in -"$define"|true|[yY]*) - cat <&4 +EOH +set X $dflt +shift +dflt=${1+"$@"} +rp="Any additional cc flags?" +. ./myread +case "$ans" in +none) ccflags='';; +*) ccflags="$ans";; +esac -*** There is no Configure -Duselonglongs, using -Duse64bitint instead. -EOM - use64bitint="$define" - ;; -esac -case "$use64bitsall" in -"$define"|true|[yY]*) - cat <&4 +: the following weeds options from ccflags that are of no interest to cpp +cppflags="$ccflags" +case "$gccversion" in +1*) cppflags="$cppflags -D__GNUC__" +esac +case "$mips_type" in +'');; +*BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";; +esac +case "$cppflags" in +'');; +*) + echo " " + echo "Let me guess what the preprocessor flags are..." >&4 + set X $cppflags + shift + cppflags='' + $cat >cpp.c <<'EOM' +#define BLURFL foo -*** There is no Configure -Duse64bitsall, using -Duse64bitall instead. +BLURFL xx LFRULB EOM - use64bitall="$define" + previous='' + for flag in $* + do + case "$flag" in + -*) ftry="$flag";; + *) ftry="$previous $flag";; + esac + if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus cpp1.out 2>/dev/null && \ + $cpprun -DLFRULB=bar $cppflags $ftry $cpplast cpp2.out 2>/dev/null && \ + $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \ + $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1 + then + cppflags="$cppflags $ftry" + previous='' + else + previous="$flag" + fi + done + set X $cppflags + shift + cppflags=${1+"$@"} + case "$cppflags" in + *-*) echo "They appear to be: $cppflags";; + esac + $rm -f cpp.c cpp?.out ;; -esac - -case "$ccflags" in -*-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";; esac -case "$use64bitall" in -"$define"|true|[yY]*) use64bitint="$define" ;; + +: flags used in final linking phase +case "$ldflags" in +'') if ./venix; then + dflt='-i -z' + else + dflt='' + fi + case "$ccflags" in + *-posix*) dflt="$dflt -posix" ;; + esac + ;; +*) dflt="$ldflags";; esac -case "$longsize" in -8) cat <&4 +$cat > try.c <<'EOF' +#include +int main() { printf("Ok\n"); exit(0); } +EOF +set X $cc -o try $optimize $ccflags $ldflags try.c $libs +shift +$cat >try.msg <<'EOM' +I've tried to compile and run the following simple program: -Since you have chosen a maximally 64-bit build, I'm also turning on -the use of 64-bit integers. EOM - use64bitint="$define" ;; - esac - ;; -esac +$cat try.c >> try.msg -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 - case "$longsize" in - 4) case "$archname64" in - '') archname64=64int ;; - esac - ;; - esac - ;; -esac +$cat >> try.msg < tmparch 2>&1 ; then - tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \ - -e 's/$/'"-$osname/" tmparch` - else - tarch="$osname" - fi - $rm -f tmparch + $* + ./try + +and I got the following output: + +EOM +dflt=y +if sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then + if sh -c './try' >>try.msg 2>&1; then + xxx=`./try` + case "$xxx" in + "Ok") dflt=n ;; + *) echo 'The program compiled OK, but produced no output.' >> try.msg + case " $libs " in + *" -lsfio "*) + cat >> try.msg <<'EOQS' +If $libs contains -lsfio, and sfio is mis-configured, then it +sometimes (apparently) runs and exits with a 0 status, but with no +output! It may have to do with sfio's use of _exit vs. exit. + +EOQS + rp="You have a big problem. Shall I abort Configure" + dflt=y + ;; + esac + ;; + esac + else + echo "The program compiled OK, but exited with status $?." >>try.msg + rp="You have a problem. Shall I abort Configure" + dflt=y + fi else - tarch="$osname" + echo "I can't compile the test program." >>try.msg + rp="You have a BIG problem. Shall I abort Configure" + dflt=y fi -case "$myarchname" in -''|"$tarch") ;; -*) - echo "(Your architecture name used to be $myarchname.)" - archname='' - ;; -esac -myarchname="$tarch" -case "$archname" in -'') dflt="$tarch";; -*) dflt="$archname";; -esac -rp='What is your architecture name' -. ./myread -archname="$ans" -case "$usethreads" in -$define) - echo "Threads selected." >&4 - case "$archname" in - *-thread*) echo "...and architecture name already has -thread." >&4 - ;; - *) archname="$archname-thread" - echo "...setting architecture name to $archname." >&4 - ;; - esac - ;; -esac -case "$usemultiplicity" in -$define) - echo "Multiplicity selected." >&4 - case "$archname" in - *-multi*) echo "...and architecture name already has -multi." >&4 - ;; - *) archname="$archname-multi" - echo "...setting architecture name to $archname." >&4 - ;; - esac - ;; -esac -case "$use64bitint" in -$define) - case "$archname64" in +case "$dflt" in +y) + $cat try.msg >&4 + case "$knowitall" in '') + echo "(The supplied flags or libraries might be incorrect.)" ;; - *) - case "$archname" in - *-$archname64*) echo "...and architecture name already has $archname64." >&4 - ;; - *) archname="$archname-$archname64" - echo "...setting architecture name to $archname." >&4 - ;; - esac + *) dflt=n;; + esac + echo " " + . ./myread + case "$ans" in + n*|N*) ;; + *) echo "Ok. Stopping Configure." >&4 + exit 1 ;; esac -esac - -: determine root of directory hierarchy where package will be installed. -case "$prefix" in -'') - dflt=`./loc . /usr/local /usr/local /local /opt /usr` - ;; -*) - dflt="$prefix" ;; +n) echo "OK, that should do.";; esac -$cat <&4 + $cat >intsize.c <<'EOCP' +#include +int main() +{ + printf("intsize=%d;\n", (int)sizeof(int)); + printf("longsize=%d;\n", (int)sizeof(long)); + printf("shortsize=%d;\n", (int)sizeof(short)); + exit(0); +} +EOCP + set intsize + if eval $compile_ok && ./intsize > /dev/null; then + eval `./intsize` + echo "Your integers are $intsize bytes long." + echo "Your long integers are $longsize bytes long." + echo "Your short integers are $shortsize bytes long." else - afs=false + $cat >&4 <&4 -else - echo "AFS does not seem to be running..." >&4 -fi +$rm -f intsize intsize.* -: determine installation prefix for where package is to be installed. -if $afs; then -$cat <&4 +$cat >try.c < +#include +int main() +{ + printf("%d\n", (int)sizeof($lseektype)); + return(0); +} +EOCP +set try +if eval $compile_ok; then + lseeksize=`./try` + echo "Your file offsets are $lseeksize bytes long." else -$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` -else - revision=0 - patchlevel=0 - subversion=0 - api_revision=0 - api_version=0 - api_subversion=0 -fi -$echo $n "(You have $package revision $revision" $c -$echo $n " patchlevel $patchlevel" $c -test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c -echo ".)" -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 }'` - ;; +case "$fpostype" in +*_t) zzz="$fpostype" ;; +*) zzz="fpos_t" ;; 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 - -: determine installation style -: For now, try to deduce it from prefix unless it is already set. -: Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7. -case "$installstyle" in -'') case "$prefix" in - *perl*) dflt='lib';; - *) dflt='lib/perl5' ;; +echo "Checking the size of $zzz..." >&4 +cat > try.c < +#include +int main() { + printf("%d\n", (int)sizeof($fpostype)); + exit(0); +} +EOCP +set try +if eval $compile_ok; then + yyy=`./try` + case "$yyy" in + '') fpossize=4 + echo "(I can't execute the test program--guessing $fpossize.)" >&4 + ;; + *) fpossize=$yyy + echo "Your $zzz is $fpossize bytes long." + ;; esac - ;; -*) dflt='lib/perl5' ;; -esac -: Probably not worth prompting for this since we prompt for all -: the directories individually, and the prompt would be too long and -: confusing anyway. -installstyle=$dflt - -: determine where private library files go -: Usual default is /usr/local/lib/perl5/$version. -: Also allow things like /opt/perl/lib/$version, since -: /opt/perl/lib/perl5... would be redundant. -: The default "style" setting is made in installstyle.U -case "$installstyle" in -*lib/perl5*) set dflt privlib lib/$package/$version ;; -*) set dflt privlib lib/$version ;; -esac -eval $prefixit -$cat <&4 + echo "(I can't compile the test program. Guessing...)" >&4 + rp="What is the size of your file positions (in bytes)?" + . ./myread + fpossize="$ans" fi -: set the prefixup variable, to restore leading tilda escape -prefixup='case "$prefixexp" in -"$prefix") ;; -*) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";; -esac' -: determine where public architecture dependent libraries go -set archlib archlib -eval $prefixit -: privlib default is /usr/local/lib/$package/$version -: archlib default is /usr/local/lib/$package/$version/$archname -: privlib may have an optional trailing /share. -tdflt=`echo $privlib | $sed 's,/share$,,'` -tdflt=$tdflt/$archname -case "$archlib" in -'') dflt=$tdflt - ;; -*) dflt="$archlib" - ;; -esac -$cat <&4 +*** Configure -Duselfs is deprecated, using -Duselargefiles instead. EOM -fn=d+~ -rp='Where do you want to put the public architecture-dependent libraries?' -. ./getfile -archlib="$ans" -archlibexp="$ansexp" -if $test X"$archlib" = X"$privlib"; then - d_archlib="$undef" -else - d_archlib="$define" -fi -: Change installation prefix, if necessary. -if $test X"$prefix" != X"$installprefix"; then - installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"` -else - installarchlib="$archlibexp" -fi + uselargefiles="$define" + ;; +esac +case "$lseeksize:$fpossize" in +8:8) cat <&4 + $cat >try.c < +#include +int main() +{ + printf("%d\n", (int)sizeof($lseektype)); + return(0); +} +EOCP + set try + if eval $compile_ok; then + lseeksize=`./try` + $echo "Your file offsets are now $lseeksize bytes long." + else + dflt="$lseeksize" + echo " " + echo "(I can't seem to compile the test program. Guessing...)" + rp="What is the size of your file offsets (in bytes)?" + . ./myread + lseeksize="$ans" + fi + case "$fpostype" in + *_t) zzz="$fpostype" ;; + *) zzz="fpos_t" ;; + esac + $echo $n "Rechecking the size of $zzz...$c" >&4 + $cat > try.c < +#include +int main() { + printf("%d\n", (int)sizeof($fpostype)); + exit(0); +} +EOCP + set try + if eval $compile_ok; then + yyy=`./try` + dflt="$lseeksize" + case "$yyy" in + '') echo " " + echo "(I can't execute the test program--guessing $fpossize.)" >&4 + ;; + *) fpossize=$yyy + echo " $fpossize bytes." >&4 + ;; + esac + else + dflt="$fpossize" + echo " " + echo "(I can't compile the test program. Guessing...)" >&4 + rp="What is the size of your file positions (in bytes)?" + . ./myread + fpossize="$ans" + fi + $rm -f try.c try + fi ;; esac -: see if setuid scripts can be secure -$cat <&4 +*** Configure -Duselonglong is deprecated, using -Duse64bitint instead. EOM + use64bitint="$define" + ;; +esac +case "$use64bits" in +"$define"|true|[yY]*) + cat <&4 -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" - else - $cat <&4 +*** There is no Configure -Duse64bitints, using -Duse64bitint instead. EOM - rp='Other username to test security of setuid scripts with?' - dflt='none' - . ./myread - case "$ans" in - n|none) - case "$d_suidsafe" in - '') echo "I'll assume setuid scripts are *not* secure." >&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 + use64bitint="$define" + ;; +esac +case "$use64bitsint" in +"$define"|true|[yY]*) + cat <&4 -$rm -f reflect flect +*** There is no Configure -Duse64bitsint, using -Duse64bitint instead. +EOM + use64bitint="$define" + ;; +esac +case "$uselonglongs" in +"$define"|true|[yY]*) + cat <&4 -: 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 +*** There is no Configure -Duselonglongs, using -Duse64bitint instead. +EOM + use64bitint="$define" ;; -*) - $cat <&4 +*** There is no Configure -Duse64bitsall, using -Duse64bitall instead. EOM - case "$d_dosuid" in - "$define") dflt=y ;; - *) dflt=n ;; - esac - rp="Do you want to do setuid/setgid emulation?" - . ./myread - case "$ans" in - [yY]*) val="$define";; - *) val="$undef";; - esac + use64bitall="$define" ;; +esac + +case "$ccflags" in +*-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";; +esac +case "$use64bitall" in +"$define"|true|[yY]*) use64bitint="$define" ;; esac -set d_dosuid -eval $setvar -: determine filename position in cpp output -echo " " -echo "Computing filename position in cpp output for #include directives..." >&4 -echo '#include ' > foo.c -$cat >fieldn </dev/null | \ -$grep '^[ ]*#.*stdio\.h' | \ -while read cline; do - pos=1 - set \$cline - while $test \$# -gt 0; do - if $test -r \`echo \$1 | $tr -d '"'\`; then - echo "\$pos" - exit 0 - fi - shift - pos=\`expr \$pos + 1\` - done -done -EOF -chmod +x fieldn -fieldn=`./fieldn` -$rm -f foo.c fieldn -case $fieldn in -'') pos='???';; -1) pos=first;; -2) pos=second;; -3) pos=third;; -*) pos="${fieldn}th";; -esac -echo "Your cpp writes the filename in the $pos field of the line." +case "$longsize" in +8) cat <findhdr <" > foo\$\$.c -$cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \ -$grep "^[ ]*#.*\$wanted" | \ -while read cline; do - name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\` - case "\$name" in - *[/\\\\]\$wanted) echo "\$name"; exit 1;; - *[\\\\/]\$wanted) echo "\$name"; exit 1;; - *) exit 2;; - esac; -done; -# -# status = 0: grep returned 0 lines, case statement not executed -# status = 1: headerfile found -# status = 2: while loop executed, no headerfile found -# -status=\$? -$rm -f foo\$\$.c; -if test \$status -eq 1; then - exit 0; -fi -exit 1 -EOF -chmod +x findhdr +You have natively 64-bit long integers. +EOM + val="$define" + ;; +*) case "$use64bitint" in + "$define"|true|[yY]*) dflt='y';; + *) dflt='n';; + esac + cat <&4 - set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'` - shift - libs="$*" - echo "libs = $libs" >&4 - ;; +[yY]*) val="$define" ;; +*) val="$undef" ;; +esac +set use64bitall +eval $setvar +case "$use64bitall" in +"$define") + case "$use64bitint" in + "$undef") + cat <malloc.c < -#include -#ifdef I_MALLOC -#include -#endif -#ifdef I_STDLIB -#include -#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 *' +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 + case "$longsize" in + 4) case "$archname64" in + '') archname64=64int ;; + esac + ;; + esac ;; 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' +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 + case "$longsize" in + 4) case "$archname64" in + ''|64int) archname64=64all ;; + esac + ;; + esac ;; esac -echo "Your system uses $freetype free(), it would seem." >&4 -$rm -f malloc.[co] -$cat <&4 -$cat >prototype.c <<'EOCP' -int main(int argc, char *argv[]) { - exit(0);} -EOCP -if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then - echo "Your C compiler appears to support function prototypes." +echo "Checking for GNU C Library..." >&4 +cat >gnulibc.c < +int main() +{ +#ifdef __GLIBC__ + exit(0); +#else + exit(1); +#endif +} +EOM +set gnulibc +if eval $compile_ok && ./gnulibc; then val="$define" + echo "You are using the GNU C Library" else - echo "Your C compiler doesn't seem to understand function prototypes." val="$undef" + echo "You are not using the GNU C Library" fi -set prototype +$rm -f gnulibc* +set d_gnulibc eval $setvar -$rm -f prototype* - -case "$prototype" in -"$define") ;; -*) ansi2knr='ansi2knr' - echo " " - cat <&4 - -$me: FATAL ERROR: -This version of $package can only be compiled by a compiler that -understands function prototypes. Unfortunately, your C compiler - $cc $ccflags -doesn't seem to understand them. Sorry about that. - -If GNU cc is available for your system, perhaps you could try that instead. - -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 - -: 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 -: Find perl5.005 or later. -echo "Looking for a previously installed perl5.005 or later... " -case "$perl5" in -'') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do - : Check if this perl is recent and can load a simple module - if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then - perl5=$tdir/perl - break; - elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then - perl5=$tdir/perl - break; +: see if nm is to be used to determine whether a symbol is defined or not +case "$usenm" in +'') + dflt='' + case "$d_gnulibc" in + "$define") + echo " " + echo "nm probably won't work on the GNU C Library." >&4 + dflt=n + ;; + esac + case "$dflt" in + '') + if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then + echo " " + echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4 + echo "'nm' won't be sufficient on this sytem." >&4 + dflt=n fi - done + ;; + esac + case "$dflt" in + '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null` + if $test $dflt -gt 20; then + dflt=y + else + dflt=n + fi + ;; + esac ;; -*) perl5="$perl5" +*) + case "$usenm" in + true|$define) dflt=y;; + *) dflt=n;; + esac ;; 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=(); -$stem=dirname($sitelib); -# 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, "$d/$archname", $d); - } - elsif ($d ge "5.005") { - unshift(@inc_version_list, $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"; then - dflt=`$perl5 getverlist` - else - dflt='none' - fi - ;; -$undef) dflt='none' ;; -*) dflt="$inc_version_list" ;; -esac -case "$dflt" in -''|' ') dflt=none ;; -esac -$cat <<'EOM' - -In order to ease the process of upgrading, this version of perl -can be configured to use modules built and installed with earlier -versions of perl that were installed under $prefix. Specify here -the list of earlier versions that this version of perl should check. -If Configure detected no earlier versions of perl installed under -$prefix, then the list will be empty. Answer 'none' to tell perl -to not search earlier versions. - -The default should almost always be sensible, so if you're not sure, -just accept the default. -EOM - -rp='List of earlier versions to include in @INC?' -. ./myread -case "$ans" in -[Nn]one|''|' ') inc_version_list=' ' ;; -*) inc_version_list="$ans" ;; -esac -case "$inc_version_list" in -''|' ') - inc_version_list_init='0';; -*) inc_version_list_init=`echo $inc_version_list | - $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'` - ;; -esac -$rm -f getverlist - -: determine whether to install perl also as /usr/bin/perl - -echo " " -if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then - $cat <&4 -cat >gnulibc.c < -int main() -{ -#ifdef __GLIBC__ - exit(0); -#else - exit(1); -#endif -} -EOM -set gnulibc -if eval $compile_ok && ./gnulibc; then - val="$define" - echo "You are using the GNU C Library" -else - val="$undef" - echo "You are not using the GNU C Library" -fi -$rm -f gnulibc* -set d_gnulibc -eval $setvar - -: see if nm is to be used to determine whether a symbol is defined or not -case "$usenm" in -'') - dflt='' - case "$d_gnulibc" in - "$define") - echo " " - echo "nm probably won't work on the GNU C Library." >&4 - dflt=n - ;; - esac - case "$dflt" in - '') - if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then - echo " " - echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4 - echo "'nm' won't be sufficient on this sytem." >&4 - dflt=n - fi - ;; - esac - case "$dflt" in - '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null` - if $test $dflt -gt 20; then - dflt=y - else - dflt=n - fi - ;; - esac - ;; -*) - case "$usenm" in - true|$define) dflt=y;; - *) dflt=n;; - esac - ;; -esac -$cat <&4 + +*** You requested the use of long doubles but you do not seem to have +*** the mathematic functions for long doubles. I'm disabling the use +*** of long doubles. + +EOM + uselongdouble=$undef + ;; +esac + +: check for length of double +echo " " +case "$doublesize" in +'') + echo "Checking to see how big your double precision numbers are..." >&4 + $cat >try.c <<'EOCP' +#include +int main() +{ + printf("%d\n", (int)sizeof(double)); + exit(0); +} +EOCP + set try + if eval $compile_ok; then + doublesize=`./try` + echo "Your double is $doublesize bytes long." + else + dflt='8' + echo "(I can't seem to compile the test program. Guessing...)" + rp="What is the size of a double precision number (in bytes)?" + . ./myread + doublesize="$ans" + fi + ;; +esac +$rm -f try.c try + +: check for long doubles +echo " " +echo "Checking to see if you have long double..." >&4 +echo 'int main() { long double x = 7.0; }' > try.c +set try +if eval $compile; then + val="$define" + echo "You have long double." +else + val="$undef" + echo "You do not have long double." +fi +$rm try.* +set d_longdbl +eval $setvar + +: check for length of long double +case "${d_longdbl}${longdblsize}" in +$define) + echo " " + echo "Checking to see how big your long doubles are..." >&4 + $cat >try.c <<'EOCP' +#include +int main() +{ + printf("%d\n", sizeof(long double)); +} +EOCP + set try + set try + if eval $compile; then + longdblsize=`./try$exe_ext` + echo "Your long doubles are $longdblsize bytes long." + else + dflt='8' + echo " " + echo "(I can't seem to compile the test program. Guessing...)" >&4 + rp="What is the size of a long double (in bytes)?" + . ./myread + longdblsize="$ans" + fi + if $test "X$doublesize" = "X$longdblsize"; then + echo "(That isn't any different from an ordinary double.)" + fi + ;; +esac +$rm -f try.* try + +: determine the architecture name +echo " " +if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then + tarch=`arch`"-$osname" +elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then + if uname -m > tmparch 2>&1 ; then + tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \ + -e 's/$/'"-$osname/" tmparch` + else + tarch="$osname" + fi + $rm -f tmparch +else + tarch="$osname" +fi +case "$myarchname" in +''|"$tarch") ;; +*) + echo "(Your architecture name used to be $myarchname.)" + archname='' + ;; +esac +myarchname="$tarch" +case "$archname" in +'') dflt="$tarch";; +*) dflt="$archname";; +esac +rp='What is your architecture name' +. ./myread +archname="$ans" +case "$usethreads" in +$define) + echo "Threads selected." >&4 + case "$archname" in + *-thread*) echo "...and architecture name already has -thread." >&4 + ;; + *) archname="$archname-thread" + echo "...setting architecture name to $archname." >&4 + ;; + esac + ;; +esac +case "$usemultiplicity" in +$define) + echo "Multiplicity selected." >&4 + case "$archname" in + *-multi*) echo "...and architecture name already has -multi." >&4 + ;; + *) archname="$archname-multi" + echo "...setting architecture name to $archname." >&4 + ;; + esac + ;; +esac +case "$use64bitint$use64bitall" in +*"$define"*) + case "$archname64" in + '') + echo "This architecture is naturally 64-bit, not changing architecture name." >&4 + ;; + *) + case "$use64bitint" in + "$define") echo "64 bit integers selected." >&4 ;; + esac + case "$use64bitall" in + "$define") echo "Maximal 64 bitness selected." >&4 ;; + esac + case "$archname" in + *-$archname64*) echo "...and architecture name already has $archname64." >&4 + ;; + *) archname="$archname-$archname64" + echo "...setting architecture name to $archname." >&4 + ;; + esac + ;; + esac +esac +case "$uselongdouble" in +$define) + echo "Long doubles selected." >&4 + case "$longdblsize" in + $doublesize) + "...but long doubles are equal to doubles, not changing architecture name." >&4 + ;; + *) + case "$archname" in + *-ld*) echo "...and architecture name already has -ld." >&4 + ;; + *) archname="$archname-ld" + echo "...setting architecture name to $archname." >&4 + ;; + esac + ;; + esac + ;; +esac + +: determine root of directory hierarchy where package will be installed. +case "$prefix" in +'') + dflt=`./loc . /usr/local /usr/local /local /opt /usr` + ;; +*) + 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` +else + revision=0 + patchlevel=0 + subversion=0 + api_revision=0 + api_version=0 + api_subversion=0 +fi +$echo "(You have $package version $patchlevel subversion $subversion.)" +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 + +: determine installation style +: For now, try to deduce it from prefix unless it is already set. +: Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7. +case "$installstyle" in +'') case "$prefix" in + *perl*) dflt='lib';; + *) dflt='lib/perl5' ;; + esac + ;; +*) dflt="$installstyle" ;; +esac +: Probably not worth prompting for this since we prompt for all +: the directories individually, and the prompt would be too long and +: confusing anyway. +installstyle=$dflt + +: determine where private library files go +: Usual default is /usr/local/lib/perl5/$version. +: Also allow things like /opt/perl/lib/$version, since +: /opt/perl/lib/perl5... would be redundant. +: The default "style" setting is made in installstyle.U +case "$installstyle" in +*lib/perl5*) set dflt privlib lib/$package/$version ;; +*) set dflt privlib lib/$version ;; +esac +eval $prefixit +$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 <&4 +echo '#include ' > foo.c +$cat >fieldn </dev/null | \ +$grep '^[ ]*#.*stdio\.h' | \ +while read cline; do + pos=1 + set \$cline + while $test \$# -gt 0; do + if $test -r \`echo \$1 | $tr -d '"'\`; then + echo "\$pos" + exit 0 + fi + shift + pos=\`expr \$pos + 1\` + done +done +EOF +chmod +x fieldn +fieldn=`./fieldn` +$rm -f foo.c fieldn +case $fieldn in +'') pos='???';; +1) pos=first;; +2) pos=second;; +3) pos=third;; +*) pos="${fieldn}th";; +esac +echo "Your cpp writes the filename in the $pos field of the line." + +: locate header file +$cat >findhdr <" > foo\$\$.c +$cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \ +$grep "^[ ]*#.*\$wanted" | \ +while read cline; do + name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\` + case "\$name" in + *[/\\\\]\$wanted) echo "\$name"; exit 1;; + *[\\\\/]\$wanted) echo "\$name"; exit 1;; + *) exit 2;; + esac; +done; +# +# status = 0: grep returned 0 lines, case statement not executed +# status = 1: headerfile found +# status = 2: while loop executed, no headerfile found +# +status=\$? +$rm -f foo\$\$.c; +if test \$status -eq 1; then + exit 0; +fi +exit 1 +EOF +chmod +x findhdr + +: define an alternate in-header-list? function +inhdr='echo " "; td=$define; tu=$undef; yyy=$@; +cont=true; xxf="echo \"<\$1> found.\" >&4"; +case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";; +*) xxnf="echo \"<\$1> NOT found, ...\" >&4";; +esac; +case $# in 4) instead=instead;; *) instead="at last";; esac; +while $test "$cont"; do + xxx=`./findhdr $1` + var=$2; eval "was=\$$2"; + if $test "$xxx" && $test -r "$xxx"; + then eval $xxf; + eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td"; + cont=""; + else eval $xxnf; + eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi; + set $yyy; shift; shift; yyy=$@; + case $# in 0) cont="";; + 2) xxf="echo \"but I found <\$1> $instead.\" >&4"; + xxnf="echo \"and I did not find <\$1> either.\" >&4";; + *) xxf="echo \"but I found <\$1\> instead.\" >&4"; + xxnf="echo \"there is no <\$1>, ...\" >&4";; + esac; +done; +while $test "$yyy"; +do set $yyy; var=$2; eval "was=\$$2"; + eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; + set $yyy; shift; shift; yyy=$@; +done' + +: see if this is a malloc.h system +set malloc.h i_malloc +eval $inhdr + +: see if stdlib is available +set stdlib.h i_stdlib +eval $inhdr + +: determine which malloc to compile in +echo " " +case "$usemymalloc" in +''|[yY]*|true|$define) dflt='y' ;; +*) dflt='n' ;; +esac +rp="Do you wish to attempt to use the malloc that comes with $package?" +. ./myread +usemymalloc="$ans" +case "$ans" in +y*|true) + usemymalloc='y' + mallocsrc='malloc.c' + mallocobj="malloc$_o" + d_mymalloc="$define" + case "$libs" in + *-lmalloc*) + : Remove malloc from list of libraries to use + echo "Removing unneeded -lmalloc from library list" >&4 + set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'` + shift + libs="$*" + echo "libs = $libs" >&4 + ;; + esac + ;; +*) + usemymalloc='n' + mallocsrc='' + mallocobj='' + d_mymalloc="$undef" + ;; +esac + +: compute the return types of malloc and free +echo " " +$cat >malloc.c < +#include +#ifdef I_MALLOC +#include +#endif +#ifdef I_STDLIB +#include +#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 <&4 +$cat >prototype.c <<'EOCP' +int main(int argc, char *argv[]) { + exit(0);} +EOCP +if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then + echo "Your C compiler appears to support function prototypes." + val="$define" +else + echo "Your C compiler doesn't seem to understand function prototypes." + val="$undef" +fi +set prototype +eval $setvar +$rm -f prototype* + +case "$prototype" in +"$define") ;; +*) ansi2knr='ansi2knr' + echo " " + cat <&4 + +$me: FATAL ERROR: +This version of $package can only be compiled by a compiler that +understands function prototypes. Unfortunately, your C compiler + $cc $ccflags +doesn't seem to understand them. Sorry about that. + +If GNU cc is available for your system, perhaps you could try that instead. + +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 + +: 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 + +: Find perl5.005 or later. +echo "Looking for a previously installed perl5.005 or later... " +case "$perl5" in +'') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do + : Check if this perl is recent and can load a simple module + if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then + perl5=$tdir/perl + break; + elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then + perl5=$tdir/perl + 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"; then + dflt=`$perl5 getverlist` + else + dflt='none' + fi + ;; +$undef) dflt='none' ;; +*) dflt="$inc_version_list" ;; +esac +case "$dflt" in +''|' ') dflt=none ;; +esac +case "$dflt" in +5.005) case "$bincompat5005" in + $define|true|[yY]*) ;; + *) dflt=none ;; + esac + ;; +esac +$cat <<'EOM' + +In order to ease the process of upgrading, this version of perl +can be configured to use modules built and installed with earlier +versions of perl that were installed under $prefix. Specify here +the list of earlier versions that this version of perl should check. +If Configure detected no earlier versions of perl installed under +$prefix, then the list will be empty. Answer 'none' to tell perl +to not search earlier versions. + +The default should almost always be sensible, so if you're not sure, +just accept the default. +EOM + +rp='List of earlier versions to include in @INC?' +. ./myread +case "$ans" in +[Nn]one|''|' ') inc_version_list=' ' ;; +*) inc_version_list="$ans" ;; +esac +case "$inc_version_list" in +''|' ') + inc_version_list_init='0';; +*) inc_version_list_init=`echo $inc_version_list | + $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'` + ;; +esac +$rm -f getverlist + +: determine whether to install perl also as /usr/bin/perl + +echo " " +if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then + $cat <&4 <&4 +else + echo "Could not find manual pages in source form." >&4 +fi + : determine where manual pages go set man1dir man1dir none eval $prefixit @@ -6577,46 +6841,26 @@ esac : see if we can have long filenames echo " " -rmlist="$rmlist /tmp/cf$$" -$test -d /tmp/cf$$ || mkdir /tmp/cf$$ first=123456789abcdef -second=/tmp/cf$$/$first -$rm -f $first $second +$rm -f $first if (echo hi >$first) 2>/dev/null; then if $test -f 123456789abcde; then echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4 val="$undef" else - if (echo hi >$second) 2>/dev/null; then - if $test -f /tmp/cf$$/123456789abcde; then - $cat <<'EOM' -That's peculiar... You can have filenames longer than 14 characters, but only -on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems -I shall consider your system cannot support long filenames at all. -EOM - val="$undef" - else - echo 'You can have filenames longer than 14 characters.' >&4 - val="$define" - fi - else - $cat <<'EOM' -How confusing! Some of your filesystems are sane enough to allow filenames -longer than 14 characters but some others like /tmp can't even think about them. -So, for now on, I shall assume your kernel does not allow them at all. -EOM - val="$undef" - fi + echo 'You can have filenames longer than 14 characters.'>&4 + val="$define" fi else $cat <<'EOM' -You can't have filenames longer than 14 chars. You can't even think about them! +You can't have filenames longer than 14 chars. +You can't even think about them! EOM val="$undef" fi set d_flexfnam eval $setvar -$rm -rf /tmp/cf$$ 123456789abcde* +$rm -rf 123456789abcde* : determine where library module manual pages go set man3dir man3dir none @@ -6649,7 +6893,7 @@ esac echo "If you don't want the manual sources installed, answer 'none'." prog=`echo $package | $sed 's/-*[0-9.]*$//'` case "$man3dir" in -'') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` +'') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` if $test -d "$privlib/man/man3"; then cat <&4 @@ -6667,16 +6911,18 @@ EOM esac fi ;; -' ') dflt=none;; *) dflt="$man3dir" ;; esac +case "$dflt" in +' ') dflt=none ;; +esac echo " " fn=dn+~ rp="Where do the $package library man pages (source) go?" . ./getfile man3dir="$ans" man3direxp="$ansexp" -case "$man1dir" in +case "$man3dir" in '') man3dir=' ' installman3dir='';; esac @@ -6875,18 +7121,23 @@ case "$myhostname" in /[ ]$myhostname[ . ]/p" > hosts } tmp_re="[ . ]" - $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ } + if $test -f hosts; then + $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ } END { print sum }" hosts` = x1 || tmp_re="[ ]" - dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \ - hosts | $sort | $uniq | \ - $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"` - case `$echo X$dflt` in - X*\ *) echo "(Several hosts in /etc/hosts matched hostname)" + dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \ + hosts | $sort | $uniq | \ + $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"` + case `$echo X$dflt` in + X*\ *) echo "(Several hosts in the database matched hostname)" + dflt=. + ;; + X.) echo "(You do not have fully-qualified names in the hosts database)" + ;; + esac + else + echo "(I cannot locate a hosts database anywhere)" dflt=. - ;; - X.) echo "(You do not have fully-qualified names in /etc/hosts)" - ;; - esac + fi case "$dflt" in .) tans=`./loc resolv.conf X /etc /usr/etc` @@ -7002,7 +7253,7 @@ $cat <&4 - -*** You requested the use of long doubles but you do not seem to have -*** the mathematic functions for long doubles. I'm disabling the use -*** of long doubles. - -EOM - uselongdouble=$undef - ;; -esac - case "$useperlio" in $define|true|[yY]*) dflt='y';; *) dflt='n';; @@ -7253,117 +7412,60 @@ y|Y) val="$define" ;; *) - echo "Ok, doing things the stdio way" - val="$undef" - ;; -esac -set useperlio -eval $setvar - -case "$vendorprefix" in -'') d_vendorbin="$undef" - vendorbin='' - vendorbinexp='' - ;; -*) d_vendorbin="$define" - : determine where vendor-supplied executables go. - case "$vendorbin" in - '') dflt=$vendorprefix/bin ;; - *) dflt="$vendorbin" ;; - esac - fn=d~+ - rp='Pathname for the vendor-supplied executables directory?' - . ./getfile - vendorbin="$ans" - 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 - -: see if qgcvt exists -set qgcvt d_qgcvt -eval $inlibc - -: check for length of double -echo " " -case "$doublesize" in -'') - echo "Checking to see how big your double precision numbers are..." >&4 - $cat >try.c <<'EOCP' -#include -int main() -{ - printf("%d\n", (int)sizeof(double)); - exit(0); -} -EOCP - set try - if eval $compile_ok; then - doublesize=`./try` - echo "Your double is $doublesize bytes long." - else - dflt='8' - echo "(I can't seem to compile the test program. Guessing...)" - rp="What is the size of a double precision number (in bytes)?" - . ./myread - doublesize="$ans" - fi - ;; -esac -$rm -f try.c try - -: check for long doubles -echo " " -echo "Checking to see if you have long double..." >&4 -echo 'int main() { long double x = 7.0; }' > try.c -set try -if eval $compile; then - val="$define" - echo "You have long double." -else - val="$undef" - echo "You do not have long double." -fi -$rm try.* -set d_longdbl -eval $setvar - -: check for length of long double -case "${d_longdbl}${longdblsize}" in -$define) - echo " " - echo "Checking to see how big your long doubles are..." >&4 - $cat >try.c <<'EOCP' -#include -int main() -{ - printf("%d\n", sizeof(long double)); -} -EOCP - set try - set try - if eval $compile; then - longdblsize=`./try$exe_ext` - echo "Your long doubles are $longdblsize bytes long." - else - dflt='8' - echo " " - echo "(I can't seem to compile the test program. Guessing...)" >&4 - rp="What is the size of a long double (in bytes)?" - . ./myread - longdblsize="$ans" - fi - if $test "X$doublesize" = "X$longdblsize"; then - echo "(That isn't any different from an ordinary double.)" - fi + echo "Ok, doing things the stdio way" + val="$undef" ;; esac -$rm -f try.* try +set useperlio +eval $setvar + +case "$vendorprefix" in +'') d_vendorbin="$undef" + vendorbin='' + vendorbinexp='' + ;; +*) d_vendorbin="$define" + : determine where vendor-supplied executables go. + case "$vendorbin" in + '') dflt=$vendorprefix/bin ;; + *) dflt="$vendorbin" ;; + esac + fn=d~+ + rp='Pathname for the vendor-supplied executables directory?' + . ./getfile + vendorbin="$ans" + 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 + +: determine whether to only install version-specific parts. +echo " " +$cat <&4 +else + sSCNfldbl=$sPRIfldbl # expect consistency fi $rm -f try try.* @@ -7469,28 +7573,29 @@ fi # d_longdbl case "$sPRIfldbl" in '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef"; - d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef"; + d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef"; + d_SCNfldbl="$undef"; ;; *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define"; - d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define"; + d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define"; + d_SCNfldbl="$define"; ;; esac : Check how to convert floats to strings. -if test "X$d_Gconvert" = X; then - echo " " - echo "Checking for an efficient way to convert floats to strings." - echo " " > try.c - case "$uselongdouble" in - "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;; - esac - case "$d_longdbl" in - "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;; - esac - case "$d_PRIgldbl" in - "$define") echo "#define HAS_PRIgldbl" >>try.c ;; - esac - $cat >>try.c < try.c +case "$uselongdouble" in +"$define") echo "#define USE_LONG_DOUBLE" >>try.c ;; +esac +case "$d_longdbl" in +"$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;; +esac +case "$d_PRIgldbl" in +"$define") echo "#define HAS_PRIgldbl" >>try.c ;; +esac +$cat >>try.c <&4 - if ./try; then - echo "I'll use $xxx_convert to convert floats into a string." >&4 - break; - else - echo "...But $xxx_convert didn't work as I expected." - fi +for xxx_convert in $xxx_list; do + echo "Trying $xxx_convert..." + $rm -f try try$_o + set try -DTRY_$xxx_convert + if eval $compile; then + echo "$xxx_convert() found." >&4 + if ./try; then + echo "I'll use $xxx_convert to convert floats into a string." >&4 + break; else - echo "$xxx_convert NOT found." >&4 + echo "...But $xxx_convert didn't work as I expected." fi - done - - case "$xxx_convert" in - gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;; - gcvt) d_Gconvert='gcvt((x),(n),(b))' ;; - qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;; - *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in - "$define$define$define") - d_Gconvert="sprintf((b),\"%.*$sPRIgldbl\",(n),(x))" ;; - *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;; - esac - ;; - esac -fi + else + echo "$xxx_convert NOT found." >&4 + fi +done + +case "$xxx_convert" in +gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;; +gcvt) d_Gconvert='gcvt((x),(n),(b))' ;; +qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;; +*) case "$uselongdouble$d_longdbl$d_PRIgldbl" in + "$define$define$define") + d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;; + *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;; + esac + ;; +esac : Initialize h_fcntl h_fcntl=false @@ -7660,15 +7774,15 @@ int main() { EOCP : check sys/file.h first, no particular reason here if $test `./findhdr sys/file.h` && \ - $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then + $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then h_sysfile=true; echo " defines the *_OK access constants." >&4 elif $test `./findhdr fcntl.h` && \ - $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then + $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then h_fcntl=true; echo " defines the *_OK access constants." >&4 elif $test `./findhdr unistd.h` && \ - $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then + $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then echo " defines the *_OK access constants." >&4 else echo "I can't find the four *_OK access constants--I'll use mine." >&4 @@ -7758,10 +7872,10 @@ int main() exit(1); } EOP - if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then + if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then echo "You have to use getpgrp(pid) instead of getpgrp()." >&4 val="$define" - elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then + elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then echo "You have to use getpgrp() instead of getpgrp(pid)." >&4 val="$undef" else @@ -7820,10 +7934,10 @@ int main() exit(1); } EOP - if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then + if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4 val="$define" - elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then + elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4 val="$undef" else @@ -8375,8 +8489,8 @@ EOM : Call the object file tmp-dyna.o in case dlext=o. if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 && mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 && - $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 && - $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then + $ld -o dyna.$dlext $lddlflags tmp-dyna${_o} > /dev/null 2>&1 && + $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then xxx=`./fred` case $xxx in 1) echo "Test program failed using dlopen." >&4 @@ -8455,10 +8569,6 @@ eval $inlibc set endservent d_endsent eval $inlibc -: see if endspent exists -set endspent d_endspent -eval $inlibc - : Locate the flags for 'open()' echo " " $cat >open3.c <<'EOCP' @@ -8597,7 +8707,8 @@ extern int errno; #ifdef I_UNISTD #include #endif -#ifdef $i_string +#$i_string I_STRING +#ifdef I_STRING #include #else #include @@ -9037,6 +9148,10 @@ $rm -f try.* try set d_fpos64_t eval $setvar +: see if frexpl exists +set frexpl d_frexpl +eval $inlibc + hasstruct='varname=$1; struct=$2; shift; shift; while $test $# -ge 2; do case "$1" in @@ -9114,6 +9229,10 @@ esac set getcwd d_getcwd eval $inlibc +: see if getespwnam exists +set getespwnam d_getespwnam +eval $inlibc + : see if getfsstat exists set getfsstat d_getfsstat @@ -9292,6 +9411,10 @@ echo " " set d_getprotoprotos getprotoent $i_netdb netdb.h eval $hasproto +: see if getprpwnam exists +set getprpwnam d_getprpwnam +eval $inlibc + : see if getpwent exists set getpwent d_getpwent eval $inlibc @@ -9314,10 +9437,6 @@ echo " " set d_getservprotos getservent $i_netdb netdb.h eval $hasproto -: see if getspent exists -set getspent d_getspent -eval $inlibc - : see if getspnam exists set getspnam d_getspnam eval $inlibc @@ -9527,6 +9646,14 @@ set d_isascii eval $setvar $rm -f isascii* +: see if isnan exists +set isnan d_isnan +eval $inlibc + +: see if isnanl exists +set isnanl d_isnanl +eval $inlibc + : see if killpg exists set killpg d_killpg eval $inlibc @@ -9609,7 +9736,7 @@ echo 'int main() { long long x = 7; return 0; }' > try.c set try if eval $compile; then val="$define" - echo "You have have long long." + echo "You have long long." else val="$undef" echo "You do not have long long." @@ -9746,6 +9873,10 @@ esac +: see if modfl exists +set modfl d_modfl +eval $inlibc + : see if mprotect exists set mprotect d_mprotect eval $inlibc @@ -10115,6 +10246,38 @@ esac $rm -f try.* try +case "$d_nv_preserves_uv" in +"$define") d_nv_preserves_uv_bits=`expr $uvsize \* 8` ;; +*) $echo "Checking how many bits of your UVs your NVs can preserve..." >&4 + $cat <try.c +#include +int main() { + $uvtype u = 0; + int n = 8 * $uvsize; + int i; + for (i = 0; i < n; i++) { + u = u << 1 | ($uvtype)1; + if (($uvtype)($nvtype)u != u) + break; + } + printf("%d\n", i); + exit(0); +} +EOP + set try + if eval $compile; then + d_nv_preserves_uv_bits="`./try$exe_ext`" + fi + case "$d_nv_preserves_uv_bits" in + [1-9]*) $echo "Your NVs can preserve $d_nv_preserves_uv_bits bits of your UVs." 2>&1 ;; + *) $echo "Can't figure out how many bits your NVs preserve." 2>&1 + d_nv_preserves_uv_bits="$undef" + ;; + esac + $rm -f try.* try + ;; +esac + : check for off64_t echo " " @@ -10909,6 +11072,10 @@ eval $inlibc set setpriority d_setprior eval $inlibc +: see if setproctitle exists +set setproctitle d_setproctitle +eval $inlibc + : see if setpwent exists set setpwent d_setpwent eval $inlibc @@ -10941,10 +11108,6 @@ eval $inlibc set setsid d_setsid eval $inlibc -: see if setspent exists -set setspent d_setspent -eval $inlibc - : see if setvbuf exists set setvbuf d_setvbuf eval $inlibc @@ -10973,10 +11136,19 @@ $define) *) dflt='n';; esac echo "$package can use the sfio library, but it is experimental." + case "$useperlio" in + "$undef") + echo "For sfio also the PerlIO abstraction layer is needed." + echo "Earlier you said you wouldn't want that." + ;; + esac rp="You seem to have sfio available, do you want to try using it?" . ./myread case "$ans" in - y|Y) ;; + y|Y) echo "Ok, turning on both sfio and PerlIO, then." + useperlio="$define" + val="$define" + ;; *) echo "Ok, avoiding sfio this time. I'll use stdio instead." val="$undef" : Remove sfio from list of libraries to use @@ -10989,8 +11161,9 @@ $define) ;; *) case "$usesfio" in true|$define|[yY]*) - echo "Sorry, cannot find sfio on this machine" >&4 - echo "Ignoring your setting of usesfio=$usesfio" >&4 + echo "Sorry, cannot find sfio on this machine." >&4 + echo "Ignoring your setting of usesfio=$usesfio." >&4 + val="$undef" ;; esac ;; @@ -11159,6 +11332,10 @@ set d_sigsetjmp eval $setvar $rm -f try.c try +: see if socks5_init exists +set socks5_init d_socks5_init +eval $inlibc + : see if sys/stat.h is available set sys/stat.h i_sysstat eval $inhdr @@ -11455,6 +11632,61 @@ eval $inlibc set strtoll d_strtoll eval $inlibc +case "$d_longlong-$d_strtoll" in +"$define-$define") + $cat <try.c <<'EOCP' +#include +#ifdef __hpux +#define strtoll __strtoll +#endif +#ifdef __EMX__ +#define strtoll _strtoll +#endif +#include +extern long long int strtoll(char *s, char **, int); +static int bad = 0; +int check(char *s, long long ell, int een) { + long long gll; + errno = 0; + gll = strtoll(s, 0, 10); + if (!((gll == ell) && (errno == een))) + bad++; +} +int main() { + check(" 1", 1LL, 0); + check(" 0", 0LL, 0); + check("-1", -1LL, 0); + check("-9223372036854775808", -9223372036854775808LL, 0); + check("-9223372036854775808", -9223372036854775808LL, 0); + check(" 9223372036854775807", 9223372036854775807LL, 0); + check("-9223372036854775808", -9223372036854775808LL, 0); + check(" 9223372036854775808", 9223372036854775807LL, ERANGE); + check("-9223372036854775809", -9223372036854775808LL, ERANGE); + if (!bad) + printf("ok\n"); +} +EOCP + set try + if eval $compile; then + yyy=`./try` + case "$yyy" in + ok) echo "Your strtoll() seems to be working okay." ;; + *) cat <&4 +Your strtoll() doesn't seem to be working okay. +EOM + d_strtoll="$undef" + ;; + esac + else + echo "(I can't seem to compile the test program--assuming it doesn't)" + d_strtoll="$undef" + fi + ;; +esac + : see if strtoul exists set strtoul d_strtoul eval $inlibc @@ -11463,6 +11695,49 @@ eval $inlibc set strtoull d_strtoull eval $inlibc +case "$d_longlong-$d_strtoull" in +"$define-$define") + $cat <try.c <<'EOCP' +#include +#ifdef __hpux +#define strtoull __strtoull +#endif +#include +extern unsigned long long int strtoull(char *s, char **, int); +static int bad = 0; +int check(char *s, long long eull, int een) { + long long gull; + errno = 0; + gull = strtoull(s, 0, 10); + if (!((gull == eull) && (errno == een))) + bad++; +} +int main() { + check(" 1", 1LL, 0); + check(" 0", 0LL, 0); + check("18446744073709551615", 18446744073709551615ULL, 0); + check("18446744073709551616", 18446744073709551615ULL, ERANGE); + if (!bad) + printf("ok\n"); +} +EOCP + set try + if eval $compile; then + case "`./try`" in + ok) echo "Your strtoull() seems to be working okay." ;; + *) cat <&4 +Your strtoull() doesn't seem to be working okay. +EOM + d_strtoull="$undef" + ;; + esac + fi + ;; +esac + : see if strtouq exists set strtouq d_strtouq eval $inlibc @@ -12296,14 +12571,14 @@ val=$undef set tebcdic if eval $compile_ok; then if ./tebcdic; then - echo "You have EBCDIC." >&4 + echo "You seem to speak EBCDIC." >&4 val="$define" else - echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4 + echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4 fi else echo "I'm unable to compile the test program." >&4 - echo "I'll assume ASCII or some ISO Latin." >&4 + echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4 fi $rm -f tebcdic.c tebcdic set ebcdic @@ -12423,9 +12698,52 @@ EOM $rm -f core try.core core.try.* case "$fflushNULL" in x) $cat >&4 <tryp.c < +int +main(int argc, char **argv) +{ + char buf[1024]; + int i; + char *bp = buf; + while (1) { + while ((i = getc(stdin)) != -1 + && (*bp++ = i) != '\n' + && bp < &buf[1024]) + /* DO NOTHING */ ; + *bp = '\0'; + fprintf(stdout, "%s", buf); + fflush(NULL); + if (i == -1) + return 0; + bp = buf; + } +} +EOCP + fflushNULL="$define" + set tryp + if eval $compile; then + $rm -f tryp.out + $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out + if cmp tryp.c tryp.out >/dev/null 2>&1; then + $cat >&4 <&4 <&4 <&4 <tryp.c < +int +main(int argc, char **argv) +{ + char buf[1024]; + int i; + char *bp = buf; + while (1) { + while ((i = getc(stdin)) != -1 + && (*bp++ = i) != '\n' + && bp < &buf[1024]) + /* DO NOTHING */ ; + *bp = '\0'; + fprintf(stdout, "%s", buf); + fflush(stdin); + if (i == -1) + return 0; + bp = buf; + } +} +EOCP + set tryp + if eval $compile; then + $rm -f tryp.out + $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out + if cmp tryp.c tryp.out >/dev/null 2>&1; then + $cat >&4 </dev/null - if $test -s try.out -a "X$?" = X42; then - fflushall="`$cat try.out`" - fi - fi - $rm -f core try.core core.try.* + : now check for fflushall behaviour case "$fflushall" in - x) $cat >&4 <&4 </dev/null + if $test -s try.out -a "X$?" = X42; then + fflushall="`$cat try.out`" + fi + fi + $rm -f core try.core core.try.* + case "$fflushall" in + x) $cat >&4 <&4 <&4 <&4 <&4 <&4 < #include int main() { - long long q = 12345678901LL; /* AIX cc requires the LL prefix. */ + long long q = 12345678901LL; /* AIX cc requires the LL suffix. */ printf("%lld\n", q); } EOCP @@ -12692,7 +13053,7 @@ EOCP case "$yyy" in 12345678901) sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"'; - sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"'; + sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"'; echo "We will use the %lld style." ;; esac @@ -12714,7 +13075,7 @@ EOCP case "$yyy" in 12345678901) sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"'; - sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"'; + sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"'; echo "We will use %Ld." ;; esac @@ -12736,7 +13097,7 @@ EOCP case "$yyy" in 12345678901) sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"'; - sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"'; + sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"'; echo "We will use %qd." ;; esac @@ -12753,10 +13114,10 @@ fi case "$sPRId64" in '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef"; - d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$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_PRIX64="$define"; + d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define"; ;; esac @@ -12769,18 +13130,21 @@ if $test X"$ivsize" = X8; then uvuformat="$sPRIu64" uvoformat="$sPRIo64" uvxformat="$sPRIx64" + uvXUformat="$sPRIXU64" else if $test X"$ivsize" = X"$longsize"; then ivdformat='"ld"' uvuformat='"lu"' uvoformat='"lo"' uvxformat='"lx"' + uvXUformat='"lX"' else if $test X"$ivsize" = X"$intsize"; then ivdformat='"d"' uvuformat='"u"' uvoformat='"o"' uvxformat='"x"' + uvXUformat='"X"' else : far out if $test X"$ivsize" = X"$shortsize"; then @@ -12788,11 +13152,28 @@ else uvuformat='"hu"' uvoformat='"ho"' uvxformat='"hx"' + uvXUformat='"hX"' fi fi fi fi +if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then + nveformat="$sPRIeldbl" + nvfformat="$sPRIfldbl" + nvgformat="$sPRIgldbl" + nvEUformat="$sPRIEUldbl" + nvFUformat="$sPRIFUldbl" + nvGUformat="$sPRIGUldbl" +else + nveformat='"e"' + nvfformat='"f"' + nvgformat='"g"' + nvEUformat='"E"' + nvFUformat='"F"' + nvGUformat='"G"' +fi + case "$ivdformat" in '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4 exit 1 @@ -13071,12 +13452,15 @@ case "$pager" in dflt='' case "$pg" in /*) dflt=$pg;; + [a-zA-Z]:/*) dflt=$pg;; esac case "$more" in /*) dflt=$more;; + [a-zA-Z]:/*) dflt=$more;; esac case "$less" in /*) dflt=$less;; + [a-zA-Z]:/*) dflt=$less;; esac case "$dflt" in '') dflt=/usr/ucb/more;; @@ -13149,13 +13533,13 @@ $cc $ccflags -c bar1.c >/dev/null 2>&1 $cc $ccflags -c bar2.c >/dev/null 2>&1 $cc $ccflags -c foo.c >/dev/null 2>&1 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1 -if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 && +if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 && ./foobar >/dev/null 2>&1; then echo "$ar appears to generate random libraries itself." orderlib=false ranlib=":" elif $ar ts bar$_a >/dev/null 2>&1 && - $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 && + $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 && ./foobar >/dev/null 2>&1; then echo "a table of contents needs to be added with '$ar ts'." orderlib=false @@ -13589,6 +13973,37 @@ echo $sig_name | $awk \ }' $rm -f signal signal.c signal.awk signal.lst signal_cmd +echo " " +case "$sizetype" in +*_t) zzz="$sizetype" ;; +*) zzz="filesize" ;; +esac +echo "Checking the size of $zzz..." >&4 +cat > try.c < +#include +int main() { + printf("%d\n", (int)sizeof($sizetype)); + exit(0); +} +EOCP +set try +if eval $compile_ok; then + yyy=`./try` + case "$yyy" in + '') sizesize=4 + echo "(I can't execute the test program--guessing $sizesize.)" >&4 + ;; + *) sizesize=$yyy + echo "Your $zzz size is $sizesize bytes." + ;; + esac +else + sizesize=4 + echo "(I can't compile the test program--guessing $sizesize.)" >&4 +fi + + : check for socklen_t echo " " echo "Checking to see if you have socklen_t..." >&4 @@ -13608,7 +14023,7 @@ else val="$undef" echo "You do not have socklen_t." case "$sizetype" in - size_t) echo "(You do have size_t, that might work.)" ;; + 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.* @@ -13627,7 +14042,7 @@ EOM case "$d_socklen_t" in "$define") yyy="$yyy socklen_t" esac - yyy="$yyy $sizetype int long" + yyy="$yyy $sizetype int long unsigned" for xxx in $yyy; do case "$socksizetype" in '') try="extern int accept(int, struct sockaddr *, $xxx *);" @@ -13647,8 +14062,8 @@ EOM ;; esac ;; -*) : no sockets, so pick relatively harmless defaults - socksizetype='char *' +*) : no sockets, so pick relatively harmless default + socksizetype='int' ;; esac @@ -13938,6 +14353,14 @@ eval $setvar set iconv.h i_iconv eval $inhdr +: see if this is a ieeefp.h system +set ieeefp.h i_ieeefp +eval $inhdr + +: see if this is a libutil.h system +set libutil.h i_libutil +eval $inhdr + : see if locale.h is available set locale.h i_locale eval $inhdr @@ -14017,6 +14440,10 @@ eval $inhdr set poll.h i_poll eval $inhdr +: see if this is a prot.h system +set prot.h i_prot +eval $inhdr + echo " " $echo "Guessing which symbols your C compiler and preprocessor define..." >&4 $cat <<'EOSH' > Cppsym.know @@ -14085,8 +14512,9 @@ $osname EOSH ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b -$cat Cppsym.a Cppsym.b | $tr ' ' $trnl | sort | uniq > Cppsym.know -$rm -f Cppsym.a Cppsym.b +$cat Cppsym.know > Cppsym.c +$cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | sort | uniq > Cppsym.know +$rm -f Cppsym.a Cppsym.b Cppsym.c cat < Cppsym $startsh if $test \$# -gt 0; then @@ -14125,8 +14553,9 @@ cat <> Cppsym.try ccflags="$ccflags" case "$osname-$gccversion" in irix-) ccflags="\$ccflags -woff 1178" ;; +os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;; esac -$cc $optimize \$ccflags $ldflags -o try try.c $libs && ./try$exe_ext +$cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext EOSH chmod +x Cppsym.try $eunicefix Cppsym.try @@ -14180,7 +14609,7 @@ if $test -z ccsym.raw; then else if $test -s ccsym.com; then echo "Your C compiler and pre-processor define these symbols:" - $sed -e 's/\(.*\)=.*/\1/' ccsym.com + $sed -e 's/\(..*\)=.*/\1/' ccsym.com also='also ' symbols='ones' cppccsymbols=`$cat ccsym.com` @@ -14190,7 +14619,7 @@ else if $test -s ccsym.cpp; then $test "$also" && echo " " echo "Your C pre-processor ${also}defines the following symbols:" - $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp + $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp also='further ' cppsymbols=`$cat ccsym.cpp` cppsymbols=`echo $cppsymbols` @@ -14199,14 +14628,14 @@ else if $test -s ccsym.own; then $test "$also" && echo " " echo "Your C compiler ${also}defines the following cpp symbols:" - $sed -e 's/\(.*\)=1/\1/' ccsym.own - $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true + $sed -e 's/\(..*\)=1/\1/' ccsym.own + $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true ccsymbols=`$cat ccsym.own` ccsymbols=`echo $ccsymbols` $test "$silent" || sleep 1 fi fi -$rm -f ccsym* +$rm -f ccsym* Cppsym.* : see if this is a termio system val="$undef" @@ -14588,6 +15017,12 @@ for xxx in $known_extensions ; do true|$define|y) avail_ext="$avail_ext $xxx" ;; esac ;; + Sys/Syslog|sys/syslog) + : XXX syslog requires socket + case "$d_socket" in + true|$define|y) avail_ext="$avail_ext $xxx" ;; + esac + ;; Thread|thread) case "$usethreads" in true|$define|y) avail_ext="$avail_ext $xxx" ;; @@ -14734,6 +15169,25 @@ set X $dynamic_ext $static_ext $nonxs_ext shift extensions="$*" +: Remove libraries needed only for extensions +: The appropriate ext/Foo/Makefile.PL will add them back in, if necessary. +: The exception is SunOS 4.x, which needs them. +case "${osname}X${osvers}" in +sunos*X4*) + perllibs="$libs" + ;; +*) case "$usedl" in + $define|true|[yY]*) + set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'` + shift + perllibs="$*" + ;; + *) perllibs="$libs" + ;; + esac + ;; +esac + : Remove build directory name from cppstdin so it can be used from : either the present location or the final installed location. echo " " @@ -14845,7 +15299,10 @@ cc='$cc' cccdlflags='$cccdlflags' ccdlflags='$ccdlflags' ccflags='$ccflags' +ccflags_uselargefiles='$ccflags_uselargefiles' +ccname='$ccname' ccsymbols='$ccsymbols' +ccversion='$ccversion' cf_by='$cf_by' cf_email='$cf_email' cf_time='$cf_time' @@ -14872,10 +15329,10 @@ crosscompile='$crosscompile' cryptlib='$cryptlib' csh='$csh' d_Gconvert='$d_Gconvert' -d_PRIEldbl='$d_PRIEldbl' -d_PRIFldbl='$d_PRIFldbl' -d_PRIGldbl='$d_PRIGldbl' -d_PRIX64='$d_PRIX64' +d_PRIEUldbl='$d_PRIEUldbl' +d_PRIFUldbl='$d_PRIFUldbl' +d_PRIGUldbl='$d_PRIGUldbl' +d_PRIXU64='$d_PRIXU64' d_PRId64='$d_PRId64' d_PRIeldbl='$d_PRIeldbl' d_PRIfldbl='$d_PRIfldbl' @@ -14884,6 +15341,7 @@ d_PRIi64='$d_PRIi64' d_PRIo64='$d_PRIo64' d_PRIu64='$d_PRIu64' d_PRIx64='$d_PRIx64' +d_SCNfldbl='$d_SCNfldbl' d_access='$d_access' d_accessx='$d_accessx' d_alarm='$d_alarm' @@ -14925,7 +15383,6 @@ d_endnent='$d_endnent' d_endpent='$d_endpent' d_endpwent='$d_endpwent' d_endsent='$d_endsent' -d_endspent='$d_endspent' d_eofnblk='$d_eofnblk' d_eunice='$d_eunice' d_fchmod='$d_fchmod' @@ -14940,6 +15397,7 @@ d_flock='$d_flock' d_fork='$d_fork' d_fpathconf='$d_fpathconf' d_fpos64_t='$d_fpos64_t' +d_frexpl='$d_frexpl' d_fs_data_s='$d_fs_data_s' d_fseeko='$d_fseeko' d_fsetpos='$d_fsetpos' @@ -14948,6 +15406,7 @@ d_fstatvfs='$d_fstatvfs' d_ftello='$d_ftello' d_ftime='$d_ftime' d_getcwd='$d_getcwd' +d_getespwnam='$d_getespwnam' d_getfsstat='$d_getfsstat' d_getgrent='$d_getgrent' d_getgrps='$d_getgrps' @@ -14972,12 +15431,12 @@ d_getpgrp='$d_getpgrp' d_getppid='$d_getppid' d_getprior='$d_getprior' d_getprotoprotos='$d_getprotoprotos' +d_getprpwnam='$d_getprpwnam' d_getpwent='$d_getpwent' d_getsbyname='$d_getsbyname' d_getsbyport='$d_getsbyport' d_getsent='$d_getsent' d_getservprotos='$d_getservprotos' -d_getspent='$d_getspent' d_getspnam='$d_getspnam' d_gettimeod='$d_gettimeod' d_gnulibc='$d_gnulibc' @@ -14989,6 +15448,8 @@ d_index='$d_index' d_inetaton='$d_inetaton' d_int64_t='$d_int64_t' d_isascii='$d_isascii' +d_isnan='$d_isnan' +d_isnanl='$d_isnanl' d_killpg='$d_killpg' d_lchown='$d_lchown' d_ldbl_dig='$d_ldbl_dig' @@ -15015,6 +15476,7 @@ d_mkstemp='$d_mkstemp' d_mkstemps='$d_mkstemps' d_mktime='$d_mktime' d_mmap='$d_mmap' +d_modfl='$d_modfl' d_mprotect='$d_mprotect' d_msg='$d_msg' d_msg_ctrunc='$d_msg_ctrunc' @@ -15031,6 +15493,7 @@ d_munmap='$d_munmap' d_mymalloc='$d_mymalloc' d_nice='$d_nice' d_nv_preserves_uv='$d_nv_preserves_uv' +d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits' d_off64_t='$d_off64_t' d_old_pthread_create_joinable='$d_old_pthread_create_joinable' d_oldpthreads='$d_oldpthreads' @@ -15038,6 +15501,7 @@ d_oldsock='$d_oldsock' d_open3='$d_open3' d_pathconf='$d_pathconf' d_pause='$d_pause' +d_perl_otherlibdirs='$d_perl_otherlibdirs' d_phostname='$d_phostname' d_pipe='$d_pipe' d_poll='$d_poll' @@ -15084,6 +15548,7 @@ d_setpgid='$d_setpgid' d_setpgrp2='$d_setpgrp2' d_setpgrp='$d_setpgrp' d_setprior='$d_setprior' +d_setproctitle='$d_setproctitle' d_setpwent='$d_setpwent' d_setregid='$d_setregid' d_setresgid='$d_setresgid' @@ -15093,7 +15558,6 @@ d_setrgid='$d_setrgid' d_setruid='$d_setruid' d_setsent='$d_setsent' d_setsid='$d_setsid' -d_setspent='$d_setspent' d_setvbuf='$d_setvbuf' d_sfio='$d_sfio' d_shm='$d_shm' @@ -15107,6 +15571,7 @@ d_sigsetjmp='$d_sigsetjmp' d_socket='$d_socket' d_socklen_t='$d_socklen_t' d_sockpair='$d_sockpair' +d_socks5_init='$d_socks5_init' d_sqrtl='$d_sqrtl' d_statblks='$d_statblks' d_statfs_f_flags='$d_statfs_f_flags' @@ -15149,6 +15614,7 @@ d_umask='$d_umask' d_uname='$d_uname' d_union_semun='$d_union_semun' d_ustat='$d_ustat' +d_vendorarch='$d_vendorarch' d_vendorbin='$d_vendorbin' d_vendorlib='$d_vendorlib' d_vfork='$d_vfork' @@ -15192,6 +15658,7 @@ freetype='$freetype' full_ar='$full_ar' full_csh='$full_csh' full_sed='$full_sed' +gccosandvers='$gccosandvers' gccversion='$gccversion' gidformat='$gidformat' gidsign='$gidsign' @@ -15206,7 +15673,6 @@ h_fcntl='$h_fcntl' h_sysfile='$h_sysfile' hint='$hint' hostcat='$hostcat' -huge='$huge' i16size='$i16size' i16type='$i16type' i32size='$i32size' @@ -15227,7 +15693,9 @@ i_float='$i_float' i_gdbm='$i_gdbm' i_grp='$i_grp' i_iconv='$i_iconv' +i_ieeefp='$i_ieeefp' i_inttypes='$i_inttypes' +i_libutil='$i_libutil' i_limits='$i_limits' i_locale='$i_locale' i_machcthr='$i_machcthr' @@ -15241,6 +15709,7 @@ i_neterrno='$i_neterrno' i_netinettcp='$i_netinettcp' i_niin='$i_niin' i_poll='$i_poll' +i_prot='$i_prot' i_pthread='$i_pthread' i_pwd='$i_pwd' i_rpcsvcdbm='$i_rpcsvcdbm' @@ -15309,6 +15778,7 @@ installsitebin='$installsitebin' installsitelib='$installsitelib' installstyle='$installstyle' installusrbinperl='$installusrbinperl' +installvendorarch='$installvendorarch' installvendorbin='$installvendorbin' installvendorlib='$installvendorlib' intsize='$intsize' @@ -15317,10 +15787,10 @@ ivsize='$ivsize' ivtype='$ivtype' known_extensions='$known_extensions' ksh='$ksh' -large='$large' ld='$ld' lddlflags='$lddlflags' ldflags='$ldflags' +ldflags_uselargefiles='$ldflags_uselargefiles' ldlibpthname='$ldlibpthname' less='$less' lib_ext='$lib_ext' @@ -15333,6 +15803,7 @@ libsfiles='$libsfiles' libsfound='$libsfound' libspath='$libspath' libswanted='$libswanted' +libswanted_uselargefiles='$libswanted_uselargefiles' line='$line' lint='$lint' lkflags='$lkflags' @@ -15361,11 +15832,9 @@ man1ext='$man1ext' man3dir='$man3dir' man3direxp='$man3direxp' man3ext='$man3ext' -medium='$medium' mips_type='$mips_type' mkdir='$mkdir' mmaptype='$mmaptype' -models='$models' modetype='$modetype' more='$more' multiarch='$multiarch' @@ -15384,6 +15853,12 @@ nm_opt='$nm_opt' nm_so_opt='$nm_so_opt' nonxs_ext='$nonxs_ext' nroff='$nroff' +nvEUformat='$nvEUformat' +nvFUformat='$nvFUformat' +nvGUformat='$nvGUformat' +nveformat='$nveformat' +nvfformat='$nvfformat' +nvgformat='$nvgformat' nvsize='$nvsize' nvtype='$nvtype' o_nonblock='$o_nonblock' @@ -15393,6 +15868,7 @@ optimize='$optimize' orderlib='$orderlib' osname='$osname' osvers='$osvers' +otherlibdirs='$otherlibdirs' package='$package' pager='$pager' passcat='$passcat' @@ -15401,6 +15877,7 @@ path_sep='$path_sep' perl5='$perl5' perl='$perl' perladmin='$perladmin' +perllibs='$perllibs' perlpath='$perlpath' pg='$pg' phostname='$phostname' @@ -15426,10 +15903,10 @@ revision='$revision' rm='$rm' rmail='$rmail' runnm='$runnm' -sPRIEldbl='$sPRIEldbl' -sPRIFldbl='$sPRIFldbl' -sPRIGldbl='$sPRIGldbl' -sPRIX64='$sPRIX64' +sPRIEUldbl='$sPRIEUldbl' +sPRIFUldbl='$sPRIFUldbl' +sPRIGUldbl='$sPRIGUldbl' +sPRIXU64='$sPRIXU64' sPRId64='$sPRId64' sPRIeldbl='$sPRIeldbl' sPRIfldbl='$sPRIfldbl' @@ -15438,6 +15915,7 @@ sPRIi64='$sPRIi64' sPRIo64='$sPRIo64' sPRIu64='$sPRIu64' sPRIx64='$sPRIx64' +sSCNfldbl='$sSCNfldbl' sched_yield='$sched_yield' scriptdir='$scriptdir' scriptdirexp='$scriptdirexp' @@ -15464,13 +15942,14 @@ sitearchexp='$sitearchexp' sitebin='$sitebin' sitebinexp='$sitebinexp' sitelib='$sitelib' +sitelib_stem='$sitelib_stem' sitelibexp='$sitelibexp' siteprefix='$siteprefix' siteprefixexp='$siteprefixexp' +sizesize='$sizesize' sizetype='$sizetype' sleep='$sleep' smail='$smail' -small='$small' so='$so' sockethdr='$sockethdr' socketlib='$socketlib' @@ -15478,7 +15957,6 @@ socksizetype='$socksizetype' sort='$sort' spackage='$spackage' spitshell='$spitshell' -split='$split' src='$src' ssizetype='$ssizetype' startperl='$startperl' @@ -15543,18 +16021,23 @@ usevendorprefix='$usevendorprefix' usevfork='$usevfork' usrinc='$usrinc' uuname='$uuname' +uvXUformat='$uvXUformat' uvoformat='$uvoformat' uvsize='$uvsize' uvtype='$uvtype' uvuformat='$uvuformat' uvxformat='$uvxformat' +vendorarch='$vendorarch' +vendorarchexp='$vendorarchexp' vendorbin='$vendorbin' vendorbinexp='$vendorbinexp' vendorlib='$vendorlib' +vendorlib_stem='$vendorlib_stem' vendorlibexp='$vendorlibexp' vendorprefix='$vendorprefix' vendorprefixexp='$vendorprefixexp' version='$version' +versiononly='$versiononly' vi='$vi' voidflags='$voidflags' xlibpth='$xlibpth' @@ -15649,7 +16132,7 @@ EOM . UU/myread case "$ans" in y*) - $make depend && echo "Now you must run a $make." + $make depend && echo "Now you must run '$make'." ;; *) echo "You must run '$make depend' then '$make'."