X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Configure;h=f20ba17cdbc2ac761b39e45d29c68dc69aabdd44;hb=7599c0b3a5551e3249bec4cfca2a97eefbcd917f;hp=fab24d30a155ba84ed86fb94700ec35b30552f57;hpb=213c275fd042f6776d723234c5ca21e122773fd8;p=p5sagit%2Fp5-mst-13.2.git diff --git a/Configure b/Configure index fab24d3..f20ba17 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Sun Nov 7 02:39:34 EET 1999 [metaconfig 3.0 PL70] +# Generated on Tue Nov 16 23:04:27 EET 1999 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <&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 + # AIX cc -E doesn't show the absolute headerfile + # locations but we'll cheat by using the -M flag. + echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin + else + echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin + fi +else + echo "Keeping your $hint cppstdin wrapper." +fi +chmod 755 cppstdin +wrapper=`pwd`/cppstdin +ok='false' +cd UU -case "$usemorebits" in -"$define"|true|[yY]*) - use64bits="$define" - uselongdouble="$define" - usemorebits="$define" - ;; -*) usemorebits="$undef" - ;; -esac - - -cat <testcpp.out 2>&1 && \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 +then + echo "You used to use $cppstdin $cppminus so we'll use that again." + case "$cpprun" in + '') echo "But let's see if we can live without a wrapper..." ;; + *) + if $cpprun $cpplast testcpp.out 2>&1 && \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 + then + echo "(And we'll use $cpprun $cpplast to preprocess directly.)" + ok='true' + else + echo "(However, $cpprun $cpplast does not work, let's see...)" + fi + ;; + esac +else + case "$cppstdin" in + '') ;; + *) + echo "Good old $cppstdin $cppminus does not seem to be of any help..." + ;; + esac +fi -Perl can be built to understand large files (files larger than 2 gigabytes) -on some systems. To do so, Configure must be run with -Duselargefiles. +if $ok; then + : nothing +elif echo 'Maybe "'"$cc"' -E" will work...'; \ + $cc -E testcpp.out 2>&1; \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then + echo "Yup, it does." + x_cpp="$cc -E" + x_minus=''; +elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \ + $cc -E - testcpp.out 2>&1; \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then + echo "Yup, it does." + x_cpp="$cc -E" + x_minus='-'; +elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \ + $cc -P testcpp.out 2>&1; \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then + echo "Yipee, that works!" + x_cpp="$cc -P" + x_minus=''; +elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \ + $cc -P - testcpp.out 2>&1; \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then + echo "At long last!" + x_cpp="$cc -P" + x_minus='-'; +elif echo 'No such luck, maybe "'$cpp'" will work...'; \ + $cpp testcpp.out 2>&1; \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then + echo "It works!" + x_cpp="$cpp" + x_minus=''; +elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \ + $cpp - testcpp.out 2>&1; \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then + echo "Hooray, it works! I was beginning to wonder." + x_cpp="$cpp" + x_minus='-'; +elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \ + $wrapper testcpp.out 2>&1; \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then + x_cpp="$wrapper" + x_minus='' + echo "Eureka!" +else + dflt='' + rp="No dice. I can't find a C preprocessor. Name one:" + . ./myread + x_cpp="$ans" + x_minus='' + $x_cpp testcpp.out 2>&1 + if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then + echo "OK, that will do." >&4 + else +echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4 + exit 1 + fi +fi -If this doesn't make any sense to you, just accept the default. -EOM -case "$uselargefiles" in -"$define"|true|[yY]*) dflt='y' ;; -*) dflt='n' ;; -esac -rp='Try to understand large files?' -. ./myread -case "$ans" in -y|Y) val="$define" ;; -*) val="$undef" ;; -esac -set uselargefiles -eval $setvar -case "$uselargefiles" in -"$define") use64bits="$define" ;; +case "$ok" in +false) + cppstdin="$x_cpp" + cppminus="$x_minus" + cpprun="$x_cpp" + cpplast="$x_minus" + set X $x_cpp + shift + case "$1" in + "$cpp") + echo "Perhaps can we force $cc -E using a wrapper..." + if $wrapper testcpp.out 2>&1; \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 + then + echo "Yup, we can." + cppstdin="$wrapper" + cppminus=''; + else + echo "Nope, we'll have to live without it..." + fi + ;; + esac + case "$cpprun" in + "$wrapper") + cpprun='' + cpplast='' + ;; + esac + ;; esac -cat <filexp <&2 + exit 1 + fi + case "\$1" in + */*) + echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\` + ;; + *) + echo \$dir ;; esac fi ;; -esac - -: 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 "$use64bits" in -$define) - echo "Explicit 64-bitness selected." >&4 - case "$archname64" in - '') - ;; - *) - 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 - -: 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 + echo \$1 ;; esac EOSS @@ -3493,1109 +3480,1392 @@ rm -f getfile.ok test "X$gfpthkeep" != Xy && gfpth="" EOSC -: determine root of directory hierarchy where package will be installed. -case "$prefix" in -'') - dflt=`./loc . /usr/local /usr/local /local /opt /usr` +: 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" ;; -*) - dflt="$prefix" +*) usrinc="$dflt" ;; 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 - patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` - subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` - apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h` -else - patchlevel=0 - subversion=0 - apiversion=0 -fi -$echo $n "(You have $package" $c -case "$package" in -"*$baserev") ;; -*) $echo $n " $baserev" $c ;; +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 +for thislib in $libswanted; do + + if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; + $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then + echo "Found -l$thislib (shared)." + case " $dflt " in + *"-l$thislib "*);; + *) dflt="$dflt -l$thislib";; + esac + elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then + echo "Found -l$thislib (shared)." + case " $dflt " in + *"-l$thislib "*);; + *) dflt="$dflt -l$thislib";; + esac + elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then + echo "Found -l$thislib." + case " $dflt " in + *"-l$thislib "*);; + *) dflt="$dflt -l$thislib";; + esac + elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then + echo "Found -l$thislib." + case " $dflt " in + *"-l$thislib "*);; + *) dflt="$dflt -l$thislib";; + esac + elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then + echo "Found -l${thislib}_s." + case " $dflt " in + *"-l$thislib "*);; + *) dflt="$dflt -l${thislib}_s";; + esac + elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then + echo "Found -l$thislib." + case " $dflt " in + *"-l$thislib "*);; + *) dflt="$dflt -l$thislib";; + esac + else + echo "No -l$thislib." + fi +done +set X $dflt +shift +dflt="$*" +case "$libs" in +'') dflt="$dflt";; +*) dflt="$libs";; +esac +case "$dflt" in +' '|'') dflt='none';; esac -$echo $n " patchlevel $patchlevel" $c -test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c -echo ".)" -if test 0 -eq "$subversion"; then - version=`LC_ALL=C; export LC_ALL; \ - echo $baserev $patchlevel | \ - $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'` -else - version=`LC_ALL=C; export LC_ALL; \ - echo $baserev $patchlevel $subversion | \ - $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'` -fi +$cat </dev/null 2>&1 + then + dflt="$dflt -posix" + fi + ;; + 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 ;; -*) 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 ;; +case "$mips_type" in +*BSD*|'') inclwanted="$locincpth $usrinc";; +*) inclwanted="$locincpth $inclwanted $usrinc/bsd";; esac -eval $prefixit -$cat <&4 + set X $cppflags + shift + cppflags='' + $cat >cpp.c <<'EOM' +#define BLURFL foo +BLURFL xx LFRULB EOM - case "$bincompat5005$d_bincompat5005" in - *"$undef"*) dflt=n ;; - *) dflt=y ;; + 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 - rp='Binary compatibility with Perl 5.005?' - . ./myread - case "$ans" in - y*) val="$define" ;; - *) val="$undef" ;; + $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" ;; esac - set d_bincompat5005 - eval $setvar - case "$d_bincompat5005" in - "$define") - bincompat5005="$define" - ;; - *) bincompat5005="$undef" - d_bincompat5005="$undef" + ;; +*) 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 ;; esac - ;; +done + +case "$dflt" in +'') dflt='none' ;; esac +$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 -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 <> try.msg <&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 +if sh -c "$cc $optimize $ccflags -o try $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 - 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 + ;; 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 - 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" + echo "I can't compile the test program." >>try.msg + rp="You have a BIG problem. Shall I abort Configure" + dflt=y 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 + case "$knowitall" in + '') + echo "(The supplied flags or libraries might be incorrect.)" + ;; + *) dflt=n;; esac - rp="Do you want to do setuid/setgid emulation?" + echo " " . ./myread case "$ans" in - [yY]*) val="$define";; - *) val="$undef";; + n*|N*) ;; + *) echo "Ok. Stopping Configure." >&4 + exit 1 + ;; esac ;; +n) echo "OK, that should do.";; esac -set d_dosuid -eval $setvar +$rm -f try try.* core -: What should the include directory be ? +: 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' + +: define a shorthand compile call +compile=' +mc_file=$1; +shift; +$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;' +: define a shorthand compile call for compilations that should be ok. +compile_ok=' +mc_file=$1; +shift; +$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;' + +: check for lengths of integral types 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 +case "$intsize" in +'') + echo "Checking to see how big your integers are..." >&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 - 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' + 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 - mips_type='System V' + $cat >&4 <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 +$rm -f intsize intsize.* -: 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 - # AIX cc -E doesn't show the absolute headerfile - # locations but we'll cheat by using the -M flag. - echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin - else - echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin - fi -else - echo "Keeping your $hint cppstdin wrapper." -fi -chmod 755 cppstdin -wrapper=`pwd`/cppstdin -ok='false' -cd UU - -if $test "X$cppstdin" != "X" && \ - $cppstdin $cppminus testcpp.out 2>&1 && \ - $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 -then - echo "You used to use $cppstdin $cppminus so we'll use that again." - case "$cpprun" in - '') echo "But let's see if we can live without a wrapper..." ;; - *) - if $cpprun $cpplast testcpp.out 2>&1 && \ - $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 - then - echo "(And we'll use $cpprun $cpplast to preprocess directly.)" - ok='true' - else - echo "(However, $cpprun $cpplast does not work, let's see...)" - fi - ;; - esac -else - case "$cppstdin" in - '') ;; - *) - echo "Good old $cppstdin $cppminus does not seem to be of any help..." - ;; - esac -fi - -if $ok; then - : nothing -elif echo 'Maybe "'"$cc"' -E" will work...'; \ - $cc -E testcpp.out 2>&1; \ - $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Yup, it does." - x_cpp="$cc -E" - x_minus=''; -elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \ - $cc -E - testcpp.out 2>&1; \ - $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Yup, it does." - x_cpp="$cc -E" - x_minus='-'; -elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \ - $cc -P testcpp.out 2>&1; \ - $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Yipee, that works!" - x_cpp="$cc -P" - x_minus=''; -elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \ - $cc -P - testcpp.out 2>&1; \ - $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then - echo "At long last!" - x_cpp="$cc -P" - x_minus='-'; -elif echo 'No such luck, maybe "'$cpp'" will work...'; \ - $cpp testcpp.out 2>&1; \ - $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then - echo "It works!" - x_cpp="$cpp" - x_minus=''; -elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \ - $cpp - testcpp.out 2>&1; \ - $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Hooray, it works! I was beginning to wonder." - x_cpp="$cpp" - x_minus='-'; -elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \ - $wrapper testcpp.out 2>&1; \ - $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then - x_cpp="$wrapper" - x_minus='' - echo "Eureka!" +: see what type lseek is declared as in the kernel +rp="What is the type used for lseek's offset on this system?" +set off_t lseektype long stdio.h sys/types.h +eval $typedef_ask + +echo " " +$echo $n "Checking to see how big your file offsets are...$c" >&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 " $lseeksize bytes." >&4 else - dflt='' - rp="No dice. I can't find a C preprocessor. Name one:" + 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 - x_cpp="$ans" - x_minus='' - $x_cpp testcpp.out 2>&1 - if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then - echo "OK, that will do." >&4 - else -echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4 - exit 1 - fi + lseeksize="$ans" fi +$rm -f try.c try -case "$ok" in -false) - cppstdin="$x_cpp" - cppminus="$x_minus" - cpprun="$x_cpp" - cpplast="$x_minus" - set X $x_cpp - shift - case "$1" in - "$cpp") - echo "Perhaps can we force $cc -E using a wrapper..." - if $wrapper testcpp.out 2>&1; \ - $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 - then - echo "Yup, we can." - cppstdin="$wrapper" - cppminus=''; - else - echo "Nope, we'll have to live without it..." - fi +: 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 + +echo " " +case "$fpostype" in +*_t) zzz="$fpostype" ;; +*) zzz="fpos_t" ;; +esac +$echo $n "Checking 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` + case "$yyy" in + '') fpossize=4 + echo " " + echo "(I can't execute the test program--guessing $fpossize.)" >&4 ;; - esac - case "$cpprun" in - "$wrapper") - cpprun='' - cpplast='' + *) fpossize=$yyy + echo " $fpossize bytes." ;; esac - ;; -esac - -case "$cppstdin" in -"$wrapper"|'cppstdin') ;; -*) $rm -f $wrapper;; -esac -$rm -f testcpp.c testcpp.out +else + dflt="$longsize" + 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 -: 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 -: 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. +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 " $lseeksize bytes." >&4 + 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." + ;; + 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 -case "$_o" in -'') case "$obj_ext" in - '') _o='.o';; - *) _o="$obj_ext";; - esac + + +case "$usemorebits" in +"$define"|true|[yY]*) + use64bits="$define" + uselongdouble="$define" + usemorebits="$define" ;; -esac -case "$p_" in -'') case "$path_sep" in - '') p_=':';; - *) p_="$path_sep";; - esac +*) usemorebits="$undef" ;; esac -exe_ext=$_exe -lib_ext=$_a -obj_ext=$_o -path_sep=$p_ -: Which makefile gets called first. This is used by make depend. -case "$firstmakefile" in -'') firstmakefile='makefile';; -esac -cat <&4 -case "$libs" in -' '|'') dflt='';; -*) dflt="$libs";; -esac -case "$libswanted" in -'') libswanted='c_s';; -esac -case "$usesocks" in -$define) - libswanted="$libswanted socks5 socks5_sh" - ;; +case "$archname64" in +'') archname64='' ;; # not a typo esac -for thislib in $libswanted; do - - if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; - $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then - echo "Found -l$thislib (shared)." - case " $dflt " in - *"-l$thislib "*);; - *) dflt="$dflt -l$thislib";; - esac - elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then - echo "Found -l$thislib (shared)." - case " $dflt " in - *"-l$thislib "*);; - *) dflt="$dflt -l$thislib";; - esac - elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then - echo "Found -l$thislib." - case " $dflt " in - *"-l$thislib "*);; - *) dflt="$dflt -l$thislib";; - esac - elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then - echo "Found -l$thislib." - case " $dflt " in - *"-l$thislib "*);; - *) dflt="$dflt -l$thislib";; - esac - elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then - echo "Found -l${thislib}_s." - case " $dflt " in - *"-l$thislib "*);; - *) dflt="$dflt -l${thislib}_s";; - esac - elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then - echo "Found -l$thislib." - case " $dflt " in - *"-l$thislib "*);; - *) dflt="$dflt -l$thislib";; - esac + +case "$use64bits" 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 use64bits.cbu; then + echo "Your platform has some specific hints for 64-bit builds, using them..." + . ./use64bits.cbu else - echo "No -l$thislib." + $cat < 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 - -: determine optimization, if desired, or use for debug flag also -case "$optimize" in -' '|$undef) dflt='none';; -'') dflt='-O';; -*) dflt="$optimize";; +myarchname="$tarch" +case "$archname" in +'') dflt="$tarch";; +*) dflt="$archname";; esac -$cat <&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 - -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 - ;; - 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 +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 "$use64bits" in +$define) + case "$archname64" in + '') + ;; + *) + 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 "$mips_type" in -*BSD*|'') inclwanted="$locincpth $usrinc";; -*) inclwanted="$locincpth $inclwanted $usrinc/bsd";; +: 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 -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' +$cat <&4 +else + echo "AFS does not seem to be running..." >&4 +fi -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. +: determine installation prefix for where package is to be installed. +if $afs; then +$cat <&4 - set X $cppflags - shift - cppflags='' - $cat >cpp.c <<'EOM' -#define BLURFL foo +In some special cases, particularly when building $package for distribution, +it is convenient to distinguish between the directory in which files should +be installed from the directory ($prefix) in which they +will eventually reside. For most users, these two directories are the same. -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 "$installprefix" in + '') dflt=$prefix ;; + *) dflt=$installprefix;; esac - $rm -f cpp.c cpp?.out - ;; +fi +fn=d~ +rp='What installation prefix should I use for installing files?' +. ./getfile +installprefix="$ans" +installprefixexp="$ansexp" + +: set the prefixit variable, to compute a suitable default value +prefixit='case "$3" in +""|none) + case "$oldprefix" in + "") eval "$1=\"\$$2\"";; + *) + case "$3" in + "") eval "$1=";; + none) + eval "tp=\"\$$2\""; + case "$tp" in + ""|" ") eval "$1=\"\$$2\"";; + *) eval "$1=";; + esac;; + esac;; + esac;; +*) + eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\""; + case "$tp" in + --|/*--|\~*--) eval "$1=\"$prefix/$3\"";; + /*-$oldprefix/*|\~*-$oldprefix/*) + eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";; + *) eval "$1=\"\$$2\"";; + esac;; +esac' + +: set the base revision +baserev=5.0 + +: get the patchlevel +echo " " +echo "Getting the current patchlevel..." >&4 +if $test -r $rsrc/patchlevel.h;then + patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` + subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` + apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h` +else + patchlevel=0 + subversion=0 + apiversion=0 +fi +$echo $n "(You have $package" $c +case "$package" in +"*$baserev") ;; +*) $echo $n " $baserev" $c ;; esac +$echo $n " patchlevel $patchlevel" $c +test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c +echo ".)" -: 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" ;; +if test 0 -eq "$subversion"; then + version=`LC_ALL=C; export LC_ALL; \ + echo $baserev $patchlevel | \ + $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'` +else + version=`LC_ALL=C; export LC_ALL; \ + echo $baserev $patchlevel $subversion | \ + $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'` +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="$ldflags";; +*) 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 -: 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 - ;; - esac -done - -case "$dflt" in -'') dflt='none' ;; +: 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 -$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: +$spackage contains architecture-dependent library files. If you are +sharing libraries in a heterogeneous environment, you might store +these files in a separate location. Otherwise, you can just include +them with the rest of the public library files. EOM -$cat try.c >> try.msg +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 -$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 - ;; +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 + 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 - 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 - echo "I can't compile the test program." >>try.msg - rp="You have a BIG problem. Shall I abort Configure" - dflt=y + 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 -case "$dflt" in -y) - $cat try.msg >&4 - case "$knowitall" in - '') - echo "(The supplied flags or libraries might be incorrect.)" - ;; - *) dflt=n;; +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 - exit 1 - ;; + [yY]*) val="$define";; + *) val="$undef";; esac ;; -n) echo "OK, that should do.";; esac -$rm -f try try.* core +set d_dosuid +eval $setvar : determine filename position in cpp output echo " " @@ -4945,17 +5215,6 @@ fi set installusrbinperl eval $setvar -: define a shorthand compile call -compile=' -mc_file=$1; -shift; -$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;' -: define a shorthand compile call for compilations that should be ok. -compile_ok=' -mc_file=$1; -shift; -$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;' - echo " " echo "Checking for GNU C Library..." >&4 cat >gnulibc.c < hosts && \ $test -s hosts } || { + test "X$hostcat" != "X" && $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ / /[ ]$myhostname[ . ]/p" > hosts } @@ -6519,7 +6779,7 @@ siteprefixexp="$ansexp" : XXX No longer works with Prefixit stuff. prog=`echo $package | $sed 's/-*[0-9.]*$//'` case "$installstyle" in -*lib/perl5*) dflt=$siteprefix/lib/site_$prog ;; +*lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog ;; *) dflt=$siteprefix/lib/site_$prog ;; 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 < #endif #ifdef $i_string @@ -8441,128 +8656,6 @@ eval $inlibc set fpathconf d_fpathconf eval $inlibc -: 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' - -: see what type lseek is declared as in the kernel -rp="What is the type used for lseek's offset on this system?" -set off_t lseektype long stdio.h sys/types.h -eval $typedef_ask - -echo " " -$echo $n "Checking to see how big your file offsets are...$c" >&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 " $lseeksize bytes." >&4 -else - dflt='4' - 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 - -echo " " -case "$fpostype" in -*_t) zzz="$fpostype" ;; -*) zzz="fpos_t" ;; -esac -echo "Checking the size of $zzz..." >&4 -cat > try.c < -#include -int main() { - printf("%d\n", (int)sizeof($fpostype)); - return(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 size is $fpossize bytes." - ;; - esac -else - fpossize=4 - echo "(I can't compile the test program--guessing $fpossize.)" >&4 -fi - - : check for off64_t echo " " @@ -8580,7 +8673,7 @@ else val="$undef" echo "No, it doesn't." case "$lseeksize" in - 8) echo "(This is okay because your off_t is 64 bits wide.)" ;; + 8) echo "(Your off_t is 64 bits, so you could use that.)" ;; esac fi $rm -f try.* try @@ -8602,7 +8695,7 @@ else val="$undef" echo "No, it doesn't." case "$fpossize" in - 8) echo "(This is okay because your fpos_t is 64 bits wide.)" ;; + 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;; esac fi $rm -f try.* try @@ -8652,6 +8745,9 @@ esac : see if fseeko exists set fseeko d_fseeko eval $inlibc +case "$longsize" in +8) echo "(Your long is 64 bits, so in a pinch you could use fseek.)" ;; +esac : see if fsetpos exists set fsetpos d_fsetpos @@ -8675,6 +8771,9 @@ eval $inlibc : see if ftello exists set ftello d_ftello eval $inlibc +case "$longsize" in +8) echo "(Your long is 64 bits, so in a pinch you could use ftell.)" ;; +esac : see if getgrent exists set getgrent d_getgrent @@ -9033,11 +9132,9 @@ set i_inttypes eval $setvar : check for int64_t -case "$use64bits" in -"$define" ) - echo " " - $echo $n "Checking to see if your system supports int64_t...$c" >&4 - $cat >try.c <&4 +$cat >try.c < #$i_inttypes I_INTTYPES #ifdef I_INTTYPES @@ -9045,23 +9142,18 @@ case "$use64bits" in #endif int main() { int64_t x = 7; } EOCP - set try - if eval $compile; then - val="$define" - echo " Yes, it does." >&4 - else - val="$undef" - echo " No, it doesn't." >&4 - fi - $rm -f try try.* - ;; -*) val="$undef" - ;; -esac +set try +if eval $compile; then + val="$define" + echo " Yes, it does." >&4 +else + val="$undef" + echo " No, it doesn't." >&4 +fi +$rm -f try try.* set d_int64t eval $setvar - : Look for isascii echo " " $cat >isascii.c <<'EOCP' @@ -9551,7 +9643,7 @@ esac echo " " -echo "Checking which 64-bit integer type to use..." >&4 +echo "Checking which 64-bit integer type we could use..." >&4 case "$intsize" in 8) val=int @@ -9560,7 +9652,7 @@ case "$intsize" in val='"unsigned int"' set uquadtype eval $setvar - quadcase=1 + quadkind=1 ;; *) case "$longsize" in 8) val=long @@ -9569,7 +9661,7 @@ case "$intsize" in val='"unsigned long"' set uquadtype eval $setvar - quadcase=2 + quadkind=2 ;; *) case "$uselonglong:$d_longlong:$longlongsize" in define:define:8) @@ -9579,7 +9671,7 @@ case "$intsize" in val='"unsigned long long"' set uquadtype eval $setvar - quadcase=3 + quadkind=3 ;; *) case "$d_int64t" in define) @@ -9589,7 +9681,7 @@ case "$intsize" in val=uint64_t set uquadtype eval $setvar - quadcase=4 + quadkind=4 ;; esac ;; @@ -9600,10 +9692,19 @@ case "$intsize" in esac case "$quadtype" in -'') echo "Alas, no 64-bit integer types in sight." >&4 +'') case "$uselonglong:$d_longlong:$longlongsize" in + undef:define:8) + echo "(You would have 'long long', but you are not using it.)" >&4 ;; + *) echo "Alas, no 64-bit integer types in sight." >&4 ;; + esac d_quad="$undef" ;; -*) echo "Using '$quadtype' for 64-bit integers." >&4 +*) if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then + verb="will" + else + verb="could" + fi + echo "We $verb use '$quadtype' for 64-bit integers." >&4 d_quad="$define" ;; esac @@ -10330,6 +10431,8 @@ int main() struct sigaction act, oact; act.sa_flags = 0; oact.sa_handler = 0; + /* so that act and oact are used */ + exit(act.sa_flags == 0 && oact.sa_handler == 0); } EOP set try @@ -10964,6 +11067,7 @@ EOM case "$alignbytes" in '') echo "Checking alignment constraints..." >&4 $cat >try.c <<'EOCP' +#include struct foobar { char foo; double bar; @@ -11758,7 +11862,7 @@ cat > try.c < int main() { printf("%d\n", (int)sizeof($gidtype)); - return(0); + exit(0); } EOCP set try @@ -11825,7 +11929,7 @@ case "$charsize" in int main() { printf("%d\n", (int)sizeof(char)); - return(0); + exit(0); } EOCP set try @@ -12540,7 +12644,7 @@ case "$ptrsize" in int main() { printf("%d\n", (int)sizeof(VOID_PTR)); - return(0); + exit(0); } EOCP set try @@ -12753,10 +12857,17 @@ esac : Remove SIGSTKSIZE used by Linux. : Remove SIGSTKSZ used by Posix. : Remove SIGTYP void lines used by OS2. -xxx=`echo '#include ' | +if [ "X$fieldn" = X ]; then + xxx=`echo '#include ' | + $cppstdin $cppminus $cppflags 2>/dev/null | + $grep '^[ ]*#.*include' | + $sed 's!"!!g' | $sort | $uniq` +else + xxx=`echo '#include ' | $cppstdin $cppminus $cppflags 2>/dev/null | $grep '^[ ]*#.*include' | $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq` +fi : Check this list of files to be sure we have parsed the cpp output ok. : This will also avoid potentially non-existent files, such : as ../foo/bar.h @@ -12852,7 +12963,7 @@ echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk ' } END { printf "#endif /* JUST_NSIG */\n"; - printf "}\n"; + printf "exit(0);\n}\n"; } ' >>signal.c $cat >signal.awk <<'EOP' @@ -13105,7 +13216,7 @@ cat > try.c < int main() { printf("%d\n", (int)sizeof($uidtype)); - return(0); + exit(0); } EOCP set try @@ -14624,7 +14735,7 @@ privlib='$privlib' privlibexp='$privlibexp' prototype='$prototype' ptrsize='$ptrsize' -quadcase='$quadcase' +quadkind='$quadkind' quadtype='$quadtype' randbits='$randbits' randfunc='$randfunc'