X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Configure;h=a57fad1dfb1a45e61ea1ef8f81a04126e2d2c0e7;hb=ba979b3106a5e7f3b2512d1f4e93c681fba7aa9f;hp=e7d4ced8ba230b6b90110b75582e788cd252a3e6;hpb=93bc48faf83afc24e3501cff22973c0d6498c26e;p=p5sagit%2Fp5-mst-13.2.git diff --git a/Configure b/Configure index e7d4ced..a57fad1 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 Tue Jun 19 02:14:42 EET DST 2001 [metaconfig 3.0 PL70] +# Generated on Sat Jan 12 23:16:55 EET 2002 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ <&2 +'') cat >&2 </dev/null 2>&1`; then shsharp=true spitshell=cat xcat=/bin/cat - test -f $xcat || xcat=/usr/bin/cat + test -f $xcat$_exe || xcat=/usr/bin/cat + if test ! -f $xcat$_exe; then + for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do + if test -f $p/cat$_exe; then + xcat=$p/cat + break + fi + done + if test ! -f $xcat$_exe; then + echo "Can't find cat anywhere!" + exit 1 + fi + fi echo "#!$xcat" >sharp $eunicefix sharp chmod +x sharp @@ -1190,12 +1233,24 @@ config_args='$*' config_argc=$# EOSH argn=1 +args_exp='' +args_sep='' for arg in "$@"; do cat >>cmdline.opt < cmdl.opt +$arg +EOC + arg_exp=`cat cmdl.opt` + args_exp="$args_exp$args_sep'$arg_exp'" argn=`expr $argn + 1` + args_sep=' ' done +# args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@" +# used by ./hints/os2.sh +rm -f cmdl.opt : produce awk script to parse command line options cat >options.awk <<'EOF' @@ -1977,6 +2032,9 @@ for dir in \$*; do if test -f \$thisthing; then echo \$thisthing exit 0 + elif test "X$_exe" != X -a -f \$thisthing$_exe; then + echo \$thisthing + exit 0 elif test -f \$dir/\$thing.exe; then if test -n "$DJGPP"; then echo \$dir/\$thing.exe @@ -1997,13 +2055,13 @@ $eunicefix loc loclist=" awk cat +chmod comm cp echo expr grep ls -make mkdir rm sed @@ -2021,9 +2079,11 @@ cpp csh date egrep +gmake gzip less ln +make more nm nroff @@ -2048,7 +2108,7 @@ for file in $loclist; do '') xxx=`./loc $file $file $pth`;; *) xxx=`./loc $xxx $xxx $pth`;; esac - eval $file=$xxx + eval $file=$xxx$_exe eval _$file=$xxx case "$xxx" in /*) @@ -2100,12 +2160,37 @@ case "$egrep" in egrep) echo "Substituting grep for egrep." egrep=$grep + _egrep=$grep ;; esac case "$ln" in ln) echo "Substituting cp for ln." ln=$cp + _ln=$cp + ;; +esac +case "$make" in +make) + case "$gmake" in + gmake) + echo "I can't find make or gmake, and my life depends on it." >&4 + echo "Go find a public domain implementation or fix your PATH setting!" >&4 + exit 1 + ;; + esac + ;; +esac +case "$gmake" in +gmake) ;; +*) # We can't have osname yet. + if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS + # Assume that gmake, if found, is definitely GNU make + # and prefer it over the system make. + echo "Substituting gmake for make." + make=$gmake + _make=$gmake + fi ;; esac case "$test" in @@ -2230,20 +2315,43 @@ case "$lns" in echo "Checking how to test for symbolic links..." >&4 $lns blurfl sym if $test "X$issymlink" = X; then - sh -c "PATH= test -h sym" >/dev/null 2>&1 + case "$newsh" in + '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;; + *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;; + esac if test $? = 0; then issymlink="test -h" - fi - fi - if $test "X$issymlink" = X; then - if $test -h >/dev/null 2>&1; then - issymlink="$test -h" - echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4 + else + echo "Your builtin 'test -h' may be broken." >&4 + case "$test" in + /*) ;; + *) pth=`echo $PATH | sed -e "s/$p_/ /g"` + for p in $pth + do + if test -f "$p/$test"; then + test="$p/$test" + break + fi + done + ;; + esac + case "$test" in + /*) + echo "Trying external '$test -h'." >&4 + issymlink="$test -h" + if $test ! -h sym >/dev/null 2>&1; then + echo "External '$test -h' is broken, too." >&4 + issymlink='' + fi + ;; + *) issymlink='' ;; + esac fi fi if $test "X$issymlink" = X; then if $test -L sym 2>/dev/null; then issymlink="$test -L" + echo "The builtin '$test -L' worked." >&4 fi fi if $test "X$issymlink" != X; then @@ -2296,8 +2404,8 @@ $define|true|[yY]*) fi done # Sanity check 2. - if test ! -f t/base/commonsense.t; then - echo "Failed to create the symlinks. Aborting." >&4 + if test ! -f t/base/lex.t; then + echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4 exit 1 fi cd UU @@ -2323,20 +2431,20 @@ $define|true|[yY]*) nm=$targetarch-nm ranlib=$targetarch-ranlib $echo 'extern int foo;' > try.c - set X `$cc -v -E perl.c 2>&1 | $awk '/^#include &1 | $awk '/^#include &4 + incpth="`$echo $incpth|$sed 's/^ //'`" + echo "Guessing incpth '$incpth'." >&4 for i in $*; do - j=`$echo $i|$sed 's,/include$,/lib,'` + j="`$echo $i|$sed 's,/include$,/lib,'`" if $test -d $j; then libpth="$libpth $j" fi done - libpth="$echo $libpth|$sed 's/^ //'" - echo "Guessing libpth $libpth." >&4 + libpth="`$echo $libpth|$sed 's/^ //'`" + echo "Guessing libpth '$libpth'." >&4 fi $rm -f try.c ;; @@ -2347,11 +2455,11 @@ $define|true|[yY]*) esac case "$incpth" in '') echo "Incpth not defined." >&4; croak=y ;; - *) echo "Using incpth $incpth." >&4 ;; + *) echo "Using incpth '$incpth'." >&4 ;; esac case "$libpth" in '') echo "Libpth not defined." >&4; croak=y ;; - *) echo "Using libpth $libpth." >&4 ;; + *) echo "Using libpth '$libpth'." >&4 ;; esac case "$usrinc" in '') for i in $incpth; do @@ -2378,11 +2486,13 @@ $define|true|[yY]*) esac case "$src" in /*) run=$src/Cross/run + targetmkdir=$src/Cross/mkdir to=$src/Cross/to from=$src/Cross/from ;; *) pwd=`$test -f ../Configure & cd ..; pwd` run=$pwd/Cross/run + targetmkdir=$pwd/Cross/mkdir to=$pwd/Cross/to from=$pwd/Cross/from ;; @@ -2417,30 +2527,77 @@ $define|true|[yY]*) ssh|rsh) cat >$run <&4 exit 1 ;; esac + case "$targetmkdir" in + */Cross/mkdir) + cat >$targetmkdir <&4 + exit 1 + ;; + esac case "$targetto" in scp|rcp) cat >$to <$to <&4 @@ -2453,6 +2610,7 @@ EOF #!/bin/sh for f in \$@ do + $rm -f \$f $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1 done exit 0 @@ -2462,6 +2620,7 @@ EOF #!/bin/sh for f in \$@ do + $rm -f \$f cp $targetdir/\$f . || exit 1 done exit 0 @@ -2474,23 +2633,24 @@ EOF if $test ! -f $run; then echo "Target 'run' script '$run' not found." >&4 else - chmod a+rx $run + $chmod a+rx $run fi if $test ! -f $to; then echo "Target 'to' script '$to' not found." >&4 else - chmod a+rx $to + $chmod a+rx $to fi if $test ! -f $from; then echo "Target 'from' script '$from' not found." >&4 else - chmod a+rx $from + $chmod a+rx $from fi if $test ! -f $run -o ! -f $to -o ! -f $from; then exit 1 fi cat >&4 <&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!" -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 - -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 - -case "$cppstdin" in -"$wrapper"|'cppstdin') ;; -*) $rm -f $wrapper;; -esac -$rm -f testcpp.c testcpp.out : decide how portable to be. Allow command line overrides. case "$d_portable" in @@ -3921,40 +3940,188 @@ y) fn=d/ ;; esac -: 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. - -EOM -case "$libpth" in -'') dflt='none';; -*) +: 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!" +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 + +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 + +case "$cppstdin" in +"$wrapper"|'cppstdin') ;; +*) $rm -f $wrapper;; +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";; +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+"$@"} @@ -3995,7 +4162,7 @@ so="$ans" : or the new name. case "$_exe" in '') case "$exe_ext" in - '') ;; + '') ;; *) _exe="$exe_ext" ;; esac ;; @@ -4458,325 +4625,80 @@ 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.";; -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' - -: define a shorthand compile call -compile=' -mc_file=$1; -shift; -$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${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 -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;' - -: check for lengths of integral types -echo " " -case "$intsize" in -'') - echo "Checking to see how big your integers are..." >&4 - $cat >try.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 try - if eval $compile_ok && $run ./try > /dev/null; then - eval `$run ./try` - 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=`$run ./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 - -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)); - exit(0); -} -EOCP -set try -if eval $compile_ok; then - yyy=`$run ./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 -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=`$run ./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=`$run ./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 + '') + 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.";; esac +$rm -f try try.* core +: define a shorthand compile call +compile=' +mc_file=$1; +shift; +$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${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 -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;' -case "$usemorebits" in -"$define"|true|[yY]*) - use64bitint="$define" - uselongdouble="$define" - usemorebits="$define" - ;; -*) usemorebits="$undef" +: check for lengths of integral types +echo " " +case "$intsize" in +'') + echo "Checking to see how big your integers are..." >&4 + $cat >try.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 try + if eval $compile_ok && $run ./try > /dev/null; then + eval `$run ./try` + 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 +case "$osname" in +vos) testaccess=-e ;; +*) testaccess=-r ;; +esac echo '#include ' > foo.c $cat >fieldn < +*) cppfilter='' ;; +esac : locate header file $cat >findhdr <" > foo\$\$.c $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \ -$grep "^[ ]*#.*\$wanted" | \ +$cppfilter $grep "^[ ]*#.*\$wanted" | \ while read cline; do name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\` case "\$name" in @@ -5743,7 +5673,7 @@ nm_extract="$com" if $test -f /lib/syscalls.exp; then echo " " echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4 - $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list + $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list fi ;; esac @@ -6080,7 +6010,7 @@ $define) echo "Long doubles selected." >&4 case "$longdblsize" in $doublesize) - "...but long doubles are equal to doubles, not changing architecture name." >&4 + echo "...but long doubles are equal to doubles, not changing architecture name." >&4 ;; *) case "$archname" in @@ -6228,7 +6158,6 @@ prefixit='case "$3" in esac;; esac' - : get the patchlevel echo " " echo "Getting the current patchlevel..." >&4 @@ -6255,11 +6184,15 @@ if $test -r $rsrc/.patch ; then perl_patchlevel=`cat $rsrc/.patch` fi fi +: Define a handy string here to avoid duplication in myconfig.SH and configpm. +version_patchlevel_string="version $patchlevel subversion $subversion" case "$perl_patchlevel" in -0) ;; -'') $echo "(You have $package version $patchlevel subversion $subversion.)" ;; -*) $echo "(You have $package version $patchlevel subversion $subversion patchlevel $perl_patchlevel.)" ;; +0|'') ;; +*) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;; esac + +$echo "(You have $package $version_patchlevel_string.)" + case "$osname" in dos|vms) : XXX Should be a Configure test for double-dots in filenames. @@ -6492,7 +6425,7 @@ val="$undef" case "$d_suidsafe" in "$define") val="$undef" - echo "No need to emulate SUID scripts since they are secure here." >& 4 + echo "No need to emulate SUID scripts since they are secure here." >&4 ;; *) $cat < ../extras.lst + val="'$extras'" + ;; +esac +set extras +eval $setvar +echo " " + : Find perl5.005 or later. echo "Looking for a previously installed perl5.005 or later... " case "$perl5" in @@ -7158,6 +7143,7 @@ EOM esac ;; *) case "$osname" in + darwin) dflt='none' ;; svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;; *) dflt='-fpic' ;; esac ;; @@ -7248,7 +7234,7 @@ EOM esac for thisflag in $ldflags; do case "$thisflag" in - -L*|-R*) + -L*|-R*|-Wl,-R*) case " $dflt " in *" $thisflag "*) ;; *) dflt="$dflt $thisflag" ;; @@ -7457,10 +7443,10 @@ if "$useshrplib"; then aix) # We'll set it in Makefile.SH... ;; - solaris|netbsd) + solaris) xxx="-R $shrpdir" ;; - freebsd) + freebsd|netbsd) xxx="-Wl,-R$shrpdir" ;; linux|irix*|dec_osf) @@ -7518,8 +7504,9 @@ esac 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='/usr/share/man/man1 /usr/man/man1' + syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1" + syspath="$syspath /usr/man/u_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" @@ -7551,7 +7538,8 @@ case "$man1dir" in ' ') dflt=none ;; '') - lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1" + lookpath="$prefixexp/share/man/man1" + lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1" lookpath="$lookpath $prefixexp/man/p_man/man1" lookpath="$lookpath $prefixexp/man/u_man/man1" lookpath="$lookpath $prefixexp/man/man.1" @@ -7741,7 +7729,7 @@ case "$man3dir" in esac : see if we have to deal with yellow pages, now NIS. -if $test -d /usr/etc/yp || $test -d /etc/yp; then +if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then if $test -f /usr/etc/nibindd; then echo " " echo "I'm fairly confident you're on a NeXT." @@ -8110,7 +8098,10 @@ echo "I'll use $startperl to start perl scripts." : figure best path for perl in scripts case "$perlpath" in '') - perlpath="$binexp/perl" + case "$versiononly" in + "$define") perlpath="$binexp/perl$version";; + *) perlpath="$binexp/perl";; + esac case "$startperl" in *!*) ;; *) @@ -8176,22 +8167,256 @@ else installscript="$scriptdirexp" fi -: determine where add-on public executables go -case "$sitebin" in -'') dflt=$siteprefix/bin ;; -*) dflt=$sitebin ;; +: determine where add-on public executables go +case "$sitebin" in +'') dflt=$siteprefix/bin ;; +*) dflt=$sitebin ;; +esac +fn=d~ +rp='Pathname where the add-on public executables should be installed?' +. ./getfile +sitebin="$ans" +sitebinexp="$ansexp" +: Change installation prefix, if necessary. +if $test X"$prefix" != X"$installprefix"; then + installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"` +else + installsitebin="$sitebinexp" +fi + +: 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 "Checking to see how big your file offsets are..." >&4 +$cat >try.c < +#include +int main() +{ + printf("%d\n", (int)sizeof($lseektype)); + return(0); +} +EOCP +set try +if eval $compile_ok; then + lseeksize=`$run ./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 + +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)); + exit(0); +} +EOCP +set try +if eval $compile_ok; then + yyy=`$run ./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 +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=`$run ./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=`$run ./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 -fn=d~ -rp='Pathname where the add-on public executables should be installed?' -. ./getfile -sitebin="$ans" -sitebinexp="$ansexp" -: Change installation prefix, if necessary. -if $test X"$prefix" != X"$installprefix"; then - installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"` -else - installsitebin="$sitebinexp" -fi case "$vendorprefix" in '') d_vendorbin="$undef" @@ -8448,6 +8673,13 @@ int main() Gconvert((DOUBLETYPE)123.456, 8, 0, buf); checkit("123.456", buf); + /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */ + Gconvert((DOUBLETYPE)1e30, 8, 0, buf); + if (strlen(buf) > 5) + checkit("1e+030", buf); /* for Microsoft */ + else + checkit("1e+30", buf); + exit(0); } EOP @@ -8979,6 +9211,10 @@ eval $inlibc set chsize d_chsize eval $inlibc +: see if class exists +set class d_class +eval $inlibc + hasstruct='varname=$1; struct=$2; shift; shift; while $test $# -ge 2; do case "$1" in @@ -9058,7 +9294,7 @@ else sockethdr="-I/usr/netinclude" ;; esac - echo "Found Berkeley sockets interface in lib$net." >& 4 + echo "Found Berkeley sockets interface in lib$net." >&4 if $contains setsockopt libc.list >/dev/null 2>&1; then d_oldsock="$undef" else @@ -9084,7 +9320,7 @@ eval $inlibc echo " " -echo "Checking the availability of certain socket constants..." >& 4 +echo "Checking the availability of certain socket constants..." >&4 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'` $cat >try.c <&4 - val="$define" - cryptlib='' -else - cryptlib=`./loc Slibcrypt$_a "" $xlibpth` - if $test -z "$cryptlib"; then - cryptlib=`./loc Mlibcrypt$_a "" $xlibpth` - else - cryptlib=-lcrypt - fi - if $test -z "$cryptlib"; then - cryptlib=`./loc Llibcrypt$_a "" $xlibpth` - else - cryptlib=-lcrypt - fi - if $test -z "$cryptlib"; then - cryptlib=`./loc libcrypt$_a "" $libpth` - else - cryptlib=-lcrypt - fi - if $test -z "$cryptlib"; then - echo 'crypt() NOT found.' >&4 - val="$undef" - else +set crypt d_crypt +eval $inlibc +case "$d_crypt" in +$define) cryptlib='' ;; +*) if set crypt val -f d_crypt; eval $csym; $val; then + echo 'crypt() found.' >&4 val="$define" + cryptlib='' + else + cryptlib=`./loc Slibcrypt$_a "" $xlibpth` + if $test -z "$cryptlib"; then + cryptlib=`./loc Mlibcrypt$_a "" $xlibpth` + else + cryptlib=-lcrypt + fi + if $test -z "$cryptlib"; then + cryptlib=`./loc Llibcrypt$_a "" $xlibpth` + else + cryptlib=-lcrypt + fi + if $test -z "$cryptlib"; then + cryptlib=`./loc libcrypt$_a "" $libpth` + else + cryptlib=-lcrypt + fi + if $test -z "$cryptlib"; then + echo 'crypt() NOT found.' >&4 + val="$undef" + else + val="$define" + fi fi -fi -set d_crypt -eval $setvar + set d_crypt + eval $setvar + ;; +esac : get csh whereabouts case "$csh" in @@ -9348,6 +9590,63 @@ set d_dirnamlen eval $setvar $rm -f try.c +: see if this is an sysdir system +set sys/dir.h i_sysdir +eval $inhdr + +: see if this is an sysndir system +set sys/ndir.h i_sysndir +eval $inhdr + +: Look for dirfd +echo " " +$cat >dirfd.c < +#$i_dirent I_DIRENT /**/ +#$i_sysdir I_SYS_DIR /**/ +#$i_sysndir I_SYS_NDIR /**/ +#$i_systypes I_SYS_TYPES /**/ +#if defined(I_SYS_TYPES) +#include +#endif +#if defined(I_DIRENT) +#include +#if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */ +#include +#endif +#else +#ifdef I_SYS_NDIR +#include +#else +#ifdef I_SYS_DIR +#ifdef hp9000s500 +#include /* may be wrong in the future */ +#else +#include +#endif +#endif +#endif +#endif +int main() { + DIR *dirp = opendir("."); + if (dirfd(dirp) >= 0) + exit(0); + else + exit(1); +} +EOM +set dirfd +if eval $compile; then + val="$define" +fi +case "$val" in +$define) echo "dirfd() found." >&4 ;; +*) echo "dirfd() NOT found." >&4 ;; +esac +set d_dirfd +eval $setvar +$rm -f dirfd* + : see if dlerror exists xxx_runnm="$runnm" runnm=false @@ -9460,7 +9759,7 @@ EOM ;; esac -$rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.? +$rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.* set d_dlsymun eval $setvar @@ -9541,38 +9840,91 @@ elif $test `./findhdr fcntl.h` && \ echo "and you have the 3 argument form of open()." >&4 val="$define" else - echo "but not the 3 argument form of open(). Oh, well." >&4 + echo "but not the 3 argument form of open(). Oh, well." >&4 + val="$undef" + fi +else + val="$undef" + echo "I can't find the O_* constant definitions! You got problems." >&4 +fi +set d_open3 +eval $setvar +$rm -f try try.* + +: see which of string.h or strings.h is needed +echo " " +strings=`./findhdr string.h` +if $test "$strings" && $test -r "$strings"; then + echo "Using instead of ." >&4 + val="$define" +else + val="$undef" + strings=`./findhdr strings.h` + if $test "$strings" && $test -r "$strings"; then + echo "Using instead of ." >&4 + else + echo "No string header found -- You'll surely have problems." >&4 + fi +fi +set i_string +eval $setvar +case "$i_string" in +"$undef") strings=`./findhdr strings.h`;; +*) strings=`./findhdr string.h`;; +esac + +: see if this is a sys/file.h system +val='' +set sys/file.h val +eval $inhdr + +: do we need to include sys/file.h ? +case "$val" in +"$define") + echo " " + if $h_sysfile; then + val="$define" + echo "We'll be including ." >&4 + else + val="$undef" + echo "We won't be including ." >&4 + fi + ;; +*) + h_sysfile=false + ;; +esac +set i_sysfile +eval $setvar + +: see if fcntl.h is there +val='' +set fcntl.h val +eval $inhdr + +: see if we can include fcntl.h +case "$val" in +"$define") + echo " " + if $h_fcntl; then + val="$define" + echo "We'll be including ." >&4 + else val="$undef" + if $h_sysfile; then + echo "We don't need to include if we include ." >&4 + else + echo "We won't be including ." >&4 + fi fi -else - val="$undef" - echo "I can't find the O_* constant definitions! You got problems." >&4 -fi -set d_open3 -eval $setvar -$rm -f try try.* - -: see which of string.h or strings.h is needed -echo " " -strings=`./findhdr string.h` -if $test "$strings" && $test -r "$strings"; then - echo "Using instead of ." >&4 - val="$define" -else + ;; +*) + h_fcntl=false val="$undef" - strings=`./findhdr strings.h` - if $test "$strings" && $test -r "$strings"; then - echo "Using instead of ." >&4 - else - echo "No string header found -- You'll surely have problems." >&4 - fi -fi -set i_string -eval $setvar -case "$i_string" in -"$undef") strings=`./findhdr strings.h`;; -*) strings=`./findhdr string.h`;; + ;; esac +set i_fcntl +eval $setvar : check for non-blocking I/O stuff case "$h_sysfile" in @@ -9589,8 +9941,13 @@ echo "Figuring out the flag used by open() for non-blocking I/O..." >&4 case "$o_nonblock" in '') $cat head.c > try.c - $cat >>try.c <<'EOCP' + $cat >>try.c < +#include +#$i_fcntl I_FCNTL +#ifdef I_FCNTL +#include +#endif int main() { #ifdef O_NONBLOCK printf("O_NONBLOCK\n"); @@ -9632,6 +9989,11 @@ case "$eagain" in #include #include #include +#include +#$i_fcntl I_FCNTL +#ifdef I_FCNTL +#include +#endif #define MY_O_NONBLOCK $o_nonblock #ifndef errno /* XXX need better Configure test */ extern int errno; @@ -9692,7 +10054,7 @@ int main() ret = read(pd[0], buf, 1); /* Should read EOF */ alarm(0); sprintf(string, "%d\n", ret); - write(3, string, strlen(string)); + write(4, string, strlen(string)); exit(0); } @@ -9706,7 +10068,7 @@ EOCP set try if eval $compile_ok; then echo "$startsh" >mtry - echo "$run ./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry + echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry chmod +x mtry ./mtry >/dev/null 2>&1 case $? in @@ -9768,6 +10130,10 @@ EOCP esac $rm -f try try.* .out core head.c mtry +: see if fchdir exists +set fchdir d_fchdir +eval $inlibc + : see if fchmod exists set fchmod d_fchmod eval $inlibc @@ -9782,10 +10148,12 @@ eval $inlibc echo " " : See if fcntl-based locking works. -$cat >try.c <<'EOCP' +$cat >try.c < #include #include +#include +$signal_t blech(x) int x; { exit(3); } int main() { #if defined(F_SETLK) && defined(F_SETLKW) struct flock flock; @@ -9794,6 +10162,8 @@ int main() { flock.l_type = F_RDLCK; flock.l_whence = SEEK_SET; flock.l_start = flock.l_len = 0; + signal(SIGALRM, blech); + alarm(10); retval = fcntl(fd, F_SETLK, &flock); close(fd); (retval < 0 ? exit(2) : exit(0)); @@ -9813,6 +10183,18 @@ case "$d_fcntl" in else echo "Nope, it didn't work." val="$undef" + case "$?" in + 3) $cat >&4 <." >&4 - else - val="$undef" - echo "We won't be including ." >&4 - fi - ;; -*) - h_sysfile=false - ;; -esac -set i_sysfile -eval $setvar +: see if flock exists +set flock d_flock +eval $inlibc : see if prototype for flock is available echo " " @@ -10031,6 +10397,10 @@ eval $hasproto set fork d_fork eval $inlibc +: see if fp_class exists +set fp_class d_fp_class +eval $inlibc + : see if pathconf exists set pathconf d_pathconf eval $inlibc @@ -10039,6 +10409,18 @@ eval $inlibc set fpathconf d_fpathconf eval $inlibc +: see if fpclass exists +set fpclass d_fpclass +eval $inlibc + +: see if fpclassify exists +set fpclassify d_fpclassify +eval $inlibc + +: see if fpclassl exists +set fpclassl d_fpclassl +eval $inlibc + : check for fpos64_t echo " " @@ -10439,10 +10821,6 @@ esac set d_htonl eval $setvar -: see if iconv exists -set iconv d_iconv -eval $inlibc - : index or strchr echo " " if set index val -f; eval $csym; $val; then @@ -10505,6 +10883,14 @@ set d_isascii eval $setvar $rm -f isascii* +: see if isfinite exists +set isfinite d_isfinite +eval $inlibc + +: see if isinf exists +set isinf d_isinf +eval $inlibc + : see if isnan exists set isnan d_isnan eval $inlibc @@ -10738,7 +11124,7 @@ EOCP d_modfl="$undef" fi case "$osname:$gccversion" in - aix:) $ccflags="saveccflags" ;; # restore + aix:) ccflags="$saveccflags" ;; # restore esac ;; esac @@ -10822,6 +11208,14 @@ eval $inlibc set nice d_nice eval $inlibc +: see if this is a langinfo.h system +set langinfo.h i_langinfo +eval $inhdr + +: see if nl_langinfo exists +set nl_langinfo d_nl_langinfo +eval $inlibc + : check for length of character echo " " case "$charsize" in @@ -11222,6 +11616,41 @@ eval $inlibc set poll d_poll eval $inlibc +: see if readlink exists +set readlink d_readlink +eval $inlibc + +echo " " +procselfexe='' +val="$undef" +case "$d_readlink" in +"$define") + if $issymlink /proc/self/exe ; then + $ls -l /proc/self/exe > reflect + if $contains /`basename $ls` reflect >/dev/null 2>&1; then + echo "You have Linux-like /proc/self/exe." + procselfexe='"/proc/self/exe"' + val="$define" + fi + fi + if $issymlink /proc/curproc/file ; then + $ls -l /proc/curproc/file > reflect + if $contains /`basename $ls` reflect >/dev/null 2>&1; then + echo "You have BSD-like /proc/curproc/file." + procselfexe='"/proc/curproc/file"' + val="$define" + fi + fi + ;; +esac +$rm -f reflect +set d_procselfexe +eval $setvar + +: see if pthread_atfork exists +set pthread_atfork d_pthread_atfork +eval $inlibc + : see whether the various POSIXish _yields exist $cat >try.c <&4 - $cat >try.c <&4 + $cat >try.c <= 0; align--) { @@ -11493,36 +11918,34 @@ for (align = 7; align >= 0; align--) { exit(0); } EOCP - set try - if eval $compile_ok; then - if $run ./try 2>/dev/null; then - echo "Yes, it can." - val="$define" + set try + if eval $compile_ok; then + if ./try 2>/dev/null; then + echo "Yes, it can." + val="$define" + else + echo "It can't, sorry." + fi else - echo "It can't, sorry." - case "$d_memmove" in - "$define") echo "But that's Ok since you have memmove()." ;; - esac + echo "(I can't compile the test program, so we'll assume not...)" fi - else - echo "(I can't compile the test program, so we'll assume not...)" - case "$d_memmove" in - "$define") echo "But that's Ok since you have memmove()." ;; - esac - fi + ;; + esac + $rm -f try.* try core ;; esac -$rm -f try.* try core set d_safebcpy eval $setvar : can memcpy handle overlapping blocks? +echo " " val="$undef" -case "$d_memcpy" in -"$define") - echo " " - echo "Checking to see if your memcpy() can do overlapping copies..." >&4 - $cat >try.c <&4 + $cat >try.c <= 0; align--) { exit(0); } EOCP - set try - if eval $compile_ok; then - if $run ./try 2>/dev/null; then - echo "Yes, it can." - val="$define" + set try + if eval $compile_ok; then + if ./try 2>/dev/null; then + echo "Yes, it can." + val="$define" + else + echo "It can't, sorry." + fi else - echo "It can't, sorry." - case "$d_memmove" in - "$define") echo "But that's Ok since you have memmove()." ;; - esac + echo "(I can't compile the test program, so we'll assume not...)" fi - else - echo "(I can't compile the test program, so we'll assume not...)" - case "$d_memmove" in - "$define") echo "But that's Ok since you have memmove()." ;; - esac - fi + ;; + esac + $rm -f try.* try core ;; esac -$rm -f try.* try core set d_safemcpy eval $setvar @@ -12042,10 +12461,15 @@ esac case "$d_sfio" in $define) ;; *) : Remove sfio from list of libraries to use - set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'` - shift - libs="$*" - echo "libs = $libs" >&4 + case "$libs" in + *-lsfio*) + echo "Removing unneeded -lsfio from library list" >&4 + set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'` + shift + libs="$*" + echo "libs = $libs" >&4 + ;; + esac ;; esac @@ -13053,7 +13477,12 @@ EOM $cat >try.c < #define U32 $u32type -#define BYTEORDER $byteorder +#define BYTEORDER 0x$byteorder +#define U8 $u8type +#include +#ifdef SIGBUS +$signal_t bletch(s) int s; { exit(4); } +#endif int main() { #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321 U8 buf[] = "\0\0\0\1\0\0\0\0"; @@ -13067,6 +13496,10 @@ int main() { fflush(stdout); +#ifdef SIGBUS + signal(SIGBUS, bletch); +#endif + for (i = 0; i < 4; i++) { up = (U32*)(buf + i); if (! ((*up == 1 << (8*i)) || /* big-endian */ @@ -13099,7 +13532,7 @@ int main() { EOCP set try if eval $compile_ok; then - echo "(Testing for character data alignment may dump core.)" >&4 + echo "(Testing for character data alignment may crash the test. That's okay.)" >&4 $run ./try 2>&1 >/dev/null case "$?" in 0) cat >&4 </dev/null - $rm -f try.out + code="$?" $from try.out - if $test ! -s try.out -a "X$?" = X42; then + if $test ! -s try.out -a "X$code" = X42; then output=-DTRY_FPUTC fi fi @@ -13803,9 +14232,9 @@ if $test "X$fflushNULL" = X -o "X$fflushall" = X; then set try -DTRY_FPRINTF if eval $compile; then $run ./try 2>/dev/null - $rm -f try.out + code="$?" $from try.out - if $test ! -s try.out -a "X$?" = X42; then + if $test ! -s try.out -a "X$code" = X42; then output=-DTRY_FPRINTF fi fi @@ -13818,7 +14247,6 @@ case "$fflushNULL" in if eval $compile; then $run ./try 2>/dev/null code="$?" - $rm -f try.out $from try.out if $test -s try.out -a "X$code" = X42; then fflushNULL="`$cat try.out`" @@ -13941,9 +14369,10 @@ EOM $cat >&4 </dev/null - if $test -s try.out -a "X$?" = X42; then + code=$? + $from try.out + if $test -s try.out -a "X$code" = X42; then fflushall="`$cat try.out`" fi fi @@ -14310,7 +14739,7 @@ else fi case "$ivdformat" in -'') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4 +'') echo "$0: Fatal: failed to find format strings, cannot continue." >&4 exit 1 ;; esac @@ -15556,11 +15985,11 @@ case "$yacc" in esac echo " " comp='yacc' -if $test -f "$byacc"; then +if $test -f "$byacc$_exe"; then dflt="$byacc" comp="byacc or $comp" fi -if $test -f "$bison"; then +if $test -f "$bison$_exe"; then comp="$comp or bison -y" fi rp="Which compiler compiler ($comp) shall I use?" @@ -15578,42 +16007,20 @@ case "$yacc" in ;; esac -: see if fcntl.h is there -val='' -set fcntl.h val +: see if this is a fp.h system +set fp.h i_fp eval $inhdr -: see if we can include fcntl.h -case "$val" in -"$define") - echo " " - if $h_fcntl; then - val="$define" - echo "We'll be including ." >&4 - else - val="$undef" - if $h_sysfile; then - echo "We don't need to include if we include ." >&4 - else - echo "We won't be including ." >&4 - fi - fi - ;; -*) - h_fcntl=false - val="$undef" - ;; -esac -set i_fcntl -eval $setvar - -: see if this is a iconv.h system -set iconv.h i_iconv +: see if this is a fp_class.h system +set fp_class.h i_fp_class eval $inhdr : see if this is a ieeefp.h system -set ieeefp.h i_ieeefp -eval $inhdr +case "$i_ieeefp" in +'' ) set ieeefp.h i_ieeefp + eval $inhdr + ;; +esac : see if this is a libutil.h system set libutil.h i_libutil @@ -15644,6 +16051,19 @@ eval $inhdr : see if ndbm.h is available set ndbm.h t_ndbm eval $inhdr + +case "$t_ndbm" in +$undef) + # Some Linux distributions such as RedHat 7.1 put the + # ndbm.h header in /usr/include/gdbm/ndbm.h. + if $test -f /usr/include/gdbm/ndbm.h; then + ccflags="$ccflags -I/usr/include/gdbm" + cppflags="$cppflags -I/usr/include/gdbm" + t_ndbm=$define + fi + ;; +esac + case "$t_ndbm" in $define) : see if dbm_open exists @@ -15714,9 +16134,10 @@ BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi bull c cadmus clipper CMU COFF COMPILER_VERSION concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO -Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS -FreeBSD GCC_NEW_VARARGS gcos gcx gimpel -GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN +Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD +FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel +GLIBC GLIBC_MINOR +GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 hp700 HP700 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500 @@ -15759,7 +16180,11 @@ tower tower32 tower32_200 tower32_600 tower32_700 tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK -unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2 +unix UNIX95 UNIX99 unixpc unos +USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64 +USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2 +USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED +USGr4 USGr4_2 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED @@ -15894,7 +16319,6 @@ else $test "$silent" || sleep 1 fi fi -$rm -f ccsym* Cppsym.* : see if this is a termio system val="$undef" @@ -16125,6 +16549,10 @@ cd $rsrc/ext set X shift eval $find_extensions +# Special case: Add in threads/shared since it is not picked up by the +# recursive find above (and adding in general recursive finding breaks +# SDBM_File/sdbm). A.D. 10/25/2001. +known_extensions="$known_extensions threads/shared" set X $nonxs_extensions shift nonxs_extensions="$*" @@ -16147,11 +16575,16 @@ for xxx in $known_extensions ; do $define) avail_ext="$avail_ext $xxx" ;; esac ;; + I18N/Langinfo|i18n_lan) + case "$i_langinfo$d_nl_langinfo" in + $define$define) avail_ext="$avail_ext $xxx" ;; + esac + ;; NDBM_File|ndbm_fil) case "$i_ndbm" in $define) case "$osname-$use64bitint" in - hpux-define) + cygwin-*|hpux-define) case "$libs" in *-lndbm*) avail_ext="$avail_ext $xxx" ;; esac @@ -16165,7 +16598,7 @@ for xxx in $known_extensions ; do case "${i_dbm}${i_rpcsvcdbm}" in *"${define}"*) case "$osname-$use64bitint" in - hpux-define) + cygwin-*|hpux-define) case "$libs" in *-ldbm*) avail_ext="$avail_ext $xxx" ;; esac @@ -16187,7 +16620,12 @@ for xxx in $known_extensions ; do ;; Socket|socket) case "$d_socket" in - true|$define|y) avail_ext="$avail_ext $xxx" ;; + true|$define|y) + case "$osname" in + beos) ;; # not unless BONE + *) avail_ext="$avail_ext $xxx" ;; + esac + ;; esac ;; Sys/Syslog|sys/syslog) @@ -16204,6 +16642,14 @@ for xxx in $known_extensions ; do esac esac ;; + threads|threads/shared) + case "$usethreads" in + true|$define|y) + case "$useithreads" in + $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;; + esac + esac + ;; IPC/SysV|ipc/sysv) : XXX Do we need a useipcsysv variable here case "${d_msg}${d_sem}${d_shm}" in @@ -16387,6 +16833,12 @@ if test -d ../UU; then cd .. fi +: configuration may be patched via a 'config.arch' file +if $test -f config.arch; then + echo "I see a config.arch file, loading it." + . ./config.arch +fi + : configuration may be patched via a 'config.over' file if $test -f config.over; then echo " " @@ -16539,6 +16991,7 @@ d_charvspr='$d_charvspr' d_chown='$d_chown' d_chroot='$d_chroot' d_chsize='$d_chsize' +d_class='$d_class' d_closedir='$d_closedir' d_cmsghdr_s='$d_cmsghdr_s' d_const='$d_const' @@ -16548,6 +17001,7 @@ d_cuserid='$d_cuserid' d_dbl_dig='$d_dbl_dig' d_dbminitproto='$d_dbminitproto' d_difftime='$d_difftime' +d_dirfd='$d_dirfd' d_dirnamlen='$d_dirnamlen' d_dlerror='$d_dlerror' d_dlopen='$d_dlopen' @@ -16564,6 +17018,7 @@ d_endpwent='$d_endpwent' d_endsent='$d_endsent' d_eofnblk='$d_eofnblk' d_eunice='$d_eunice' +d_fchdir='$d_fchdir' d_fchmod='$d_fchmod' d_fchown='$d_fchown' d_fcntl='$d_fcntl' @@ -16572,11 +17027,17 @@ d_fd_macros='$d_fd_macros' d_fd_set='$d_fd_set' d_fds_bits='$d_fds_bits' d_fgetpos='$d_fgetpos' +d_finite='$d_finite' +d_finitel='$d_finitel' d_flexfnam='$d_flexfnam' d_flock='$d_flock' d_flockproto='$d_flockproto' d_fork='$d_fork' +d_fp_class='$d_fp_class' d_fpathconf='$d_fpathconf' +d_fpclass='$d_fpclass' +d_fpclassify='$d_fpclassify' +d_fpclassl='$d_fpclassl' d_fpos64_t='$d_fpos64_t' d_frexpl='$d_frexpl' d_fs_data_s='$d_fs_data_s' @@ -16627,11 +17088,12 @@ d_gnulibc='$d_gnulibc' d_grpasswd='$d_grpasswd' d_hasmntopt='$d_hasmntopt' d_htonl='$d_htonl' -d_iconv='$d_iconv' d_index='$d_index' d_inetaton='$d_inetaton' d_int64_t='$d_int64_t' d_isascii='$d_isascii' +d_isfinite='$d_isfinite' +d_isinf='$d_isinf' d_isnan='$d_isnan' d_isnanl='$d_isnanl' d_killpg='$d_killpg' @@ -16678,6 +17140,7 @@ d_msync='$d_msync' d_munmap='$d_munmap' d_mymalloc='$d_mymalloc' d_nice='$d_nice' +d_nl_langinfo='$d_nl_langinfo' d_nv_preserves_uv='$d_nv_preserves_uv' d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits' d_off64_t='$d_off64_t' @@ -16692,6 +17155,8 @@ d_phostname='$d_phostname' d_pipe='$d_pipe' d_poll='$d_poll' d_portable='$d_portable' +d_procselfexe='$d_procselfexe' +d_pthread_atfork='$d_pthread_atfork' d_pthread_yield='$d_pthread_yield' d_pwage='$d_pwage' d_pwchange='$d_pwchange' @@ -16706,7 +17171,6 @@ d_quad='$d_quad' d_readdir='$d_readdir' d_readlink='$d_readlink' d_readv='$d_readv' -d_realpath='$d_realpath' d_recvmsg='$d_recvmsg' d_rename='$d_rename' d_rewinddir='$d_rewinddir' @@ -16817,6 +17281,7 @@ d_ualarm='$d_ualarm' d_umask='$d_umask' d_uname='$d_uname' d_union_semun='$d_union_semun' +d_unordered='$d_unordered' d_usleep='$d_usleep' d_usleepproto='$d_usleepproto' d_ustat='$d_ustat' @@ -16857,6 +17322,7 @@ eunicefix='$eunicefix' exe_ext='$exe_ext' expr='$expr' extensions='$extensions' +extras='$extras' fflushNULL='$fflushNULL' fflushall='$fflushall' find='$find' @@ -16876,6 +17342,7 @@ gidsign='$gidsign' gidsize='$gidsize' gidtype='$gidtype' glibpth='$glibpth' +gmake='$gmake' grep='$grep' groupcat='$groupcat' groupstype='$groupstype' @@ -16901,11 +17368,13 @@ i_dld='$i_dld' i_dlfcn='$i_dlfcn' i_fcntl='$i_fcntl' i_float='$i_float' +i_fp='$i_fp' +i_fp_class='$i_fp_class' i_gdbm='$i_gdbm' i_grp='$i_grp' -i_iconv='$i_iconv' i_ieeefp='$i_ieeefp' i_inttypes='$i_inttypes' +i_langinfo='$i_langinfo' i_libutil='$i_libutil' i_limits='$i_limits' i_locale='$i_locale' @@ -17104,6 +17573,7 @@ prefix='$prefix' prefixexp='$prefixexp' privlib='$privlib' privlibexp='$privlibexp' +procselfexe='$procselfexe' prototype='$prototype' ptrsize='$ptrsize' quadkind='$quadkind' @@ -17257,6 +17727,7 @@ vendorlibexp='$vendorlibexp' vendorprefix='$vendorprefix' vendorprefixexp='$vendorprefixexp' version='$version' +version_patchlevel_string='$version_patchlevel_string' versiononly='$versiononly' vi='$vi' voidflags='$voidflags'