From de64de47f7150f9a23ee0bb6d23c1082e8c5e551 Mon Sep 17 00:00:00 2001 From: Michael Schwern Date: Thu, 19 Dec 2002 00:00:00 -0800 Subject: Perl 1.0.15 As a birthday present to Perl and Larry, through the work of the perl1-porters, in particular Richard Clamp, resurrected here is Perl 1.0 with minimal patches for modern machines. --- Configure | 5503 +++++++++++++++++++++++++++++++++++++++----------- MANIFEST | 98 +- Makefile | 649 ++++++ Makefile.SH | 2 +- README | 11 +- all | 0 arg.c | 8 +- array.c | 2 +- cmd.h | 2 +- config.H | 80 - config.h | 190 ++ config.h.SH | 161 -- config_H | 80 + config_h.SH | 209 ++ form.c | 2 +- hints/3b1.sh | 15 + hints/3b1cc | 88 + hints/README.hints | 318 +++ hints/aix.sh | 518 +++++ hints/altos486.sh | 3 + hints/amigaos.sh | 55 + hints/apollo.sh | 55 + hints/atheos.sh | 35 + hints/aux_3.sh | 22 + hints/beos.sh | 62 + hints/broken-db.msg | 14 + hints/bsdos.sh | 130 ++ hints/convexos.sh | 12 + hints/cxux.sh | 106 + hints/cygwin.sh | 42 + hints/darwin.sh | 148 ++ hints/dcosx.sh | 188 ++ hints/dec_osf.sh | 523 +++++ hints/dgux.sh | 239 +++ hints/dos_djgpp.sh | 76 + hints/dynix.sh | 7 + hints/dynixptx.sh | 60 + hints/epix.sh | 66 + hints/esix4.sh | 36 + hints/fps.sh | 1 + hints/freebsd.sh | 256 +++ hints/genix.sh | 1 + hints/gnu.sh | 33 + hints/greenhills.sh | 1 + hints/hpux.sh | 598 ++++++ hints/i386.sh | 1 + hints/irix_4.sh | 45 + hints/irix_5.sh | 55 + hints/irix_6.sh | 361 ++++ hints/irix_6_0.sh | 64 + hints/irix_6_1.sh | 64 + hints/isc.sh | 44 + hints/isc_2.sh | 25 + hints/linux.sh | 284 +++ hints/lynxos.sh | 19 + hints/machten.sh | 279 +++ hints/machten_2.sh | 94 + hints/mint.sh | 94 + hints/mips.sh | 14 + hints/mpc.sh | 1 + hints/mpeix.sh | 163 ++ hints/ncr_tower.sh | 16 + hints/netbsd.sh | 146 ++ hints/newsos4.sh | 33 + hints/next_3.sh | 141 ++ hints/next_3_0.sh | 53 + hints/next_4.sh | 102 + hints/nonstopux.sh | 20 + hints/openbsd.sh | 134 ++ hints/opus.sh | 1 + hints/os2.sh | 484 +++++ hints/os390.sh | 218 ++ hints/posix-bc.sh | 172 ++ hints/powerux.sh | 218 ++ hints/qnx.sh | 249 +++ hints/rhapsody.sh | 77 + hints/sco.sh | 243 +++ hints/sco_2_3_0.sh | 2 + hints/sco_2_3_1.sh | 2 + hints/sco_2_3_2.sh | 2 + hints/sco_2_3_3.sh | 3 + hints/sco_2_3_4.sh | 5 + hints/solaris_2.sh | 603 ++++++ hints/stellar.sh | 2 + hints/sunos_4_0.sh | 2 + hints/sunos_4_1.sh | 84 + hints/super-ux.sh | 20 + hints/svr4.sh | 163 ++ hints/svr5.sh | 226 +++ hints/t001.c | 90 + hints/ti1500.sh | 1 + hints/titanos.sh | 38 + hints/ultrix_4.sh | 70 + hints/umips.sh | 39 + hints/unicos.sh | 54 + hints/unicosmk.sh | 46 + hints/unisysdynix.sh | 1 + hints/utekv.sh | 12 + hints/uts.sh | 32 + hints/uwin.sh | 36 + hints/vmesa.sh | 336 +++ hints/vos.sh | 145 ++ makedepend | 126 ++ makedepend.SH | 2 +- makedir | 58 + patchlevel.h | 2 +- perl.h | 2 - perl.y | 1 - perly.c | 7 +- stab.c | 10 +- t/TEST | 4 +- t/base.cond | 0 t/base.if | 0 t/base.lex | 0 t/base.pat | 0 t/base.term | 2 +- t/cmd.elsif | 0 t/cmd.for | 0 t/cmd.mod | 0 t/cmd.subval | 0 t/cmd.while | 0 t/comp.cmdopt | 0 t/comp.cpp | 0 t/comp.decl | 0 t/comp.multiline | 0 t/comp.script | 0 t/comp.term | 0 t/io.argv | 0 t/io.fs | 0 t/io.inplace | 0 t/io.print | 0 t/io.tell | 0 t/op.append | 0 t/op.auto | 0 t/op.chop | 0 t/op.cond | 0 t/op.crypt | 0 t/op.do | 0 t/op.each | 0 t/op.eval | 0 t/op.exec | 0 t/op.exp | 0 t/op.flip | 2 +- t/op.fork | 0 t/op.goto | 0 t/op.int | 0 t/op.join | 0 t/op.list | 0 t/op.magic | 0 t/op.oct | 0 t/op.ord | 0 t/op.pat | 0 t/op.push | 0 t/op.repeat | 0 t/op.sleep | 0 t/op.split | 0 t/op.sprintf | 0 t/op.stat | 0 t/op.subst | 0 t/op.time | 4 +- t/op.unshift | 0 t/perl | 1 + util.c | 2 +- util.h | 2 +- 164 files changed, 15406 insertions(+), 1452 deletions(-) create mode 100644 Makefile create mode 100644 all delete mode 100644 config.H create mode 100644 config.h delete mode 100644 config.h.SH create mode 100644 config_H create mode 100644 config_h.SH create mode 100644 hints/3b1.sh create mode 100644 hints/3b1cc create mode 100644 hints/README.hints create mode 100644 hints/aix.sh create mode 100644 hints/altos486.sh create mode 100644 hints/amigaos.sh create mode 100644 hints/apollo.sh create mode 100644 hints/atheos.sh create mode 100644 hints/aux_3.sh create mode 100644 hints/beos.sh create mode 100644 hints/broken-db.msg create mode 100644 hints/bsdos.sh create mode 100644 hints/convexos.sh create mode 100644 hints/cxux.sh create mode 100644 hints/cygwin.sh create mode 100644 hints/darwin.sh create mode 100644 hints/dcosx.sh create mode 100644 hints/dec_osf.sh create mode 100644 hints/dgux.sh create mode 100644 hints/dos_djgpp.sh create mode 100644 hints/dynix.sh create mode 100644 hints/dynixptx.sh create mode 100644 hints/epix.sh create mode 100644 hints/esix4.sh create mode 100644 hints/fps.sh create mode 100644 hints/freebsd.sh create mode 100644 hints/genix.sh create mode 100644 hints/gnu.sh create mode 100644 hints/greenhills.sh create mode 100644 hints/hpux.sh create mode 100644 hints/i386.sh create mode 100644 hints/irix_4.sh create mode 100644 hints/irix_5.sh create mode 100644 hints/irix_6.sh create mode 100644 hints/irix_6_0.sh create mode 100644 hints/irix_6_1.sh create mode 100644 hints/isc.sh create mode 100644 hints/isc_2.sh create mode 100644 hints/linux.sh create mode 100644 hints/lynxos.sh create mode 100644 hints/machten.sh create mode 100644 hints/machten_2.sh create mode 100644 hints/mint.sh create mode 100644 hints/mips.sh create mode 100644 hints/mpc.sh create mode 100644 hints/mpeix.sh create mode 100644 hints/ncr_tower.sh create mode 100644 hints/netbsd.sh create mode 100644 hints/newsos4.sh create mode 100644 hints/next_3.sh create mode 100644 hints/next_3_0.sh create mode 100644 hints/next_4.sh create mode 100644 hints/nonstopux.sh create mode 100644 hints/openbsd.sh create mode 100644 hints/opus.sh create mode 100644 hints/os2.sh create mode 100644 hints/os390.sh create mode 100644 hints/posix-bc.sh create mode 100644 hints/powerux.sh create mode 100644 hints/qnx.sh create mode 100644 hints/rhapsody.sh create mode 100644 hints/sco.sh create mode 100644 hints/sco_2_3_0.sh create mode 100644 hints/sco_2_3_1.sh create mode 100644 hints/sco_2_3_2.sh create mode 100644 hints/sco_2_3_3.sh create mode 100644 hints/sco_2_3_4.sh create mode 100644 hints/solaris_2.sh create mode 100644 hints/stellar.sh create mode 100644 hints/sunos_4_0.sh create mode 100644 hints/sunos_4_1.sh create mode 100644 hints/super-ux.sh create mode 100644 hints/svr4.sh create mode 100644 hints/svr5.sh create mode 100644 hints/t001.c create mode 100644 hints/ti1500.sh create mode 100644 hints/titanos.sh create mode 100644 hints/ultrix_4.sh create mode 100644 hints/umips.sh create mode 100644 hints/unicos.sh create mode 100644 hints/unicosmk.sh create mode 100644 hints/unisysdynix.sh create mode 100644 hints/utekv.sh create mode 100644 hints/uts.sh create mode 100644 hints/uwin.sh create mode 100644 hints/vmesa.sh create mode 100644 hints/vos.sh create mode 100755 makedepend create mode 100755 makedir mode change 100644 => 100755 t/TEST mode change 100644 => 100755 t/base.cond mode change 100644 => 100755 t/base.if mode change 100644 => 100755 t/base.lex mode change 100644 => 100755 t/base.pat mode change 100644 => 100755 t/base.term mode change 100644 => 100755 t/cmd.elsif mode change 100644 => 100755 t/cmd.for mode change 100644 => 100755 t/cmd.mod mode change 100644 => 100755 t/cmd.subval mode change 100644 => 100755 t/cmd.while mode change 100644 => 100755 t/comp.cmdopt mode change 100644 => 100755 t/comp.cpp mode change 100644 => 100755 t/comp.decl mode change 100644 => 100755 t/comp.multiline mode change 100644 => 100755 t/comp.script mode change 100644 => 100755 t/comp.term mode change 100644 => 100755 t/io.argv mode change 100644 => 100755 t/io.fs mode change 100644 => 100755 t/io.inplace mode change 100644 => 100755 t/io.print mode change 100644 => 100755 t/io.tell mode change 100644 => 100755 t/op.append mode change 100644 => 100755 t/op.auto mode change 100644 => 100755 t/op.chop mode change 100644 => 100755 t/op.cond mode change 100644 => 100755 t/op.crypt mode change 100644 => 100755 t/op.do mode change 100644 => 100755 t/op.each mode change 100644 => 100755 t/op.eval mode change 100644 => 100755 t/op.exec mode change 100644 => 100755 t/op.exp mode change 100644 => 100755 t/op.flip mode change 100644 => 100755 t/op.fork mode change 100644 => 100755 t/op.goto mode change 100644 => 100755 t/op.int mode change 100644 => 100755 t/op.join mode change 100644 => 100755 t/op.list mode change 100644 => 100755 t/op.magic mode change 100644 => 100755 t/op.oct mode change 100644 => 100755 t/op.ord mode change 100644 => 100755 t/op.pat mode change 100644 => 100755 t/op.push mode change 100644 => 100755 t/op.repeat mode change 100644 => 100755 t/op.sleep mode change 100644 => 100755 t/op.split mode change 100644 => 100755 t/op.sprintf mode change 100644 => 100755 t/op.stat mode change 100644 => 100755 t/op.subst mode change 100644 => 100755 t/op.time mode change 100644 => 100755 t/op.unshift create mode 120000 t/perl diff --git a/Configure b/Configure index 991f3bbae1..e4fa1a27fc 100755 --- a/Configure +++ b/Configure @@ -1,1461 +1,4616 @@ #! /bin/sh # -# If these # comments don't work, trim them. Don't worry about any other +# If these # comments don't work, trim them. Don't worry about any other # shell scripts, Configure will trim # comments from them for you. # -# (If you are trying to port this package to a machine without sh, I would -# suggest you cut out the prototypical config.h from the end of Configure -# and edit it to reflect your system. Some packages may include samples +# (If you are trying to port this package to a machine without sh, +# I would suggest you have a look at the prototypical config_h.SH file +# and edit it to reflect your system. Some packages may include samples # of config.h for certain machines, so you might look for one of those.) # -# $Header: Configure,v 1.0.1.6 88/02/02 11:20:07 root Exp $ +# Yes, you may rip this off to use in other distribution packages. This +# script belongs to the public domain and cannot be copyrighted. # -# Yes, you may rip this off to use in other distribution packages. -# (Note: this Configure script was generated automatically. Rather than -# working with this copy of Configure, you may wish to get metaconfig.) +# (Note: this Configure script was generated automatically. Rather than +# working with this copy of Configure, you may wish to get metaconfig. +# The dist-3.0 package (which contains metaconfig) was posted in +# comp.sources.misc and is available on CPAN under authors/id/RAM so +# you may fetch it yourself from your nearest archive site.) +# + +# $Id: Configure 821 2002-10-22 11:14:00Z richardc $ +# +# Generated on Mon Aug 5 21:38:20 BST 2002 [metaconfig 3.0 PL70] + +cat >/tmp/c1$$ </tmp/c2$$ </dev/null` + test "$me" || me=$0 + ;; +esac + +: Proper PATH separator +p_=: +: On OS/2 this directory should exist if this is not floppy only system :-] +if test -d c:/.; then + p_=\; + PATH=`cmd /c "echo %PATH%" | tr '\\\\' / ` + OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'` fi -(alias) >/dev/null 2>&1 && \ - echo "(I see you are using the Korn shell. Some ksh's blow up on Configure," && \ - echo "especially on exotic machines. If yours does, try the Bourne shell instead.)" +: Proper PATH setting +paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin' +paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin" +paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin" +paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin" +paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb" +paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin" +paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib" +paths="$paths /sbin /usr/sbin /usr/libexec" -if test ! -d ../UU; then - if test ! -d UU; then - mkdir UU - fi - cd UU +for p in $paths +do + case "$p_$PATH$p_" in + *$p_$p$p_*) ;; + *) test -d $p && PATH=$PATH$p_$p ;; + esac +done + +PATH=.$p_$PATH +export PATH + +: shall we be using ksh? +inksh='' +needksh='' +avoidksh='' +newsh=/bin/ksh +changesh='' +if (PATH=.; alias -x) >/dev/null 2>&1; then + inksh=true +fi +if test -f /hp-ux -a -f /bin/ksh; then + needksh='to avoid sh bug in "here document" expansion' +fi +if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then + if test X`/usr/bin/uname -v` = X4; then + avoidksh="to avoid AIX 4's /bin/sh" + newsh=/usr/bin/bsh + fi fi +case "$inksh/$needksh" in +/[a-z]*) + unset ENV + changesh=true + reason="$needksh" + ;; +esac +case "$inksh/$avoidksh" in +true/[a-z]*) + changesh=true + reason="$avoidksh" + ;; +esac +case "$inksh/$needksh-$avoidksh-" in +true/--) + cat <&2 +$me: Fatal Error: I can't find a Bourne Shell anywhere. + +Usually it's in /bin/sh. How did you even get this far? +Please contact me () at perl1-porters@perl.org and +we'll try to straighten this all out. +EOM + exit 1 + ;; +esac + +: see if sh knows # comments +if `$sh -c '#' >/dev/null 2>&1`; then + shsharp=true + spitshell=cat + xcat=/bin/cat + test -f $xcat || xcat=/usr/bin/cat + echo "#!$xcat" >try + $eunicefix try + chmod +x try + ./try > today + if test -s today; then + sharpbang='#!' + else + echo "#! $xcat" > try + $eunicefix try + chmod +x try + ./try > today + if test -s today; then + sharpbang='#! ' + else + sharpbang=': use ' + fi + fi +else + echo " " + echo "Your $sh doesn't grok # comments--I will strip them later on." + shsharp=false + cd .. + echo "exec grep -v '^[ ]*#'" >spitshell + chmod +x spitshell + $eunicefix spitshell + spitshell=`pwd`/spitshell + cd UU + echo "I presume that if # doesn't work, #! won't work either!" + sharpbang=': use ' +fi +rm -f try today + +: figure out how to guarantee sh startup +case "$startsh" in +'') startsh=${sharpbang}${sh} ;; +*) +esac +cat >try <options.awk <<'EOF' +BEGIN { + optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification + + len = length(optstr); + for (i = 1; i <= len; i++) { + c = substr(optstr, i, 1); + if (i < len) a = substr(optstr, i + 1, 1); else a = ""; + if (a == ":") { + arg[c] = 1; + i++; + } + opt[c] = 1; + } +} +{ + expect = 0; + str = $0; + if (substr(str, 1, 1) != "-") { + printf("'%s'\n", str); + next; + } + len = length($0); + for (i = 2; i <= len; i++) { + c = substr(str, i, 1); + if (!opt[c]) { + printf("-%s\n", substr(str, i)); + next; + } + printf("-%s\n", c); + if (arg[c]) { + if (i < len) + printf("'%s'\n", substr(str, i + 1)); + else + expect = 1; + next; + } + } +} +END { + if (expect) + print "?"; +} +EOF + +: process the command line options +set X `for arg in "$@"; do echo "X$arg"; done | + sed -e s/X// | awk -f options.awk` +eval "set $*" +shift +rm -f options.awk + +: set up default values +fastread='' +reuseval=false +config_sh='' +alldone='' +error='' +silent='' +extractsh='' +override='' +knowitall='' +rm -f optdef.sh +cat >optdef.sh <&2 + error=true + fi + cd UU + shift;; + -h) shift; error=true;; + -r) shift; reuseval=true;; + -s) shift; silent=true; realsilent=true;; + -E) shift; alldone=exit;; + -K) shift; knowitall=true;; + -O) shift; override=true;; + -S) shift; silent=true; extractsh=true;; + -D) + shift + case "$1" in + *=) + echo "$me: use '-U symbol=', not '-D symbol='." >&2 + echo "$me: ignoring -D $1" >&2 + ;; + *=*) echo "$1" | \ + sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;; + *) echo "$1='define'" >> optdef.sh;; + esac + shift + ;; + -U) + shift + case "$1" in + *=) echo "$1" >> optdef.sh;; + *=*) + echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2 + echo "$me: ignoring -U $1" >&2 + ;; + *) echo "$1='undef'" >> optdef.sh;; + esac + shift + ;; + -V) echo "$me generated by metaconfig 3.0 PL70." >&2 + exit 0;; + --) break;; + -*) echo "$me: unknown option $1" >&2; shift; error=true;; + *) break;; + esac +done + +case "$error" in +true) + cat >&2 <&1 +case "$silent" in +true) exec 1>/dev/null;; +esac + +: run the defines and the undefines, if any, but leave the file out there... +touch optdef.sh +. ./optdef.sh + : set package name package=perl +first=`echo $package | sed -e 's/^\(.\).*/\1/'` +last=`echo $package | sed -e 's/^.\(.*\)/\1/'` +case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in +ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;; +*) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;; +esac -echo " " -echo "Beginning of configuration questions for $package kit." -: Eunice requires " " instead of "", can you believe it -echo " " - -define='define' -undef='/*undef' -libpth='/usr/lib /usr/local/lib /lib' -smallmach='pdp11 i8086 z8000 i80286 iAPX286' -rmlist='kit[1-9]isdone kit[1-9][0-9]isdone' -trap 'echo " "; rm -f $rmlist; exit 1' 1 2 3 -attrlist="mc68000 sun gcos unix ibm gimpel interdata tss os mert pyr" -attrlist="$attrlist vax pdp11 i8086 z8000 u3b2 u3b5 u3b20 u3b200" -attrlist="$attrlist ns32000 ns16000 iAPX286 mc300 mc500 mc700 sparc" -pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /etc /usr/lib" -defvoidused=7 - -: some greps do not return status, grrr. +: Some greps do not return status, grrr. echo "grimblepritz" >grimble if grep blurfldyick grimble >/dev/null 2>&1 ; then - contains=contains + contains=contains elif grep grimblepritz grimble >/dev/null 2>&1 ; then - contains=grep + contains=grep else - contains=contains + contains=contains fi rm -f grimble : the following should work in any shell case "$contains" in contains*) - echo " " - echo "AGH! Grep doesn't return a status. Attempting remedial action." - cat >contains <<'EOSS' + echo " " + echo "AGH! Grep doesn't return a status. Attempting remedial action." + cat >contains <<'EOSS' grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp EOSS -chmod 755 contains +chmod +x contains esac : first determine how to suppress newline on echo command +echo " " echo "Checking echo to see how to suppress newlines..." (echo "hi there\c" ; echo " ") >.echotmp if $contains c .echotmp >/dev/null 2>&1 ; then - echo "...using -n." - n='-n' - c='' + echo "...using -n." + n='-n' + c='' else - cat <<'EOM' + cat <<'EOM' ...using \c EOM - n='' - c='\c' + n='' + c='\c' fi -echo $n "Type carriage return to continue. Your cursor should be here-->$c" -read ans +echo $n "The star should be here-->$c" +echo '*' rm -f .echotmp +: compute the number of columns on the terminal for proper question formatting +case "$COLUMNS" in +'') COLUMNS='80';; +esac + +: set up the echo used in my read +myecho="case \"\$xxxm\" in +'') echo $n \"\$rp $c\" >&4;; +*) case \"\$rp\" in + '') echo $n \"[\$xxxm] $c\";; + *) + if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then + echo \"\$rp\" >&4 + echo $n \"[\$xxxm] $c\" >&4 + else + echo $n \"\$rp [\$xxxm] $c\" >&4 + fi + ;; + esac;; +esac" + : now set up to do reads with possible shell escape and default assignment cat <myread +$startsh +xxxm=\$dflt +$myecho ans='!' +case "\$fastread" in +yes) case "\$dflt" in + '') ;; + *) ans=''; + case "\$silent-\$rp" in + true-) ;; + *) echo " " >&4;; + esac;; + esac;; +*) case "\$silent" in + true) case "\$rp" in + '') ans='';; + esac;; + esac;; +esac while expr "X\$ans" : "X!" >/dev/null; do - read ans - case "\$ans" in - !) - sh - echo " " - echo $n "\$rp $c" - ;; - !*) - set \`expr "X\$ans" : "X!\(.*\)\$"\` - sh -c "\$*" - echo " " - echo $n "\$rp $c" - ;; - esac + read answ + set x \$xxxm + shift + aok=''; eval "ans=\\"\$answ\\"" && aok=y + case "\$answ" in + "!") + sh 1>&4 + echo " " + $myecho + ;; + !*) + set x \`expr "X\$ans" : "X!\(.*\)\$"\` + shift + sh 1>&4 -c "\$*" + echo " " + $myecho + ;; + "\$ans") + case "\$ans" in + \\&*) + set x \`expr "X\$ans" : "X&\(.*\)\$"\` + shift + case "\$1" in + -d) + fastread=yes + echo "(OK, I'll run with -d after this question.)" >&4 + ;; + -*) + echo "*** Sorry, \$1 not supported yet." >&4 + ;; + esac + $myecho + ans=! + ;; + esac;; + *) + case "\$aok" in + y) + echo "*** Substitution done -- please confirm." + xxxm="\$ans" + ans=\`echo $n "\$ans$c" | tr '\012' ' '\` + xxxm="\$ans" + ans=! + ;; + *) + echo "*** Error -- try again." + ans=! + ;; + esac + $myecho + ;; + esac + case "\$ans\$xxxm\$nostick" in + '') + ans=! + $myecho + ;; + esac done -rp='Your answer:' case "\$ans" in -'') ans="\$dflt";; +'') ans="\$xxxm";; esac EOSC -: general instructions -cat <loc -$startsh -case \$# in -0) exit 1;; +: Find the path to the source tree +case "$src" in +'') src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;; esac -thing=\$1 -shift -dflt=\$1 -shift -for dir in \$*; do - case "\$thing" in - .) - if test -d \$dir/\$thing; then - echo \$dir - exit 0 - fi +case "$src" in +'') + src=. + rsrc=.. ;; - *) - if test -f \$dir/\$thing; then - echo \$dir/\$thing - exit 0 +/*) rsrc="$src/..";; +*) rsrc="../$src";; +esac +if test -f $rsrc/Configure && \ + $contains "^package=$package" $rsrc/Configure >/dev/null 2>&1 +then + : found it, so we are ok. +else + rsrc='' + for src in . .. ../.. ../../.. ../../../..; do + if test -f ../$src/Configure && \ + $contains "^package=$package" ../$src/Configure >/dev/null 2>&1 + then + rsrc=../$src + break + fi + done +fi +case "$rsrc" in +'') + echo " " + dflt= + rp="Directory where sources for $package are located?" + . ./myread + src="$ans" + rsrc="$src" + if test -f $rsrc/Configure && \ + $contains "^package=$package" $rsrc/Configure >/dev/null 2>&1 + then + echo "Ok, I've found them under $src" + else + echo "Sorry, I can't seem to be able to locate $package sources." >&4 + exit 1 fi ;; - esac +../.) ;; +*) + echo " " + echo "Sources for $package found in $src" >&4 + ;; +esac + +: script used to extract .SH files with variable substitutions +cat >extract <<'EOS' +CONFIG=true +echo "Doing variable substitutions on .SH files..." +if test -f $src/MANIFEST; then + set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH'` +else + echo "(Looking for .SH files under the source directory.)" + set x `(cd $src; find . -name "*.SH" -print)` +fi +shift +case $# in +0) set x `(cd $src; echo *.SH)`; shift;; +esac +if test ! -f $src/$1; then + shift +fi +mkdir_p=' +name=$1; +create=""; +while test $name; do + if test ! -d "$name"; then + create="$name $create"; + name=`echo $name | sed -e "s|^[^/]*$||"`; + name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`; + else + name=""; + fi; +done; +for file in $create; do + mkdir $file; +done +' +for file in $*; do + case "$src" in + ".") + case "$file" in + */*) + dir=`expr X$file : 'X\(.*\)/'` + file=`expr X$file : 'X.*/\(.*\)'` + (cd $dir && . ./$file) + ;; + *) + . ./$file + ;; + esac + ;; + *) + case "$file" in + */*) + dir=`expr X$file : 'X\(.*\)/'` + file=`expr X$file : 'X.*/\(.*\)'` + (set x $dir; shift; eval $mkdir_p) + sh <$src/$dir/$file + ;; + *) + sh <$src/$file + ;; + esac + ;; + esac +done +if test -f $src/config_h.SH; then + if test ! -f config.h; then + : oops, they left it out of MANIFEST, probably, so do it anyway. + . $src/config_h.SH + fi +fi +EOS + +: extract files and exit if asked to do so +case "$extractsh" in +true) + case "$realsilent" in + true) ;; + *) exec 1>&4;; + esac + case "$config_sh" in + '') config_sh='config.sh'; config="$rsrc/config.sh";; + /*) config="$config_sh";; + *) config="$rsrc/$config_sh";; + esac + echo " " + echo "Fetching answers from $config_sh..." + . $config + test "$override" && . ./optdef.sh + echo " " + cd .. + . UU/extract + rm -rf UU + echo "Done." + exit 0 + ;; +esac + +: Eunice requires " " instead of "", can you believe it +echo " " +: Here we go... +echo "Beginning of configuration questions for $package." + +trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15 + +: Now test for existence of everything in MANIFEST +echo " " +if test -f $rsrc/MANIFEST; then + echo "First let's make sure your kit is complete. Checking..." >&4 + awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50 + rm -f missing + tmppwd=`pwd` + for filelist in x??; do + (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing) + done + if test -s missing; then + cat missing >&4 + cat >&4 <<'EOM' + +THIS PACKAGE SEEMS TO BE INCOMPLETE. + +You have the option of continuing the configuration process, despite the +distinct possibility that your kit is damaged, by typing 'y'es. If you +do, don't blame me if something goes wrong. I advise you to type 'n'o +and contact the author (perl1-porters@perl.org). + +EOM + echo $n "Continue? [n] $c" >&4 + read ans + case "$ans" in + y*) + echo "Continuing..." >&4 + rm -f missing + ;; + *) + echo "ABORTING..." >&4 + kill $$ + ;; + esac + else + echo "Looks good..." + fi +else + echo "There is no MANIFEST file. I hope your kit is complete !" +fi +rm -f missing x?? + +: create .config dir to save info across Configure sessions +test -d ../.config || mkdir ../.config +cat >../.config/README </dev/null` +case "$user" in +'') user=`whoami 2>&1`;; +esac +if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then + firsttime=false + echo " " + rp='Would you like to see the instructions?' + dflt=n + . ./myread + case "$ans" in + [yY]*) ;; + *) needman=false;; + esac +fi +if $needman; then + cat <>../.config/instruct;; + esac +fi + +: find out where common programs are +echo " " +echo "Locating common programs..." >&4 +cat <loc +$startsh +case \$# in +0) exit 1;; +esac +thing=\$1 +shift +dflt=\$1 +shift +for dir in \$*; do + case "\$thing" in + .) + if test -d \$dir/\$thing; then + echo \$dir + exit 0 + fi + ;; + *) + for thisthing in \$dir/\$thing; do + : just loop through to pick last item + done + if test -f \$thisthing; then + echo \$thisthing + exit 0 + elif test -f \$dir/\$thing.exe; then + : on Eunice apparently + echo \$dir/\$thing + exit 0 + fi + ;; + esac done echo \$dflt exit 1 EOSC -chmod 755 loc +chmod +x loc $eunicefix loc loclist=" -expr -sed -echo +awk cat -rm -mv cp -tr +echo +expr +grep mkdir +mv +rm +sed sort +touch +tr uniq -grep " trylist=" -test -egrep Mcc +cpp +date +egrep +ln +nroff +test +uname " +pth=`echo $PATH | sed -e "s/$p_/ /g"` +pth="$pth /lib /usr/lib" for file in $loclist; do - xxx=`loc $file $file $pth` - eval $file=$xxx - eval _$file=$xxx - case "$xxx" in - /*) - echo $file is in $xxx. - ;; - *) - echo "I don't know where $file is. I hope it's in everyone's PATH." - ;; - esac + eval xxx=\$$file + case "$xxx" in + /*|?:[\\/]*) + if test -f "$xxx"; then + : ok + else + echo "WARNING: no $xxx -- ignoring your setting for $file." >&4 + xxx=`./loc $file $file $pth` + fi + ;; + '') xxx=`./loc $file $file $pth`;; + *) xxx=`./loc $xxx $xxx $pth`;; + esac + eval $file=$xxx + eval _$file=$xxx + case "$xxx" in + /*) + echo $file is in $xxx. + ;; + ?:[\\/]*) + echo $file is in $xxx. + ;; + *) + echo "I don't know where '$file' is, and my life depends on it." >&4 + echo "Go find a public domain implementation or fix your PATH setting!" >&4 + exit 1 + ;; + esac done echo " " echo "Don't worry if any of the following aren't found..." -ans=offhand +say=offhand for file in $trylist; do - xxx=`loc $file $file $pth` - eval $file=$xxx - eval _$file=$xxx - case "$xxx" in - /*) - echo $file is in $xxx. - ;; - *) - echo "I don't see $file out there, $ans." - ans=either - ;; - esac + eval xxx=\$$file + case "$xxx" in + /*|?:[\\/]*) + if test -f "$xxx"; then + : ok + else + echo "WARNING: no $xxx -- ignoring your setting for $file." >&4 + xxx=`./loc $file $file $pth` + fi + ;; + '') xxx=`./loc $file $file $pth`;; + *) xxx=`./loc $xxx $xxx $pth`;; + esac + eval $file=$xxx + eval _$file=$xxx + case "$xxx" in + /*) + echo $file is in $xxx. + ;; + ?:[\\/]*) + echo $file is in $xxx. + ;; + *) + echo "I don't see $file out there, $say." + say=either + ;; + esac done case "$egrep" in egrep) - echo "Substituting grep for egrep." - egrep=$grep - ;; + echo "Substituting grep for egrep." + egrep=$grep + ;; +esac +case "$ln" in +ln) + echo "Substituting cp for ln." + ln=$cp + ;; esac case "$test" in test) - echo "Hopefully test is built into your sh." - ;; -/bin/test) - echo " " - dflt=n - rp="Is your "'"'"test"'"'" built into sh? [$dflt] (OK to guess)" - echo $n "$rp $c" - . myread - case "$ans" in - y*) test=test ;; - esac - ;; + echo "Hopefully test is built into your sh." + ;; *) - test=test - ;; + if `sh -c "PATH= test true" >/dev/null 2>&1`; then + echo "Using the test built into your sh." + test=test + _test=test + fi + ;; esac case "$echo" in echo) - echo "Hopefully echo is built into your sh." - ;; -/bin/echo) - echo " " - echo "Checking compatibility between /bin/echo and builtin echo (if any)..." - $echo $n "hi there$c" >foo1 - echo $n "hi there$c" >foo2 - if cmp foo1 foo2 >/dev/null 2>&1; then - echo "They are compatible. In fact, they may be identical." - else - case "$n" in - '-n') n='' c='\c' ans='\c' ;; - *) n='-n' c='' ans='-n' ;; - esac - cat <&4 + $echo $n "hi there$c" >foo1 + echo $n "hi there$c" >foo2 + if cmp foo1 foo2 >/dev/null 2>&1; then + echo "They are compatible. In fact, they may be identical." + else + case "$n" in + '-n') n='' c='\c';; + *) n='-n' c='';; + esac + cat <$c" + $echo "*" + fi + $rm -f foo1 foo2 + ;; esac -rmlist="$rmlist loc" -: get list of predefined functions in a handy place +: determine whether symbolic links are supported echo " " -if test -f /lib/libc.a; then - echo "Your C library is in /lib/libc.a. You're normal." - libc=/lib/libc.a +$touch blurfl +if $ln -s blurfl sym > /dev/null 2>&1 ; then + echo "Symbolic links are supported." >&4 + lns="$ln -s" else - ans=`loc libc.a blurfl/dyick $libpth` - if test -f $ans; then - echo "Your C library is in $ans, of all places." - libc=$ans - else - if test -f "$libc"; then - echo "Your C library is in $libc, like you said before." - else - cat <&4 + lns="$ln" +fi +$rm -f blurfl sym - $libpth +: see whether [:lower:] and [:upper:] are supported character classes +echo " " +up='[A-Z]' +low='[a-z]' +case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in +ABYZ) + echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4 + up='[:upper:]' + low='[:lower:]' + ;; +*) + echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4 + ;; +esac +: set up the translation script tr, must be called with ./tr of course +cat >tr </dev/null || hostname) 2>&1` +myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \ + ./tr '[A-Z]' '[a-z]' | tr '\012' ' '` +newmyuname="$myuname" +dflt=n +case "$knowitall" in +'') + if test -f ../config.sh; then + if $contains myuname= ../config.sh >/dev/null 2>&1; then + eval "`grep myuname= ../config.sh`" + fi + if test "X$myuname" = "X$newmyuname"; then + dflt=y + fi fi - fi -fi -echo " " -$echo $n "Extracting names from $libc for later perusal...$c" -if ar t $libc > libc.list; then - echo "done" -else - echo " " - echo "The archiver doesn't think $libc is a reasonable library." - echo "Trying nm instead..." - if nm -g $libc > libc.list; then - echo "Done. Maybe this is Unicos, or an Apollo?" - else - echo "That didn't work either. Giving up." - exit 1 - fi -fi -rmlist="$rmlist libc.list" + ;; +*) dflt=y;; +esac -: make some quick guesses about what we are up against -echo " " -$echo $n "Hmm... $c" -if $contains SIGTSTP /usr/include/signal.h >/dev/null 2>&1 ; then - echo "Looks kind of like a BSD system, but we'll see..." - echo exit 0 >bsd - echo exit 1 >usg - echo exit 1 >v7 -elif $contains fcntl libc.list >/dev/null 2>&1 ; then - echo "Looks kind of like a USG system, but we'll see..." - echo exit 1 >bsd - echo exit 0 >usg - echo exit 1 >v7 -else - echo "Looks kind of like a version 7 system, but we'll see..." - echo exit 1 >bsd - echo exit 1 >usg - echo exit 0 >v7 -fi -if $contains vmssystem libc.list >/dev/null 2>&1 ; then - cat <<'EOI' -There is, however, a strange, musty smell in the air that reminds me of -something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit. -EOI - echo "exit 0" >eunice - eunicefix=unixtovms - d_eunice="$define" -: it so happens the Eunice I know will not run shell scripts in Unix format -else - echo " " - echo "Congratulations. You aren't running Eunice." - eunicefix=':' - d_eunice="$undef" - echo "exit 1" >eunice -fi -if test -f /xenix; then - echo "Actually, this looks more like a XENIX system..." - echo "exit 0" >xenix -else - echo " " - echo "It's not Xenix..." - echo "exit 1" >xenix -fi -chmod 755 xenix -if test -f /venix; then - echo "Actually, this looks more like a VENIX system..." - echo "exit 0" >venix -else - echo " " - if xenix; then - : null - else - echo "Nor is it Venix..." - fi - echo "exit 1" >venix +: Get old answers from old config file if Configure was run on the +: same system, otherwise use the hints. +hint=default +cd .. +if test -f config.sh; then + echo " " + rp="I see a config.sh file. Shall I use it to set the defaults?" + . UU/myread + case "$ans" in + n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;; + *) echo "Fetching default answers from your old config.sh file..." >&4 + tmp_n="$n" + tmp_c="$c" + tmp_sh="$sh" + . ./config.sh + cp config.sh UU + n="$tmp_n" + c="$tmp_c" + : Older versions did not always set $sh. Catch re-use of such + : an old config.sh. + case "$sh" in + '') sh="$tmp_sh" ;; + esac + hint=previous + ;; + esac fi -chmod 755 bsd usg v7 eunice venix xenix -$eunicefix bsd usg v7 eunice venix xenix -rmlist="$rmlist bsd usg v7 eunice venix xenix" +if test ! -f config.sh; then + $cat </dev/null 2>&1 ; then - echo "Your sh handles # comments correctly." - shsharp=true - spitshell=cat - echo " " - echo "Okay, let's see if #! works on this system..." - echo "#!/bin/echo hi" > try - $eunicefix try - chmod 755 try - try > today - if test -s today; then - echo "It does." - sharpbang='#!' - else - echo "#! /bin/echo hi" > try - $eunicefix try - chmod 755 try - try > today - if test -s today; then - echo "It does." - sharpbang='#! ' +First time through, eh? I have some defaults handy for the following systems: + +EOM + (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4 + dflt='' + : Half the following guesses are probably wrong... If you have better + : tests or hints, please send them to perl1-porters@perl.org + : The metaconfig authors would also appreciate a copy... + $test -f /irix && osname=irix + $test -f /xenix && osname=sco_xenix + $test -f /dynix && osname=dynix + $test -f /dnix && osname=dnix + $test -f /lynx.os && osname=lynxos + $test -f /unicos && osname=unicos && osvers=`$uname -r` + $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r` + $test -f /bin/mips && /bin/mips && osname=mips + $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \ + $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4 + $test -d /usr/apollo/bin && osname=apollo + $test -f /etc/saf/_sactab && osname=svr4 + $test -d /usr/include/minix && osname=minix + if $test -d /MachTen; then + osname=machten + if $test -x /sbin/version; then + osvers=`/sbin/version | $awk '{print $2}' | + $sed -e 's/[A-Za-z]$//'` + elif $test -x /usr/etc/version; then + osvers=`/usr/etc/version | $awk '{print $2}' | + $sed -e 's/[A-Za-z]$//'` + else + osvers="$2.$3" + fi + fi + if $test -f $uname; then + set X $myuname + shift + + case "$5" in + fps*) osname=fps ;; + mips*) + case "$4" in + umips) osname=umips ;; + *) osname=mips ;; + esac;; + [23]100) osname=mips ;; + next*) osname=next ;; + news*) osname=news ;; + i386*) + if $test -f /etc/kconfig; then + osname=isc + if test "$lns" = "ln -s"; then + osvers=4 + elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then + osvers=3 + elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then + osvers=2 + fi + fi + ;; + esac + + case "$1" in + aix) osname=aix + tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1` + case "$tmp" in + 'not found') osvers="$4"."$3" ;; + '<3240'|'<>3240') osvers=3.2.0 ;; + '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;; + '=3250'|'>3250') osvers=3.2.5 ;; + *) osvers=$tmp;; + esac + ;; + *dc.osx) osname=dcosx + osvers="$3" + ;; + dnix) osname=dnix + osvers="$3" + ;; + domainos) osname=apollo + osvers="$3" + ;; + dgux) osname=dgux + osvers="$3" + ;; + dynixptx*) osname=dynixptx + osvers="$3" + ;; + freebsd) osname=freebsd + osvers="$3" ;; + genix) osname=genix ;; + hp*) osname=hpux + case "$3" in + *.08.*) osvers=9 ;; + *.09.*) osvers=9 ;; + *.10.*) osvers=10 ;; + *) osvers="$3" ;; + esac + ;; + irix*) osname=irix + case "$3" in + 4*) osvers=4 ;; + 5*) osvers=5 ;; + *) osvers="$3" ;; + esac + ;; + linux) osname=linux + case "$3" in + 1*) osvers=1 ;; + *) osvers="$3" ;; + esac + ;; + netbsd*) osname=netbsd + osvers="$3" + ;; + bsd386) osname=bsd386 + osvers=`$uname -r` + ;; + next*) osname=next ;; + solaris) osname=solaris + case "$3" in + 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;; + *) osvers="$3" ;; + esac + ;; + sunos) osname=sunos + case "$3" in + 5*) osname=solaris + osvers=`echo $3 | $sed 's/^5/2/g'` ;; + *) osvers="$3" ;; + esac + ;; + titanos) osname=titanos + case "$3" in + 1*) osvers=1 ;; + 2*) osvers=2 ;; + 3*) osvers=3 ;; + 4*) osvers=4 ;; + *) osvers="$3" ;; + esac + ;; + ultrix) osname=ultrix + osvers="$3" + ;; + osf1|mls+) case "$5" in + alpha) + osname=dec_osf + osvers=`echo "$3" | sed 's/^[vt]//'` + ;; + hp*) osname=hp_osf1 ;; + mips) osname=mips_osf1 ;; + esac + ;; + uts) osname=uts + osvers="$3" + ;; + qnx) osname=qnx + osvers="$4" + ;; + $2) case "$osname" in + *isc*) ;; + *freebsd*) ;; + svr*) + : svr4.x or possibly later + case "svr$3" in + ${osname}*) + osname=svr$3 + osvers=$4 + ;; + esac + case "$osname" in + svr4.0) + : Check for ESIX + if test -f /stand/boot ; then + eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot` + if test -n "$INITPROG" -a -f "$INITPROG"; then + isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'` + if test -n "$isesix"; then + osname=esix4 + fi + fi + fi + ;; + esac + ;; + *) if test -f /etc/systemid; then + osname=sco + set `echo $3 | $sed 's/\./ /g'` $4 + if $test -f sco_$1_$2_$3.sh; then + osvers=$1.$2.$3 + elif $test -f sco_$1_$2.sh; then + osvers=$1.$2 + elif $test -f sco_$1.sh; then + osvers=$1 + fi + else + case "$osname" in + '') : Still unknown. Probably a generic Sys V. + osname="sysv" + osvers="$3" + ;; + esac + fi + ;; + esac + ;; + *) case "$osname" in + '') : Still unknown. Probably a generic BSD. + osname="$1" + osvers="$3" + ;; + esac + ;; + esac else - echo "It doesn't." - sharpbang=': use ' + if test -f /vmunix -a -f $src/hints/news_os.sh; then + (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1 + if $contains news-os UU/kernel.what >/dev/null 2>&1; then + osname=news_os + fi + $rm -f UU/kernel.what + elif test -d c:/.; then + set X $myuname + osname=os2 + osvers="$5" + fi + fi + + : Now look for a hint file osname_osvers, unless one has been + : specified already. + case "$hintfile" in + ''|' ') + file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'` + : Also try without trailing minor version numbers. + xfile=`echo $file | $sed -e 's@_[^_]*$@@'` + xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'` + xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'` + xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'` + case "$file" in + '') dflt=none ;; + *) case "$osvers" in + '') dflt=$file + ;; + *) if $test -f $src/hints/$file.sh ; then + dflt=$file + elif $test -f $src/hints/$xfile.sh ; then + dflt=$xfile + elif $test -f $src/hints/$xxfile.sh ; then + dflt=$xxfile + elif $test -f $src/hints/$xxxfile.sh ; then + dflt=$xxxfile + elif $test -f $src/hints/$xxxxfile.sh ; then + dflt=$xxxxfile + elif $test -f "$src/hints/${osname}.sh" ; then + dflt="${osname}" + else + dflt=none + fi + ;; + esac + ;; + esac + ;; + *) + dflt=`echo $hintfile | $sed 's/\.sh$//'` + ;; + esac + + $cat <> UU/config.sh + elif $test X$tans = X -o X$tans = Xnone ; then + : nothing + else + : 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 "$src/hints/$file.sh"; then + . $src/hints/$file.sh + $cat $src/hints/$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 "$src/hints/$file.sh" ; then + hintfile="$file" + else + hintfile='' fi - fi -else - echo "Your sh doesn't grok # comments--I will strip them later on." - shsharp=false - echo "exec grep -v '^#'" >spitshell - chmod 755 spitshell - $eunicefix spitshell - spitshell=`pwd`/spitshell - echo "I presume that if # doesn't work, #! won't work either!" - sharpbang=': use ' fi +cd UU +;; +*) + echo " " + echo "Fetching default answers from $config_sh..." >&4 + tmp_n="$n" + tmp_c="$c" + cd .. + cp $config_sh config.sh 2>/dev/null + chmod +w config.sh + . ./config.sh + cd UU + cp ../config.sh . + n="$tmp_n" + c="$tmp_c" + hint=previous + ;; +esac +test "$override" && . ./optdef.sh +myuname="$newmyuname" -: figure out how to guarantee sh startup -echo " " -echo "Checking out how to guarantee sh startup..." -startsh=$sharpbang'/bin/sh' -echo "Let's see if '$startsh' works..." -cat >try <&1` +cf_by=`(logname) 2>/dev/null` +case "$cf_by" in +"") + cf_by=`(whoami) 2>/dev/null` + case "$cf_by" in + "") cf_by=unknown ;; + esac ;; +esac + +: decide how portable to be +case "$d_portable" in +"$define") dflt=y;; +*) dflt=n;; +esac +$cat <<'EOH' + +I can set things up so that your shell scripts and binaries are more portable, +at what may be a noticable cost in performance. In particular, if you +ask to be portable, the following happens: + + 1) Shell scripts will rely on the PATH variable rather than using + the paths derived above. + 2) ~username interpretations will be done at run time rather than + by Configure. + +EOH +rp="Do you expect to run these scripts and binaries on multiple machines?" +. ./myread +case "$ans" in + y*) d_portable="$define" + ;; + *) d_portable="$undef" ;; +esac + +: set up shell script to do ~ expansion +cat >filexp <&2 + exit 1 + fi + case "\$1" in + */*) + echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\` + ;; + *) + echo \$dir + ;; + esac + fi + ;; +*) + echo \$1 + ;; +esac +EOSS +chmod +x filexp +$eunicefix filexp + +: now set up to get a file name +cat <getfile +$startsh +EOS +cat <<'EOSC' >>getfile +tilde='' +fullpath='' +already='' +skip='' +none_ok='' +exp_file='' +nopath_ok='' +orig_rp="$rp" +orig_dflt="$dflt" + +case "$fn" in +*\(*) + expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok + fn=`echo $fn | sed 's/(.*)//'` + ;; +esac + +case "$fn" in +*:*) + loc_file=`expr $fn : '.*:\(.*\)'` + fn=`expr $fn : '\(.*\):.*'` + ;; +esac + +case "$fn" in +*~*) tilde=true;; +esac +case "$fn" in +*/*) fullpath=true;; +esac +case "$fn" in +*+*) skip=true;; +esac +case "$fn" in +*n*) none_ok=true;; +esac +case "$fn" in +*e*) exp_file=true;; +esac +case "$fn" in +*p*) nopath_ok=true;; +esac + +case "$fn" in +*f*) type='File';; +*d*) type='Directory';; +*l*) type='Locate';; +esac + +what="$type" +case "$what" in +Locate) what='File';; +esac + +case "$exp_file" in +'') + case "$d_portable" in + "$define") ;; + *) exp_file=true;; + esac + ;; +esac + +cd .. +while test "$type"; do + redo='' + rp="$orig_rp" + dflt="$orig_dflt" + case "$tilde" in + true) rp="$rp (~name ok)";; + esac + . UU/myread + if test -f UU/getfile.ok && \ + $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1 + then + value="$ans" + ansexp="$ans" + break + fi + case "$ans" in + none) + value='' + ansexp='' + case "$none_ok" in + true) type='';; + esac + ;; + *) + case "$tilde" in + '') value="$ans" + ansexp="$ans";; + *) + value=`UU/filexp $ans` + case $? in + 0) + if test "$ans" != "$value"; then + echo "(That expands to $value on this system.)" + fi + ;; + *) value="$ans";; + esac + ansexp="$value" + case "$exp_file" in + '') value="$ans";; + esac + ;; + esac + case "$fullpath" in + true) + case "$ansexp" in + /*) value="$ansexp" ;; + *) + redo=true + case "$already" in + true) + echo "I shall only accept a full path name, as in /bin/ls." >&4 + echo "Use a ! shell escape if you wish to check pathnames." >&4 + ;; + *) + echo "Please give a full path name, starting with slash." >&4 + case "$tilde" in + true) + echo "Note that using ~name is ok provided it expands well." >&4 + already=true + ;; + esac + esac + ;; + esac + ;; + esac + case "$redo" in + '') + case "$type" in + File) + if test -f "$ansexp"; then + type='' + elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1 + then + echo "($value is not a plain file, but that's ok.)" + type='' + fi + ;; + Directory) + if test -d "$ansexp"; then + type='' + fi + ;; + Locate) + if test -d "$ansexp"; then + echo "(Looking for $loc_file in directory $value.)" + value="$value/$loc_file" + ansexp="$ansexp/$loc_file" + fi + if test -f "$ansexp"; then + type='' + fi + case "$nopath_ok" in + true) case "$value" in + */*) ;; + *) echo "Assuming $value will be in people's path." + type='' + ;; + esac + ;; + esac + ;; + esac + + case "$skip" in + true) type=''; + esac + + case "$type" in + '') ;; + *) + if test "$fastread" = yes; then + dflt=y + else + dflt=n + fi + rp="$what $value doesn't exist. Use that name anyway?" + . UU/myread + dflt='' + case "$ans" in + y*) type='';; + *) echo " ";; + esac + ;; + esac + ;; + esac + ;; + esac +done +cd UU +ans="$value" +rp="$orig_rp" +dflt="$orig_dflt" +rm -f getfile.ok +EOSC + +: determine root of directory hierarchy where package will be installed. +case "$prefix" in +'') + dflt=`./loc . /usr/local /usr/local /local /opt /usr` + ;; +*) + dflt="$prefix" + ;; +esac +$cat <&4 +else + echo "AFS does not seem to be running..." >&4 +fi + +: determine where public executables go +echo " " +set dflt bin bin +eval $prefixit +fn=d~ +rp='Pathname where the public executables will reside?' +. ./getfile +if $test "X$ansexp" != "X$binexp"; then + installbin='' +fi +bin="$ans" +binexp="$ansexp" +if $afs; then + $cat <&4 +else + echo "Could not find manual pages in source form." >&4 +fi + +: determine where manual pages go +set mansrc mansrc none +eval $prefixit +$cat <pdp11.c <<'EOP' +main() { +#ifdef pdp11 + exit(0); +#else + exit(1); +#endif +} +EOP + cc -o pdp11 pdp11.c >/dev/null 2>&1 + if ./pdp11 2>/dev/null; then + dflt='unsplit split' + else + tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge` + case "$tans" in + X) dflt='none';; + *) if $test -d /lib/small || $test -d /usr/lib/small; then + dflt='small' + else + dflt='' + fi + if $test -d /lib/medium || $test -d /usr/lib/medium; then + dflt="$dflt medium" + fi + if $test -d /lib/large || $test -d /usr/lib/large; then + dflt="$dflt large" + fi + if $test -d /lib/huge || $test -d /usr/lib/huge; then + dflt="$dflt huge" + fi + esac + fi;; +*) dflt="$models";; +esac +$cat </dev/null 2>&1 || \ + $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then + dflt='-i' + else + dflt='none' + fi;; + *) dflt="$split";; + esac + rp="What flag indicates separate I and D space?" + . ./myread + tans="$ans" + case "$tans" in + none) tans='';; + esac + split="$tans" + unsplit='';; +*large*|*small*|*medium*|*huge*) + case "$models" in + *large*) + case "$large" in + '') dflt='-Ml';; + *) dflt="$large";; + esac + rp="What flag indicates large model?" + . ./myread + tans="$ans" + case "$tans" in + none) tans=''; + esac + large="$tans";; + *) large='';; + esac + case "$models" in + *huge*) case "$huge" in + '') dflt='-Mh';; + *) dflt="$huge";; + esac + rp="What flag indicates huge model?" + . ./myread + tans="$ans" + case "$tans" in + none) tans=''; + esac + huge="$tans";; + *) huge="$large";; + esac + case "$models" in + *medium*) case "$medium" in + '') dflt='-Mm';; + *) dflt="$medium";; + esac + rp="What flag indicates medium model?" + . ./myread + tans="$ans" + case "$tans" in + none) tans=''; + esac + medium="$tans";; + *) medium="$large";; + esac + case "$models" in + *small*) case "$small" in + '') dflt='none';; + *) dflt="$small";; + esac + rp="What flag indicates small model?" + . ./myread + tans="$ans" + case "$tans" in + none) tans=''; + esac + small="$tans";; + *) small='';; + esac + ;; +*) + echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4 + ;; +esac + +: make some quick guesses about what we are up against +echo " " +$echo $n "Hmm... $c" +echo exit 1 >bsd +echo exit 1 >usg +echo exit 1 >v7 +echo exit 1 >osf1 +echo exit 1 >eunice +echo exit 1 >xenix +echo exit 1 >venix +echo exit 1 >os2 +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 + echo "Looks kind of like an OSF/1 system, but we'll see..." + echo exit 0 >osf1 +elif test `echo abc | tr a-z A-Z` = Abc ; then + xxx=`./loc addbib blurfl $pth` + if $test -f $xxx; then + echo "Looks kind of like a USG system with BSD features, but we'll see..." + echo exit 0 >bsd + echo exit 0 >usg + else + if $contains SIGTSTP foo >/dev/null 2>&1 ; then + echo "Looks kind of like an extended USG system, but we'll see..." + else + echo "Looks kind of like a USG system, but we'll see..." + fi + echo exit 0 >usg + 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..." + echo exit 0 >v7 +fi +case "$eunicefix" in +*unixtovms*) + $cat <<'EOI' +There is, however, a strange, musty smell in the air that reminds me of +something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit. +EOI + echo exit 0 >eunice + d_eunice="$define" +: it so happens the Eunice I know will not run shell scripts in Unix format + ;; +*) + echo " " + echo "Congratulations. You aren't running Eunice." + d_eunice="$undef" + ;; +esac +case "$p_" in +:) ;; +*) + $cat <<'EOI' +I have the feeling something is not exactly right, however...don't tell me... +lemme think...does HAL ring a bell?...no, of course, you're only running OS/2! +EOI + echo exit 0 >os2 + ;; +esac +if test -f /xenix; then + echo "Actually, this looks more like a XENIX system..." + echo exit 0 >xenix + d_xenix="$define" +else + echo " " + echo "It's not Xenix..." + d_xenix="$undef" +fi +chmod +x xenix +$eunicefix xenix +if test -f /venix; then + echo "Actually, this looks more like a VENIX system..." + echo exit 0 >venix +else + echo " " + if ./xenix; then + : null + else + echo "Nor is it Venix..." + fi +fi +chmod +x bsd usg v7 osf1 eunice xenix venix os2 +$eunicefix bsd usg v7 osf1 eunice xenix venix os2 +$rm -f foo + +: see if we need a special compiler +echo " " +if ./usg; then + case "$cc" in + '') case "$Mcc" in + /*) dflt='Mcc';; + *) case "$large" in + -M*) dflt='cc';; + *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then + if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then + dflt='cc' + else + dflt='cc -M' + fi + else + dflt='cc' + fi;; + esac;; + esac;; + *) dflt="$cc";; + esac + $cat <<'EOM' +On some systems the default C compiler will not resolve multiple global +references that happen to have the same name. On some such systems the "Mcc" +command may be used to force these to be resolved. On other systems a "cc -M" +command is required. (Note that the -M flag on other systems indicates a +memory model to use!) If you have the Gnu C compiler, you might wish to use +that instead. + +EOM + rp="What command will force resolution on this system?" + . ./myread + cc="$ans" +else + case "$cc" in + '') dflt=cc;; + *) dflt="$cc";; + esac + rp="Use which C compiler?" + . ./myread + cc="$ans" +fi +echo " " +echo "Checking for GNU cc in disguise and/or its version number..." >&4 +$cat >gccvers.c < +int main() { +#ifdef __GNUC__ +#ifdef __VERSION__ + printf("%s\n", __VERSION__); +#else + printf("%s\n", "1"); +#endif +#endif + exit(0); +} +EOM +if $cc -o gccvers gccvers.c >/dev/null 2>&1; then + gccversion=`./gccvers` + case "$gccversion" in + '') echo "You are not using GNU cc." ;; + *) echo "You are using GNU cc $gccversion." ;; + esac +else + echo " " + echo "*** WHOA THERE!!! ***" >&4 + echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4 + case "$knowitall" in + '') + echo " You'd better start hunting for one and let me know about it." >&4 + exit 1 + ;; + esac +fi +$rm -f gccvers* +case "$gccversion" in +1*) cpp=`./loc gcc-cpp $cpp $pth` ;; +esac + +: What should the include directory be ? +echo " " +$echo $n "Hmm... $c" +dflt='/usr/include' +incpath='' +mips_type='' +if $test -f /bin/mips && /bin/mips; then + echo "Looks like a MIPS system..." + $cat >usr.c <<'EOCP' +#ifdef SYSTYPE_BSD43 +/bsd43 +#endif +EOCP + if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then + dflt='/bsd43/usr/include' + incpath='/bsd43' + mips_type='BSD 4.3' + else + mips_type='System V' + fi + $rm -f usr.c usr.out + echo "and you're compiling with the $mips_type compiler and libraries." + xxx_prompt=y + echo "exit 0" >mips +else + echo "Doesn't look like a MIPS system." + xxx_prompt=n + echo "exit 1" >mips +fi +chmod +x mips +$eunicefix mips +case "$usrinc" in +'') ;; +*) dflt="$usrinc";; +esac +case "$xxx_prompt" in +y) fn=d/ + echo " " + rp='Where are the include files you want to use?' + . ./getfile + usrinc="$ans" + ;; +*) usrinc="$dflt" + ;; +esac + +: 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+"$@"} + ;; +esac +rp="Directories to use for library searches?" +. ./myread +case "$ans" in +none) libpth=' ';; +*) libpth="$ans";; +esac + +: compute shared library extension +case "$so" in +'') + if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then + dflt='sl' + else + dflt='so' + fi + ;; +*) dflt="$so";; +esac +$cat <&4 +case "$libs" in +' '|'') dflt='';; +*) dflt="$libs";; +esac +case "$libswanted" in +'') libswanted='c_s';; +esac +for thislib in $libswanted; do + + if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then + echo "Found -l$thislib (shared)." + case " $dflt " in + *"-l$thislib "*);; + *) dflt="$dflt -l$thislib";; + esac + elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then + echo "Found -l$thislib (shared)." + case " $dflt " in + *"-l$thislib "*);; + *) dflt="$dflt -l$thislib";; + esac + elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then + echo "Found -l$thislib." + case " $dflt " in + *"-l$thislib "*);; + *) dflt="$dflt -l$thislib";; + esac + elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then + echo "Found -l$thislib." + case " $dflt " in + *"-l$thislib "*);; + *) dflt="$dflt -l$thislib";; + esac + elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then + echo "Found -l${thislib}_s." + case " $dflt " in + *"-l$thislib "*);; + *) dflt="$dflt -l${thislib}_s";; + esac + elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then + echo "Found -l$thislib." + case " $dflt " in + *"-l$thislib "*);; + *) dflt="$dflt -l$thislib";; + esac + else + echo "No -l$thislib." + fi +done +set X $dflt +shift +dflt="$*" +case "$libs" in +'') dflt="$dflt";; +*) dflt="$libs";; +esac +case "$dflt" in +' '|'') dflt='none';; +esac + +$cat <whoa +$startsh +EOS +cat <<'EOSC' >>whoa +dflt=y +echo " " +echo "*** WHOA THERE!!! ***" >&4 +echo " The $hint value for \$$var on this machine was \"$was\"!" >&4 +rp=" Keep the $hint value?" +. ./myread +case "$ans" in +y) td=$was; tu=$was;; +esac +EOSC + +: function used to set $1 to $val +setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef; +case "$val$was" in +$define$undef) . ./whoa; eval "$var=\$td";; +$undef$define) . ./whoa; eval "$var=\$tu";; +*) eval "$var=$val";; +esac' + +: 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 .. +echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin +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") ;; +*) $rm -f $wrapper;; +esac +$rm -f testcpp.c testcpp.out + +: determine optimize, if desired, or use for debug flag also +case "$optimize" in +' ') dflt='none';; +'') dflt='-O';; +*) dflt="$optimize";; +esac +$cat </dev/null 2>&1 + then + dflt="$dflt -posix" + fi + ;; + esac + ;; +esac + +case "$mips_type" in +*BSD*|'') inclwanted="$locincpth $usrinc";; +*) inclwanted="$locincpth $inclwanted $usrinc/bsd";; +esac +for thisincl in $inclwanted; do + if $test -d $thisincl; then + if $test x$thisincl != x$usrinc; then + case "$dflt" in + *$thisincl*);; + *) dflt="$dflt -I$thisincl";; + esac + fi + fi +done + +inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then + xxx=true; +elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then + xxx=true; +else + xxx=false; +fi; +if $xxx; then + case "$dflt" in + *$2*);; + *) dflt="$dflt -D$2";; + esac; +fi' + +if ./osf1; then + set signal.h __LANGUAGE_C__; eval $inctest +else + set signal.h LANGUAGE_C; eval $inctest +fi + +case "$hint" in +none|recommended) dflt="$ccflags $dflt" ;; +*) dflt="$ccflags";; +esac + +case "$dflt" in +''|' ') dflt=none;; +esac +$cat <&4 + set X $cppflags + shift + cppflags='' + $cat >cpp.c <<'EOM' +#define BLURFL foo + +BLURFL xx LFRULB +EOM + previous='' + for flag in $* + do + case "$flag" in + -*) ftry="$flag";; + *) ftry="$previous $flag";; + esac + if $cppstdin -DLFRULB=bar $ftry $cppminus cpp1.out 2>/dev/null && \ + $cpprun -DLFRULB=bar $ftry $cpplast cpp2.out 2>/dev/null && \ + $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \ + $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1 + then + cppflags="$cppflags $ftry" + previous='' + else + previous="$flag" + fi + done + set X $cppflags + shift + cppflags=${1+"$@"} + case "$cppflags" in + *-*) echo "They appear to be: $cppflags";; + esac + $rm -f cpp.c cpp?.out + ;; +esac + +: flags used in final linking phase +case "$ldflags" in +'') if ./venix; then + dflt='-i -z' + else + dflt='' + fi + case "$ccflags" in + *-posix*) dflt="$dflt -posix" ;; + esac + ;; +*) dflt="$ldflags";; +esac + +: Try to guess additional flags to pick up local libraries. +for thislibdir in $libpth; do + case " $loclibpth " in + *" $thislibdir "*) + case "$dflt " in + *"-L$thislibdir "*) ;; + *) dflt="$dflt -L$thislibdir" ;; + esac + ;; + esac +done + +case "$dflt" in +'') dflt='none' ;; +esac + +$cat <&4 +set X $cc $optimize $ccflags $ldflags try.c -o try +shift +$cat >try.msg < try.c <<'EOF' +#include +main() { exit(0); } +EOF +dflt=y +if sh -c "$cc $optimize $ccflags try.c -o try $ldflags" >>try.msg 2>&1; then + if sh -c './try' >>try.msg 2>&1; then + dflt=n + else + echo "The program compiled OK, but exited with status $?." >>try.msg + rp="You have a problem. Shall I abort Configure" + dflt=y + fi +else + echo "I can't compile the test program." >>try.msg + rp="You have a BIG problem. Shall I abort Configure" + dflt=y +fi +case "$dflt" in +y) + $cat try.msg + case "$knowitall" in + '') + echo "(The supplied flags might be incorrect with this C compiler.)" + ;; + *) 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 + +echo " " +echo "Checking for GNU C Library..." >&4 +cat >gnulibc.c </dev/null 2>&1 && \ + ./gnulibc | $contains '^GNU C Library' >/dev/null 2>&1; then + val="$define" + echo "You are using the GNU C Library" +else + val="$undef" + echo "You are not using the GNU C Library" +fi +$rm -f gnulibc* +set d_gnulibc +eval $setvar + +: see if nm is to be used to determine whether a symbol is defined or not +case "$usenm" in +'') + case "$d_gnulibc" in + $define) + dflt=n + ;; + *) + dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null` + if $test $dflt -gt 20; then + dflt=y + else + dflt=n + fi + ;; + esac + ;; +*) + case "$usenm" in + true) dflt=y;; + *) dflt=n;; + esac + ;; +esac +$cat < /dev/null 2>&1; then + nm_so_opt='--dynamic' + fi + ;; + esac + ;; +esac + +case "$runnm" in +true) +: get list of predefined functions in a handy place +echo " " +case "$libc" in +'') libc=unknown + case "$libs" in + *-lc_s*) libc=`./loc libc_s$_a $libc $libpth` + esac + ;; +esac +libnames=''; +case "$libs" in +'') ;; +*) for thislib in $libs; do + case "$thislib" in + -lc|-lc_s) + : Handle C library specially below. + ;; + -l*) + thislib=`echo $thislib | $sed -e 's/^-l//'` + if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then + : + elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then + : + elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then + : + elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then + : + elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then + : + elif try=`./loc $thislib X $libpth`; $test -f "$try"; then + : + elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then + : + else + try='' + fi + libnames="$libnames $try" + ;; + *) libnames="$libnames $thislib" ;; + esac + done + ;; +esac +xxx=normal +case "$libc" in +unknown) + set /lib/libc.$so + for xxx in $libpth; do + $test -r $1 || set $xxx/libc.$so + $test -r $1 || \ + set `echo blurfl; echo /usr/lib/libc.$so.[0-9]* | \ + tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e ' + h + s/[0-9][0-9]*/0000&/g + s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g + G + s/\n/ /' | \ + sort | $sed -e 's/^.* //'` + eval set \$$# + done + $test -r $1 || set /usr/ccs/lib/libc.$so + $test -r $1 || set /lib/libsys_s$_a + ;; +*) + set blurfl + ;; +esac +if $test -r "$1"; then + echo "Your (shared) C library seems to be in $1." + libc="$1" +elif $test -r /lib/libc && $test -r /lib/clib; then + echo "Your C library seems to be in both /lib/clib and /lib/libc." + xxx=apollo + libc='/lib/clib /lib/libc' + if $test -r /lib/syslib; then + echo "(Your math library is in /lib/syslib.)" + libc="$libc /lib/syslib" + fi +elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then + echo "Your C library seems to be in $libc, as you said before." +elif $test -r $incpath/usr/lib/libc$_a; then + libc=$incpath/usr/lib/libc$_a; + echo "Your C library seems to be in $libc. That's fine." +elif $test -r /lib/libc$_a; then + libc=/lib/libc$_a; + echo "Your C library seems to be in $libc. You're normal." +else + if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then + : + elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then + libnames="$libnames "`./loc clib blurfl/dyick $libpth` + elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then + : + elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then + : + elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then + : + else + tans=`./loc Llibc$_a blurfl/dyick $xlibpth` + fi + if $test -r "$tans"; then + echo "Your C library seems to be in $tans, of all places." + libc=$tans + else + libc='blurfl' + fi +fi +if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then + dflt="$libc" + cat < libpath + cat >&4 <testcpp.c -#define ABC abc -#define XYZ xyz -ABC.XYZ -EOT -echo 'Maybe "/lib/cpp" will work...' -/lib/cpp testcpp.out 2>&1 -if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Yup, it does." - cpp='/lib/cpp' - cppminus=''; +echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames +set X `cat libnames` +shift +xxx=files +case $# in 1) xxx=file; esac +echo "Extracting names from the following $xxx for later perusal:" >&4 +echo " " +$sed 's/^/ /' libnames >&4 +echo " " +$echo $n "This may take a while...$c" >&4 + +for file in $*; do + case $file in + *$so*) nm $nm_so_opt $nm_opt $file 2>/dev/null;; + *) nm $nm_opt $file 2>/dev/null;; + esac +done >libc.tmp + +$echo $n ".$c" +$grep fprintf libc.tmp > libc.ptf +xscan='eval "libc.list"; $echo $n ".$c" >&4' +xrun='eval "libc.list"; echo "done" >&4' +xxx='[ADTSIW]' +if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \ + -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun else - echo 'Nope, maybe "/lib/cpp -" will work...' - /lib/cpp - testcpp.out 2>&1 - if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Yup, it does." - cpp='/lib/cpp' - cppminus='-'; - else - echo 'No such luck...maybe "cc -E" will work...' - cc -E testcpp.out 2>&1 - if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then - echo "It works!" - cpp='cc -E' - cppminus=''; + nm -p $* 2>/dev/null >libc.tmp + $grep fprintf libc.tmp > libc.ptf + if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\ + eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1 + then + nm_opt='-p' + eval $xrun else - echo 'Nixed again...maybe "cc -E -" will work...' - cc -E - testcpp.out 2>&1 - if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Hooray, it works! I was beginning to wonder." - cpp='cc -E' - cppminus='-'; - else - echo 'Nope...maybe "cc -P" will work...' - cc -P testcpp.out 2>&1 - if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Yup, that does." - cpp='cc -P' - cppminus=''; + echo " " + echo "nm didn't seem to work right. Trying ar instead..." >&4 + com='' + if ar t $libc > libc.tmp; then + for thisname in $libnames; do + ar t $thisname >>libc.tmp + done + $sed -e "s/\\$_o\$//" < libc.tmp > libc.list + echo "Ok." >&4 else - echo 'Nope...maybe "cc -P -" will work...' - cc -P - testcpp.out 2>&1 - if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Yup, that does." - cpp='cc -P' - cppminus='-'; - else - echo 'Hmm...perhaps you already told me...' - case "$cpp" in - '') ;; - *) $cpp $cppminus testcpp.out 2>&1;; - esac - if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Hooray, you did! I was beginning to wonder." + echo "ar didn't seem to work right." >&4 + echo "Maybe this is a Cray...trying bld instead..." >&4 + if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list + then + for thisname in $libnames; do + bld t $libnames | \ + $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list + ar t $thisname >>libc.tmp + done + echo "Ok." >&4 else - echo 'Uh-uh. Time to get fancy...' - echo 'Trying (cat >/tmp/$$.c; cc -E /tmp/$$.c; rm /tmp/$$.c)' - cpp='(cat >/tmp/$$.c; cc -E /tmp/$$.c; rm /tmp/$$.c)' - cppminus=''; - $cpp testcpp.out 2>&1 - if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Eureka!." - else - dflt=blurfl - $echo $n "No dice. I can't find a C preprocessor. Name one: $c" - rp='Name a C preprocessor:' - . myread - cpp="$ans" - $cpp testcpp.out 2>&1 - if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then - echo "OK, that will do." - else - echo "Sorry, I can't get that to work. Go find one." - exit 1 - fi - fi + echo "That didn't work either. Giving up." >&4 + exit 1 fi - fi fi - fi fi - fi fi -rm -f testcpp.c testcpp.out +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$/\1/p' /lib/syscalls.exp >>libc.list +fi +;; +esac +$rm -f libnames libpath + +: is a C symbol defined? +csym='tlook=$1; +case "$3" in +-v) tf=libc.tmp; tc=""; tdc="";; +-a) tf=libc.tmp; tc="[0]"; tdc="[]";; +*) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";; +esac; +tx=yes; +case "$reuseval-$4" in +true-) ;; +true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;; +esac; +case "$tx" in +yes) + case "$runnm" in + true) + if $contains $tlook $tf >/dev/null 2>&1; + then tval=true; + else tval=false; + fi;; + *) + echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c; + if $cc $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1; + then tval=true; + else tval=false; + fi; + $rm -f t t.c;; + esac;; +*) + case "$tval" in + $define) tval=true;; + *) tval=false;; + esac;; +esac; +eval "$2=$tval"' + +: define an is-in-libc? function +inlibc='echo " "; td=$define; tu=$undef; +sym=$1; var=$2; eval "was=\$$2"; +tx=yes; +case "$reuseval$was" in +true) ;; +true*) tx=no;; +esac; +case "$tx" in +yes) + set $sym tres -f; + eval $csym; + case "$tres" in + true) + echo "$sym() found." >&4; + case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";; + *) + echo "$sym() NOT found." >&4; + case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";; + esac;; +*) + case "$was" in + $define) echo "$sym() found." >&4;; + *) echo "$sym() NOT found." >&4;; + esac;; +esac' : see if bcopy exists +set bcopy d_bcopy +eval $inlibc + +: see if bzero exists +set bzero d_bzero +eval $inlibc + +: see if sprintf is declared as int or pointer to char echo " " -if $contains bcopy libc.list >/dev/null 2>&1; then - echo 'bcopy() found.' - d_bcopy="$define" +$cat >ucbsprf.c <<'EOF' +main() +{ + int sprintf(); + char buf[10]; + exit((unsigned long)sprintf(buf,"%s","foo") > 10L); +} +EOF +if $cc ucbsprf.c -o ucbsprf >/dev/null 2>&1 && ./ucbsprf; then + echo "Your sprintf() returns (int)." >&4 + val="$undef" else - echo 'bcopy() not found.' - d_bcopy="$undef" + echo "Your sprintf() returns (char*)." >&4 + val="$define" fi +set d_charsprf +eval $setvar +$rm -f ucbsprf* -: see if sprintf is declared as int or pointer to char +: see if crypt exists echo " " -if $contains 'char.*sprintf' /usr/include/stdio.h >/dev/null 2>&1 ; then - echo "Your sprintf() returns (char*)." - d_charsprf="$define" +if set crypt val -f d_crypt; eval $csym; $val; then + echo 'crypt() found.' >&4 + val="$define" + cryptlib='' else - echo "Your sprintf() returns (int)." - d_charsprf="$undef" + 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 +set d_crypt +eval $setvar -: see if crypt exists +: see if rename exists +set rename d_rename +eval $inlibc + +: see if select exists +set select d_select +eval $inlibc + +: see if stat exists +set stat d_stat +eval $inlibc + +: determine filename position in cpp output +echo " " +echo "Computing filename position in cpp output for #include directives..." >&4 +echo '#include ' > foo.c +$cat >fieldn </dev/null | \ +$grep '^[ ]*#.*stdio\.h' | \ +while read cline; do + pos=1 + set \$cline + while $test \$# -gt 0; do + if $test -r \`echo \$1 | $tr -d '"'\`; then + echo "\$pos" + exit 0 + fi + shift + pos=\`expr \$pos + 1\` + done +done +EOF +chmod +x fieldn +fieldn=`./fieldn` +$rm -f foo.c fieldn +case $fieldn in +'') pos='???';; +1) pos=first;; +2) pos=second;; +3) pos=third;; +*) pos="${fieldn}th";; +esac +echo "Your cpp writes the filename in the $pos field of the line." + +: locate header file +$cat >findhdr <" > foo\$\$.c +$cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \ +$grep "^[ ]*#.*\$wanted" | \ +while read cline; do + name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\` + case "\$name" in + */\$wanted) echo "\$name"; exit 0;; + *) name='';; + esac; +done; +$rm -f foo\$\$.c; +case "\$name" in +'') exit 1;; +esac +EOF +chmod +x findhdr + +: see if stat knows about block sizes echo " " -if $contains crypt libc.list >/dev/null 2>&1; then - echo 'crypt() found.' - d_crypt="$define" +xxx=`./findhdr sys/stat.h` +if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then + if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then + echo "Your stat() knows about block sizes." >&4 + val="$define" + else + echo "Your stat() doesn't know about block sizes." >&4 + val="$undef" + fi else - echo 'crypt() not found.' - d_crypt="$undef" + echo "Your stat() doesn't know about block sizes." >&4 + val="$undef" fi +set d_statblks +eval $setvar -: index or strcpy +: see if _ptr and _cnt from stdio act std echo " " -dflt=y -if $contains index libc.list >/dev/null 2>&1 ; then - echo "Your system appears to use index() and rindex() rather than strchr()" - $echo $n "and strrchr(). Is this correct? [$dflt] $c" - rp='index() rather than strchr()? [$dflt]' - . myread - case "$ans" in - n*|f*) d_index="$define" ;; - *) d_index="$undef" ;; - esac +if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then + echo "(Looks like you have stdio.h from Linux.)" + case "$stdio_ptr" in + '') stdio_ptr='((fp)->_IO_read_ptr)' + ptr_lval=$define + ;; + *) ptr_lval=$d_stdio_ptr_lval;; + esac + case "$stdio_cnt" in + '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)' + cnt_lval=$undef + ;; + *) cnt_lval=$d_stdio_cnt_lval;; + esac + case "$stdio_base" in + '') stdio_base='((fp)->_IO_read_base)';; + esac + case "$stdio_bufsiz" in + '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';; + esac +else + case "$stdio_ptr" in + '') stdio_ptr='((fp)->_ptr)' + ptr_lval=$define + ;; + *) ptr_lval=$d_stdio_ptr_lval;; + esac + case "$stdio_cnt" in + '') stdio_cnt='((fp)->_cnt)' + cnt_lval=$define + ;; + *) cnt_lval=$d_stdio_cnt_lval;; + esac + case "$stdio_base" in + '') stdio_base='((fp)->_base)';; + esac + case "$stdio_bufsiz" in + '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';; + esac +fi +: test whether _ptr and _cnt really work +echo "Checking how std your stdio is..." >&4 +$cat >try.c < +#define FILE_ptr(fp) $stdio_ptr +#define FILE_cnt(fp) $stdio_cnt +main() { + FILE *fp = fopen("try.c", "r"); + char c = getc(fp); + if ( + 18 <= FILE_cnt(fp) && + strncmp(FILE_ptr(fp), "include \n", 18) == 0 + ) + exit(0); + exit(1); +} +EOP +val="$undef" +if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1; then + if ./try; then + echo "Your stdio acts pretty std." + val="$define" + else + echo "Your stdio isn't very std." + fi else - echo "Your system appears to use strchr() and strrchr() rather than index()" - $echo $n "and rindex(). Is this correct? [$dflt] $c" - rp='strchr() rather than index()? [$dflt]' - . myread - case "$ans" in - n*|f*) d_index="$undef" ;; - *) d_index="$define" ;; - esac + echo "Your stdio doesn't appear very std." fi +$rm -f try.c try +set d_stdstdio +eval $setvar -: see if stat knows about block sizes +: see which of string.h or strings.h is needed echo " " -if $contains 'st_blocks;' /usr/include/sys/stat.h >/dev/null 2>&1 ; then - if $contains 'st_blksize;' /usr/include/sys/stat.h >/dev/null 2>&1 ; then - echo "Your stat knows about block sizes." - d_statblks="$define" - else - echo "Your stat doesn't know about block sizes." - d_statblks="$undef" - fi +strings=`./findhdr string.h` +if $test "$strings" && $test -r "$strings"; then + echo "Using instead of ." >&4 + val="$define" else - echo "Your stat doesn't know about block sizes." - d_statblks="$undef" + 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 stdio is really std +: index or strchr echo " " -if $contains 'char.*_ptr;' /usr/include/stdio.h >/dev/null 2>&1 ; then - if $contains '_cnt;' /usr/include/stdio.h >/dev/null 2>&1 ; then - echo "Your stdio is pretty std." - d_stdstdio="$define" - else - echo "Your stdio isn't very std." - d_stdstdio="$undef" - fi +if set index val -f; eval $csym; $val; then + if set strchr val -f d_strchr; eval $csym; $val; then + if $contains strchr "$strings" >/dev/null 2>&1 ; then + val="$define" + vali="$undef" + echo "strchr() found." >&4 + else + val="$undef" + vali="$define" + echo "index() found." >&4 + fi + else + val="$undef" + vali="$define" + echo "index() found." >&4 + fi else - echo "Your stdio isn't very std." - d_stdstdio="$undef" + if set strchr val -f d_strchr; eval $csym; $val; then + val="$define" + vali="$undef" + echo "strchr() found." >&4 + else + echo "No index() or strchr() found!" >&4 + val="$undef" + vali="$undef" + fi fi +set d_strchr; eval $setvar +val="$vali" +set d_index; eval $setvar : check for structure copying echo " " -echo "Checking to see if your C compiler can copy structs..." +echo "Checking to see if your C compiler can copy structs..." >&4 $cat >try.c <<'EOCP' main() { struct blurfl { - int dyick; + int dyick; } foo, bar; foo = bar; } EOCP -if cc -c try.c >/dev/null 2>&1 ; then - d_strctcpy="$define" - echo "Yup, it can." +if $cc -c try.c >/dev/null 2>&1 ; then + val="$define" + echo "Yup, it can." else - d_strctcpy="$undef" - echo "Nope, it can't." + val="$undef" + echo "Nope, it can't." fi +set d_strctcpy +eval $setvar $rm -f try.* -: see if struct tm is defined in sys/time.h -echo " " -if $contains 'struct tm' /usr/include/time.h >/dev/null 2>&1 ; then - echo "You have struct tm defined in rather than ." - d_tminsys="$undef" -else - echo "You have struct tm defined in rather than ." - d_tminsys="$define" -fi - -: see if there is a vfork -echo " " -if $contains vfork libc.list >/dev/null 2>&1 ; then - echo "vfork() found." - d_vfork="$undef" -else - echo "No vfork() found--will use fork() instead." - d_vfork="$define" -fi - -: see if signal is declared as pointer to function returning int or void -echo " " -if $contains 'void.*signal' /usr/include/signal.h >/dev/null 2>&1 ; then - echo "You have void (*signal())() instead of int." - d_voidsig="$define" -else - echo "You have int (*signal())() instead of void." - d_voidsig="$undef" -fi +: see if symlink exists +set symlink d_symlink +eval $inlibc -: check for void type -echo " " -$cat <try.c <<'EOCP' -#if TRY & 1 -void main() { -#else -main() { -#endif - extern void *moo(); - void (*goo)(); -#if TRY & 2 - void (*foo[10])(); -#endif +: 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' -#if TRY & 4 - if(goo == moo) { - exit(0); - } -#endif - exit(0); -} -EOCP - if cc -S -DTRY=7 try.c >.out 2>&1 ; then - voidflags=7 - echo "It appears to support void fully." - if $contains warning .out >/dev/null 2>&1; then - echo "However, you might get some warnings that look like this:" - $cat .out - fi - else - echo "Hmm, you compiler has some difficulty with void. Checking further..." - if cc -S -DTRY=1 try.c >/dev/null 2>&1 ; then - echo "It supports 1..." - if cc -S -DTRY=3 try.c >/dev/null 2>&1 ; then - voidflags=3 - echo "And it supports 2 but not 4." - else - echo "It doesn't support 2..." - if cc -S -DTRY=3 try.c >/dev/null 2>&1 ; then - voidflags=5 - echo "But it supports 4." - else - voidflags=1 - echo "And it doesn't support 4." - fi - fi - else - echo "There is no support at all for void." - voidflags=0 - fi - fi -esac -dflt="$voidflags"; -rp="Your void support flags add up to what? [$dflt]" -$echo $n "$rp $c" -. myread -voidflags="$ans" -$rm -f try.* .out +: see if this is a sys/times.h system +set sys/times.h i_systimes +eval $inhdr -: see what type of char stdio uses. +: see if times exists echo " " -if $contains 'unsigned.*char.*_ptr;' /usr/include/stdio.h >/dev/null 2>&1 ; then - echo "Your stdio uses unsigned chars." - stdchar="unsigned char" +if set times val -f d_times; eval $csym; $val; then + echo 'times() found.' >&4 + d_times="$define" + inc='' + case "$i_systimes" in + "$define") inc='sys/times.h';; + esac + set clock_t clocktype long stdio.h sys/types.h $inc + eval $typedef + dflt="$clocktype" + echo " " + rp="What type is returned by times() on this system?" + . ./myread + clocktype="$ans" else - echo "Your stdio uses signed chars." - stdchar="char" + echo 'times() NOT found, hope that will do.' >&4 + d_times="$undef" + clocktype='int' fi -: preserve RCS keywords in files with variable substitution, grrr -Log='$Log' -Header='$Header' - -: set up shell script to do ~ expansion -cat >filexp <&2 - exit 1 - fi - case "\$1" in - */*) - echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\` - ;; - *) - echo \$dir - ;; - esac - fi - ;; -*) - echo \$1 - ;; -esac -EOSS -chmod 755 filexp -$eunicefix filexp - -: determine where public executables go -case "$bin" in -'') - dflt=`loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin` - ;; -*) dflt="$bin" - ;; -esac -cont=true -while $test "$cont" ; do - echo " " - rp="Where do you want to put the public executables? [$dflt]" - $echo $n "$rp $c" - . myread - bin="$ans" - bin=`filexp $bin` - if test -d $bin; then - cont='' - else - dflt=n - rp="Directory $bin doesn't exist. Use that name anyway? [$dflt]" - $echo $n "$rp $c" - . myread - dflt='' - case "$ans" in - y*) cont='';; - esac - fi -done - -: determine where manual pages go -case "$mansrc" in -'') - dflt=`loc . /usr/man/man1 /usr/man/mann /usr/man/local/man1 /usr/man/u_man/man1 /usr/man/man1` - ;; -*) dflt="$mansrc" - ;; -esac -cont=true -while $test "$cont" ; do - echo " " - rp="Where do the manual pages (source) go? [$dflt]" - $echo $n "$rp $c" - . myread - mansrc=`filexp "$ans"` - if test -d $mansrc; then - cont='' - else - dflt=n - rp="Directory $mansrc doesn't exist. Use that name anyway? [$dflt]" - $echo $n "$rp $c" - . myread - dflt='' - case "$ans" in - y*) cont='';; - esac - fi -done -case "$mansrc" in -*l) - manext=l - ;; -*n) - manext=n - ;; -*) - manext=1 - ;; -esac - -: get C preprocessor symbols handy +: see if struct tm is defined in sys/time.h echo " " -echo $attrlist | $tr '[ - ]' '[\012-\012]' >Cppsym.know -$cat <Cppsym -$startsh -case "\$1" in --l) list=true - shift - ;; -esac -unknown='' -case "\$list\$#" in -1|2) - for sym do - if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then - exit 0 - elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then - : - else - unknown="\$unknown \$sym" - fi - done - set X \$unknown - shift - ;; -esac -case \$# in -0) exit 1;; -esac -echo \$* | $tr '[ - ]' '[\012-\012]' | $sed -e 's/\(.*\)/\\ -#ifdef \1\\ -exit 0; _ _ _ _\1\\ \1\\ -#endif\\ -/' >/tmp/Cppsym\$\$ -echo exit 1 >>/tmp/Cppsym\$\$ -$cpp $cppminus /tmp/Cppsym2\$\$ -case "\$list" in -true) awk 'NF > 5 {print substr(\$6,2,100)}' Cppsym.true -cat Cppsym.true -rmlist="$rmlist Cppsym Cppsym.know Cppsym.true" - -: see what memory models we can support -case "$models" in -'') - if Cppsym pdp11; then - dflt='unsplit split' - else - ans=`loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge` - case "$ans" in - X) dflt='none';; - *) if $test -d /lib/small || $test -d /usr/lib/small; then - dflt='small' - else - dflt='' - fi - if $test -d /lib/medium || $test -d /usr/lib/medium; then - dflt="$dflt medium" - fi - if $test -d /lib/large || $test -d /usr/lib/large; then - dflt="$dflt large" - fi - if $test -d /lib/huge || $test -d /usr/lib/huge; then - dflt="$dflt huge" - fi - esac - fi - ;; -*) dflt="$models" ;; -esac -$cat </dev/null 2>&1 || \ - $contains '-i' $mansrc/cc.1 >/dev/null 2>&1; then - dflt='-i' - else - dflt='none' - fi - ;; - *) dflt="$split";; - esac - rp="What flag indicates separate I and D space? [$dflt]" - $echo $n "$rp $c" - . myread - case "$ans" in - none) ans='';; - esac - split="$ans" - unsplit='' - ;; -*large*|*small*|*medium*|*huge*) - case "$model" in - *large*) - case "$large" in - '') dflt='-Ml';; - *) dflt="$large";; - esac - rp="What flag indicates large model? [$dflt]" - $echo $n "$rp $c" - . myread - case "$ans" in - none) ans=''; - esac - large="$ans" - ;; - *) large='';; - esac - case "$model" in - *huge*) - case "$huge" in - '') dflt='-Mh';; - *) dflt="$huge";; - esac - rp="What flag indicates huge model? [$dflt]" - $echo $n "$rp $c" - . myread - case "$ans" in - none) ans=''; - esac - huge="$ans" - ;; - *) huge="$large";; - esac - case "$model" in - *medium*) - case "$medium" in - '') dflt='-Mm';; - *) dflt="$medium";; - esac - rp="What flag indicates medium model? [$dflt]" - $echo $n "$rp $c" - . myread - case "$ans" in - none) ans=''; - esac - medium="$ans" - ;; - *) medium="$large";; - esac - case "$model" in - *small*) - case "$small" in - '') dflt='none';; - *) dflt="$small";; +if $contains 'struct tm' `./findhdr time.h` >/dev/null 2>&1 ; then + echo "You have struct tm defined in rather than ." >&4 + val="$undef" +else + echo "You have struct tm defined in rather than ." >&4 + val="$define" +fi +set d_tminsys +eval $setvar + +: 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 +val='' +set vfork val +eval $inlibc + +: Ok, but do we want to use it. vfork is reportedly unreliable in +: perl on Solaris 2.x, and probably elsewhere. +case "$val" in +$define) + echo " " + case "$usevfork" in + false) dflt='n';; + *) dflt='y';; esac - rp="What flag indicates small model? [$dflt]" - $echo $n "$rp $c" - . myread + rp="Some systems have problems with vfork(). Do you want to use it?" + . ./myread case "$ans" in - none) ans=''; + y|Y) ;; + *) + echo "Ok, we won't use vfork()." + val="$undef" + ;; esac - small="$ans" ;; - *) small='';; - esac - ;; -*) - echo "Unrecognized memory models--you may have to edit Makefile.SH" - ;; -esac - -case "$ccflags" in -'') dflt='none';; -*) dflt="$ccflags";; esac -echo " " -rp="Any additional cc flags? [$dflt]" -$echo $n "$rp $c" -. myread -case "$ans" in -none) ans=''; +set d_vfork +eval $setvar +case "$d_vfork" in +$define) usevfork='true';; +*) usevfork='false';; esac -ccflags="$ans" -case "$ldflags" in -'') if venix; then - dflt='-i -z' - else - dflt='none' - fi - ;; -*) dflt="$ldflags";; -esac +: see if signal is declared as pointer to function returning int or void echo " " -rp="Any additional ld flags? [$dflt]" -$echo $n "$rp $c" -. myread -case "$ans" in -none) ans=''; +xxx=`./findhdr signal.h` +$test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null +if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then + echo "You have int (*signal())() instead of void." >&4 + val="$undef" +elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then + echo "You have void (*signal())() instead of int." >&4 + val="$define" +elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then + echo "You have int (*signal())() instead of void." >&4 + val="$undef" +else + case "$d_voidsig" in + '') + echo "I can't determine whether signal handler returns void or int..." >&4 + dflt=void + rp="What type does your signal handler return?" + . ./myread + case "$ans" in + v*) val="$define";; + *) val="$undef";; + esac;; + "$define") + echo "As you already told me, signal handler returns void." >&4;; + *) + echo "As you already told me, signal handler returns int." >&4;; + esac +fi +set d_voidsig +eval $setvar +case "$d_voidsig" in +"$define") signal_t="void";; +*) signal_t="int";; esac -ldflags="$ans" +$rm -f $$.tmp -: see if we need a special compiler +: preserve RCS keywords in files with variable substitution, grrr +Header='$Header' +Id='$Id' +Log='$Log' + +: check for void type echo " " -if usg; then - case "$cc" in - '') - case "$Mcc" in - /*) dflt='Mcc' - ;; - *) - case "$large" in - -M*) - dflt='cc' - ;; - *) - if $contains '\-M' $mansrc/cc.1 >/dev/null 2>&1 ; then - dflt='cc -M' +echo "Checking to see how well your C compiler groks the void type..." >&4 +echo " " +$cat >&4 <try.c <<'EOCP' +#if TRY & 1 +void sub() { +#else +sub() { +#endif + extern void moo(); /* function returning void */ + void (*goo)(); /* ptr to func returning void */ +#if TRY & 8 + void *hue; /* generic ptr */ +#endif +#if TRY & 2 + void (*foo[10])(); +#endif + +#if TRY & 4 + if(goo == moo) { + exit(0); + } +#endif + exit(0); +} +main() { sub(); } +EOCP + if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then + voidflags=$defvoidused + echo "It appears to support void to the level $package wants ($defvoidused)." + if $contains warning .out >/dev/null 2>&1; then + echo "However, you might get some warnings that look like this:" + $cat .out + fi + else +echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4 + if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then + echo "It supports 1..." + if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then + echo "It also supports 2..." + if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then + voidflags=7 + echo "And it supports 4 but not 8 definitely." + else + echo "It doesn't support 4..." + if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then + voidflags=11 + echo "But it supports 8." + else + voidflags=3 + echo "Neither does it support 8." + fi + fi + else + echo "It does not support 2..." + if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then + voidflags=13 + echo "But it supports 4 and 8." + else + if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then + voidflags=5 + echo "And it supports 4 but has not heard about 8." + else + echo "However it supports 8 but not 4." + fi + fi + fi else - dflt='cc' + echo "There is no support at all for void." + voidflags=0 fi - ;; - esac - ;; - esac + fi +esac +case "$voidflags" in +"$defvoidused") ;; +*) + dflt="$voidflags"; + rp="Your void support flags add up to what?" + . ./myread + voidflags="$ans" ;; - *) dflt="$cc";; - esac - $cat <<'EOM' - -On some systems the default C compiler will not resolve multiple global -references that happen to have the same name. On some such systems the -"Mcc" command may be used to force these to be resolved. On other systems -a "cc -M" command is required. (Note that the -M flag on other systems -indicates a memory model to use!) What command will force resolution on -EOM - $echo $n "this system? [$dflt] $c" - rp="Command to resolve multiple refs? [$dflt]" - . myread - cc="$ans" -else - echo "Not a USG system--assuming cc can resolve multiple definitions." - cc=cc -fi - -: see if symlink exists -echo " " -if $contains symlink libc.list >/dev/null 2>&1; then - echo 'symlink() found.' - d_symlink="$define" -else - echo 'symlink() not found.' - d_symlink="$undef" -fi +esac +$rm -f try.* .out : see if we should include -lnm echo " " -if $test -r /usr/lib/libnm.a || $test -r /usr/local/lib/libnm.a ; then - echo "New math library found." - libnm='-lnm' +if $test -r /usr/lib/libnm$_a || $test -r /usr/local/lib/libnm$_a ; then + echo "New math library found." >&4 + libnm='-lnm' else - ans=`loc libnm.a x $libpth` - case "$ans" in - x) - echo "No nm library found--the normal math library will have to do." - libnm='' - ;; - *) - echo "New math library found in $ans." - libnm="$ans" - ;; - esac + ans=`./loc libnm$_a x $libpth` + case "$ans" in + x) + echo "No nm library found--the normal math library will have to do." >&4 + libnm='' + ;; + *) + echo "New math library found in $ans." >&4 + libnm="$ans" + ;; + esac fi +: see if this is a malloc.h system +set malloc.h i_malloc +eval $inhdr + +: see if stdlib is available +set stdlib.h i_stdlib +eval $inhdr + : determine which malloc to compile in echo " " case "$usemymalloc" in -'') - if bsd || v7; then - dflt='y' - else - dflt='n' - fi - ;; -*) dflt="$usemymalloc" - ;; -esac -rp="Do you wish to attempt to use the malloc that comes with $package? [$dflt]" -$echo $n "$rp $c" -. myread -case "$ans" in -'') ans=$dflt;; +''|y*|true) dflt='y' ;; +n*|false) dflt='n' ;; +*) 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';; -*) mallocsrc=''; mallocobj='';; +y*|true) + usemymalloc='y' + mallocsrc='malloc.c' + mallocobj="malloc$_o" + d_mymalloc="$define" + case "$libs" in + *-lmalloc*) + : Remove malloc from list of libraries to use + echo "Removing unneeded -lmalloc from library list" >&4 + set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'` + shift + libs="$*" + echo "libs = $libs" >&4 + ;; + esac + ;; +*) + usemymalloc='n' + mallocsrc='' + mallocobj='' + d_mymalloc="$undef" + ;; esac +: Cruising for prototypes echo " " -echo "End of configuration questions." +echo "Checking out function prototypes..." >&4 +$cat >prototype.c <<'EOCP' +main(int argc, char *argv[]) { + exit(0);} +EOCP +if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then + echo "Your C compiler appears to support function prototypes." + val="$define" +else + echo "Your C compiler doesn't seem to understand function prototypes." + val="$undef" +fi +set prototype +eval $setvar +$rm -f prototype* + +: see what type of char stdio uses. echo " " +if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then + echo "Your stdio uses unsigned chars." >&4 + stdchar="unsigned char" +else + echo "Your stdio uses signed chars." >&4 + stdchar="char" +fi -: create config.sh file +: end of configuration questions +echo " " +echo "End of configuration questions." echo " " + +: back to where it started if test -d ../UU; then - cd .. + cd .. +fi + +: configuration may be patched via a 'config.over' file +if $test -f config.over; then + echo " " + dflt=y + rp='I see a config.over file. Do you wish to load it?' + . UU/myread + case "$ans" in + n*) echo "OK, I'll ignore it.";; + *) . ./config.over + echo "Configuration override changes have been loaded." + ;; + esac fi -echo "Creating config.sh..." + +: in case they want portability, strip down executable paths +case "$d_portable" in +"$define") + echo " " + echo "Stripping down executable paths..." >&4 + for file in $loclist $trylist; do + eval $file="\$file" + done + ;; +esac + +: create config.sh file +echo " " +echo "Creating config.sh..." >&4 $spitshell <config.sh $startsh -# config.sh -# This file was produced by running the Configure script. +# +# This file was produced by running the Configure script. It holds all the +# definitions figured out by Configure. Should you modify one of these values, +# do not forget to propagate your changes by running "Configure -der". You may +# instead choose to run each of the .SH files by yourself, or "Configure -S". +# -d_eunice='$d_eunice' -eunicefix='$eunicefix' -define='$define' -loclist='$loclist' -expr='$expr' -sed='$sed' -echo='$echo' -cat='$cat' -rm='$rm' -mv='$mv' -cp='$cp' -tail='$tail' -tr='$tr' -mkdir='$mkdir' -sort='$sort' -uniq='$uniq' -grep='$grep' -trylist='$trylist' -test='$test' -inews='$inews' -egrep='$egrep' -more='$more' -pg='$pg' -Mcc='$Mcc' -vi='$vi' -mailx='$mailx' -mail='$mail' -Log='$Log' +# Package name : $package +# Source directory : $src +# Configuration time: $cf_time +# Configured by : $cf_by +# Target system : $myuname + +Author='$Author' +Date='$Date' Header='$Header' +Id='$Id' +Locker='$Locker' +Log='$Log' +Mcc='$Mcc' +RCSfile='$RCSfile' +Revision='$Revision' +Source='$Source' +State='$State' +afs='$afs' +ar='$ar' +archobjs='$archobjs' +awk='$awk' +bash='$bash' bin='$bin' +binexp='$binexp' +bison='$bison' +byacc='$byacc' +c='$c' +cat='$cat' cc='$cc' +ccflags='$ccflags' +cf_by='$cf_by' +cf_time='$cf_time' +chgrp='$chgrp' +chmod='$chmod' +chown='$chown' +clocktype='$clocktype' +comm='$comm' +compress='$compress' contains='$contains' +cp='$cp' +cpio='$cpio' cpp='$cpp' +cppflags='$cppflags' +cpplast='$cpplast' cppminus='$cppminus' +cpprun='$cpprun' +cppstdin='$cppstdin' +cryptlib='$cryptlib' +csh='$csh' d_bcopy='$d_bcopy' +d_bsd='$d_bsd' +d_bzero='$d_bzero' d_charsprf='$d_charsprf' d_crypt='$d_crypt' +d_eunice='$d_eunice' +d_gnulibc='$d_gnulibc' d_index='$d_index' +d_mymalloc='$d_mymalloc' +d_portable='$d_portable' +d_rename='$d_rename' +d_select='$d_select' +d_stat='$d_stat' d_statblks='$d_statblks' +d_stdio_cnt_lval='$d_stdio_cnt_lval' +d_stdio_ptr_lval='$d_stdio_ptr_lval' +d_stdiobase='$d_stdiobase' d_stdstdio='$d_stdstdio' +d_strchr='$d_strchr' d_strctcpy='$d_strctcpy' d_symlink='$d_symlink' +d_system='$d_system' +d_times='$d_times' d_tminsys='$d_tminsys' d_vfork='$d_vfork' d_voidsig='$d_voidsig' +d_xenix='$d_xenix' +date='$date' +defvoidused='$defvoidused' +echo='$echo' +egrep='$egrep' +emacs='$emacs' +eunicefix='$eunicefix' +expr='$expr' +find='$find' +firstmakefile='$firstmakefile' +flex='$flex' +freetype='$freetype' +gcc='$gcc' +gccversion='$gccversion' +glibpth='$glibpth' +grep='$grep' +gzip='$gzip' +hint='$hint' +huge='$huge' +i_malloc='$i_malloc' +i_stdlib='$i_stdlib' +i_string='$i_string' +i_systimes='$i_systimes' +incpath='$incpath' +inews='$inews' +installbin='$installbin' +installmansrc='$installmansrc' +ksh='$ksh' +large='$large' +ldflags='$ldflags' +less='$less' +lib='$lib' libc='$libc' +libexp='$libexp' libnm='$libnm' -mallocsrc='$mallocsrc' +libpth='$libpth' +libs='$libs' +line='$line' +lint='$lint' +lkflags='$lkflags' +ln='$ln' +lns='$lns' +locincpth='$locincpth' +loclibpth='$loclibpth' +lp='$lp' +lpr='$lpr' +ls='$ls' +mail='$mail' +mailx='$mailx' +make='$make' mallocobj='$mallocobj' -usemymalloc='$usemymalloc' -mansrc='$mansrc' +mallocsrc='$mallocsrc' +malloctype='$malloctype' manext='$manext' -models='$models' -split='$split' -small='$small' +mansrc='$mansrc' +mansrcexp='$mansrcexp' medium='$medium' -large='$large' -huge='$huge' -ccflags='$ccflags' -ldflags='$ldflags' +mips='$mips' +mips_type='$mips_type' +mkdir='$mkdir' +models='$models' +more='$more' +mv='$mv' +myuname='$myuname' n='$n' -c='$c' +nm_opt='$nm_opt' +nm_so_opt='$nm_so_opt' +nroff='$nroff' +optimize='$optimize' +osname='$osname' +osvers='$osvers' package='$package' -spitshell='$spitshell' -shsharp='$shsharp' +perl='$perl' +pg='$pg' +plibpth='$plibpth' +pmake='$pmake' +pr='$pr' +prefix='$prefix' +prefixexp='$prefixexp' +prototype='$prototype' +rm='$rm' +rmail='$rmail' +runnm='$runnm' +sed='$sed' +sendmail='$sendmail' +sh='$sh' +shar='$shar' sharpbang='$sharpbang' +shsharp='$shsharp' +signal_t='$signal_t' +sleep='$sleep' +smail='$smail' +small='$small' +so='$so' +sort='$sort' +spackage='$spackage' +spitshell='$spitshell' +split='$split' +src='$src' startsh='$startsh' stdchar='$stdchar' +stdio_base='$stdio_base' +stdio_bufsiz='$stdio_bufsiz' +stdio_cnt='$stdio_cnt' +stdio_filbuf='$stdio_filbuf' +stdio_ptr='$stdio_ptr' +strings='$strings' +submit='$submit' +sysman='$sysman' +tail='$tail' +tar='$tar' +tbl='$tbl' +test='$test' +touch='$touch' +tr='$tr' +troff='$troff' +uname='$uname' +uniq='$uniq' +usemymalloc='$usemymalloc' +usenm='$usenm' +usevfork='$usevfork' +usrinc='$usrinc' +uuname='$uuname' +vi='$vi' voidflags='$voidflags' -defvoidused='$defvoidused' -CONFIG=true +xlibpth='$xlibpth' +zcat='$zcat' +zip='$zip' EOT - -CONFIG=true -echo " " -dflt='' -echo "If you didn't make any mistakes, then just type a carriage return here." -rp="If you need to edit config.sh, do it as a shell escape here:" -$echo $n "$rp $c" -. UU/myread -case "$ans" in -'') ;; -*) : in case they cannot read - eval $ans;; -esac +: add special variables +$test -f $src/patchlevel.h && \ +awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh +echo "CONFIG=true" >>config.sh -echo " " -echo "Doing variable substitutions on .SH files..." -set x `awk '{print $1}' UU/oldconfig.sh + sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\ + sort | uniq -u >UU/oldsyms + set X `cat UU/oldsyms` + shift + case $# in + 0) ;; + *) + cat <>config.sh + for sym in `cat UU/oldsyms`; do + echo " Propagating $hint variable "'$'"$sym..." + eval 'tmp="$'"${sym}"'"' + echo "$tmp" | \ + sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh + done + ;; + esac fi -for file in $*; do - case "$file" in - */*) - dir=`$expr X$file : 'X\(.*\)/'` - file=`$expr X$file : 'X.*/\(.*\)'` - (cd $dir && . $file) + +: Finish up by extracting the .SH files +case "$alldone" in +exit) + $rm -rf UU + echo "Done." + exit 0 ;; - *) - . $file +cont) ;; - esac -done -if test -f config.h.SH; then - if test ! -f config.h; then - : oops, they left it out of MANIFEST, probably, so do it anyway. - . config.h.SH - fi -fi +'') + dflt='' + nostick=true + $cat <&4 -c "$ans";; + esac + ;; +esac -if $contains '^depend:' Makefile >/dev/null 2>&1; then - dflt=n - $cat <&4 +. ./UU/extract + +if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then + dflt=y + case "$silent" in + true) ;; + *) + $cat < makedepend.out &" It can take a while, so you might not want to run it right now. EOM - rp="Run make depend now? [$dflt]" - $echo $n "$rp $c" - . UU/myread - case "$ans" in - y*) make depend + ;; + esac + rp="Run make depend now?" + . UU/myread + case "$ans" in + y*) + make depend && echo "Now you must run a make." + ;; + *) + echo "You must run 'make depend' then 'make'." + ;; + esac +elif test -f [Mm]akefile; then + echo " " echo "Now you must run a make." - ;; - *) echo "You must run 'make depend' then 'make'." - ;; - esac -elif test -f Makefile; then - echo " " - echo "Now you must run a make." else - echo "Done." + echo "Done." fi -$rm -f kit*isdone -cd UU && $rm -f $rmlist -: end of Configure +$rm -f kit*isdone ark*isdone +$rm -rf UU + +: End of Configure + diff --git a/MANIFEST b/MANIFEST index 085b831183..e069b72c65 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,7 +1,3 @@ -After all the perl kits are run you should have the following files: - -Filename Kit Description --------- --- ----------- Configure 6 Run this first EXTERN.h 10 Included before foreign .h files INTERN.h 10 Included before domestic .h files @@ -15,14 +11,101 @@ array.c 6 Numerically subscripted arrays array.h 10 Public declarations for the above cmd.c 7 Command interpreter cmd.h 9 Public declarations for the above -config.H 9 Sample config.h -config.h.SH 9 Produces config.h. +config_H 9 Sample config.h +config_h.SH 9 Produces config.h. dump.c 8 Debugging output form.c 8 Format processing form.h 10 Public declarations for the above handy.h 10 Handy definitions hash.c 9 Associative arrays hash.h 10 Public declarations for the above +hints/3b1.sh +hints/3b1cc +hints/README.hints +hints/aix.sh +hints/altos486.sh +hints/amigaos.sh +hints/apollo.sh +hints/atheos.sh +hints/aux_3.sh +hints/beos.sh +hints/broken-db.msg +hints/bsdos.sh +hints/convexos.sh +hints/cxux.sh +hints/cygwin.sh +hints/darwin.sh +hints/dcosx.sh +hints/dec_osf.sh +hints/dgux.sh +hints/dos_djgpp.sh +hints/dynix.sh +hints/dynixptx.sh +hints/epix.sh +hints/esix4.sh +hints/fps.sh +hints/freebsd.sh +hints/genix.sh +hints/gnu.sh +hints/greenhills.sh +hints/hpux.sh +hints/i386.sh +hints/irix_4.sh +hints/irix_5.sh +hints/irix_6.sh +hints/irix_6_0.sh +hints/irix_6_1.sh +hints/isc.sh +hints/isc_2.sh +hints/linux.sh +hints/lynxos.sh +hints/machten.sh +hints/machten_2.sh +hints/mint.sh +hints/mips.sh +hints/mpc.sh +hints/mpeix.sh +hints/ncr_tower.sh +hints/netbsd.sh +hints/newsos4.sh +hints/next_3.sh +hints/next_3_0.sh +hints/next_4.sh +hints/nonstopux.sh +hints/openbsd.sh +hints/opus.sh +hints/os2.sh +hints/os390.sh +hints/posix-bc.sh +hints/powerux.sh +hints/qnx.sh +hints/rhapsody.sh +hints/sco.sh +hints/sco_2_3_0.sh +hints/sco_2_3_1.sh +hints/sco_2_3_2.sh +hints/sco_2_3_3.sh +hints/sco_2_3_4.sh +hints/solaris_2.sh +hints/stellar.sh +hints/sunos_4_0.sh +hints/sunos_4_1.sh +hints/super-ux.sh +hints/svr4.sh +hints/svr5.sh +hints/t001.c +hints/ti1500.sh +hints/titanos.sh +hints/ultrix_4.sh +hints/umips.sh +hints/unicos.sh +hints/unicosmk.sh +hints/unisysdynix.sh +hints/utekv.sh +hints/uts.sh +hints/uwin.sh +hints/vmesa.sh +hints/vos.sh makedepend.SH 9 Precursor to makedepend makedir.SH 10 Precursor to makedir malloc.c 7 A version of malloc you might not want @@ -31,6 +114,8 @@ perl.h 9 Global declarations perl.man.1 5 The manual page(s), first half perl.man.2 4 The manual page(s), second half perl.y 5 Yacc grammar for perl +perldb +perldb.man perly.c 2 The perl compiler search.c 6 String matching search.h 10 Public declarations for the above @@ -69,6 +154,7 @@ t/op.cond 10 See if conditional expressions work t/op.crypt 10 See if crypt works t/op.do 10 See if subroutines work t/op.each 10 See if associative iterators work +t/op.eval t/op.exec 10 See if exec and system work t/op.exp 10 See if math functions work t/op.flip 10 See if range operator works diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..7faeed1791 --- /dev/null +++ b/Makefile @@ -0,0 +1,649 @@ +# $Header: Makefile.SH,v 1.0.1.5 88/02/02 11:20:49 root Exp $ +# +# $Log: Makefile.SH,v $ +# Revision 1.0.1.5 88/02/02 11:20:49 root +# patch13: added d_symlink dependency, changed TEST to ./perl TEST. +# +# Revision 1.0.1.4 88/01/28 10:17:59 root +# patch8: added perldb.man +# +# Revision 1.0.1.3 88/01/26 14:14:52 root +# Added mallocsrc stuff. +# +# Revision 1.0.1.2 88/01/26 08:46:04 root +# patch 4: make depend didn't work right if . wasn't in PATH. +# +# Revision 1.0.1.1 88/01/24 03:55:18 root +# patch 2: remove extra Log lines. +# +# Revision 1.0 87/12/18 16:11:50 root +# Initial revision +# + +CC = cc +bin = /usr/local/perl1.0.15/bin +lib = /usr/local/perl1.0.15/lib +mansrc = /usr/local/perl1.0.15/man/man1 +manext = 1 +CFLAGS = -I/usr/local/include -O +LDFLAGS = -L/usr/local/lib +SMALL = +LARGE = +mallocsrc = +mallocobj = +SLN = ln -s + +libs = /usr/lib/libcrypt.a -lm + +public = perl perldb + +private = + +manpages = perl.man perldb.man + +util = + +sh = Makefile.SH makedepend.SH + +h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h +h2 = hash.h perl.h search.h spat.h stab.h str.h util.h + +h = $(h1) $(h2) + +c1 = arg.c array.c cmd.c dump.c form.c hash.c $(mallocsrc) +c2 = search.c stab.c str.c util.c version.c + +c = $(c1) $(c2) + +obj1 = arg.o array.o cmd.o dump.o form.o hash.o $(mallocobj) +obj2 = search.o stab.o str.o util.o version.o + +obj = $(obj1) $(obj2) + +lintflags = -phbvxac + +addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7 + +# grrr +SHELL = /bin/sh + +.c.o: + $(CC) -c $(CFLAGS) $(LARGE) $*.c + +all: $(public) $(private) $(util) + touch all + +perl: $(obj) perl.o + $(CC) $(LDFLAGS) $(LARGE) $(obj) perl.o $(libs) -o perl + +perl.c: perl.y + @ echo Expect 2 shift/reduce errors... + yacc perl.y + mv y.tab.c perl.c + +perl.o: perl.c perly.c perl.h EXTERN.h search.h util.h INTERN.h handy.h + $(CC) -c $(CFLAGS) $(LARGE) perl.c + +# if a .h file depends on another .h file... +$(h): + touch $@ + +perl.man: perl.man.1 perl.man.2 + cat perl.man.1 perl.man.2 >perl.man + +install: perl perl.man +# won't work with csh + export PATH || exit 1 + - mv $(bin)/perl $(bin)/perl.old + - if test `pwd` != $(bin); then cp $(public) $(bin); fi + cd $(bin); \ +for pub in $(public); do \ +chmod 755 `basename $$pub`; \ +done + - test $(bin) = /bin || rm -f /bin/perl + - test $(bin) = /bin || ln -s $(bin)/perl /bin || cp $(bin)/perl /bin +# chmod 755 makedir +# - makedir `filexp $(lib)` +# - \ +#if test `pwd` != `filexp $(lib)`; then \ +#cp $(private) `filexp $(lib)`; \ +#fi +# cd `filexp $(lib)`; \ +#for priv in $(private); do \ +#chmod 755 `basename $$priv`; \ +#done + - if test `pwd` != $(mansrc); then \ +for page in $(manpages); do \ +cp $$page $(mansrc)/`basename $$page .man`.$(manext); \ +done; \ +fi + +clean: + rm -f *.o + +realclean: + rm -f perl *.orig */*.orig *.o core $(addedbyconf) + +# The following lint has practically everything turned on. Unfortunately, +# you have to wade through a lot of mumbo jumbo that can't be suppressed. +# If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message +# for that spot. + +lint: + lint $(lintflags) $(defs) $(c) > perl.fuzz + +depend: makedepend + ./makedepend + +test: perl + chmod 755 t/TEST t/base.* t/comp.* t/cmd.* t/io.* t/op.* + cd t && (rm -f perl; $(SLN) ../perl .) && ./perl TEST + +clist: + echo $(c) | tr ' ' '\012' >.clist + +hlist: + echo $(h) | tr ' ' '\012' >.hlist + +shlist: + echo $(sh) | tr ' ' '\012' >.shlist + +# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE +# If this runs make out of memory, delete /usr/include lines. +arg.o: /usr/include/_G_config.h +arg.o: /usr/include/asm/ptrace.h +arg.o: /usr/include/asm/sigcontext.h +arg.o: /usr/include/bits/endian.h +arg.o: /usr/include/bits/pthreadtypes.h +arg.o: /usr/include/bits/sched.h +arg.o: /usr/include/bits/select.h +arg.o: /usr/include/bits/setjmp.h +arg.o: /usr/include/bits/sigaction.h +arg.o: /usr/include/bits/sigcontext.h +arg.o: /usr/include/bits/siginfo.h +arg.o: /usr/include/bits/signum.h +arg.o: /usr/include/bits/sigset.h +arg.o: /usr/include/bits/sigstack.h +arg.o: /usr/include/bits/sigthread.h +arg.o: /usr/include/bits/stat.h +arg.o: /usr/include/bits/stdio_lim.h +arg.o: /usr/include/bits/sys_errlist.h +arg.o: /usr/include/bits/time.h +arg.o: /usr/include/bits/types.h +arg.o: /usr/include/bits/wchar.h +arg.o: /usr/include/bits/wordsize.h +arg.o: /usr/include/ctype.h +arg.o: /usr/include/endian.h +arg.o: /usr/include/features.h +arg.o: /usr/include/gconv.h +arg.o: /usr/include/gnu/stubs.h +arg.o: /usr/include/libio.h +arg.o: /usr/include/setjmp.h +arg.o: /usr/include/signal.h +arg.o: /usr/include/stdio.h +arg.o: /usr/include/sys/cdefs.h +arg.o: /usr/include/sys/select.h +arg.o: /usr/include/sys/stat.h +arg.o: /usr/include/sys/sysmacros.h +arg.o: /usr/include/sys/times.h +arg.o: /usr/include/sys/types.h +arg.o: /usr/include/time.h +arg.o: /usr/include/wchar.h +arg.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stdarg.h +arg.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stddef.h +arg.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/va-ppc.h +arg.o: EXTERN.h +arg.o: arg.c +arg.o: arg.h +arg.o: array.h +arg.o: cmd.h +arg.o: config.h +arg.o: form.h +arg.o: handy.h +arg.o: hash.h +arg.o: perl.h +arg.o: search.h +arg.o: spat.h +arg.o: stab.h +arg.o: str.h +arg.o: util.h +array.o: /usr/include/_G_config.h +array.o: /usr/include/bits/endian.h +array.o: /usr/include/bits/pthreadtypes.h +array.o: /usr/include/bits/sched.h +array.o: /usr/include/bits/select.h +array.o: /usr/include/bits/setjmp.h +array.o: /usr/include/bits/sigset.h +array.o: /usr/include/bits/stat.h +array.o: /usr/include/bits/stdio_lim.h +array.o: /usr/include/bits/sys_errlist.h +array.o: /usr/include/bits/time.h +array.o: /usr/include/bits/types.h +array.o: /usr/include/bits/wchar.h +array.o: /usr/include/ctype.h +array.o: /usr/include/endian.h +array.o: /usr/include/features.h +array.o: /usr/include/gconv.h +array.o: /usr/include/gnu/stubs.h +array.o: /usr/include/libio.h +array.o: /usr/include/setjmp.h +array.o: /usr/include/stdio.h +array.o: /usr/include/sys/cdefs.h +array.o: /usr/include/sys/select.h +array.o: /usr/include/sys/stat.h +array.o: /usr/include/sys/sysmacros.h +array.o: /usr/include/sys/times.h +array.o: /usr/include/sys/types.h +array.o: /usr/include/time.h +array.o: /usr/include/wchar.h +array.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stdarg.h +array.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stddef.h +array.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/va-ppc.h +array.o: EXTERN.h +array.o: arg.h +array.o: array.c +array.o: array.h +array.o: cmd.h +array.o: config.h +array.o: form.h +array.o: handy.h +array.o: hash.h +array.o: perl.h +array.o: search.h +array.o: spat.h +array.o: stab.h +array.o: str.h +array.o: util.h +cmd.o: /usr/include/_G_config.h +cmd.o: /usr/include/bits/endian.h +cmd.o: /usr/include/bits/pthreadtypes.h +cmd.o: /usr/include/bits/sched.h +cmd.o: /usr/include/bits/select.h +cmd.o: /usr/include/bits/setjmp.h +cmd.o: /usr/include/bits/sigset.h +cmd.o: /usr/include/bits/stat.h +cmd.o: /usr/include/bits/stdio_lim.h +cmd.o: /usr/include/bits/sys_errlist.h +cmd.o: /usr/include/bits/time.h +cmd.o: /usr/include/bits/types.h +cmd.o: /usr/include/bits/wchar.h +cmd.o: /usr/include/ctype.h +cmd.o: /usr/include/endian.h +cmd.o: /usr/include/features.h +cmd.o: /usr/include/gconv.h +cmd.o: /usr/include/gnu/stubs.h +cmd.o: /usr/include/libio.h +cmd.o: /usr/include/setjmp.h +cmd.o: /usr/include/stdio.h +cmd.o: /usr/include/sys/cdefs.h +cmd.o: /usr/include/sys/select.h +cmd.o: /usr/include/sys/stat.h +cmd.o: /usr/include/sys/sysmacros.h +cmd.o: /usr/include/sys/times.h +cmd.o: /usr/include/sys/types.h +cmd.o: /usr/include/time.h +cmd.o: /usr/include/wchar.h +cmd.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stdarg.h +cmd.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stddef.h +cmd.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/va-ppc.h +cmd.o: EXTERN.h +cmd.o: arg.h +cmd.o: array.h +cmd.o: cmd.c +cmd.o: cmd.h +cmd.o: config.h +cmd.o: form.h +cmd.o: handy.h +cmd.o: hash.h +cmd.o: perl.h +cmd.o: search.h +cmd.o: spat.h +cmd.o: stab.h +cmd.o: str.h +cmd.o: util.h +dump.o: /usr/include/_G_config.h +dump.o: /usr/include/bits/endian.h +dump.o: /usr/include/bits/pthreadtypes.h +dump.o: /usr/include/bits/sched.h +dump.o: /usr/include/bits/select.h +dump.o: /usr/include/bits/setjmp.h +dump.o: /usr/include/bits/sigset.h +dump.o: /usr/include/bits/stat.h +dump.o: /usr/include/bits/stdio_lim.h +dump.o: /usr/include/bits/sys_errlist.h +dump.o: /usr/include/bits/time.h +dump.o: /usr/include/bits/types.h +dump.o: /usr/include/bits/wchar.h +dump.o: /usr/include/ctype.h +dump.o: /usr/include/endian.h +dump.o: /usr/include/features.h +dump.o: /usr/include/gconv.h +dump.o: /usr/include/gnu/stubs.h +dump.o: /usr/include/libio.h +dump.o: /usr/include/setjmp.h +dump.o: /usr/include/stdio.h +dump.o: /usr/include/sys/cdefs.h +dump.o: /usr/include/sys/select.h +dump.o: /usr/include/sys/stat.h +dump.o: /usr/include/sys/sysmacros.h +dump.o: /usr/include/sys/times.h +dump.o: /usr/include/sys/types.h +dump.o: /usr/include/time.h +dump.o: /usr/include/wchar.h +dump.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stdarg.h +dump.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stddef.h +dump.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/va-ppc.h +dump.o: EXTERN.h +dump.o: arg.h +dump.o: array.h +dump.o: cmd.h +dump.o: config.h +dump.o: dump.c +dump.o: form.h +dump.o: handy.h +dump.o: hash.h +dump.o: perl.h +dump.o: search.h +dump.o: spat.h +dump.o: stab.h +dump.o: str.h +dump.o: util.h +form.o: /usr/include/_G_config.h +form.o: /usr/include/bits/endian.h +form.o: /usr/include/bits/pthreadtypes.h +form.o: /usr/include/bits/sched.h +form.o: /usr/include/bits/select.h +form.o: /usr/include/bits/setjmp.h +form.o: /usr/include/bits/sigset.h +form.o: /usr/include/bits/stat.h +form.o: /usr/include/bits/stdio_lim.h +form.o: /usr/include/bits/sys_errlist.h +form.o: /usr/include/bits/time.h +form.o: /usr/include/bits/types.h +form.o: /usr/include/bits/wchar.h +form.o: /usr/include/ctype.h +form.o: /usr/include/endian.h +form.o: /usr/include/features.h +form.o: /usr/include/gconv.h +form.o: /usr/include/gnu/stubs.h +form.o: /usr/include/libio.h +form.o: /usr/include/setjmp.h +form.o: /usr/include/stdio.h +form.o: /usr/include/sys/cdefs.h +form.o: /usr/include/sys/select.h +form.o: /usr/include/sys/stat.h +form.o: /usr/include/sys/sysmacros.h +form.o: /usr/include/sys/times.h +form.o: /usr/include/sys/types.h +form.o: /usr/include/time.h +form.o: /usr/include/wchar.h +form.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stdarg.h +form.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stddef.h +form.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/va-ppc.h +form.o: EXTERN.h +form.o: arg.h +form.o: array.h +form.o: cmd.h +form.o: config.h +form.o: form.c +form.o: form.h +form.o: handy.h +form.o: hash.h +form.o: perl.h +form.o: search.h +form.o: spat.h +form.o: stab.h +form.o: str.h +form.o: util.h +hash.o: /usr/include/_G_config.h +hash.o: /usr/include/bits/endian.h +hash.o: /usr/include/bits/pthreadtypes.h +hash.o: /usr/include/bits/sched.h +hash.o: /usr/include/bits/select.h +hash.o: /usr/include/bits/setjmp.h +hash.o: /usr/include/bits/sigset.h +hash.o: /usr/include/bits/stat.h +hash.o: /usr/include/bits/stdio_lim.h +hash.o: /usr/include/bits/sys_errlist.h +hash.o: /usr/include/bits/time.h +hash.o: /usr/include/bits/types.h +hash.o: /usr/include/bits/wchar.h +hash.o: /usr/include/ctype.h +hash.o: /usr/include/endian.h +hash.o: /usr/include/features.h +hash.o: /usr/include/gconv.h +hash.o: /usr/include/gnu/stubs.h +hash.o: /usr/include/libio.h +hash.o: /usr/include/setjmp.h +hash.o: /usr/include/stdio.h +hash.o: /usr/include/sys/cdefs.h +hash.o: /usr/include/sys/select.h +hash.o: /usr/include/sys/stat.h +hash.o: /usr/include/sys/sysmacros.h +hash.o: /usr/include/sys/times.h +hash.o: /usr/include/sys/types.h +hash.o: /usr/include/time.h +hash.o: /usr/include/wchar.h +hash.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stdarg.h +hash.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stddef.h +hash.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/va-ppc.h +hash.o: EXTERN.h +hash.o: arg.h +hash.o: array.h +hash.o: cmd.h +hash.o: config.h +hash.o: form.h +hash.o: handy.h +hash.o: hash.c +hash.o: hash.h +hash.o: perl.h +hash.o: search.h +hash.o: spat.h +hash.o: stab.h +hash.o: str.h +hash.o: util.h +search.o: /usr/include/_G_config.h +search.o: /usr/include/bits/endian.h +search.o: /usr/include/bits/pthreadtypes.h +search.o: /usr/include/bits/sched.h +search.o: /usr/include/bits/select.h +search.o: /usr/include/bits/setjmp.h +search.o: /usr/include/bits/sigset.h +search.o: /usr/include/bits/stat.h +search.o: /usr/include/bits/stdio_lim.h +search.o: /usr/include/bits/sys_errlist.h +search.o: /usr/include/bits/time.h +search.o: /usr/include/bits/types.h +search.o: /usr/include/bits/wchar.h +search.o: /usr/include/ctype.h +search.o: /usr/include/endian.h +search.o: /usr/include/features.h +search.o: /usr/include/gconv.h +search.o: /usr/include/gnu/stubs.h +search.o: /usr/include/libio.h +search.o: /usr/include/setjmp.h +search.o: /usr/include/stdio.h +search.o: /usr/include/sys/cdefs.h +search.o: /usr/include/sys/select.h +search.o: /usr/include/sys/stat.h +search.o: /usr/include/sys/sysmacros.h +search.o: /usr/include/sys/times.h +search.o: /usr/include/sys/types.h +search.o: /usr/include/time.h +search.o: /usr/include/wchar.h +search.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stdarg.h +search.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stddef.h +search.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/va-ppc.h +search.o: EXTERN.h +search.o: INTERN.h +search.o: arg.h +search.o: array.h +search.o: cmd.h +search.o: config.h +search.o: form.h +search.o: handy.h +search.o: hash.h +search.o: perl.h +search.o: search.c +search.o: search.h +search.o: spat.h +search.o: stab.h +search.o: str.h +search.o: util.h +stab.o: /usr/include/_G_config.h +stab.o: /usr/include/asm/ptrace.h +stab.o: /usr/include/asm/sigcontext.h +stab.o: /usr/include/bits/endian.h +stab.o: /usr/include/bits/pthreadtypes.h +stab.o: /usr/include/bits/sched.h +stab.o: /usr/include/bits/select.h +stab.o: /usr/include/bits/setjmp.h +stab.o: /usr/include/bits/sigaction.h +stab.o: /usr/include/bits/sigcontext.h +stab.o: /usr/include/bits/siginfo.h +stab.o: /usr/include/bits/signum.h +stab.o: /usr/include/bits/sigset.h +stab.o: /usr/include/bits/sigstack.h +stab.o: /usr/include/bits/sigthread.h +stab.o: /usr/include/bits/stat.h +stab.o: /usr/include/bits/stdio_lim.h +stab.o: /usr/include/bits/sys_errlist.h +stab.o: /usr/include/bits/time.h +stab.o: /usr/include/bits/types.h +stab.o: /usr/include/bits/wchar.h +stab.o: /usr/include/bits/wordsize.h +stab.o: /usr/include/ctype.h +stab.o: /usr/include/endian.h +stab.o: /usr/include/features.h +stab.o: /usr/include/gconv.h +stab.o: /usr/include/gnu/stubs.h +stab.o: /usr/include/libio.h +stab.o: /usr/include/setjmp.h +stab.o: /usr/include/signal.h +stab.o: /usr/include/stdio.h +stab.o: /usr/include/sys/cdefs.h +stab.o: /usr/include/sys/select.h +stab.o: /usr/include/sys/stat.h +stab.o: /usr/include/sys/sysmacros.h +stab.o: /usr/include/sys/times.h +stab.o: /usr/include/sys/types.h +stab.o: /usr/include/time.h +stab.o: /usr/include/wchar.h +stab.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stdarg.h +stab.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stddef.h +stab.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/va-ppc.h +stab.o: EXTERN.h +stab.o: arg.h +stab.o: array.h +stab.o: cmd.h +stab.o: config.h +stab.o: form.h +stab.o: handy.h +stab.o: hash.h +stab.o: perl.h +stab.o: search.h +stab.o: spat.h +stab.o: stab.c +stab.o: stab.h +stab.o: str.h +stab.o: util.h +str.o: /usr/include/_G_config.h +str.o: /usr/include/bits/endian.h +str.o: /usr/include/bits/pthreadtypes.h +str.o: /usr/include/bits/sched.h +str.o: /usr/include/bits/select.h +str.o: /usr/include/bits/setjmp.h +str.o: /usr/include/bits/sigset.h +str.o: /usr/include/bits/stat.h +str.o: /usr/include/bits/stdio_lim.h +str.o: /usr/include/bits/sys_errlist.h +str.o: /usr/include/bits/time.h +str.o: /usr/include/bits/types.h +str.o: /usr/include/bits/wchar.h +str.o: /usr/include/ctype.h +str.o: /usr/include/endian.h +str.o: /usr/include/features.h +str.o: /usr/include/gconv.h +str.o: /usr/include/gnu/stubs.h +str.o: /usr/include/libio.h +str.o: /usr/include/setjmp.h +str.o: /usr/include/stdio.h +str.o: /usr/include/sys/cdefs.h +str.o: /usr/include/sys/select.h +str.o: /usr/include/sys/stat.h +str.o: /usr/include/sys/sysmacros.h +str.o: /usr/include/sys/times.h +str.o: /usr/include/sys/types.h +str.o: /usr/include/time.h +str.o: /usr/include/wchar.h +str.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stdarg.h +str.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stddef.h +str.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/va-ppc.h +str.o: EXTERN.h +str.o: arg.h +str.o: array.h +str.o: cmd.h +str.o: config.h +str.o: form.h +str.o: handy.h +str.o: hash.h +str.o: perl.h +str.o: search.h +str.o: spat.h +str.o: stab.h +str.o: str.c +str.o: str.h +str.o: util.h +util.o: /usr/include/_G_config.h +util.o: /usr/include/bits/endian.h +util.o: /usr/include/bits/pthreadtypes.h +util.o: /usr/include/bits/sched.h +util.o: /usr/include/bits/select.h +util.o: /usr/include/bits/setjmp.h +util.o: /usr/include/bits/sigset.h +util.o: /usr/include/bits/stat.h +util.o: /usr/include/bits/stdio_lim.h +util.o: /usr/include/bits/sys_errlist.h +util.o: /usr/include/bits/time.h +util.o: /usr/include/bits/types.h +util.o: /usr/include/bits/wchar.h +util.o: /usr/include/ctype.h +util.o: /usr/include/endian.h +util.o: /usr/include/features.h +util.o: /usr/include/gconv.h +util.o: /usr/include/gnu/stubs.h +util.o: /usr/include/libio.h +util.o: /usr/include/setjmp.h +util.o: /usr/include/stdio.h +util.o: /usr/include/sys/cdefs.h +util.o: /usr/include/sys/select.h +util.o: /usr/include/sys/stat.h +util.o: /usr/include/sys/sysmacros.h +util.o: /usr/include/sys/times.h +util.o: /usr/include/sys/types.h +util.o: /usr/include/time.h +util.o: /usr/include/wchar.h +util.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stdarg.h +util.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/stddef.h +util.o: /usr/lib/gcc-lib/powerpc-linux/2.95.4/include/va-ppc.h +util.o: EXTERN.h +util.o: INTERN.h +util.o: arg.h +util.o: array.h +util.o: cmd.h +util.o: config.h +util.o: form.h +util.o: handy.h +util.o: hash.h +util.o: perl.h +util.o: search.h +util.o: spat.h +util.o: stab.h +util.o: str.h +util.o: util.c +util.o: util.h +version.o: patchlevel.h +version.o: version.c +Makefile: Makefile.SH config.sh ; /bin/sh Makefile.SH +makedepend: makedepend.SH config.sh ; /bin/sh makedepend.SH +# WARNING: Put nothing here or make depend will gobble it up! diff --git a/Makefile.SH b/Makefile.SH index 8845396539..b0ec91c82a 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -55,7 +55,7 @@ mallocsrc = $mallocsrc mallocobj = $mallocobj SLN = $sln -libs = $libnm -lm +libs = $libs $cryptlib $libnm -lm !GROK!THIS! cat >>Makefile <<'!NO!SUBS!' diff --git a/README b/README index b5d95e1776..75e3acf5e6 100644 --- a/README +++ b/README @@ -68,16 +68,13 @@ Installation "make install" to create the awk to perl and sed to perl translators. 9) IMPORTANT! Help save the world! Communicate any problems and suggested - patches to me, lwall@jpl-devvax.jpl.nasa.gov (Larry Wall), so we can - keep the world in sync. If you have a problem, there's someone else - out there who either has had or will have the same problem. + patches to perl1-porters@perl.org so we can keep the world in sync. + If you have a problem, there's someone else out there who either has + had or will have the same problem. If possible, send in patches such that the patch program will apply them. Context diffs are the best, then normal diffs. Don't send ed scripts-- I've probably changed my copy since the version you have. - Watch for perl patches in comp.sources.bugs. Patches will generally be - in a form usable by the patch program. If you are just now bringing up - perl and aren't sure how many patches there are, write to me and I'll - send any you don't have. Your current patch level is shown in patchlevel.h. + Your current patch level is shown in patchlevel.h. diff --git a/all b/all new file mode 100644 index 0000000000..e69de29bb2 diff --git a/arg.c b/arg.c index 74da53c1da..abbb304300 100644 --- a/arg.c +++ b/arg.c @@ -1057,7 +1057,7 @@ STR ***retary; apush(ary,str_make(str_get(hiterval(entry)))); } if (retary) { /* array wanted */ - sarg = (STR**)saferealloc((char*)sarg,(max+2)*sizeof(STR*)); + sarg = (STR**)safemalloc((max+2)*sizeof(STR*)); sarg[0] = Nullstr; sarg[max+1] = Nullstr; for (i = 1; i <= max; i++) @@ -1084,7 +1084,7 @@ STR ***retary; if (retary) { /* array wanted */ if (entry) { - sarg = (STR**)saferealloc((char*)sarg,4*sizeof(STR*)); + sarg = (STR**)safemalloc(4*sizeof(STR*)); sarg[0] = Nullstr; sarg[3] = Nullstr; sarg[1] = mystr = str_make(hiterkey(entry)); @@ -1092,7 +1092,7 @@ STR ***retary; *retary = sarg; } else { - sarg = (STR**)saferealloc((char*)sarg,2*sizeof(STR*)); + sarg = (STR**)safemalloc(2*sizeof(STR*)); sarg[0] = Nullstr; sarg[1] = retstr = Nullstr; *retary = sarg; @@ -1959,7 +1959,7 @@ STR ***retary; /* where to return an array to, null if nowhere */ retary = Null(STR***); /* do_stat already did retary */ goto donumset; case O_CRYPT: -#ifdef CRYPT +#ifdef HAS_CRYPT tmps = str_get(sarg[1]); str_set(str,crypt(tmps,str_get(sarg[2]))); #else diff --git a/array.c b/array.c index 156b78378f..eb29917a9e 100644 --- a/array.c +++ b/array.c @@ -34,7 +34,7 @@ STR *val; if (key < 0) return FALSE; if (key > ar->ary_max) { - int newmax = key + ar->ary_max / 5; + int newmax = key + ar->ary_max; ar->ary_array = (STR**)saferealloc((char*)ar->ary_array, (newmax+1) * sizeof(STR*)); diff --git a/cmd.h b/cmd.h index 9a019f2c74..14a5dbd419 100644 --- a/cmd.h +++ b/cmd.h @@ -111,7 +111,7 @@ struct cmd { EXT CMD *main_root INIT(Nullcmd); EXT CMD *eval_root INIT(Nullcmd); -EXT struct compcmd { +struct compcmd { CMD *comp_true; CMD *comp_alt; }; diff --git a/config.H b/config.H deleted file mode 100644 index bb9eb6b09a..0000000000 --- a/config.H +++ /dev/null @@ -1,80 +0,0 @@ -/* config.h - * This file was produced by running the config.h.SH script, which - * gets its values from config.sh, which is generally produced by - * running Configure. - * - * Feel free to modify any of this as the need arises. Note, however, - * that running config.h.SH again will wipe out any changes you've made. - * For a more permanent change edit config.sh and rerun config.h.SH. - */ - - -/* EUNICE: - * This symbol, if defined, indicates that the program is being compiled - * under the EUNICE package under VMS. The program will need to handle - * things like files that don't go away the first time you unlink them, - * due to version numbering. It will also need to compensate for lack - * of a respectable link() command. - */ -/* VMS: - * This symbol, if defined, indicates that the program is running under - * VMS. It is currently only set in conjunction with the EUNICE symbol. - */ -#/*undef EUNICE /**/ -#/*undef VMS /**/ - -/* CHARSPRINTF: - * This symbol is defined if this system declares "char *sprintf()" in - * stdio.h. The trend seems to be to declare it as "int sprintf()". It - * is up to the package author to declare sprintf correctly based on the - * symbol. - */ -#define CHARSPRINTF /**/ - -/* index: - * This preprocessor symbol is defined, along with rindex, if the system - * uses the strchr and strrchr routines instead. - */ -/* rindex: - * This preprocessor symbol is defined, along with index, if the system - * uses the strchr and strrchr routines instead. - */ -#/*undef index strchr /* cultural */ -#/*undef rindex strrchr /* differences? */ - -/* STRUCTCOPY: - * This symbol, if defined, indicates that this C compiler knows how - * to copy structures. If undefined, you'll need to use a block copy - * routine of some sort instead. - */ -#define STRUCTCOPY /**/ - -/* vfork: - * This symbol, if defined, remaps the vfork routine to fork if the - * vfork() routine isn't supported here. - */ -#/*undef vfork fork /**/ - -/* VOIDFLAGS: - * This symbol indicates how much support of the void type is given by this - * compiler. What various bits mean: - * - * 1 = supports declaration of void - * 2 = supports arrays of pointers to functions returning void - * 4 = supports comparisons between pointers to void functions and - * addresses of void functions - * - * The package designer should define VOIDUSED to indicate the requirements - * of the package. This can be done either by #defining VOIDUSED before - * including config.h, or by defining defvoidused in Myinit.U. If the - * level of void support necessary is not present, defines void to int. - */ -#ifndef VOIDUSED -#define VOIDUSED 7 -#endif -#define VOIDFLAGS 7 -#if (VOIDFLAGS & VOIDUSED) != VOIDUSED -#define void int /* is void to be avoided? */ -#define M_VOID /* Xenix strikes again */ -#endif - diff --git a/config.h b/config.h new file mode 100644 index 0000000000..333d4bbc62 --- /dev/null +++ b/config.h @@ -0,0 +1,190 @@ +/* + * This file was produced by running the config_h.SH script, which + * gets its values from config.sh, which is generally produced by + * running Configure. + * + * Feel free to modify any of this as the need arises. Note, however, + * that running config_h.SH again will wipe out any changes you've made. + * For a more permanent change edit config.sh and rerun config_h.SH. + * + * $Id: config_h.SH 821 2002-10-22 11:14:00Z richardc $ + */ + +/* + * Package name : perl + * Source directory : . + * Configuration time: Wed Dec 18 15:31:08 PST 2002 + * Configured by : schwern + * Target system : linux blackrider 2.4.19 #1 wed nov 13 02:17:13 est 2002 ppc 740750 gnulinux + */ + +#ifndef _config_h_ +#define _config_h_ + +/* EUNICE: + * This symbol, if defined, indicates that the program is being compiled + * under the EUNICE package under VMS. The program will need to handle + * things like files that don't go away the first time you unlink them, + * due to version numbering. It will also need to compensate for lack + * of a respectable link() command. + */ +/*#define EUNICE / **/ + +/* CPP: + * This symbol contains the first part of the string which will invoke + * the C preprocessor on the standard input and produce to standard + * output. Typical value of "cc -E" or "/lib/cpp". + */ +/* CPPMINUS: + * This symbol contains the second part of the string which will invoke + * the C preprocessor on the standard input and produce to standard + * output. This symbol will have the value "-" if CPPSTDIN needs a minus + * to specify standard input, otherwise the value is "". + */ +#define CPP "/usr/bin/cpp" +#define CPPMINUS "-" + +/* SED: + * Your sed binary + */ +#define SED "/bin/sed" + +/* CHARSPRINTF: + * This symbol is defined if this system declares "char *sprintf()" in + * stdio.h. The trend seems to be to declare it as "int sprintf()". It + * is up to the package author to declare sprintf correctly based on the + * symbol. + */ +/*#define CHARSPRINTF / **/ + +/* HAS_CRYPT: + * This symbol, if defined, indicates that the crypt routine is available + * to encrypt passwords and the like. + */ +#define HAS_CRYPT /**/ + +/* HAS_RENAME: + * This symbol, if defined, indicates that the rename routine is available + * to rename files. Otherwise you should do the unlink(), link(), unlink() + * trick. + */ +#define HAS_RENAME /**/ + +/* HAS_SELECT: + * This symbol, if defined, indicates that the select routine is + * available to select active file descriptors. If the timeout field + * is used, may need to be included. + */ +#define HAS_SELECT /**/ + +/* HAS_STAT: + * This symbol, if defined, indicates that the stat routine is + * available to get file status. + */ +#define HAS_STAT /**/ + +/* USE_STAT_BLOCKS: + * This symbol is defined if this system has a stat structure declaring + * st_blksize and st_blocks. + */ +/*#define USE_STAT_BLOCKS / **/ + +/* USE_STDIO_PTR: + * This symbol is defined if the _ptr and _cnt fields (or similar) + * of the stdio FILE structure can be used to access the stdio buffer + * for a file handle. If this is defined, then the FILE_ptr(fp) + * and FILE_cnt(fp) macros will also be defined and should be used + * to access these fields. + */ +/*#define USE_STDIO_PTR / **/ +#ifdef USE_STDIO_PTR +#if defined(STDIO_PTR_LVALUE) && defined(STDIO_CNT_LVALUE) +#endif +#endif + +/* USE_STRUCT_COPY: + * This symbol, if defined, indicates that this C compiler knows how + * to copy structures. If undefined, you'll need to use a block copy + * routine of some sort instead. + */ +#define USE_STRUCT_COPY /**/ + +/* HAS_SYSTEM: + * This symbol, if defined, indicates that the system routine is + * available to issue a shell command. + */ +#define HAS_SYSTEM /**/ + +/* HAS_TIMES: + * This symbol, if defined, indicates that the times() routine exists. + * Note that this became obsolete on some systems (SUNOS), which now + * use getrusage(). It may be necessary to include . + */ +#define HAS_TIMES /**/ + +/* TM_IN_SYS: + * This symbol is defined if this system declares "struct tm" in + * in rather than . We can't just say + * -I/usr/include/sys because some systems have both time files, and + * the -I trick gets the wrong one. + */ +/*#define TM_IN_SYS / **/ + +/* VOIDSIG: + * This symbol is defined if this system declares "void (*signal(...))()" in + * signal.h. The old way was to declare it as "int (*signal(...))()". It + * is up to the package author to declare things correctly based on the + * symbol. + */ +#define VOIDSIG /**/ + +/* CAN_PROTOTYPE: + * If defined, this macro indicates that the C compiler can handle + * function prototypes. + */ +/* _: + * This macro is used to declare function parameters for folks who want + * to make declarations with prototypes using a different style than + * the above macros. Use double parentheses. For example: + * + * int main _((int argc, char *argv[])); + */ +#define CAN_PROTOTYPE /**/ +#ifdef CAN_PROTOTYPE +#define _(args) args +#else +#define _(args) () +#endif + +/* STDCHAR: + * This symbol is defined to be the type of char used in stdio.h. + * It has the values "unsigned char" or "char". + */ +#define STDCHAR char /**/ + +/* VOIDFLAGS: + * This symbol indicates how much support of the void type is given by this + * compiler. What various bits mean: + * + * 1 = supports declaration of void + * 2 = supports arrays of pointers to functions returning void + * 4 = supports comparisons between pointers to void functions and + * addresses of void functions + * 8 = suports declaration of generic void pointers + * + * The package designer should define VOIDUSED to indicate the requirements + * of the package. This can be done either by #defining VOIDUSED before + * including config.h, or by defining defvoidused in Myinit.U. If the + * latter approach is taken, only those flags will be tested. If the + * level of void support necessary is not present, defines void to int. + */ +#ifndef VOIDUSED +#define VOIDUSED 15 +#endif +#define VOIDFLAGS 15 +#if (VOIDFLAGS & VOIDUSED) != VOIDUSED +#define void int /* is void to be avoided? */ +#define M_VOID /* Xenix strikes again */ +#endif + +#endif diff --git a/config.h.SH b/config.h.SH deleted file mode 100644 index a1778a4568..0000000000 --- a/config.h.SH +++ /dev/null @@ -1,161 +0,0 @@ -case $CONFIG in -'') - if test ! -f config.sh; then - ln ../config.sh . || \ - ln ../../config.sh . || \ - ln ../../../config.sh . || \ - (echo "Can't find config.sh."; exit 1) - echo "Using config.sh from above..." - fi - . config.sh - ;; -esac -echo "Extracting config.h (with variable substitutions)" -cat <config.h -/* config.h - * This file was produced by running the config.h.SH script, which - * gets its values from config.sh, which is generally produced by - * running Configure. - * - * Feel free to modify any of this as the need arises. Note, however, - * that running config.h.SH again will wipe out any changes you've made. - * For a more permanent change edit config.sh and rerun config.h.SH. - */ - - -/* EUNICE: - * This symbol, if defined, indicates that the program is being compiled - * under the EUNICE package under VMS. The program will need to handle - * things like files that don't go away the first time you unlink them, - * due to version numbering. It will also need to compensate for lack - * of a respectable link() command. - */ -/* VMS: - * This symbol, if defined, indicates that the program is running under - * VMS. It is currently only set in conjunction with the EUNICE symbol. - */ -#$d_eunice EUNICE /**/ -#$d_eunice VMS /**/ - -/* CPP: - * This symbol contains the first part of the string which will invoke - * the C preprocessor on the standard input and produce to standard - * output. Typical value of "cc -E" or "/lib/cpp". - */ -/* CPPMINUS: - * This symbol contains the second part of the string which will invoke - * the C preprocessor on the standard input and produce to standard - * output. This symbol will have the value "-" if CPP needs a minus - * to specify standard input, otherwise the value is "". - */ -#define CPP "$cpp" -#define CPPMINUS "$cppminus" - -/* BCOPY: - * This symbol, if defined, indicates that the bcopy routine is available - * to copy blocks of memory. Otherwise you should probably use memcpy(). - */ -#$d_bcopy BCOPY /**/ - -/* CHARSPRINTF: - * This symbol is defined if this system declares "char *sprintf()" in - * stdio.h. The trend seems to be to declare it as "int sprintf()". It - * is up to the package author to declare sprintf correctly based on the - * symbol. - */ -#$d_charsprf CHARSPRINTF /**/ - -/* CRYPT: - * This symbol, if defined, indicates that the crypt routine is available - * to encrypt passwords and the like. - */ -#$d_crypt CRYPT /**/ - -/* index: - * This preprocessor symbol is defined, along with rindex, if the system - * uses the strchr and strrchr routines instead. - */ -/* rindex: - * This preprocessor symbol is defined, along with index, if the system - * uses the strchr and strrchr routines instead. - */ -#$d_index index strchr /* cultural */ -#$d_index rindex strrchr /* differences? */ - -/* STATBLOCKS: - * This symbol is defined if this system has a stat structure declaring - * st_blksize and st_blocks. - */ -#$d_statblks STATBLOCKS /**/ - -/* STDSTDIO: - * This symbol is defined if this system has a FILE structure declaring - * _ptr and _cnt in stdio.h. - */ -#$d_stdstdio STDSTDIO /**/ - -/* STRUCTCOPY: - * This symbol, if defined, indicates that this C compiler knows how - * to copy structures. If undefined, you'll need to use a block copy - * routine of some sort instead. - */ -#$d_strctcpy STRUCTCOPY /**/ - -/* SYMLINK: - * This symbol, if defined, indicates that the symlink routine is available - * to create symbolic links. - */ -#$d_symlink SYMLINK /**/ - -/* TMINSYS: - * This symbol is defined if this system declares "struct tm" in - * in rather than . We can't just say - * -I/usr/include/sys because some systems have both time files, and - * the -I trick gets the wrong one. - */ -#$d_tminsys TMINSYS /**/ - -/* vfork: - * This symbol, if defined, remaps the vfork routine to fork if the - * vfork() routine isn't supported here. - */ -#$d_vfork vfork fork /**/ - -/* VOIDSIG: - * This symbol is defined if this system declares "void (*signal())()" in - * signal.h. The old way was to declare it as "int (*signal())()". It - * is up to the package author to declare things correctly based on the - * symbol. - */ -#$d_voidsig VOIDSIG /**/ - -/* STDCHAR: - * This symbol is defined to be the type of char used in stdio.h. - * It has the values "unsigned char" or "char". - */ -#define STDCHAR $stdchar /**/ - -/* VOIDFLAGS: - * This symbol indicates how much support of the void type is given by this - * compiler. What various bits mean: - * - * 1 = supports declaration of void - * 2 = supports arrays of pointers to functions returning void - * 4 = supports comparisons between pointers to void functions and - * addresses of void functions - * - * The package designer should define VOIDUSED to indicate the requirements - * of the package. This can be done either by #defining VOIDUSED before - * including config.h, or by defining defvoidused in Myinit.U. If the - * level of void support necessary is not present, defines void to int. - */ -#ifndef VOIDUSED -#define VOIDUSED $defvoidused -#endif -#define VOIDFLAGS $voidflags -#if (VOIDFLAGS & VOIDUSED) != VOIDUSED -#$define void int /* is void to be avoided? */ -#$define M_VOID /* Xenix strikes again */ -#endif - -!GROK!THIS! diff --git a/config_H b/config_H new file mode 100644 index 0000000000..bb9eb6b09a --- /dev/null +++ b/config_H @@ -0,0 +1,80 @@ +/* config.h + * This file was produced by running the config.h.SH script, which + * gets its values from config.sh, which is generally produced by + * running Configure. + * + * Feel free to modify any of this as the need arises. Note, however, + * that running config.h.SH again will wipe out any changes you've made. + * For a more permanent change edit config.sh and rerun config.h.SH. + */ + + +/* EUNICE: + * This symbol, if defined, indicates that the program is being compiled + * under the EUNICE package under VMS. The program will need to handle + * things like files that don't go away the first time you unlink them, + * due to version numbering. It will also need to compensate for lack + * of a respectable link() command. + */ +/* VMS: + * This symbol, if defined, indicates that the program is running under + * VMS. It is currently only set in conjunction with the EUNICE symbol. + */ +#/*undef EUNICE /**/ +#/*undef VMS /**/ + +/* CHARSPRINTF: + * This symbol is defined if this system declares "char *sprintf()" in + * stdio.h. The trend seems to be to declare it as "int sprintf()". It + * is up to the package author to declare sprintf correctly based on the + * symbol. + */ +#define CHARSPRINTF /**/ + +/* index: + * This preprocessor symbol is defined, along with rindex, if the system + * uses the strchr and strrchr routines instead. + */ +/* rindex: + * This preprocessor symbol is defined, along with index, if the system + * uses the strchr and strrchr routines instead. + */ +#/*undef index strchr /* cultural */ +#/*undef rindex strrchr /* differences? */ + +/* STRUCTCOPY: + * This symbol, if defined, indicates that this C compiler knows how + * to copy structures. If undefined, you'll need to use a block copy + * routine of some sort instead. + */ +#define STRUCTCOPY /**/ + +/* vfork: + * This symbol, if defined, remaps the vfork routine to fork if the + * vfork() routine isn't supported here. + */ +#/*undef vfork fork /**/ + +/* VOIDFLAGS: + * This symbol indicates how much support of the void type is given by this + * compiler. What various bits mean: + * + * 1 = supports declaration of void + * 2 = supports arrays of pointers to functions returning void + * 4 = supports comparisons between pointers to void functions and + * addresses of void functions + * + * The package designer should define VOIDUSED to indicate the requirements + * of the package. This can be done either by #defining VOIDUSED before + * including config.h, or by defining defvoidused in Myinit.U. If the + * level of void support necessary is not present, defines void to int. + */ +#ifndef VOIDUSED +#define VOIDUSED 7 +#endif +#define VOIDFLAGS 7 +#if (VOIDFLAGS & VOIDUSED) != VOIDUSED +#define void int /* is void to be avoided? */ +#define M_VOID /* Xenix strikes again */ +#endif + diff --git a/config_h.SH b/config_h.SH new file mode 100644 index 0000000000..fb37fac75c --- /dev/null +++ b/config_h.SH @@ -0,0 +1,209 @@ +case $CONFIG in +'') + if test -f config.sh; then TOP=.; + elif test -f ../config.sh; then TOP=..; + elif test -f ../../config.sh; then TOP=../..; + elif test -f ../../../config.sh; then TOP=../../..; + elif test -f ../../../../config.sh; then TOP=../../../..; + else + echo "Can't find config.sh."; exit 1 + fi + . $TOP/config.sh + ;; +esac +case "$0" in +*/*) cd `expr X$0 : 'X\(.*\)/'` ;; +esac +echo "Extracting config.h (with variable substitutions)" +sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-def!#undef!' +/* + * This file was produced by running the config_h.SH script, which + * gets its values from config.sh, which is generally produced by + * running Configure. + * + * Feel free to modify any of this as the need arises. Note, however, + * that running config_h.SH again will wipe out any changes you've made. + * For a more permanent change edit config.sh and rerun config_h.SH. + * + * \$Id: config_h.SH 821 2002-10-22 11:14:00Z richardc $ + */ + +/* + * Package name : $package + * Source directory : $src + * Configuration time: $cf_time + * Configured by : $cf_by + * Target system : $myuname + */ + +#ifndef _config_h_ +#define _config_h_ + +/* EUNICE: + * This symbol, if defined, indicates that the program is being compiled + * under the EUNICE package under VMS. The program will need to handle + * things like files that don't go away the first time you unlink them, + * due to version numbering. It will also need to compensate for lack + * of a respectable link() command. + */ +#$d_eunice EUNICE /**/ + +/* CPP: + * This symbol contains the first part of the string which will invoke + * the C preprocessor on the standard input and produce to standard + * output. Typical value of "cc -E" or "/lib/cpp". + */ +/* CPPMINUS: + * This symbol contains the second part of the string which will invoke + * the C preprocessor on the standard input and produce to standard + * output. This symbol will have the value "-" if CPPSTDIN needs a minus + * to specify standard input, otherwise the value is "". + */ +#define CPP "$cpp" +#define CPPMINUS "$cppminus" + +/* SED: + * Your sed binary + */ +#define SED "$sed" + +/* CHARSPRINTF: + * This symbol is defined if this system declares "char *sprintf()" in + * stdio.h. The trend seems to be to declare it as "int sprintf()". It + * is up to the package author to declare sprintf correctly based on the + * symbol. + */ +#$d_charsprf CHARSPRINTF /**/ + +/* HAS_CRYPT: + * This symbol, if defined, indicates that the crypt routine is available + * to encrypt passwords and the like. + */ +#$d_crypt HAS_CRYPT /**/ + +/* HAS_RENAME: + * This symbol, if defined, indicates that the rename routine is available + * to rename files. Otherwise you should do the unlink(), link(), unlink() + * trick. + */ +#$d_rename HAS_RENAME /**/ + +/* HAS_SELECT: + * This symbol, if defined, indicates that the select routine is + * available to select active file descriptors. If the timeout field + * is used, may need to be included. + */ +#$d_select HAS_SELECT /**/ + +/* HAS_STAT: + * This symbol, if defined, indicates that the stat routine is + * available to get file status. + */ +#$d_stat HAS_STAT /**/ + +/* USE_STAT_BLOCKS: + * This symbol is defined if this system has a stat structure declaring + * st_blksize and st_blocks. + */ +#$d_statblks USE_STAT_BLOCKS /**/ + +/* USE_STDIO_PTR: + * This symbol is defined if the _ptr and _cnt fields (or similar) + * of the stdio FILE structure can be used to access the stdio buffer + * for a file handle. If this is defined, then the FILE_ptr(fp) + * and FILE_cnt(fp) macros will also be defined and should be used + * to access these fields. + */ +#$d_stdstdio USE_STDIO_PTR /**/ +#ifdef USE_STDIO_PTR +#if defined(STDIO_PTR_LVALUE) && defined(STDIO_CNT_LVALUE) +#endif +#endif + +/* USE_STRUCT_COPY: + * This symbol, if defined, indicates that this C compiler knows how + * to copy structures. If undefined, you'll need to use a block copy + * routine of some sort instead. + */ +#$d_strctcpy USE_STRUCT_COPY /**/ + +/* HAS_SYSTEM: + * This symbol, if defined, indicates that the system routine is + * available to issue a shell command. + */ +#$d_system HAS_SYSTEM /**/ + +/* HAS_TIMES: + * This symbol, if defined, indicates that the times() routine exists. + * Note that this became obsolete on some systems (SUNOS), which now + * use getrusage(). It may be necessary to include . + */ +#$d_times HAS_TIMES /**/ + +/* TM_IN_SYS: + * This symbol is defined if this system declares "struct tm" in + * in rather than . We can't just say + * -I/usr/include/sys because some systems have both time files, and + * the -I trick gets the wrong one. + */ +#$d_tminsys TM_IN_SYS /**/ + +/* VOIDSIG: + * This symbol is defined if this system declares "void (*signal(...))()" in + * signal.h. The old way was to declare it as "int (*signal(...))()". It + * is up to the package author to declare things correctly based on the + * symbol. + */ +#$d_voidsig VOIDSIG /**/ + +/* CAN_PROTOTYPE: + * If defined, this macro indicates that the C compiler can handle + * function prototypes. + */ +/* _: + * This macro is used to declare function parameters for folks who want + * to make declarations with prototypes using a different style than + * the above macros. Use double parentheses. For example: + * + * int main _((int argc, char *argv[])); + */ +#$prototype CAN_PROTOTYPE /**/ +#ifdef CAN_PROTOTYPE +#define _(args) args +#else +#define _(args) () +#endif + +/* STDCHAR: + * This symbol is defined to be the type of char used in stdio.h. + * It has the values "unsigned char" or "char". + */ +#define STDCHAR $stdchar /**/ + +/* VOIDFLAGS: + * This symbol indicates how much support of the void type is given by this + * compiler. What various bits mean: + * + * 1 = supports declaration of void + * 2 = supports arrays of pointers to functions returning void + * 4 = supports comparisons between pointers to void functions and + * addresses of void functions + * 8 = suports declaration of generic void pointers + * + * The package designer should define VOIDUSED to indicate the requirements + * of the package. This can be done either by #defining VOIDUSED before + * including config.h, or by defining defvoidused in Myinit.U. If the + * latter approach is taken, only those flags will be tested. If the + * level of void support necessary is not present, defines void to int. + */ +#ifndef VOIDUSED +#define VOIDUSED $defvoidused +#endif +#define VOIDFLAGS $voidflags +#if (VOIDFLAGS & VOIDUSED) != VOIDUSED +#define void int /* is void to be avoided? */ +#define M_VOID /* Xenix strikes again */ +#endif + +#endif +!GROK!THIS! diff --git a/form.c b/form.c index 8894621c9f..0c7af03cea 100644 --- a/form.c +++ b/form.c @@ -17,7 +17,7 @@ #define CHKLEN(allow) \ if (d - orec->o_str + (allow) >= curlen) { \ curlen = d - orec->o_str; \ - GROWSTR(&orec->o_str,&orec->o_len,orec->o_len + (allow)); \ + GROWSTR(&orec->o_str,&orec->o_len,orec->o_len + (allow) + 1); \ d = orec->o_str + curlen; /* in case it moves */ \ curlen = orec->o_len - 2; \ } diff --git a/hints/3b1.sh b/hints/3b1.sh new file mode 100644 index 0000000000..991348af3e --- /dev/null +++ b/hints/3b1.sh @@ -0,0 +1,15 @@ +d_voidsig='undef' +d_tosignal='int' +gidtype='int' +groupstype='int' +uidtype='int' +# Note that 'Configure' is run from 'UU', hence the strange 'ln' +# command. +for i in .. ../x2p +do + rm -f $i/3b1cc + ln ../hints/3b1cc $i +done +echo "\nIf you want to use the 3b1 shared libraries, complete this script then" >&4 +echo "read the header in 3b1cc. [Type carriage return to continue]\c" >&4 +read vch diff --git a/hints/3b1cc b/hints/3b1cc new file mode 100644 index 0000000000..0001e046b8 --- /dev/null +++ b/hints/3b1cc @@ -0,0 +1,88 @@ +# To incorporate the 7300/3b1 shared library, run this script in place +# of 'CC'. +# You can skip this is you have the shcc program installed as cc in +# your path. +# First: Run 'Configure' through to the end and run 'make depend'. +# Second: Edit 'makefile' ( not Makefile ) and set CC = 3b1cc. +# Third: Edit 'x2p/makefile' and set CC = 3b1cc. +# +# Do not use '3b1cc' as the default compiler. The call to the default +# compiler is used by 'perl' and will not be available when running +# 'perl'. +# +# Note: This script omits libraries which are redundant in the shared +# library. It is an excerpt from a grander version available upon +# request from "zebra!vern" or "vern@zebra.alphacdc.com". + +CC="cc" +LIBS= +INCL= + +LD="ld" +SHAREDLIB="/lib/crt0s.o /lib/shlib.ifile" + +# Local variables +COBJS= +LOBJS= +TARG= +FLAGS= +CMD= + +# These are libraries which are incorporated in the shared library +OMIT="-lmalloc" + +# These routines are in libc.a but not in the shared library +if [ ! -f vsprintf.o -o ! -f doprnt.o ] +then + echo "Extracting vsprintf.o from libc.a" + ar -x /lib/libc.a vsprintf.o doprnt.o +fi + +CMD="$CC" +while [ $# -gt 0 ] +do + case $1 in + -c) CFLAG=$1;; + -o) CFLAG=$1 + shift + TARG="$1";; + -l*) match=false + for i in $OMIT + do + [ "$i" = "$1" ] && match=true + done + [ "$match" != false ] || LIBS="$LIBS $1";; + -*) FLAGS="$FLAGS $1";; + *.c) COBJS="$COBJS $1";; + *.o) LOBJS="$LOBJS $1";; + *) TARG="$1";; + esac + shift +done + +if [ -n "$COBJS" ] +then + CMD="$CMD $FLAGS $INCL $LPATHS $LIBS $COBJS $CFLAG $TARG" +elif [ -n "$LOBJS" ] +then + LOBJS="$LOBJS vsprintf.o doprnt.o" + CMD="$LD -r $LOBJS $LPATHS $LIBS -o temp.o" + echo "\t$CMD" + $CMD + CMD="$LD -s temp.o $SHAREDLIB -o $TARG" + echo "\t$CMD" + $CMD + ccrslt=$? + if [ $ccrslt -ne 0 ] + then + exit $ccrslt + fi + CMD="rm -f temp.o" +else + exit 1 +fi +echo "\t$CMD" +$CMD +ccrslt=$? +rm -f $$.c +exit $ccrslt diff --git a/hints/README.hints b/hints/README.hints new file mode 100644 index 0000000000..1d0f35cccd --- /dev/null +++ b/hints/README.hints @@ -0,0 +1,318 @@ +=head1 NAME + +README.hints + +=head1 DESCRIPTION + +These files are used by Configure to set things which Configure either +can't or doesn't guess properly. Most of these hint files have been +tested with at least some version of perl5, but some are still left +over from perl4. + +Please send any problems or suggested changes to perlbug@perl.org. + +=head1 Hint file naming convention. + +Each hint file name should have only +one '.'. (This is for portability to non-unix file systems.) Names +should also fit in <= 14 characters, for portability to older SVR3 +systems. File names are of the form $osname_$osvers.sh, with all '.' +changed to '_', and all characters (such as '/') that don't belong in +Unix filenames omitted. + +For example, consider Sun OS 4.1.3. Configure determines $osname=sunos +(all names are converted to lower case) and $osvers=4.1.3. Configure +will search for an appropriate hint file in the following order: + + sunos_4_1_3.sh + sunos_4_1.sh + sunos_4.sh + sunos.sh + +If you need to create a hint file, please try to use as general a name +as possible and include minor version differences inside case or test +statements. For example, for IRIX 6.X, we have the following hints +files: + + irix_6_0.sh + irix_6_1.sh + irix_6.sh + +That is, 6.0 and 6.1 have their own special hints, but 6.2, 6.3, and +up are all handled by the same irix_6.sh. That way, we don't have to +make a new hint file every time the IRIX O/S is upgraded. + +If you need to test for specific minor version differences in your +hints file, be sure to include a default choice. (See aix.sh for one +example.) That way, if you write a hint file for foonix 3.2, it might +still work without any changes when foonix 3.3 is released. + +Please also comment carefully on why the different hints are needed. +That way, a future version of Configure may be able to automatically +detect what is needed. + +A glossary of config.sh variables is in the file Porting/Glossary. + +=head1 Setting variables + +=head2 Optimizer + +If you want to set a variable, try to allow for Configure command-line +overrides. For example, suppose you think the default optimizer +setting to be -O2 for a particular platform. You should allow for +command line overrides with something like + + case "$optimize" in + '') optimize='-O2' ;; + esac + +or, if your system has a decent test(1) command, + + test -z "$optimize" && optimize='-O2' + +This allows the user to select a different optimization level, e.g. +-O6 or -g. + +=head2 Compiler and Linker flags + +If you want to set $ccflags or $ldflags, you should append to the existing +value to allow Configure command-line settings, e.g. use + + ccflags="$ccflags -DANOTHER_OPTION_I_NEED" + +so that the user can do something like + + sh Configure -Dccflags='FIX_NEGATIVE_ZERO' + +and have the FIX_NEGATIVE_ZERO value preserved by the hints file. + +=head2 Libraries + +Configure will attempt to use the libraries listed in the variable +$libswanted. If necessary, you should remove broken libraries from +that list, or add additional libraries to that list. You should +*not* simply set $libs -- that ignores the possibilities of local +variations. For example, a setting of libs='-lgdbm -lm -lc' would +fail if another user were to try to compile Perl on a system without +GDBM but with Berkeley DB. See hints/dec_osf.sh and hints/solaris_2.sh +for examples. + +=head2 Other + +In general, try to avoid hard-wiring something that Configure will +figure out anyway. Also try to allow for Configure command-line +overrides. + +=head1 Working around compiler bugs + +Occasionally, the root cause of a bug in perl turns out to be due to a bug +in the compiler. Often, changing the compilation options (particularly the +optimization level) can work around the bug. However, if you try to do +this on the command line, you will be changing the compilation options for +every component of perl, which can really hurt perl's performance. +Instead, consider placing a test case into the hints directory to detect +whether the compiler bug is present, and add logic to the hints file to +take a specific and appropriate action + +=head2 Test-case conventions + +Test cases should be named "tNNN.c", where NNN is the next unused sequence +number. The test case must be executable and should display a message +containing the word "fails" when the compiler bug is present. It should +display the word "works" with the compiler bug is not present. The test +cases should be liberally commented and may be used by any hints file that +needs them. See the first hints file (t001.c) for an example. + +=head2 Hint file processing + +The hint file must define a call-back unit (see below) that will compile, +link, and run the test case, and then check for the presence of the string +"fails" in the output. If it finds this string, it sets a special variable +to specify the compilation option(s) for the specific perl source file that +is affected by the bug. + +The special variable is named "XXX_cflags" where "XXX" is the name of +the source file (without the ".c" suffix). The value of this variable +is the string "optimize=YYY", where "YYY" is the compilation option +necessary to work around the bug. The default value of this variable +is "-O" (letter O), which specifies that the C compiler should compile +the source program at the default optimization level. If you can +avoid the compiler bug by disabling optimization, just reset the +"optimize" variable to the null string. Sometimes a bug is present at +a higher optimization level (say, O3) and not present at a lower +optimization level (say, O1). In this case, you should specify the +highest optimization level at which the bug is not present, so that +you will retain as many of the benefits of code optimization as +possible. + +For example, if the pp_pack.c source file must be compiled at +optimization level 0 to work around a problem on a particular +platform, one of the statements + + pp_pack_cflags="optimize=-O0" or + pp_pack_cflags="optimize=" + +will do the trick, since level 0 is equivalent to no optimization. +(In case your printer or display device does not distinguish the +letter O from the digit 0, that is the letter O followed by the digit +0). You can specify any compiler option or set of options here, not +just optimizer options. These options are appended to the list of all +other compiler options, so you should be able to override almost any +compiler option prepared by Configure. (Obviously this depends on how +the compiler treats conflicting options, but most seem to go with the +last value specified on the command line). + +You should also allow for the XXX_cflags variable to be overridden on the +command line. + +See the vos.sh hints file for an extended example of these techniques. + +=head1 Hint file tricks + +=head2 Printing critical messages + +[This is still experimental] + +If you have a *REALLY* important message that the user ought to see at +the end of the Configure run, you can store it in the file +'config.msg'. At the end of the Configure run, Configure will display +the contents of this file. Currently, the only place this is used is +in Configure itself to warn about the need to set LD_LIBRARY_PATH if +you are building a shared libperl.so. + +To use this feature, just do something like the following + + $cat <&4 + + This is a really important message. Be sure to read it + before you type 'make'. + EOM + +This message will appear on the screen as the hint file is being +processed and again at the end of Configure. + +Please use this sparingly. + +=head2 Propagating variables to config.sh + +Sometimes, you want an extra variable to appear in config.sh. For +example, if your system can't compile toke.c with the optimizer on, +you can put + + toke_cflags='optimize=""' + +at the beginning of a line in your hints file. Configure will then +extract that variable and place it in your config.sh file. Later, +while compiling toke.c, the cflags shell script will eval $toke_cflags +and hence compile toke.c without optimization. + +Note that for this to work, the variable you want to propagate must +appear in the first column of the hint file. It is extracted by +Configure with a simple sed script, so beware that surrounding case +statements aren't any help. + +By contrast, if you don't want Configure to propagate your temporary +variable, simply indent it by a leading tab in your hint file. + +For example, prior to 5.002, a bug in scope.c led to perl crashing +when compiled with -O in AIX 4.1.1. The following "obvious" +workaround in hints/aix.sh wouldn't work as expected: + + case "$osvers" in + 4.1.1) + scope_cflags='optimize=""' + ;; + esac + +because Configure doesn't parse the surrounding 'case' statement, it +just blindly propagates any variable that starts in the first column. +For this particular case, that's probably harmless anyway. + +Three possible fixes are: + +=over + +=item 1 + +Create an aix_4_1_1.sh hint file that contains the scope_cflags +line and then sources the regular aix hints file for the rest of +the information. + +=item 2 + +Do the following trick: + + scope_cflags='case "$osvers" in 4.1*) optimize=" ";; esac' + +Now when $scope_cflags is eval'd by the cflags shell script, the +case statement is executed. Of course writing scripts to be eval'd is +tricky, especially if there is complex quoting. Or, + +=item 3 + +Write directly to Configure's temporary file UU/config.sh. +You can do this with + + case "$osvers" in + 4.1.1) + echo "scope_cflags='optimize=\"\"'" >> UU/config.sh + scope_cflags='optimize=""' + ;; + esac + +Note you have to both write the definition to the temporary +UU/config.sh file and set the variable to the appropriate value. + +This is sneaky, but it works. Still, if you need anything this +complex, perhaps you should create the separate hint file for +aix 4.1.1. + +=back + +=head2 Call-backs + +=over 4 + +=item Compiler-related flags + +The settings of some things, such as optimization flags, may depend on +the particular compiler used. For example, consider the following: + + case "$cc" in + *gcc*) ccflags="$ccflags -posix" + ldflags="$ldflags -posix" + ;; + *) ccflags="$ccflags -Xp -D_POSIX_SOURCE" + ldflags="$ldflags -Xp" + ;; + esac + +However, the hints file is processed before the user is asked which +compiler should be used. Thus in order for these hints to be useful, +the user must specify sh Configure -Dcc=gcc on the command line, as +advised by the INSTALL file. + +For versions of perl later than 5.004_61, this problem can +be circumvented by the use of "call-back units". That is, the hints +file can tuck this information away into a file UU/cc.cbu. Then, +after Configure prompts the user for the C compiler, it will load in +and run the UU/cc.cbu "call-back" unit. See hints/solaris_2.sh for an +example. + +=item Future status + +I hope this "call-back" scheme is simple enough to use but powerful +enough to deal with most situations. Still, there are certainly cases +where it's not enough. For example, for aix we actually change +compilers if we are using threads. + +I'd appreciate feedback on whether this is sufficiently general to be +helpful, or whether we ought to simply continue to require folks to +say things like "sh Configure -Dcc=gcc -Dusethreads" on the command line. + +=back + +Have the appropriate amount of fun :-) + + Andy Dougherty doughera@lafayette.edu (author) + Paul Green paul.green@stratus.com (compiler bugs) diff --git a/hints/aix.sh b/hints/aix.sh new file mode 100644 index 0000000000..09ca0a4b57 --- /dev/null +++ b/hints/aix.sh @@ -0,0 +1,518 @@ +# hints/aix.sh +# AIX 3.x.x hints thanks to Wayne Scott +# AIX 4.1 hints thanks to Christopher Chan-Nui . +# AIX 4.1 pthreading by Christopher Chan-Nui and +# Jarkko Hietaniemi . +# AIX 4.3.x LP64 build by Steven Hirsch +# Merged on Mon Feb 6 10:22:35 EST 1995 by +# Andy Dougherty + +# +# Contact dfavor@corridor.com for any of the following: +# +# - AIX 43x and above support +# - gcc + threads support +# - socks support +# +# Apr 99 changes: +# +# - use nm in AIX 43x and above +# - gcc + threads now builds +# [(added support for socks) Jul 99 SOCKS support rewritten] +# +# Notes: +# +# - shared libperl support is tricky. if ever libperl.a ends up +# in /usr/local/lib/* it can override any subsequent builds of +# that same perl release. to make sure you know where the shared +# libperl.a is coming from do a 'dump -Hv perl' and check all the +# library search paths in the loader header. +# +# it would be nice to warn the user if a libperl.a exists that is +# going to override the current build, but that would be complex. +# +# better yet, a solid fix for this situation should be developed. +# + +# Configure finds setrgid and setruid, but they're useless. The man +# pages state: +# setrgid: The EPERM error code is always returned. +# setruid: The EPERM error code is always returned. Processes cannot +# reset only their real user IDs. +d_setrgid='undef' +d_setruid='undef' + +alignbytes=8 + +case "$usemymalloc" in +'') usemymalloc='n' ;; +esac + +# Intuiting the existence of system calls under AIX is difficult, +# at best; the safest technique is to find them empirically. + +# AIX 4.3.* and above default to using nm for symbol extraction +case "$osvers" in + 3.*|4.1.*|4.2.*) + case "$usenm" in + '') usenm='undef' + esac + case "$usenativedlopen" in + '') usenativedlopen='false' + esac + ;; + *) + case "$usenm" in + '') usenm='true' + esac + case "$usenativedlopen" in + '') usenativedlopen='true' + esac + ;; +esac + +so="a" +# AIX itself uses .o (libc.o) but we prefer compatibility +# with the rest of the world and with rest of the scripting +# languages (Tcl, Python) and related systems (SWIG). +# Stephanie Beals +dlext="so" + +# Take possible hint from the environment. If 32-bit is set in the +# environment, we can override it later. If set for 64, the +# 'sizeof' test sees a native 64-bit architecture and never looks back. +case "$OBJECT_MODE" in +32) + cat >&4 <&4 < +# +# Tell perl which symbols to export for dynamic linking. +cccdlflags='none' # All AIX code is position independent +cc_type=xlc +case "$cc" in +*gcc*) + cc_type=gcc + ccdlflags='-Xlinker' + if [ "X$gccversion" = "X" ]; then + # Done too late in Configure if hinted + gccversion=`$cc --version | sed 's/.*(GCC) *//` + fi + ;; +*) ccversion=`lslpp -L | grep 'C for AIX Compiler$' | grep -v '\.msg\.[A-Za-z_]*\.' | awk '{print $2}'` + case "$ccversion" in + '') ccversion=`lslpp -L | grep 'IBM C and C++ Compilers LUM$' | awk '{print $2}'` + ;; + *.*.*.*.*.*.*) # Ahhrgg, more than one C compiler installed + first_cc_path=`which ${cc:-cc}` + case "$first_cc_path" in + *vac*) + cc_type=vac ;; + /usr/bin/cc) # Check the symlink + if [ -h $first_cc_path ] ; then + ls -l $first_cc_path > reflect + if grep -i vac reflect >/dev/null 2>&1 ; then + cc_type=vac + fi + rm -f reflect + fi + ;; + esac + ccversion=`lslpp -L | grep 'C for AIX Compiler$' | grep -i $cc_type | awk '{print $2}' | head -1` + ;; + esac + case "$ccversion" in + 3.6.6.0) + optimize='none' + ;; + 4.4.0.0|4.4.0.1|4.4.0.2) + cat >&4 <&4 <&4 < "... c bind ..." + set `echo X "$libswanted "| sed -e 's/ bind\( .*\) \([cC]\) / \1 \2 bind /'` + shift + libswanted="$*" + ;; + esac + ;; + esac + +# This script UU/usethreads.cbu will get 'called-back' by Configure +# after it has prompted the user for whether to use threads. +cat > UU/usethreads.cbu <<'EOCBU' +case "$usethreads" in +$define|true|[yY]*) + ccflags="$ccflags -DNEED_PTHREAD_INIT" + case "$cc" in + *gcc*) +echo "GCC $gccversion disabling some _r functions" >&4 + case "$gccversion" in + 3*) d_drand48_r='undef' + d_endgrent_r='undef' + d_endpwent_r='undef' + d_getgrent_r='undef' + d_getpwent_r='undef' + d_random_r='undef' + d_srand48_r='undef' + d_strerror_r='undef' + ;; + esac + ;; + cc_r) ;; + cc|xl[cC]_r) + echo >&4 "Switching cc to cc_r because of POSIX threads." + # xlc_r has been known to produce buggy code in AIX 4.3.2. + # (e.g. pragma/overload core dumps) Let's suspect xlC_r, too. + # --jhi@iki.fi + cc=cc_r + + case "`oslevel`" in + 4.2.1.*) i_crypt='undef' ;; + esac + ;; + '') + cc=cc_r + ;; + *) + cat >&4 < UU/uselargefiles.cbu <<'EOCBU' +case "$uselargefiles" in +''|$define|true|[yY]*) + # Configure should take care of use64bitint and use64bitall being + # defined before uselargefiles.cbu is consulted. + if test X"$use64bitint:$quadtype" = X"$define:long" -o X"$use64bitall" = Xdefine; then +# Keep these at the left margin. +ccflags_uselargefiles="`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`" +ldflags_uselargefiles="`getconf XBS5_LP64_OFF64_LDFLAGS 2>/dev/null`" + else +# Keep these at the left margin. +ccflags_uselargefiles="`getconf XBS5_ILP32_OFFBIG_CFLAGS 2>/dev/null`" +ldflags_uselargefiles="`getconf XBS5_ILP32_OFFBIG_LDFLAGS 2>/dev/null`" + fi + # _Somehow_ in AIX 4.3.1.0 the above getconf call manages to + # insert(?) *something* to $ldflags so that later (in Configure) evaluating + # $ldflags causes a newline after the '-b64' (the result of the getconf). + # (nothing strange shows up in $ldflags even in hexdump; + # so it may be something (a bug) in the shell, instead?) + # Try it out: just uncomment the below line and rerun Configure: +# echo >&4 "AIX 4.3.1.0 $ldflags_uselargefiles mystery" ; exit 1 + # Just don't ask me how AIX does it, I spent hours wondering. + # Therefore the line re-evaluating ldflags_uselargefiles: it seems to fix + # the whatever it was that AIX managed to break. --jhi + ldflags_uselargefiles="`echo $ldflags_uselargefiles`" + if test X"$use64bitint:$quadtype" = X"$define:long" -o X"$use64bitall" = Xdefine; then +# Keep this at the left margin. +libswanted_uselargefiles="`getconf XBS5_LP64_OFF64_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g`" + else +# Keep this at the left margin. +libswanted_uselargefiles="`getconf XBS5_ILP32_OFFBIG_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g`" + fi + case "$ccflags_uselargefiles$ldflags_uselargefiles$libs_uselargefiles" in + '');; + *) ccflags="$ccflags $ccflags_uselargefiles" + ldflags="$ldflags $ldflags_uselargefiles" + libswanted="$libswanted $libswanted_uselargefiles" + ;; + esac + case "$gccversion" in + '') ;; + *) # Remove xlc-spefific -qflags. + ccflags="`echo $ccflags | sed -e 's@ -q[^ ]*@ @g' -e 's@^-q[^ ]* @@g'`" + ldflags="`echo $ldflags | sed -e 's@ -q[^ ]*@ @g' -e 's@^-q[^ ]* @@g'`" + # Move xld-spefific -bflags. + ccflags="`echo $ccflags | sed -e 's@ -b@ -Wl,-b@g'`" + ldflags="`echo ' '$ldflags | sed -e 's@ -b@ -Wl,-b@g'`" + lddlflags="`echo ' '$lddlflags | sed -e 's@ -b@ -Wl,-b@g'`" + ld='gcc' + echo >&4 "(using ccflags $ccflags)" + echo >&4 "(using ldflags $ldflags)" + echo >&4 "(using lddlflags $lddlflags)" + ;; + esac + ;; +esac +EOCBU + +# This script UU/use64bitint.cbu will get 'called-back' by Configure +# after it has prompted the user for whether to use 64 bit integers. +cat > UU/use64bitint.cbu <<'EOCBU' +case "$use64bitint" in +$define|true|[yY]*) + case "`oslevel`" in + 3.*|4.[012].*) + cat >&4 < UU/use64bitall.cbu <<'EOCBU' +# This script UU/use64bitall.cbu will get 'called-back' by Configure +# after it has prompted the user for whether to be maximally 64-bitty. +case "$use64bitall" in +$define|true|[yY]*) + case "`oslevel`" in + 3.*|4.[012].*) + cat >&4 <&4 + $cat >size.c < +#include +int main (void) +{ + printf("%d\n",_system_configuration.width); + return(0); +} +EOCP + set size + if eval $compile_ok; then + qacpuwidth=`./size` + echo "You are running on $qacpuwidth bit hardware." + else + dflt="32" + echo " " + echo "(I can't seem to compile the test program. Guessing...)" + rp="What is the width of your CPU (in bits)?" + . ./myread + qacpuwidth="$ans" + fi + $rm -f size.c size + case "$qacpuwidth" in + 32*) + cat >&4 <&1 | grep gcc`" = X; then + # Cify libswanted. + set `echo X "$libswanted "| sed -e 's/ c / C c /'` + shift + libswanted="$*" + # Cify lddlflags. + set `echo X "$lddlflags "| sed -e 's/ -lc / -lC -lc /'` + shift + lddlflags="$*" + fi + esac +fi + +# EOF diff --git a/hints/altos486.sh b/hints/altos486.sh new file mode 100644 index 0000000000..b85f907e34 --- /dev/null +++ b/hints/altos486.sh @@ -0,0 +1,3 @@ +: have heard of problems with -lc_s on Altos 486 +set `echo " $libswanted " | sed "s/ c_s / /"` +libswanted="$*" diff --git a/hints/amigaos.sh b/hints/amigaos.sh new file mode 100644 index 0000000000..c5ba6ff591 --- /dev/null +++ b/hints/amigaos.sh @@ -0,0 +1,55 @@ +# hints/amigaos.sh +# +# talk to pueschel@imsdd.meb.uni-bonn.de if you want to change this file. +# +# misc stuff +archname='m68k-amigaos' +cc='gcc' +firstmakefile='GNUmakefile' +usenm='true' +d_fork='undef' # available but ENOSYS + +usemymalloc='n' +useperlio='true' +d_eofnblk='define' +groupstype='int' + +# libs + +libpth="$prefix/lib /local/lib" +glibpth="$libpth" +xlibpth="$libpth" + +# This should remove unwanted libraries instead of limiting the set +# to just these few. E.g. what about Berkeley DB? +libswanted='gdbm m dld' +so=' ' +libs='-lm' + +# compiler & linker flags +# Respect command-line values. + +ccflags="$ccflags -DAMIGAOS" +case "$optimize" in +'') optimize='-O2 -fomit-frame-pointer';; +esac +dlext='o' +# Are these two different from the defaults? +cccdlflags='none' +ccdlflags='none' +lddlflags='-oformat a.out-amiga -r' + +# uncomment the following settings if you are compiling for an 68020+ system +# and want a residentable executable instead of dynamic loading + +# usedl='n' +# ccflags='-DAMIGAOS -mstackextend -m68020 -resident32' +# ldflags='-m68020 -resident32' + +# AmigaOS always reports only two links to directories, even if they +# contain subdirectories. Consequently, we use this variable to stop +# File::Find using the link count to determine whether there are +# subdirectories to be searched. This will generate a harmless message: +# Hmm...You had some extra variables I don't know about...I'll try to keep 'em. +# Propagating recommended variable dont_use_nlink +dont_use_nlink='define' diff --git a/hints/apollo.sh b/hints/apollo.sh new file mode 100644 index 0000000000..05f433dfc1 --- /dev/null +++ b/hints/apollo.sh @@ -0,0 +1,55 @@ +# Info from Johann Klasek +# Merged by Andy Dougherty +# Last revised Tue Mar 16 19:12:22 EET 1999 by +# Jarkko Hietaniemi + +# uname -a looks like +# DomainOS newton 10.4.1 bsd4.3 425t + +# We want to use both BSD includes and some of the features from the +# /sys5 includes. +ccflags="$ccflags -A cpu,mathchip -I`pwd`/apollo -I/usr/include -I/sys5/usr/include" + +# When Apollo runs a script with "#!", it sets argv[0] to the script name. +toke_cflags='ccflags="$ccflags -DARG_ZERO_IS_SCRIPT"' + +# These adjustments are necessary (why?) to compile malloc.c. +freetype='void' +i_malloc='undef' +malloctype='void *' + +# This info is left over from perl4. +cat <<'EOF' >&4 +Some tests may fail unless you use 'chacl -B'. Also, op/stat +test 2 may fail occasionally because Apollo doesn't guarantee +that mtime will be equal to ctime on a newly created unmodified +file. Finally, the sleep test will sometimes fail. See the +sleep(3) man page to learn why. + +See hints/apollo.sh for hints on running h2ph. + +And a note on ccflags: + + Lastly, while -A cpu,mathchip generates optimal code for your DN3500 + running sr10.3, be aware that you should be using -A cpu,mathlib_sr10 + if your perl must also run on any machines running sr10.0, sr10.1, or + sr10.2. The -A cpu,mathchip option generates code that doesn't work on + pre-sr10.3 nodes. See the cc(1) man page for more details. + -- Steve Vinoski + +EOF + +# Running h2ph, on the other hand, presents a challenge. + +#The perl header files have to be generated with following commands + +#sed 's|/usr/include|/sys5/usr/include|g' h2ph >h2ph.new && chmod +x h2ph.new +#(set cdir=`pwd`; cd /sys5/usr/include; $cdir/h2ph.new sys/* ) +#(set cdir=`pwd`; cd /usr/include; $cdir/h2ph * sys/* machine/*) + +#The SYS5 headers (only sys) are overlayed by the BSD headers. It seems +#all ok, but once I am going into details, a lot of limitations from +#'h2ph' are coming up. Lines like "#define NODEV (dev_t)(-1)" result in +#syntax errors as converted by h2ph. + +# Generally, h2ph might need a lot of help. diff --git a/hints/atheos.sh b/hints/atheos.sh new file mode 100644 index 0000000000..c3acdbb910 --- /dev/null +++ b/hints/atheos.sh @@ -0,0 +1,35 @@ +# AtheOS hints file ( http://www.atheos.cx/ ) +# Kurt Skauen, kurt@atheos.cx + +prefix="/usr/perl5" + +libpth='/system/libs /usr/lib' +usrinc='/include' + +libs=' ' + +d_htonl='define' +d_htons='define' +d_ntohl='define' +d_ntohs='define' + +d_locconv='undef' + +# POSIX and BSD functions are scattered over several non-standard libraries +# in AtheOS, so I figured it would be safer to let the linker figure out +# which symbols are available. + +usenm='false' + +# Hopefully, the native malloc knows better than perl's. +usemymalloc='n' + +# AtheOS native FS does not support hard-links, but link() is defined +# (for other FS's). + +d_link='undef' +dont_use_nlink='define' + +ld='gcc' +cc='gcc' + diff --git a/hints/aux_3.sh b/hints/aux_3.sh new file mode 100644 index 0000000000..aa3150afbe --- /dev/null +++ b/hints/aux_3.sh @@ -0,0 +1,22 @@ +# hints/aux_3.sh +# +# Improved by Jake Hamby to support both Apple CC +# and GNU CC. Tested on A/UX 3.1.1 with GCC 2.6.3. +# Now notifies of problem with version of dbm shipped with A/UX +# Last modified +# Sun Jan 5 11:16:41 WET 1997 + +case "$cc" in +*gcc*) optimize='-O2' + ccflags="$ccflags -D_POSIX_SOURCE" + echo "Setting hints for GNU CC." + ;; +*) optimize='-O' + ccflags="$ccflags -B/usr/lib/big/ -DPARAM_NEEDS_TYPES -D_POSIX_SOURCE" + POSIX_cflags='ccflags="$ccflags -ZP -Du_long=U32"' + echo "Setting hints for Apple's CC. If you plan to use" + echo "GNU CC, please rerun this Configure script as:" + echo "./Configure -Dcc=gcc" + ;; +esac +test -r ./broken-db.msg && . ./broken-db.msg diff --git a/hints/beos.sh b/hints/beos.sh new file mode 100644 index 0000000000..49d85716ab --- /dev/null +++ b/hints/beos.sh @@ -0,0 +1,62 @@ +# BeOS hints file +# $Id: beos.sh 821 2002-10-22 11:14:00Z richardc $ + +if [ ! -f beos/nm ]; then mwcc -w all -o beos/nm beos/nm.c 2>/dev/null; fi +# If this fails, that's all right - it's only for PPC. + +prefix="/boot/home/config" + +#cpp="mwcc -e" + +libpth='/boot/beos/system/lib /boot/home/config/lib' +usrinc='/boot/develop/headers/posix' +locinc='/boot/develop/headers/ /boot/home/config/include' + +libc='/boot/beos/system/lib/libroot.so' +libs=' ' + +d_bcmp='define' +d_bcopy='define' +d_bzero='define' +d_index='define' +#d_htonl='define' # It exists, but much hackery would be required to support. +# a bunch of extra includes would have to be added, and it's only used at +# one place in the non-socket perl code. + +#these are all in libdll.a, which my version of nm doesn't know how to parse. +#if I can get it to both do that, and scan multiple library files, perhaps +#these can be gotten rid of. + +usemymalloc='n' +# Hopefully, Be's malloc knows better than perl's. + +d_link='undef' +dont_use_nlink='define' +# no posix (aka hard) links for us! + +d_syserrlst='undef' +# the array syserrlst[] is useless for the most part. +# large negative numbers really kind of suck in arrays. + +# Sockets didn't use to be real sockets but BONE changes this. +# How does one test for BONEness? +if [ ! -f /some/bone/file.h ]; then + d_socket='undef' + d_gethbyaddr='undef' + d_gethbyname='undef' + d_getsbyname='undef' +fi + +ld='gcc' + +export PATH="$PATH:$PWD/beos" + +case "$ldlibpthname" in +'') ldlibpthname=LIBRARY_PATH ;; +esac + +# the waitpid() wrapper +archobjs="beos.o" +test -f beos.c || cp beos/beos.c . + + diff --git a/hints/broken-db.msg b/hints/broken-db.msg new file mode 100644 index 0000000000..92ba0776bf --- /dev/null +++ b/hints/broken-db.msg @@ -0,0 +1,14 @@ +# Several OSs come with an old version of the DB library which fails +# on a few of the db-recno.t tests. This file is sourced by the hints +# files for those OSs. + +cat <&4 + +Unless you've upgraded your DB library manually you will see failures in +db-recno tests 51, 53 and 55. The behavior these tests are checking is +broken in the DB library which is included with the OS. You can ignore +the errors if you're never going to use the broken functionality (recno +databases with a modified bval), otherwise you'll have to upgrade your +DB library or OS. + +EOF diff --git a/hints/bsdos.sh b/hints/bsdos.sh new file mode 100644 index 0000000000..f16a56efc7 --- /dev/null +++ b/hints/bsdos.sh @@ -0,0 +1,130 @@ +# hints/bsdos.sh +# +# hints file for BSD/OS (adapted from bsd386.sh) +# Original by Neil Bowers ; Tue Oct 4 12:01:34 EDT 1994 +# Updated by Tony Sanders ; Sat Aug 23 12:47:45 MDT 1997 +# Added 3.1 with ELF dynamic libraries (NOT in 3.1 yet. +# Estimated for 4.0) SYSV IPC tested Ok so I re-enabled. +# +# Updated to work in post-4.0 by Todd C. Miller +# +# Updated for threads by "Timur I. Bakeyev" +# +# To override the compiler on the command line: +# ./Configure -Dcc=gcc2 +# +# The BSD/OS distribution is built with: +# ./Configure -des -Dbsdos_distribution=defined + +signal_t='void' +d_voidsig='define' + +usemymalloc='n' + +# setre?[ug]id() have been replaced by the _POSIX_SAVED_IDS versions. +# See http://www.bsdi.com/bsdi-man?setuid(2) +d_setregid='undef' +d_setreuid='undef' +d_setrgid='undef' +d_setruid='undef' + +# we don't want to use -lnm, since exp() is busted (in 1.1 anyway) +set `echo X "$libswanted "| sed -e 's/ nm / /'` +shift +libswanted="$*" + +# X libraries are in their own tree +glibpth="$glibpth /usr/X11/lib" +ldflags="$ldflags -L/usr/X11/lib" + +case "$optimize" in +'') optimize='-O2' ;; +esac + +case "$bsdos_distribution" in +''|undef|false) ;; +*) + d_dosuid='define' + d_portable='undef' + prefix='/usr/contrib' + perlpath='/usr/bin/perl5' + startperl='#!/usr/bin/perl5' + scriptdir='/usr/contrib/bin' + privlib='/usr/libdata/perl5' + man1dir='/usr/contrib/man/man1' + man3dir='/usr/contrib/man/man3' + # phlib added by BSDI -- we share the *.ph include dir with perl4 + phlib="/usr/libdata/perl5/site_perl/$(arch)-$osname/include" + phlibexp="/usr/libdata/perl5/site_perl/$(arch)-$osname/include" + ;; +esac + +case "$osvers" in +1.0*) + # Avoid problems with HUGE_VAL in POSIX in 1.0's cc. + POSIX_cflags='ccflags="$ccflags -UHUGE_VAL"' + ;; +1.1*) + # Use gcc2 + case "$cc" in + '') cc='gcc2' ;; + esac + ;; +2.0*|2.1*|3.0*|3.1*) + so='o' + + # default to GCC 2.X w/shared libraries + case "$cc" in + '') cc='shlicc2' + cccdlflags=' ' ;; # Avoid the dreaded -fpic + esac + + # default ld to shared library linker + case "$ld" in + '') ld='shlicc2' + lddlflags='-r' ;; # this one is necessary + esac + + # Must preload the static shared libraries. + libswanted="Xpm Xaw Xmu Xt SM ICE Xext X11 $libswanted" + libswanted="rpc curses termcap $libswanted" + ;; +4.*) + # ELF dynamic link libraries starting in 4.0 + useshrplib='true' + so='so' + dlext='so' + + case "$cc" in + '') cc='cc' # cc is gcc2 in 4.0 + cccdlflags="-fPIC" + ;; + esac + + case "$ld" in + '') ld='ld' + lddlflags="-shared -x $lddlflags" ;; + esac + # Due usage of static pointer from crt.o + libswanted="util $libswanted" ;; +esac + +# This script UU/usethreads.cbu will get 'called-back' by Configure +# after it has prompted the user for whether to use threads. +cat > UU/usethreads.cbu <<'EOCBU' +case "$usethreads" in +$define|true|[yY]*) + case "$osvers" in + 3.*|4.*) ccflags="-D_REENTRANT $ccflags" + ;; + *) cat <&4 +I did not know that BSD/OS $osvers supports POSIX threads. + +Feel free to tell perlbug@perl.org otherwise. +EOM + exit 1 + ;; + esac + ;; +esac +EOCBU diff --git a/hints/convexos.sh b/hints/convexos.sh new file mode 100644 index 0000000000..9f6d702b06 --- /dev/null +++ b/hints/convexos.sh @@ -0,0 +1,12 @@ +# convexos.sh +# Thanks to David Starks-Browning +# Date: Tue, 17 Jan 1995 10:45:03 -0500 (EST) +# Subject: Re: Hints for ConvexOS 10.2 +# +# uname -a output looks like +# ConvexOS xxxx C38xx 10.2 convex +# Configure may incorrectly assign $3 to $osvers. +# +set X $myuname +shift +osvers=$4 diff --git a/hints/cxux.sh b/hints/cxux.sh new file mode 100644 index 0000000000..e3ac086e23 --- /dev/null +++ b/hints/cxux.sh @@ -0,0 +1,106 @@ +#! /local/gnu/bin/bash +# Hints for the CX/UX 7.1 operating system running on Concurrent (formerly +# Harris) NightHawk machines. written by Tom.Horsley@mail.ccur.com +# +# This config is setup for dynamic linking and the Concurrent C compiler. + +# Check some things and print warnings if this isn't going to work... +# +case ${SDE_TARGET:-ELF} in + [Cc][Oo][Ff][Ff]|[Oo][Cc][Ss]) echo '' + echo '' >&2 + echo WARNING: Do not build perl 5 with the SDE_TARGET set to >&2 + echo generate coff object - perl 5 must be built in the ELF >&2 + echo environment. >&2 + echo '' >&2 + echo '';; + [Ee][Ll][Ff]) : ;; + *) echo '' >&2 + echo 'Unknown SDE_TARGET value: '$SDE_TARGET >&2 + echo '' >&2 ;; +esac + +case `uname -r` in + [789]*) : ;; + *) echo '' + echo '' >&2 + echo WARNING: Perl 5 requires shared library support, it cannot >&2 + echo be built on releases of CX/UX prior to 7.0 with this hints >&2 + echo file. You\'ll have to do a separate port for the statically >&2 + echo linked COFF environment. >&2 + echo '' >&2 + echo '';; +esac + +# Internally at Concurrent, we use a source management tool which winds up +# giving us read-only copies of source trees that are mostly symbolic links. +# That upsets the perl build process when it tries to edit opcode.h and +# embed.h or touch perly.c or perly.h, so turn those files into "real" files +# when Configure runs. (If you already have "real" source files, this won't +# do anything). +# +if [ -x /usr/local/mkreal ] +then + for i in '.' '..' + do + for j in embed.h opcode.h perly.h perly.c + do + if [ -h $i/$j ] + then + ( cd $i ; /usr/local/mkreal $j ; chmod 666 $j ) + fi + done + done +fi + +# We DO NOT want -lmalloc +# +libswanted=`echo ' '$libswanted' ' | sed -e 's/ malloc / /'` + +# Stick the low-level elf library path in first. +# +glibpth="/usr/sde/elf/usr/lib $glibpth" + +# Need to use Concurrent cc for most of these options to be meaningful (if +# you want to get this to work with gcc, you're on your own :-). Passing +# -Bexport to the linker when linking perl is important because it leaves +# the interpreter internal symbols visible to the shared libs that will be +# loaded on demand (and will try to reference those symbols). The -u option +# to drag 'sigaction' into the perl main program is to make sure it gets +# defined for the posix shared library (for some reason sigaction is static, +# rather than being defined in libc.so.1). The 88110compat option makes sure +# the code will run on both 88100 and 88110 machines. The define is added to +# trigger a work around for a compiler bug which shows up in pp.c. +# +cc='/bin/cc -Xa -Qtarget=M88110compat -DCXUX_BROKEN_CONSTANT_CONVERT' +cccdlflags='-Zelf -Zpic' +ccdlflags='-Zelf -Zlink=dynamic -Wl,-Bexport -u sigaction' +lddlflags='-Zlink=so' + +# Configure imagines that it sees a pw_quota field, but it is really in a +# different structure than the one it thinks it is looking at. +d_pwquota='undef' + +# Configure sometimes finds what it believes to be ndbm header files on the +# system and imagines that we have the NDBM library, but we really don't. +# There is something there that once resembled ndbm, but it is purely +# for internal use in some tool and has been hacked beyond recognition +# (or even function :-) +# +i_ndbm='undef' + +# Don't use the perl malloc +# +d_mymalloc='undef' +usemymalloc='n' + +cat <<'EOM' >&4 + +WARNING: If you are using ksh to run the Configure script, you may find it +failing in mysterious ways (such as failing to find library routines which +are known to exist). Configure seems to push ksh beyond its limits +sometimes. Try using env to strip unnecessary things out of the environment +and run Configure with /sbin/sh. That sometimes seems to produce more +accurate results. + +EOM diff --git a/hints/cygwin.sh b/hints/cygwin.sh new file mode 100644 index 0000000000..e88cab7930 --- /dev/null +++ b/hints/cygwin.sh @@ -0,0 +1,42 @@ +#! /bin/sh +# cygwin.sh - hints for building perl using the Cygwin environment for Win32 +# + +# not otherwise settable +exe_ext='.exe' +firstmakefile='GNUmakefile' +case "$ldlibpthname" in +'') ldlibpthname=PATH ;; +esac +archobjs='cygwin.o' + +# mandatory (overrides incorrect defaults) +test -z "$cc" && cc='gcc' +if test -z "$plibpth" +then + plibpth=`gcc -print-file-name=libc.a` + plibpth=`dirname $plibpth` + plibpth=`cd $plibpth && pwd` +fi +so='dll' +# - eliminate -lc, implied by gcc and a symlink to libcygwin.a +libswanted=`echo " $libswanted " | sed -e 's/ c / /g'` +# - eliminate -lm, symlink to libcygwin.a +libswanted=`echo " $libswanted " | sed -e 's/ m / /g'` +test -z "$optimize" && optimize='-O2' +ccflags="$ccflags -DPERL_USE_SAFE_PUTENV" +# - otherwise i686-cygwin +archname='cygwin' + +# dynamic loading +# - otherwise -fpic +cccdlflags=' ' +ld='ld2' + +# Win9x problem with non-blocking read from a closed pipe +d_eofnblk='define' + +# strip exe's and dll's +#ldflags="$ldflags -s" +#ccdlflags="$ccdlflags -s" +#lddlflags="$lddlflags -s" diff --git a/hints/darwin.sh b/hints/darwin.sh new file mode 100644 index 0000000000..518af30026 --- /dev/null +++ b/hints/darwin.sh @@ -0,0 +1,148 @@ +## +# Darwin (Mac OS) hints +# Wilfredo Sanchez +## + +## +# Paths +## + +# BSD paths +case "$prefix" in +'') + # Default install; use non-system directories + prefix='/usr/local'; # Built-in perl uses /usr + siteprefix='/usr/local'; + vendorprefix='/usr/local'; usevendorprefix='define'; + + # Where to put modules. + privlib='/Library/Perl'; # Built-in perl uses /System/Library/Perl + sitelib='/Library/Perl'; + vendorlib='/Network/Library/Perl'; + ;; +'/usr') + # We are building/replacing the built-in perl + siteprefix='/usr/local'; + vendorprefix='/usr/local'; usevendorprefix='define'; + + # Where to put modules. + privlib='/System/Library/Perl'; + sitelib='/Library/Perl'; + vendorlib='/Network/Library/Perl'; + ;; +esac + +# 4BSD uses ${prefix}/share/man, not ${prefix}/man. +man1dir="${prefix}/share/man/man1"; +man3dir="${prefix}/share/man/man3"; + +## +# Tool chain settings +## + +# Since we can build fat, the archname doesn't need the processor type +archname='darwin'; + +# nm works. +usenm='true'; + +# Optimize. +if [ "x$optimize" = 'x' ]; then + optimize='-O3' +fi + +# -pipe: makes compilation go faster. +# -fno-common: we don't like commons. Common symbols are not allowed +# in MH_DYLIB binaries, which is what libperl.dylib is. You will fail +# to link without that option, unless you otherwise eliminate all commons +# by, for example, initializing all globals. +# --Fred Sánchez +ccflags="${ccflags} -pipe -fno-common" + +# At least on Darwin 1.3.x: +# +# # define INT32_MIN -2147483648 +# int main () { +# double a = INT32_MIN; +# printf ("INT32_MIN=%g\n", a); +# return 0; +# } +# will output: +# INT32_MIN=2.14748e+09 +# Note that the INT32_MIN has become positive. +# INT32_MIN is set in /usr/include/stdint.h by: +# #define INT32_MIN -2147483648 +# which seems to break the gcc. Defining INT32_MIN as (-2147483647-1) +# seems to work. INT64_MIN seems to be similarly broken. +# -- Nicholas Clark, Ken Williams, and Edward Moy +# +ccflags="${ccflags} -DINT32_MIN_BROKEN -DINT64_MIN_BROKEN" + +# cppflags='-traditional-cpp'; +# avoid Apple's cpp precompiler, better for extensions +cppflags="${cppflags} -no-cpp-precomp" +# and ccflags needs them aswell since we don't use cpp directly +ccflags="${ccflags} -no-cpp-precomp" + +# Known optimizer problems. +case "`cc -v 2>&1`" in +*"3.1 20020105"*) toke_cflags='optimize=""' ;; +esac + +# Shared library extension is .dylib. +# Bundle extension is .bundle. +ld='cc'; +so='dylib'; +dlext='bundle'; +dlsrc='dl_dyld.xs'; usedl='define'; +cccdlflags=' '; # space, not empty, because otherwise we get -fpic +# ldflag: -flat_namespace is only available since OS X 10.1 (Darwin 1.4.1) +# - but not in 10.0.x (Darwin 1.3.x) +# -- Kay Roepke +case "$osvers" in +1.[0-3].*) ;; +*) ldflags="${ldflags} -flat_namespace" ;; +esac +lddlflags="${ldflags} -bundle -undefined suppress"; +ldlibpthname='DYLD_LIBRARY_PATH'; +useshrplib='true'; + +## +# System libraries +## + +# vfork works +usevfork='true'; + +# malloc works +usemymalloc='n'; + +## +# Build process +## + +# Locales aren't feeling well. +LC_ALL=C; export LC_ALL; +LANG=C; export LANG; + +# Case-insensitive filesystems don't get along with Makefile and +# makefile in the same place. Since Darwin uses GNU make, this dodges +# the problem. +firstmakefile=GNUmakefile; + +# +# The libraries are not threadsafe as of OS X 10.1. +# +# Fix when Apple fixes libc. +# +case "$usethreads$useithreads$use5005threads" in +*define*) +cat <&4 + +*** Warning, there might be problems with your libraries with +*** regards to threading. The test ext/threads/t/libc.t is likely +*** to fail. + +EOM + ;; +esac diff --git a/hints/dcosx.sh b/hints/dcosx.sh new file mode 100644 index 0000000000..c1b0d0ac42 --- /dev/null +++ b/hints/dcosx.sh @@ -0,0 +1,188 @@ +# hints/dcosx.sh +# Last modified: Thu Jan 16 11:38:12 EST 1996 +# Stephen Zander +# hints for DC/OSx (Pyramid) & SINIX (Seimens: dc/osx rebadged) +# Based on the hints/solaris_2.sh file + +# See man vfork. +usevfork=false + +d_suidsafe=define + +# Avoid all libraries in /usr/ucblib. +set `echo $glibpth | sed -e 's@/usr/ucblib@@'` +glibpth="$*" + +# Remove bad libraries. +# -lucb contains incompatible routines. +set `echo " $libswanted " | sed -e 's@ ucb @ @'` +libswanted="$*" + +# Here's another draft of the perl5/solaris/gcc sanity-checker. + +case $PATH in +*/usr/ucb*:/usr/bin:*|*/usr/ucb*:/usr/bin) cat <&2 + +NOTE: /usr/ucb/cc does not function properly. +Remove /usr/ucb from your PATH. + +END +;; +esac + + +# Check that /dev/fd is mounted. If it is not mounted, let the +# user know that suid scripts may not work. +/usr/bin/df /dev/fd 2>&1 > /dev/null +case $? in +0) ;; +*) + cat <&4 + +NOTE: Your system does not have /dev/fd mounted. If you want to +be able to use set-uid scripts you must ask your system administrator +to mount /dev/fd. + +END + ;; +esac + + +# See if libucb can be found in /usr/lib. If it is, warn the user +# that this may cause problems while building Perl extensions. +/usr/bin/ls /usr/lib/libucb* >/dev/null 2>&1 +case $? in +0) + cat <&4 + +NOTE: libucb has been found in /usr/lib. libucb should reside in +/usr/ucblib. You may have trouble while building Perl extensions. + +END +;; +esac + + +# See if make(1) is GNU make(1). +# If it is, make sure the setgid bit is not set. +make -v > make.vers 2>&1 +if grep GNU make.vers > /dev/null 2>&1; then + tmp=`/usr/bin/ksh -c "whence make"` + case "`/usr/bin/ls -l $tmp`" in + ??????s*) + cat <&2 + +NOTE: Your PATH points to GNU make, and your GNU make has the set-group-id +bit set. You must either rearrange your PATH to put /usr/ccs/bin before the +GNU utilities or you must ask your system administrator to disable the +set-group-id bit on GNU make. + +END + ;; + esac +fi +rm -f make.vers + +# If the C compiler is gcc: +# - check the fixed-includes +# - check as(1) and ld(1), they should not be GNU +# If the C compiler is not gcc: +# - check as(1) and ld(1), they should not be GNU +# - increase the optimizing level to prevent object size warnings +# +# Watch out in case they have not set $cc. +case "`${cc:-cc} -v 2>&1`" in +*gcc*) + # + # Using gcc. + # + #echo Using gcc + + # Get gcc to share its secrets. + echo 'main() { return 0; }' > try.c + verbose=`${cc:-cc} -v -o try try.c 2>&1` + rm -f try try.c + tmp=`echo "$verbose" | grep '^Reading' | + awk '{print $NF}' | sed 's/specs$/include/'` + + # Determine if the fixed-includes look like they'll work. + # Doesn't work anymore for gcc-2.7.2. + + # See if as(1) is GNU as(1). GNU as(1) won't work for this job. + case $verbose in + */usr/ccs/bin/as*) ;; + *) + cat <&2 + +NOTE: You are using GNU as(1). GNU as(1) will not build Perl. +You must arrange to use /usr/ccs/bin/as, perhaps by setting +GCC_EXEC_PREFIX or by including -B/usr/ccs/bin in your cc command. + +END + ;; + esac + + # See if ld(1) is GNU ld(1). GNU ld(1) won't work for this job. + case $verbose in + */usr/ccs/bin/ld*) ;; + *) + cat <&2 + +NOTE: You are using GNU ld(1). GNU ld(1) will not build Perl. +You must arrange to use /usr/ccs/bin/ld, perhaps by setting +GCC_EXEC_PREFIX or by including -B/usr/ccs/bin in your cc command. + +END + ;; + esac + + ;; #using gcc +*) + optimize='-O -K Olimit:3064' + # + # Not using gcc. + # + #echo Not using gcc + + # See if as(1) is GNU as(1). GNU as(1) won't work for this job. + case `as --version < /dev/null 2>&1` in + *GNU*) + cat <&2 + +NOTE: You are using GNU as(1). GNU as(1) will not build Perl. +You must arrange to use /usr/ccs/bin, perhaps by adding it to the +beginning of your PATH. + +END + ;; + esac + + # See if ld(1) is GNU ld(1). GNU ld(1) won't work for this job. + case `ld --version < /dev/null 2>&1` in + *GNU*) + cat <&2 + +NOTE: You are using GNU ld(1). GNU ld(1) will not build Perl. +You must arrange to use /usr/ccs/bin, perhaps by adding it to the +beginning of your PATH + +END + ;; + esac + + ;; #not using gcc +esac + +# as --version or ld --version might dump core. +rm -f core + +# DC/OSx hides certain functions in a libc that looks dynamic but isn't +# because of this we reinclude -lc when building dynamic extenstions +libc='/usr/ccs/lib/libc.so' +lddlflags='-G -lc' + +# DC/OSx gets overenthusiastic with symbol removal when building dynamically +ccdlflags='-Blargedynsym' + +# System malloc is safer when using third part libs +usemymalloc='n' diff --git a/hints/dec_osf.sh b/hints/dec_osf.sh new file mode 100644 index 0000000000..b3872fac12 --- /dev/null +++ b/hints/dec_osf.sh @@ -0,0 +1,523 @@ +# hints/dec_osf.sh + +# * If you want to debug perl or want to send a +# stack trace for inclusion into an bug report, call +# Configure with the additional argument -Doptimize=-g2 +# or uncomment this assignment to "optimize": +# +#optimize=-g2 +# +# If you want both to optimise and debug with the DEC cc +# you must have -g3, e.g. "-O4 -g3", and (re)run Configure. +# +# * gcc can always have both -g and optimisation on. +# +# * debugging optimised code, no matter what compiler +# one is using, can be surprising and confusing because of +# the optimisation tricks like code motion, code removal, +# loop unrolling, and inlining. The source code and the +# executable code simply do not agree any more while in +# mid-execution, the optimiser only cares about the results. +# +# * Configure will automatically add the often quoted +# -DDEBUGGING for you if the -g is specified. +# +# * There is even more optimisation available in the new +# (GEM) DEC cc: -O5 and -fast. "man cc" will tell more about them. +# The jury is still out whether either or neither help for Perl +# and how much. Based on very quick testing, -fast boosts +# raw data copy by about 5-15% (-fast brings in, among other +# things, inlined, ahem, fast memcpy()), while on the other +# hand searching things (index, m//, s///), seems to get slower. +# Your mileage will vary. +# +# * The -std is needed because the following compiled +# without the -std and linked with -lm +# +# #include +# #include +# int main(){short x=10,y=sqrt(x);printf("%d\n",y);} +# +# will in Digital UNIX 3.* and 4.0b print 0 -- and in Digital +# UNIX 4.0{,a} dump core: Floating point exception in the printf(), +# the y has become a signaling NaN. +# +# * Compilation warnings like: +# +# "Undefined the ANSI standard macro ..." +# +# can be ignored, at least while compiling the POSIX extension +# and especially if using the sfio (the latter is not a standard +# part of Perl, never mind if it says little to you). +# + +# If using the DEC compiler we must find out the DEC compiler style: +# the style changed between Digital UNIX (aka DEC OSF/1) 3 and +# Digital UNIX 4. The old compiler was originally from Ultrix and +# the MIPS company, the new compiler is originally from the VAX world +# and it is called GEM. Many of the options we are going to use depend +# on the compiler style. + +cc=${cc:-cc} + +case "`$cc -v 2>&1 | grep cc`" in +*gcc*) isgcc=gcc ;; +esac + +# do NOT, I repeat, *NOT* take away the leading tabs +# Configure Black Magic (TM) + # reset + _DEC_cc_style= +case "$isgcc" in +gcc) if [ "X$gccversion" = "X" ]; then + # Done too late in Configure if hinted + gccversion=`$cc --version | sed 's/.*(GCC) *//'` + fi + set $gccversion + if test "$1" -lt 2 -o \( "$1" -eq 2 -a \( "$2" -lt 95 -o \( "$2" -eq 95 -a "$3" -lt 3 \) \) \); then + cat >&4 <&4 <&1`" in + */gemc_cc*) # we have the new DEC GEM CC + _DEC_cc_style=new + ;; + *) # we have the old MIPS CC + _DEC_cc_style=old + ;; + esac + # cleanup + rm -f taint$$.o + ;; +esac + +# be nauseatingly ANSI +case "$isgcc" in +gcc) ccflags="$ccflags -ansi" + ;; +*) ccflags="$ccflags -std" + ;; +esac + +# for gcc the Configure knows about the -fpic: +# position-independent code for dynamic loading + +# we want optimisation + +case "$optimize" in +'') case "$isgcc" in + gcc) optimize='-O3' ;; + *) case "$_DEC_cc_style" in + new) optimize='-O4' ;; + old) optimize='-O2 -Olimit 3200' ;; + esac + ccflags="$ccflags -D_INTRINSICS" + ;; + esac + ;; +esac + +# we want dynamic fp rounding mode, and we want ieee exception semantics +case "$isgcc" in +gcc) ;; +*) case "$_DEC_cc_style" in + new) ccflags="$ccflags -fprm d -ieee" ;; + esac + ;; +esac + +# Make glibpth agree with the compiler suite. Note that /shlib +# is not here. That's on purpose. Even though that's where libc +# really lives from V4.0 on, the linker (and /sbin/loader) won't +# look there by default. The sharable /sbin utilities were all +# built with "-Wl,-rpath,/shlib" to get around that. This makes +# no attempt to figure out the additional location(s) searched by +# gcc, since not all versions of gcc are easily coerced into +# revealing that information. +glibpth="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc" +glibpth="$glibpth /usr/lib /usr/local/lib /var/shlib" + +# dlopen() is in libc +libswanted="`echo $libswanted | sed -e 's/ dl / /'`" + +# libPW contains nothing useful for perl +libswanted="`echo $libswanted | sed -e 's/ PW / /'`" + +# libnet contains nothing useful for perl here, and doesn't work +libswanted="`echo $libswanted | sed -e 's/ net / /'`" + +# libbsd contains nothing used by perl that is not already in libc +libswanted="`echo $libswanted | sed -e 's/ bsd / /'`" + +# libc need not be separately listed +libswanted="`echo $libswanted | sed -e 's/ c / /'`" + +# ndbm is already in libc +libswanted="`echo $libswanted | sed -e 's/ ndbm / /'`" + +# the basic lddlflags used always +lddlflags='-shared -expect_unresolved "*"' + +# Fancy compiler suites use optimising linker as well as compiler. +# +case "`uname -r`" in +*[123].*) # old loader + lddlflags="$lddlflags -O3" + ;; +*) if $test "X$optimize" = "X$undef"; then + lddlflags="$lddlflags -msym" + else + case "`/usr/sbin/sizer -v`" in + *4.0D*) + # QAR 56761: -O4 + .so may produce broken code, + # fixed in 4.0E or better. + ;; + *) + lddlflags="$lddlflags $optimize" + ;; + esac + # -msym: If using a sufficiently recent /sbin/loader, + # keep the module symbols with the modules. + lddlflags="$lddlflags -msym -std" + fi + ;; +esac +# Yes, the above loses if gcc does not use the system linker. +# If that happens, let me know about it. + + +# If debugging or (old systems and doing shared) +# then do not strip the lib, otherwise, strip. +# As noted above the -DDEBUGGING is added automagically by Configure if -g. +case "$optimize" in + *-g*) ;; # left intentionally blank +*) case "`uname -r`" in + *[123].*) + case "$useshrplib" in + false|undef|'') lddlflags="$lddlflags -s" ;; + esac + ;; + *) lddlflags="$lddlflags -s" + ;; + esac + ;; +esac + +# +# Make embedding in things like INN and Apache more memory friendly. +# Keep it overridable on the Configure command line, though, so that +# "-Uuseshrplib" prevents this default. +# + +case "$_DEC_cc_style.$useshrplib" in + new.) useshrplib="$define" ;; +esac + +# The EFF_ONLY_OK from is present but dysfunctional for +# [RWX]_OK as of Digital UNIX 4.0[A-D]?. If and when this gets fixed, +# please adjust this appropriately. See also pp_sys.c just before the +# emulate_eaccess(). + +# Fixed in V5.0A. +case "`/usr/sbin/sizer -v`" in +*5.0[A-Z]*|*5.[1-9]*|*[6-9].[0-9]*) + : ok + ;; +*) +# V5.0 or previous +pp_sys_cflags='ccflags="$ccflags -DNO_EFF_ONLY_OK"' + ;; +esac + +# The off_t is already 8 bytes, so we do have largefileness. + +cat > UU/usethreads.cbu <<'EOCBU' +# This script UU/usethreads.cbu will get 'called-back' by Configure +# after it has prompted the user for whether to use threads. +case "$usethreads" in +$define|true|[yY]*) + # Threads interfaces changed with V4.0. + case "$isgcc" in + gcc) ccflags="-D_REENTRANT $ccflags" ;; + *) case "`uname -r`" in + *[123].*) ccflags="-threads $ccflags" ;; + *) ccflags="-pthread $ccflags" ;; + esac + ;; + esac + case "`uname -r`" in + *[123].*) libswanted="$libswanted pthreads mach exc c_r" ;; + *) libswanted="$libswanted pthread exc" ;; + esac + + case "$usemymalloc" in + '') + usemymalloc='n' + ;; + esac + # These symbols are renamed in so + # that the Configure hasproto doesn't see them. + d_asctime_r_proto="$define" + d_ctime_r_proto="$define" + d_gmtime_r_proto="$define" + d_localtime_r_proto="$define" + ;; +esac +EOCBU + +cat > UU/uselongdouble.cbu <<'EOCBU' +# This script UU/uselongdouble.cbu will get 'called-back' by Configure +# after it has prompted the user for whether to use long doubles. +case "$uselongdouble" in +$define|true|[yY]*) + case "`/usr/sbin/sizer -v`" in + *[1-4].0*) cat >&4 <try.c <<\TRY +#include +int main(int argc, char **argv) +{ + unsigned long uvmax = ~0UL; + long double ld = uvmax + 0.0L; + char buf1[30], buf2[30]; + + (void) sprintf(buf1, "%lu", uvmax); + (void) sprintf(buf2, "%.0Lf", ld); + return strcmp(buf1, buf2) != 0; +} +TRY + # Don't bother trying to work with Configure's idea of + # cc and the various flags. This might not work as-is + # with gcc -- but we're testing libc, not the compiler. + if cc -o try -std try.c && ./try + then + : ok + else + cat <<\UGLY >&4 +! +Warning! Your libc has not yet been patched so that its "%Lf" format for +printing long doubles shows all the significant digits. You will get errors +in the t/op/numconvert test because of this. (The data is still good +internally, and the "%e" format of printf() or sprintf() in perl will still +produce valid results.) See README.tru64 for additional details. + +Continuing anyway. +! +UGLY + fi + $rm -f try try.c + esac + ;; +esac +EOCBU + +case "`/usr/sbin/sizer -v`" in +*[1-4].0*) d_modfl=undef ;; # must wait till 5.0 +esac + +# Keep those leading tabs. + needusrshlib='' + old_LD_LIBRARY_PATH=$LD_LIBRARY_PATH +for p in $loclibpth +do + if test -n "`ls $p/libdb.so* 2>/dev/null`"; then + needusrshlib=yes + fi + if test -d $p; then + echo "Appending $p to LD_LIBRARY_PATH." >& 4 + case "$LD_LIBRARY_PATH" in + '') LD_LIBRARY_PATH=$p ;; + *) LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$p ;; + esac + fi +done +case "$LD_LIBRARY_PATH" in +"$old_LD_LIBRARY_PATH") ;; +*) echo "LD_LIBRARY_PATH is now $LD_LIBRARY_PATH." >& 4 ;; +esac +# This is evil but I can't think of a nice workaround: +# the /usr/shlib/libdb.so needs to be seen first, +# or running Configure will fail. +if test -n "$needusrshlib"; then + echo "Prepending /usr/shlib to loclibpth." >& 4 + loclibpth="/usr/shlib $loclibpth" + echo "loclibpth is now $loclibpth." >& 4 +fi + +# +# Unset temporary variables no more needed. +# + +unset _DEC_cc_style + +# +# History: +# +# perl5.005_51: +# +# September-1998 Jarkko Hietaniemi +# +# * Added the -DNO_EFF_ONLY_OK flag ('use filetest;' support). +# +# perl5.004_57: +# +# 19-Dec-1997 Spider Boardman +# +# * Newer Digital UNIX compilers enforce signaling for NaN without +# -ieee. Added -fprm d at the same time since it's friendlier for +# embedding. +# +# * Fixed the library search path to match cc, ld, and /sbin/loader. +# +# * Default to building -Duseshrplib on newer systems. -Uuseshrplib +# still overrides. +# +# * Fix -pthread additions for useshrplib. ld has no -pthread option. +# +# +# perl5.004_04: +# +# 19-Sep-1997 Spider Boardman +# +# * libnet on Digital UNIX is for JAVA, not for sockets. +# +# +# perl5.003_28: +# +# 22-Feb-1997 Jarkko Hietaniemi +# +# * Restructuring Spider's suggestions. +# +# * Older Digital UNIXes cannot handle -Olimit ... for $lddlflags. +# +# * ld -s cannot be used in older Digital UNIXes when doing shared. +# +# +# 21-Feb-1997 Spider Boardman +# +# * -hidden removed. +# +# * -DSTANDARD_C removed. +# +# * -D_INTRINSICS added. (that -fast does not seem to buy much confirmed) +# +# * odbm not in libc, only ndbm. Therefore dbm back to $libswanted. +# +# * -msym for the newer runtime loaders. +# +# * $optimize also in $lddflags. +# +# +# perl5.003_27: +# +# 18-Feb-1997 Jarkko Hietaniemi +# +# * unset _DEC_cc_style and more commentary on -std. +# +# +# perl5.003_26: +# +# 15-Feb-1997 Jarkko Hietaniemi +# +# * -std and -ansi. +# +# +# perl5.003_24: +# +# 30-Jan-1997 Jarkko Hietaniemi +# +# * Fixing the note on -DDEBUGGING. +# +# * Note on -O5 -fast. +# +# +# perl5.003_23: +# +# 26-Jan-1997 Jarkko Hietaniemi +# +# * Notes on how to do both optimisation and debugging. +# +# +# 25-Jan-1997 Jarkko Hietaniemi +# +# * Remove unneeded libraries from $libswanted: PW, bsd, c, dbm +# +# * Restructure the $lddlflags build. +# +# * $optimize based on which compiler we have. +# +# +# perl5.003_22: +# +# 23-Jan-1997 Achim Bohnet +# +# * Added comments 'how to create a debugging version of perl' +# +# * Fixed logic of this script to prevent stripping of shared +# objects by the loader (see ld man page for -s) is debugging +# is set via the -g switch. +# +# +# 21-Jan-1997 Achim Bohnet +# +# * now 'dl' is always removed from libswanted. Not only if +# optimize is an empty string. +# +# +# 17-Jan-1997 Achim Bohnet +# +# * Removed 'dl' from libswanted: When the FreePort binary +# translator for Sun binaries is installed Configure concludes +# that it should use libdl.x.yz.fpx.so :-( +# Because the dlopen, dlclose,... calls are in the +# C library it not necessary at all to check for the +# dl library. Therefore dl is removed from libswanted. +# +# +# 1-Jan-1997 Achim Bohnet +# +# * Set -Olimit to 3200 because perl_yylex.c got too big +# for the optimizer. +# diff --git a/hints/dgux.sh b/hints/dgux.sh new file mode 100644 index 0000000000..6735edea7c --- /dev/null +++ b/hints/dgux.sh @@ -0,0 +1,239 @@ +# $Id: dgux.sh 821 2002-10-22 11:14:00Z richardc $ + +# This is a hints file for DGUX, which is EMC's Data General's Unix. It +# was originally developed with version 5.4.3.10 of the OS, and then was +# later updated running under version 4.11.2 (running on m88k hardware). +# The gross features should work with versions going back to 2.nil but +# some tweaking will probably be necessary. +# +# DGUX is an SVR4 derivative. It ships with gcc as the standard +# compiler. Since version 3.0 it has shipped with Perl 4.036 +# installed in /usr/bin, which is kind of neat. Be careful when you +# install that you don't overwrite the system version, though (by +# answering yes to the question about installing perl as /usr/bin/perl), +# as it would suck to try to get support if the vendor learned that you +# were physically replacing the system binaries. +# +# -Roderick Schertler + +# The standard system compiler is gcc, but invoking it as cc changes its +# behavior. I have to pick one name or the other so I can get the +# dynamic loading switches right (they vary depending on this). I'm +# picking gcc because there's no way to get at the optimization options +# and so on when you call it cc. + +########################################## +# Modified by Takis Psarogiannakopoulos +# Universirty of Cambridge +# Centre for Mathematical Sciences +# Department of Pure Mathematics +# Wilberforce road +# Cambridge CB3 0WB , UK +# e-mail +# Use GCC-2.95.2/3 rev (DG/UX) for threads +# This compiler supports the -pthread switch +# to link correctly DG/UX 's -lthread. +# March 2002 +########################################### + +cc=gcc +ccflags="-DDGUX -D_DGUX_SOURCE" +# Debug build. If using GNU as,ld use the flag -gstabs+ +# ccflags="-g -mstandard -DDGUX -D_DGUX_SOURCE -DDEBUGGING" +# Dummy ; always compile with -O2 on GCC 2.95.2/3 rev (DG/UX) +# even if you debugging the program! +optimize="-mno-legend -O2" + +archname="ix86-dgux" +libpth="/usr/lib" + +##################################### +# +# Change this if you want. +# prefix =/usr/local +##################################### + +prefix=/usr/local +perlpath="$prefix/bin/perl58" +startperl="#! $prefix/bin/perl58" +privlib="$prefix/lib/perl58" +man1dir="$prefix/man/man1" +man3dir="$prefix/man/man3" + +sitearch="$prefix/lib/perl58/$archname" +sitelib="$prefix/lib/perl58" + +#Do not overwrite by default /usr/bin/perl of DG/UX +installusrbinperl="$undef" + +# Configure may fail to find lstat() +# function in . +d_lstat='define' + +# Internal (perl) malloc is causing serious problems and +# test failures in DG/UX. Most notable Embed.t +# So for perl-5.7.3 and on do NOT use. +# I have no time to investigate more. +# + +case "$usemymalloc" in +'') usemymalloc='n' ;; +esac + +case "$uselongdouble" in +'') uselongdouble='y' ;; +esac + +#usevfork=true +usevfork=false + +# DG has this thing set up with symlinks which point to different places +# depending on environment variables (see elink(5)) and the compiler and +# related tools use them to access different development environments +# (COFF, ELF, m88k BCS and so on), see sde(5). The upshot, however, is +# that when a normal program tries to access one of these elinks it sees +# no such file (like stat()ting a mis-directed symlink). Setting +# $plibpth to explicitly include the place to which the elinks point +# allows Configure to find libraries which vary based on the development +# environment. +# +# Starting with version 4.10 (the first time the OS supported Intel +# hardware) all libraries are accessed with this mechanism. +# +# The default $TARGET_BINARY_INTERFACE changed with version 4.10. The +# system now comes with a link named /usr/sde/default which points to +# the proper entry, but older versions lacked this and used m88kdgux +# directly. + +: && sde_path=${SDE_PATH:-/usr}/sde # hide from Configure +while : # dummy loop +do + if [ -n "$TARGET_BINARY_INTERFACE" ] + then set X "$TARGET_BINARY_INTERFACE" + else set X default dg m88k_dg ix86_dg m88kdgux m88kdguxelf + fi + shift + default_sde=$1 + for sde + do + [ -d "$sde_path/$sde" ] && break 2 + done + cat <&2 + +NOTE: I can't figure out what SDE is used by default on this machine (I +didn't find a likely directory under $sde_path). This is bad news. If +this is a R4.10 or newer system I'm not going to be able to find any of +your libraries, if this system is R3.10 or older I won't be able to find +the math library. You should re-run Configure with the environment +variable TARGET_BINARY_INTERFACE set to the proper value for this +machine, see sde(5) and the notes in hints/dgux.sh. + +END + sde=$default_sde + break +done + +plibpth="$plibpth $sde_path/$sde/usr/lib" +unset sde_path default_sde sde + +##################################### +# +##################################### + +libperl="libperl58.so" + +# Many functions (eg, gethostent(), killpg(), getpriority(), setruid() +# dbm_*(), and plenty more) are defined in -ldgc. Usually you don't +# need to know this (it seems that libdgc.so is searched automatically +# by ld), but Configure needs to check it otherwise it will report all +# those functions as missing. + +##################################### +# +##################################### + +# libswanted="dgc gdbm $libswanted" +#libswanted="dbm posix $libswanted" +# Do *NOT* add there the malloc native +# DG/UX library! +libswanted="dbm posix resolv socket nsl dl m" + +##################################### +# +##################################### + +mydomain='.localhost' +cf_by=`(whoami) 2>/dev/null` +cf_email="$cf_by@localhost" + +# Dynamic loading works using the dlopen() functions. Note that dlfcn.h +# used to be broken, it declared _dl*() rather than dl*(). This was the +# case up to 3.10, it has been fixed in 4.11. I'm not sure if it was +# fixed in 4.10. If you have the older header just ignore the warnings +# (since pointers and integers have the same format on m88k). + +# usedl=true +usedl=false + +# For cc rather than gcc the flags would be `-K PIC' for compiling and +# -G for loading. I haven't tested this. + +##################################### +# +# Use -fPIC instead -fpic +##################################### + +cccdlflags=-fPIC +#We must use gcc +ld="gcc" +lddlflags="-shared" + +############################################################################ +# DGUX Posix 4A Draft 10 Thread support +# +# use Configure -Dusethreads to enable +############################################################################ + +cat > UU/usethreads.cbu <<'EOCBU' +case "$usethreads" in +$define|true|[yY]*) + ccflags="$ccflags" + # DG/UX has this for sure! Main Configure fails to + # detect it but it is needed! + d_pthread_atfork='define' + shift + # DG/UX's sched_yield is in -lrte + # Do *NOT* add there the malloc native + # DG/UX library! + libswanted="dbm posix resolv socket nsl dl m rte" + archname="ix86-dgux-thread" + sitearch="$prefix/lib/perl58/$archname" + sitelib="$prefix/lib/perl58" + case "$cc" in + *gcc*) + #### Use GCC -2.95.2/3 rev (DG/UX) and -pthread + #### Otherwise take out the switch -pthread + #### And add manually the -D_POSIX4A_DRAFT10_SOURCE flag. + ld="gcc" + ccflags="$ccflags -D_POSIX4A_DRAFT10_SOURCE" + # Debug build : use -DS flag on command line perl + # ccflags="$ccflags -g -mstandard -DDEBUGGING -D_POSIX4A_DRAFT10_SOURCE -pthread" + cccdlflags='-fPIC' + lddlflags="-shared" + #### Use GCC -2.95.2/3 rev (DG/UX) and -pthread + #### Otherwise take out the switch -pthread + #### And add manually the -lthread library. + ldflags="$ldflags -pthread" + ;; + + *) + echo "Not supported DG/UX cc and threads !" + ;; + esac +esac +EOCBU + +# "./Configure -d" can't figure this out easily +d_suidsafe='define' + +################################################### diff --git a/hints/dos_djgpp.sh b/hints/dos_djgpp.sh new file mode 100644 index 0000000000..3ae9d22ae1 --- /dev/null +++ b/hints/dos_djgpp.sh @@ -0,0 +1,76 @@ +# hints file for dos/djgpp v2.xx +# Original by Laszlo Molnar + +# 971015 - archname changed from 'djgpp' to 'dos-djgpp' +# 971210 - threads support +# 000222 - added -DPERL_EXTERNAL_GLOB to ccflags + +archname='dos-djgpp' +archobjs='djgpp.o' +path_sep=\; +startsh="#! /bin/sh" + +cc='gcc' +ld='gcc' +usrinc="$DJDIR/include" + +libpth="$DJDIR/lib" +libc="$libpth/libc.a" + +so='none' +usedl='n' + +firstmakefile='GNUmakefile' +exe_ext='.exe' + +randbits=31 +lns='cp' + +usenm='true' + +# this reportedly causes compile errors in system includes +i_ieeefp='undef' + +d_link='undef' # these are empty functions in libc.a +d_symlink='undef' +d_fork='undef' +d_pipe='undef' + +startperl='#!perl' + +case "X$optimize" in + X) + optimize="-O2 -malign-loops=2 -malign-jumps=2 -malign-functions=2" + ldflags='-s' + ;; + X*) + ldflags=' ' + ;; +esac +ccflags="$ccflags -DPERL_EXTERNAL_GLOB" +usemymalloc='n' +timetype='time_t' + +prefix=$DJDIR +privlib=$prefix/lib/perl5 +archlib=$privlib +sitelib=$privlib/site +sitearch=$sitelib + +eagain='EAGAIN' +rd_nodata='-1' + +# This script UU/usethreads.cbu will get 'called-back' by Configure +# after it has prompted the user for whether to use threads. +cat > UU/usethreads.cbu <<'EOCBU' +case "$usethreads" in +$define|true|[yY]*) + set `echo X "$libswanted "| sed -e 's/ c / gthreads c /'` + shift + libswanted="$*" + ;; +esac +EOCBU + +useperlio='undef' +uselargefiles='undef' diff --git a/hints/dynix.sh b/hints/dynix.sh new file mode 100644 index 0000000000..4bdb804f53 --- /dev/null +++ b/hints/dynix.sh @@ -0,0 +1,7 @@ +# If this doesn't work, try specifying 'none' for hints. +d_castneg=undef +libswanted=`echo $libswanted | sed -e 's/socket /socket seq /'` + +# Reported by Craig Milo Rogers +# Date: Tue, 30 Jan 96 15:29:26 PST +d_casti32=undef diff --git a/hints/dynixptx.sh b/hints/dynixptx.sh new file mode 100644 index 0000000000..b08dbc29d7 --- /dev/null +++ b/hints/dynixptx.sh @@ -0,0 +1,60 @@ +# Sequent Dynix/Ptx v. 4 hints +# Created 1996/03/15 by Brad Howerter, bhower@wgc.woodward.com + +# Modified 1998/11/10 by Martin J. Bligh, mbligh@sequent.com +# to incorporate work done by Kurtis D. Rader & myself. + +# Use Configure -Dcc=gcc to use gcc. + +# cc wants -G for dynamic loading +lddlflags='-G' + +# Remove inet to avoid this error in Configure, which causes Configure +# to be unable to figure out return types: +# dynamic linker: ./ssize: can't find libinet.so, +# link with -lsocket instead of -linet + +libswanted=`echo $libswanted | sed -e 's/ inet / /'` + +# Configure defaults to usenm='y', which doesn't work very well +usenm='n' + +# removed d_vfork='define'; we can't use it any more ... + +case "$optimize" in +'') optimize='-Wc,-O3 -W0,-xstring' ;; +esac + +# We override d_socket because it's very hard for Configure to get it right +# in Dynix/Ptx, for several reasons. +# (1) the socket interface is in libsocket.so -- this wouldn't be so hard +# for Configure to fathom...but it gets more tangled. +# (2) if the system has been patched there can be libsocket.so.1.FOO.BAR, +# the FOO.BAR being the old version of the system before the patching. +# Configure picks up the old broken version. +# (3) libsocket.so points to either libsocket.so.1 (v4.2) +# or libsocket.so.1.1 (v4.4) The socket call in libsocket.so.1.1 +# (BSD socket library) is called bsd_socket(), and has a macro wrapper +# to hide this. +# This information kindly provided by Martin J. Bligh of Sequent. +# As he puts it: +# "Sequent has unusual capabilities, taking it above and beyond +# the complexity of any other vendor" :-) +# +# Jarkko Hietaniemi November 1998 + +case "$osvers" in +4.[45]*) # configure doesn't find sockets, as they're in libsocket, not libc + d_socket='define' + d_oldsock='undef' + d_sockpair='define' + ;; +4.2*) # on ptx/TCP 4.2, we can use BSD sockets, but they're not the default. + cppflags="$cppflags -Wc,+bsd-socket" + ccflags="$ccflags -Wc,+bsd-socket" + ldflags="$ldflags -Wc,+bsd-socket" + d_socket='define' + d_oldsock='undef' + d_sockpair='define' + ;; +esac diff --git a/hints/epix.sh b/hints/epix.sh new file mode 100644 index 0000000000..dcad3c5d47 --- /dev/null +++ b/hints/epix.sh @@ -0,0 +1,66 @@ +# epix.sh +# Hint file for EP/IX on CDC RISC boxes. +# +# From: Stanley Donald Capelik +# Modified by Andy Dougherty +# Last modified: Mon May 8 15:29:18 EDT 1995 +# +# This hint file appears to be based on the svr4 hints for perl5.000, +# with some CDC-specific additions. I've tried to updated it to +# match the 5.001 svr4 hints, which allow for dynamic loading, +# but I have no way of testing the resulting file. +# +# There were also some contradictions that I've tried to straighten +# out, but I'm not sure I got them all right. +# +# Edit config.sh to change shmattype from 'char *' to 'void *'" + +# Use Configure -Dcc=gcc to use gcc. +case "$cc" in +'') cc='/bin/cc3.11' + test -f $cc || cc='/usr/ccs/bin/cc' + ;; +esac + +usrinc='/svr4/usr/include' + +# Various things that Configure apparently doesn't get right. +strings='/svr4/usr/include/string.h' +timeincl='/svr4/usr/include/sys/time.h ' +libc='/svr4/usr/lib/libc.a' +glibpth="/svr4/usr/lib /svr4/usr/lib/cmplrs/cc /usr/ccs/lib /svr4/lib /svr4/usr/ucblib $glibpth" +osname='epix2' +archname='epix2' +d_suidsafe='define' # "./Configure -d" can't figure this out easilly +d_flock='undef' + +# Old version had this, but I'm not sure why since the old version +# also mucked around with libswanted. This is also definitely wrong +# if the user is trying to use DB_File or GDBM_File. +# libs='-lsocket -lnsl -ldbm -ldl -lc -lcrypt -lm -lucb' + +# We include support for using libraries in /usr/ucblib, but the setting +# of libswanted excludes some libraries found there. You may want to +# prevent "ucb" from being removed from libswanted and see if perl will +# build on your system. +ldflags="$ldflags -non_shared -systype svr4 -L/svr4/usr/lib -L/svr4/usr/lib/cmplrs/cc -L/usr/ccs/lib -L/svr4/usr/ucblib" +ccflags="$ccflags -systype svr4 -D__STDC__=0 -I/svr4/usr/include -I/svr4/usr/ucbinclude" +cppflags="$ccflags -D__STDC__=0 -I/svr4/usr/include -I/svr4/usr/ucbinclude" + +# Don't use problematic libraries: + +libswanted=`echo " $libswanted " | sed -e 's/ malloc / /'` # -e 's/ ucb / /'` +# libmalloc.a - Probably using Perl's malloc() anyway. +# libucb.a - Remove it if you have problems ld'ing. We include it because +# it is needed for ODBM_File and NDBM_File extensions. +if [ -r /usr/ucblib/libucb.a ]; then # If using BSD-compat. library: + # Use the "native" counterparts, not the BSD emulation stuff: + d_bcmp='undef'; d_bcopy='undef'; d_bzero='undef'; d_safebcpy='undef' + d_index='undef'; d_killpg='undef'; d_getprior='undef'; d_setprior='undef' + d_setlinebuf='undef'; d_setregid='undef'; d_setreuid='undef' +fi + +lddlflags="-G $ldflags" # Probably needed for dynamic loading +# We _do_ want the -L paths in ldflags, but we don't want the -non_shared. +lddlflags=`echo $lddlflags | sed 's/-non_shared//'` + diff --git a/hints/esix4.sh b/hints/esix4.sh new file mode 100644 index 0000000000..b1d697cccb --- /dev/null +++ b/hints/esix4.sh @@ -0,0 +1,36 @@ +# hints/esix4.sh +# Original esix4 hint file courtesy of +# Kevin O'Gorman ( kevin@kosman.UUCP, kevin%kosman.uucp@nrc.com ) +# +# Use Configure -Dcc=gcc to use gcc. + +# Why can't we just use PATH? It contains /usr/ccs/bin. +case "$cc" in +'') cc='/bin/cc' + test -f $cc || cc='/usr/ccs/bin/cc' + ;; +esac + +ldflags="$ldflags -L/usr/ccs/lib -L/usr/ucblib" +test -d /usr/local/man || mansrc='none' +# Do we really need to tell cc to look in /usr/include? +ccflags="$ccflags -I/usr/include -I/usr/ucbinclude" +libswanted=`echo " $libswanted " | sed -e 's/ malloc / /' ` +d_index='undef' +d_suidsafe=define +usevfork='false' +if test "$osvers" = "3.0"; then + d_gconvert='undef' + grep 'define[ ]*AF_OSI[ ]' /usr/include/sys/socket.h | grep '/\*[^*]*$' >esix$$ + if test -s esix$$; then + cat <&2 + +WARNING: You are likely to have problems compiling the Socket extension +unless you fix the unterminated comment for AF_OSI in the file +/usr/include/sys/socket.h. + +EOM + fi + rm -f esix$$ +fi + diff --git a/hints/fps.sh b/hints/fps.sh new file mode 100644 index 0000000000..7726790ac0 --- /dev/null +++ b/hints/fps.sh @@ -0,0 +1 @@ +ccflags="$ccflags -J" diff --git a/hints/freebsd.sh b/hints/freebsd.sh new file mode 100644 index 0000000000..4a01430017 --- /dev/null +++ b/hints/freebsd.sh @@ -0,0 +1,256 @@ +# Original based on info from +# Carl M. Fongheiser +# Date: Thu, 28 Jul 1994 19:17:05 -0500 (CDT) +# +# Additional 1.1.5 defines from +# Ollivier Robert +# Date: Wed, 28 Sep 1994 00:37:46 +0100 (MET) +# +# Additional 2.* defines from +# Ollivier Robert +# Date: Sat, 8 Apr 1995 20:53:41 +0200 (MET DST) +# +# Additional 2.0.5 and 2.1 defined from +# Ollivier Robert +# Date: Fri, 12 May 1995 14:30:38 +0200 (MET DST) +# +# Additional 2.2 defines from +# Mark Murray +# Date: Wed, 6 Nov 1996 09:44:58 +0200 (MET) +# +# Modified to ensure we replace -lc with -lc_r, and +# to put in place-holders for various specific hints. +# Andy Dougherty +# Date: Tue Mar 10 16:07:00 EST 1998 +# +# Support for FreeBSD/ELF +# Ollivier Robert +# Date: Wed Sep 2 16:22:12 CEST 1998 +# +# The two flags "-fpic -DPIC" are used to indicate a +# will-be-shared object. Configure will guess the -fpic, (and the +# -DPIC is not used by perl proper) but the full define is included to +# be consistent with the FreeBSD general shared libs building process. +# +# setreuid and friends are inherently broken in all versions of FreeBSD +# before 2.1-current (before approx date 4/15/95). It is fixed in 2.0.5 +# and what-will-be-2.1 +# + +case "$osvers" in +0.*|1.0*) + usedl="$undef" + ;; +1.1*) + malloctype='void *' + groupstype='int' + d_setregid='undef' + d_setreuid='undef' + d_setrgid='undef' + d_setruid='undef' + ;; +2.0-release*) + d_setregid='undef' + d_setreuid='undef' + d_setrgid='undef' + d_setruid='undef' + ;; +# +# Trying to cover 2.0.5, 2.1-current and future 2.1/2.2 +# It does not covert all 2.1-current versions as the output of uname +# changed a few times. +# +# Even though seteuid/setegid are available, they've been turned off +# because perl isn't coded with saved set[ug]id variables in mind. +# In addition, a small patch is requried to suidperl to avoid a security +# problem with FreeBSD. +# +2.0.5*|2.0-built*|2.1*) + usevfork='true' + case "$usemymalloc" in + "") usemymalloc='n' + ;; + esac + d_setregid='define' + d_setreuid='define' + d_setegid='undef' + d_seteuid='undef' + test -r ./broken-db.msg && . ./broken-db.msg + ;; +# +# 2.2 and above have phkmalloc(3). +# don't use -lmalloc (maybe there's an old one from 1.1.5.1 floating around) +2.2*) + usevfork='true' + case "$usemymalloc" in + "") usemymalloc='n' + ;; + esac + libswanted=`echo $libswanted | sed 's/ malloc / /'` + d_setregid='define' + d_setreuid='define' + d_setegid='undef' + d_seteuid='undef' + ;; +*) usevfork='true' + case "$usemymalloc" in + "") usemymalloc='n' + ;; + esac + libswanted=`echo $libswanted | sed 's/ malloc / /'` + ;; +esac + +# Dynamic Loading flags have not changed much, so they are separated +# out here to avoid duplicating them everywhere. +case "$osvers" in +0.*|1.0*) ;; + +1*|2*) cccdlflags='-DPIC -fpic' + lddlflags="-Bshareable $lddlflags" + ;; + +*) + objformat=`/usr/bin/objformat` + if [ x$objformat = xelf ]; then + libpth="/usr/lib /usr/local/lib" + glibpth="/usr/lib /usr/local/lib" + ldflags="-Wl,-E " + lddlflags="-shared " + else + if [ -e /usr/lib/aout ]; then + libpth="/usr/lib/aout /usr/local/lib /usr/lib" + glibpth="/usr/lib/aout /usr/local/lib /usr/lib" + fi + lddlflags='-Bshareable' + fi + cccdlflags='-DPIC -fpic' + ;; +esac + +case "$osvers" in +0*|1*|2*|3*) ;; + +*) + ccflags="${ccflags} -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H" + if /usr/bin/file -L /usr/lib/libc.so | /usr/bin/grep -vq "not stripped" ; then + usenm=false + fi + ;; +esac + +cat <<'EOM' >&4 + +Some users have reported that Configure halts when testing for +the O_NONBLOCK symbol with a syntax error. This is apparently a +sh error. Rerunning Configure with ksh apparently fixes the +problem. Try + ksh Configure [your options] + +EOM + +# From: Anton Berezin +# To: perl5-porters@perl.org +# Subject: [PATCH 5.005_54] Configure - hints/freebsd.sh signal handler type +# Date: 30 Nov 1998 19:46:24 +0100 +# Message-ID: <864srhhvcv.fsf@lion.plab.ku.dk> + +signal_t='void' +d_voidsig='define' + +# set libperl.so.X.X for 2.2.X +case "$osvers" in +2.2*) + # unfortunately this code gets executed before + # the equivalent in the main Configure so we copy a little + # from Configure XXX Configure should be fixed. + if $test -r $src/patchlevel.h;then + patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $src/patchlevel.h` + subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $src/patchlevel.h` + else + patchlevel=0 + subversion=0 + fi + libperl="libperl.so.$patchlevel.$subversion" + unset patchlevel + unset subversion + ;; +esac + +# This script UU/usethreads.cbu will get 'called-back' by Configure +# after it has prompted the user for whether to use threads. +cat > UU/usethreads.cbu <<'EOCBU' +case "$usethreads" in +$define|true|[yY]*) + lc_r=`/sbin/ldconfig -r|grep ':-lc_r'|awk '{print $NF}'|sed -n '$p'` + case "$osvers" in + 0*|1*|2.0*|2.1*) cat <&4 +I did not know that FreeBSD $osvers supports POSIX threads. + +Feel free to tell perlbug@perl.org otherwise. +EOM + exit 1 + ;; + + 2.2.[0-7]*) + cat <&4 +POSIX threads are not supported well by FreeBSD $osvers. + +Please consider upgrading to at least FreeBSD 2.2.8, +or preferably to the most recent -RELEASE or -STABLE +version (see http://www.freebsd.org/releases/). + +(While 2.2.7 does have pthreads, it has some problems + with the combination of threads and pipes and therefore + many Perl tests will either hang or fail.) +EOM + exit 1 + ;; + + *) + if [ ! -r "$lc_r" ]; then + cat <&4 +POSIX threads should be supported by FreeBSD $osvers -- +but your system is missing the shared libc_r. +(/sbin/ldconfig -r doesn't find any). + +Consider using the latest STABLE release. +EOM + exit 1 + fi + ldflags="-pthread $ldflags" + case "$osvers" in + 4.*) # 4.x has gethostbyaddr_r but it is + # "Temporary function, not threadsafe"... + d_gethostbyaddr_r="undef" + d_gethostbyaddr_r_proto="undef" + ;; + esac + ;; + + esac + + set `echo X "$libswanted "| sed -e 's/ c / c_r /'` + shift + libswanted="$*" + # Configure will probably pick the wrong libc to use for nm scan. + # The safest quick-fix is just to not use nm at all... + usenm=false + + case "$osvers" in + 2.2.8*) + # ... but this does not apply for 2.2.8 - we know it's safe + libc="$lc_r" + usenm=true + ;; + esac + + unset lc_r + + # Even with the malloc mutexes the Perl malloc does not + # seem to be threadsafe in FreeBSD? + usemymalloc=n + +esac +EOCBU + diff --git a/hints/genix.sh b/hints/genix.sh new file mode 100644 index 0000000000..16b6879b46 --- /dev/null +++ b/hints/genix.sh @@ -0,0 +1 @@ +i_varargs=undef diff --git a/hints/gnu.sh b/hints/gnu.sh new file mode 100644 index 0000000000..927bceab9d --- /dev/null +++ b/hints/gnu.sh @@ -0,0 +1,33 @@ +# hints/gnu.sh +# Last modified: Thu Dec 10 20:47:28 CET 1998 +# Mark Kettenis + +# libnsl is unusable on the Hurd. +# XXX remove this once SUNRPC is implemented. +set `echo X "$libswanted "| sed -e 's/ nsl / /'` +shift +libswanted="$*" + +case "$optimize" in +'') optimize='-O2' ;; +esac + +# Flags needed to produce shared libraries. +lddlflags='-shared' + +# Flags needed by programs that use dynamic linking. +ccdlflags='-Wl,-E' + +# The following routines are only available as stubs in GNU libc. +# XXX remove this once metaconf detects the GNU libc stubs. +d_msgctl='undef' +d_msgget='undef' +d_msgrcv='undef' +d_msgsnd='undef' +d_semctl='undef' +d_semget='undef' +d_semop='undef' +d_shmat='undef' +d_shmctl='undef' +d_shmdt='undef' +d_shmget='undef' diff --git a/hints/greenhills.sh b/hints/greenhills.sh new file mode 100644 index 0000000000..da6fcc95b0 --- /dev/null +++ b/hints/greenhills.sh @@ -0,0 +1 @@ +ccflags="$ccflags -X18" diff --git a/hints/hpux.sh b/hints/hpux.sh new file mode 100644 index 0000000000..71705163d4 --- /dev/null +++ b/hints/hpux.sh @@ -0,0 +1,598 @@ +#!/usr/bin/sh + +### SYSTEM ARCHITECTURE + +# Determine the architecture type of this system. +# Keep leading tab below -- Configure Black Magic -- RAM, 03/02/97 + xxOsRevMajor=`uname -r | sed -e 's/^[^0-9]*//' | cut -d. -f1`; +if [ "$xxOsRevMajor" -ge 10 ]; then + # This system is running >= 10.x + + # Tested on 10.01 PA1.x and 10.20 PA[12].x. + # Idea: Scan /usr/include/sys/unistd.h for matches with + # "#define CPU_* `getconf # CPU_VERSION`" to determine CPU type. + # Note the text following "CPU_" is used, *NOT* the comment. + # + # ASSUMPTIONS: Numbers will continue to be defined in hex -- and in + # /usr/include/sys/unistd.h -- and the CPU_* #defines will be kept + # up to date with new CPU/OS releases. + xxcpu=`getconf CPU_VERSION`; # Get the number. + xxcpu=`printf '0x%x' $xxcpu`; # convert to hex + archname=`sed -n -e "s/^#[[:space:]]*define[[:space:]]*CPU_//p" /usr/include/sys/unistd.h | + sed -n -e "s/[[:space:]]*$xxcpu[[:space:]].*//p" | + sed -e s/_RISC/-RISC/ -e s/HP_// -e s/_/./ -e "s/[[:space:]]*//g"`; +else + # This system is running <= 9.x + # Tested on 9.0[57] PA and [78].0 MC680[23]0. Idea: After removing + # MC6888[12] from context string, use first CPU identifier. + # + # ASSUMPTION: Only CPU identifiers contain no lowercase letters. + archname=`getcontext | tr ' ' '\012' | grep -v '[a-z]' | grep -v MC688 | + sed -e 's/HP-//' -e 1q`; + selecttype='int *' + fi + +# For some strange reason, the u32align test from Configure hangs in +# HP-UX 10.20 since the December 2001 patches. So hint it to avoid +# the test. +if [ "$xxOsRevMajor" -le 10 ]; then + d_u32align=$define + fi + +echo "Archname is $archname" + +# Fix XSlib (CPAN) confusion when re-using a prefix but changing from ILP32 +# to LP64 builds. They're NOT binary compatible, so quit claiming they are. +archname64=LP64 + + +### HP-UX OS specific behaviour + +# -ldbm is obsolete and should not be used +# -lBSD contains BSD-style duplicates of SVR4 routines that cause confusion +# -lPW is obsolete and should not be used +# The libraries crypt, malloc, ndir, and net are empty. +set `echo "X $libswanted " | sed -e 's/ ld / /' -e 's/ dbm / /' -e 's/ BSD / /' -e 's/ PW / /'` +shift +libswanted="$*" + +cc=${cc:-cc} +ar=/usr/bin/ar # Yes, truly override. We do not want the GNU ar. +full_ar=$ar # I repeat, no GNU ar. arrr. + +set `echo "X $ccflags " | sed -e 's/ -A[ea] / /' -e 's/ -D_HPUX_SOURCE / /'` +shift + cc_cppflags="$* -D_HPUX_SOURCE" +cppflags="-Aa -D__STDC_EXT__ $cc_cppflags" + +case "$prefix" in + "") prefix='/opt/perl5' ;; + esac + + gnu_as=no + gnu_ld=no +case `$cc -v 2>&1`"" in + *gcc*) ccisgcc="$define" + ccflags="$cc_cppflags" + if [ "X$gccversion" = "X" ]; then + # Done too late in Configure if hinted + gccversion=`$cc --version | sed 's/.*(GCC) *//'` + fi + case "$gccversion" in + [012]*) # HP-UX and gcc-2.* break UINT32_MAX :-( + ccflags="$ccflags -DUINT32_MAX_BROKEN" + ;; + 3*) # GCC (both 32bit and 64bit) will define __STDC_EXT__ + # by default when using GCC 3.0 and newer versions of + # the compiler. + cppflags="$cc_cppflags" + ;; + esac + case "`getconf KERNEL_BITS 2>/dev/null`" in + *64*) + echo "main(){}">try.c + case "$gccversion" in + 3*) + case "$archname" in + PA-RISC*) + case "$ccflags" in + *-mpa-risc*) ;; + *) ccflags="$ccflags -mpa-risc-2-0" ;; + esac + ;; + esac + ;; + *) # gcc with gas will not accept +DA2.0 + case "`$cc -c -Wa,+DA2.0 try.c 2>&1`" in + *"+DA2.0"*) # gas + gnu_as=yes + ;; + *) # HPas + ccflags="$ccflags -Wa,+DA2.0" + ;; + esac + ;; + esac + # gcc with gld will not accept +vnocompatwarnings + case "`$cc -o try -Wl,+vnocompatwarnings try.c 2>&1`" in + *"+vnocompat"*) # gld + gnu_ld=yes + ;; + *) # HPld + case "$gccversion" in + [12]*) + # Why not 3 as well here? + # Since not relevant to IA64, not changed. + ldflags="$ldflags -Wl,+vnocompatwarnings" + ccflags="$ccflags -Wl,+vnocompatwarnings" + ;; + esac + ;; + esac + rm -f try.c + ;; + esac + ;; + *) ccisgcc='' + ccversion=`which cc | xargs what | awk '/Compiler/{print $2}'` + case "$ccflags" in + "-Ae "*) ;; + *) ccflags="-Ae $cc_cppflags -Wl,+vnocompatwarnings" ;; + esac + # Needed because cpp does only support -Aa (not -Ae) + cpplast='-' + cppminus='-' + cppstdin='cc -E -Aa -D__STDC_EXT__' + cpprun=$cppstdin +# case "$d_casti32" in +# "") d_casti32='undef' ;; +# esac + ;; + esac + +# When HP-UX runs a script with "#!", it sets argv[0] to the script name. +toke_cflags='ccflags="$ccflags -DARG_ZERO_IS_SCRIPT"' + +### 64 BITNESS + +# Some gcc versions do native 64 bit long (e.g. 2.9-hppa-000310 and gcc-3.0) +# We have to force 64bitness to go search the right libraries + gcc_64native=no +case "$ccisgcc" in + $define|true|[Yy]) + echo 'int main(){long l;printf("%d\\n",sizeof(l));}'>try.c + $cc -o try $ccflags $ldflags try.c + if [ "`try`" = "8" ]; then + cat <&4 + +*** This version of gcc uses 64 bit longs. -Duse64bitall is +*** implicitly set to enable continuation +EOM + use64bitall=$define + gcc_64native=yes + fi + ;; + esac + +case "$use64bitall" in + $define|true|[yY]*) use64bitint="$define" ;; + esac + +case "$usemorebits" in + $define|true|[yY]*) use64bitint="$define"; uselongdouble="$define" ;; + esac + +case "$archname" in + IA64*) + # While here, override so=sl auto-detection + so='so' + ;; + *) + case "$uselongdouble" in + *) ;; + $define|true|[yY]*) + cat <&4 + +*** long doubles are not (yet) supported on HP-UX (any version) +*** Until it does, we cannot continue, aborting. +EOM + exit 1 ;; + esac + ;; + esac + +case "$use64bitint" in + $define|true|[Yy]) + + if [ "$xxOsRevMajor" -lt 11 ]; then + cat <&4 + +*** 64-bit compilation is not supported on HP-UX $xxOsRevMajor. +*** You need at least HP-UX 11.0. +*** Cannot continue, aborting. +EOM + exit 1 + fi + + # Set libc and the library paths + case "$archname" in + PA-RISC*) + loclibpth="$loclibpth /lib/pa20_64" + libc='/lib/pa20_64/libc.sl' ;; + IA64*) + loclibpth="$loclibpth /usr/lib/hpux64" + libc='/usr/lib/hpux64/libc.so' ;; + esac + if [ ! -f "$libc" ]; then + cat <&4 + +*** You do not seem to have the 64-bit libc. +*** I cannot find the file $libc. +*** Cannot continue, aborting. +EOM + exit 1 + fi + + case "$ccisgcc" in + $define|true|[Yy]) + # For the moment, don't care that it ain't supported (yet) + # by gcc (up to and including 2.95.3), cause it'll crash + # anyway. Expect auto-detection of 64-bit enabled gcc on + # HP-UX soon, including a user-friendly exit + case $gcc_64native in + no) case "$gccversion" in + [123]*) ccflags="$ccflags -mlp64" + case "$archname" in + PA-RISC*) + ldflags="$ldflags -Wl,+DD64" + ;; + IA64*) + ldflags="$ldflags -mlp64" + ;; + esac + ;; + esac + ;; + esac + ;; + *) + ccflags="$ccflags +DD64" + ldflags="$ldflags +DD64" + ;; + esac + + # Reset the library checker to make sure libraries + # are the right type + # (NOTE: on IA64, this doesn't work with .a files.) + libscheck='case "`/usr/bin/file $xxx`" in + *ELF-64*|*LP64*|*PA-RISC2.0*) ;; + *) xxx=/no/64-bit$xxx ;; + esac' + + ;; + + *) # Not in 64-bit mode + + case "$archname" in + PA-RISC*) + libc='/lib/libc.sl' ;; + IA64*) + loclibpth="$loclibpth /usr/lib/hpux32" + libc='/usr/lib/hpux32/libc.so' ;; + esac + ;; + esac + +# By setting the deferred flag below, this means that if you run perl +# on a system that does not have the required shared library that you +# linked it with, it will die when you try to access a symbol in the +# (missing) shared library. If you would rather know at perl startup +# time that you are missing an important shared library, switch the +# comments so that immediate, rather than deferred loading is +# performed. Even with immediate loading, you can postpone errors for +# undefined (or multiply defined) routines until actual access by +# adding the "nonfatal" option. +# ccdlflags="-Wl,-E -Wl,-B,immediate $ccdlflags" +# ccdlflags="-Wl,-E -Wl,-B,immediate,-B,nonfatal $ccdlflags" +if [ "$gnu_ld" = "yes" ]; then + ccdlflags="-Wl,-E $ccdlflags" +else + ccdlflags="-Wl,-E -Wl,-B,deferred $ccdlflags" + fi + + +### COMPILER SPECIFICS + +## Local restrictions (point to README.hpux to lift these) + +## Optimization limits +cat >try.c < + +int main () +{ + struct rlimit rl; + int i = getrlimit (RLIMIT_DATA, &rl); + printf ("%d\n", rl.rlim_cur / (1024 * 1024)); + } /* main */ +EOF +$cc -o try $ccflags $ldflags try.c + maxdsiz=`try` +rm -f try try.c core +if [ $maxdsiz -le 64 ]; then + # 64 Mb is probably not enough to optimize toke.c + # and regexp.c with -O2 + cat <&4 +Your kernel limits the data section of your programs to $maxdsiz Mb, +which is (sadly) not enough to fully optimize some parts of the +perl binary. I'll try to use a lower optimization level for +those parts. If you are a sysadmin, and you *do* want full +optimization, raise the 'maxdsiz' kernel configuration parameter +to at least 0x08000000 (128 Mb) and rebuild your kernel. +EOM +regexec_cflags='' +doop_cflags='' + fi + +case "$ccisgcc" in + $define|true|[Yy]) + + case "$optimize" in + "") optimize="-g -O" ;; + *O[3456789]*) optimize=`echo "$optimize" | sed -e 's/O[3-9]/O2/'` ;; + esac + #ld="$cc" + ld=/usr/bin/ld + cccdlflags='-fPIC' + #lddlflags='-shared' + lddlflags='-b' + case "$optimize" in + *-g*-O*|*-O*-g*) + # gcc without gas will not accept -g + echo "main(){}">try.c + case "`$cc $optimize -c try.c 2>&1`" in + *"-g option disabled"*) + set `echo "X $optimize " | sed -e 's/ -g / /'` + shift + optimize="$*" + ;; + esac + ;; + esac + if [ $maxdsiz -le 64 ]; then + case "$optimize" in + *O2*) opt=`echo "$optimize" | sed -e 's/O2/O1/'` + toke_cflags="$toke_cflags;optimize=\"$opt\"" + regexec_cflags="optimize=\"$opt\"" + ;; + esac + fi + ;; + + *) # HP's compiler cannot combine -g and -O + case "$optimize" in + "") optimize="+O2 +Onolimit" ;; + *O[3456789]*) optimize=`echo "$optimize" | sed -e 's/O[3-9]/O2/'` ;; + esac + case "$optimize" in + *-O*|\ + *O2*) opt=`echo "$optimize" | sed -e 's/-O/+O2/' -e 's/O2/O1/' -e 's/ *+Onolimit//'` + ;; + *) opt="$optimize" + ;; + esac + if [ $maxdsiz -le 64 ]; then + toke_cflags="$toke_cflags;optimize=\"$opt\"" + regexec_cflags="optimize=\"$opt\"" + fi + case "$archname" in + IA64*) + doop_cflags="optimize=\"$opt\"" + ;; + esac + ld=/usr/bin/ld + cccdlflags='+Z' + lddlflags='-b +vnocompatwarnings' + ;; + esac + +## LARGEFILES + +#case "$uselargefiles-$ccisgcc" in +# "$define-$define"|'-define') +# cat <&4 +# +#*** I'm ignoring large files for this build because +#*** I don't know how to do use large files in HP-UX using gcc. +# +#EOM +# uselargefiles="$undef" +# ;; +# esac + +cat >UU/uselargefiles.cbu <<'EOCBU' +# This script UU/uselargefiles.cbu will get 'called-back' by Configure +# after it has prompted the user for whether to use large files. +case "$uselargefiles" in + ""|$define|true|[yY]*) + # there are largefile flags available via getconf(1) + # but we cheat for now. (Keep that in the left margin.) +ccflags_uselargefiles="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" + + case " $ccflags " in + *" $ccflags_uselargefiles "*) ;; + *) ccflags="$ccflags $ccflags_uselargefiles" ;; + esac + + if test -z "$ccisgcc" -a -z "$gccversion"; then + # The strict ANSI mode (-Aa) doesn't like large files. + ccflags=`echo " $ccflags "|sed 's@ -Aa @ @g'` + case "$ccflags" in + *-Ae*) ;; + *) ccflags="$ccflags -Ae" ;; + esac + fi + ;; + esac +EOCBU + +# THREADING + +# This script UU/usethreads.cbu will get 'called-back' by Configure +# after it has prompted the user for whether to use threads. +cat >UU/usethreads.cbu <<'EOCBU' +case "$usethreads" in + $define|true|[yY]*) + if [ "$xxOsRevMajor" -lt 10 ]; then + cat <&4 + +HP-UX $xxOsRevMajor cannot support POSIX threads. +Consider upgrading to at least HP-UX 11. +Cannot continue, aborting. +EOM + exit 1 + fi + + if [ "$xxOsRevMajor" -eq 10 ]; then + # Under 10.X, a threaded perl can be built + if [ -f /usr/include/pthread.h ]; then + if [ -f /usr/lib/libcma.sl ]; then + # DCE (from Core OS CD) is installed + + # Check if it is pristine, or patched + cmavsn=`what /usr/lib/libcma.sl 2>&1 | grep 1996` + if [ ! -z "$cmavsn" ]; then + cat <&4 + +*************************************************************************** + +Perl will support threading through /usr/lib/libcma.sl from +the HP DCE package, but the version found is too old to be +reliable. + +If you are not depending on this specific version of the library, +consider to upgrade using patch PHSS_23672 (read README.hpux) + +*************************************************************************** + +(sleeping for 10 seconds...) +EOM + sleep 10 + fi + + # It needs # libcma and OLD_PTHREADS_API. Also + # needs to be #included before any + # other includes (in perl.h) + + # HP-UX 10.X uses the old pthreads API + d_oldpthreads="$define" + + # include libcma before all the others + libswanted="cma $libswanted" + + # tell perl.h to include before other + # include files + ccflags="$ccflags -DPTHREAD_H_FIRST" +# First column on purpose: +# this is not a standard Configure variable +# but we need to get this noticed. +pthread_h_first="$define" + + # HP-UX 10.X seems to have no easy + # way of detecting these *time_r protos. + d_gmtime_r_proto='define' + gmtime_r_proto='REENTRANT_PROTO_I_TS' + d_localtime_r_proto='define' + localtime_r_proto='REENTRANT_PROTO_I_TS' + + # Avoid the poisonous conflicting (and irrelevant) + # prototypes of setkey(). + i_crypt="$undef" + + # CMA redefines select to cma_select, and cma_select + # expects int * instead of fd_set * (just like 9.X) + selecttype='int *' + + elif [ -f /usr/lib/libpthread.sl ]; then + # PTH package is installed + libswanted="pthread $libswanted" + else + libswanted="no_threads_available" + fi + else + libswanted="no_threads_available" + fi + + if [ $libswanted = "no_threads_available" ]; then + cat <&4 + +In HP-UX 10.X for POSIX threads you need both of the files +/usr/include/pthread.h and either /usr/lib/libcma.sl or /usr/lib/libpthread.sl. +Either you must upgrade to HP-UX 11 or install a posix thread library: + + DCE-CoreTools from HP-UX 10.20 Hardware Extensions 3.0 CD (B3920-13941) + +or + + PTH package from e.g. http://hpux.tn.tudelft.nl/hppd/hpux/alpha.html + +Cannot continue, aborting. +EOM + exit 1 + fi + else + # 12 may want upping the _POSIX_C_SOURCE datestamp... + ccflags=" -D_POSIX_C_SOURCE=199506L -D_REENTRANT $ccflags" + set `echo X "$libswanted "| sed -e 's/ c / pthread c /'` + shift + libswanted="$*" + fi + + ;; + esac +EOCBU + +# The mysterious io_xs memory corruption in 11.00 32bit seems to get +# fixed by not using Perl's malloc. Flip side is performance loss. +# So we want mymalloc for all situations possible +usemymalloc='y' +case "$usethreads" in + $define|true|[yY]*) usemymalloc='n' ;; + *) case "$ccisgcc" in + $undef|false|[nN]*) + case "$use64bitint" in + $undef|false|[nN]*) + case "$ccflags" in + *-DDEBUGGING*) ;; + *) usemymalloc='n' ;; + esac + ;; + esac + ;; + esac + ;; + esac + +usemymalloc='n' +case "$useperlio" in + $undef|false|[nN]*) usemymalloc='y' ;; + esac + +# fpclassify() is a macro, the library call is Fpclassify +# Similarly with the others below. +d_fpclassify='define' +d_isnan='define' +d_isinf='define' +d_isfinite='define' +d_unordered='define' +# Next one(s) need the leading tab. These are special 'hint' symbols that +# are not to be propagated to config.sh, all related to pthreads draft 4 +# interfaces. +case "$d_oldpthreads" in + ''|$undef) + d_crypt_r_proto='undef' + d_getgrent_r_proto='undef' + d_getpwent_r_proto='undef' + d_strerror_r_proto='undef' + ;; + esac diff --git a/hints/i386.sh b/hints/i386.sh new file mode 100644 index 0000000000..0a810ffea8 --- /dev/null +++ b/hints/i386.sh @@ -0,0 +1 @@ +ldflags='-L/usr/ucblib' diff --git a/hints/irix_4.sh b/hints/irix_4.sh new file mode 100644 index 0000000000..5c5bdb2f0d --- /dev/null +++ b/hints/irix_4.sh @@ -0,0 +1,45 @@ +#irix_4.sh +# Last modified Fri May 5 14:06:37 EDT 1995 +optimize='-O1' + +# Does Configure really get these wrong? Why? +d_voidsig=define +d_charsprf=undef + +case "$cc" in +*gcc*) ccflags="$ccflags -D_BSD_TYPES" ;; +*) ccflags="$ccflags -ansiposix -signed" ;; +esac + +# This hint due thanks Hershel Walters +# Date: Tue, 31 Jan 1995 16:32:53 -0600 (CST) +# Subject: IRIX4.0.4(.5? 5.0?) problems +# I don't know if they affect versions of perl other than 5.000 or +# versions of IRIX other than 4.0.4. +# +cat <<'EOM' >&4 +If you have problems, you might have try including + -DSTANDARD_C -cckr +in ccflags. +EOM + +case "$usethreads" in +$define|true|[yY]*) + cat >&4 <&4 < +# Subject: sockets broken under IRIX 5.3? YES...how to fix +# Anyone attempting to use perl4 or perl5 with SGI IRIX 5.3 may discover +# that sockets are essentially broken. The syslog interface for perl also +# fails because it uses the broken socket interface. This problem was +# reported to SGI as bug #255347 and it can be fixed by installing +# patchSG0000596. The patch can be downloaded from Advantage OnLine (SGI's +# WWW server) or from the Support Advantage 9/95 Patch CDROM. Thanks to Tom +# Christiansen and others who provided assistance. + +case "$usethreads" in +$define|true|[yY]*) + cat >&4 <&4 < +# with help from Dean Roehrich . +# cc -n32 update info from Krishna Sethuraman, krishna@sgi.com. +# additional update from Scott Henry, scotth@sgi.com + +# Futzed with by John Stoffel on 4/24/1997 +# - assumes 'cc -n32' by default +# - tries to check for various compiler versions and do the right +# thing when it can +# - warnings turned off (-n32 messages): +# 1184 - "=" is used where where "==" may have been intended +# 1552 - variable "foo" set but never used + +# Tweaked by Chip Salzenberg on 5/13/97 +# - don't assume 'cc -n32' if the n32 libm.so is missing + +# Threaded by Jarkko Hietaniemi on 11/18/97 +# - POSIX threads knowledge by IRIX version + +# gcc-enabled by Kurt Starsinic on 3/24/1998 + +# 64-bitty by Jarkko Hietaniemi on 9/1998 + +# Use sh Configure -Dcc='cc -n32' to try compiling with -n32. +# or -Dcc='cc -n32 -mips3' (or -mips4) to force (non)portability +# Don't bother with -n32 unless you have the 7.1 or later compilers. +# But there's no quick and light-weight way to check in 6.2. + +# NOTE: some IRIX cc versions, e.g. 7.3.1.1m (try cc -version) have +# been known to have issues (coredumps) when compiling perl.c. +# If you've used -OPT:fast_io=ON and this happens, try removing it. +# If that fails, or you didn't use that, then try adjusting other +# optimization options (-LNO, -INLINE, -O3 to -O2, etcetera). +# The compiler bug has been reported to SGI. +# -- Allen Smith + +# Let's assume we want to use 'cc -n32' by default, unless the +# necessary libm is missing (which has happened at least twice) +case "$cc" in +'') case "$use64bitall" in + "$define"|true|[yY]*) test -f /usr/lib64/libm.so && cc='cc -64' ;; + *) test -f /usr/lib32/libm.so && cc='cc -n32' ;; + esac +esac + +cc=${cc:-cc} + +case "$cc" in +*gcc*) ;; +*) ccversion=`cc -version 2>&1` ;; +esac + +case "$use64bitint" in +$define|true|[yY]*) + case "`uname -r`" in + [1-5]*|6.[01]) + cat >&4 <&4 < + libscheck='case "$xxx" in +*.a) /bin/ar p $xxx `/bin/ar t $xxx | sed q` >$$.o; + case "`/usr/bin/file $$.o`" in + *N32*) rm -f $$.o ;; + *) rm -f $$.o; xxx=/no/n32$xxx ;; + esac ;; +*) case "`/usr/bin/file $xxx`" in + *N32*) ;; + *) xxx=/no/n32$xxx ;; + esac ;; +esac' + + # NOTE: -L/usr/lib32 -L/lib32 are automatically selected by the linker + ldflags=' -L/usr/local/lib32 -L/usr/local/lib' + cccdlflags=' ' + # From: David Billinghurst + # If you get complaints about so_locations then change the following + # line to something like: + # lddlflags="-n32 -shared -check_registry /usr/lib32/so_locations" + lddlflags="-n32 -shared" + libc='/usr/lib32/libc.so' + plibpth='/usr/lib32 /lib32 /usr/ccs/lib' + ;; +*"cc -64"*) + + loclibpth="$loclibpth /usr/lib64" + libscheck='case "`/usr/bin/file $xxx`" in +*64-bit*) ;; +*) xxx=/no/64-bit$xxx ;; +esac' + # NOTE: -L/usr/lib64 -L/lib64 are automatically selected by the linker + ldflags=' -L/usr/local/lib64 -L/usr/local/lib' + cccdlflags=' ' + # From: David Billinghurst + # If you get complaints about so_locations then change the following + # line to something like: + # lddlflags="-64 -shared -check_registry /usr/lib64/so_locations" + lddlflags="-64 -shared" + libc='/usr/lib64/libc.so' + plibpth='/usr/lib64 /lib64 /usr/ccs/lib' + ;; +*gcc*) + ccflags="$ccflags -D_BSD_TYPES -D_BSD_TIME -D_POSIX_C_SOURCE" + optimize="-O3" + usenm='undef' + case "`uname -s`" in + # Without the -mabi=64 gcc in 64-bit IRIX has problems passing + # and returning small structures. This affects inet_*() and semctl(). + # See http://reality.sgi.com/ariel/freeware/gcc-2.8.1-notes.html + # for more information. Reported by Lionel Cons . + IRIX64) ccflags="$ccflags -mabi=64" + ldflags="$ldflags -mabi=64 -L/usr/lib64" + lddlflags="$lddlflags -mabi=64" + ;; + *) ccflags="$ccflags -DIRIX32_SEMUN_BROKEN_BY_GCC" + ;; + esac + ;; +*) + # this is needed to force the old-32 paths + # since the system default can be changed. + ccflags="$ccflags -32 -D_BSD_TYPES -D_BSD_TIME -Olimit 3100" + optimize='-O' + ;; +esac + +# Settings common to both native compiler modes. +case "$cc" in +*"cc -n32"*|*"cc -64"*) + ld=$cc + + # perl's malloc can return improperly aligned buffer + # which (under 5.6.0RC1) leads into really bizarre bus errors + # and freak test failures (lib/safe1 #18, for example), + # even more so with -Duse64bitall: for example lib/io_linenumtb. + # fails under the harness but succeeds when run separately, + # under make test pragma/warnings #98 fails, and lib/io_dir + # apparently coredumps (the last two don't happen under + # the harness. Helmut Jarausch is seeing bus errors from + # miniperl, as was Scott Henry with snapshots from just before + # the RC1. --jhi + usemymalloc='undef' +#malloc_cflags='ccflags="-DSTRICT_ALIGNMENT $ccflags"' + + nm_opt='-p' + nm_so_opt='-p' + + # Warnings to turn off because the source code hasn't + # been cleaned up enough yet to satisfy the IRIX cc. + # 1184: "=" is used where where "==" may have been intended. + # 1552: The variable "foobar" is set but never used. + woff=1184,1552 + + # Perl 5.004_57 introduced new qsort code into pp_ctl.c that + # makes IRIX cc prior to 7.2.1 to emit bad code. + # so some serious hackery follows to set pp_ctl flags correctly. + + # Check for which version of the compiler we're running + case "`$cc -version 2>&1`" in + *7.0*) # Mongoose 7.0 + ccflags="$ccflags -D_BSD_TYPES -D_BSD_TIME -woff $woff -OPT:Olimit=0" + optimize='none' + ;; + *7.1*|*7.2|*7.20) # Mongoose 7.1+ + ccflags="$ccflags -D_BSD_TYPES -D_BSD_TIME -woff $woff -OPT:Olimit=0" + optimize='-O3' +# This is a temporary fix for 5.005. +# Leave pp_ctl_cflags line at left margin for Configure. See +# hints/README.hints, especially the section +# =head2 Propagating variables to config.sh +pp_ctl_cflags='optimize=-O' + ;; + *7.*) # Mongoose 7.2.1+ + ccflags="$ccflags -D_BSD_TYPES -D_BSD_TIME -woff $woff -OPT:Olimit=0:space=ON" + optimize='-O3' + ;; + *6.2*) # Ragnarok 6.2 + ccflags="$ccflags -D_BSD_TYPES -D_BSD_TIME -woff $woff" + optimize='none' + ;; + *) # Be safe and not optimize + ccflags="$ccflags -D_BSD_TYPES -D_BSD_TIME -woff $woff -OPT:Olimit=0" + optimize='none' + ;; + esac + +# this is to accommodate the 'modules' capability of the +# 7.2 MIPSPro compilers, which allows for the compilers to be installed +# in a nondefault location. Almost everything works as expected, but +# /usr/include isn't caught properly. Hence see the /usr/include/pthread.h +# change below to include TOOLROOT (a modules environment variable), +# and the following code. Additional +# code to accommodate the 'modules' environment should probably be added +# here if possible, or be inserted as a ${TOOLROOT} reference before +# absolute paths (again, see the pthread.h change below). +# -- krishna@sgi.com, 8/23/98 + + if [ "X${TOOLROOT}" != "X" ]; then + # we cant set cppflags because it gets overwritten + # we dont actually need $TOOLROOT/usr/include on the cc line cuz the + # modules functionality already includes it but + # XXX - how do I change cppflags in the hints file? + ccflags="$ccflags -I${TOOLROOT}/usr/include" + usrinc="${TOOLROOT}/usr/include" + fi + + ;; +esac + +# Don't groan about unused libraries. +ldflags="$ldflags -Wl,-woff,84" + +# workaround for an optimizer bug +case "`$cc -version 2>&1`" in +*7.2.*) op_cflags='optimize=-O1'; opmini_cflags='optimize=-O1' ;; +*7.3.1.*) op_cflags='optimize=-O2'; opmini_cflags='optimize=-O2' ;; +esac + +# We don't want these libraries. +# Socket networking is in libc, these are not installed by default, +# and just slow perl down. (scotth@sgi.com) +set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ nsl / /' -e 's/ dl / /'` +shift +libswanted="$*" + +# Irix 6.5.6 seems to have a broken header +# don't include that (it doesn't contain S_IFMT, S_IFREG, et al) + +i_sysmode="$undef" + +# I have conflicting reports about the sun, crypt, bsd, and PW +# libraries on Irix 6.2. +# +# One user rerports: +# Don't need sun crypt bsd PW under 6.2. You *may* need to link +# with these if you want to run perl built under 6.2 on a 5.3 machine +# (I haven't checked) +# +# Another user reported that if he included those libraries, a large number +# of the tests failed (approx. 20-25) and he would get a core dump. To +# make things worse, test results were inconsistent, i.e., some of the +# tests would pass some times and fail at other times. +# The safest thing to do seems to be to eliminate them. +# +# Actually, the only libs that you want are '-lm'. Everything else +# you need is in libc. You do also need '-lbsd' if you choose not +# to use the -D_BSD_* defines. Note that as of 6.2 the only +# difference between '-lmalloc' and '-lc' malloc is the debugging +# and control calls, which aren't used by perl. -- scotth@sgi.com + +set `echo X "$libswanted "|sed -e 's/ sun / /' -e 's/ crypt / /' -e 's/ bsd / /' -e 's/ PW / /' -e 's/ malloc / /'` +shift +libswanted="$*" + +cat > UU/usethreads.cbu <<'EOCBU' +# This script UU/usethreads.cbu will get 'called-back' by Configure +# after it has prompted the user for whether to use threads. +case "$usethreads" in +$define|true|[yY]*) + if test ! -f ${TOOLROOT}/usr/include/pthread.h -o ! -f /usr/lib/libpthread.so; then + case "`uname -r`" in + [1-5].*|6.[01]) + cat >&4 <&4 <&4 <&4 <