From pa.dec.com!decwrl!uunet!sparky!kent Sun Jun 30 14:43:45 PDT 1991 Article: 2449 of comp.sources.misc Newsgroups: comp.sources.misc Path: pa.dec.com!decwrl!uunet!sparky!kent From: Larry Wall Subject: v20i056: perl - The perl programming language, Patch04 Message-ID: Summary: This is an official patch for perl 4.0. Please apply it. X-Md4-Signature: 6e5a8c800bf0a070ab9b3971547c1f12 Sender: kent@sparky.IMD.Sterling.COM (Kent Landfield) Organization: NetLabs, Inc. Date: Thu, 20 Jun 1991 03:02:33 GMT Approved: kent@sparky.imd.sterling.com Lines: 1942 Submitted-by: Larry Wall Posting-number: Volume 20, Issue 56 Archive-name: perl/patch04 Patch-To: perl: Volume 18, Issue 19-54 System: perl version 4.0 Patch #: 4 Priority: High Subject: many, many itty-bitty portability fixes Subject: there's now a separate doSH script Subject: new copyright notice Subject: new files Subject: cflags now emits entire cc command except for the filename Subject: alternate make programs are now semi-supported Subject: uperl.o no longer tries to link in libraries prematurely Subject: installperl now installs x2p stuff too Subject: length($`), length($&), length($') now optimized to avoid string copy Subject: cflags.SH now spits out cflags for execution Subject: Configure can now propagate arbitrary variables from old config.sh Subject: cflags can now heed config variables on a file by file basis Subject: made some allowances for "semi-standard" C Subject: added global modifier for pattern matches Subject: // wouldn't use previous pattern if it started with a null character Subject: //o and s///o now optimize themselves fully at runtime Subject: undef @array disabled "@array" interpolation Subject: chop("") was returning "\0" rather than "" Subject: vector logical operations &, | and ^ sometimes returned null string Subject: syscall couldn't pass numbers with most significant bit set on sparcs Subject: system fd's are now treated specially Subject: added $^F variable to specify maximum system fd, default 2 Subject: character special files now opened with bidirectional stdio buffers Subject: taintchecks could improperly modify parent in vfork() Subject: $` was busted inside s/// Subject: caller($arg) didn't work except under debugger Subject: perl-mode.el now does better with formats Subject: assignment wasn't correctly de-tainting the assigned variable. Subject: default top-of-form format is now FILEHANDLE_TOP Subject: added $^P variable to control calling of perldb routines Subject: debugger sometimes listed wrong number of lines for a statement Subject: Makefile is no longer self-modifying code under makedepend Subject: debugger lost track of lines in eval Subject: changed old $^P to $^X Subject: /(x+) \1/ incorrectly optimized to not match "xxx xx" Subject: $^D |= 1024 now does syntax tree dump at run-time Subject: taint check on undefined string could cause core dump Subject: t/TEST now tells you number of tests executed Subject: t/op/stat.t no longer depends on certain devices being in /dev Subject: index() could blow up searching for null string Subject: exec would close files even if you cleared close-on-exec flag Subject: find2perl now makes use of find.pl and finddepth.pl Subject: find2perl now optimizes -exec rm -f {} to an unlink Subject: s2p now handles embedded newlines better and optimizes common idioms Subject: a2p didn't correctly implement -n switch Description: 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. Fix: From rn, say "| patch -p -N -d DIR", where DIR is your perl source directory. Outside of rn, say "cd DIR; patch -p -N #define PATCHLEVEL 4 Index: hints/3b1.sh *** hints/3b1.sh.old Fri Jun 7 12:24:17 1991 --- hints/3b1.sh Fri Jun 7 12:24:18 1991 *************** *** 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." Index: Artistic *** Artistic.old Fri Jun 7 12:22:09 1991 --- Artistic Fri Jun 7 12:22:10 1991 *************** *** 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 Index: Configure Prereq: 4.0.1.1 *** Configure.old Fri Jun 7 12:22:15 1991 --- Configure Fri Jun 7 12:22:17 1991 *************** *** 8,14 **** # 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 $ # # Yes, you may rip this off to use in other distribution packages. # (Note: this Configure script was generated automatically. Rather than --- 8,14 ---- # 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.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,194 **** --- 189,195 ---- d_setruid='' d_shm='' d_shmat='' + d_voidshmat='' d_shmctl='' d_shmdt='' d_shmget='' *************** *** 263,268 **** --- 264,270 ---- cppflags='' ldflags='' cc='' + nativegcc='' libs='' n='' c='' *************** *** 269,274 **** --- 271,277 ---- package='' randbits='' scriptdir='' + installscr='' sig_name='' spitshell='' shsharp='' *************** *** 338,345 **** 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' : Now test for existence of everything in MANIFEST --- 341,348 ---- d_ndir=ndir voidwant=1 voidwant=7 ! 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,725 **** 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 dflt=y else dflt=n fi ! lastuname="$uname" rp="I see a config.sh file. Did Configure make it on THIS system? [$dflt]" echo $n "$rp $c" . myread --- 715,728 ---- hint=default if test -f ../config.sh; then echo " " ! eval "`grep lastuname ../config.sh`" ! tmp=`(uname -a) 2>&1` ! if test "X$tmp" = "X$lastuname"; then dflt=y else dflt=n fi ! lastuname="$tmp" rp="I see a config.sh file. Did Configure make it on THIS system? [$dflt]" echo $n "$rp $c" . myread *************** *** 746,751 **** --- 749,755 ---- 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,804 **** case "$dflt" in '') dflt=none;; esac ! echo '(You may give one or more space-separated answers, or "none" if appropriate.)' rp="Which of these apply, if any? [$dflt]" echo $n "$rp $c" . myread --- 802,809 ---- case "$dflt" in '') dflt=none;; esac ! 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 *************** *** 805,810 **** --- 810,816 ---- 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,1244 **** cc="$ans" fi case "$cc" in ! gcc*) cpp=`./loc gcc-cpp $cpp $pth`;; esac : determine optimize, if desired, or use for debug flag also --- 1244,1268 ---- cc="$ans" fi case "$cc" in ! 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,1280 **** case "$ccflags" in '') case "$cc" in ! *gcc*) dflt='-fpcc-struct-return';; *) dflt='';; esac ;; ! *) dflt="$ccflags";; esac for thisincl in $inclwanted; do if test -d $thisincl; then --- 1294,1309 ---- case "$ccflags" in '') case "$cc" in ! *gcc*) dflt="$gccflags";; *) dflt='';; esac ;; ! *-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,1342 **** cppflags='' for flag do case $flag in ! -D*|-I*|-traditional|-ansi|-nostdinc) cppflags="$cppflags $flag";; esac done case "$cppflags" in --- 1365,1371 ---- cppflags='' for flag do case $flag in ! -D*|-U*|-I*|-traditional|-ansi|-nostdinc) cppflags="$cppflags $flag";; esac done case "$cppflags" in *************** *** 1524,1529 **** --- 1553,1559 ---- case "$installbin" in '') dflt=`echo $bin | sed 's#^/afs/#/afs/.#'` + test -d $dflt || dflt="$bin" ;; *) dflt="$installbin" ;; *************** *** 1611,1616 **** --- 1641,1648 ---- $cat >try.c <<'EOCP' #include + blech() { exit(3); } + main() { double f = -123; *************** *** 1619,1625 **** unsigned short ashort; int result = 0; ! signal(SIGFPE, SIG_IGN); along = (unsigned long)f; aint = (unsigned int)f; ashort = (unsigned short)f; --- 1651,1657 ---- unsigned short ashort; int result = 0; ! signal(SIGFPE, blech); along = (unsigned long)f; aint = (unsigned int)f; ashort = (unsigned short)f; *************** *** 1674,1776 **** #define XYZ xyz ABC.XYZ EOT ! echo 'Maybe "'"$cc"' -E" will work...' ! $cc -E 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.out 2>&1 ! ;; ! esac ! ;; ! esac ! if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then echo "Yup, it does." cppstdin="$cc -E" cppminus=''; else ! echo 'Nope...maybe "'"$cc"' -E -" will work...' ! $cc -E - testcpp.out 2>&1 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then ! echo "Yup, it does." ! cppstdin="$cc -E" ! cppminus='-'; else ! echo 'No such luck, maybe "'$cpp'" will work...' ! $cpp 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.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.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.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.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.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.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 fi fi --- 1706,1783 ---- #define XYZ xyz ABC.XYZ EOT ! ! 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.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.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.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.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.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.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.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.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.out 2>&1; \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then + echo "At long last!" + cppstdin="$cc -P" + cppminus='-'; 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.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 and rerun Configure." ! exit 1 fi fi *************** *** 1834,1845 **** test -f $1 || set /lib/libsys_s.a eval set \$$# if test -f "$1"; then ! echo "Your shared C library is in $1." libc="$1" elif test -f "$libc"; then ! echo "Your C library is in $libc." elif test -f /lib/libc.a; then ! echo "Your C library is in /lib/libc.a. You're normal." libc=/lib/libc.a else if ans=`./loc libc.a blurfl/dyick $libpth`; test -f "$ans"; then --- 1841,1852 ---- test -f $1 || set /lib/libsys_s.a eval set \$$# if test -f "$1"; then ! echo "Your (shared) C library seems to be in $1." libc="$1" elif test -f "$libc"; then ! echo "Your C library seems to be in $libc." elif test -f /lib/libc.a; then ! 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,1862 **** : fi if test -f "$ans"; then ! echo "Your C library is in $ans, of all places." libc=$ans else cat </dev/null >libc.tmp $sed -n -e 's/^.* [ATDS] *[_.]*//p' -e 's/^.* [ATDS] //p' libc.list if $contains '^printf$' libc.list >/dev/null 2>&1; then --- 1885,1907 ---- if test $libc = "/lib/libc"; then libc="$libc /lib/clib" fi ! cat <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.list if $contains '^printf$' libc.list >/dev/null 2>&1; then *************** *** 1898,1904 **** libc.list; \ $contains '^printf$' libc.list >/dev/null 2>&1; then echo done ! elif $grep '|' libc.list $contains '^printf$' libc.list >/dev/null 2>&1; then echo done --- 1920,1926 ---- libc.list; \ $contains '^printf$' libc.list >/dev/null 2>&1; then echo done ! elif $grep '|' libc.list $contains '^printf$' libc.list >/dev/null 2>&1; then echo done *************** *** 1939,1954 **** 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 - inlibc='echo " "; td=$define; tu=$undef; if $contains "^$1\$" libc.list >/dev/null 2>&1; then echo "$1() found"; --- 1961,1971 ---- fi fi fi + 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; then echo "$1() found"; *************** *** 2615,2620 **** --- 2632,2650 ---- 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,2870 **** : 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 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 : see if truncate exists set truncate d_truncate --- 2884,2902 ---- : 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[^A-Za-z]*signal' d_voidsig.txt >/dev/null 2>&1 ; then echo "You have int (*signal())() instead of void." val="$undef" else echo "You have void (*signal())() instead of int." val="$define" 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,2934 **** --- 2961,3004 ---- . 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,2989 **** --- 3053,3063 ---- case "$mallocptrtype" in '') cat >usemymalloc.c <<'END' + #ifdef __STDC__ + #include + #else #include + #endif void *malloc(); END if $cc $ccflags -c usemymalloc.c >/dev/null 2>&1; then *************** *** 3021,3026 **** --- 3095,3101 ---- case "$installprivlib" in '') dflt=`echo $privlib | sed 's#^/afs/#/afs/.#'` + test -d $dflt || dflt="$privlib" ;; *) dflt="$installprivlib" ;; *************** *** 3073,3079 **** . myread randbits="$ans" ! : determine where public executables go case "$scriptdir" in '') dflt="$bin" --- 3148,3154 ---- . myread randbits="$ans" ! : determine where publicly executable scripts go case "$scriptdir" in '') dflt="$bin" *************** *** 3094,3100 **** EOM while $test "$cont" ; do ! rp="Where do you keep publicly executable scripts (~name ok)? [$dflt]" $echo $n "$rp $c" . myread scriptdir="$ans" --- 3169,3175 ---- EOM while $test "$cont" ; do ! rp="Where will publicly executable scripts reside (~name ok)? [$dflt]" $echo $n "$rp $c" . myread scriptdir="$ans" *************** *** 3116,3121 **** --- 3191,3233 ---- fi done + case "$installscr" in + '') + dflt=`echo $scriptdir | sed 's#^/afs/#/afs/.#'` + test -d $dflt || dflt="$scriptdir" + ;; + *) dflt="$scriptdir" + ;; + esac + cont=true + $cat </dev/null 2>&1 ; then echo "Your stdio uses unsigned chars." stdchar="unsigned char" else --- 3271,3277 ---- : see what type of char stdio uses. echo " " ! if $contains 'unsigned.*char.*\*.*_ptr.*;' $usrinclude/stdio.h >/dev/null 2>&1 ; then echo "Your stdio uses unsigned chars." stdchar="unsigned char" else *************** *** 3223,3229 **** exit(0); } EOCP ! if $cc -S -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 --- 3335,3341 ---- exit(0); } EOCP ! 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,3245 **** 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 echo "It supports 1..." ! if $cc -S -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 voidhave=5 echo "But it supports 4." else --- 3344,3357 ---- fi else echo "Hmm, your compiler has some difficulty with void. Checking further..." ! if $cc -c -DTRY=1 void.c >/dev/null 2>&1 ; then echo "It supports 1..." ! 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 -c -DTRY=5 void.c >/dev/null 2>&1 ; then voidhave=5 echo "But it supports 4." else *************** *** 3292,3331 **** 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 --- 3404,3409 ---- *************** *** 3463,3473 **** cd .. fi echo "Creating config.sh..." $spitshell <config.sh $startsh # config.sh # This file was produced by running the Configure script. - d_eunice='$d_eunice' define='$define' eunicefix='$eunicefix' --- 3541,3551 ---- cd .. fi echo "Creating config.sh..." + test -f config.sh && cp config.sh UU/oldconfig.sh $spitshell <config.sh $startsh # config.sh # This file was produced by running the Configure script. d_eunice='$d_eunice' define='$define' eunicefix='$eunicefix' *************** *** 3596,3601 **** --- 3674,3680 ---- 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,3675 **** --- 3749,3755 ---- cppflags='$cppflags' ldflags='$ldflags' cc='$cc' + nativegcc='$nativegcc' libs='$libs' n='$n' c='$c' *************** *** 3676,3681 **** --- 3756,3762 ---- package='$package' randbits='$randbits' scriptdir='$scriptdir' + installscr='$installscr' sig_name='$sig_name' spitshell='$spitshell' shsharp='$shsharp' *************** *** 3695,3708 **** lib='$lib' privlib='$privlib' installprivlib='$installprivlib' - CONFIG=true EOT : 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." --- 3776,3808 ---- lib='$lib' privlib='$privlib' installprivlib='$installprivlib' 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 " " dflt='' fastread='' echo "If you didn't make any mistakes, then just type a carriage return here." *************** *** 3714,3754 **** *) : 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}' /dev/null 2>&1; then dflt=n $cat </dev/null 2>&1; then dflt=n $cat <Makefile <Makefile <>Makefile <<'!NO!SUBS!' ! CFLAGS = `sh cflags.SH $@` private = scripts = h2ph - MAKE = make - manpages = perl.man h2ph.man util = --- 61,79 ---- public = perl taintperl $suidperl + # To use an alternate make, set $altmake in config.sh. + MAKE = ${altmake-make} + !GROK!THIS! cat >>Makefile <<'!NO!SUBS!' ! CCCMD = `sh cflags $@` private = scripts = h2ph manpages = perl.man h2ph.man util = *************** *** 104,110 **** SHELL = /bin/sh .c.o: ! $(CC) -c $(CFLAGS) $*.c all: $(public) $(private) $(util) uperl.o $(scripts) cd x2p; $(MAKE) all --- 111,117 ---- SHELL = /bin/sh .c.o: ! $(CCCMD) $*.c all: $(public) $(private) $(util) uperl.o $(scripts) cd x2p; $(MAKE) all *************** *** 119,125 **** $(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 saber: perly.c # load $(c) perly.c --- 126,132 ---- $(CC) $(LARGE) $(CLDFLAGS) $(obj) perly.o usersub.o $(libs) -o perl uperl.o: $& perly.o $(obj) ! -ld $(LARGE) $(LDFLAGS) -r $(obj) perly.o -o uperl.o saber: perly.c # load $(c) perly.c *************** *** 147,267 **** tperly.o: perly.c perly.h $(h) /bin/rm -f tperly.c $(SLN) perly.c tperly.c ! $(CC) -c -DTAINT $(CFLAGS) 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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /bin/rm -f tutil.c perly.h: perly.c --- 154,274 ---- tperly.o: perly.c perly.h $(h) /bin/rm -f tperly.c $(SLN) perly.c 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 ! $(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 ! $(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 ! $(CCCMD) -DTAINT tarray.c /bin/rm -f tarray.c tcmd.o: cmd.c $(h) /bin/rm -f tcmd.c $(SLN) cmd.c 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 ! $(CCCMD) -DTAINT tcons.c /bin/rm -f tcons.c tconsarg.o: consarg.c $(h) /bin/rm -f tconsarg.c $(SLN) consarg.c 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 ! $(CCCMD) -DTAINT tdoarg.c /bin/rm -f tdoarg.c tdoio.o: doio.c $(h) /bin/rm -f tdoio.c $(SLN) doio.c 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 ! $(CCCMD) -DTAINT tdolist.c /bin/rm -f tdolist.c tdump.o: dump.c $(h) /bin/rm -f tdump.c $(SLN) dump.c 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 ! $(CCCMD) -DTAINT teval.c /bin/rm -f teval.c tform.o: form.c $(h) /bin/rm -f tform.c $(SLN) form.c 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 ! $(CCCMD) -DTAINT thash.c /bin/rm -f thash.c tregcomp.o: regcomp.c $(h) /bin/rm -f tregcomp.c $(SLN) regcomp.c 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 ! $(CCCMD) -DTAINT tregexec.c /bin/rm -f tregexec.c tstab.o: stab.c $(h) /bin/rm -f tstab.c $(SLN) stab.c 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 ! $(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 ! $(CCCMD) -DTAINT ttoke.c /bin/rm -f ttoke.c tutil.o: util.c $(h) /bin/rm -f tutil.c $(SLN) util.c tutil.c ! $(CCCMD) -DTAINT tutil.c /bin/rm -f tutil.c perly.h: perly.c *************** *** 268,287 **** @ echo Dummy dependency for dumb parallel make touch perly.h ! perly.c: perly.y @ 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 mv y.tab.h perly.h echo 'extern YYSTYPE yylval;' >>perly.h perly.o: perly.c perly.h $(h) ! $(CC) -c $(CFLAGS) perly.c install: all ./perl installperl - cd x2p; $(MAKE) install clean: rm -f *.o all perl taintperl suidperl --- 275,293 ---- @ echo Dummy dependency for dumb parallel make touch perly.h ! 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 mv y.tab.h perly.h echo 'extern YYSTYPE yylval;' >>perly.h perly.o: perly.c perly.h $(h) ! $(CCCMD) perly.c install: all ./perl installperl clean: rm -f *.o all perl taintperl suidperl *************** *** 291,297 **** 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 # The following lint has practically everything turned on. Unfortunately, # you have to wade through a lot of mumbo jumbo that can't be suppressed. --- 297,303 ---- 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 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. *** End of Patch 4 *** exit 0 # Just in case... -- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM Sterling Software, IMD UUCP: uunet!sparky!kent Phone: (402) 291-8300 FAX: (402) 291-4362 Please send comp.sources.misc-related mail to kent@uunet.uu.net.