diff options
Diffstat (limited to 'Configure')
-rwxr-xr-x | Configure | 1042 |
1 files changed, 797 insertions, 245 deletions
@@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.3 1993/12/15 08:15:07 ram Exp $ # -# Generated on Sat Apr 2 17:29:14 EST 1994 [metaconfig 3.0 PL22] +# Generated on Wed May 4 14:59:36 EDT 1994 [metaconfig 3.0 PL22] cat >/tmp/c1$$ <<EOF ARGGGHHHH!!!!! @@ -84,7 +84,6 @@ test -d UU || mkdir UU cd UU && rm -f * extensions='' -d_bsd='' d_eunice='' d_xenix='' eunicefix='' @@ -155,6 +154,8 @@ vi='' zcat='' hint='' myuname='' +osname='' +osvers='' Author='' Date='' Header='' @@ -166,7 +167,7 @@ Revision='' Source='' State='' afs='' -alignbytes='' +memalignbytes='' bin='' binexp='' installbin='' @@ -232,6 +233,9 @@ d_msgsnd='' d_open3='' d_portable='' d_readdir='' +d_rewinddir='' +d_seekdir='' +d_telldir='' d_rename='' d_rmdir='' d_safebcpy='' @@ -258,6 +262,7 @@ d_setruid='' d_setsid='' d_shm='' d_shmat='' +d_voidshmat='' d_shmctl='' d_shmdt='' d_shmget='' @@ -278,6 +283,8 @@ d_syserrlst='' d_symlink='' d_syscall='' d_system='' +d_time='' +timetype='' clocktype='' d_times='' d_truncate='' @@ -294,8 +301,13 @@ d_charvspr='' d_vprintf='' d_wait4='' d_waitpid='' +cccdlflags='' +ccdlflags='' +dldir='' dlobj='' dlsrc='' +lddlflags='' +shlibsuffix='' usedl='' gidtype='' groupstype='' @@ -308,7 +320,9 @@ i_dlfcn='' i_fcntl='' i_gdbm='' i_grp='' +i_memory='' i_ndbm='' +i_neterrno='' i_niin='' i_sysin='' d_pwage='' @@ -318,6 +332,7 @@ d_pwcomment='' d_pwexpire='' d_pwquota='' i_pwd='' +i_sdbm='' i_stdarg='' i_stddef='' i_string='' @@ -337,6 +352,7 @@ i_systime='' i_systimek='' i_time='' timeincl='' +i_unistd='' i_utime='' i_varargs='' i_varhdr='' @@ -349,6 +365,9 @@ libpth='' plibpth='' xlibpth='' libs='' +lns='' +lseektype='' +d_mymalloc='' mallocobj='' mallocsrc='' malloctype='' @@ -371,12 +390,15 @@ n='' groupcat='' hostcat='' passcat='' +orderlib='' +ranlib='' package='' spackage='' installprivlib='' privlib='' privlibexp='' prototype='' +ptrsize='' randbits='' installscript='' scriptdir='' @@ -572,7 +594,7 @@ true) esac : set package name -package=perl +package=perl5 : Eunice requires " " instead of "", can you believe it echo " " @@ -616,7 +638,9 @@ gccversion='' : no include file wanted by default inclwanted='' - usedl='' +: File to use for dynamic loading +usedl='' +gidtype='' groupstype='' : change the next line if compiling for Xenix/286 on Xenix/386 xlibpth='/usr/lib/386 /lib/386' @@ -631,7 +655,7 @@ libpth="$libpth /usr/ccs/lib /usr/ucblib /usr/local/lib" : machines, like the mips. Usually, it should be empty. plibpth='' -libswanted="net socket nsl inet nm sdbm gdbm ndbm dbm malloc dl dld sun m c_s posix cposix ndir dir ucb bsd BSD PW x" +libswanted=" net socket inet nsl nm sdbm gdbm ndbm dbm malloc dl dld sun m c_s posix cposix ndir dir ucb bsd BSD PW x " : full support for void wanted by default defvoidused=15 @@ -1004,11 +1028,13 @@ cp echo expr grep +ln mkdir mv rm sed sort +touch tr uniq " @@ -1159,13 +1185,13 @@ EOM : Half the following guesses are probably wrong... If you have better : tests or hints, please send them to lwall@netlabs.com : The metaconfig authors would also appreciate a copy... - $test -f /irix && dflt="$dflt sgi" - $test -f /xenix && dflt="$dflt sco_xenix" - $test -f /dynix && dflt="$dflt dynix" - $test -f /dnix && dflt="$dflt dnix" - $test -f /bin/mips && /bin/mips && dflt="$dflt mips" - $test -d /NextApps && test -f /usr/adm/software_version && dflt="$dflt next" - $test -d /usr/include/minix && dflt="$dflt minix" + $test -f /irix && osname=sgi + $test -f /xenix && osname=sco_xenix + $test -f /dynix && osname=dynix + $test -f /dnix && osname=dnix + $test -f /bin/mips && /bin/mips && osname=mips + $test -d /NextApps && test -f /usr/adm/software_version && osname=next + $test -d /usr/include/minix && osname=minix if $test -f $uname; then set X $myuname shift @@ -1173,63 +1199,80 @@ EOM $test -f $5.sh && dflt="$dflt $5" case "$5" in - fps*) dflt="$dflt fps";; + fps*) osname=fps ;; mips*) case "$4" in - umips) dflt="$dflt umips";; - *) dflt="$dflt mips";; + umips) osname=umips ;; + *) osname=mips ;; esac;; - [23]100) dflt="$dflt mips";; - next*) dflt="$dflt next" ;; - news*) dflt="$dflt news" ;; + [23]100) osname=mips ;; + next*) osname=next ;; + news*) osname=news ;; i386*) if $test -f /etc/kconfig; then + osname=isc if $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then - dflt="$dflt isc_3_2_3" + osvers=3.2.3 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then - dflt="$dflt isc_3_2_2" + osvers=3.2.2 fi - : i386.sh hint is wrong for Interactive. - dflt=`echo $dflt | $sed 's/i386//'` fi ;; esac case "$1" in - aix) dflt="$dflt aix_rs" ;; - sun[Oo][Ss]) case "$3" in - [34]*) vers=`echo $3 | $sed 's/\./_/g'` - dflt="$dflt sunos_$vers" ;; - 5*) vers=`echo $3 | $sed 's/^5/2/g'` - dflt="$dflt solaris_$vers" ;; + aix) osname=aix_rs ;; + sunos) osname=sunos + case "$3" in + [34]*) osvers=$3 ;; + 5*) osname=solaris + osvers=`echo $3 | $sed 's/^5/2/g'` ;; esac ;; - [sS]olaris) case "$3" in - 5*) vers=`echo $3 | $sed 's/^5/2/g'` - dflt="$dflt solaris_$vers" ;; + solaris) osname=solaris + case "$3" in + 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;; esac ;; - dnix) dflt="$dflt dnix" ;; - dgux) dflt="$dflt dgux" ;; - genix) dflt="$dflt genix" ;; - hp*ux) dflt="$dflt hpux" ;; - next) dflt="$dflt next" ;; - irix) dflt="$dflt sgi" ;; - ultrix) case "$3" in - 3*) dflt="$dflt ultrix_3" ;; - 4*) dflt="$dflt ultrix_4" ;; + dnix) osname=dnix ;; + dgux) osname=dgux ;; + genix) osname=genix ;; + hp*ux) osname=hpux ;; + next) osname=next ;; + irix) osname=sgi ;; + ultrix) osname=ultrix + case "$3" in + 1*) osvers=1 ;; + 2*) osvers=2 ;; + 3*) osvers=3 ;; + 4*) osvers=4 ;; esac ;; - uts) dflt="$dflt uts" ;; - $2) case "$dflt" in + osf1) case "$5" in + alpha) osname=dec_osf + case "$3" in + [vt]1\.*) osvers=1 ;; + [vt]2\.*) osvers=2 ;; + [vt]3\.*) osvers=3 ;; + esac + ;; + hp*) osname=hp_osf1 ;; # TR + mips) osname=mips_osf1 ;; # TR + # TR = Technology Releases: (un^N)supported + esac + ;; + uts) osname=uts ;; + $2) case "$osname" in *isc*) ;; *) if test -f /etc/systemid; then + osname=sco + : Does anyone know if these next gyrations are needed set `echo $3 | $sed 's/\./ /g'` $4 if $test -f sco_$1_$2_$3.sh; then - dflt="$dflt sco_$1_$2_$3" + osvers=$1.$2.$3 elif $test -f sco_$1_$2.sh; then - dflt="$dflt sco_$1_$2" + osvers=$1.$2 elif $test -f sco_$1.sh; then - dflt="$dflt sco_$1" + osvers=$1 fi fi ;; @@ -1240,25 +1283,31 @@ EOM if test -f /vmunix -a -f news_os.sh; then (what /vmunix | tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1 if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then - dflt="$dflt news_os" + osname=news_os fi $rm -f ../UU/kernel.what fi fi - set X `echo $dflt | tr ' ' '\012' | sort | uniq` - shift - dflt='' - for file in $*; do - if $test -f "$file.sh"; then - dflt="$dflt $file" - fi - done - set X $dflt - shift - dflt=${1+"$@"} - case "$dflt" in - '') dflt=none;; + + : Now look for a hint file osname_osvers + file=`echo "${osname}_${osvers}" | sed -e 's@\.@_@g' -e 's@_$@@'` + case "$file" in + '') dflt=none ;; + *) case "$osvers" in + '') dflt=$file + ;; + *) if $test -f $file.sh ; then + dflt=$file + elif $test -f "${osname}.sh" ; then + dflt="${osname}" + else + dflt=none + fi + ;; + esac + ;; esac + $cat <<EOM You may give one or more space-separated answers, or "none" if appropriate. @@ -1267,17 +1316,40 @@ If your OS version has no hints, DO NOT give a wrong version -- say "none". EOM rp="Which of these apply, if any?" . ../UU/myread - for file in $ans; do + tans=$ans + for file in $tans; do if $test -f $file.sh; then . ./$file.sh $cat $file.sh >> ../UU/config.sh - elif $test X$ans = X -o X$ans = Xnone ; then + elif $test X$tans = X -o X$tans = Xnone ; then : nothing else - echo "$file.sh does not exist -- ignored" + : Give one chance to correct a possible typo. + echo "$file.sh does not exist" + dflt=$file + rp="hint to use instead?" + . ../UU/myread + for file in $ans; do + if $test -f "$file.sh"; then + . ./$file.sh + $cat $file.sh >> ../UU/config.sh + elif $test X$ans = X -o X$ans = Xnone ; then + : nothing + else + echo "$file.sh does not exist -- ignored." + fi + done fi done + hint=recommended + : Remember our hint file for later. + if $test -f "$file.sh" ; then + hintfile="$file.sh" + else + hintfile=none + fi + cd .. fi cd UU @@ -1303,6 +1375,43 @@ for file in $loclist $trylist; do eval $file="\$_$file" done +cat << EOM +Configure uses the operating system name and version to set some defaults. +Say "none" to leave it blank. +EOM + +case "$osname" in + ''|' ') + case "$hintfile" in + none) dflt=none ;; + *) dflt=`echo $hintfile | sed -e 's/\.sh$//' -e 's/_.*$//'` ;; + esac + ;; + *) dflt="$osname" ;; +esac +rp="Operating system name?" +. ./myread +case "$ans" in + none) osname='' ;; + *) osname="$ans" ;; +esac + +case "$osvers" in + ''|' ') + case "$hintfile" in + none) dflt=none ;; + *) dflt=`echo $hintfile | sed -e 's/\.sh$//' -e 's/^[^_]*//'` + dflt=`echo $dflt | sed -e 's/^_//' -e 's/_/./g'` ;; + esac + ;; + *) dflt="$osvers" ;; +esac +rp="Operating system version?" +. ./myread +case "$ans" in + none) osvers='' ;; + *) osvers="$ans" ;; +esac : who configured the system cf_time=`$date 2>&1` cf_by=`( (logname) 2>/dev/null || whoami) 2>&1` @@ -1479,7 +1588,6 @@ echo exit 1 >osf1 echo exit 1 >eunice echo exit 1 >xenix echo exit 1 >venix -d_bsd="$undef" $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1 then @@ -1501,7 +1609,6 @@ elif test `echo abc | tr a-z A-Z` = Abc ; then fi elif $contains SIGTSTP foo >/dev/null 2>&1 ; then echo "Looks kind of like a BSD system, but we'll see..." - d_bsd="$define" echo exit 0 >bsd else echo "Looks kind of like a Version 7 system, but we'll see..." @@ -1618,7 +1725,7 @@ return 1; #endif } EOM - if $cc -o gccvers $ccflags gccvers.c >/dev/null 2>&1; then + if $cc -o gccvers gccvers.c >/dev/null 2>&1; then gccversion=`./gccvers` echo "You appear to have version $gccversion." else @@ -1925,12 +2032,12 @@ case "$optimize" in 'none') optimize=" ";; esac +dflt='' case "$ccflags" in '') case "$cc" in *gcc*) if $test "$gccversion" = "1"; then dflt='-fpcc-struct-return' fi ;; - *) dflt='';; esac case "$optimize" in *-g*) dflt="$dflt -DDEBUGGING";; @@ -1944,7 +2051,6 @@ case "$ccflags" in ;; esac ;; -*) dflt="$ccflags" ;; esac case "$mips_type" in @@ -1988,6 +2094,10 @@ set signal.h _NO_PROTO; eval $inctest case "$dflt" in '') dflt=none;; esac +case "$ccflags" in +'') ;; +*) dflt="$ccflags";; +esac $cat <<EOH Your C compiler may want other flags. For this question you should include @@ -1996,8 +2106,8 @@ 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. To use no flags, specify the word "none". -Your C compiler might also need additional flags, such as -DJMPCLOBBER -or -DCRIPPLED_CC. +Your C compiler might also need additional flags, such as -DJMPCLOBBER, +-DHIDEMYMALLOC or -DCRIPPLED_CC. EOH set X $dflt shift @@ -2012,9 +2122,10 @@ esac : the following weeds options from ccflags that are of no interest to cpp cppflags="$ccflags" case "$cc" in -*gcc*) if $test "$gccversion" = "1"; then - cppflags="$cppflags -D__GNUC__" - fi ;; +*gcc*) case "$gccversion" in + 1) cppflags="$cppflags -D__GNUC__" ;; + esac + ;; esac case "$mips_type" in '');; @@ -2027,7 +2138,7 @@ case "$cppflags" in for flag do case $flag in - -D*|-I*|-traditional|-ansi|-nostdinc) cppflags="$cppflags $flag";; + -D*|-I*|-traditional|-ansi|-nostdinc|-posix|-Xp) cppflags="$cppflags $flag";; esac done case "$cppflags" in @@ -2104,27 +2215,27 @@ for thislib in $libswanted; do case "$thislib" in dbm) thatlib=ndbm;; *_s) thatlib=NONE;; - *) thatlib="${thislib}_s";; + *) thatlib=${thislib}_s;; esac xxx=`./loc lib$thislib.a X $libpth` yyy=`./loc lib$thatlib.a X $libpth` - zzz=`./loc lib$thislib.so.[0-9]'*' $libpth` + zzz=`./loc lib$thislib.so.[0-9]'*' X $libpth` if $test -f $xxx; then echo "Found -l$thislib." case "$dflt" in - "*-l$thislib *.*"|"*-l$thatlib *.*") ;; + *"-l$thislib "*|*-l$thislib|*"-l$thatlib "*|*-l$thatlib) ;; *) dflt="$dflt -l$thislib";; esac elif $test -f $yyy; then echo "Found -l$thatlib." case "$dflt" in - "*-l$thislib *.*"|"*-l$thatlib *.*") ;; + *"-l$thatlib "*|*-l$thatlib) ;; *) dflt="$dflt -l$thatlib";; esac elif $test -f $zzz; then echo "Found -$thislib." case "$dflt" in - "*-l$thislib *.*"|"*-l$thatlib *.*") ;; + *"-l$thislib "*|*-l$thislib) ;; *) dflt="$dflt -l$thislib";; esac else @@ -2133,13 +2244,13 @@ for thislib in $libswanted; do if $test -f $xxx; then echo "Found -l$thislib." case "$dflt" in - "*-l$thislib *.*"|"*-l$thatlib *.*") ;; + *"-l$thislib "*|*-l$thislib|*"-l$thatlib "*|*-l$thatlib) ;; *) dflt="$dflt -l$thislib";; esac elif $test -f $yyy; then echo "Found -l$thatlib." case "$dflt" in - "*-l$thislib *.*"|"*-l$thatlib *.*") ;; + *"-l$thatlib "*|*-l$thatlib) ;; *) dflt="$dflt -l$thatlib";; esac else @@ -2758,6 +2869,9 @@ EOCP $cc $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then h_fcntl=true; echo "<fcntl.h> defines the *_OK access constants." >&4 + elif $test `./findhdr unistd.h` && \ + $cc $cppflags -DI_UNISTD access.c -o access >/dev/null 2>&1 ; then + echo "<unistd.h> defines the *_OK access constants." >&4 else echo "I can't find the four *_OK access constants--I'll use mine." >&4 fi @@ -2816,7 +2930,7 @@ esac' : check for ability to cast large floats to 32-bit ints. echo " " echo 'Checking whether your C compiler can cast large floats to int32.' >&4 -if $test "$intsize" -ge 4; then +if $test "$intsize" -eq 4; then xxx=int else xxx=long @@ -2858,7 +2972,7 @@ case "$yyy" in esac set d_casti32 eval $setvar -$rm -f try.* +$rm -f try try.* : check for ability to cast negative floats to unsigned echo " " echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4 @@ -3177,10 +3291,70 @@ eval $inlibc set getpriority d_getprior eval $inlibc +: define an alternate in-header-list? function +inhdr='echo " "; td=$define; tu=$undef; yyy=$@; +cont=true; xxf="echo \"<\$1> found.\" >&4"; +case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";; +*) xxnf="echo \"<\$1> NOT found, ...\" >&4";; +esac; +case $# in 4) instead=instead;; *) instead="at last";; esac; +while $test "$cont"; do + xxx=`./findhdr $1` + var=$2; eval "was=\$$2"; + if $test "$xxx" && $test -r "$xxx"; + then eval $xxf; + eval "case \"\$$var\" in $undef) . whoa; esac"; eval "$var=\$td"; + cont=""; + else eval $xxnf; + eval "case \"\$$var\" in $define) . whoa; esac"; eval "$var=\$tu"; fi; + set $yyy; shift; shift; yyy=$@; + case $# in 0) cont="";; + 2) xxf="echo \"but I found <\$1> $instead.\" >&4"; + xxnf="echo \"and I did not find <\$1> either.\" >&4";; + *) xxf="echo \"but I found <\$1\> instead.\" >&4"; + xxnf="echo \"there is no <\$1>, ...\" >&4";; + esac; +done; +while $test "$yyy"; +do set $yyy; var=$2; eval "was=\$$2"; + eval "case \"\$$var\" in $define) . whoa; esac"; eval "$var=\$tu"; + set $yyy; shift; shift; yyy=$@; +done' + +: see if this is a netinet/in.h or sys/in.h system +set netinet/in.h i_niin sys/in.h i_sysin +eval $inhdr + : see if htonl --and friends-- exists set htonl d_htonl eval $inlibc - +: Maybe they are macros. +case "$d_htonl" in +'define') ;; +*) cat > try.c <<EOM +#include <stdio.h> +#include <sys/types.h> +#$i_niin I_NETINET_IN +#$i_sysin I_SYS_IN +#ifdef I_NETINET_IN +# include <netinet/in.h> +#endif +#ifdef I_SYS_IN +# include <sys/in.h> +#endif +int main() +{ + int x; + printf("x = ", htonl(7)); +} +EOM + if $cc $ccflags -c try.c >/dev/null 2>&1; then + d_htonl="$define" + echo "But it seems to be defined as a macro." + fi + $rm -f try.* try + ;; +esac : Look for isascii echo " " $cat >isascii.c <<'EOCP' @@ -3269,6 +3443,55 @@ fi set d_msg eval $setvar +: determine which malloc to compile in +: Old versions had dflt='y' only for bsd or v7. +echo " " +case "$usemymalloc" in +'') + if bsd || v7; then + dflt='y' + else + dflt='y' + fi + ;; +*) dflt="$usemymalloc" + ;; +esac +rp="Do you wish to attempt to use the malloc that comes with $package?" +. ./myread +usemymalloc="$ans" +case "$ans" in +y*) mallocsrc='malloc.c' + mallocobj='malloc.o' + d_mymalloc="$define" + ;; +*) mallocsrc='' + mallocobj='' + d_mymalloc="$undef" + ;; +esac + +: compute the type returned by malloc +echo " " +case "$malloctype" in +'') + if $test `./findhdr malloc.h`; then + echo "#include <malloc.h>" > malloc.c + fi +#include <malloc.h> + $cat >>malloc.c <<'END' +void *malloc(); +END + if $cc $ccflags -c malloc.c >/dev/null 2>&1; then + malloctype='void *' + else + malloctype='char *' + fi + $rm -f malloc.[co] + ;; +esac +echo "Your system wants malloc to return '$malloctype', it would seem." >&4 + socketlib='' sockethdr='' : see whether socket exists @@ -3378,7 +3601,7 @@ xxx=`./findhdr pwd.h` if $test "$xxx"; then i_pwd="$define" echo "<pwd.h> found." >&4 - $cppstdin $cppflags < $xxx >$$.h + $cppstdin $cppflags $cppminus < $xxx >$$.h if $contains 'pw_quota' $$.h >/dev/null 2>&1; then d_pwquota="$define" else @@ -3421,9 +3644,15 @@ else echo "<pwd.h> NOT found." >&4 fi -: see if readdir exists +: see if readdir and friends exist set readdir d_readdir eval $inlibc +set seekdir d_seekdir +eval $inlibc +set telldir d_telldir +eval $inlibc +set rewinddir d_rewinddir +eval $inlibc : see if rename exists set rename d_rename @@ -3442,20 +3671,21 @@ case "$d_bcopy" in $cat >foo.c <<'EOCP' main() { -char buf[128]; -register char *b; -register int len; -register int off; -register int align; +char buf[128], abc[128]; +char *b; +int len; +int off; +int align; +bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36); for (align = 7; align >= 0; align--) { for (len = 36; len; len--) { b = buf+align; - bcopy("abcdefghijklmnopqrstuvwxyz0123456789", b, len); + bcopy(abc, b, len); for (off = 1; off <= len; off++) { bcopy(b, b+off, len); bcopy(b+off, b, len); - if (bcmp(b, "abcdefghijklmnopqrstuvwxyz0123456789", len)) + if (bcmp(b, abc, len)) exit(1); } } @@ -3488,20 +3718,22 @@ case "$d_memcpy" in $cat >foo.c <<'EOCP' main() { -char buf[128]; -register char *b; -register int len; -register int off; -register int align; +char buf[128], abc[128]; +char *b; +int len; +int off; +int align; + +memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36); for (align = 7; align >= 0; align--) { for (len = 36; len; len--) { b = buf+align; - memcpy("abcdefghijklmnopqrstuvwxyz0123456789", b, len); + memcpy(abc, b, len); for (off = 1; off <= len; off++) { memcpy(b, b+off, len); memcpy(b+off, b, len); - if (memcmp(b, "abcdefghijklmnopqrstuvwxyz0123456789", len)) + if (memcmp(b, abc, len)) exit(1); } } @@ -3620,7 +3852,19 @@ eval $inlibc : see if shmat exists set shmat d_shmat eval $inlibc - +: see what shmat returns +d_voidshmat="$undef" +case "$d_shmat" in +define) + $cppstdin $cppflags $cppminus < $usrinc/sys/shm.h >voidshmat.txt 2>/dev/null + if $contains "void.*shmat" voidshmat.txt >/dev/null 2>&1; then + echo "and shmat returns (void*)" + d_voidshmat="$define" + else + echo "and shmat returns (char*)" + fi + ;; +esac : see if shmdt exists set shmdt d_shmdt eval $inlibc @@ -4022,15 +4266,24 @@ case "$d_phostname" in '') d_phostname="$undef";; esac -: backward compatibility for d_hvfork -if test X$d_hvfork != X; then - d_vfork="$d_hvfork" - d_hvfork='' -fi : see if there is a vfork set vfork d_vfork eval $inlibc - +: But do we want to use it. vfork is reportedly unreliable in +: perl in Solaris 2.x, and probably elsewhere. +case "$d_vfork" in +define) + dflt='n' + rp="Some systems have problems with vork. Do you want to use it?" + . ./myread + case "$ans" in + y|Y) ;; + *) echo "Ok, we won't use vfork." + d_vfork="$undef" + ;; + esac + ;; +esac : see if signal is declared as pointer to function returning int or void echo " " xxx=`./findhdr signal.h` @@ -4111,35 +4364,6 @@ Log='$Log' RCSfile='$RCSfile' Revision='$Revision' -: check for alignment requirements -echo " " -case "$alignbytes" in -'') echo "Checking alignment constraints..." >&4 - $cat >try.c <<'EOCP' -struct foobar { - char foo; - double bar; -} try; -main() -{ - printf("%d\n", (char *)&try.bar - (char *)&try.foo); -} -EOCP - if $cc $ccflags try.c -o try >/dev/null 2>&1; then - dflt=`./try` - else - dflt='8' - echo"(I can't seem to compile the test program...)" - fi - ;; -*) dflt="$alignbytes" - ;; -esac -rp="Doubles must be aligned on a how-many-byte boundary?" -. ./myread -alignbytes="$ans" -$rm -f try.c try - : is AFS running? echo " " if test -d /afs; then @@ -4239,77 +4463,228 @@ rp="What is the order of bytes in a long?" byteorder="$ans" $rm -f try.c try -: define an alternate in-header-list? function -inhdr='echo " "; td=$define; tu=$undef; yyy=$@; -cont=true; xxf="echo \"<\$1> found.\" >&4"; -case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";; -*) xxnf="echo \"<\$1> NOT found, ...\" >&4";; -esac; -case $# in 4) instead=instead;; *) instead="at last";; esac; -while $test "$cont"; do - xxx=`./findhdr $1` - var=$2; eval "was=\$$2"; - if $test "$xxx" && $test -r "$xxx"; - then eval $xxf; - eval "case \"\$$var\" in $undef) . whoa; esac"; eval "$var=\$td"; - cont=""; - else eval $xxnf; - eval "case \"\$$var\" in $define) . whoa; esac"; eval "$var=\$tu"; fi; - set $yyy; shift; shift; yyy=$@; - case $# in 0) cont="";; - 2) xxf="echo \"but I found <\$1> $instead.\" >&4"; - xxnf="echo \"and I did not find <\$1> either.\" >&4";; - *) xxf="echo \"but I found <\$1\> instead.\" >&4"; - xxnf="echo \"there is no <\$1>, ...\" >&4";; - esac; -done; -while $test "$yyy"; -do set $yyy; var=$2; eval "was=\$$2"; - eval "case \"\$$var\" in $define) . whoa; esac"; eval "$var=\$tu"; - set $yyy; shift; shift; yyy=$@; -done' - : see if dlfcn is available set dlfcn.h i_dlfcn eval $inhdr - : determine which dynamic loading, if any, to compile in echo " " case "$usedl" in -'') - case "$i_dlfcn" in - 'define') dflt='y' ;; - *) dflt='n' ;; - esac - ;; -'define') dflt='y' ;; -'y') dflt='y' - usedl='define' ;; -*) dflt='n' ;; +'') case "$i_dlfcn" in + define) dflt='y' ;; + *) dflt='n' ;; + esac + : Does a dl.c file exist for this operating system + $test -f ../ext/dl/dl_${osname}.c && dflt='y' + ;; +define|y|true) dflt='y' + usedl="$define" + ;; +*) dflt='n' + ;; esac rp="Do you wish to attempt to use dynamic loading?" . ./myread usedl="$ans" case "$ans" in -y*) usedl='define'; dlsrc='dl.c'; dlobj='dl.o';; -*) usedl='undef'; dlsrc=''; dlobj='';; +y*) usedl="$define" + if $test -f ../ext/dl/dl_${osname}.c ; then + dflt="ext/dl/dl_${osname}.c" + else + dflt='ext/dl/dl.c' + fi + echo "The following dynamic loading files are available:" + cd ..; ls -C ext/dl/dl*.c; cd UU + rp="Source file to use for dynamic loading" + fn="fne~" + . ./getfile + : emulate basename and dirname + xxx=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@' -e 's@\.c$@@'` + dlobj=$xxx.o + dlsrc=$xxx.c + dldir=`echo $ans | $sed 's@\(.*\)/[^/]*$@\1@'` + case "$dldir" in + '') dldir="." ;; + *) ;; + esac + if $test -f ../$dldir/$dlsrc; then + usedl="$define" + else + echo "File $dlsrc does not exist -- ignored" + usedl="$undef" + fi + + cat << EOM + +Some systems may require passing special flags to $cc -c to +compile modules that will be used to create a shared library. +To use no flags, say "none". +EOM + case "$cccdlflags" in + ''|' ') case "$osname" in + hpux) dflt='+z' ;; + next) dflt='none' ;; + sunos) dflt='none' ;; + *) dflt='none' ;; + esac + ;; + *) dflt="$cccdlflags" ;; + esac + rp="Any special flags to pass to $cc -c to compile shared library modules?" + . ./myread + case "$ans" in + none) cccdlflags='' ;; + *) cccdlflags="$ans" ;; + esac + + cat << 'EOM' + +Some systems may require passing special flags to ld to +create a shared library. To use no flags, say "none". +EOM + case "$lddlflags" in + ''|' ') case "$osname" in + hpux) dflt='-b' ;; + next) dflt='none' ;; + sunos) dflt='none' ;; + *) dflt='none' ;; + esac + ;; + *) dflt="$lddlflags" ;; + esac + rp="Any special flags to pass to ld to create a shared library?" + . ./myread + case "$ans" in + none) lddlflags='' ;; + *) lddlflags="$ans" ;; + esac + + cat <<EOM + +Some systems may require passing special flags to $cc to indicate that +dynamic linking will be used. To use no flags, say "none". +EOM + case "$ccdlflags" in + ''|' ') + case "$osname" in + hpux) dflt='none' ;; + next) dflt='none' ;; + sunos) dflt='none' ;; + *) dflt='none' ;; + esac + ;; + *) dflt="$ccdlflags" + ;; + esac + rp="Any special flags to pass to $cc to use dynamic loading?" + . ./myread + case "$ans" in + none) ccdlflags='' ;; + *) ccdlflags="$ans" ;; + esac + cat <<EOM + +Some systems may require using a special suffix for shared libraries. +To create the shared library for POSIX, for example, you may need to +actually build the file POSIX.so. + +EOM + case "$shlibsuffix" in + '') + case "$osname" in + hpux) dflt='.sl' ;; + next) dflt='.so' ;; + sunos) dflt='.so' ;; + *) dflt='.so' ;; + esac + ;; + *) dflt="$shlibsuffix" + ;; + esac + rp="What is the suffix used for shared libraries?" + . ./myread + case "$ans" in + none) shlibsuffix='' ;; + *) shlibsuffix="$ans" ;; + esac + ;; +*) usedl="$undef" + : These are currently not used. + dlsrc='' + dlobj='' + dldir='' + lddlflags='' + ccdlflags='' + shlibsuffix='.o' + ;; esac +: see if we have the old dbm +set dbm.h i_dbm +eval $inhdr + +: see if ndbm.h is available +set ndbm.h i_ndbm +eval $inhdr + +: see if gdbm.h is available +set gdbm.h i_gdbm +eval $inhdr + +: see if sdbm.h is wanted echo " " +echo "$package includes an implementation of sdbm in ext/dbm/sdbm." +case "$i_sdbm" in + ''|' ') val="$define" ;; + *) val="$i_sdbm" ;; +esac +set i_sdbm +eval $setvar case "$extensions" in ' '|'') echo "Looking for extensions..." case "$find" in *find*) cd .. - dflt="`$find ext -type f -name \*.xs -print`" + extensions=`$find ext -type f -name \*.xs -print` + set X $extensions + shift + extensions="$*" cd UU ;; - *) dflt='ext/dbm/NDBM_File.xs ext/dbm/ODBM_File.xs ext/dbm/GDBM_File.xs ext/dbm/SDBM_File.xs ext/posix/POSIX.xs' + *) extensions='ext/dbm/NDBM_File.xs ext/dbm/ODBM_File.xs ext/dbm/GDBM_File.xs ext/dbm/SDBM_File.xs ext/posix/POSIX.xs' ;; esac ;; -none) dflt='' ;; -*) dflt="$extensions" ;; +none) extensions='' ;; +*) ;; esac +: Now see which are supported on this system. +dflt="" +for xxx in $extensions ; do + case "$xxx" in + *ODBM*) case "$i_dbm" in + define) dflt="$dflt $xxx" ;; + *) ;; + esac + ;; + *NDBM*) case "$i_ndbm" in + define) dflt="$dflt $xxx" ;; + *) ;; + esac + ;; + *GDBM*) case "$i_gdbm" in + define) dflt="$dflt $xxx" ;; + *) ;; + esac + ;; + *SDBM*) case "$i_sdbm" in + define) dflt="$dflt $xxx" ;; + *) ;; + esac + ;; + *) dflt="$dflt $xxx" + ;; + esac +done + rp="What extensions do you wish to include?" . ./myread extensions="$ans" @@ -4333,7 +4708,9 @@ esac echo " " rp="What is the type for group ids returned by getgid()?" . ./myread -gidtype="$ans" +val="$ans" +set gidtype +eval $setvar : see if getgroups exists set getgroups d_getgrps eval $inlibc @@ -4347,14 +4724,16 @@ case "$d_getgrps" in echo " " $cat <<EOM What is the type of the second argument to getgroups()? Usually this -is the same as group ids, "$gidtype", but not always. +is the same as group ids, $gidtype, but not always. EOM rp="What type is the second arguement to getgroups()?" . ./myread - groupstype="$ans" + val="$ans" ;; -*) groupstype="$gidtype";; +*) val="$gidtype";; esac +set groupstype +eval $setvar : determine where private executables go case "$privlib" in '') @@ -4408,48 +4787,30 @@ rp='Where do you want to put the public libraries?' lib="$ans" libexp="$ansexp" -: determine which malloc to compile in -: Old versions had dflt='y' only for bsd or v7. -echo " " -case "$usemymalloc" in +: determine whether symbolic links are supported +$touch blurfl +if $ln -s blurfl sym > /dev/null 2>&1 ; then + lns="$ln -s" +else + lns="$ln" +fi +rm -f blurfl sym +: see what type lseek is declared as in the kernel +case "$lseektype" in '') - if bsd || v7; then - dflt='y' + if $contains 'off_t;' `./findhdr sys/types.h` >/dev/null 2>&1 ; then + dflt='off_t'; else - dflt='y' + dflt='long'; fi ;; -*) dflt="$usemymalloc" +*) dflt="$lseektype" ;; esac -rp="Do you wish to attempt to use the malloc that comes with $package?" -. ./myread -usemymalloc="$ans" -case "$ans" in -y*) mallocsrc='malloc.c'; mallocobj='malloc.o';; -*) mallocsrc=''; mallocobj='';; -esac - -: compute the type returned by malloc echo " " -case "$malloctype" in -'') - if $test `./findhdr malloc.h`; then - echo "#include <malloc.h>" > malloc.c - fi -#include <malloc.h> - $cat >>malloc.c <<'END' -void *malloc(); -END - if $cc $ccflags -c malloc.c >/dev/null 2>&1; then - malloctype='void *' - else - malloctype='char *' - fi - $rm -f malloc.[co] - ;; -esac -echo "Your system wants malloc to return '$malloctype', it would seem." >&4 +rp="What type is lseek's offset on this system declared as?" +. ./myread +lseektype="$ans" : determine where manual pages go $cat <<EOM @@ -4519,6 +4880,35 @@ case "$mansrc" in *) manext=1;; esac +: check for alignment requirements +echo " " +case "$memalignbytes" in +'') echo "Checking alignment constraints..." >&4 + $cat >try.c <<'EOCP' +struct foobar { + char foo; + double bar; +} try; +main() +{ + printf("%d\n", (char *)&try.bar - (char *)&try.foo); +} +EOCP + if $cc $ccflags try.c -o try >/dev/null 2>&1; then + dflt=`./try` + else + dflt='8' + echo"(I can't seem to compile the test program...)" + fi + ;; +*) dflt="$memalignbytes" + ;; +esac +rp="Doubles must be aligned on a how-many-byte boundary?" +. ./myread +memalignbytes="$ans" +$rm -f try.c try + : Cruising for prototypes echo " " echo "Checking out function prototypes..." >&4 @@ -4537,6 +4927,34 @@ set prototype eval $setvar $rm -f prototype* +: check for length of pointer +echo " " +case "$ptrsize" in +'') + echo "Checking to see how big your pointers are..." >&4 + $cat >try.c <<'EOCP' +#include <stdio.h> +main() +{ + printf("%d\n", sizeof(char *)); +} +EOCP + if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then + dflt=`./try` + else + dflt='4' + echo "(I can't seem to compile the test program. Guessing...)" + fi + ;; +*) + dflt="$ptrsize" + ;; +esac +rp="What is the size of a pointer (in bytes)?" +. ./myread +ptrsize="$ans" +$rm -f try.c try + : check for size of random number generator echo " " case "$randbits" in @@ -4575,6 +4993,47 @@ rp='How many bits does your rand() function produce?' randbits="$ans" $rm -f try.c try +: see if ar generates random libraries by itself +echo " " +echo "Checking how to generate random libraries on your machine..." >&4 +$cat >a.c <<EOP +f() { exit(0); } +EOP +cc -c a.c >/dev/null 2>&1 +ar rc ran.a a.o >/dev/null 2>&1 +$cat >b.c <<EOP +main() { f(); } +EOP +cp ran.a lib.a +if ar ts ran.a >/dev/null 2>&1; then + if $cc -o b b.c lib.a >/dev/null 2>&1; then + echo "ar appears to generate random libraries itself." + orderlib=false + ranlib=":" + else + echo "a table of contents needs to be added with 'ar ts'." + orderlib=false + ranlib="ar ts" + fi +else + if $test -f /usr/bin/ranlib; then + ranlib=/usr/bin/ranlib + elif $test -f /bin/ranlib; then + ranlib=/bin/ranlib + fi + + if $test -n "$ranlib"; then + echo "your system has $ranlib; we'll use that." + orderlib=false + else + echo "your system doesn't seem to support random libraries" + echo "so we'll use lorder and tsort to order the libraries." + orderlib=true + ranlib=":" + fi +fi +$rm -f a.* b.c b.o b ran.a lib.a + : determine where public executables go case "$scriptdir" in '') @@ -4663,8 +5122,18 @@ END { ;; esac echo "The following signals are available:" -echo $sig_name | tr ' ' '\012' | $sed 's/^/ SIG/' - +echo $sig_name | + $awk 'BEGIN { linelen = 0 } + { for (i = 1; i < NF; i++) + { + name = "SIG" $i " " + linelen = linelen + length(name) + if (linelen > 70) + { + printf "\n" + linelen = length(name) + } + printf "%s", name } }' : see what type of char stdio uses. echo " " if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then @@ -4675,6 +5144,34 @@ else stdchar="char" fi +: see if time exists +echo " " +if set time val -f d_time; eval $csym; $val; then + echo 'time() found.' >&4 + val="$define" + case "$timetype" in + '') + if $contains 'time_t;' `./findhdr sys/types.h` >/dev/null 2>&1 ; then + dflt='time_t'; + else + dflt='long'; + fi + ;; + *) dflt="$timetype" + ;; + esac + echo " " + rp="What type is returned by time() on this sytem?" + . ./myread + timetype="$ans" +else + echo 'time() not found, hope that will do.' >&4 + val="$undef" + timetype='int'; +fi +set d_time +eval $setvar + : see what type uids are declared as in the kernel case "$uidtype" in '') @@ -4802,8 +5299,7 @@ if $test -f "$bison"; then rp="$rp or bison -y" fi $cat <<EOM -$package no longer requires a compiler compiler, so the following is -optional. +$package no longer requires a compiler compiler, so the following is optional. EOM rp="Which compiler compiler ($rp) shall I use?" . ./myread @@ -4820,10 +5316,6 @@ case "$yacc" in ;; esac -: see if we have the old dbm -set dbm.h i_dbm -eval $inhdr - : see if this is a sys/file.h system val='' set sys/file.h val @@ -4877,18 +5369,27 @@ esac set i_fcntl eval $setvar -: see if gdbm.h is available -set gdbm.h i_gdbm -eval $inhdr - : see if this is an grp system set grp.h i_grp eval $inhdr -: see if ndbm.h is available -set ndbm.h i_ndbm +: see if memory.h is available. +set memory.h i_memory eval $inhdr - +: See if it conflicts with string.h +case "$i_memory" in +define) + case "$strings" in + '') ;; + *) $cppstdin $cppflags $cppminus < $strings > mem.h + if $contains 'memcpy' mem.h >/dev/null 2>&1; then + echo "We won't be including <memory.h>" + i_memory="$undef" + fi + rm -f mem.h + ;; + esac +esac : see if there are directory access routines out there echo " " if $test `./findhdr ndir.h` && \ @@ -4919,10 +5420,32 @@ else fi fi -: see if this is a netinet/in.h or sys/in.h system -set netinet/in.h i_niin sys/in.h i_sysin +: see if net/errno.h is available +set net/errno.h i_neterrno eval $inhdr - +: Unfortunately, it causes problems on some systems. Arrgh. +case '$i_neterrno' in +'define') echo "<net/errno.h> found." + cat > try.c <<'EOM' +#include <stdio.h> +#include <errno.h> +#include <net/errno.h> +int func() +{ +int x; +x = ENOTSOCK; +return x; +} +EOM + if $cc $ccflags -c try.c >/dev/null 2>&1; then + i_neterrno="$define" + else + echo "But it causes problems, so we won't include it" + i_neterrno="$undef" + fi + $rm -f try.* try + ;; +esac : see if stdarg is available set stdarg.h i_stdarg eval $inhdr @@ -5147,6 +5670,10 @@ case "$flags" in esac $rm -f try.c try +: see if this is a unistd.h system +set unistd.h i_unistd +eval $inhdr + : see if this is an utime system set utime.h i_utime eval $inhdr @@ -5230,9 +5757,12 @@ esac $rm -f varargs* : see if this is a vfork system -set vfork.h i_vfork -eval $inhdr - +case "$d_vfork" in +define) set vfork.h i_vfork + eval $inhdr + ;; +*) i_vfork="$undef";; +esac : end of configuration questions echo " " echo "End of configuration questions." @@ -5274,7 +5804,6 @@ $startsh # Target system: $myuname extensions='$extensions' -d_bsd='$d_bsd' d_eunice='$d_eunice' d_xenix='$d_xenix' eunicefix='$eunicefix' @@ -5345,6 +5874,8 @@ vi='$vi' zcat='$zcat' hint='$hint' myuname='$myuname' +osname='$osname' +osvers='$osvers' Author='$Author' Date='$Date' Header='$Header' @@ -5356,7 +5887,7 @@ Revision='$Revision' Source='$Source' State='$State' afs='$afs' -alignbytes='$alignbytes' +memalignbytes='$memalignbytes' bin='$bin' binexp='$binexp' installbin='$installbin' @@ -5422,6 +5953,9 @@ d_msgsnd='$d_msgsnd' d_open3='$d_open3' d_portable='$d_portable' d_readdir='$d_readdir' +d_rewinddir='$d_rewinddir' +d_seekdir='$d_seekdir' +d_telldir='$d_telldir' d_rename='$d_rename' d_rmdir='$d_rmdir' d_safebcpy='$d_safebcpy' @@ -5448,6 +5982,7 @@ d_setruid='$d_setruid' d_setsid='$d_setsid' d_shm='$d_shm' d_shmat='$d_shmat' +d_voidshmat='$d_voidshmat' d_shmctl='$d_shmctl' d_shmdt='$d_shmdt' d_shmget='$d_shmget' @@ -5468,6 +6003,8 @@ d_syserrlst='$d_syserrlst' d_symlink='$d_symlink' d_syscall='$d_syscall' d_system='$d_system' +d_time='$d_time' +timetype='$timetype' clocktype='$clocktype' d_times='$d_times' d_truncate='$d_truncate' @@ -5484,8 +6021,13 @@ d_charvspr='$d_charvspr' d_vprintf='$d_vprintf' d_wait4='$d_wait4' d_waitpid='$d_waitpid' +cccdlflags='$cccdlflags' +ccdlflags='$ccdlflags' +dldir='$dldir' dlobj='$dlobj' dlsrc='$dlsrc' +lddlflags='$lddlflags' +shlibsuffix='$shlibsuffix' usedl='$usedl' gidtype='$gidtype' groupstype='$groupstype' @@ -5498,7 +6040,9 @@ i_dlfcn='$i_dlfcn' i_fcntl='$i_fcntl' i_gdbm='$i_gdbm' i_grp='$i_grp' +i_memory='$i_memory' i_ndbm='$i_ndbm' +i_neterrno='$i_neterrno' i_niin='$i_niin' i_sysin='$i_sysin' d_pwage='$d_pwage' @@ -5508,6 +6052,7 @@ d_pwcomment='$d_pwcomment' d_pwexpire='$d_pwexpire' d_pwquota='$d_pwquota' i_pwd='$i_pwd' +i_sdbm='$i_sdbm' i_stdarg='$i_stdarg' i_stddef='$i_stddef' i_string='$i_string' @@ -5527,6 +6072,7 @@ i_systime='$i_systime' i_systimek='$i_systimek' i_time='$i_time' timeincl='$timeincl' +i_unistd='$i_unistd' i_utime='$i_utime' i_varargs='$i_varargs' i_varhdr='$i_varhdr' @@ -5539,6 +6085,9 @@ libpth='$libpth' plibpth='$plibpth' xlibpth='$xlibpth' libs='$libs' +lns='$lns' +lseektype='$lseektype' +d_mymalloc='$d_mymalloc' mallocobj='$mallocobj' mallocsrc='$mallocsrc' malloctype='$malloctype' @@ -5561,12 +6110,15 @@ n='$n' groupcat='$groupcat' hostcat='$hostcat' passcat='$passcat' +orderlib='$orderlib' +ranlib='$ranlib' package='$package' spackage='$spackage' installprivlib='$installprivlib' privlib='$privlib' privlibexp='$privlibexp' prototype='$prototype' +ptrsize='$ptrsize' randbits='$randbits' installscript='$installscript' scriptdir='$scriptdir' |