diff options
author | Larry Wall <lwall@netlabs.com> | 1991-06-06 23:27:37 +0000 |
---|---|---|
committer | Larry Wall <lwall@netlabs.com> | 1991-06-06 23:27:37 +0000 |
commit | 132b68a5c516d31aa5abdbca3bb36ded2c13b4cc (patch) | |
tree | d9d2896757fae635863444852c7d4d5c63033c8b | |
parent | 16a2aea0ab11de3fff7ce863c5c2cf1851bb125e (diff) | |
download | perl-132b68a5c516d31aa5abdbca3bb36ded2c13b4cc.tar.gz |
perl 4.0 patch 4: (combined patch)
Random patches, mostly bugs and portability stuff. //g is the
only major new feature. Additionally, there is now an alternate
license you can distribute Perl under.
-rw-r--r-- | Artistic | 117 | ||||
-rwxr-xr-x | Configure | 472 | ||||
-rw-r--r-- | EXTERN.h | 11 | ||||
-rw-r--r-- | INTERN.h | 11 | ||||
-rw-r--r-- | MANIFEST | 10 | ||||
-rw-r--r-- | Makefile.SH | 68 | ||||
-rw-r--r-- | hints/3b1.sh | 4 | ||||
-rw-r--r-- | patchlevel.h | 2 | ||||
-rw-r--r-- | usub/Makefile | 6 | ||||
-rw-r--r-- | x2p/EXTERN.h | 11 | ||||
-rw-r--r-- | x2p/INTERN.h | 11 |
11 files changed, 470 insertions, 253 deletions
diff --git a/Artistic b/Artistic new file mode 100644 index 0000000000..fbf7989775 --- /dev/null +++ b/Artistic @@ -0,0 +1,117 @@ + + + + + The "Artistic License" + + Preamble + +The intent of this document is to state the conditions under which a +Package may be copied, such that the Copyright Holder maintains some +semblance of artistic control over the development of the package, +while giving the users of the package the right to use and distribute +the Package in a more-or-less customary fashion, plus the right to make +reasonable modifications. + +Definitions: + + "Package" refers to the collection of files distributed by the + Copyright Holder, and derivatives of that collection of files + created through textual modification. + + "Standard Version" refers to such a Package if it has not been + modified, or has been modified in accordance with the wishes + of the Copyright Holder. + + "Copyright Holder" is whoever is named in the copyright or + copyrights for the package. + + "You" is you, if you're thinking about copying or distributing + this Package. + + "Reasonable copying fee" is whatever you can justify on the + basis of media cost, duplication charges, time of people involved, + and so on. (You will not be required to justify it to the + Copyright Holder, but only to the computing community at large + as a market that must bear the fee.) + + "Freely Available" means that no fee is charged for the item + itself, though there may be fees involved in handling the item. + It also means that recipients of the item may redistribute it + under the same conditions they received it. + +1. You may make and give away verbatim copies of the source form of the +Standard Version of this Package without restriction, provided that you +duplicate all of the original copyright notices and associated disclaimers. + +2. You may apply bug fixes, portability fixes and other modifications +derived from the Public Domain or from the Copyright Holder. A Package +modified in such a way shall still be considered the Standard Version. + +3. You may otherwise modify your copy of this Package in any way, provided +that you insert a prominent notice in each changed file stating how and +when you changed that file, and provided that you do at least ONE of the +following: + + a) place your modifications in the Public Domain or otherwise make them + Freely Available, such as by posting said modifications to Usenet or + an equivalent medium, or placing the modifications on a major archive + site such as uunet.uu.net, or by allowing the Copyright Holder to include + your modifications in the Standard Version of the Package. + + b) use the modified Package only within your corporation or organization. + + c) rename any non-standard executables so the names do not conflict + with standard executables, which must also be provided, and provide + a separate manual page for each non-standard executable that clearly + documents how it differs from the Standard Version. + + d) make other distribution arrangements with the Copyright Holder. + +4. You may distribute the programs of this Package in object code or +executable form, provided that you do at least ONE of the following: + + a) distribute a Standard Version of the executables and library files, + together with instructions (in the manual page or equivalent) on where + to get the Standard Version. + + b) accompany the distribution with the machine-readable source of + the Package with your modifications. + + c) accompany any non-standard executables with their corresponding + Standard Version executables, giving the non-standard executables + non-standard names, and clearly documenting the differences in manual + pages (or equivalent), together with instructions on where to get + the Standard Version. + + d) make other distribution arrangements with the Copyright Holder. + +5. You may charge a reasonable copying fee for any distribution of this +Package. You may charge any fee you choose for support of this Package. +You may not charge a fee for this Package itself. However, +you may distribute this Package in aggregate with other (possibly +commercial) programs as part of a larger (possibly commercial) software +distribution provided that you do not advertise this Package as a +product of your own. + +6. The scripts and library files supplied as input to or produced as +output from the programs of this Package do not automatically fall +under the copyright of this Package, but belong to whomever generated +them, and may be sold commercially, and may be aggregated with this +Package. + +7. C subroutines supplied by you and linked into this Package in order +to emulate subroutines and variables of the language defined by this +Package shall not be considered part of this Package, but are the +equivalent of input as in Paragraph 6, provided these subroutines do +not change the language in any way that would cause it to fail the +regression tests for the language. + +8. The name of the Copyright Holder may not be used to endorse or promote +products derived from this software without specific prior written permission. + +9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + + The End @@ -8,7 +8,7 @@ # 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.) # -# $RCSfile: Configure,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:26:42 $ +# $RCSfile: Configure,v $$Revision: 4.0.1.2 $$Date: 91/06/07 10:09:34 $ # # Yes, you may rip this off to use in other distribution packages. # (Note: this Configure script was generated automatically. Rather than @@ -189,6 +189,7 @@ d_setrgid='' d_setruid='' d_shm='' d_shmat='' +d_voidshmat='' d_shmctl='' d_shmdt='' d_shmget='' @@ -263,12 +264,14 @@ ccflags='' cppflags='' ldflags='' cc='' +nativegcc='' libs='' n='' c='' package='' randbits='' scriptdir='' +installscr='' sig_name='' spitshell='' shsharp='' @@ -338,8 +341,8 @@ serve_unix_tcp="" d_ndir=ndir voidwant=1 voidwant=7 -libswanted="net_s net nsl_s nsl socket nm ndir ndbm dbm malloc sun m bsd BSD x c_s posix" -inclwanted='/usr/include /usr/netinclude /usr/include/sun /usr/include/bsd /usr/include/lan' +libswanted="c_s net_s net nsl_s nsl socket nm ndir ndbm dbm malloc sun m bsd BSD x posix ucb" +inclwanted='/usr/include /usr/netinclude /usr/include/sun /usr/include/bsd /usr/include/lan /usr/ucbinclude' : Now test for existence of everything in MANIFEST @@ -712,14 +715,14 @@ $eunicefix filexp hint=default if test -f ../config.sh; then echo " " - eval `grep lastuname ../config.sh` - uname=`(uname -a || hostname) 2>&1` - if test "X$uname" = "X$lastuname"; then + eval "`grep lastuname ../config.sh`" + tmp=`(uname -a) 2>&1` + if test "X$tmp" = "X$lastuname"; then dflt=y else dflt=n fi - lastuname="$uname" + lastuname="$tmp" rp="I see a config.sh file. Did Configure make it on THIS system? [$dflt]" echo $n "$rp $c" . myread @@ -746,6 +749,7 @@ if test -d ../hints && test ! -f ../config.sh; then test -f /dynix && dflt="$dflt dynix" test -f /dnix && dflt="$dflt dnix" test -f /bin/mips && /bin/mips && dflt="$dflt mips" + test -d /NextApps && test -f /usr/adm/software_version && dflt="$dflt next" if test -f /bin/uname || test -f /usr/bin/uname; then set `uname -a | tr '[A-Z]' '[a-z]'` @@ -798,13 +802,15 @@ if test -d ../hints && test ! -f ../config.sh; then case "$dflt" in '') dflt=none;; esac - echo '(You may give one or more space-separated answers, or "none" if appropriate.)' + echo '(You may give one or more space-separated answers, or "none" if appropriate.' + echo 'If your OS version has no hints, do not give a wrong version--say "none".)' rp="Which of these apply, if any? [$dflt]" echo $n "$rp $c" . myread for file in $ans; do if test -f ../hints/$file.sh; then . ../hints/$file.sh + cat ../hints/$file.sh >>../config.sh hint=recommended fi done @@ -1238,7 +1244,25 @@ else cc="$ans" fi case "$cc" in -gcc*) cpp=`./loc gcc-cpp $cpp $pth`;; +gcc*) cpp=`./loc gcc-cpp $cpp $pth` + case "$nativegcc" in + '') case "$ccflags" in + *-fpcc-struct-return*) dflt=n;; + *) dflt=y;; + esac + ;; + undef) dflt=n;; + *) dflt=y;; + esac + echo " " + rp="Are your system (especially dbm) libraries compiled with gcc? [$dflt]" + $echo $n "$rp $c" + . myread + case "$ans" in + n*) nativegcc="$undef"; gccflags='-fpcc-struct-return';; + *) nativegcc="$define"; gccflags='';; + esac + ;; esac : determine optimize, if desired, or use for debug flag also @@ -1270,11 +1294,16 @@ esac case "$ccflags" in '') case "$cc" in - *gcc*) dflt='-fpcc-struct-return';; + *gcc*) dflt="$gccflags";; *) dflt='';; esac ;; -*) dflt="$ccflags";; +*-fpcc-struct-return*) dflt="$ccflags";; +*) case "$cc" in + *gcc*) dflt="$ccflags $gccflags";; + *) dflt="$ccflags";; + esac + ;; esac for thisincl in $inclwanted; do if test -d $thisincl; then @@ -1336,7 +1365,7 @@ case "$cppflags" in cppflags='' for flag do case $flag in - -D*|-I*|-traditional|-ansi|-nostdinc) cppflags="$cppflags $flag";; + -D*|-U*|-I*|-traditional|-ansi|-nostdinc) cppflags="$cppflags $flag";; esac done case "$cppflags" in @@ -1524,6 +1553,7 @@ done case "$installbin" in '') dflt=`echo $bin | sed 's#^/afs/#/afs/.#'` + test -d $dflt || dflt="$bin" ;; *) dflt="$installbin" ;; @@ -1611,6 +1641,8 @@ echo 'Checking to see if your C compiler can cast weird floats to unsigned' $cat >try.c <<'EOCP' #include <signal.h> +blech() { exit(3); } + main() { double f = -123; @@ -1619,7 +1651,7 @@ main() unsigned short ashort; int result = 0; - signal(SIGFPE, SIG_IGN); + signal(SIGFPE, blech); along = (unsigned long)f; aint = (unsigned int)f; ashort = (unsigned short)f; @@ -1674,103 +1706,78 @@ cat <<'EOT' >testcpp.c #define XYZ xyz ABC.XYZ EOT -echo 'Maybe "'"$cc"' -E" will work...' -$cc -E <testcpp.c >testcpp.out 2>&1 -: try to force gcc preprocessor if that is the compiler they are using -case $? in -0) cppstdin="$cc -E";; -*) case "$cc" in - *gcc*) - cd .. - echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)' - echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin - chmod 755 cppstdin - cppstdin=`pwd`/cppstdin - cppminus=''; - cd UU - $cppstdin <testcpp.c >testcpp.out 2>&1 - ;; - esac - ;; -esac -if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then + +cd .. +echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin +chmod 755 cppstdin +wrapper=`pwd`/cppstdin +cd UU + +if test "X$cppstdin" != "X" && \ + $cppstdin $cppminus <testcpp.c >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." +elif test "$cc" = gcc && \ + (echo "Using gcc, eh? We'll try to force gcc -E using a wrapper..."; \ + $wrapper <testcpp.c >testcpp.out 2>&1; \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1) ; then + echo "Yup, we can." + cppstdin="$wrapper" + cppminus=''; +elif echo 'Maybe "'"$cc"' -E" will work...'; \ + $cc -E <testcpp.c >testcpp.out 2>&1; \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then + echo "Yup, it does." + cppstdin="$cc -E" + cppminus=''; +elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \ + $cc -E - <testcpp.c >testcpp.out 2>&1; \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then echo "Yup, it does." cppstdin="$cc -E" + cppminus='-'; +elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \ + $wrapper <testcpp.c >testcpp.out 2>&1; \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then + cppstdin="$wrapper" + cppminus='' + echo "Eureka!." +elif echo 'No such luck, maybe "'$cpp'" will work...'; \ + $cpp <testcpp.c >testcpp.out 2>&1; \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then + echo "It works!" + cppstdin="$cpp" + cppminus=''; +elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \ + $cpp - <testcpp.c >testcpp.out 2>&1; \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then + echo "Hooray, it works! I was beginning to wonder." + cppstdin="$cpp" + cppminus='-'; +elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \ + $cc -P <testcpp.c >testcpp.out 2>&1; \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then + echo "Yipee, that works!" + cppstdin="$cc -P" cppminus=''; +elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \ + $cc -P - <testcpp.c >testcpp.out 2>&1; \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then + echo "At long last!" + cppstdin="$cc -P" + cppminus='-'; else - echo 'Nope...maybe "'"$cc"' -E -" will work...' - $cc -E - <testcpp.c >testcpp.out 2>&1 + dflt=blurfl + $echo $n "No dice. I can't find a C preprocessor. Name one: $c" + rp='Name a C preprocessor:' + . myread + cppstdin="$ans" + $cppstdin <testcpp.c >testcpp.out 2>&1 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Yup, it does." - cppstdin="$cc -E" - cppminus='-'; + echo "OK, that will do." else - echo 'No such luck, maybe "'$cpp'" will work...' - $cpp <testcpp.c >testcpp.out 2>&1 - if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then - echo "It works!" - cppstdin="$cpp" - cppminus=''; - else - echo 'Nixed again...maybe "'$cpp' -" will work...' - $cpp - <testcpp.c >testcpp.out 2>&1 - if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Hooray, it works! I was beginning to wonder." - cppstdin="$cpp" - cppminus='-'; - else - echo 'Nope...maybe "'"$cc"' -P" will work...' - $cc -P <testcpp.c >testcpp.out 2>&1 - if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Yup, that does." - cppstdin="$cc -P" - cppminus=''; - else - echo 'Nope...maybe "'"$cc"' -P -" will work...' - $cc -P - <testcpp.c >testcpp.out 2>&1 - if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then - echo "Yup, that does." - cppstdin="$cc -P" - cppminus='-'; - else - echo 'Hmm...perhaps you already told me...' - case "$cppstdin" in - '') ;; - *) $cppstdin $cppminus <testcpp.c >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." - else - echo 'Uh-uh. Time to get fancy...' - cd .. - echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)' - echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin - chmod 755 cppstdin - cppstdin=`pwd`/cppstdin - cppminus=''; - cd UU - $cppstdin <testcpp.c >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 - cppstdin="$ans" - $cppstdin <testcpp.c >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 - fi - fi - fi - fi - fi + echo "Sorry, I can't get that to work. Go find one and rerun Configure." + exit 1 fi fi @@ -1834,12 +1841,12 @@ test -f $1 || set /usr/lib/libc.so.[0-9]* test -f $1 || set /lib/libsys_s.a eval set \$$# if test -f "$1"; then - echo "Your shared C library is in $1." + echo "Your (shared) C library seems to be in $1." libc="$1" elif test -f "$libc"; then - echo "Your C library is in $libc." + echo "Your C library seems to be in $libc." elif test -f /lib/libc.a; then - echo "Your C library is in /lib/libc.a. You're normal." + echo "Your C library seems to be in /lib/libc.a. You're normal." libc=/lib/libc.a else if ans=`./loc libc.a blurfl/dyick $libpth`; test -f "$ans"; then @@ -1856,7 +1863,7 @@ else : fi if test -f "$ans"; then - echo "Your C library is in $ans, of all places." + echo "Your C library seems to be in $ans, of all places." libc=$ans else cat <<EOM @@ -1878,8 +1885,23 @@ echo " " if test $libc = "/lib/libc"; then libc="$libc /lib/clib" fi -set `echo $libc $libnames | tr ' ' '\012' | sort | uniq` -$echo $n "Extracting names from $* for later perusal...$c" +cat <<END + +If the guess above is wrong (which it might be if you're using a strange +compiler, or your machine supports multiple models), you can override it here. +END +dflt="$libc"; +rp="Your C library is where? [$dflt]" +$echo $n "$rp $c" +. myread +libc="$ans" +echo " " +echo $libc $libnames | tr ' ' '\012' | sort | uniq >libnames +$echo "Extracting names from the following files for later perusal:" +sed 's/^/ /' libnames +echo $n "This may take a while...$c" +set X `cat libnames` +shift nm $nm_opts $* 2>/dev/null >libc.tmp $sed -n -e 's/^.* [ATDS] *[_.]*//p' -e 's/^.* [ATDS] //p' <libc.tmp >libc.list if $contains '^printf$' libc.list >/dev/null 2>&1; then @@ -1898,7 +1920,7 @@ elif $sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p' \ <libc.tmp >libc.list; \ $contains '^printf$' libc.list >/dev/null 2>&1; then echo done -elif $grep '|' <libc.tmp | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \ +elif $grep '|' <libc.tmp | $sed -n -e '/|COMMON/d' -e '/|DATA/d' -e '/ file/d' \ -e 's/^\([^ ]*\).*/\1/p' >libc.list $contains '^printf$' libc.list >/dev/null 2>&1; then echo done @@ -1939,15 +1961,10 @@ else fi fi fi - -: old version - -inlibc='echo " "; -if $contains "^$1\$" libc.list >/dev/null 2>&1; -then echo "$1() found"; eval "$2=$define"; -else echo "$1() not found"; eval "$2=$undef"; fi' - -: new version +if test -f /lib/syscalls.exp; then + echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." + sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list +fi inlibc='echo " "; td=$define; tu=$undef; if $contains "^$1\$" libc.list >/dev/null 2>&1; @@ -2615,6 +2632,19 @@ eval $inlibc set shmat d_shmat eval $inlibc +d_voidshmat="$undef" +case "$d_shmat" in +define) + $cppstdin $cppflags $cppminus < $usrinclude/sys/shm.h >voidshmat.txt 2>/dev/null + if $contains "void.*shmat" voidshmat.txt >/dev/null 2>&1; then + echo "and shmat returns (void*)" + d_voidshmat="$define" + else + echo "and shmat returns (char*)" + fi + ;; +esac + : see if shmdt exists set shmdt d_shmdt eval $inlibc @@ -2854,17 +2884,19 @@ esac : see if signal is declared as pointer to function returning int or void echo " " $cppstdin $cppflags $cppminus < $usrinclude/signal.h >d_voidsig.txt -if $contains 'int.*signal' d_voidsig.txt >/dev/null 2>&1 ; then +if $contains 'int[^A-Za-z]*signal' d_voidsig.txt >/dev/null 2>&1 ; then echo "You have int (*signal())() instead of void." val="$undef" - d_tosignal=int else echo "You have void (*signal())() instead of int." val="$define" - d_tosignal=void fi set d_voidsig eval $setvar +case $voidsig in +define) d_tosignal=void;; +*) d_tosignal=int;; +esac : see if truncate exists set truncate d_truncate @@ -2929,6 +2961,44 @@ $echo $n "$rp $c" . myread gidtype="$ans" +: see what type gids are returned by getgroups +echo " " +case "$groupstype" in +'') + if $contains 'getgroups.*short' /usr/lib/lint/llib-lc >/dev/null 2>&1; then + dflt='short' + elif $contains 'getgroups.*int' /usr/lib/lint/llib-lc >/dev/null 2>&1; then + dflt='int' + elif $contains 'getgroups.*short' /usr/include/libc.h >/dev/null 2>&1; then + dflt='short' + elif $contains 'getgroups.*int' /usr/include/libc.h >/dev/null 2>&1; then + dflt='int' + elif $contains 'getgroups.*short' /usr/lib/lint/llib-lbsd >/dev/null 2>&1; then + dflt='short' + elif $contains 'getgroups.*int' /usr/lib/lint/llib-lbsd >/dev/null 2>&1; then + dflt='int' + elif $contains 'int.*gidset' /usr/man/man2/getgroups.2 >/dev/null 2>&1; then + dflt='int' + elif $contains 'gid_t;' $usrinclude/sys/types.h >/dev/null 2>&1 ; then + dflt='gid_t' + else + set `grep 'groups\[NGROUPS\];' $usrinclude/sys/user.h 2>/dev/null` unsigned short + case $1 in + unsigned) dflt="$1 $2" ;; + *) dflt="$1" ;; + esac + fi + ;; +*) dflt="$groupstype" + ;; +esac +cont=true +echo "(The following only matters if you have getgroups().)" +rp="What type are the group ids returned by getgroups()? [$dflt]" +$echo $n "$rp $c" +. myread +groupstype="$ans" + : check for length of integer echo " " case "$intsize" in @@ -2983,7 +3053,11 @@ y*) mallocsrc='malloc.c'; mallocobj='malloc.o' case "$mallocptrtype" in '') cat >usemymalloc.c <<'END' +#ifdef __STDC__ +#include <stdlib.h> +#else #include <malloc.h> +#endif void *malloc(); END if $cc $ccflags -c usemymalloc.c >/dev/null 2>&1; then @@ -3021,6 +3095,7 @@ privlib=`./filexp "$ans"` case "$installprivlib" in '') dflt=`echo $privlib | sed 's#^/afs/#/afs/.#'` + test -d $dflt || dflt="$privlib" ;; *) dflt="$installprivlib" ;; @@ -3073,7 +3148,7 @@ $echo $n "$rp $c" . myread randbits="$ans" -: determine where public executables go +: determine where publicly executable scripts go case "$scriptdir" in '') dflt="$bin" @@ -3094,7 +3169,7 @@ Or you might just lump your scripts in with all your other executables. EOM while $test "$cont" ; do - rp="Where do you keep publicly executable scripts (~name ok)? [$dflt]" + rp="Where will publicly executable scripts reside (~name ok)? [$dflt]" $echo $n "$rp $c" . myread scriptdir="$ans" @@ -3116,6 +3191,43 @@ while $test "$cont" ; do fi done +case "$installscr" in +'') + dflt=`echo $scriptdir | sed 's#^/afs/#/afs/.#'` + test -d $dflt || dflt="$scriptdir" + ;; +*) dflt="$scriptdir" + ;; +esac +cont=true +$cat <<EOM + +Some installations must install scripts in a different directory than where +they will eventually reside. On most systems they're the same directory. +EOM +while $test "$cont" ; do + rp="Where do you install publicly executable scripts (~name ok)? [$dflt]" + $echo $n "$rp $c" + . myread + installscr="$ans" + installscr=`./filexp "$installscr"` + if test -d $installscr; then + cont='' + else + case "$fastread" in + yes) dflt=y;; + *) dflt=n;; + esac + rp="Directory $installscr doesn't exist. Use that name anyway? [$dflt]" + $echo $n "$rp $c" + . myread + dflt='' + case "$ans" in + y*) cont='';; + esac + fi +done + : generate list of signal names echo " " case "$sig_name" in @@ -3159,7 +3271,7 @@ echo "Signals are: $sig_name" : see what type of char stdio uses. echo " " -if $contains 'unsigned.*char.*_ptr;' $usrinclude/stdio.h >/dev/null 2>&1 ; then +if $contains 'unsigned.*char.*\*.*_ptr.*;' $usrinclude/stdio.h >/dev/null 2>&1 ; then echo "Your stdio uses unsigned chars." stdchar="unsigned char" else @@ -3223,7 +3335,7 @@ main() { exit(0); } EOCP - if $cc -S -DTRY=$voidwant void.c >void.out 2>&1 ; then + if $cc -c -DTRY=$voidwant void.c >void.out 2>&1 ; then voidhave=$voidwant echo "It appears to support void to the level $package wants ($voidwant)." if $contains warning void.out >/dev/null 2>&1; then @@ -3232,14 +3344,14 @@ EOCP fi else echo "Hmm, your compiler has some difficulty with void. Checking further..." - if $cc -S -DTRY=1 void.c >/dev/null 2>&1 ; then + if $cc -c -DTRY=1 void.c >/dev/null 2>&1 ; then echo "It supports 1..." - if $cc -S -DTRY=3 void.c >/dev/null 2>&1 ; then + if $cc -c -DTRY=3 void.c >/dev/null 2>&1 ; then voidhave=3 echo "And it supports 2 but not 4." else echo "It doesn't support 2..." - if $cc -S -DTRY=5 void.c >/dev/null 2>&1 ; then + if $cc -c -DTRY=5 void.c >/dev/null 2>&1 ; then voidhave=5 echo "But it supports 4." else @@ -3292,40 +3404,6 @@ case "$ans" in esac yacc="$ans" -: see what type gids are returned by getgroups -echo " " -case "$groupstype" in -'') - if $contains 'getgroups.*short' /usr/lib/lint/llib-lc >/dev/null 2>&1; then - dflt='short' - elif $contains 'getgroups.*int' /usr/lib/lint/llib-lc >/dev/null 2>&1; then - dflt='int' - elif $contains 'getgroups.*short' /usr/lib/lint/llib-lbsd >/dev/null 2>&1; then - dflt='short' - elif $contains 'getgroups.*int' /usr/lib/lint/llib-lbsd >/dev/null 2>&1; then - dflt='int' - elif $contains 'int gidset' /usr/man/man2/getgroups.2 >/dev/null 2>&1 ; then - dflt='int' - elif $contains 'gid_t;' $usrinclude/sys/types.h >/dev/null 2>&1 ; then - dflt='gid_t' - else - set `grep 'groups\[NGROUPS\];' $usrinclude/sys/user.h 2>/dev/null` unsigned short - case $1 in - unsigned) dflt="$1 $2" ;; - *) dflt="$1" ;; - esac - fi - ;; -*) dflt="$groupstype" - ;; -esac -cont=true -echo "(The following only matters if you have getgroups().)" -rp="What type are the group ids returned by getgroups()? [$dflt]" -$echo $n "$rp $c" -. myread -groupstype="$ans" - : see if we can include fcntl.h echo " " if $h_fcntl; then @@ -3463,11 +3541,11 @@ if test -d ../UU; then cd .. fi echo "Creating config.sh..." +test -f config.sh && cp config.sh UU/oldconfig.sh $spitshell <<EOT >config.sh $startsh # config.sh # This file was produced by running the Configure script. - d_eunice='$d_eunice' define='$define' eunicefix='$eunicefix' @@ -3596,6 +3674,7 @@ d_setrgid='$d_setrgid' d_setruid='$d_setruid' d_shm='$d_shm' d_shmat='$d_shmat' +d_voidshmat='$d_voidshmat' d_shmctl='$d_shmctl' d_shmdt='$d_shmdt' d_shmget='$d_shmget' @@ -3670,12 +3749,14 @@ ccflags='$ccflags' cppflags='$cppflags' ldflags='$ldflags' cc='$cc' +nativegcc='$nativegcc' libs='$libs' n='$n' c='$c' package='$package' randbits='$randbits' scriptdir='$scriptdir' +installscr='$installscr' sig_name='$sig_name' spitshell='$spitshell' shsharp='$shsharp' @@ -3695,14 +3776,33 @@ yacc='$yacc' lib='$lib' privlib='$privlib' installprivlib='$installprivlib' -CONFIG=true EOT +test -f patchlevel.h && awk '{printf "%s=%s\n",$2,$3}' patchlevel.h >>config.sh +echo "CONFIG=true" >>config.sh + +if test -f UU/oldconfig.sh; then + 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) ;; + *) echo "Hmm...You had some extra variables I don't know about...I'll try to keep 'em..." + 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 + : Finish up CONFIG=true echo " " -test -f patchlevel.h && awk '{printf "%s=%s\n",$2,$3}' patchlevel.h >>config.sh dflt='' fastread='' echo "If you didn't make any mistakes, then just type a carriage return here." @@ -3714,40 +3814,8 @@ case "$ans" in *) : in case they cannot read eval $ans;; esac -: if this fails, just run all the .SH files by hand -. ./config.sh - -echo " " -echo "Doing variable substitutions on .SH files..." -set x `awk '{print $1}' <MANIFEST | $grep '\.SH'` -shift -case $# in -0) set x *.SH; shift;; -esac -if test ! -f $1; then - shift -fi -for file in $*; do - set X - shift - chmod +x $file - case "$file" in - */*) - dir=`$expr X$file : 'X\(.*\)/'` - file=`$expr X$file : 'X.*/\(.*\)'` - (cd $dir && . $file) - ;; - *) - . $file - ;; - 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 +chmod +x doSH +./doSH if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then dflt=n @@ -3775,5 +3843,5 @@ else fi $rm -f kit*isdone -cd .. && $rm -rf UU +$rm -rf UU : end of Configure @@ -1,11 +1,14 @@ -/* $Header: EXTERN.h,v 4.0 91/03/20 00:58:26 lwall Locked $ +/* $RCSfile: EXTERN.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 10:10:32 $ * - * Copyright (c) 1989, Larry Wall + * Copyright (c) 1991, Larry Wall * - * You may distribute under the terms of the GNU General Public License - * as specified in the README file that comes with the perl 3.0 kit. + * You may distribute under the terms of either the GNU General Public + * License or the Artistic License, as specified in the README file. * * $Log: EXTERN.h,v $ + * Revision 4.0.1.1 91/06/07 10:10:32 lwall + * patch4: new copyright notice + * * Revision 4.0 91/03/20 00:58:26 lwall * 4.0 baseline. * @@ -1,11 +1,14 @@ -/* $Header: INTERN.h,v 4.0 91/03/20 00:58:35 lwall Locked $ +/* $RCSfile: INTERN.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 10:10:42 $ * - * Copyright (c) 1989, Larry Wall + * Copyright (c) 1991, Larry Wall * - * You may distribute under the terms of the GNU General Public License - * as specified in the README file that comes with the perl 3.0 kit. + * You may distribute under the terms of either the GNU General Public + * License or the Artistic License, as specified in the README file. * * $Log: INTERN.h,v $ + * Revision 4.0.1.1 91/06/07 10:10:42 lwall + * patch4: new copyright notice + * * Revision 4.0 91/03/20 00:58:35 lwall * 4.0 baseline. * @@ -1,3 +1,4 @@ +Artistic The "Artistic License" Configure Run this first Copying The GNU General Public License EXTERN.h Included before foreign .h files @@ -20,6 +21,7 @@ config.H Sample config.h config_h.SH Produces config.h cons.c Routines to construct cmd nodes of a parse tree consarg.c Routines to construct arg nodes of a parse tree +doSH Script to run all the *.SH files doarg.c Scalar expression evaluation doio.c I/O operations dolist.c Array expression evaluation @@ -87,6 +89,7 @@ h2pl/tcbreak2 cbreak test routine using .pl handy.h Handy definitions hash.c Associative arrays hash.h Public declarations for the above +hints/3b1.sh hints/3b2.sh hints/aix_rs.sh hints/aix_rt.sh @@ -114,9 +117,11 @@ hints/sunos_3_4.sh hints/sunos_3_5.sh hints/sunos_4_0_1.sh hints/sunos_4_0_2.sh +hints/svr4.sh hints/ultrix_3.sh hints/ultrix_4.sh hints/uts.sh +hints/vax.sh installperl Perl script to do "make install" dirty work ioctl.pl Sample ioctl.pl lib/abbrev.pl An abbreviation table builder @@ -127,13 +132,17 @@ lib/cacheout.pl Manages output filehandles when you need too many lib/complete.pl A command completion subroutine lib/ctime.pl A ctime workalike lib/dumpvar.pl A variable dumper +lib/find.pl A find emulator--used by find2perl +lib/finddepth.pl A depth-first find emulator--used by find2perl lib/flush.pl Routines to do single flush lib/getopt.pl Perl library supporting option parsing lib/getopts.pl Perl library supporting option parsing lib/importenv.pl Perl routine to get environment into variables lib/look.pl A "look" equivalent +lib/newgetopt.pl A perl library supporting long option parsing lib/perldb.pl Perl debugging routines lib/pwd.pl Routines to keep track of PWD environment variable +lib/shellwords.pl Perl library to split into words with shell quoting lib/stat.pl Perl library supporting stat function lib/syslog.pl Perl library supporting syslogging lib/termcap.pl Perl library supporting termcap usage @@ -296,6 +305,7 @@ x2p/a2p.h Global declarations x2p/a2p.man Manual page for awk to perl translator x2p/a2p.y A yacc grammer for awk x2p/a2py.c Awk compiler, sort of +x2p/cflags.SH A script that emits C compilation flags per file x2p/find2perl.SH A find to perl translator x2p/handy.h Handy definitions x2p/hash.c Associative arrays again diff --git a/Makefile.SH b/Makefile.SH index 5f5182543d..3efc862e28 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -25,9 +25,15 @@ esac echo "Extracting Makefile (with variable substitutions)" cat >Makefile <<!GROK!THIS! -# $RCSfile: Makefile.SH,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:30:39 $ +# $RCSfile: Makefile.SH,v $$Revision: 4.0.1.2 $$Date: 91/06/07 10:14:43 $ # # $Log: Makefile.SH,v $ +# Revision 4.0.1.2 91/06/07 10:14:43 lwall +# patch4: cflags now emits entire cc command except for the filename +# patch4: alternate make programs are now semi-supported +# patch4: uperl.o no longer tries to link in libraries prematurely +# patch4: installperl now installs x2p stuff too +# # Revision 4.0.1.1 91/04/11 17:30:39 lwall # patch1: C flags are now settable on a per-file basis # @@ -55,18 +61,19 @@ libs = $libs $cryptlib public = perl taintperl $suidperl +# To use an alternate make, set $altmake in config.sh. +MAKE = ${altmake-make} + !GROK!THIS! cat >>Makefile <<'!NO!SUBS!' -CFLAGS = `sh cflags.SH $@` +CCCMD = `sh cflags $@` private = scripts = h2ph -MAKE = make - manpages = perl.man h2ph.man util = @@ -104,7 +111,7 @@ addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7 SHELL = /bin/sh .c.o: - $(CC) -c $(CFLAGS) $*.c + $(CCCMD) $*.c all: $(public) $(private) $(util) uperl.o $(scripts) cd x2p; $(MAKE) all @@ -119,7 +126,7 @@ perl: $& perly.o $(obj) usersub.o $(CC) $(LARGE) $(CLDFLAGS) $(obj) perly.o usersub.o $(libs) -o perl uperl.o: $& perly.o $(obj) - -ld $(LARGE) $(LDFLAGS) -r $(obj) perly.o $(libs) -o uperl.o + -ld $(LARGE) $(LDFLAGS) -r $(obj) perly.o -o uperl.o saber: perly.c # load $(c) perly.c @@ -147,141 +154,140 @@ taintperl: $& tperly.o tperl.o $(tobj) usersub.o tperly.o: perly.c perly.h $(h) /bin/rm -f tperly.c $(SLN) perly.c tperly.c - $(CC) -c -DTAINT $(CFLAGS) tperly.c + $(CCCMD) -DTAINT tperly.c /bin/rm -f tperly.c tperl.o: perl.c perly.h patchlevel.h perl.h $(h) /bin/rm -f tperl.c $(SLN) perl.c tperl.c - $(CC) -c -DTAINT $(CFLAGS) tperl.c + $(CCCMD) -DTAINT tperl.c /bin/rm -f tperl.c sperl.o: perl.c perly.h patchlevel.h $(h) /bin/rm -f sperl.c $(SLN) perl.c sperl.c - $(CC) -c -DTAINT -DIAMSUID $(CFLAGS) sperl.c + $(CCCMD) -DTAINT -DIAMSUID sperl.c /bin/rm -f sperl.c tarray.o: array.c $(h) /bin/rm -f tarray.c $(SLN) array.c tarray.c - $(CC) -c -DTAINT $(CFLAGS) tarray.c + $(CCCMD) -DTAINT tarray.c /bin/rm -f tarray.c tcmd.o: cmd.c $(h) /bin/rm -f tcmd.c $(SLN) cmd.c tcmd.c - $(CC) -c -DTAINT $(CFLAGS) tcmd.c + $(CCCMD) -DTAINT tcmd.c /bin/rm -f tcmd.c tcons.o: cons.c $(h) perly.h /bin/rm -f tcons.c $(SLN) cons.c tcons.c - $(CC) -c -DTAINT $(CFLAGS) tcons.c + $(CCCMD) -DTAINT tcons.c /bin/rm -f tcons.c tconsarg.o: consarg.c $(h) /bin/rm -f tconsarg.c $(SLN) consarg.c tconsarg.c - $(CC) -c -DTAINT $(CFLAGS) tconsarg.c + $(CCCMD) -DTAINT tconsarg.c /bin/rm -f tconsarg.c tdoarg.o: doarg.c $(h) /bin/rm -f tdoarg.c $(SLN) doarg.c tdoarg.c - $(CC) -c -DTAINT $(CFLAGS) tdoarg.c + $(CCCMD) -DTAINT tdoarg.c /bin/rm -f tdoarg.c tdoio.o: doio.c $(h) /bin/rm -f tdoio.c $(SLN) doio.c tdoio.c - $(CC) -c -DTAINT $(CFLAGS) tdoio.c + $(CCCMD) -DTAINT tdoio.c /bin/rm -f tdoio.c tdolist.o: dolist.c $(h) /bin/rm -f tdolist.c $(SLN) dolist.c tdolist.c - $(CC) -c -DTAINT $(CFLAGS) tdolist.c + $(CCCMD) -DTAINT tdolist.c /bin/rm -f tdolist.c tdump.o: dump.c $(h) /bin/rm -f tdump.c $(SLN) dump.c tdump.c - $(CC) -c -DTAINT $(CFLAGS) tdump.c + $(CCCMD) -DTAINT tdump.c /bin/rm -f tdump.c teval.o: eval.c $(h) /bin/rm -f teval.c $(SLN) eval.c teval.c - $(CC) -c -DTAINT $(CFLAGS) teval.c + $(CCCMD) -DTAINT teval.c /bin/rm -f teval.c tform.o: form.c $(h) /bin/rm -f tform.c $(SLN) form.c tform.c - $(CC) -c -DTAINT $(CFLAGS) tform.c + $(CCCMD) -DTAINT tform.c /bin/rm -f tform.c thash.o: hash.c $(h) /bin/rm -f thash.c $(SLN) hash.c thash.c - $(CC) -c -DTAINT $(CFLAGS) thash.c + $(CCCMD) -DTAINT thash.c /bin/rm -f thash.c tregcomp.o: regcomp.c $(h) /bin/rm -f tregcomp.c $(SLN) regcomp.c tregcomp.c - $(CC) -c -DTAINT $(CFLAGS) tregcomp.c + $(CCCMD) -DTAINT tregcomp.c /bin/rm -f tregcomp.c tregexec.o: regexec.c $(h) /bin/rm -f tregexec.c $(SLN) regexec.c tregexec.c - $(CC) -c -DTAINT $(CFLAGS) tregexec.c + $(CCCMD) -DTAINT tregexec.c /bin/rm -f tregexec.c tstab.o: stab.c $(h) /bin/rm -f tstab.c $(SLN) stab.c tstab.c - $(CC) -c -DTAINT $(CFLAGS) tstab.c + $(CCCMD) -DTAINT tstab.c /bin/rm -f tstab.c tstr.o: str.c $(h) perly.h /bin/rm -f tstr.c $(SLN) str.c tstr.c - $(CC) -c -DTAINT $(CFLAGS) tstr.c + $(CCCMD) -DTAINT tstr.c /bin/rm -f tstr.c ttoke.o: toke.c $(h) perly.h /bin/rm -f ttoke.c $(SLN) toke.c ttoke.c - $(CC) -c -DTAINT $(CFLAGS) ttoke.c + $(CCCMD) -DTAINT ttoke.c /bin/rm -f ttoke.c tutil.o: util.c $(h) /bin/rm -f tutil.c $(SLN) util.c tutil.c - $(CC) -c -DTAINT $(CFLAGS) tutil.c + $(CCCMD) -DTAINT tutil.c /bin/rm -f tutil.c perly.h: perly.c @ echo Dummy dependency for dumb parallel make touch perly.h -perly.c: perly.y +perly.c: perly.y perly.fixer @ echo 'Expect either' 29 shift/reduce and 59 reduce/reduce conflicts... @ echo ' or' 27 shift/reduce and 61 reduce/reduce conflicts... $(YACC) -d perly.y - sh perly.fixer y.tab.c perly.c + sh ./perly.fixer y.tab.c perly.c mv y.tab.h perly.h echo 'extern YYSTYPE yylval;' >>perly.h perly.o: perly.c perly.h $(h) - $(CC) -c $(CFLAGS) perly.c + $(CCCMD) perly.c install: all ./perl installperl - cd x2p; $(MAKE) install clean: rm -f *.o all perl taintperl suidperl @@ -291,7 +297,7 @@ realclean: clean cd x2p; $(MAKE) realclean rm -f *.orig */*.orig *~ */*~ core $(addedbyconf) h2ph h2ph.man rm -f perly.c perly.h t/perl Makefile config.h makedepend makedir - rm -f x2p/Makefile + rm -f makefile x2p/Makefile x2p/makefile cflags x2p/cflags # The following lint has practically everything turned on. Unfortunately, # you have to wade through a lot of mumbo jumbo that can't be suppressed. diff --git a/hints/3b1.sh b/hints/3b1.sh new file mode 100644 index 0000000000..8c9f5a909a --- /dev/null +++ b/hints/3b1.sh @@ -0,0 +1,4 @@ +d_voidsig='undef' +d_tosignal='int'; +echo "If you're going to use shared libraries, don't include -lmalloc, and" +echo "change cc to '/bin/ccc' when editing config.sh at the end." diff --git a/patchlevel.h b/patchlevel.h index 558d48cd9b..82d4f629a7 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -1 +1 @@ -#define PATCHLEVEL 3 +#define PATCHLEVEL 4 diff --git a/usub/Makefile b/usub/Makefile index cf3a48b3ea..107702f303 100644 --- a/usub/Makefile +++ b/usub/Makefile @@ -1,10 +1,10 @@ -SRC = /usr/local/src/perl +SRC = .. GLOBINCS = LOCINCS = -LIBS = -lcurses -ltermlib +LIBS = -lcurses -ltermlib `. $(SRC)/config.sh; echo $$libs` curseperl: $(SRC)/uperl.o usersub.o curses.o - cc $(SRC)/uperl.o usersub.o curses.o $(LIBS) -lm -o curseperl + cc $(SRC)/uperl.o usersub.o curses.o $(LIBS) -o curseperl usersub.o: usersub.c cc -c -I$(SRC) $(GLOBINCS) -DDEBUGGING -g usersub.c diff --git a/x2p/EXTERN.h b/x2p/EXTERN.h index 4a2d360203..d6174c419e 100644 --- a/x2p/EXTERN.h +++ b/x2p/EXTERN.h @@ -1,11 +1,14 @@ -/* $Header: EXTERN.h,v 4.0 91/03/20 01:56:53 lwall Locked $ +/* $RCSfile: EXTERN.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:11:15 $ * - * Copyright (c) 1989, Larry Wall + * Copyright (c) 1991, Larry Wall * - * You may distribute under the terms of the GNU General Public License - * as specified in the README file that comes with the perl 3.0 kit. + * You may distribute under the terms of either the GNU General Public + * License or the Artistic License, as specified in the README file. * * $Log: EXTERN.h,v $ + * Revision 4.0.1.1 91/06/07 12:11:15 lwall + * patch4: new copyright notice + * * Revision 4.0 91/03/20 01:56:53 lwall * 4.0 baseline. * diff --git a/x2p/INTERN.h b/x2p/INTERN.h index bbb54626af..566531fc0d 100644 --- a/x2p/INTERN.h +++ b/x2p/INTERN.h @@ -1,11 +1,14 @@ -/* $Header: INTERN.h,v 4.0 91/03/20 01:56:58 lwall Locked $ +/* $RCSfile: INTERN.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:11:20 $ * - * Copyright (c) 1989, Larry Wall + * Copyright (c) 1991, Larry Wall * - * You may distribute under the terms of the GNU General Public License - * as specified in the README file that comes with the perl 3.0 kit. + * You may distribute under the terms of either the GNU General Public + * License or the Artistic License, as specified in the README file. * * $Log: INTERN.h,v $ + * Revision 4.0.1.1 91/06/07 12:11:20 lwall + * patch4: new copyright notice + * * Revision 4.0 91/03/20 01:56:58 lwall * 4.0 baseline. * |