--- /dev/null
+: basic variables
+package=perl
+baserev=4.1
+patchbranch=1
+mydiff='diff -c'
+maintname='Larry Wall'
+maintloc='lwall@netlabs.com'
+ftpsite=''
+orgname='NetLabs, Inc.'
+newsgroups='comp.lang.perl'
+recipients=''
+ftpdir=''
+
+: derivative variables--do not change
+revbranch="$baserev.$patchbranch"
+packver='1'
--- /dev/null
+
+
+
+
+
+
+ Larry Wall
+ Matthias Neeracher
+ c/o 4920 El Camino Real
+ Los Altos, CA 94022
+
+ March 26, 1993
+
+
+ Gary Little
+ M/S 37-X
+ Apple Computer, Inc.
+ 20525 Mariani Ave.
+ Cupertino, CA 95014
+
+ Dear Gary,
+
+ We are writing you as the product manager of Apple's
+ EssentialsoToolsoObjects (E.T.O.) CD-ROM. As the authors of Perl for
+ MPW, we hereby authorize Apple to distribute Perl for MPW including
+ source code on E.T.O. according to the terms of the "Artistic" license
+ distributed with Perl and enclosed with this letter. The Perl for MPW
+ materials are hereby confirmed as being provided to Apple free of
+ charge, for the purpose of being distributed on E.T.O. This
+ authorization includes distribution of Perl for MPW on successive
+ releases of E.T.O. and distribution of revisions to Perl for MPW that
+ we provide you with or agree to.
+
+ Thank you for your efforts in promoting the use of Perl amongst
+ Macintosh developers.
+
+ Sincerely,
+
+
+ ________________________ ________________________
+
+ Larry Wall Matthias Neeracher
"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.
+ of the Copyright Holder as specified below.
"Copyright Holder" is whoever is named in the copyright or
copyrights for the package.
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.
+ c) give non-standard executables non-standard names, and clearly
+ document 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,
+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.
+product of your own. You may embed this Package's interpreter within
+an executable of yours (by linking); this shall be construed as a mere
+form of aggregation, provided that the complete Standard Version of the
+interpreter is so embedded.
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. If such scripts or library files are aggregated with this
+Package via the so-called "undump" or "unexec" methods of producing a
+binary executable image, then distribution of such an image shall
+neither be construed as a distribution of this Package nor shall it
+fall under the restrictions of Paragraphs 3 and 4, provided that you do
+not represent such an executable image as a Standard Version of 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
+7. C subroutines (or comparably compiled subroutines in other
+languages) 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
--- /dev/null
+$ActualRevision = "M";
+
+($junk, $ActualRevision) = '';
+
+chop($ActualRevision);
+
+($name, $ActualRevision, $junk) = split(/\s+/, $ActualRevision);
--- /dev/null
+#!./perl
+
+#!/usr/bin/perl
+$month = (split(' ',`date`))[1];
+
+while (<DATA>) {
+ next if 1 .. ?^$month\b?o;
+ next unless /deposit/;
+ ($day) = /(\d+)/;
+ local(*where) = m:([^/]+)$:;
+ # with the local, you get bad free's. with it, you get a core dump
+ $where{$day}++;
+}
+
+@days = sort { $a <=> $b } keys %personal;
+
+foreach $place ('tivoli', 'lists', 'personal') {
+ *where = $place;
+ foreach $day (@days) {
+ printf "Aug %02d: %3d in %s\n", $day, $where{$day}, $place;
+ }
+}
+
+__END__
+Aug 27 10:40:20 New mail from hess
+Aug 27 10:40:20 deposit into /home/wraeththu/tchrist/Mail/in.coming/tivoli
+Aug 27 10:42:27 New mail from jcarson
+Aug 27 10:42:27 deposit into /home/wraeththu/tchrist/Mail/in.coming/tivoli
+Aug 27 10:48:18 New mail from dean
+Aug 27 10:48:18 deposit into /home/wraeththu/tchrist/Mail/in.coming/tivoli
+Aug 27 11:05:56 New mail from hess
+Aug 27 11:05:56 deposit into personal
+Aug 27 11:13:28 New mail from hess
+Aug 27 11:13:28 deposit into personal
--- /dev/null
+#!./perl
+# These filenames doesn't seem to matter, as long as the first one exists,
+# and we have permission to create the second one.
+open(OLD_FILE, "/etc/passwd");
+open(NEW_FILE, ">/tmp/foobar");
+
+# This line is unnecessary to trigger death, but it helps to show where
+# we crash and burn.
+$| = 1;
+
+# Seemingly, this loop is necessary to activate the bug. If I just say
+# $_ = <OLD_FILE>
+# instead of the loop, everything works as expected.
+while (<OLD_FILE>) {
+ # This was originally just a random typing spaz on my part, but it causes
+ # perl to crash later.
+ print <NEW_FILE>;
+}
+
+print "About to die...\n";
+print "dest = '$dest'\n";
+print "Didn't die!\n";
+
--- /dev/null
+sleep(1) &sort
--- /dev/null
+#!./perl
+
+sub minmax {
+ eval '@_ = sort { $a '.shift().' $b } @_';
+ (shift, pop(@_));
+}
+
+($x, $y) = &minmax('<=>', 2, 4, 1, 0, 3);
+print "x = $x, y = $y\n";
+($x, $y) = &minmax('cmp', "foo", "bar", "zot", "xyzzy");
+print "x = $x, y = $y\n";
+
--- /dev/null
+print STDERR "Can't open $mib_name: $!\n"
+&objviews'Exit;
--- /dev/null
+
+ s'$lhs'$rhs' now does no interpolation on either side. It used to
+ interplolate $lhs but not $rhs.
+
+ The second and third arguments of splice are now evaluated in scalar
+ context (like the book says) rather than list context.
+
+ Saying shift @foo + 20 is now a semantic error.
+
+ The elements of argument lists for formats are now evaluated in list
+ context.
+
+ You can't do a goto into a block that is optimized away.
+
+ It is no longer syntactically legal to use whitespace as the name
+ of a variable.
+
+ Some error messages will be different.
+++ /dev/null
-#! /bin/sh
-#
-# 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
-# of config.h for certain machines, so you might look for one of those.)
-#
-# $RCSfile: Configure,v $$Revision: 4.0.1.9 $$Date: 92/06/23 12:28:33 $
-#
-# 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.)
-
-cat >/tmp/c1$$ <<EOF
-ARGGGHHHH!!!!!
-
-Your csh still thinks true is false. Write to your vendor today and tell
-them that next year Configure ought to "rm /bin/csh" unless they fix their
-blasted shell. :-)
-
-[End of diatribe. We now return you to your regularly scheduled
-programming...]
-
-EOF
-cat >/tmp/c2$$ <<EOF
-OOPS! You naughty creature! You didn't run Configure with sh!
-I will attempt to remedy the situation by running sh for you...
-
-EOF
-
-true || cat /tmp/c1$$ /tmp/c2$$
-true || exec sh $0
-
-export PATH || cat /tmp/c2$$
-export PATH || exec sh $0
-rm -f /tmp/c1$$ /tmp/c2$$
-
-PATH=".:$PATH:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc:/usr/new:/usr/new/bin:/usr/nbin"
-
-if test ! -t 0; then
- echo "Say 'sh Configure', not 'sh <Configure'"
- exit 1
-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.)"
-
-unset CDPATH
-if test ! -d ../UU; then
- if test ! -d UU; then
- mkdir UU
- fi
- cd UU
-fi
-
-case "$1" in
--d) shift; fastread='yes';;
-esac
-
-d_eunice=''
-define=''
-eunicefix=''
-loclist=''
-expr=''
-sed=''
-echo=''
-cat=''
-rm=''
-mv=''
-cp=''
-tail=''
-tr=''
-mkdir=''
-sort=''
-uniq=''
-grep=''
-trylist=''
-test=''
-inews=''
-egrep=''
-more=''
-pg=''
-Mcc=''
-vi=''
-mailx=''
-mail=''
-cpp=''
-perl=''
-emacs=''
-ls=''
-rmail=''
-sendmail=''
-shar=''
-smail=''
-tbl=''
-troff=''
-nroff=''
-uname=''
-uuname=''
-line=''
-chgrp=''
-chmod=''
-lint=''
-sleep=''
-pr=''
-tar=''
-ln=''
-lpr=''
-lp=''
-touch=''
-make=''
-date=''
-csh=''
-bash=''
-ksh=''
-lex=''
-flex=''
-bison=''
-Log=''
-Header=''
-Id=''
-lastuname=''
-alignbytes=''
-bin=''
-installbin=''
-byteorder=''
-contains=''
-cppstdin=''
-cppminus=''
-d_bcmp=''
-d_bcopy=''
-d_safebcpy=''
-d_bzero=''
-d_castneg=''
-castflags=''
-d_charsprf=''
-d_chsize=''
-d_crypt=''
-cryptlib=''
-d_csh=''
-d_dosuid=''
-d_dup2=''
-d_fchmod=''
-d_fchown=''
-d_fcntl=''
-d_flexfnam=''
-d_flock=''
-d_getgrps=''
-d_gethent=''
-d_getpgrp=''
-d_getpgrp2=''
-d_getprior=''
-d_htonl=''
-d_index=''
-d_isascii=''
-d_killpg=''
-d_lstat=''
-d_memcmp=''
-d_memcpy=''
-d_safemcpy=''
-d_memmove=''
-d_memset=''
-d_mkdir=''
-d_msg=''
-d_msgctl=''
-d_msgget=''
-d_msgrcv=''
-d_msgsnd=''
-d_ndbm=''
-d_odbm=''
-d_open3=''
-d_readdir=''
-d_rename=''
-d_rewindir=''
-d_rmdir=''
-d_seekdir=''
-d_select=''
-d_sem=''
-d_semctl=''
-d_semget=''
-d_semop=''
-d_setegid=''
-d_seteuid=''
-d_setpgrp=''
-d_setpgrp2=''
-d_setprior=''
-d_setregid=''
-d_setresgid=''
-d_setreuid=''
-d_setresuid=''
-d_setrgid=''
-d_setruid=''
-d_shm=''
-d_shmat=''
-d_voidshmat=''
-d_shmctl=''
-d_shmdt=''
-d_shmget=''
-d_socket=''
-d_sockpair=''
-d_oldsock=''
-socketlib=''
-d_statblks=''
-d_stdstdio=''
-d_strctcpy=''
-d_strerror=''
-d_symlink=''
-d_syscall=''
-d_telldir=''
-d_truncate=''
-d_vfork=''
-d_voidsig=''
-d_tosignal=''
-d_volatile=''
-d_vprintf=''
-d_charvspr=''
-d_wait4=''
-d_waitpid=''
-gidtype=''
-groupstype=''
-i_fcntl=''
-i_gdbm=''
-i_grp=''
-i_niin=''
-i_sysin=''
-i_pwd=''
-d_pwquota=''
-d_pwage=''
-d_pwchange=''
-d_pwclass=''
-d_pwexpire=''
-d_pwcomment=''
-i_sys_file=''
-i_sysioctl=''
-i_time=''
-i_sys_time=''
-i_sys_select=''
-d_systimekernel=''
-i_utime=''
-i_varargs=''
-i_vfork=''
-intsize=''
-libc=''
-nm_opts=''
-libndir=''
-i_my_dir=''
-i_ndir=''
-i_sys_ndir=''
-i_dirent=''
-i_sys_dir=''
-d_dirnamlen=''
-ndirc=''
-ndiro=''
-mallocsrc=''
-mallocobj=''
-d_mymalloc=''
-mallocptrtype=''
-mansrc=''
-manext=''
-models=''
-split=''
-small=''
-medium=''
-large=''
-huge=''
-optimize=''
-ccflags=''
-cppflags=''
-ldflags=''
-cc=''
-nativegcc=''
-libs=''
-n=''
-c=''
-package=''
-randbits=''
-scriptdir=''
-installscr=''
-sig_name=''
-spitshell=''
-shsharp=''
-sharpbang=''
-startsh=''
-stdchar=''
-uidtype=''
-usrinclude=''
-inclPath=''
-void=''
-voidhave=''
-voidwant=''
-w_localtim=''
-w_s_timevl=''
-w_s_tm=''
-yacc=''
-lib=''
-privlib=''
-installprivlib=''
-CONFIG=''
-: get the name of the package
-package=perl
-: Here we go...
-echo " "
-echo "Beginning of configuration questions for $package kit."
-: Eunice requires " " instead of "", can you believe it
-echo " "
-
-define='define'
-undef='undef'
-: change the next line if compiling for Xenix/286 on Xenix/386
-xlibpth='/usr/lib/386 /lib/386'
-
-: the hints files may add more components to libpth
-test -d /usr/cs/lib && libpth="$libpth /usr/cs/lib"
-test -d /usr/ccs/lib && libpth="$libpth /usr/ccs/lib"
-test -d /usr/lib && libpth="$libpth /usr/lib"
-test -d /usr/ucblib && libpth="$libpth /usr/ucblib"
-test -d /usr/local/lib && libpth="$libpth /usr/local/lib"
-test -d /usr/lib/large && libpth="$libpth /usr/lib/large"
-test -d /lib && libpth="$libpth /lib"
- libpth="$libpth $xlibpth"
-test -d /lib/large && libpth="$libpth /lib/large"
-test -d /usr/lib/small && libpth="$libpth /usr/lib/small"
-test -d /lib/small && libpth="$libpth /lib/small"
-test -d /usr/lib/cmplrs/cc && libpth="$libpth /usr/lib/cmplrs/cc"
-
-smallmach='pdp11 i8086 z8000 i80286 iAPX286'
-trap 'echo " "; exit 1' 1 2 3
-
-: We must find out about Eunice early
-eunicefix=':'
-if test -f /etc/unixtovms; then
- eunicefix=/etc/unixtovms
-fi
-if test -f /etc/unixtovms.exe; then
- eunicefix=/etc/unixtovms.exe
-fi
-
-attrlist="DGUX M_I186 M_I286 M_I386 M_I8086 M_XENIX UTS __DGUX__"
-attrlist="$attrlist __STDC__ __m88k__ ansi bsd4_2 gcos gimpel"
-attrlist="$attrlist hp9000s300 hp9000s500 hp9000s800 hpux"
-attrlist="$attrlist i186 i386 i8086 iAPX286 ibm interdata"
-attrlist="$attrlist m68k m88k mc300 mc500 mc68000 mc68k mc700 mert"
-attrlist="$attrlist ns16000 ns32000 nsc32000 os pdp11 posix pyr sinix"
-attrlist="$attrlist sparc sun tower tower32 tower32_600 tower32_800 tss"
-attrlist="$attrlist u3b2 u3b20 u3b200 u3b5 ultrix unix vax venix xenix"
-attrlist="$attrlist z8000"
-boPATH=""
-eoPATH="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /usr/plx /usr/5bin /vol/local/bin /etc /usr/lib /lib /usr/local/lib /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/bin /bsd4.3/usr/ucb /bsd43/usr/bin /usr/ccs/lib /opt/SUNWste/bin /usr/opt/SUNWste/bin"
-d_newshome="/usr/NeWS"
-errnolist=errnolist
-h_fcntl=false
-h_sys_file=false
-serve_shm=""
-serve_msg="$undef"
-serve_inet_udp=""
-serve_inet_tcp=""
-serve_unix_udp=""
-serve_unix_tcp=""
-d_ndir=ndir
-voidwant=1
-voidwant=7
-libswanted="c_s net_s net socket nsl_s nsl nm ndir dir ndbm dbm PW 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
-
-echo "First let's make sure your kit is complete. Checking..."
-awk '$1 !~ /PACKINGLIST/ {print $1}' ../MANIFEST | split -100
-rm -f missing
-for filelist in x??; do
- (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing)
-done
-if test -s missing; then
- echo "WARNING: the following files are missing:"
- cat missing
- echo "INTERRUPT NOW, OR HIT RETURN TO PROCEED AT YOUR OWN RISK"
- read junk
-else
- echo "Looks good..."
-fi
-
-: some greps do not return status, grrr.
-echo "grimblepritz" >contains.txt
-if grep blurfldyick contains.txt >/dev/null 2>&1 ; then
- contains=contains
-elif grep grimblepritz contains.txt >/dev/null 2>&1 ; then
- contains=grep
-else
- contains=contains
-fi
-: 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'
-grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
-EOSS
-chmod +x contains
-esac
-
-: see if sh knows # comments
-echo " "
-echo "Checking your sh to see if it knows about # comments..."
-if sh -c '#' >/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..."
- if test -f /bsd43/bin/echo; then
- echo "#!/bsd43/bin/echo hi" > spit.sh
- else
- echo "#!/bin/echo hi" > spit.sh
- fi
- $eunicefix spit.sh
- chmod +x spit.sh
- ./spit.sh > today
- if $contains hi today >/dev/null 2>&1; then
- echo "It does."
- sharpbang='#!'
- else
- echo "#! /bin/echo hi" > spit.sh
- $eunicefix spit.sh
- chmod +x spit.sh
- ./spit.sh > today
- if test -s today; then
- echo "It does."
- sharpbang='#! '
- else
- echo "It doesn't."
- sharpbang=': use '
- fi
- fi
-else
- echo "Your sh doesn't grok # comments--I will strip them later on."
- shsharp=false
- echo "exec grep -v '^#'" >spitshell
- chmod +x spitshell
- $eunicefix spitshell
- spitshell=`pwd`/spitshell
- echo "I presume that if # doesn't work, #! won't work either!"
- sharpbang=': use '
-fi
-
-: 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 >start.sh <<EOSS
-$startsh
-set abc
-test "$?abc" != 1
-EOSS
-
-chmod +x start.sh
-$eunicefix start.sh
-if ./start.sh; then
- echo "Yup, it does."
-else
- echo "Nope. You may have to fix up the shell scripts to make sure sh runs them."
-fi
-
-: first determine how to suppress newline on echo command
-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=''
-else
- cat <<'EOM'
-...using \c
-EOM
- n=''
- c='\c'
-fi
-echo $n "Type carriage return to continue. Your cursor should be here-->$c"
-read ans
-
-: now set up to do reads with possible shell escape and default assignment
-cat <<EOSC >myread
-case "\$fastread" in
-yes) ans=''; echo " " ;;
-*) ans='!';;
-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
-done
-rp='Your answer:'
-case "\$ans" in
-'') ans="\$dflt";;
-esac
-EOSC
-
-: general instructions
-cat <<EOH
-
-This installation shell script will examine your system and ask you questions
-to determine how the $package package should be installed. If you get stuck
-on a question, you may use a ! shell escape to start a subshell or execute
-a command. Many of the questions will have default answers in square
-brackets--typing carriage return will give you the default.
-
-On some of the questions which ask for file or directory names you are
-allowed to use the ~name construct to specify the login directory belonging
-to "name", even if you don't have a shell which knows about that. Questions
-where this is allowed will be marked "(~name ok)".
-
-EOH
-rp="[Type carriage return to continue]"
-echo $n "$rp $c"
-. myread
-cat <<EOH
-
-Much effort has been expended to ensure that this shell script will run on any
-Unix system. If despite that it blows up on you, your best bet is to edit
-Configure and run it again. Also, let me (lwall@netlabs.com)
-know how I blew it. If you can't run Configure for some reason, you'll have
-to generate a config.sh file by hand.
-
-This installation script affects things in two ways: 1) it may do direct
-variable substitutions on some of the files included in this kit, and
-2) it builds a config.h file for inclusion in C programs. You may edit
-any of these files as the need arises after running this script.
-
-If you make a mistake on a question, there is no easy way to back up to it
-currently. The easiest thing to do is to edit config.sh and rerun all the
-SH files. Configure will offer to let you do this before it runs the SH files.
-
-EOH
-rp="[Type carriage return to continue]"
-echo $n "$rp $c"
-. myread
-
-: find out where common programs are
-echo " "
-echo "Locating common programs..."
-cat <<EOSC >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
- ;;
- *)
- if test -f \$dir/\$thing; then
- echo \$dir/\$thing
- 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 +x loc
-$eunicefix loc
-loclist="
-cat
-cp
-echo
-expr
-grep
-mkdir
-mv
-rm
-sed
-sort
-tr
-uniq
-"
-trylist="
-Mcc
-bison
-cpp
-csh
-egrep
-line
-nroff
-perl
-test
-uname
-yacc
-"
-pth=`echo :$boPATH:$PATH:$eoPATH: | sed -e 's/:/ /g'`
-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
-done
-echo " "
-echo "Don't worry if any of the following aren't found..."
-ans=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
-done
-case "$egrep" in
-egrep)
- echo "Substituting grep for egrep."
- egrep=$grep
- ;;
-esac
-case "$test" in
-test)
- echo "Hopefully test is built into your sh."
- ;;
-/bin/test)
- if sh -c "PATH= test true" >/dev/null 2>&1; then
- echo "Using the test built into your sh."
- test=test
- fi
- ;;
-*)
- test=test
- ;;
-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" >Loc1.txt
- echo $n "hi there$c" >Loc2.txt
- if cmp Loc1.txt Loc2.txt >/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 <<FOO
-They are not compatible! You are probably running ksh on a non-USG system.
-I'll have to use /bin/echo instead of the builtin, since Bourne shell doesn't
-have echo built in and we may have to run some Bourne shell scripts. That
-means I'll have to use $ans to suppress newlines now. Life is ridiculous.
-
-FOO
- rp="Your cursor should be here-->"
- $echo $n "$rp$c"
- . myread
- fi
- ;;
-*)
- : cross your fingers
- echo=echo
- ;;
-esac
-
-: set up shell script to do ~ expansion
-cat >filexp <<EOSS
-$startsh
-: expand filename
-case "\$1" in
- ~/*|~)
- echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
- ;;
- ~*)
- if $test -f /bin/csh; then
- /bin/csh -f -c "glob \$1"
- echo ""
- else
- name=\`$expr x\$1 : '..\([^/]*\)'\`
- dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
- if $test ! -d "\$dir"; then
- me=\`basename \$0\`
- echo "\$me: can't locate home directory for: \$name" >&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
-
-: get old answers, if there is a config file out there
-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
- case "$ans" in
- n*) echo "OK, I'll ignore it."; mv ../config.sh ../config.sh.old;;
- *) echo "Fetching default answers from your old config.sh file..."
- tmp="$n"
- ans="$c"
- . ../config.sh
- n="$tmp"
- c="$ans"
- hint=previous
- ;;
- esac
-else
- lastuname=`(uname -a) 2>&1`
-fi
-if test -d ../hints && test ! -f ../config.sh; then
- echo ' '
- echo "First time through, eh? I have some defaults handy for the following systems:"
- (cd ../hints; ls -C *.sh | sed 's/\.sh/ /g')
- dflt=''
- : Half the following guesses are probably wrong...
- test -f /irix && dflt="$dflt sgi"
- test -f /xenix && dflt="$dflt sco_xenix"
- test -f /dynix && dflt="$dflt dynix"
- test -f /dnix && dflt="$dflt dnix"
- test -f /bin/mips && /bin/mips && dflt="$dflt mips"
- test -d /NextApps && test -f /usr/adm/software_version && dflt="$dflt next"
- if test -f /bin/uname || test -f /usr/bin/uname; then
- set `uname -a | tr '[A-Z]' '[a-z]'`
-
- test -f "../hints/$5.sh" && dflt="$dflt $5"
-
- case "$5" in
- 3b2) dflt="$dflt 3b2";;
- fps*) dflt="$dflt fps";;
- mips*) dflt="$dflt mips";;
- [23]100) dflt="$dflt mips";;
- next*) dflt="$dflt next" ;;
- 6000) dflt="$dflt mc6000";;
- esac
-
- test -f "../hints/$1.sh" && dflt="$dflt $1"
-
- case "$1" in
- aix) dflt="$dflt aix_rs" ;;
- sunos) case "$3" in
- 3.4) dflt="$dflt sunos_3_4" ;;
- 3.5) dflt="$dflt sunos_3_5" ;;
- 4.0.1) dflt="$dflt sunos_4_0_1" ;;
- 4.0.2) dflt="$dflt sunos_4_0_2" ;;
- esac
- ;;
- hp*ux) dflt="$dflt hpux"
- extra_hints="hp"`echo $5 | sed -e s#/#_#g -e s/..$/00/`
- if test -f ../hints/$extra_hints.sh; then
- dflt="$dflt $extra_hints"
- fi;;
- irix) dflt="$dflt sgi" ;;
- ultrix) case "$3" in
- 1*) dflt="$dflt ultrix_1" ;;
- 3*) dflt="$dflt ultrix_3" ;;
- 4*) dflt="$dflt ultrix_4" ;;
- esac
- ;;
- uts) dflt="$dflt uts" ;;
- $2) if test -f /etc/systemid; then
- set `echo $3 | sed 's/\./ /'` $4
- if test -f ../hints/sco_$1_$2_$3.sh; then
- dflt="$dflt sco_$1_$2_$3"
- elif test -f ../hints/sco_$1_$2.sh; then
- dflt="$dflt sco_$1_$2"
- elif test -f ../hints/sco_$1.sh; then
- dflt="$dflt sco_$1"
- fi
- fi
- ;;
- esac
- fi
- set X `echo $dflt | tr ' ' '\012' | sort | uniq`
- shift
- dflt=${1+"$@"}
- 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
- 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
-fi
-
-cat >whoa <<'EOF'
-eval "was=\$$2"
-dflt=y
-echo ' '
-echo "*** WHOA THERE!!! ***"
-echo " The $hint value for \$$2 on this machine was \"$was\"!"
-rp=" Keep the $hint value? [y]"
-echo $n "$rp $c"
-. myread
-case "$ans" in
-y) td=$was; tu=$was;;
-esac
-EOF
-
-setvar='td=$define; tu=$undef; set X $1; eval "was=\$$2";
-case "$val$was" in
-defineundef) . whoa; eval "$2=\$td";;
-undefdefine) . whoa; eval "$2=\$tu";;
-*) eval "$2=$val";;
-esac'
-
-: determine where manual pages go
-$cat <<EOM
-
-$package has manual pages available in source form.
-EOM
-case "$nroff" in
-'nroff')
- echo "However, you don't have nroff, so they're probably useless to you."
- case "$mansrc" in
- '')
- mansrc="none"
- ;;
- esac
-esac
-echo "If you don't want the manual sources installed, answer 'none'."
-case "$mansrc" in
-'')
- dflt=`./loc . none /usr/man/local/man1 /usr/man/man.L /usr/man/manl /usr/man/mann /usr/man/u_man/man1 /usr/man/man1 /usr/local/man/man1`
- ;;
-*) dflt="$mansrc"
- ;;
-esac
-cont=true
-while $test "$cont" ; do
- echo " "
- rp="Where do the manual pages (source) go (~name ok)? [$dflt]"
- $echo $n "$rp $c"
- . myread
- case "$ans" in
- 'none')
- mansrc=''
- cont=''
- ;;
- *)
- mansrc=`./filexp "$ans"`
- if $test -d "$mansrc"; then
- cont=''
- else
- if $test "$fastread" = yes; then
- dflt=y
- else
- dflt=n
- fi
- rp="Directory $mansrc doesn't exist. Use that name anyway? [$dflt]"
- $echo $n "$rp $c"
- . myread
- dflt=''
- case "$ans" in
- y*) cont='';;
- esac
- fi
- ;;
- esac
-done
-case "$mansrc" in
-'')
- manext=''
- ;;
-*l)
- manext=l
- ;;
-*n)
- manext=n
- ;;
-*o)
- manext=l
- ;;
-*p)
- manext=n
- ;;
-*C)
- manext=C
- ;;
-*L)
- manext=L
- ;;
-*)
- manext=1
- ;;
-esac
-
-: Sigh. Well, at least the box is fast...
-echo " "
-$echo $n "Hmm... $c"
-case "$usrinclude" in
-'') dflt='/usr/include';;
-*) dflt=$usrinclude;;
-esac
-inclPath=''
-if $test -f /bin/mips && /bin/mips; then
- echo "Looks like a MIPS system..."
- $cat >usrinclude.c <<'EOCP'
-#ifdef SYSTYPE_BSD43
-/bsd43
-#endif
-EOCP
- if cc -E usrinclude.c > usrinclude.out && $contains / usrinclude.out >/dev/null 2>&1 ; then
- echo "and you're compiling with the BSD43 compiler and libraries."
- dflt='/bsd43/usr/include'
- inclPath='/bsd43'
- else
- echo "and you're compiling with the SysV compiler and libraries."
- fi
-else
- echo "Doesn't look like a MIPS system."
- echo "exit 1" >mips
- chmod +x mips
- $eunicefix mips
-fi
-
-cont=true
-while $test "$cont" ; do
- echo " "
- rp="Where are the include files you want to use? [$dflt]"
- $echo $n "$rp $c"
- . myread
- usrinclude="$ans"
- if $test -d $ans; then
- cont=''
- else
- if $test "$fastread" = yes; then
- dflt=y
- else
- dflt=n
- fi
- rp="Directory $ans doesn't exist. Use that name anyway? [$dflt]"
- $echo $n "$rp $c"
- . myread
- dflt=''
- case "$ans" in
- y*) cont='';;
- esac
- fi
-done
-
-: make some quick guesses about what we are up against
-echo " "
-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
-cat $usrinclude/signal.h $usrinclude/sys/signal.h >guess.txt 2>/dev/null
-if test "$usrinclude" = "/bsd43/usr/include" ; then
- echo "Looks kind of like a SysV MIPS running BSD, but we'll see..."
- echo exit 0 >bsd
-elif test -f /osf_boot || $contains "OSF/1" /usr/include/ctype.h; then
- echo "Looks like an OSF/1 system, but we'll see..."
- echo exit 0 >osf1
-elif test `echo abc | tr a-z A-Z` = Abc ; then
- echo "Looks kind of like a USG system, but we'll see..."
- echo exit 0 >usg
-elif $contains SIGTSTP guess.txt >/dev/null 2>&1 ; then
- echo "Looks kind of like a BSD system, but we'll see..."
- 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"
- ;;
-*)
- echo " "
- echo "Congratulations. You aren't running Eunice."
- d_eunice="$undef"
- ;;
-esac
-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..."
-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 venix
-$eunicefix bsd usg v7 eunice venix
-
-: see what memory models we can support
-case "$models" in
-'')
- : We may not use Cppsym or we get a circular dependency through cc.
- : But this should work regardless of which cc we eventually use.
- 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
- 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 <<EOM
-
-Some systems have different model sizes. On most systems they are called
-small, medium, large, and huge. On the PDP11 they are called unsplit and
-split. If your system doesn't support different memory models, say "none".
-If you wish to force everything to one memory model, say "none" here and
-put the appropriate flags later when it asks you for other cc and ld flags.
-Venix systems may wish to put "none" and let the compiler figure things out.
-(In the following question multiple model names should be space separated.)
-
-EOM
-rp="Which models are supported? [$dflt]"
-$echo $n "$rp $c"
-. myread
-models="$ans"
-
-case "$models" in
-none)
- small=''
- medium=''
- large=''
- huge=''
- unsplit=''
- split=''
- ;;
-*split)
- case "$split" in
- '')
- if $contains '\-i' $mansrc/man1/ld.1 >/dev/null 2>&1 || \
- $contains '\-i' $mansrc/man1/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 "$models" 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 "$models" 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 "$models" 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 "$models" in
- *small*)
- case "$small" in
- '') dflt='none';;
- *) dflt="$small";;
- esac
- rp="What flag indicates small model? [$dflt]"
- $echo $n "$rp $c"
- . myread
- case "$ans" in
- none) ans='';
- esac
- small="$ans"
- ;;
- *) small='';;
- esac
- ;;
-*)
- echo "Unrecognized memory models--you may have to edit Makefile.SH"
- ;;
-esac
-
-: 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' $mansrc/cc.1 >/dev/null 2>&1 ; then
- dflt='cc -M'
- 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. What command will force resolution on
-EOM
- $echo $n "this system? [$dflt] $c"
- rp="Command to resolve multiple refs? [$dflt]"
- . myread
- cc="$ans"
-else
- case "$cc" in
- '') dflt=cc;;
- *) dflt="$cc";;
- esac
- rp="Use which C compiler? [$dflt]"
- $echo $n "$rp $c"
- . myread
- 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
- case "$gccflags" in
- *-ansi*) ;;
- *-traditional*) ;;
- *) gccflags="$gccflags -traditional -Dvolatile=__volatile__" ;;
- esac
- ;;
-esac
-
-: determine optimize, if desired, or use for debug flag also
-case "$optimize" in
-' ') dflt="none"
- ;;
-'') dflt="-O";
- ;;
-*) dflt="$optimize"
- ;;
-esac
-cat <<EOH
-
-Some C compilers have problems with their optimizers, by default, $package
-compiles with the -O flag to use the optimizer. Alternately, you might
-want to use the symbolic debugger, which uses the -g flag (on traditional
-Unix systems). Either flag can be specified here. To use neither flag,
-specify the word "none".
-
-EOH
-rp="What optimizer/debugger flag should be used? [$dflt]"
-$echo $n "$rp $c"
-. myread
-optimize="$ans"
-case "$optimize" in
-'none') optimize=" "
- ;;
-esac
-
-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
- if test "x$thisincl" != "x$usrinclude"; then
- case "$dflt" in
- *$thisincl*);;
- *) dflt="$dflt -I$thisincl";;
- esac
- fi
- fi
-done
-case "$optimize" in
--g*)
- case "$dflt" in
- *DEBUGGING*);;
- *) dflt="$dflt -DDEBUGGING";;
- esac
- ;;
-esac
-if $contains 'LANGUAGE_C' $usrinclude/signal.h >/dev/null 2>&1; then
- case "$dflt" in
- *LANGUAGE_C*);;
- *) dflt="$dflt -DLANGUAGE_C";;
- *) if osf1; then
- dflt="$dflt -D__LANGUAGE_C__"
- else
- dflt="$dflt -DLANGUAGE_C"
- fi
- ;;
- esac
-fi
-if $contains '_NO_PROTO' $usrinclude/signal.h >/dev/null 2>&1; then
- case "$dflt" in
- *_NO_PROTO*);;
- *) osf1 || dflt="$dflt -D_NO_PROTO";;
- esac
-fi
-case "$dflt" in
-'') dflt=none;;
-esac
-cat <<EOH
-
-Your C compiler may want other flags. For this question you should
-include -I/whatever and -DWHATEVER flags and any other flags used by
-the C compiler, but you should NOT include libraries or ld flags like
--lwhatever. For instance, this would be a good place to specify
--DDEBUGGING. To use no flags, specify the word "none".
-
-EOH
-rp="Any additional cc flags? [$dflt]"
-$echo $n "$rp $c"
-. myread
-case "$ans" in
-none) ans='';
-esac
-ccflags="$ans"
-
-: the following weeds options from ccflags that are of no interest to cpp
-cppflags="$ccflags"
-case "$cc" in
-*gcc*) cppflags="$cppflags -D__GNUC__";;
-esac
-case "$cppflags" in
-'');;
-*) set X $cppflags
- cppflags=''
- for flag do
- case $flag in
- -D*|-U*|-I*|-traditional|-ansi|-nostdinc) cppflags="$cppflags $flag";;
- esac
- done
- case "$cppflags" in
- *-*) echo "(C preprocessor flags: $cppflags)";;
- esac
- ;;
-esac
-
-case "$ldflags" in
-'') if venix; then
- dflt='-i -z'
- else
- dflt='none'
- fi
- ;;
-*) dflt="$ldflags";;
-esac
-echo " "
-rp="Any additional ld flags (NOT including libraries)? [$dflt]"
-$echo $n "$rp $c"
-. myread
-case "$ans" in
-none) ans='';
-esac
-ldflags="$ans"
-
-echo " "
-echo "Checking for optional libraries..."
-case "$libs" in
-'') dflt=' ';;
-*) dflt="$libs ";;
-esac
-case "$libswanted" in
-'') libswanted='c_s';;
-esac
-for thislib in $libswanted; do
- case "$thislib" in
- dbm) thatlib=ndbm;;
- *_s) thatlib=NONE;;
- *) thatlib="${thislib}_s";;
- *) thatlib=NONE;;
- esac
- xxx=`./loc lib$thislib.a X /usr/ccs/lib /usr/lib /usr/ucblib /usr/local/lib /lib`
- if test -f $xxx; then
- echo "Found -l$thislib."
- case "$dflt" in
- *-l$thislib\ *|*-l$thatlib\ *);;
- *) dflt="$dflt -l$thislib ";;
- esac
- else
- xxx=`./loc lib$thislib.a X $libpth`
- if test -f $xxx; then
- echo "Found $xxx."
- case "$dflt" in
- *"$xxx "*);;
- *) dflt="$dflt $xxx ";;
- esac
- else
- xxx=`./loc Slib$thislib.a X $xlibpth`
- if test -f $xxx; then
- echo "Found -l$thislib."
- case "$dflt" in
- *-l$thislib\ *|*-l$thatlib\ *);;
- *) dflt="$dflt -l$thislib ";;
- esac
- else
- xxx=`./loc lib$thislib.so X /usr/ccs/lib /usr/lib /usr/ucblib /usr/local/lib /lib`
- if test -f $xxx; then
- echo "Found -l$thislib as a shared object only."
- case "$dflt" in
- *-l$thislib\ *|*-l$thatlib\ *);;
- *) dflt="$dflt -l$thislib ";;
- esac
- else
- echo "No -l$thislib."
- fi
- fi
- fi
- fi
-done
-set X $dflt
-shift
-dflt="$*"
-case "$dflt" in
-'') dflt='none';;
-esac
-
-$cat <<EOM
-
-Some versions of Unix support shared libraries, which make
-executables smaller but make load time slightly longer.
-
-On some systems, mostly newer Unix System V's, the shared library
-is included by putting the option "-lc_s" as the last thing on the
-cc command line when linking. Other systems use shared libraries
-by default. There may be other libraries needed to compile $package
-on your machine as well. If your system needs the "-lc_s" option,
-include it here. Include any other special libraries here as well.
-Say "none" for none.
-EOM
-
-echo " "
-rp="Any additional libraries? [$dflt]"
-$echo $n "$rp $c"
-. myread
-case "$ans" in
-none) ans='';
-esac
-libs="$ans"
-
-: check for size of random number generator
-echo " "
-case "$alignbytes" in
-'')
- echo "Checking alignment constraints..."
- $cat >try.c <<'EOCP'
-struct foobar {
- char foo;
- double bar;
-} try;
-main()
-{
- printf("%d\n", (char*)&try.bar - (char*)&try.foo);
-}
-EOCP
- if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then
- dflt=`./try`
- else
- dflt='?'
- echo "(I can't seem to compile the test program...)"
- fi
- ;;
-*)
- dflt="$alignbytes"
- ;;
-esac
-rp="Doubles must be aligned on a how-many-byte boundary? [$dflt]"
-$echo $n "$rp $c"
-. myread
-alignbytes="$ans"
-$rm -f try.c try
-
-: determine where public executables go
-cat <<EOF
-
-The following questions distinguish the directory in which executables
-reside from the directory in which they are installed (and from which they
-are presumably copied to the former directory by occult means). This
-distinction is often necessary under afs. On most other systems, however,
-the two directories are the same.
-
-EOF
-case "$bin" in
-'')
- dflt=`./loc . /usr/local/bin /usr/local/bin /usr/lbin /usr/local /usr/bin /bin`
- ;;
-*) dflt="$bin"
- ;;
-esac
-cont=true
-while $test "$cont" ; do
- rp="In which directory will public executables reside (~name ok)? [$dflt]"
- $echo "In which directory will public executables reside (~name ok)?"
- $echo $n "[$dflt] $c"
- . myread
- bin="$ans"
- bin=`./filexp $bin`
- if test -d $bin; then
- cont=''
- else
- case "$fastread" in
- yes) dflt=y;;
- *) dflt=n;;
- esac
- 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
-
-case "$bin" in
- ?????????????????????????)
- cat <<EOF
-
-NOTE: you have a fairly long path name there. Some systems have trouble
-executing a script if the #! line ends up longer than 32 characters. If
-you have this trouble you may have to reinstall somewhere else, or make
-a symbolic link from someplace with a shorter name.
-
-EOF
- ;;
-esac
-
-case "$installbin" in
-'')
- dflt=`echo $bin | sed 's#^/afs/#/afs/.#'`
- test -d $dflt || dflt="$bin"
- ;;
-*) dflt="$installbin"
- ;;
-esac
-cont=true
-while $test "$cont" ; do
- rp="In which directory will public executables be installed (~name ok)? [$dflt]"
- $echo "In which directory will public executables be installed (~name ok)?"
- $echo $n "[$dflt] $c"
- . myread
- installbin="$ans"
- installbin=`./filexp $installbin`
- if test -d $installbin; then
- cont=''
- else
- case "$fastread" in
- yes) dflt=y;;
- *) dflt=n;;
- esac
- rp="Directory $installbin doesn't exist. Use that name anyway? [$dflt]"
- $echo $n "$rp $c"
- . myread
- dflt=''
- case "$ans" in
- y*) cont='';;
- esac
- fi
-done
-
-: check for ordering of bytes in a long
-case "$byteorder" in
-'')
-cat <<'EOM'
-
-In the following, larger digits indicate more significance. A big-endian
-machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
-little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
-machines may have weird orders like 3412. A Cray will report 87654321. If
-the test program works the default is probably right.
-I'm now running the test program...
-EOM
- $cat >byteorder.c <<'EOCP'
-#include <stdio.h>
-main()
-{
- int i;
- union {
- unsigned long l;
- char c[sizeof(long)];
- } u;
-
- if (sizeof(long) > 4)
- u.l = (0x08070605L << 32) | 0x04030201L;
- else
- u.l = 0x04030201L;
- for (i=0; i < sizeof(long); i++)
- printf("%c",u.c[i]+'0');
- printf("\n");
-}
-EOCP
- if $cc byteorder.c -o byteorder >/dev/null 2>&1 ; then
- dflt=`./byteorder`
- case "$dflt" in
- ????|????????) echo "(The test program ran ok.)";;
- *) echo "(The test program didn't run right for some reason.)";;
- esac
- else
- dflt='4321'
- echo "(I can't seem to compile the test program. Guessing big-endian...)"
- fi
- ;;
-*)
- echo " "
- dflt="$byteorder"
- ;;
-esac
-rp="What is the order of bytes in a long? [$dflt]"
-$echo $n "$rp $c"
-. myread
-byteorder="$ans"
-
-: check for ability to cast negative floats to unsigned
-echo " "
-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;
- unsigned long along;
- unsigned int aint;
- unsigned short ashort;
- int result = 0;
-
- signal(SIGFPE, blech);
- along = (unsigned long)f;
- aint = (unsigned int)f;
- ashort = (unsigned short)f;
- if (along != (unsigned long)-123)
- result |= 1;
- if (aint != (unsigned int)-123)
- result |= 1;
- if (ashort != (unsigned short)-123)
- result |= 1;
- f = (double)0x40000000;
- f = f + f;
- along = 0;
- along = (unsigned long)f;
- if (along != 0x80000000)
- result |= 2;
- f -= 1;
- along = 0;
- along = (unsigned long)f;
- if (along != 0x7fffffff)
- result |= 1;
- f += 2;
- along = 0;
- along = (unsigned long)f;
- if (along != 0x80000001)
- result |= 2;
- exit(result);
-}
-EOCP
-if $cc -o try $ccflags try.c >/dev/null 2>&1; then
- ./try
- castflags=$?
-else
- castflags=3
-fi
-case "$castflags" in
-0) val="$define"
- echo "Yup, it does."
- ;;
-*) val="$undef"
- echo "Nope, it doesn't."
- ;;
-esac
-set d_castneg
-eval $setvar
-$rm -f try.*
-
-: see how we invoke the C preprocessor
-echo " "
-echo "Now, how can we feed standard input to your C preprocessor..."
-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=cppstdin
-
-case "$cppstdin" in
-/*cppstdin) cppstdin=cppstdin;;
-esac
-cp cppstdin UU
-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 '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 '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 '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
- 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 and rerun Configure."
- exit 1
- fi
-fi
-
-: get list of predefined functions in a handy place
-echo " "
-case "$libc" in
-'') libc=unknown;;
-esac
-case "$nm_opts" in
-'') if test -f /mach_boot; then
- nm_opts=''
- elif test -d /usr/ccs/lib; then
- nm_opts='-p'
- else
- nm_opts=''
- fi
- ;;
-esac
-: on mips, we DO NOT want /lib, and we want inclPath/usr/lib
-case "$libpth" in
-'') if mips; then
- libpth='$inclPath/usr/lib /usr/local/lib'
- nm_opts="-B"
- else
- libpth='/usr/ccs/lib /lib /usr/lib /usr/ucblib /usr/local/lib'
- fi
- ;;
-esac
-case "$libs" in
-*-lc_s*) libc=`./loc libc_s.a $libc $libpth`
-esac
-libnames='';
-case "$libs" in
-'') ;;
-*) for thislib in $libs; do
- case "$thislib" in
- -l*) thislib=`expr X$thislib : 'X-l\(.*\)'`
- try=`./loc lib$thislib.a blurfl/dyick $libpth`
- if test ! -f $try; then
- try=`./loc lib$thislib blurfl/dyick $libpth`
- if test ! -f $try; then
- try=`./loc $thislib blurfl/dyick $libpth`
- if test ! -f $try; then
- try=`./loc Slib$thislib.a blurfl/dyick $xlibpth`
- if test ! -f $try; then
- try=''
- fi
- fi
- fi
- fi
- libnames="$libnames $try"
- ;;
- *) libnames="$libnames $thislib" ;;
- esac
- done
- ;;
-esac
-set /usr/ccs/lib/libc.so
-test -f $1 || set /usr/lib/libc.so
-test -f $1 || set /usr/shlib/libc.so
-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 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
- :
- elif ans=`./loc libc blurfl/dyick $libpth`; test -f "$ans"; then
- libnames="$libnames "`./loc clib blurfl/dyick $libpth`
- elif ans=`./loc clib blurfl/dyick $libpth`; test -f "$ans"; then
- :
- elif ans=`./loc Slibc.a blurfl/dyick $xlibpth`; test -f "$ans"; then
- :
- elif ans=`./loc Mlibc.a blurfl/dyick $xlibpth`; test -f "$ans"; then
- :
- elif ans=`./loc Llibc.a blurfl/dyick $xlibpth`; test -f "$ans"; then
- :
- fi
- if test -f "$ans"; then
- echo "Your C library seems to be in $ans, of all places."
- libc=$ans
- else
- cat <<EOM
-
-I can't seem to find your C library. I've looked in the following places:
-
- $libpth
-
-None of these seems to contain your C library. What is the full name
-EOM
- dflt=None
- $echo $n "of your C library? $c"
- rp='C library full name?'
- . myread
- libc="$ans"
- fi
-fi
-echo " "
-if test $libc = "/lib/libc"; then
- libc="$libc /lib/clib"
-fi
-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
- echo done
-elif $sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p' \
- <libc.tmp >libc.list; \
- $contains '^printf$' libc.list >/dev/null 2>&1; then
- echo done
-elif $sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p' <libc.tmp >libc.list; \
- $contains '^printf$' libc.list >/dev/null 2>&1; then
- echo done
-elif $sed -n -e 's/^.* D __*//p' -e 's/^.* D //p' <libc.tmp >libc.list; \
- $contains '^printf$' libc.list >/dev/null 2>&1; then
- echo done
-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' -e '/ file/d' \
- -e 's/^\([^ ]*\).*/\1/p' >libc.list
- $contains '^printf$' libc.list >/dev/null 2>&1; then
- echo done
-elif $sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p' \
- <libc.tmp >libc.list; \
- $contains '^printf$' libc.list >/dev/null 2>&1; then
- echo done
-elif $sed -n -e 's/^[ ]*[0-9][0-9a-f]*[ ]*Def. Text[ ]*//p' \
- < libc.tmp | $sed -e 's/\[.*\]//' > libc.list; \
- $contains '^printf$' libc.list >/dev/null 2>&1; then
- echo done
-else
- nm -p $* 2>/dev/null >libc.tmp
- $sed -n -e 's/^.* [AT] *_[_.]*//p' -e 's/^.* [AT] //p' <libc.tmp >libc.list
- if $contains '^printf$' libc.list >/dev/null 2>&1; then
- nm_opts='-p'
- echo "done"
- else
- echo " "
- echo "nm didn't seem to work right."
- echo "Trying ar instead..."
- 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."
- else
- echo "ar didn't seem to work right."
- echo "Maybe this is a Cray...trying bld instead..."
- 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."
- else
- echo "That didn't work either. Giving up."
- exit 1
- fi
- 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";
- eval "case \"\$$2\" in undef) . whoa; esac"; eval "$2=\$td";
-else echo "$1() NOT found";
- eval "case \"\$$2\" in define) . whoa; esac"; eval "$2=\$tu"; fi'
-
-: see if bcmp exists
-set bcmp d_bcmp
-eval $inlibc
-
-: see if bcopy exists
-set bcopy d_bcopy
-eval $inlibc
-
-case "$d_safebcpy" in
-'')
- : assume the worst
- d_safebcpy=undef
- case "$d_bcopy" in
- define)
- echo "Checking to see if your bcopy() can do overlapping copies..."
- $cat >safebcpy.c <<'EOCP'
-main()
-{
- char buf[128];
- register char *b;
- register int len;
- register int off;
- register int align;
-
- for (align = 7; align >= 0; align--) {
- for (len = 36; len; len--) {
- b = buf+align;
- bcopy("abcdefghijklmnopqrstuvwxyz0123456789", b, len);
- for (off = 1; off <= len; off++) {
- bcopy(b, b+off, len);
- bcopy(b+off, b, len);
- if (bcmp(b, "abcdefghijklmnopqrstuvwxyz0123456789", len))
- exit(1);
- }
- }
- }
- exit(0);
-}
-EOCP
- if $cc safebcpy.c -o safebcpy $ccflags $libs >/dev/null 2>&1 ; then
- if ./safebcpy; then
- echo "It can."
- d_safebcpy=define
- else
- echo "It can't."
- fi
- else
- echo "(I can't compile the test program, so we'll assume not...)"
- fi
- ;;
- esac
- ;;
-esac
-
-: see if bzero exists
-set bzero d_bzero
-eval $inlibc
-
-: see if sprintf is declared as int or pointer to char
-echo " "
-cat >ucbsprf.c <<'EOF'
-#include <stdio.h>
-main()
-{
- int sprintf();
- char buf[10];
- exit((unsigned long)sprintf(buf,"%s","foo") > 10L);
-}
-EOF
-if $cc $ccflags ucbsprf.c -o ucbsprf >/dev/null 2>&1 && ./ucbsprf; then
- echo "Your sprintf() returns (int)."
- val="$undef"
-else
- echo "Your sprintf() returns (char*)."
- val="$define"
-fi
-set d_charsprf
-eval $setvar
-
-: see if vprintf exists
-echo " "
-if $contains '^vprintf$' libc.list >/dev/null 2>&1; then
- echo 'vprintf() found.'
- val="$define"
- cat >vprintf.c <<'EOF'
-#include <varargs.h>
-
-main() { xxx("foo"); }
-
-xxx(va_alist)
-va_dcl
-{
- va_list args;
- char buf[10];
-
- va_start(args);
- exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
-}
-EOF
- if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then
- echo "Your vsprintf() returns (int)."
- val2="$undef"
- else
- echo "Your vsprintf() returns (char*)."
- val2="$define"
- fi
-else
- echo 'vprintf() NOT found.'
- val="$undef"
- val2="$undef"
-fi
-set d_vprintf
-eval $setvar
-val=$val2
-set d_charvspr
-eval $setvar
-
-: see if chsize exists
-set chsize d_chsize
-eval $inlibc
-
-: see if crypt exists
-echo " "
-if $contains '^crypt$' libc.list >/dev/null 2>&1; then
- echo 'crypt() found.'
- val="$define"
- cryptlib=''
-else
- cryptlib=`./loc Slibcrypt.a "" $xlibpth`
- if $test -z "$cryptlib"; then
- cryptlib=`./loc Mlibcrypt.a "" $xlibpth`
- else
- cryptlib=-lcrypt
- fi
- if $test -z "$cryptlib"; then
- cryptlib=`./loc Llibcrypt.a "" $xlibpth`
- else
- cryptlib=-lcrypt
- fi
- if $test -z "$cryptlib"; then
- cryptlib=`./loc libcrypt.a "" $libpth`
- else
- cryptlib=-lcrypt
- fi
- if $test -z "$cryptlib"; then
- echo 'crypt() NOT found.'
- val="$undef"
- else
- val="$define"
- fi
-fi
-set d_crypt
-eval $setvar
-
-: get csh whereabouts
-case "$csh" in
-'csh') val="$undef" ;;
-*) val="$define" ;;
-esac
-set d_csh
-eval $setvar
-
-: see if readdir exists
-set readdir d_readdir
-eval $inlibc
-
-: see if there are directory access routines out there
-echo " "
-xxx=`./loc ndir.h x $usrinclude /usr/local/include $inclwanted`
-case "$xxx" in
-x)
- xxx=`./loc sys/ndir.h x $usrinclude /usr/local/include $inclwanted`
- ;;
-esac
-D_dirnamlen="$undef"
-I_dirent="$undef"
-I_sys_dir="$undef"
-I_my_dir="$undef"
-I_ndir="$undef"
-I_sys_ndir="$undef"
-libndir=''
-ndirc=''
-ndiro=''
-if $test -r $usrinclude/dirent.h; then
- echo "dirent.h found."
- if $contains 'd_namlen' $usrinclude/dirent.h >/dev/null 2>&1; then
- D_dirnamlen="$define"
- fi
- I_dirent="$define"
-elif $test -r $xxx; then
- echo "You seem to use <$xxx>,"
- if $test "$d_readdir" = "$define"; then
- echo "and I can get readdir() from your C library."
- elif $test -r /usr/lib/libndir.a || $test -r /usr/local/lib/libndir.a; then
- echo "and I'll get the routines using -lndir ."
- libndir='-lndir'
- else
- ans=`./loc libndir.a x $libpth`
- case "$ans" in
- x)
- echo "but I can't find the ndir library!"
- ;;
- *)
- echo "and I found the directory library in $ans."
- libndir="$ans"
- ;;
- esac
- fi
- if $contains 'd_namlen' $xxx >/dev/null 2>&1; then
- D_dirnamlen="$define"
- fi
- case "$xxx" in
- sys/)
- I_sys_ndir="$define"
- ;;
- *)
- I_ndir="$define"
- ;;
- esac
-else
- : The next line used to require this to be a bsd system.
- if $contains '^readdir$' libc.list >/dev/null 2>&1 ; then
- echo "No ndir library found, but you have readdir() so we'll use that."
- if $contains 'd_namlen' $usrinclude/sys/dir.h >/dev/null 2>&1; then
- D_dirnamlen="$define"
- fi
- I_sys_dir="$define"
- else
- echo "No ndir library found--using ./$d_ndir.c."
-: This will lose since $d_ndir.h is in another directory.
-: I doubt we can rely on it being in ../$d_ndir.h .
-: At least it will fail in a conservative manner.
- if $contains 'd_namlen' $d_ndir.h >/dev/null 2>&1; then
- D_dirnamlen="$define"
- fi
- I_my_dir="$define"
- ndirc="$d_ndir.c"
- ndiro="$d_ndir.o"
- fi
-fi
-val=$D_dirnamlen; set d_dirnamlen; eval $setvar
-val=$I_dirent; set i_dirent; eval $setvar
-val=$I_sys_dir; set i_sys_dir; eval $setvar
-val=$I_my_dir; set i_my_dir; eval $setvar
-val=$I_ndir; set i_ndir; eval $setvar
-val=$I_sys_ndir; set i_sys_ndir; eval $setvar
-
-: now see if they want to do setuid emulation
-case "$d_dosuid" in
-'') dflt=n;;
-*undef*) dflt=n;;
-*) dflt=y;;
-esac
-cat <<EOM
-
-Some sites have disabled setuid #! scripts because of a bug in the kernel
-that prevents them from being secure. If you are on such a system, the
-setuid/setgid bits on scripts are currently useless. It is possible for
-$package to detect those bits and emulate setuid/setgid in a secure fashion
-until a better solution is devised for the kernel problem.
-
-EOM
-rp="Do you want to do setuid/setgid emulation? [$dflt]"
-$echo $n "$rp $c"
-. myread
-case "$ans" in
-'') $ans="$dflt";;
-esac
-case "$ans" in
-y*) d_dosuid="$define";;
-*) d_dosuid="$undef";;
-esac
-
-: see if dup2 exists
-set dup2 d_dup2
-eval $inlibc
-
-: see if fchmod exists
-set fchmod d_fchmod
-eval $inlibc
-
-: see if fchown exists
-set fchown d_fchown
-eval $inlibc
-
-: see if this is an fcntl system
-set fcntl d_fcntl
-eval $inlibc
-
-: see if we can have long filenames
-echo " "
-rm -f 123456789abcde
-if (echo hi >123456789abcdef) 2>/dev/null; then
- : not version 8
- if test -f 123456789abcde; then
- echo 'You cannot have filenames longer than 14 characters. Sigh.'
- val="$undef"
- else
- echo 'You can have filenames longer than 14 characters.'
- val="$define"
- fi
-else
- : version 8 probably
- echo "You can't have filenames longer than 14 chars. You can't even think about them!"
- val="$undef"
-fi
-set d_flexfnam
-eval $setvar
-
-: see if flock exists
-set flock d_flock
-eval $inlibc
-
-: see if getgroups exists
-set getgroups d_getgrps
-eval $inlibc
-
-: see if gethostent exists
-set gethostent d_gethent
-eval $inlibc
-
-: see if getpgrp exists
-set getpgrp d_getpgrp
-eval $inlibc
-
-: see if getpgrp2 exists
-set getpgrp2 d_getpgrp2
-eval $inlibc
-
-: see if getpriority exists
-set getpriority d_getprior
-eval $inlibc
-
-: see if htonl exists
-set htonl d_htonl
-eval $inlibc
-
-: index or strcpy
-echo " "
-case "$d_index" in
-undef) dflt=y;;
-define) dflt=n;;
-*) if $test -f /unix; then
- dflt=n
- else
- dflt=y
- fi
- ;;
-esac
-if $contains '^index$' libc.list >/dev/null 2>&1 ; then
- if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
- echo "Your system has both index() and strchr(). Shall I use"
- rp="index() rather than strchr()? [$dflt]"
- $echo $n "$rp $c"
- . myread
- case "$ans" in
- n*) d_index="$define" ;;
- *) d_index="$undef" ;;
- esac
- else
- d_index="$undef"
- echo "index() found."
- fi
-else
- if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
- d_index="$define"
- echo "strchr() found."
- else
- echo "No index() or strchr() found!"
- d_index="$undef"
- fi
-fi
-
-: see if isascii exists
-set isascii d_isascii
-eval $inlibc
-
-: see if killpg exists
-set killpg d_killpg
-eval $inlibc
-
-: see if lstat exists
-set lstat d_lstat
-eval $inlibc
-
-: see if memcmp exists
-set memcmp d_memcmp
-eval $inlibc
-
-: see if memcpy exists
-set memcpy d_memcpy
-eval $inlibc
-
-case "$d_safemcpy" in
-'')
- : assume the worst
- d_safemcpy=undef
- case "$d_memcpy" in
- define)
- echo "Checking to see if your memcpy() can do overlapping copies..."
- $cat >safemcpy.c <<'EOCP'
-main()
-{
- char buf[128];
- register char *b;
- register int len;
- register int off;
- register int align;
-
- for (align = 7; align >= 0; align--) {
- for (len = 36; len; len--) {
- b = buf+align;
- memcpy(b,"abcdefghijklmnopqrstuvwxyz0123456789", len);
- for (off = 1; off <= len; off++) {
- memcpy(b+off, b, len);
- memcpy(b, b+off, len);
- if (memcmp(b, "abcdefghijklmnopqrstuvwxyz0123456789", len))
- exit(1);
- }
- }
- }
- exit(0);
-}
-EOCP
- if $cc safemcpy.c -o safemcpy $ccflags $libs >/dev/null 2>&1 ; then
- if ./safemcpy; then
- echo "It can."
- d_safemcpy=define
- else
- echo "It can't."
- fi
- else
- echo "(I can't compile the test program, so we'll assume not...)"
- fi
- ;;
- esac
- ;;
-esac
-
-: see if memmove exists
-set memmove d_memmove
-eval $inlibc
-
-: see if memset exists
-set memset d_memset
-eval $inlibc
-
-: see if mkdir exists
-set mkdir d_mkdir
-eval $inlibc
-
-: see if msgctl exists
-set msgctl d_msgctl
-eval $inlibc
-
-: see if msgget exists
-set msgget d_msgget
-eval $inlibc
-
-: see if msgsnd exists
-set msgsnd d_msgsnd
-eval $inlibc
-
-: see if msgrcv exists
-set msgrcv d_msgrcv
-eval $inlibc
-
-: see how much of the 'msg*(2)' library is present.
-h_msg=true
-echo " "
-case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
-*undef*) h_msg=false;;
-esac
-: we could also check for sys/ipc.h ...
-if $h_msg && $test -r $usrinclude/sys/msg.h; then
- echo "You have the full msg*(2) library."
- val="$define"
-else
- echo "You don't have the full msg*(2) library."
- val="$undef"
-fi
-set d_msg
-eval $setvar
-
-: determine which malloc to compile in
-echo " "
-case "$d_mymalloc" in
-'')
- case "$usemymalloc" in
- '')
- if bsd || v7; then
- dflt='y'
- else
- dflt='n'
- fi
- ;;
- n*) dflt=n;;
- *) dflt=y;;
- esac
- ;;
-define) dflt="y"
- ;;
-*) dflt="n"
- ;;
-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;;
-esac
-case "$ans" in
-y*) mallocsrc='malloc.c'; mallocobj='malloc.o'
- libs=`echo $libs | sed 's/-lmalloc//'`
- val="$define"
- 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
- mallocptrtype=void
- else
- mallocptrtype=char
- fi
- ;;
- esac
- echo " "
- echo "Your system wants malloc to return $mallocptrtype*, it would seem."
- ;;
-*) mallocsrc='';
- mallocobj='';
- mallocptrtype=void
- val="$undef"
- ;;
-esac
-set d_mymalloc
-eval $setvar
-
-: see if ndbm is available
-echo " "
-xxx=`./loc ndbm.h x $usrinclude /usr/local/include $inclwanted`
-if test -f $xxx; then
- val="$define"
- echo "ndbm.h found."
-else
- val="$undef"
- echo "ndbm.h NOT found."
-fi
-set d_ndbm
-eval $setvar
-
-: see if we have the old dbm
-echo " "
-xxx=`./loc dbm.h x $usrinclude /usr/local/include $inclwanted`
-if test -f $xxx; then
- val="$define"
- echo "dbm.h found."
-else
- val="$undef"
- echo "dbm.h NOT found."
-fi
-set d_odbm
-eval $setvar
-
-: see whether socket exists
-echo " "
-socketlib=''
-if $contains socket libc.list >/dev/null 2>&1; then
- echo "Looks like you have Berkeley networking support."
- val="$define"
- : now check for advanced features
- if $contains setsockopt libc.list >/dev/null 2>&1; then
- val2="$undef"
- else
- echo "...but it uses the old 4.1c interface, rather than 4.2"
- val2="$define"
- fi
-else
- : hpux, for one, puts all the socket stuff in socklib.o
- if $contains socklib libc.list >/dev/null 2>&1; then
- echo "Looks like you have Berkeley networking support."
- val="$define"
- : we will have to assume that it supports the 4.2 BSD interface
- val2="$undef"
- else
- echo "Hmmm...you don't have Berkeley networking in libc.a..."
- : look for an optional networking library
- if test -f /usr/lib/libnet.a; then
- (ar t /usr/lib/libnet.a ||
- nm -g /usr/lib/libnet.a) 2>/dev/null >> libc.list
- if $contains socket libc.list >/dev/null 2>&1; then
- echo "but the Wollongong group seems to have hacked it in."
- socketlib="-lnet -lnsl_s"
- val="$define"
- : now check for advanced features
- if $contains setsockopt libc.list >/dev/null 2>&1; then
- val2="$undef"
- else
- echo "...using the old 4.1c interface, rather than 4.2"
- val2="$define"
- fi
- else
- echo "or even in libnet.a, which is peculiar."
- val="$undef"
- val2="$undef"
- fi
- else
- echo "or anywhere else I see."
- val="$undef"
- val2="$undef"
- fi
- fi
-fi
-set d_socket
-eval $setvar
-
-if $contains socketpair libc.list >/dev/null 2>&1; then
- val="$define"
-else
- val="$undef"
-fi
-set d_sockpair
-eval $setvar
-val=$val2
-set d_oldsock
-eval $setvar
-
-: Locate the flags for 'open()'
-echo " "
-$cat >open3.c <<'EOCP'
-#include <sys/types.h>
-#ifdef I_FCNTL
-#include <fcntl.h>
-#endif
-#ifdef I_SYS_FILE
-#include <sys/file.h>
-#endif
-main() {
-
- if(O_RDONLY);
-
-#ifdef O_TRUNC
- exit(0);
-#else
- exit(1);
-#endif
-}
-EOCP
-: check sys/file.h first to get FREAD on Sun
-if $test -r $usrinclude/sys/file.h && \
- $cc $cppflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then
- h_sys_file=true;
- echo "sys/file.h defines the O_* constants..."
- if ./open3; then
- echo "and you have the 3 argument form of open()."
- val="$define"
- else
- echo "but not the 3 argument form of open(). Oh, well."
- val="$undef"
- fi
-elif $test -r $usrinclude/fcntl.h && \
- $cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then
- h_fcntl=true;
- echo "fcntl.h defines the O_* constants..."
- if ./open3; then
- echo "and you have the 3 argument form of open()."
- val="$define"
- else
- echo "but not the 3 argument form of open(). Oh, well."
- val="$undef"
- fi
-else
- val="$undef"
- echo "I can't find the O_* constant definitions! You got problems."
-fi
-set d_open3
-eval $setvar
-
-: see if how pwd stuff is defined
-echo " "
-if $test -r $usrinclude/pwd.h ; then
- i_pwd="$define"
- echo "pwd.h found."
- $cppstdin $cppflags $cppminus <$usrinclude/pwd.h | \
- sed -n '/struct[ ][ ]*passwd/,/^};/p' >pwd.txt
- if $contains 'pw_quota' pwd.txt >/dev/null 2>&1; then
- d_pwquota="$define"
- else
- d_pwquota="$undef"
- fi
- if $contains 'pw_age' pwd.txt >/dev/null 2>&1; then
- d_pwage="$define"
- else
- d_pwage="$undef"
- fi
- if $contains 'pw_change' pwd.txt >/dev/null 2>&1; then
- d_pwchange="$define"
- else
- d_pwchange="$undef"
- fi
- if $contains 'pw_class' pwd.txt >/dev/null 2>&1; then
- d_pwclass="$define"
- else
- d_pwclass="$undef"
- fi
- if $contains 'pw_expire' pwd.txt >/dev/null 2>&1; then
- d_pwexpire="$define"
- else
- d_pwexpire="$undef"
- fi
- if $contains 'pw_comment' pwd.txt >/dev/null 2>&1; then
- d_pwcomment="$define"
- else
- d_pwcomment="$undef"
- fi
-else
- i_pwd="$undef"
- d_pwquota="$undef"
- d_pwage="$undef"
- d_pwchange="$undef"
- d_pwclass="$undef"
- d_pwexpire="$undef"
- d_pwcomment="$undef"
- echo "No pwd.h found."
-fi
-
-: see if rename exists
-set rename d_rename
-eval $inlibc
-
-: see if rewindir exists
-set rewinddir d_rewindir
-eval $inlibc
-
-: see if rmdir exists
-set rmdir d_rmdir
-eval $inlibc
-
-: see if seekdir exists
-set seekdir d_seekdir
-eval $inlibc
-
-: see if select exists
-set select d_select
-eval $inlibc
-
-: see if semctl exists
-set semctl d_semctl
-eval $inlibc
-
-: see if semget exists
-set semget d_semget
-eval $inlibc
-
-: see if semop exists
-set semop d_semop
-eval $inlibc
-
-: see how much of the 'sem*(2)' library is present.
-h_sem=true
-echo " "
-case "$d_semctl$d_semget$d_semop" in
-*undef*) h_sem=false;;
-esac
-: we could also check for sys/ipc.h ...
-if $h_sem && $test -r $usrinclude/sys/sem.h; then
- echo "You have the full sem*(2) library."
- val="$define"
-else
- echo "You don't have the full sem*(2) library."
- val="$undef"
-fi
-set d_sem
-eval $setvar
-
-: see if setegid exists
-set setegid d_setegid
-eval $inlibc
-
-: see if seteuid exists
-set seteuid d_seteuid
-eval $inlibc
-
-: see if setpgrp exists
-set setpgrp d_setpgrp
-eval $inlibc
-
-: see if setpgrp2 exists
-set setpgrp2 d_setpgrp2
-eval $inlibc
-
-: see if setpriority exists
-set setpriority d_setprior
-eval $inlibc
-
-: see if setregid exists
-set setregid d_setregid
-eval $inlibc
-set setresgid d_setresgid
-eval $inlibc
-
-: see if setreuid exists
-set setreuid d_setreuid
-eval $inlibc
-set setresuid d_setresuid
-eval $inlibc
-
-: see if setrgid exists
-set setrgid d_setrgid
-eval $inlibc
-
-: see if setruid exists
-set setruid d_setruid
-eval $inlibc
-
-: see if shmctl exists
-set shmctl d_shmctl
-eval $inlibc
-
-: see if shmget exists
-set shmget d_shmget
-eval $inlibc
-
-: see if shmat exists
-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
-
-: see how much of the 'shm*(2)' library is present.
-h_shm=true
-echo " "
-case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
-*undef*) h_shm=false;;
-esac
-: we could also check for sys/ipc.h ...
-if $h_shm && $test -r $usrinclude/sys/shm.h; then
- echo "You have the full shm*(2) library."
- val="$define"
-else
- echo "You don't have the full shm*(2) library."
- val="$undef"
-fi
-set d_shm
-eval $setvar
-
-: see if stat knows about block sizes
-echo " "
-if $contains 'st_blocks;' $usrinclude/sys/stat.h >/dev/null 2>&1 ; then
- if $contains 'st_blksize;' $usrinclude/sys/stat.h >/dev/null 2>&1 ; then
- echo "Your stat knows about block sizes."
- val="$define"
- else
- echo "Your stat doesn't know about block sizes."
- val="$undef"
- fi
-else
- echo "Your stat doesn't know about block sizes."
- val="$undef"
-fi
-set d_statblks
-eval $setvar
-
-: see if stdio is really std
-echo " "
-if $contains 'char.*_ptr.*;' $usrinclude/stdio.h >/dev/null 2>&1 ; then
- if $contains '_cnt;' $usrinclude/stdio.h >/dev/null 2>&1 ; then
- echo "Your stdio is pretty std."
- val="$define"
- else
- echo "Your stdio isn't very std."
- val="$undef"
- fi
-else
- echo "Your stdio isn't very std."
- val="$undef"
-fi
-set d_stdstdio
-eval $setvar
-
-: check for structure copying
-echo " "
-echo "Checking to see if your C compiler can copy structs..."
-$cat >strctcpy.c <<'EOCP'
-main()
-{
- struct blurfl {
- int dyick;
- } foo, bar;
-
- foo = bar;
-}
-EOCP
-if $cc -c strctcpy.c >/dev/null 2>&1 ; then
- val="$define"
- echo "Yup, it can."
-else
- val="$undef"
- echo "Nope, it can't."
-fi
-set d_strctcpy
-eval $setvar
-
-: see if strerror exists
-set strerror d_strerror
-eval $inlibc
-
-: see if symlink exists
-set symlink d_symlink
-eval $inlibc
-
-: see if syscall exists
-set syscall d_syscall
-eval $inlibc
-
-: set if package uses struct tm
-w_s_tm=1
-
-: set if package uses struct timeval
-case "$d_select" in
-define) w_s_timevl=1 ;;
-esac
-
-: set if package uses localtime function
-w_localtim=1
-
-: see which of time.h, sys/time.h, and sys/select should be included.
-idefs=''
-cat <<'EOM'
-
-Testing to see which of <time.h>, <sys/time.h>, and <sys/select.h>
-should be included, because this application wants:
-
-EOM
-case "$w_s_itimer" in
-1)
- echo " struct itimerval"
- idefs="-DS_ITIMERVAL $idefs"
- ;;
-esac
-case "$w_s_timevl" in
-1)
- echo " struct timeval"
- idefs="-DS_TIMEVAL $idefs"
- ;;
-esac
-case "$w_s_tm" in
-1)
- echo " struct tm"
- idefs="-DS_TM $idefs"
- ;;
-esac
-case "$w_localtim" in
-1)
- echo " ctime(3) declarations"
- idefs="-DD_CTIME $idefs"
- ;;
-esac
-case "$idefs" in
-'')
- echo " (something I don't know about)"
- ;;
-esac
-echo " "
-echo "I'm now running the test program..."
-$cat >i_time.c <<'EOCP'
-#include <sys/types.h>
-#ifdef I_TIME
-#include <time.h>
-#endif
-#ifdef I_SYS_TIME
-#ifdef SYSTIMEKERNEL
-#define KERNEL
-#endif
-#include <sys/time.h>
-#endif
-#ifdef I_SYS_SELECT
-#include <sys/select.h>
-#endif
-main()
-{
- struct tm foo;
- struct tm *tmp;
-#ifdef S_TIMEVAL
- struct timeval bar;
-#endif
-#ifdef S_ITIMERVAL
- struct itimerval baz;
-#endif
-
- if (foo.tm_sec == foo.tm_sec)
- exit(0);
-#ifdef S_TIMEVAL
- if (bar.tv_sec == bar.tv_sec)
- exit(0);
-#endif
-#ifdef S_ITIMERVAL
- if (baz.it_interval == baz.it_interval)
- exit(0);
-#endif
-#ifdef S_TIMEVAL
- if (bar.tv_sec == bar.tv_sec)
- exit(0);
-#endif
-#ifdef D_CTIME
- /* this might not do anything for us... */
- tmp = localtime((time_t *)0);
-#endif
- exit(1);
-}
-EOCP
-flags=''
-for i_sys_select in '' '-DI_SYS_SELECT'; do
- for d_systimekernel in '' '-DSYSTIMEKERNEL'; do
- for i_time in '' '-DI_TIME'; do
- for i_systime in '-DI_SYS_TIME' ''; do
- case "$flags" in
- '') echo Trying $i_time $i_systime $d_systimekernel $i_sys_select
- if $cc $ccflags $idefs \
- $i_time $i_systime $d_systimekernel $i_sys_select \
- i_time.c -o i_time >/dev/null 2>&1 ; then
- set X $i_time $i_systime $d_systimekernel $i_sys_select
- shift
- flags="$*"
- echo Succeeded with $flags
- fi
- ;;
- esac
- done
- done
- done
-done
-case "$flags" in
-*SYSTIMEKERNEL*) val="$define";;
-*) val="$undef";;
-esac
-set d_systimekernel
-eval $setvar
-case "$flags" in
-*I_TIME*) val="$define";;
-*) val="$undef";;
-esac
-set i_time
-eval $setvar
-case "$flags" in
-*I_SYS_SELECT*) val="$define";;
-*) val="$undef";;
-esac
-set i_sys_select
-eval $setvar
-case "$flags" in
-*I_SYS_TIME*) val="$define";;
-*) val="$undef";;
-esac
-set i_sys_time
-eval $setvar
-case "$flags$i_sys_time$i_time" in
-undefundef) i_sys_time="$define"; i_time="$define";
- echo "ICK, NOTHING WORKED!!! You may have to diddle the includes.";;
-esac
-
-: see if telldir exists
-set telldir d_telldir
-eval $inlibc
-
-: 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
-eval $inlibc
-
-: see if there is a vfork
-set vfork d_vfork
-eval $inlibc
-
-: check for volatile keyword
-echo " "
-echo 'Checking to see if your C compiler knows about "volatile"...'
-$cat >try.c <<'EOCP'
-main()
-{
- typedef unsigned short foo_t;
- char *volatile foo;
- volatile int bar;
- volatile foo_t blech;
- foo = foo;
-}
-EOCP
-if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
- val="$define"
- echo "Yup, it does."
-else
- val="$undef"
- echo "Nope, it doesn't."
-fi
-set d_volatile
-eval $setvar
-$rm -f try.*
-
-: see if there is a wait4
-set wait4 d_wait4
-eval $inlibc
-
-: see if there is a waitpid
-set waitpid d_waitpid
-eval $inlibc
-
-: see what type gids are declared as in the kernel
-case "$gidtype" in
-'')
- if $contains 'gid_t;' $usrinclude/sys/types.h >/dev/null 2>&1 ; then
- dflt='gid_t';
- else
- set `grep '_rgid;' $usrinclude/sys/user.h 2>/dev/null` unsigned short
- case $1 in
- unsigned) dflt="$1 $2" ;;
- *) dflt="$1" ;;
- esac
- fi
- ;;
-*) dflt="$gidtype"
- ;;
-esac
-cont=true
-echo " "
-rp="What type are groups ids returned by getgid(), etc.? [$dflt]"
-$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
-'')
- echo "Checking to see how big your integers are..."
- $cat >intsize.c <<'EOCP'
-#include <stdio.h>
-main()
-{
- printf("%d\n", sizeof(int));
-}
-EOCP
- if $cc intsize.c -o intsize >/dev/null 2>&1 ; then
- dflt=`./intsize`
- else
- dflt='4'
- echo "(I can't seem to compile the test program. Guessing...)"
- fi
- ;;
-*)
- dflt="$intsize"
- ;;
-esac
-rp="What is the size of an integer (in bytes)? [$dflt]"
-$echo $n "$rp $c"
-. myread
-intsize="$ans"
-
-: determine where private executables go
-case "$privlib" in
-'')
- dflt=/usr/lib/$package
- test -d /usr/local/lib && dflt=/usr/local/lib/$package
- ;;
-*) dflt="$privlib"
- ;;
-esac
-$cat <<EOM
-
-The $package package has some auxiliary files that should be reside in a library
-that is accessible by everyone. Where should these "private" but accessible
-EOM
-$echo $n "files reside? (~name ok) [$dflt] $c"
-rp="Private files will reside where? [$dflt]"
-. myread
-privlib=`./filexp "$ans"`
-
-case "$installprivlib" in
-'')
- dflt=`echo $privlib | sed 's#^/afs/#/afs/.#'`
- test -d $dflt || dflt="$privlib"
- ;;
-*) dflt="$installprivlib"
- ;;
-esac
-$cat <<EOM
-
-On some systems (such as afs) you have to install the library files in a
-different directory to get them to go to the right place. Where should the
-EOM
-$echo $n "library files be installed? (~name ok) [$dflt] $c"
-rp="Install private files where? [$dflt]"
-. myread
-installprivlib=`./filexp "$ans"`
-
-: check for size of random number generator
-echo " "
-case "$randbits" in
-'')
- echo "Checking to see how many bits your rand function produces..."
- $cat >randbits.c <<'EOCP'
-#include <stdio.h>
-main()
-{
- register int i;
- register unsigned long tmp;
- register unsigned long max = 0L;
-
- for (i=1000; i; i--) {
- tmp = (unsigned long)rand();
- if (tmp > max) max = tmp;
- }
- for (i=0; max; i++)
- max /= 2;
- printf("%d\n",i);
-}
-EOCP
- if $cc randbits.c -o randbits >/dev/null 2>&1 ; then
- dflt=`./randbits`
- else
- dflt='?'
- echo "(I can't seem to compile the test program...)"
- fi
- ;;
-*)
- dflt="$randbits"
- ;;
-esac
-rp="How many bits does your rand() function produce? [$dflt]"
-$echo $n "$rp $c"
-. myread
-randbits="$ans"
-
-: determine where publicly executable scripts go
-case "$scriptdir" in
-'')
- dflt="$bin"
- : guess some guesses
- test -d /usr/share/scripts && dflt=/usr/share/scripts
- test -d /usr/share/bin && dflt=/usr/share/bin
- ;;
-*) dflt="$scriptdir"
- ;;
-esac
-cont=true
-$cat <<EOM
-
-Some installations have a separate directory just for executable scripts so
-that they can mount it across multiple architectures but keep the scripts in
-one spot. You might, for example, have a subdirectory of /usr/share for this.
-Or you might just lump your scripts in with all your other executables.
-
-EOM
-while $test "$cont" ; do
- rp="Where will publicly executable scripts reside (~name ok)? [$dflt]"
- $echo $n "$rp $c"
- . myread
- scriptdir="$ans"
- scriptdir=`./filexp "$scriptdir"`
- if test -d $scriptdir; then
- cont=''
- else
- case "$fastread" in
- yes) dflt=y;;
- *) dflt=n;;
- esac
- rp="Directory $scriptdir doesn't exist. Use that name anyway? [$dflt]"
- $echo $n "$rp $c"
- . myread
- dflt=''
- case "$ans" in
- y*) cont='';;
- esac
- 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
-'')
- echo "Generating a list of signal names..."
- set X `cat $usrinclude/signal.h $usrinclude/sys/signal.h 2>&1 | awk '
-$1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $3 ~ /^[1-9][0-9]*$/ {
- sig[$3] = substr($2,4,20)
- if (max < $3 && $3 < 60) {
- max = $3
- }
-}
-
-END {
- for (i=1; i<=max; i++) {
- if (sig[i] == "")
- printf "%d", i
- else
- printf "%s", sig[i]
- if (i < max)
- printf " "
- }
- printf "\n"
-}
-'`
- shift
- case $# in
- 0) echo 'kill -l' >/tmp/foo$$
- set X `$csh -f </tmp/foo$$`
- shift
- case $# in
- 0)set HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM
- ;;
- esac
- ;;
- esac
- sig_name="ZERO $*"
- ;;
-esac
-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
- echo "Your stdio uses unsigned chars."
- stdchar="unsigned char"
-else
- echo "Your stdio uses signed chars."
- stdchar="char"
-fi
-
-: see what type uids are declared as in the kernel
-case "$uidtype" in
-'')
- if $contains 'uid_t;' $usrinclude/sys/types.h >/dev/null 2>&1 ; then
- dflt='uid_t';
- else
- set `grep '_ruid;' $usrinclude/sys/user.h 2>/dev/null` unsigned short
- case $1 in
- unsigned) dflt="$1 $2" ;;
- *) dflt="$1" ;;
- esac
- fi
- ;;
-*) dflt="$uidtype"
- ;;
-esac
-cont=true
-echo " "
-rp="What type are user ids returned by getuid(), etc.? [$dflt]"
-$echo $n "$rp $c"
-. myread
-uidtype="$ans"
-
-: check for void type
-echo " "
-$cat <<EOM
-Checking to see how well your C compiler groks the void type...
-
- Support flag bits are:
- 1: basic void declarations.
- 2: arrays of pointers to functions returning void.
- 4: operations between pointers to and addresses of void functions.
-
-EOM
-case "$voidhave" in
-'')
- $cat >void.c <<'EOCP'
-#if TRY & 1
-void main() {
-#else
-main() {
-#endif
- extern void moo(); /* function returning void */
- void (*goo)(); /* ptr to func returning void */
-#if TRY & 2
- void (*foo[10])();
-#endif
-
-#if TRY & 4
- if(goo == moo) {
- exit(0);
- }
-#endif
- 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
- echo "However, you might get some warnings that look like this:"
- $cat void.out
- 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
- voidhave=1
- echo "And it doesn't support 4."
- fi
- fi
- else
- echo "There is no support at all for void."
- voidhave=0
- fi
- fi
-esac
-dflt="$voidhave";
-rp="Your void support flags add up to what? [$dflt]"
-$echo $n "$rp $c"
-. myread
-voidhave="$ans"
-
-: preserve RCS keywords in files with variable substitution, grrr
-Log='$Log'
-Header='$Header'
-Id='$Id'
-Author='$Author'
-Date='$Date'
-Locker='$Locker'
-RCSfile='$RCSfile'
-Revision='$Revision'
-Source='$Source'
-State='$State'
-
-
-: determine compiler compiler
-case "$yacc" in
-'') if xenix; then
- dflt=yacc
- else
- dflt='yacc -Sm25000'
- fi
- ;;
-*) dflt="$yacc";;
-esac
-cont=true
- echo " "
-rp="Which compiler compiler (yacc or bison -y) will you use? [$dflt]"
-$echo $n "$rp $c"
-. myread
-case "$ans" in
-'') ans="$dflt";;
-esac
-yacc="$ans"
-
-: see if we can include fcntl.h
-echo " "
-if $h_fcntl; then
- val="$define"
- echo "We'll be including <fcntl.h>."
-else
- val="$undef"
- if $h_sys_file; then
- echo "We don't need to <fcntl.h> if we include <sys/file.h>."
- else
- echo "We won't be including <fcntl.h>."
- fi
-fi
-set i_fcntl
-eval $setvar
-
-: see if gdbm is available
-echo " "
-xxx=`./loc gdbm.h x $usrinclude /usr/local/include $inclwanted`
-if test -f $xxx; then
- val="$define"
- echo "gdbm.h found."
-else
- val="$undef"
- echo "gdbm.h NOT found."
-fi
-set i_gdbm
-eval $setvar
-
-: see if this is an grp system
-echo " "
-if $test -r $usrinclude/grp.h ; then
- val="$define"
- echo "grp.h found."
-else
- val="$undef"
- echo "No grp.h found."
-fi
-set i_grp
-eval $setvar
-
-: see if this is a netinet/in.h or sys/in.h system
-echo " "
-xxx=`./loc netinet/in.h x $usrinclude /usr/local/include $inclwanted`
-if test -f $xxx; then
- val="$define"
- val2="$undef"
- echo "netinet/in.h found."
-else
- val="$undef"
- echo "No netinet/in.h found, ..."
- xxx=`./loc sys/in.h x $usrinclude /usr/local/include $inclwanted`
- if test -f $xxx; then
- val2="$define"
- echo "but I found sys/in.h instead."
- else
- val2="$undef"
- echo "and I didn't find sys/in.h either."
- fi
-fi
-set i_niin
-eval $setvar
-val=$val2
-set i_sysin
-eval $setvar
-
-: Do we need to #include <sys/file.h> ?
-echo " "
-if $h_sys_file; then
- val="$define"
- echo "We'll be including <sys/file.h>."
-else
- val="$undef"
- echo "We won't be including <sys/file.h>."
-fi
-set i_sys_file
-eval $setvar
-
-: see if ioctl defs are in sgtty/termio or sys/ioctl
-echo " "
-if $test -r $usrinclude/sys/ioctl.h ; then
- val="$define"
- echo "sys/ioctl.h found."
-else
- val="$undef"
- echo "sys/ioctl.h NOT found, assuming ioctl args are defined in sgtty.h."
-fi
-set i_sysioctl
-eval $setvar
-
-: see if we should include utime.h
-echo " "
-if $test -r $usrinclude/utime.h ; then
- val="$define"
- echo "utime.h found."
-else
- val="$undef"
- echo "No utime.h found, but that's ok."
-fi
-set i_utime
-eval $setvar
-
-: see if this is a varargs system
-echo " "
-if $test -r $usrinclude/varargs.h ; then
- val="$define"
- echo "varargs.h found."
-else
- val="$undef"
- echo "No varargs.h found, but that's ok (I hope)."
-fi
-set i_varargs
-eval $setvar
-
-: see if this is a vfork system
-echo " "
-if $test -r $usrinclude/vfork.h ; then
- val="$define"
- echo "vfork.h found."
-else
- val="$undef"
- echo "No vfork.h found."
-fi
-set i_vfork
-eval $setvar
-
-: end of configuration questions
-echo " "
-echo "End of configuration questions."
-echo " "
-
-: create config.sh file
-echo " "
-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'
-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'
-cpp='$cpp'
-perl='$perl'
-emacs='$emacs'
-ls='$ls'
-rmail='$rmail'
-sendmail='$sendmail'
-shar='$shar'
-smail='$smail'
-tbl='$tbl'
-troff='$troff'
-nroff='$nroff'
-uname='$uname'
-uuname='$uuname'
-line='$line'
-chgrp='$chgrp'
-chmod='$chmod'
-lint='$lint'
-sleep='$sleep'
-pr='$pr'
-tar='$tar'
-ln='$ln'
-lpr='$lpr'
-lp='$lp'
-touch='$touch'
-make='$make'
-date='$date'
-csh='$csh'
-bash='$bash'
-ksh='$ksh'
-lex='$lex'
-flex='$flex'
-bison='$bison'
-Log='$Log'
-Header='$Header'
-Id='$Id'
-lastuname='$lastuname'
-alignbytes='$alignbytes'
-bin='$bin'
-installbin='$installbin'
-byteorder='$byteorder'
-contains='$contains'
-cppstdin='$cppstdin'
-cppminus='$cppminus'
-d_bcmp='$d_bcmp'
-d_bcopy='$d_bcopy'
-d_safebcpy='$d_safebcpy'
-d_bzero='$d_bzero'
-d_castneg='$d_castneg'
-castflags='$castflags'
-d_charsprf='$d_charsprf'
-d_chsize='$d_chsize'
-d_crypt='$d_crypt'
-cryptlib='$cryptlib'
-d_csh='$d_csh'
-d_dosuid='$d_dosuid'
-d_dup2='$d_dup2'
-d_fchmod='$d_fchmod'
-d_fchown='$d_fchown'
-d_fcntl='$d_fcntl'
-d_flexfnam='$d_flexfnam'
-d_flock='$d_flock'
-d_getgrps='$d_getgrps'
-d_gethent='$d_gethent'
-d_getpgrp='$d_getpgrp'
-d_getpgrp2='$d_getpgrp2'
-d_getprior='$d_getprior'
-d_htonl='$d_htonl'
-d_index='$d_index'
-d_isascii='$d_isascii'
-d_killpg='$d_killpg'
-d_lstat='$d_lstat'
-d_memcmp='$d_memcmp'
-d_memcpy='$d_memcpy'
-d_safemcpy='$d_safemcpy'
-d_memmove='$d_memmove'
-d_memset='$d_memset'
-d_mkdir='$d_mkdir'
-d_msg='$d_msg'
-d_msgctl='$d_msgctl'
-d_msgget='$d_msgget'
-d_msgrcv='$d_msgrcv'
-d_msgsnd='$d_msgsnd'
-d_ndbm='$d_ndbm'
-d_odbm='$d_odbm'
-d_open3='$d_open3'
-d_readdir='$d_readdir'
-d_rename='$d_rename'
-d_rewindir='$d_rewindir'
-d_rmdir='$d_rmdir'
-d_seekdir='$d_seekdir'
-d_select='$d_select'
-d_sem='$d_sem'
-d_semctl='$d_semctl'
-d_semget='$d_semget'
-d_semop='$d_semop'
-d_setegid='$d_setegid'
-d_seteuid='$d_seteuid'
-d_setpgrp='$d_setpgrp'
-d_setpgrp2='$d_setpgrp2'
-d_setprior='$d_setprior'
-d_setregid='$d_setregid'
-d_setresgid='$d_setresgid'
-d_setreuid='$d_setreuid'
-d_setresuid='$d_setresuid'
-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'
-d_socket='$d_socket'
-d_sockpair='$d_sockpair'
-d_oldsock='$d_oldsock'
-socketlib='$socketlib'
-d_statblks='$d_statblks'
-d_stdstdio='$d_stdstdio'
-d_strctcpy='$d_strctcpy'
-d_strerror='$d_strerror'
-d_symlink='$d_symlink'
-d_syscall='$d_syscall'
-d_telldir='$d_telldir'
-d_truncate='$d_truncate'
-d_vfork='$d_vfork'
-d_voidsig='$d_voidsig'
-d_tosignal='$d_tosignal'
-d_volatile='$d_volatile'
-d_vprintf='$d_vprintf'
-d_charvspr='$d_charvspr'
-d_wait4='$d_wait4'
-d_waitpid='$d_waitpid'
-gidtype='$gidtype'
-groupstype='$groupstype'
-i_fcntl='$i_fcntl'
-i_gdbm='$i_gdbm'
-i_grp='$i_grp'
-i_niin='$i_niin'
-i_sysin='$i_sysin'
-i_pwd='$i_pwd'
-d_pwquota='$d_pwquota'
-d_pwage='$d_pwage'
-d_pwchange='$d_pwchange'
-d_pwclass='$d_pwclass'
-d_pwexpire='$d_pwexpire'
-d_pwcomment='$d_pwcomment'
-i_sys_file='$i_sys_file'
-i_sysioctl='$i_sysioctl'
-i_time='$i_time'
-i_sys_time='$i_sys_time'
-i_sys_select='$i_sys_select'
-d_systimekernel='$d_systimekernel'
-i_utime='$i_utime'
-i_varargs='$i_varargs'
-i_vfork='$i_vfork'
-intsize='$intsize'
-libc='$libc'
-nm_opts='$nm_opts'
-libndir='$libndir'
-i_my_dir='$i_my_dir'
-i_ndir='$i_ndir'
-i_sys_ndir='$i_sys_ndir'
-i_dirent='$i_dirent'
-i_sys_dir='$i_sys_dir'
-d_dirnamlen='$d_dirnamlen'
-ndirc='$ndirc'
-ndiro='$ndiro'
-mallocsrc='$mallocsrc'
-mallocobj='$mallocobj'
-d_mymalloc='$d_mymalloc'
-mallocptrtype='$mallocptrtype'
-mansrc='$mansrc'
-manext='$manext'
-models='$models'
-split='$split'
-small='$small'
-medium='$medium'
-large='$large'
-huge='$huge'
-optimize='$optimize'
-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'
-sharpbang='$sharpbang'
-startsh='$startsh'
-stdchar='$stdchar'
-uidtype='$uidtype'
-usrinclude='$usrinclude'
-inclPath='$inclPath'
-void='$void'
-voidhave='$voidhave'
-voidwant='$voidwant'
-w_localtim='$w_localtim'
-w_s_timevl='$w_s_timevl'
-w_s_tm='$w_s_tm'
-yacc='$yacc'
-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."
-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
-chmod +x doSH
-./doSH
-
-if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
- dflt=n
- $cat <<EOM
-
-Now you need to generate make dependencies by running "make depend".
-You might prefer to run it in background: "make depend > 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 && 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."
-else
- echo "Done."
-fi
-
-$rm -f kit*isdone
-$rm -rf UU
-: end of Configure
-/* $RCSfile: EXTERN.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 10:10:32 $
+/* $RCSfile: EXTERN.h,v $$Revision: 4.1 $$Date: 92/08/07 17:18:03 $
*
* Copyright (c) 1991, Larry Wall
*
* License or the Artistic License, as specified in the README file.
*
* $Log: EXTERN.h,v $
+ * Revision 4.1 92/08/07 17:18:03 lwall
+ * Stage 6 Snapshot
+ *
* Revision 4.0.1.1 91/06/07 10:10:32 lwall
* patch4: new copyright notice
*
-/* $RCSfile: INTERN.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 10:10:42 $
+/* $RCSfile: INTERN.h,v $$Revision: 4.1 $$Date: 92/08/07 17:18:04 $
*
* Copyright (c) 1991, Larry Wall
*
* License or the Artistic License, as specified in the README file.
*
* $Log: INTERN.h,v $
+ * Revision 4.1 92/08/07 17:18:04 lwall
+ * Stage 6 Snapshot
+ *
* Revision 4.0.1.1 91/06/07 10:10:42 lwall
* patch4: new copyright notice
*
--- /dev/null
+#ifdef I_PWD
+#include <pwd.h>
+#endif
+#ifdef I_GRP
+#include <grp.h>
+#endif
+#ifdef I_UTIME
+#include <utime.h>
+#endif
+#ifdef I_FCNTL
+#include <fcntl.h>
+#endif
+#ifdef I_SYS_FILE
+#include <sys/file.h>
+#endif
cmd.h Public declarations for the above
config.H Sample config.h
config_h.SH Produces config.h
+config_c++.h TEMP FILE
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
+dosish.h
dump.c Debugging output
eg/ADB An adb wrapper to put in your crash dir
eg/README Intro to example perl scripts
emacs/perldb.el Emacs debugging
emacs/perldb.pl Emacs debugging
emacs/tedstuff Some optional patches
+embed_h.SH
eval.c The expression evaluator
form.c Format processing
form.h Public declarations for the above
gettest A little script to test the get* routines
+global.var
h2ph.SH A thing to turn C .h file into perl .ph files
h2pl/README How to turn .ph files into .pl files
h2pl/cbreak.pl cbreak routines using .ph
hints/uts.sh
hints/vax.sh
installperl Perl script to do "make install" dirty work
+interp.var
ioctl.pl Sample ioctl.pl
+keywords.h
lib/abbrev.pl An abbreviation table builder
lib/assert.pl assertion and panic with stack trace
lib/bigfloat.pl An arbitrary precision floating point package
lib/termcap.pl Perl library supporting termcap usage
lib/timelocal.pl Perl library supporting inverse of localtime, gmtime
lib/validate.pl Perl library supporting wholesale file mode validation
+main.c
makedepend.SH Precursor to makedepend
makedir.SH Precursor to makedir
+makefile.lib make libperl.a
malloc.c A version of malloc you might not want
msdos/Changes.dds Expanation of MS-DOS patches by Diomidis Spinellis
msdos/Makefile MS-DOS makefile
perlsh A poor man's perl shell
perly.fixer A program to remove yacc stack limitations
perly.y Yacc grammar for perl
+pp.h Push/Pop code defs
+pp.c Push/Pop code
+proto.h
regcomp.c Regular expression compiler
regcomp.h Private declarations for above
regexec.c Regular expression evaluator
t/op/vec.t See if vectors work
t/op/write.t See if write works
toke.c The tokener
+unixish.h
usersub.c User supplied (possibly proprietary) subroutines
usub/Makefile Makefile for curseperl
usub/README Instructions for user supplied subroutines
-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)
- fi 2>/dev/null
- . ./config.sh
- ;;
-esac
-case "$0" in
-*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
-esac
-
-case "$d_symlink" in
-*define*) sln='ln -s' ;;
-*) sln='ln';;
-esac
-
-case "$d_dosuid" in
-*define*) suidperl='suidperl' ;;
-*) suidperl='';;
-esac
-
-echo "Extracting Makefile (with variable substitutions)"
-rm -f Makefile
-cat >Makefile <<!GROK!THIS!
-# $RCSfile: Makefile.SH,v $$Revision: 4.0.1.4 $$Date: 92/06/08 11:40:43 $
+# : Makefile.SH,v 15738Revision: 4.1 15738Date: 92/08/07 17:18:08 $
#
# $Log: Makefile.SH,v $
+# Revision 4.1 92/08/07 17:18:08 lwall
+# Stage 6 Snapshot
+#
# Revision 4.0.1.4 92/06/08 11:40:43 lwall
# patch20: cray didn't give enough memory to /bin/sh
# patch20: various and sundry fixes
#
#
-CC = $cc
-YACC = $yacc
-bin = $installbin
-scriptdir = $scriptdir
-privlib = $installprivlib
-mansrc = $mansrc
-manext = $manext
-LDFLAGS = $ldflags
-CLDFLAGS = $ldflags
-SMALL = $small
-LARGE = $large $split
-mallocsrc = $mallocsrc
-mallocobj = $mallocobj
-SLN = $sln
+CC = cc
+YACC = /bin/yacc
+bin = /usr/local/bin
+scriptdir = /usr/local/bin
+privlib = /usr/local/lib/perl
+mansrc = /usr/man/manl
+manext = l
+LDFLAGS =
+CLDFLAGS =
+SMALL =
+LARGE =
+mallocsrc = malloc.c
+mallocobj = malloc.o
+SLN = ln -s
RMS = rm -f
-libs = $libs $cryptlib
-
-public = perl taintperl $suidperl
+libs = -ldbm -lm -lposix
-shellflags = $shellflags
+public = perl
-# To use an alternate make, set $altmake in config.sh.
-MAKE = ${altmake-make}
+shellflags =
-!GROK!THIS!
+# To use an alternate make, set in config.sh.
+MAKE = make
-cat >>Makefile <<'!NO!SUBS!'
CCCMD = `sh $(shellflags) cflags $@`
sh = Makefile.SH makedepend.SH h2ph.SH
-h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h
-h2 = hash.h perl.h regcomp.h regexp.h spat.h stab.h str.h util.h
+h1 = EXTERN.h INTERN.h av.h cop.h config.h embed.h form.h handy.h
+h2 = hv.h op.h opcode.h perl.h regcomp.h regexp.h gv.h sv.h util.h
h = $(h1) $(h2)
-c1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c
-c2 = eval.c form.c hash.c $(mallocsrc) perl.c regcomp.c regexec.c
-c3 = stab.c str.c toke.c util.c usersub.c
+c1 = av.c cop.c cons.c consop.c doop.c doio.c dolist.c
+c2 = eval.c hv.c main.c $(mallocsrc) perl.c pp.c regcomp.c regexec.c
+c3 = gv.c sv.c toke.c util.c usersub.c
c = $(c1) $(c2) $(c3)
-s1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c
-s2 = eval.c form.c hash.c perl.c regcomp.c regexec.c
-s3 = stab.c str.c toke.c util.c usersub.c perly.c
+s1 = av.c cop.c cons.c consop.c doop.c doio.c dolist.c
+s2 = eval.c hv.c main.c perl.c pp.c regcomp.c regexec.c
+s3 = gv.c sv.c toke.c util.c usersub.c perly.c
saber = $(s1) $(s2) $(s3)
-obj1 = array.o cmd.o cons.o consarg.o doarg.o doio.o dolist.o dump.o
-obj2 = eval.o form.o $(mallocobj) perl.o regcomp.o regexec.o
-obj3 = stab.o str.o toke.o util.o
+obj1 = av.o scope.o op.o doop.o doio.o dolist.o dump.o
+obj2 = $(mallocobj) mg.o pp.o regcomp.o regexec.o
+obj3 = gv.o sv.o toke.o util.o deb.o run.o
obj = $(obj1) $(obj2) $(obj3)
-tobj1 = tarray.o tcmd.o tcons.o tconsarg.o tdoarg.o tdoio.o tdolist.o tdump.o
-tobj2 = teval.o tform.o thash.o $(mallocobj) tregcomp.o tregexec.o
-tobj3 = tstab.o tstr.o ttoke.o tutil.o
+tobj1 = tav.o tcop.o tcons.o tconsop.o tdoop.o tdoio.o tdolist.o tdump.o
+tobj2 = teval.o thv.o $(mallocobj) tpp.o tregcomp.o tregexec.o
+tobj3 = tgv.o tsv.o ttoke.o tutil.o
tobj = $(tobj1) $(tobj2) $(tobj3)
.c.o:
$(CCCMD) $*.c
-all: $(public) $(private) $(util) uperl.o $(scripts)
- cd x2p; $(MAKE) all
- touch all
+
+all: perl
+
+#all: $(public) $(private) $(util) uperl.o $(scripts)
+# cd x2p; $(MAKE) all
+# touch all
# This is the standard version that contains no "taint" checks and is
# used for all scripts that aren't set-id or running under something set-id.
# The $& notation is tells Sequent machines that it can do a parallel make,
# and is harmless otherwise.
-perl: $& perly.o $(obj) hash.o usersub.o
- $(CC) $(LARGE) $(CLDFLAGS) $(obj) hash.o perly.o usersub.o $(libs) -o perl
-
-# This command assumes that /usr/include/dbz.h and /usr/lib/dbz.o exist.
-
-dbzperl: $& perly.o $(obj) zhash.o usersub.o
- $(CC) $(LARGE) $(CLDFLAGS) $(obj) zhash.o /usr/lib/dbz.o perly.o usersub.o $(libs) -o dbzperl
+perl: $& main.o perly.o perl.o $(obj) hv.o usersub.o
+ $(CC) -Bstatic $(LARGE) $(CLDFLAGS) main.o perly.o perl.o $(obj) hv.o usersub.o $(libs) -o perl
+ echo "\a"
-zhash.o: hash.c $(h)
- $(RMS) zhash.c
- $(SLN) hash.c zhash.c
- $(CCCMD) -DWANT_DBZ zhash.c
- $(RMS) zhash.c
+libperl.rlb: libperl.a
+ ranlib libperl.a
+ touch libperl.rlb
-uperl.o: $& perly.o $(obj) hash.o
- -ld $(LARGE) $(LDFLAGS) -r $(obj) hash.o perly.o -o uperl.o
-
-saber: $(saber)
- # load $(saber)
- # load /lib/libm.a
+libperl.a: $& perly.o perl.o $(obj) hv.o usersub.o
+ ar rcuv libperl.a $(obj) hv.o perly.o usersub.o
# This version, if specified in Configure, does ONLY those scripts which need
# set-id emulation. Suidperl must be setuid root. It contains the "taint"
# checks as well as the special code to validate that the script in question
# has been invoked correctly.
-suidperl: $& tperly.o sperl.o $(tobj) usersub.o
- $(CC) $(LARGE) $(CLDFLAGS) sperl.o $(tobj) tperly.o usersub.o $(libs) \
- -o suidperl
+suidperl: $& sperl.o tmain.o libtperl.rlb
+ $(CC) $(LARGE) $(CLDFLAGS) sperl.o tmain.o libtperl.a $(libs) -o suidperl
# This version interprets scripts that are already set-id either via a wrapper
# or through the kernel allowing set-id scripts (bad idea). Taintperl must
# NOT be setuid to root or anything else. The only difference between it
# and normal perl is the presence of the "taint" checks.
-taintperl: $& tperly.o tperl.o $(tobj) usersub.o
- $(CC) $(LARGE) $(CLDFLAGS) tperl.o $(tobj) tperly.o usersub.o $(libs) \
- -o taintperl
+taintperl: $& tmain.o libtperl.rlb
+ $(CC) $(LARGE) $(CLDFLAGS) tmain.o libtperl.a $(libs) -o taintperl
+
+libtperl.rlb: libtperl.a
+ ranlib libtperl.a
+ touch libtperl.rlb
+
+libtperl.a: $& tperly.o tperl.o $(tobj) thv.o usersub.o
+ ar rcuv libtperl.a $(tobj) thv.o tperly.o usersub.o tperl.o
+
+# This command assumes that /usr/include/dbz.h and /usr/lib/dbz.o exist.
+
+dbzperl: $& main.o zhv.o libperl.rlb
+ $(CC) $(LARGE) $(CLDFLAGS) main.o zhv.o /usr/lib/dbz.o libperl.a $(libs) -o dbzperl
+
+zhv.o: hv.c $(h)
+ $(RMS) zhv.c
+ $(SLN) hv.c zhv.c
+ $(CCCMD) -DWANT_DBZ zhv.c
+ $(RMS) zhv.c
+
+uperl.o: $& $(obj) main.o hv.o perly.o
+ -ld $(LARGE) $(LDFLAGS) -r $(obj) main.o hv.o perly.o -o uperl.o
+
+saber: $(saber)
+ # load $(saber)
+ # load /lib/libm.a
# Replicating all this junk is yucky, but I don't see a portable way to fix it.
$(CCCMD) -DTAINT -DIAMSUID sperl.c
$(RMS) sperl.c
-tarray.o: array.c $(h)
- $(RMS) tarray.c
- $(SLN) array.c tarray.c
- $(CCCMD) -DTAINT tarray.c
- $(RMS) tarray.c
+tav.o: av.c $(h)
+ $(RMS) tav.c
+ $(SLN) av.c tav.c
+ $(CCCMD) -DTAINT tav.c
+ $(RMS) tav.c
-tcmd.o: cmd.c $(h)
- $(RMS) tcmd.c
- $(SLN) cmd.c tcmd.c
- $(CCCMD) -DTAINT tcmd.c
- $(RMS) tcmd.c
+tcop.o: cop.c $(h)
+ $(RMS) tcop.c
+ $(SLN) cop.c tcop.c
+ $(CCCMD) -DTAINT tcop.c
+ $(RMS) tcop.c
tcons.o: cons.c $(h) perly.h
$(RMS) tcons.c
$(CCCMD) -DTAINT tcons.c
$(RMS) tcons.c
-tconsarg.o: consarg.c $(h)
- $(RMS) tconsarg.c
- $(SLN) consarg.c tconsarg.c
- $(CCCMD) -DTAINT tconsarg.c
- $(RMS) tconsarg.c
+tconsop.o: consop.c $(h)
+ $(RMS) tconsop.c
+ $(SLN) consop.c tconsop.c
+ $(CCCMD) -DTAINT tconsop.c
+ $(RMS) tconsop.c
-tdoarg.o: doarg.c $(h)
- $(RMS) tdoarg.c
- $(SLN) doarg.c tdoarg.c
- $(CCCMD) -DTAINT tdoarg.c
- $(RMS) tdoarg.c
+tdoop.o: doop.c $(h)
+ $(RMS) tdoop.c
+ $(SLN) doop.c tdoop.c
+ $(CCCMD) -DTAINT tdoop.c
+ $(RMS) tdoop.c
tdoio.o: doio.c $(h)
$(RMS) tdoio.c
$(CCCMD) -DTAINT teval.c
$(RMS) teval.c
-tform.o: form.c $(h)
- $(RMS) tform.c
- $(SLN) form.c tform.c
- $(CCCMD) -DTAINT tform.c
- $(RMS) tform.c
+thv.o: hv.c $(h)
+ $(RMS) thv.c
+ $(SLN) hv.c thv.c
+ $(CCCMD) -DTAINT thv.c
+ $(RMS) thv.c
-thash.o: hash.c $(h)
- $(RMS) thash.c
- $(SLN) hash.c thash.c
- $(CCCMD) -DTAINT thash.c
- $(RMS) thash.c
+tmain.o: main.c $(h)
+ $(RMS) tmain.c
+ $(SLN) main.c tmain.c
+ $(CCCMD) -DTAINT tmain.c
+ $(RMS) tmain.c
+
+tpp.o: pp.c $(h)
+ $(RMS) tpp.c
+ $(SLN) pp.c tpp.c
+ $(CCCMD) -DTAINT tpp.c
+ $(RMS) tpp.c
tregcomp.o: regcomp.c $(h)
$(RMS) tregcomp.c
$(CCCMD) -DTAINT tregexec.c
$(RMS) tregexec.c
-tstab.o: stab.c $(h)
- $(RMS) tstab.c
- $(SLN) stab.c tstab.c
- $(CCCMD) -DTAINT tstab.c
- $(RMS) tstab.c
+tgv.o: gv.c $(h)
+ $(RMS) tgv.c
+ $(SLN) gv.c tgv.c
+ $(CCCMD) -DTAINT tgv.c
+ $(RMS) tgv.c
-tstr.o: str.c $(h) perly.h
- $(RMS) tstr.c
- $(SLN) str.c tstr.c
- $(CCCMD) -DTAINT tstr.c
- $(RMS) tstr.c
+tsv.o: sv.c $(h) perly.h
+ $(RMS) tsv.c
+ $(SLN) sv.c tsv.c
+ $(CCCMD) -DTAINT tsv.c
+ $(RMS) tsv.c
ttoke.o: toke.c $(h) perly.h
$(RMS) ttoke.c
@ echo Dummy dependency for dumb parallel make
touch perly.h
+embed.h: embed_h.SH global.var interp.var
+ sh embed_h.SH
+
perly.c: perly.y perly.fixer
@ \
case "$(YACC)" in \
- *bison*) echo 'Expect' 25 shift/reduce and 59 reduce/reduce conflicts;; \
- *) echo 'Expect' 27 shift/reduce and 57 reduce/reduce conflicts;; \
+ *bison*) echo 'Expect' 25 shift/reduce and 53 reduce/reduce conflicts;; \
+ *) echo 'Expect' 27 shift/reduce and 51 reduce/reduce conflicts;; \
esac
$(YACC) -d perly.y
sh $(shellflags) ./perly.fixer y.tab.c perly.c
echo $(sh) | tr ' ' '\012' >.shlist
# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
-$(obj) hash.o:
+$(obj) hv.o:
@ echo "You haven't done a "'"make depend" yet!'; exit 1
makedepend: makedepend.SH
/bin/sh $(shellflags) makedepend.SH
-!NO!SUBS!
-$eunicefix Makefile
-case `pwd` in
-*SH)
- $rm -f ../Makefile
- ln Makefile ../Makefile
- ;;
-esac
-rm -f makefile
+
+++ /dev/null
-After all the perl kits are run you should have the following files:
-
-Filename Kit Description
--------- --- -----------
-Configure:AA 3 Run this first
-Configure:AB 20
-Copying 26 The GNU General Public License
-EXTERN.h 36 Included before foreign .h files
-INTERN.h 36 Included before domestic .h files
-MANIFEST 13 This list of files
-Makefile.SH 28 Precursor to Makefile
-PACKINGLIST 16 Which files came from which kits
-README 1 The Instructions
-README.uport 1 Special instructions for Microports
-README.xenix 1 Special instructions for Xenix
-Wishlist 36 Some things that may or may not happen
-arg.h 19 Public declarations for the above
-array.c 30 Numerically subscripted arrays
-array.h 35 Public declarations for the above
-client 35 A client to test sockets
-cmd.c 18 Command interpreter
-cmd.h 30 Public declarations for the above
-config.H 25 Sample config.h
-config_h.SH 24 Produces config.h
-cons.c 13 Routines to construct cmd nodes of a parse tree
-consarg.c 19 Routines to construct arg nodes of a parse tree
-doarg.c 12 Scalar expression evaluation
-doio.c:AA 5 I/O operations
-doio.c:AB 28
-dolist.c 11 Array expression evaluation
-dump.c 25 Debugging output
-eg/ADB 36 An adb wrapper to put in your crash dir
-eg/README 1 Intro to example perl scripts
-eg/changes 35 A program to list recently changed files
-eg/down 36 A program to do things to subdirectories
-eg/dus 35 A program to do du -s on non-mounted dirs
-eg/findcp 34 A find wrapper that implements a -cp switch
-eg/findtar 22 A find wrapper that pumps out a tar file
-eg/g/gcp 33 A program to do a global rcp
-eg/g/gcp.man 34 Manual page for gcp
-eg/g/ged 15 A program to do a global edit
-eg/g/ghosts 35 A sample /etc/ghosts file
-eg/g/gsh 32 A program to do a global rsh
-eg/g/gsh.man 33 Manual page for gsh
-eg/muck 33 A program to find missing make dependencies
-eg/muck.man 35 Manual page for muck
-eg/myrup 35 A program to find lightly loaded machines
-eg/nih 36 Script to insert #! workaround
-eg/relink 33 A program to change symbolic links
-eg/rename 34 A program to rename files
-eg/rmfrom 20 A program to feed doomed filenames to
-eg/scan/scan_df 34 Scan for filesystem anomalies
-eg/scan/scan_last 34 Scan for login anomalies
-eg/scan/scan_messages 30 Scan for console message anomalies
-eg/scan/scan_passwd 35 Scan for passwd file anomalies
-eg/scan/scan_ps 10 Scan for process anomalies
-eg/scan/scan_sudo 33 Scan for sudo anomalies
-eg/scan/scan_suid 33 Scan for setuid anomalies
-eg/scan/scanner 33 An anomaly reporter
-eg/shmkill 35 A program to remove unused shared memory
-eg/sysvipc/README 1 Intro to Sys V IPC examples
-eg/sysvipc/ipcmsg 35 Example of SYS V IPC message queues
-eg/sysvipc/ipcsem 35 Example of Sys V IPC semaphores
-eg/sysvipc/ipcshm 35 Example of Sys V IPC shared memory
-eg/travesty 35 A program to print travesties of its input text
-eg/van/empty 35 A program to empty the trashcan
-eg/van/unvanish 34 A program to undo what vanish does
-eg/van/vanexp 36 A program to expire vanished files
-eg/van/vanish 34 A program to put files in a trashcan
-eg/who 36 A sample who program
-emacs/perl-mode.el 21 Emacs major mode for perl
-emacs/perldb.el 17 Emacs debugging
-emacs/perldb.pl 15 Emacs debugging
-emacs/tedstuff 27 Some optional patches
-eval.c:AA 2 The expression evaluator
-eval.c:AB 20
-form.c 28 Format processing
-form.h 35 Public declarations for the above
-gettest 35 A little script to test the get* routines
-h2ph.SH 11 A thing to turn C .h file into perl .ph files
-h2pl/README 1 How to turn .ph files into .pl files
-h2pl/cbreak.pl 35 cbreak routines using .ph
-h2pl/cbreak2.pl 35 cbreak routines using .pl
-h2pl/eg/sizeof.ph 36 Sample sizeof array initialization
-h2pl/eg/sys/errno.pl 31 Sample translated errno.pl
-h2pl/eg/sys/ioctl.pl 31 Sample translated ioctl.pl
-h2pl/eg/sysexits.pl 36 Sample translated sysexits.pl
-h2pl/getioctlsizes 36 Program to extract types from ioctl.h
-h2pl/mksizes 35 Program to make %sizeof array.
-h2pl/mkvars 35 Program to make .pl from .ph files
-h2pl/tcbreak 36 cbreak test routine using .ph
-h2pl/tcbreak2 14 cbreak test routine using .pl
-handy.h 32 Handy definitions
-hash.c 26 Associative arrays
-hash.h 34 Public declarations for the above
-installperl 31 Perl script to do "make install" dirty work
-ioctl.pl 31 Sample ioctl.pl
-lib/abbrev.pl 35 An abbreviation table builder
-lib/bigfloat.pl 26 An arbitrary precision floating point package
-lib/bigint.pl 29 An arbitrary precision integer arithmetic package
-lib/bigrat.pl 31 An arbitrary precision rational arithmetic package
-lib/cacheout.pl 35 Manages output filehandles when you need too many
-lib/complete.pl 33 A command completion subroutine
-lib/ctime.pl 29 A ctime workalike
-lib/dumpvar.pl 35 A variable dumper
-lib/flush.pl 36 Routines to do single flush
-lib/getopt.pl 34 Perl library supporting option parsing
-lib/getopts.pl 35 Perl library supporting option parsing
-lib/importenv.pl 36 Perl routine to get environment into variables
-lib/look.pl 34 A "look" equivalent
-lib/perldb.pl 25 Perl debugging routines
-lib/pwd.pl 34 Routines to keep track of PWD environment variable
-lib/stat.pl 35 Perl library supporting stat function
-lib/syslog.pl 29 Perl library supporting syslogging
-lib/termcap.pl 32 Perl library supporting termcap usage
-lib/timelocal.pl 33 Perl library supporting inverse of localtime, gmtime
-lib/validate.pl 32 Perl library supporting wholesale file mode validation
-makedepend.SH 31 Precursor to makedepend
-makedir.SH 34 Precursor to makedir
-malloc.c 12 A version of malloc you might not want
-msdos/Changes.dds 33 Expanation of MS-DOS patches by Diomidis Spinellis
-msdos/Makefile 33 MS-DOS makefile
-msdos/README.msdos 1 Compiling and usage information
-msdos/Wishlist.dds 18 My wishlist
-msdos/chdir.c 33 A chdir that can change drives
-msdos/config.h 22 Definitions for msdos
-msdos/dir.h 34 MS-DOS header for directory access functions
-msdos/directory.c 31 MS-DOS directory access functions.
-msdos/eg/crlf.bat 35 Convert files from unix to MS-DOS line termination
-msdos/eg/drives.bat 34 List the system drives and their characteristics
-msdos/eg/lf.bat 35 Convert files from MS-DOS to Unix line termination
-msdos/glob.c 36 A command equivalent to csh glob
-msdos/msdos.c 30 MS-DOS ioctl, sleep, gete?[gu]if, spawn, aspawn
-msdos/popen.c 32 My_popen and my_pclose for MS-DOS
-msdos/usage.c 34 How to invoke perl under MS-DOS
-os2/Makefile 32 Makefile for OS/2
-os2/README.OS2 1 Notes for OS/2
-os2/a2p.cs 13 Compiler script for a2p
-os2/a2p.def 36 Linker defs for a2p
-os2/alarm.c 31 An implementation of alarm()
-os2/alarm.h 36 Header file for same
-os2/config.h 18 Configuration file for OS/2
-os2/dir.h 33 Directory header
-os2/director.c 30 Directory routines
-os2/eg/alarm.pl 36 Example of alarm code
-os2/eg/os2.pl 33 Sample script for OS/2
-os2/eg/syscalls.pl 36 Example of syscall on OS/2
-os2/glob.c 36 Globbing routines
-os2/makefile 32 Make file
-os2/mktemp.c 36 Mktemp() using TMP
-os2/os2.c 29 Unix compatibility functions
-os2/perl.bad 36 names of protect-only API calls for BIND
-os2/perl.cs 35 Compiler script for perl
-os2/perl.def 19 Linker defs for perl
-os2/perldb.dif 34 Changes to make the debugger work
-os2/perlglob.bad 36 names of protect-only API calls for BIND
-os2/perlglob.cs 36 Compiler script for perlglob
-os2/perlglob.def 36 Linker defs for perlglob
-os2/perlsh.cmd 36 Poor man's shell for os2
-os2/popen.c 29 Code for opening pipes
-os2/s2p.cmd 27 s2p as command file
-os2/selfrun.bat 36 A self running perl script for DOS
-os2/selfrun.cmd 26 Example of extproc feature
-os2/suffix.c 31 Code for creating backup filenames
-patchlevel.h 36 The current patch level of perl
-perl.c 15 main()
-perl.h 24 Global declarations
-perl.man:AA 6 The manual page(s)
-perl.man:AB 7
-perl.man:AC 8
-perl.man:AD 10
-perlsh 36 A poor man's perl shell
-perly.fixer 34 A program to remove yacc stack limitations
-perly.y 22 Yacc grammar for perl
-regcomp.c 17 Regular expression compiler
-regcomp.h 29 Private declarations for above
-regexec.c 21 Regular expression evaluator
-regexp.h 35 Public declarations for the above
-server 35 A server to test sockets
-spat.h 34 Search pattern declarations
-stab.c 23 Symbol table stuff
-stab.h 31 Public declarations for the above
-str.c 14 String handling package
-str.h 30 Public declarations for the above
-t/README 1 Instructions for regression tests
-t/TEST 34 The regression tester
-t/base/cond.t 36 See if conditionals work
-t/base/if.t 36 See if if works
-t/base/lex.t 34 See if lexical items work
-t/base/pat.t 36 See if pattern matching works
-t/base/term.t 17 See if various terms work
-t/cmd/elsif.t 35 See if else-if works
-t/cmd/for.t 35 See if for loops work
-t/cmd/mod.t 35 See if statement modifiers work
-t/cmd/subval.t 32 See if subroutine values work
-t/cmd/switch.t 34 See if switch optimizations work
-t/cmd/while.t 1 See if while loops work
-t/comp/cmdopt.t 33 See if command optimization works
-t/comp/cpp.t 35 See if C preprocessor works
-t/comp/decl.t 36 See if declarations work
-t/comp/multiline.t 35 See if multiline strings work
-t/comp/package.t 35 See if packages work
-t/comp/script.t 35 See if script invokation works
-t/comp/term.t 34 See if more terms work
-t/io/argv.t 35 See if ARGV stuff works
-t/io/dup.t 35 See if >& works right
-t/io/fs.t 32 See if directory manipulations work
-t/io/inplace.t 12 See if inplace editing works
-t/io/pipe.t 35 See if secure pipes work
-t/io/print.t 36 See if print commands work
-t/io/tell.t 34 See if file seeking works
-t/lib/big.t 31 See if lib/bigint.pl works
-t/op/append.t 36 See if . works
-t/op/array.t 31 See if array operations work
-t/op/auto.t 23 See if autoincrement et all work
-t/op/chop.t 35 See if chop works
-t/op/cond.t 36 See if conditional expressions work
-t/op/dbm.t 33 See if dbm binding works
-t/op/delete.t 16 See if delete works
-t/op/do.t 27 See if subroutines work
-t/op/each.t 34 See if associative iterators work
-t/op/eval.t 21 See if eval operator works
-t/op/exec.t 35 See if exec and system work
-t/op/exp.t 35 See if math functions work
-t/op/flip.t 35 See if range operator works
-t/op/fork.t 36 See if fork works
-t/op/glob.t 36 See if <*> works
-t/op/goto.t 35 See if goto works
-t/op/groups.t 35 See if $( works
-t/op/index.t 34 See if index works
-t/op/int.t 36 See if int works
-t/op/join.t 36 See if join works
-t/op/list.t 33 See if array lists work
-t/op/local.t 35 See if local works
-t/op/magic.t 35 See if magic variables work
-t/op/mkdir.t 36 See if mkdir works
-t/op/oct.t 36 See if oct and hex work
-t/op/ord.t 36 See if ord works
-t/op/pack.t 35 See if pack and unpack work
-t/op/pat.t 28 See if esoteric patterns work
-t/op/push.t 34 See if push and pop work
-t/op/range.t 35 See if .. works
-t/op/re_tests 32 Input file for op.regexp
-t/op/read.t 36 See if read() works
-t/op/regexp.t 35 See if regular expressions work
-t/op/repeat.t 34 See if x operator works
-t/op/s.t 30 See if substitutions work
-t/op/sleep.t 36 See if sleep works
-t/op/sort.t 35 See if sort works
-t/op/split.t 34 See if split works
-t/op/sprintf.t 34 See if sprintf works
-t/op/stat.t 30 See if stat works
-t/op/study.t 30 See if study works
-t/op/substr.t 32 See if substr works
-t/op/time.t 35 See if time functions work
-t/op/undef.t 34 See if undef works
-t/op/unshift.t 36 See if unshift works
-t/op/vec.t 35 See if vectors work
-t/op/write.t 33 See if write works
-toke.c:AA 4 The tokener
-toke.c:AB 28
-usersub.c 32 User supplied (possibly proprietary) subroutines
-usub/Makefile 36 Makefile for curseperl
-usub/README 1 Instructions for user supplied subroutines
-usub/curses.mus 26 Glue routines for BSD curses
-usub/man2mus 34 A manual page to .mus translator
-usub/mus 33 A .mus to .c translator
-usub/pager 32 A sample pager in curseperl
-usub/usersub.c 36 An initialization file to call curses glue routines
-util.c 16 Utility routines
-util.h 35 Public declarations for the above
-x2p/EXTERN.h 36 Same as above
-x2p/INTERN.h 36 Same as above
-x2p/Makefile.SH 32 Precursor to Makefile
-x2p/a2p.h 29 Global declarations
-x2p/a2p.man 29 Manual page for awk to perl translator
-x2p/a2p.y 28 A yacc grammer for awk
-x2p/a2py.c 23 Awk compiler, sort of
-x2p/find2perl.SH 14 A find to perl translator
-x2p/handy.h 35 Handy definitions
-x2p/hash.c 30 Associative arrays again
-x2p/hash.h 34 Public declarations for the above
-x2p/s2p.SH 27 Sed to perl translator
-x2p/s2p.man 33 Manual page for sed to perl translator
-x2p/str.c 27 String handling package
-x2p/str.h 34 Public declarations for the above
-x2p/util.c 24 Utility routines
-x2p/util.h 35 Public declarations for the above
-x2p/walk.c 9 Parse tree walker
--- /dev/null
+After all the perl kits are run you should have the following files:
+
+Filename Kit Description
+-------- --- -----------
+Artistic 37 The "Artistic License"
+Configure:AA 8 Run this first
+Configure:AB 14
+Copying 33 The GNU General Public License
+EXTERN.h 44 Included before foreign .h files
+INTERN.h 44 Included before domestic .h files
+MANIFEST 31 This list of files
+Makefile.SH 15 Precursor to Makefile
+PACKINGLIST 19 Which files came from which kits
+README 1 The Instructions
+README.ncr 2 Special instructions for NCR
+README.uport 2 Special instructions for Microports
+README.xenix 2 Special instructions for Xenix
+Wishlist 44 Some things that may or may not happen
+arg.h 22 Public declarations for the above
+array.c 27 Numerically subscripted arrays
+array.h 43 Public declarations for the above
+atarist/FILES 42
+atarist/README.ST 1
+atarist/RESULTS 40
+atarist/atarist.c 36
+atarist/config.h 23
+atarist/echo.c 41
+atarist/explain 40
+atarist/makefile.sm 34
+atarist/makefile.st 34
+atarist/osbind.pl 36
+atarist/perldb.diff 37
+atarist/perlglob.c 43
+atarist/test/binhandl 44
+atarist/test/ccon 44
+atarist/test/dbm 40
+atarist/test/err 44
+atarist/test/gdbm 44
+atarist/test/gdbm.t 40
+atarist/test/glob 44
+atarist/test/osexample.pl44
+atarist/test/pi.pl 39
+atarist/test/printenv 20
+atarist/test/readme 35
+atarist/test/sig 44
+atarist/test/tbinmode 44
+atarist/usersub.c 44
+atarist/usub/README.ATARI 2
+atarist/usub/acurses.mus32
+atarist/usub/makefile.st43
+atarist/usub/usersub.c 43
+atarist/wildmat.c 34
+c2ph.SH 25 program to translate dbx stabs to perl
+c2ph.doc 33 documentation for c2ph
+cflags.SH 40 A script that emits C compilation flags per file
+client 43 A client to test sockets
+cmd.c 19 Command interpreter
+cmd.h 37 Public declarations for the above
+config.H 26 Sample config.h
+config_h.SH 22 Produces config.h
+cons.c 17 Routines to construct cmd nodes of a parse tree
+consarg.c 20 Routines to construct arg nodes of a parse tree
+doSH 43 Script to run all the *.SH files
+doarg.c 13 Scalar expression evaluation
+doio.c:AA 4 I/O operations
+doio.c:AB 25
+dolist.c 12 Array expression evaluation
+dump.c 35 Debugging output
+eg/ADB 27 An adb wrapper to put in your crash dir
+eg/README 1 Intro to example perl scripts
+eg/changes 43 A program to list recently changed files
+eg/down 44 A program to do things to subdirectories
+eg/dus 43 A program to do du -s on non-mounted dirs
+eg/findcp 42 A find wrapper that implements a -cp switch
+eg/findtar 44 A find wrapper that pumps out a tar file
+eg/g/gcp 40 A program to do a global rcp
+eg/g/gcp.man 41 Manual page for gcp
+eg/g/ged 28 A program to do a global edit
+eg/g/ghosts 43 A sample /etc/ghosts file
+eg/g/gsh 39 A program to do a global rsh
+eg/g/gsh.man 41 Manual page for gsh
+eg/muck 39 A program to find missing make dependencies
+eg/muck.man 43 Manual page for muck
+eg/myrup 43 A program to find lightly loaded machines
+eg/nih 44 Script to insert #! workaround
+eg/relink 40 A program to change symbolic links
+eg/rename 41 A program to rename files
+eg/rmfrom 44 A program to feed doomed filenames to
+eg/scan/scan_df 42 Scan for filesystem anomalies
+eg/scan/scan_last 42 Scan for login anomalies
+eg/scan/scan_messages 37 Scan for console message anomalies
+eg/scan/scan_passwd 43 Scan for passwd file anomalies
+eg/scan/scan_ps 43 Scan for process anomalies
+eg/scan/scan_sudo 42 Scan for sudo anomalies
+eg/scan/scan_suid 40 Scan for setuid anomalies
+eg/scan/scanner 41 An anomaly reporter
+eg/shmkill 43 A program to remove unused shared memory
+eg/sysvipc/README 2 Intro to Sys V IPC examples
+eg/sysvipc/ipcmsg 17 Example of SYS V IPC message queues
+eg/sysvipc/ipcsem 43 Example of Sys V IPC semaphores
+eg/sysvipc/ipcshm 42 Example of Sys V IPC shared memory
+eg/travesty 43 A program to print travesties of its input text
+eg/van/empty 43 A program to empty the trashcan
+eg/van/unvanish 42 A program to undo what vanish does
+eg/van/vanexp 44 A program to expire vanished files
+eg/van/vanish 41 A program to put files in a trashcan
+eg/who 44 A sample who program
+emacs/perl-mode.el 27 Emacs major mode for perl
+emacs/perldb.el 24 Emacs debugging
+emacs/perldb.pl 27 Emacs debugging
+emacs/tedstuff 33 Some optional patches
+eval.c:AA 7 The expression evaluator
+eval.c:AB 30
+form.c 34 Format processing
+form.h 43 Public declarations for the above
+gettest 43 A little script to test the get* routines
+h2ph.SH 36 A thing to turn C .h file into perl .ph files
+h2pl/README 2 How to turn .ph files into .pl files
+h2pl/cbreak.pl 43 cbreak routines using .ph
+h2pl/cbreak2.pl 43 cbreak routines using .pl
+h2pl/eg/sizeof.ph 44 Sample sizeof array initialization
+h2pl/eg/sys/errno.pl 41 Sample translated errno.pl
+h2pl/eg/sys/ioctl.pl 38 Sample translated ioctl.pl
+h2pl/eg/sysexits.pl 44 Sample translated sysexits.pl
+h2pl/getioctlsizes 44 Program to extract types from ioctl.h
+h2pl/mksizes 43 Program to make %sizeof array.
+h2pl/mkvars 43 Program to make .pl from .ph files
+h2pl/tcbreak 29 cbreak test routine using .ph
+h2pl/tcbreak2 22 cbreak test routine using .pl
+handy.h 38 Handy definitions
+hash.c 26 Associative arrays
+hash.h 41 Public declarations for the above
+hints/3b1.sh 44
+hints/3b1cc 41
+hints/3b2.sh 44
+hints/aix_rs.sh 44
+hints/aix_rt.sh 44
+hints/altos486.sh 44
+hints/apollo_C6_7.sh 32
+hints/apollo_C6_8.sh 43
+hints/aux.sh 44
+hints/cray.sh 44
+hints/dgux.sh 44
+hints/dnix.sh 44
+hints/dynix.sh 44
+hints/fps.sh 24
+hints/genix.sh 44
+hints/greenhills.sh 44
+hints/hp9000_300.sh 44
+hints/hp9000_400.sh 44
+hints/hp9000_700.sh 44
+hints/hp9000_800.sh 44
+hints/hpux.sh 44
+hints/i386.sh 44
+hints/isc_3_2_2.sh 44
+hints/isc_3_2_3.sh 44
+hints/mc6000.sh 44
+hints/mips.sh 44
+hints/mpc.sh 44
+hints/ncr_tower.sh 44
+hints/next.sh 44
+hints/opus.sh 44
+hints/osf1.sh 44
+hints/sco_2_3_0.sh 44
+hints/sco_2_3_1.sh 1
+hints/sco_2_3_2.sh 44
+hints/sco_2_3_3.sh 44
+hints/sco_2_3_4.sh 44
+hints/sco_3.sh 44
+hints/sgi.sh 44
+hints/solaris_2_0.sh 44
+hints/stellar.sh 44
+hints/sunos_3_4.sh 44
+hints/sunos_3_5.sh 44
+hints/sunos_4_0_1.sh 44
+hints/sunos_4_0_2.sh 44
+hints/svr4.sh 15
+hints/ti1500.sh 44
+hints/titan.sh 42
+hints/ultrix_1.sh 44
+hints/ultrix_3.sh 44
+hints/ultrix_4.sh 16
+hints/unisysdynix.sh 44
+hints/utekv.sh 43
+hints/uts.sh 44
+hints/vax.sh 33
+installperl 37 Perl script to do "make install" dirty work
+ioctl.pl 39 Sample ioctl.pl
+lib/abbrev.pl 43 An abbreviation table builder
+lib/assert.pl 42 assertion and panic with stack trace
+lib/bigfloat.pl 36 An arbitrary precision floating point package
+lib/bigint.pl 34 An arbitrary precision integer arithmetic package
+lib/bigrat.pl 31 An arbitrary precision rational arithmetic package
+lib/cacheout.pl 43 Manages output filehandles when you need too many
+lib/chat2.pl 35 Randal's famous expect-ish routines
+lib/complete.pl 40 A command completion subroutine
+lib/ctime.pl 41 A ctime workalike
+lib/dumpvar.pl 43 A variable dumper
+lib/exceptions.pl 36 catch and throw routines
+lib/fastcwd.pl 43 a faster but more dangerous getcwd
+lib/find.pl 40 A find emulator--used by find2perl
+lib/finddepth.pl 40 A depth-first find emulator--used by find2perl
+lib/flush.pl 44 Routines to do single flush
+lib/getcwd.pl 42 a getcwd() emulator
+lib/getopt.pl 42 Perl library supporting option parsing
+lib/getopts.pl 42 Perl library supporting option parsing
+lib/importenv.pl 44 Perl routine to get environment into variables
+lib/look.pl 42 A "look" equivalent
+lib/newgetopt.pl 35 A perl library supporting long option parsing
+lib/open2.pl 41
+lib/perldb.pl 23 Perl debugging routines
+lib/pwd.pl 42 Routines to keep track of PWD environment variable
+lib/shellwords.pl 43 Perl library to split into words with shell quoting
+lib/stat.pl 43 Perl library supporting stat function
+lib/syslog.pl 35 Perl library supporting syslogging
+lib/termcap.pl 39 Perl library supporting termcap usage
+lib/timelocal.pl 40 Perl library supporting inverse of localtime, gmtime
+lib/validate.pl 39 Perl library supporting wholesale file mode validation
+makedepend.SH 37 Precursor to makedepend
+makedir.SH 42 Precursor to makedir
+malloc.c 32 A version of malloc you might not want
+msdos/Changes.dds 41 Expanation of MS-DOS patches by Diomidis Spinellis
+msdos/Makefile 40 MS-DOS makefile
+msdos/README.msdos 1 Compiling and usage information
+msdos/Wishlist.dds 43 My wishlist
+msdos/chdir.c 41 A chdir that can change drives
+msdos/config.h 21 Definitions for msdos
+msdos/dir.h 42 MS-DOS header for directory access functions
+msdos/directory.c 38 MS-DOS directory access functions.
+msdos/eg/crlf.bat 43 Convert files from unix to MS-DOS line termination
+msdos/eg/drives.bat 42 List the system drives and their characteristics
+msdos/eg/lf.bat 43 Convert files from MS-DOS to Unix line termination
+msdos/glob.c 44 A command equivalent to csh glob
+msdos/msdos.c 37 MS-DOS ioctl, sleep, gete?[gu]if, spawn, aspawn
+msdos/popen.c 39 My_popen and my_pclose for MS-DOS
+msdos/usage.c 41 How to invoke perl under MS-DOS
+os2/Makefile 42 Makefile for OS/2
+os2/README.OS2 1 Notes for OS/2
+os2/a2p.cs 42 Compiler script for a2p
+os2/a2p.def 44 Linker defs for a2p
+os2/alarm.c 38 An implementation of alarm()
+os2/alarm.h 44 Header file for same
+os2/config.h 24 Configuration file for OS/2
+os2/crypt.c 35
+os2/dir.h 41 Directory header
+os2/director.c 38 Directory routines
+os2/eg/alarm.pl 44 Example of alarm code
+os2/eg/os2.pl 41 Sample script for OS/2
+os2/eg/syscalls.pl 19 Example of syscall on OS/2
+os2/glob.c 44 Globbing routines
+os2/makefile 39 Make file
+os2/mktemp.c 44 Mktemp() using TMP
+os2/os2.c 36 Unix compatibility functions
+os2/perl.bad 44 names of protect-only API calls for BIND
+os2/perl.cs 43 Compiler script for perl
+os2/perl.def 23 Linker defs for perl
+os2/perldb.dif 30 Changes to make the debugger work
+os2/perlglob.bad 44 names of protect-only API calls for BIND
+os2/perlglob.cs 44 Compiler script for perlglob
+os2/perlglob.def 44 Linker defs for perlglob
+os2/perlsh.cmd 44 Poor man's shell for os2
+os2/popen.c 26 Code for opening pipes
+os2/s2p.cmd 18 s2p as command file
+os2/selfrun.bat 44 A self running perl script for DOS
+os2/selfrun.cmd 44 Example of extproc feature
+os2/suffix.c 38 Code for creating backup filenames
+os2/tests.dif 20
+patchlevel.h 44 The current patch level of perl
+perl.c 15 main()
+perl.h 29 Global declarations
+perl.man:AA 9 The manual page(s)
+perl.man:AB 10
+perl.man:AC 6
+perl.man:AD 11
+perl.man:AE 41
+perlsh 44 A poor man's perl shell
+perly.fixer 24 A program to remove yacc stack limitations
+perly.y 30 Yacc grammar for perl
+regcomp.c 2 Regular expression compiler
+regcomp.h 35 Private declarations for above
+regexec.c 28 Regular expression evaluator
+regexp.h 39 Public declarations for the above
+server 43 A server to test sockets
+spat.h 38 Search pattern declarations
+stab.c 29 Symbol table stuff
+stab.h 25 Public declarations for the above
+str.c 18 String handling package
+str.h 36 Public declarations for the above
+t/README 1 Instructions for regression tests
+t/TEST 41 The regression tester
+t/base/cond.t 44 See if conditionals work
+t/base/if.t 44 See if if works
+t/base/lex.t 40 See if lexical items work
+t/base/pat.t 44 See if pattern matching works
+t/base/term.t 43 See if various terms work
+t/cmd/elsif.t 43 See if else-if works
+t/cmd/for.t 43 See if for loops work
+t/cmd/mod.t 43 See if statement modifiers work
+t/cmd/subval.t 13 See if subroutine values work
+t/cmd/switch.t 41 See if switch optimizations work
+t/cmd/while.t 40 See if while loops work
+t/comp/cmdopt.t 39 See if command optimization works
+t/comp/cpp.t 43 See if C preprocessor works
+t/comp/decl.t 44 See if declarations work
+t/comp/multiline.t 43 See if multiline strings work
+t/comp/package.t 43 See if packages work
+t/comp/script.t 44 See if script invokation works
+t/comp/term.t 42 See if more terms work
+t/io/argv.t 43 See if ARGV stuff works
+t/io/dup.t 43 See if >& works right
+t/io/fs.t 39 See if directory manipulations work
+t/io/inplace.t 44 See if inplace editing works
+t/io/pipe.t 43 See if secure pipes work
+t/io/print.t 44 See if print commands work
+t/io/tell.t 42 See if file seeking works
+t/lib/big.t 38 See if lib/bigint.pl works
+t/op/append.t 44 See if . works
+t/op/array.t 39 See if array operations work
+t/op/auto.t 21 See if autoincrement et all work
+t/op/chop.t 43 See if chop works
+t/op/cond.t 44 See if conditional expressions work
+t/op/dbm.t 40 See if dbm binding works
+t/op/delete.t 43 See if delete works
+t/op/do.t 42 See if subroutines work
+t/op/each.t 42 See if associative iterators work
+t/op/eval.t 42 See if eval operator works
+t/op/exec.t 43 See if exec and system work
+t/op/exp.t 43 See if math functions work
+t/op/flip.t 43 See if range operator works
+t/op/fork.t 44 See if fork works
+t/op/glob.t 44 See if <*> works
+t/op/goto.t 43 See if goto works
+t/op/groups.t 43 See if $( works
+t/op/index.t 12 See if index works
+t/op/int.t 44 See if int works
+t/op/join.t 44 See if join works
+t/op/list.t 40 See if array lists work
+t/op/local.t 43 See if local works
+t/op/magic.t 42 See if magic variables work
+t/op/mkdir.t 44 See if mkdir works
+t/op/oct.t 44 See if oct and hex work
+t/op/ord.t 44 See if ord works
+t/op/pack.t 43 See if pack and unpack work
+t/op/pat.t 38 See if esoteric patterns work
+t/op/push.t 42 See if push and pop work
+t/op/range.t 43 See if .. works
+t/op/re_tests 32 Input file for op.regexp
+t/op/read.t 44 See if read() works
+t/op/readdir.t 44 See if readdir() works
+t/op/regexp.t 43 See if regular expressions work
+t/op/repeat.t 42 See if x operator works
+t/op/s.t 38 See if substitutions work
+t/op/sleep.t 44 See if sleep works
+t/op/sort.t 42 See if sort works
+t/op/split.t 41 See if split works
+t/op/sprintf.t 44 See if sprintf works
+t/op/stat.t 37 See if stat works
+t/op/study.t 41 See if study works
+t/op/substr.t 2 See if substr works
+t/op/time.t 42 See if time functions work
+t/op/undef.t 42 See if undef works
+t/op/unshift.t 44 See if unshift works
+t/op/vec.t 43 See if vectors work
+t/op/write.t 41 See if write works
+toke.c:AA 3 The tokener
+toke.c:AB 31
+usersub.c 39 User supplied (possibly proprietary) subroutines
+usub/Makefile 44 Makefile for curseperl
+usub/README 1 Instructions for user supplied subroutines
+usub/bsdcurses.mus 32 what used to be curses.mus
+usub/curses.mus 21 Glue routines for BSD curses
+usub/man2mus 42 A manual page to .mus translator
+usub/mus 40 A .mus to .c translator
+usub/pager 39 A sample pager in curseperl
+usub/usersub.c 41 An initialization file to call curses glue routines
+util.c 16 Utility routines
+util.h 42 Public declarations for the above
+x2p/EXTERN.h 44 Same as above
+x2p/INTERN.h 44 Same as above
+x2p/Makefile.SH 23 Precursor to Makefile
+x2p/a2p.h 14 Global declarations
+x2p/a2p.man 36 Manual page for awk to perl translator
+x2p/a2p.y 17 A yacc grammer for awk
+x2p/a2py.c 28 Awk compiler, sort of
+x2p/cflags.SH 41 A script that emits C compilation flags per file
+x2p/find2perl.SH 33 A find to perl translator
+x2p/handy.h 42 Handy definitions
+x2p/hash.c 38 Associative arrays again
+x2p/hash.h 42 Public declarations for the above
+x2p/s2p.SH 31 Sed to perl translator
+x2p/s2p.man 40 Manual page for sed to perl translator
+x2p/str.c 16 String handling package
+x2p/str.h 42 Public declarations for the above
+x2p/util.c 37 Utility routines
+x2p/util.h 42 Public declarations for the above
+x2p/walk.c:AA 5 Parse tree walker
+x2p/walk.c:AB 42
+[This is an unsupported, pre-release version of Perl 5.0. It is expected
+to work only on a Sparc architecture machine. No Configure support is
+provided. In fact, if you succeed in configuring and making a new
+makefile, you'll probably overwrite the only makefile that works. Note
+that a Sparc executable comes with the kit, so you may not need to
+compile at all. There is no list of new features yet, but if you look
+at t/op/ref.t you'll see some of them in use. perl -Dxst is also fun.]
- Perl Kit, Version 4.0
+ Perl Kit, Version 5.0
- Copyright (c) 1989,1990,1991, Larry Wall
- All rights reserved.
+ Copyright (c) 1989,1990,1991,1992,1993, Larry Wall
+ All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of either:
--------------------------------------------------------------------------
-Perl is a language that combines some of the features of C, sed, awk and shell.
-See the manual page for more hype. There's also a Nutshell Handbook published
-by O'Reilly & Assoc. Their U.S. number is 1-800-338-6887 (dev-nuts) and
-their international number is 1-707-829-0515. E-mail to nuts@ora.com.
-
-Perl will probably not run on machines with a small address space.
+Perl is a language that combines some of the features of C, sed, awk
+and shell. See the manual page for more hype. There's also a Nutshell
+Handbook published by O'Reilly & Assoc. Their U.S. number is
+1-800-998-9938 and their international number is 1-707-829-0515.
+E-mail to nuts@ora.com.
Please read all the directions below before you proceed any further, and
then follow them carefully.
X /* " @(#)time.h (TWG) 2.2 88/05/17 " */
X
X! /*
-X HDEF( "@(#)$RCSfile: README.ncr,v $$Revision: 4.0.1.1 $$Date: 92/06/08 11:41:41 $" )
+X HDEF( "@(#)$RCSfile: README.ncr,v $$Revision: 4.1 $$Date: 92/08/07 17:18:12 $" )
X- */
X
X /*
X! # include <sys/twg_config.h>
X! #endif
X!
-X HDEF( "@(#)$RCSfile: README.ncr,v $$Revision: 4.0.1.1 $$Date: 92/06/08 11:41:41 $" )
+X HDEF( "@(#)$RCSfile: README.ncr,v $$Revision: 4.1 $$Date: 92/08/07 17:18:12 $" )
X
X /*
X * Structure returned by gettimeofday(2) system call,
--- /dev/null
+Article 1475 of comp.lang.tcl:
+Path: netlabs!news!usc!cs.utexas.edu!sun-barr!ames!agate!sprite.Berkeley.EDU!ouster
+From: ouster@sprite.Berkeley.EDU (John Ousterhout)
+Newsgroups: comp.lang.tcl
+Subject: Planning for Tcl 7.0
+Message-ID: <1avu22INN5ao@agate.berkeley.edu>
+Date: 8 Oct 92 00:06:26 GMT
+Organization: U.C. Berkeley Sprite Project
+Lines: 156
+NNTP-Posting-Host: tyranny.berkeley.edu
+
+
+For the last year I've made only small changes to Tcl while focussing
+on the canvas and text widgets for Tk. I'm now making plans to catch
+up on a bunch of much-needed bug fixes and enhancements to Tcl. Some
+of the changes I'm considering are not backwards-compatible. The
+purpose of this message is to let know know what changes I'm considering
+for Tcl 7.0 and to solicit feedback. I'm particularly interested in
+comments on the changes that are incompatible: I'll probably drop
+the changes for which I get lots of negative feedback and not much
+positive feedback. If there are other changes that you think are
+important but aren't contained on this list, let me know and I may add
+them.
+
+Incompatible changes:
+---------------------
+
+The changes listed below are likely to require changes to existing
+scripts and/or C code. Each change includes an explanation of why the
+change might be useful. I'd like to know whether or not you think the change
+is useful enough to justify the incompatibility.
+
+1. Eliminate the "|" option in the "open" command. Instead, add a
+"popen" command that does the same thing. Rationale: in the current
+implementation you can't open a file whose name begins with "|".
+Also, I think the "popen" command would be more logical.
+
+2. Eliminate the Tcl_WaitPids procedure and use the waitpid POSIX call
+instead. Also change the wait code to periodically poll for dead
+child processes so that zombie processes don't get left around forever.
+Rationale: the current code tends to leave zombies around in some
+situations. Switching to waitpid should solve this problem in a
+relatively portable fashion. The only incompatibility will be for
+C procedures that call Tcl_WaitPids; they'll have to switch to call
+waitpid instead. I'll provide a compatibility version of waitpid for
+use on systems that don't have it yet.
+
+3. Clean up backslash processing in several ways:
+ - Change backslash-newline to eat up all the whitespace following the
+ newline and replace the sequence with a single whitespace character.
+ Right now it only eats up the newline character and replaces it
+ with an empty string. Rationale: this would be more consistent
+ with other programs that process backslash-newline sequences.
+ - Eliminate the sequences \Mxx, \Cxxx, and \e.
+ Rationale: these sequences are left around from ancient times.
+ They're not particular compatible with any other program. I
+ should have removed them in Tcl 6.0 but didn't. They did get
+ removed from the documentation, however, so no-one should be
+ using them (?).
+ - Change \x (where x is not one of the characters that gets special
+ backslash treatment) to expand to x, not \x.
+ Rationale: the current behavior is inconsistent with all other
+ programs I know of that handle backslashes, and I think it's
+ confusing.
+ - Change "format" so it doesn't do an additional layer of backslash
+ processing on its format string.
+ Rationale: I don't know why it currently behaves as it does, and
+ I think it's confusing.
+
+4. Change "regsub" so that when no match occurs it sets the result
+variable to the original string, rather than leaving it unmodified.
+Rationale: the current behavior results in extra tests of the regsub
+result that could sometimes be avoided with the proposed new behavior.
+I doubt that there's much code that will break with the change (this
+would have to be code that depends on the result variable *not* being
+modified).
+
+5. Change the name "UNIX" in the "errorCode" variable to "POSIX".
+Rationale: I suspect that I'm eventually going to get a call from the
+USL lawyers on this one if I don't change it. Better to change it now
+in an orderly fashion so I don't have change it hastily in the future.
+
+6. Change glob to return only the names of existing files.
+Rationale: at present "glob */foo" expands * and generates a result
+without checking to see if each directory has a "foo" file in it. This
+makes the current behavior incompatible with csh, for example. One
+question is whether constructs like "glob {a,b}.c" should also check for
+the existence of each of the files. At present they don't (i.e. a.c and
+b.c will be returned even if they don't exist), but neither does csh. My
+inclination is to make the behavior match csh (names containing *?[] are
+checked for existence, others aren't). I'd be interested to hear
+opinions on this one: check all names for existence, check only names
+including *?[] (for csh compatibility), or keep it as it is?
+
+7. Change "gets" so it returns 1 for success and 0 for failure. At present
+it returns the line length for success and -1 for failure.
+Rationale: this would allow slightly simple Tcl scripts: you could just
+say
+ while [gets $f line] {...}
+instead of
+ while {[gets $f line] >= 0} {...}
+I'm not really convinced that this one is important enough to justify the
+incompatibility, so it won't take much negative feedback to kill it.
+
+Other changes:
+--------------
+
+The changes listed below shouldn't introduce substantial compatibility
+problems. Of course, any change can potentially cause scripts to stop
+working (e.g. almost any change will break the test suite), but very
+few if any people should be affected by these changes.
+
+8. Implement Tcl_CreateExternVar() procedure along lines proposed by
+Andreas Stolcke to tie a C variable to a Tcl variable with automatic
+updates between them.
+
+9. Changes to exec:
+ - Allow redirection to an existing file descriptor in "exec",
+ with a mechanism like >&1 or >& stdout.
+ - Allow file names immediately after ">" and "<" without
+ intervening spaces.
+
+10. Changes related to files:
+ - Fix Scott Bolte bug (closing stdin and stdout).
+ - Move TclGetOpenFile and OpenFile stuff to tcl.h so that they're
+ accessible to applications.
+ - Extend access modes in open to include the complete set of POSIX
+ access modes (such as O_EXCL and O_NONBLOCK).
+
+11. Re-instate Tcl_WatchInterp to notify application when an interpreter
+is deleted.
+
+12. Add "elseif" mechanism to "if" command for chaining "else {if ..."
+constructs more cleanly. Require exact matches on "then" and "else"
+keywords.
+
+13. Remove UNIX system call declarations from tclUnix.h. Use them from
+unistd.h instead, and provide a default version of unistd.h for systems
+that don't have one.
+
+14. Changes in the expr command, mostly following suggestions made by
+George Howlett a long time ago:
+ - Increase precision of floating-point results.
+ - Make floating-point numbers always print with a point.
+ - Add transcendental functions like sin and exp.
+ - Add explicit integer and floating conversion operations.
+ - Don't promote large integers to floating-point automatically.
+ - Allow multiple arguments to expr command.
+
+15. Extend lsort to allow alternate sorting mechanisms, like numeric,
+or client-supplied.
+
+16. Allow alternate pattern-matching forms (e.g. exact or regexp) for
+lsearch and case.
+
+17. Add XPG/3 positional argument specifiers to format (code contributed
+by Mark Diekhans).
+
+18. Change "file readlink" to return an error on systems that don't
+support it rather than removing the option entirely.
+
+19. Add a mechanism for scheduling a Tcl command to be executed when the
+interpreter reaches a clean point. This is needed for things like
+signal support.
+
+20. Change upvar so that you can refer to an element of an array as
+well as a whole array.
+
+
--- /dev/null
+Set KEEP on constant split
+Optimize foreach on array.
+Execute all BEGINs and ENDs.
+Make a good way to determine if *.pl is being executed directly.
+Make specialized allocators.
+Optimize switches.
+Do debugger
+Cache eval tree
+Implement eval once
+Cache m//g state
+rcatmaybe
+Fix length($&)
+eval {} coredump
+
+make tr/// return histogram in list context?
+Do anything with "hint"?
+When does split() go to @_?
+undef wantarray in void context?
rewrite regexp parser for better integrated optimization
add structured types and objects
allow for lexical scoping
+delete current sub
+++ /dev/null
-/* $RCSfile: arg.h,v $$Revision: 4.0.1.3 $$Date: 92/06/08 11:44:06 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- * You may distribute under the terms of either the GNU General Public
- * License or the Artistic License, as specified in the README file.
- *
- * $Log: arg.h,v $
- * Revision 4.0.1.3 92/06/08 11:44:06 lwall
- * patch20: O_PIPE conflicted with Atari
- * patch20: clarified debugging output for literals and double-quoted strings
- *
- * Revision 4.0.1.2 91/11/05 15:51:05 lwall
- * patch11: added eval {}
- * patch11: added sort {} LIST
- *
- * Revision 4.0.1.1 91/06/07 10:18:30 lwall
- * patch4: length($`), length($&), length($') now optimized to avoid string copy
- * patch4: new copyright notice
- * patch4: many, many itty-bitty portability fixes
- *
- * Revision 4.0 91/03/20 01:03:09 lwall
- * 4.0 baseline.
- *
- */
-
-#define O_NULL 0
-#define O_RCAT 1
-#define O_ITEM 2
-#define O_SCALAR 3
-#define O_ITEM2 4
-#define O_ITEM3 5
-#define O_CONCAT 6
-#define O_REPEAT 7
-#define O_MATCH 8
-#define O_NMATCH 9
-#define O_SUBST 10
-#define O_NSUBST 11
-#define O_ASSIGN 12
-#define O_LOCAL 13
-#define O_AASSIGN 14
-#define O_SASSIGN 15
-#define O_CHOP 16
-#define O_DEFINED 17
-#define O_UNDEF 18
-#define O_STUDY 19
-#define O_POW 20
-#define O_MULTIPLY 21
-#define O_DIVIDE 22
-#define O_MODULO 23
-#define O_ADD 24
-#define O_SUBTRACT 25
-#define O_LEFT_SHIFT 26
-#define O_RIGHT_SHIFT 27
-#define O_LT 28
-#define O_GT 29
-#define O_LE 30
-#define O_GE 31
-#define O_EQ 32
-#define O_NE 33
-#define O_NCMP 34
-#define O_BIT_AND 35
-#define O_XOR 36
-#define O_BIT_OR 37
-#define O_AND 38
-#define O_OR 39
-#define O_COND_EXPR 40
-#define O_COMMA 41
-#define O_NEGATE 42
-#define O_NOT 43
-#define O_COMPLEMENT 44
-#define O_SELECT 45
-#define O_WRITE 46
-#define O_DBMOPEN 47
-#define O_DBMCLOSE 48
-#define O_OPEN 49
-#define O_TRANS 50
-#define O_NTRANS 51
-#define O_CLOSE 52
-#define O_EACH 53
-#define O_VALUES 54
-#define O_KEYS 55
-#define O_LARRAY 56
-#define O_ARRAY 57
-#define O_AELEM 58
-#define O_DELETE 59
-#define O_LHASH 60
-#define O_HASH 61
-#define O_HELEM 62
-#define O_LAELEM 63
-#define O_LHELEM 64
-#define O_LSLICE 65
-#define O_ASLICE 66
-#define O_HSLICE 67
-#define O_LASLICE 68
-#define O_LHSLICE 69
-#define O_SPLICE 70
-#define O_PUSH 71
-#define O_POP 72
-#define O_SHIFT 73
-#define O_UNPACK 74
-#define O_SPLIT 75
-#define O_LENGTH 76
-#define O_SPRINTF 77
-#define O_SUBSTR 78
-#define O_PACK 79
-#define O_GREP 80
-#define O_JOIN 81
-#define O_SLT 82
-#define O_SGT 83
-#define O_SLE 84
-#define O_SGE 85
-#define O_SEQ 86
-#define O_SNE 87
-#define O_SCMP 88
-#define O_SUBR 89
-#define O_DBSUBR 90
-#define O_CALLER 91
-#define O_SORT 92
-#define O_REVERSE 93
-#define O_WARN 94
-#define O_DIE 95
-#define O_PRTF 96
-#define O_PRINT 97
-#define O_CHDIR 98
-#define O_EXIT 99
-#define O_RESET 100
-#define O_LIST 101
-#define O_EOF 102
-#define O_GETC 103
-#define O_TELL 104
-#define O_RECV 105
-#define O_READ 106
-#define O_SYSREAD 107
-#define O_SYSWRITE 108
-#define O_SEND 109
-#define O_SEEK 110
-#define O_RETURN 111
-#define O_REDO 112
-#define O_NEXT 113
-#define O_LAST 114
-#define O_DUMP 115
-#define O_GOTO 116
-#define O_INDEX 117
-#define O_RINDEX 118
-#define O_TIME 119
-#define O_TMS 120
-#define O_LOCALTIME 121
-#define O_GMTIME 122
-#define O_TRUNCATE 123
-#define O_LSTAT 124
-#define O_STAT 125
-#define O_CRYPT 126
-#define O_ATAN2 127
-#define O_SIN 128
-#define O_COS 129
-#define O_RAND 130
-#define O_SRAND 131
-#define O_EXP 132
-#define O_LOG 133
-#define O_SQRT 134
-#define O_INT 135
-#define O_ORD 136
-#define O_ALARM 137
-#define O_SLEEP 138
-#define O_RANGE 139
-#define O_F_OR_R 140
-#define O_FLIP 141
-#define O_FLOP 142
-#define O_FORK 143
-#define O_WAIT 144
-#define O_WAITPID 145
-#define O_SYSTEM 146
-#define O_EXEC_OP 147
-#define O_HEX 148
-#define O_OCT 149
-#define O_CHOWN 150
-#define O_KILL 151
-#define O_UNLINK 152
-#define O_CHMOD 153
-#define O_UTIME 154
-#define O_UMASK 155
-#define O_MSGGET 156
-#define O_SHMGET 157
-#define O_SEMGET 158
-#define O_MSGCTL 159
-#define O_SHMCTL 160
-#define O_SEMCTL 161
-#define O_MSGSND 162
-#define O_MSGRCV 163
-#define O_SEMOP 164
-#define O_SHMREAD 165
-#define O_SHMWRITE 166
-#define O_RENAME 167
-#define O_LINK 168
-#define O_MKDIR 169
-#define O_RMDIR 170
-#define O_GETPPID 171
-#define O_GETPGRP 172
-#define O_SETPGRP 173
-#define O_GETPRIORITY 174
-#define O_SETPRIORITY 175
-#define O_CHROOT 176
-#define O_FCNTL 177
-#define O_IOCTL 178
-#define O_FLOCK 179
-#define O_UNSHIFT 180
-#define O_REQUIRE 181
-#define O_DOFILE 182
-#define O_EVAL 183
-#define O_FTRREAD 184
-#define O_FTRWRITE 185
-#define O_FTREXEC 186
-#define O_FTEREAD 187
-#define O_FTEWRITE 188
-#define O_FTEEXEC 189
-#define O_FTIS 190
-#define O_FTEOWNED 191
-#define O_FTROWNED 192
-#define O_FTZERO 193
-#define O_FTSIZE 194
-#define O_FTMTIME 195
-#define O_FTATIME 196
-#define O_FTCTIME 197
-#define O_FTSOCK 198
-#define O_FTCHR 199
-#define O_FTBLK 200
-#define O_FTFILE 201
-#define O_FTDIR 202
-#define O_FTPIPE 203
-#define O_FTLINK 204
-#define O_SYMLINK 205
-#define O_READLINK 206
-#define O_FTSUID 207
-#define O_FTSGID 208
-#define O_FTSVTX 209
-#define O_FTTTY 210
-#define O_FTTEXT 211
-#define O_FTBINARY 212
-#define O_SOCKET 213
-#define O_BIND 214
-#define O_CONNECT 215
-#define O_LISTEN 216
-#define O_ACCEPT 217
-#define O_GHBYNAME 218
-#define O_GHBYADDR 219
-#define O_GHOSTENT 220
-#define O_GNBYNAME 221
-#define O_GNBYADDR 222
-#define O_GNETENT 223
-#define O_GPBYNAME 224
-#define O_GPBYNUMBER 225
-#define O_GPROTOENT 226
-#define O_GSBYNAME 227
-#define O_GSBYPORT 228
-#define O_GSERVENT 229
-#define O_SHOSTENT 230
-#define O_SNETENT 231
-#define O_SPROTOENT 232
-#define O_SSERVENT 233
-#define O_EHOSTENT 234
-#define O_ENETENT 235
-#define O_EPROTOENT 236
-#define O_ESERVENT 237
-#define O_SOCKPAIR 238
-#define O_SHUTDOWN 239
-#define O_GSOCKOPT 240
-#define O_SSOCKOPT 241
-#define O_GETSOCKNAME 242
-#define O_GETPEERNAME 243
-#define O_SSELECT 244
-#define O_FILENO 245
-#define O_BINMODE 246
-#define O_VEC 247
-#define O_GPWNAM 248
-#define O_GPWUID 249
-#define O_GPWENT 250
-#define O_SPWENT 251
-#define O_EPWENT 252
-#define O_GGRNAM 253
-#define O_GGRGID 254
-#define O_GGRENT 255
-#define O_SGRENT 256
-#define O_EGRENT 257
-#define O_GETLOGIN 258
-#define O_OPEN_DIR 259
-#define O_READDIR 260
-#define O_TELLDIR 261
-#define O_SEEKDIR 262
-#define O_REWINDDIR 263
-#define O_CLOSEDIR 264
-#define O_SYSCALL 265
-#define O_PIPE_OP 266
-#define O_TRY 267
-#define O_EVALONCE 268
-#define MAXO 269
-
-#ifndef DOINIT
-extern char *opname[];
-#else
-char *opname[] = {
- "NULL",
- "RCAT",
- "ITEM",
- "SCALAR",
- "ITEM2",
- "ITEM3",
- "CONCAT",
- "REPEAT",
- "MATCH",
- "NMATCH",
- "SUBST",
- "NSUBST",
- "ASSIGN",
- "LOCAL",
- "AASSIGN",
- "SASSIGN",
- "CHOP",
- "DEFINED",
- "UNDEF",
- "STUDY",
- "POW",
- "MULTIPLY",
- "DIVIDE",
- "MODULO",
- "ADD",
- "SUBTRACT",
- "LEFT_SHIFT",
- "RIGHT_SHIFT",
- "LT",
- "GT",
- "LE",
- "GE",
- "EQ",
- "NE",
- "NCMP",
- "BIT_AND",
- "XOR",
- "BIT_OR",
- "AND",
- "OR",
- "COND_EXPR",
- "COMMA",
- "NEGATE",
- "NOT",
- "COMPLEMENT",
- "SELECT",
- "WRITE",
- "DBMOPEN",
- "DBMCLOSE",
- "OPEN",
- "TRANS",
- "NTRANS",
- "CLOSE",
- "EACH",
- "VALUES",
- "KEYS",
- "LARRAY",
- "ARRAY",
- "AELEM",
- "DELETE",
- "LHASH",
- "HASH",
- "HELEM",
- "LAELEM",
- "LHELEM",
- "LSLICE",
- "ASLICE",
- "HSLICE",
- "LASLICE",
- "LHSLICE",
- "SPLICE",
- "PUSH",
- "POP",
- "SHIFT",
- "UNPACK",
- "SPLIT",
- "LENGTH",
- "SPRINTF",
- "SUBSTR",
- "PACK",
- "GREP",
- "JOIN",
- "SLT",
- "SGT",
- "SLE",
- "SGE",
- "SEQ",
- "SNE",
- "SCMP",
- "SUBR",
- "DBSUBR",
- "CALLER",
- "SORT",
- "REVERSE",
- "WARN",
- "DIE",
- "PRINTF",
- "PRINT",
- "CHDIR",
- "EXIT",
- "RESET",
- "LIST",
- "EOF",
- "GETC",
- "TELL",
- "RECV",
- "READ",
- "SYSREAD",
- "SYSWRITE",
- "SEND",
- "SEEK",
- "RETURN",
- "REDO",
- "NEXT",
- "LAST",
- "DUMP",
- "GOTO",/* shudder */
- "INDEX",
- "RINDEX",
- "TIME",
- "TIMES",
- "LOCALTIME",
- "GMTIME",
- "TRUNCATE",
- "LSTAT",
- "STAT",
- "CRYPT",
- "ATAN2",
- "SIN",
- "COS",
- "RAND",
- "SRAND",
- "EXP",
- "LOG",
- "SQRT",
- "INT",
- "ORD",
- "ALARM",
- "SLEEP",
- "RANGE",
- "FLIP_OR_RANGE",
- "FLIP",
- "FLOP",
- "FORK",
- "WAIT",
- "WAITPID",
- "SYSTEM",
- "EXEC",
- "HEX",
- "OCT",
- "CHOWN",
- "KILL",
- "UNLINK",
- "CHMOD",
- "UTIME",
- "UMASK",
- "MSGGET",
- "SHMGET",
- "SEMGET",
- "MSGCTL",
- "SHMCTL",
- "SEMCTL",
- "MSGSND",
- "MSGRCV",
- "SEMOP",
- "SHMREAD",
- "SHMWRITE",
- "RENAME",
- "LINK",
- "MKDIR",
- "RMDIR",
- "GETPPID",
- "GETPGRP",
- "SETPGRP",
- "GETPRIORITY",
- "SETPRIORITY",
- "CHROOT",
- "FCNTL",
- "SYSIOCTL",
- "FLOCK",
- "UNSHIFT",
- "REQUIRE",
- "DOFILE",
- "EVAL",
- "FTRREAD",
- "FTRWRITE",
- "FTREXEC",
- "FTEREAD",
- "FTEWRITE",
- "FTEEXEC",
- "FTIS",
- "FTEOWNED",
- "FTROWNED",
- "FTZERO",
- "FTSIZE",
- "FTMTIME",
- "FTATIME",
- "FTCTIME",
- "FTSOCK",
- "FTCHR",
- "FTBLK",
- "FTFILE",
- "FTDIR",
- "FTPIPE",
- "FTLINK",
- "SYMLINK",
- "READLINK",
- "FTSUID",
- "FTSGID",
- "FTSVTX",
- "FTTTY",
- "FTTEXT",
- "FTBINARY",
- "SOCKET",
- "BIND",
- "CONNECT",
- "LISTEN",
- "ACCEPT",
- "GHBYNAME",
- "GHBYADDR",
- "GHOSTENT",
- "GNBYNAME",
- "GNBYADDR",
- "GNETENT",
- "GPBYNAME",
- "GPBYNUMBER",
- "GPROTOENT",
- "GSBYNAME",
- "GSBYPORT",
- "GSERVENT",
- "SHOSTENT",
- "SNETENT",
- "SPROTOENT",
- "SSERVENT",
- "EHOSTENT",
- "ENETENT",
- "EPROTOENT",
- "ESERVENT",
- "SOCKPAIR",
- "SHUTDOWN",
- "GSOCKOPT",
- "SSOCKOPT",
- "GETSOCKNAME",
- "GETPEERNAME",
- "SSELECT",
- "FILENO",
- "BINMODE",
- "VEC",
- "GPWNAM",
- "GPWUID",
- "GPWENT",
- "SPWENT",
- "EPWENT",
- "GGRNAM",
- "GGRGID",
- "GGRENT",
- "SGRENT",
- "EGRENT",
- "GETLOGIN",
- "OPENDIR",
- "READDIR",
- "TELLDIR",
- "SEEKDIR",
- "REWINDDIR",
- "CLOSEDIR",
- "SYSCALL",
- "PIPE",
- "TRY",
- "EVALONCE",
- "269"
-};
-#endif
-
-#define A_NULL 0
-#define A_EXPR 1
-#define A_CMD 2
-#define A_STAB 3
-#define A_LVAL 4
-#define A_SINGLE 5
-#define A_DOUBLE 6
-#define A_BACKTICK 7
-#define A_READ 8
-#define A_SPAT 9
-#define A_LEXPR 10
-#define A_ARYLEN 11
-#define A_ARYSTAB 12
-#define A_LARYLEN 13
-#define A_GLOB 14
-#define A_WORD 15
-#define A_INDREAD 16
-#define A_LARYSTAB 17
-#define A_STAR 18
-#define A_LSTAR 19
-#define A_WANTARRAY 20
-#define A_LENSTAB 21
-
-#define A_MASK 31
-#define A_DONT 32 /* or this into type to suppress evaluation */
-
-#ifndef DOINIT
-extern char *argname[];
-#else
-char *argname[] = {
- "A_NULL",
- "EXPR",
- "CMD",
- "STAB",
- "LVAL",
- "LITERAL",
- "DOUBLEQUOTE",
- "BACKTICK",
- "READ",
- "SPAT",
- "LEXPR",
- "ARYLEN",
- "ARYSTAB",
- "LARYLEN",
- "GLOB",
- "WORD",
- "INDREAD",
- "LARYSTAB",
- "STAR",
- "LSTAR",
- "WANTARRAY",
- "LENSTAB",
- "22"
-};
-#endif
-
-#ifndef DOINIT
-extern bool hoistable[];
-#else
-bool hoistable[] =
- {0, /* A_NULL */
- 0, /* EXPR */
- 1, /* CMD */
- 1, /* STAB */
- 0, /* LVAL */
- 1, /* SINGLE */
- 0, /* DOUBLE */
- 0, /* BACKTICK */
- 0, /* READ */
- 0, /* SPAT */
- 0, /* LEXPR */
- 1, /* ARYLEN */
- 1, /* ARYSTAB */
- 0, /* LARYLEN */
- 0, /* GLOB */
- 1, /* WORD */
- 0, /* INDREAD */
- 0, /* LARYSTAB */
- 1, /* STAR */
- 1, /* LSTAR */
- 1, /* WANTARRAY */
- 0, /* LENSTAB */
- 0, /* 21 */
-};
-#endif
-
-union argptr {
- ARG *arg_arg;
- char *arg_cval;
- STAB *arg_stab;
- SPAT *arg_spat;
- CMD *arg_cmd;
- STR *arg_str;
- HASH *arg_hash;
-};
-
-struct arg {
- union argptr arg_ptr;
- short arg_len;
- unsigned short arg_type;
- unsigned short arg_flags;
-};
-
-#define AF_ARYOK 1 /* op can handle multiple values here */
-#define AF_POST 2 /* post *crement this item */
-#define AF_PRE 4 /* pre *crement this item */
-#define AF_UP 8 /* increment rather than decrement */
-#define AF_COMMON 16 /* left and right have symbols in common */
-#define AF_DEPR 32 /* an older form of the construct */
-#define AF_LISTISH 64 /* turn into list if important */
-#define AF_LOCAL 128 /* list of local variables */
-
-/*
- * Most of the ARG pointers are used as pointers to arrays of ARG. When
- * so used, the 0th element is special, and represents the operator to
- * use on the list of arguments following. The arg_len in the 0th element
- * gives the maximum argument number, and the arg_str is used to store
- * the return value in a more-or-less static location. Sorry it's not
- * re-entrant (yet), but it sure makes it efficient. The arg_type of the
- * 0th element is an operator (O_*) rather than an argument type (A_*).
- */
-
-#define Nullarg Null(ARG*)
-
-#ifndef DOINIT
-EXT unsigned short opargs[MAXO+1];
-#else
-#define A(e1,e2,e3) (e1+(e2<<2)+(e3<<4))
-#define A5(e1,e2,e3,e4,e5) (e1+(e2<<2)+(e3<<4)+(e4<<6)+(e5<<8))
-unsigned short opargs[MAXO+1] = {
- A(0,0,0), /* NULL */
- A(1,1,0), /* RCAT */
- A(1,0,0), /* ITEM */
- A(1,0,0), /* SCALAR */
- A(0,0,0), /* ITEM2 */
- A(0,0,0), /* ITEM3 */
- A(1,1,0), /* CONCAT */
- A(3,1,0), /* REPEAT */
- A(1,0,0), /* MATCH */
- A(1,0,0), /* NMATCH */
- A(1,0,0), /* SUBST */
- A(1,0,0), /* NSUBST */
- A(1,1,0), /* ASSIGN */
- A(1,0,0), /* LOCAL */
- A(3,3,0), /* AASSIGN */
- A(0,0,0), /* SASSIGN */
- A(3,0,0), /* CHOP */
- A(1,0,0), /* DEFINED */
- A(1,0,0), /* UNDEF */
- A(1,0,0), /* STUDY */
- A(1,1,0), /* POW */
- A(1,1,0), /* MULTIPLY */
- A(1,1,0), /* DIVIDE */
- A(1,1,0), /* MODULO */
- A(1,1,0), /* ADD */
- A(1,1,0), /* SUBTRACT */
- A(1,1,0), /* LEFT_SHIFT */
- A(1,1,0), /* RIGHT_SHIFT */
- A(1,1,0), /* LT */
- A(1,1,0), /* GT */
- A(1,1,0), /* LE */
- A(1,1,0), /* GE */
- A(1,1,0), /* EQ */
- A(1,1,0), /* NE */
- A(1,1,0), /* NCMP */
- A(1,1,0), /* BIT_AND */
- A(1,1,0), /* XOR */
- A(1,1,0), /* BIT_OR */
- A(1,0,0), /* AND */
- A(1,0,0), /* OR */
- A(1,0,0), /* COND_EXPR */
- A(1,1,0), /* COMMA */
- A(1,0,0), /* NEGATE */
- A(1,0,0), /* NOT */
- A(1,0,0), /* COMPLEMENT */
- A(1,0,0), /* SELECT */
- A(1,0,0), /* WRITE */
- A(1,1,1), /* DBMOPEN */
- A(1,0,0), /* DBMCLOSE */
- A(1,1,0), /* OPEN */
- A(1,0,0), /* TRANS */
- A(1,0,0), /* NTRANS */
- A(1,0,0), /* CLOSE */
- A(0,0,0), /* EACH */
- A(0,0,0), /* VALUES */
- A(0,0,0), /* KEYS */
- A(0,0,0), /* LARRAY */
- A(0,0,0), /* ARRAY */
- A(0,1,0), /* AELEM */
- A(0,1,0), /* DELETE */
- A(0,0,0), /* LHASH */
- A(0,0,0), /* HASH */
- A(0,1,0), /* HELEM */
- A(0,1,0), /* LAELEM */
- A(0,1,0), /* LHELEM */
- A(0,3,3), /* LSLICE */
- A(0,3,0), /* ASLICE */
- A(0,3,0), /* HSLICE */
- A(0,3,0), /* LASLICE */
- A(0,3,0), /* LHSLICE */
- A(0,3,1), /* SPLICE */
- A(0,3,0), /* PUSH */
- A(0,0,0), /* POP */
- A(0,0,0), /* SHIFT */
- A(1,1,0), /* UNPACK */
- A(1,0,1), /* SPLIT */
- A(1,0,0), /* LENGTH */
- A(3,0,0), /* SPRINTF */
- A(1,1,1), /* SUBSTR */
- A(1,3,0), /* PACK */
- A(0,3,0), /* GREP */
- A(1,3,0), /* JOIN */
- A(1,1,0), /* SLT */
- A(1,1,0), /* SGT */
- A(1,1,0), /* SLE */
- A(1,1,0), /* SGE */
- A(1,1,0), /* SEQ */
- A(1,1,0), /* SNE */
- A(1,1,0), /* SCMP */
- A(0,3,0), /* SUBR */
- A(0,3,0), /* DBSUBR */
- A(1,0,0), /* CALLER */
- A(1,3,0), /* SORT */
- A(0,3,0), /* REVERSE */
- A(0,3,0), /* WARN */
- A(0,3,0), /* DIE */
- A(1,3,0), /* PRINTF */
- A(1,3,0), /* PRINT */
- A(1,0,0), /* CHDIR */
- A(1,0,0), /* EXIT */
- A(1,0,0), /* RESET */
- A(3,0,0), /* LIST */
- A(1,0,0), /* EOF */
- A(1,0,0), /* GETC */
- A(1,0,0), /* TELL */
- A5(1,1,1,1,0), /* RECV */
- A(1,1,3), /* READ */
- A(1,1,3), /* SYSREAD */
- A(1,1,3), /* SYSWRITE */
- A(1,1,3), /* SEND */
- A(1,1,1), /* SEEK */
- A(0,3,0), /* RETURN */
- A(0,0,0), /* REDO */
- A(0,0,0), /* NEXT */
- A(0,0,0), /* LAST */
- A(0,0,0), /* DUMP */
- A(0,0,0), /* GOTO */
- A(1,1,1), /* INDEX */
- A(1,1,1), /* RINDEX */
- A(0,0,0), /* TIME */
- A(0,0,0), /* TIMES */
- A(1,0,0), /* LOCALTIME */
- A(1,0,0), /* GMTIME */
- A(1,1,0), /* TRUNCATE */
- A(1,0,0), /* LSTAT */
- A(1,0,0), /* STAT */
- A(1,1,0), /* CRYPT */
- A(1,1,0), /* ATAN2 */
- A(1,0,0), /* SIN */
- A(1,0,0), /* COS */
- A(1,0,0), /* RAND */
- A(1,0,0), /* SRAND */
- A(1,0,0), /* EXP */
- A(1,0,0), /* LOG */
- A(1,0,0), /* SQRT */
- A(1,0,0), /* INT */
- A(1,0,0), /* ORD */
- A(1,0,0), /* ALARM */
- A(1,0,0), /* SLEEP */
- A(1,1,0), /* RANGE */
- A(1,0,0), /* F_OR_R */
- A(1,0,0), /* FLIP */
- A(0,1,0), /* FLOP */
- A(0,0,0), /* FORK */
- A(0,0,0), /* WAIT */
- A(1,1,0), /* WAITPID */
- A(1,3,0), /* SYSTEM */
- A(1,3,0), /* EXEC */
- A(1,0,0), /* HEX */
- A(1,0,0), /* OCT */
- A(0,3,0), /* CHOWN */
- A(0,3,0), /* KILL */
- A(0,3,0), /* UNLINK */
- A(0,3,0), /* CHMOD */
- A(0,3,0), /* UTIME */
- A(1,0,0), /* UMASK */
- A(1,1,0), /* MSGGET */
- A(1,1,1), /* SHMGET */
- A(1,1,1), /* SEMGET */
- A(1,1,1), /* MSGCTL */
- A(1,1,1), /* SHMCTL */
- A5(1,1,1,1,0), /* SEMCTL */
- A(1,1,1), /* MSGSND */
- A5(1,1,1,1,1), /* MSGRCV */
- A(1,1,1), /* SEMOP */
- A5(1,1,1,1,0), /* SHMREAD */
- A5(1,1,1,1,0), /* SHMWRITE */
- A(1,1,0), /* RENAME */
- A(1,1,0), /* LINK */
- A(1,1,0), /* MKDIR */
- A(1,0,0), /* RMDIR */
- A(0,0,0), /* GETPPID */
- A(1,0,0), /* GETPGRP */
- A(1,1,0), /* SETPGRP */
- A(1,1,0), /* GETPRIORITY */
- A(1,1,1), /* SETPRIORITY */
- A(1,0,0), /* CHROOT */
- A(1,1,1), /* FCNTL */
- A(1,1,1), /* SYSIOCTL */
- A(1,1,0), /* FLOCK */
- A(0,3,0), /* UNSHIFT */
- A(1,0,0), /* REQUIRE */
- A(1,0,0), /* DOFILE */
- A(1,0,0), /* EVAL */
- A(1,0,0), /* FTRREAD */
- A(1,0,0), /* FTRWRITE */
- A(1,0,0), /* FTREXEC */
- A(1,0,0), /* FTEREAD */
- A(1,0,0), /* FTEWRITE */
- A(1,0,0), /* FTEEXEC */
- A(1,0,0), /* FTIS */
- A(1,0,0), /* FTEOWNED */
- A(1,0,0), /* FTROWNED */
- A(1,0,0), /* FTZERO */
- A(1,0,0), /* FTSIZE */
- A(1,0,0), /* FTMTIME */
- A(1,0,0), /* FTATIME */
- A(1,0,0), /* FTCTIME */
- A(1,0,0), /* FTSOCK */
- A(1,0,0), /* FTCHR */
- A(1,0,0), /* FTBLK */
- A(1,0,0), /* FTFILE */
- A(1,0,0), /* FTDIR */
- A(1,0,0), /* FTPIPE */
- A(1,0,0), /* FTLINK */
- A(1,1,0), /* SYMLINK */
- A(1,0,0), /* READLINK */
- A(1,0,0), /* FTSUID */
- A(1,0,0), /* FTSGID */
- A(1,0,0), /* FTSVTX */
- A(1,0,0), /* FTTTY */
- A(1,0,0), /* FTTEXT */
- A(1,0,0), /* FTBINARY */
- A5(1,1,1,1,0), /* SOCKET */
- A(1,1,0), /* BIND */
- A(1,1,0), /* CONNECT */
- A(1,1,0), /* LISTEN */
- A(1,1,0), /* ACCEPT */
- A(1,0,0), /* GHBYNAME */
- A(1,1,0), /* GHBYADDR */
- A(0,0,0), /* GHOSTENT */
- A(1,0,0), /* GNBYNAME */
- A(1,1,0), /* GNBYADDR */
- A(0,0,0), /* GNETENT */
- A(1,0,0), /* GPBYNAME */
- A(1,0,0), /* GPBYNUMBER */
- A(0,0,0), /* GPROTOENT */
- A(1,1,0), /* GSBYNAME */
- A(1,1,0), /* GSBYPORT */
- A(0,0,0), /* GSERVENT */
- A(1,0,0), /* SHOSTENT */
- A(1,0,0), /* SNETENT */
- A(1,0,0), /* SPROTOENT */
- A(1,0,0), /* SSERVENT */
- A(0,0,0), /* EHOSTENT */
- A(0,0,0), /* ENETENT */
- A(0,0,0), /* EPROTOENT */
- A(0,0,0), /* ESERVENT */
- A5(1,1,1,1,1), /* SOCKPAIR */
- A(1,1,0), /* SHUTDOWN */
- A(1,1,1), /* GSOCKOPT */
- A5(1,1,1,1,0), /* SSOCKOPT */
- A(1,0,0), /* GETSOCKNAME */
- A(1,0,0), /* GETPEERNAME */
- A5(1,1,1,1,0), /* SSELECT */
- A(1,0,0), /* FILENO */
- A(1,0,0), /* BINMODE */
- A(1,1,1), /* VEC */
- A(1,0,0), /* GPWNAM */
- A(1,0,0), /* GPWUID */
- A(0,0,0), /* GPWENT */
- A(0,0,0), /* SPWENT */
- A(0,0,0), /* EPWENT */
- A(1,0,0), /* GGRNAM */
- A(1,0,0), /* GGRGID */
- A(0,0,0), /* GGRENT */
- A(0,0,0), /* SGRENT */
- A(0,0,0), /* EGRENT */
- A(0,0,0), /* GETLOGIN */
- A(1,1,0), /* OPENDIR */
- A(1,0,0), /* READDIR */
- A(1,0,0), /* TELLDIR */
- A(1,1,0), /* SEEKDIR */
- A(1,0,0), /* REWINDDIR */
- A(1,0,0), /* CLOSEDIR */
- A(1,3,0), /* SYSCALL */
- A(1,1,0), /* PIPE */
- A(0,0,0), /* TRY */
- A(1,0,0), /* EVALONCE */
- 0
-};
-#undef A
-#undef A5
-#endif
-
-int do_trans();
-int do_split();
-bool do_eof();
-long do_tell();
-bool do_seek();
-int do_tms();
-int do_time();
-int do_stat();
-STR *do_push();
-FILE *nextargv();
-STR *do_fttext();
-int do_slice();
+++ /dev/null
-/* $RCSfile: array.c,v $$Revision: 4.0.1.3 $$Date: 92/06/08 11:45:05 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- * You may distribute under the terms of either the GNU General Public
- * License or the Artistic License, as specified in the README file.
- *
- * $Log: array.c,v $
- * Revision 4.0.1.3 92/06/08 11:45:05 lwall
- * patch20: Perl now distinguishes overlapped copies from non-overlapped
- *
- * Revision 4.0.1.2 91/11/05 16:00:14 lwall
- * patch11: random cleanup
- * patch11: passing non-existend array elements to subrouting caused core dump
- *
- * Revision 4.0.1.1 91/06/07 10:19:08 lwall
- * patch4: new copyright notice
- *
- * Revision 4.0 91/03/20 01:03:32 lwall
- * 4.0 baseline.
- *
- */
-
-#include "EXTERN.h"
-#include "perl.h"
-
-STR *
-afetch(ar,key,lval)
-register ARRAY *ar;
-int key;
-int lval;
-{
- STR *str;
-
- if (key < 0 || key > ar->ary_fill) {
- if (lval && key >= 0) {
- if (ar->ary_flags & ARF_REAL)
- str = Str_new(5,0);
- else
- str = str_mortal(&str_undef);
- (void)astore(ar,key,str);
- return str;
- }
- else
- return &str_undef;
- }
- if (!ar->ary_array[key]) {
- if (lval) {
- str = Str_new(6,0);
- (void)astore(ar,key,str);
- return str;
- }
- return &str_undef;
- }
- return ar->ary_array[key];
-}
-
-bool
-astore(ar,key,val)
-register ARRAY *ar;
-int key;
-STR *val;
-{
- int retval;
-
- if (key < 0)
- return FALSE;
- if (key > ar->ary_max) {
- int newmax;
-
- if (ar->ary_alloc != ar->ary_array) {
- retval = ar->ary_array - ar->ary_alloc;
- Move(ar->ary_array, ar->ary_alloc, ar->ary_max+1, STR*);
- Zero(ar->ary_alloc+ar->ary_max+1, retval, STR*);
- ar->ary_max += retval;
- ar->ary_array -= retval;
- if (key > ar->ary_max - 10) {
- newmax = key + ar->ary_max;
- goto resize;
- }
- }
- else {
- if (ar->ary_alloc) {
- newmax = key + ar->ary_max / 5;
- resize:
- Renew(ar->ary_alloc,newmax+1, STR*);
- Zero(&ar->ary_alloc[ar->ary_max+1], newmax - ar->ary_max, STR*);
- }
- else {
- newmax = key < 4 ? 4 : key;
- Newz(2,ar->ary_alloc, newmax+1, STR*);
- }
- ar->ary_array = ar->ary_alloc;
- ar->ary_max = newmax;
- }
- }
- if (ar->ary_flags & ARF_REAL) {
- if (ar->ary_fill < key) {
- while (++ar->ary_fill < key) {
- if (ar->ary_array[ar->ary_fill] != Nullstr) {
- str_free(ar->ary_array[ar->ary_fill]);
- ar->ary_array[ar->ary_fill] = Nullstr;
- }
- }
- }
- retval = (ar->ary_array[key] != Nullstr);
- if (retval)
- str_free(ar->ary_array[key]);
- }
- else
- retval = 0;
- ar->ary_array[key] = val;
- return retval;
-}
-
-ARRAY *
-anew(stab)
-STAB *stab;
-{
- register ARRAY *ar;
-
- New(1,ar,1,ARRAY);
- ar->ary_magic = Str_new(7,0);
- ar->ary_alloc = ar->ary_array = 0;
- str_magic(ar->ary_magic, stab, '#', Nullch, 0);
- ar->ary_max = ar->ary_fill = -1;
- ar->ary_flags = ARF_REAL;
- return ar;
-}
-
-ARRAY *
-afake(stab,size,strp)
-STAB *stab;
-register int size;
-register STR **strp;
-{
- register ARRAY *ar;
-
- New(3,ar,1,ARRAY);
- New(4,ar->ary_alloc,size+1,STR*);
- Copy(strp,ar->ary_alloc,size,STR*);
- ar->ary_array = ar->ary_alloc;
- ar->ary_magic = Str_new(8,0);
- str_magic(ar->ary_magic, stab, '#', Nullch, 0);
- ar->ary_fill = size - 1;
- ar->ary_max = size - 1;
- ar->ary_flags = 0;
- while (size--) {
- if (*strp)
- (*strp)->str_pok &= ~SP_TEMP;
- strp++;
- }
- return ar;
-}
-
-void
-aclear(ar)
-register ARRAY *ar;
-{
- register int key;
-
- if (!ar || !(ar->ary_flags & ARF_REAL) || ar->ary_max < 0)
- return;
- /*SUPPRESS 560*/
- if (key = ar->ary_array - ar->ary_alloc) {
- ar->ary_max += key;
- ar->ary_array -= key;
- }
- for (key = 0; key <= ar->ary_max; key++)
- str_free(ar->ary_array[key]);
- ar->ary_fill = -1;
- Zero(ar->ary_array, ar->ary_max+1, STR*);
-}
-
-void
-afree(ar)
-register ARRAY *ar;
-{
- register int key;
-
- if (!ar)
- return;
- /*SUPPRESS 560*/
- if (key = ar->ary_array - ar->ary_alloc) {
- ar->ary_max += key;
- ar->ary_array -= key;
- }
- if (ar->ary_flags & ARF_REAL) {
- for (key = 0; key <= ar->ary_max; key++)
- str_free(ar->ary_array[key]);
- }
- str_free(ar->ary_magic);
- Safefree(ar->ary_alloc);
- Safefree(ar);
-}
-
-bool
-apush(ar,val)
-register ARRAY *ar;
-STR *val;
-{
- return astore(ar,++(ar->ary_fill),val);
-}
-
-STR *
-apop(ar)
-register ARRAY *ar;
-{
- STR *retval;
-
- if (ar->ary_fill < 0)
- return Nullstr;
- retval = ar->ary_array[ar->ary_fill];
- ar->ary_array[ar->ary_fill--] = Nullstr;
- return retval;
-}
-
-void
-aunshift(ar,num)
-register ARRAY *ar;
-register int num;
-{
- register int i;
- register STR **sstr,**dstr;
-
- if (num <= 0)
- return;
- if (ar->ary_array - ar->ary_alloc >= num) {
- ar->ary_max += num;
- ar->ary_fill += num;
- while (num--)
- *--ar->ary_array = Nullstr;
- }
- else {
- (void)astore(ar,ar->ary_fill+num,(STR*)0); /* maybe extend array */
- dstr = ar->ary_array + ar->ary_fill;
- sstr = dstr - num;
-#ifdef BUGGY_MSC5
- # pragma loop_opt(off) /* don't loop-optimize the following code */
-#endif /* BUGGY_MSC5 */
- for (i = ar->ary_fill - num; i >= 0; i--) {
- *dstr-- = *sstr--;
-#ifdef BUGGY_MSC5
- # pragma loop_opt() /* loop-optimization back to command-line setting */
-#endif /* BUGGY_MSC5 */
- }
- Zero(ar->ary_array, num, STR*);
- }
-}
-
-STR *
-ashift(ar)
-register ARRAY *ar;
-{
- STR *retval;
-
- if (ar->ary_fill < 0)
- return Nullstr;
- retval = *ar->ary_array;
- *(ar->ary_array++) = Nullstr;
- ar->ary_max--;
- ar->ary_fill--;
- return retval;
-}
-
-int
-alen(ar)
-register ARRAY *ar;
-{
- return ar->ary_fill;
-}
-
-void
-afill(ar, fill)
-register ARRAY *ar;
-int fill;
-{
- if (fill < 0)
- fill = -1;
- if (fill <= ar->ary_max)
- ar->ary_fill = fill;
- else
- (void)astore(ar,fill,Nullstr);
-}
+++ /dev/null
-/* $RCSfile: array.h,v $$Revision: 4.0.1.2 $$Date: 92/06/08 11:45:57 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- * You may distribute under the terms of either the GNU General Public
- * License or the Artistic License, as specified in the README file.
- *
- * $Log: array.h,v $
- * Revision 4.0.1.2 92/06/08 11:45:57 lwall
- * patch20: removed implicit int declarations on funcions
- *
- * Revision 4.0.1.1 91/06/07 10:19:20 lwall
- * patch4: new copyright notice
- *
- * Revision 4.0 91/03/20 01:03:44 lwall
- * 4.0 baseline.
- *
- */
-
-struct atbl {
- STR **ary_array;
- STR **ary_alloc;
- STR *ary_magic;
- int ary_max;
- int ary_fill;
- char ary_flags;
-};
-
-#define ARF_REAL 1 /* free old entries */
-
-STR *afetch();
-bool astore();
-STR *apop();
-STR *ashift();
-void afree();
-void aclear();
-bool apush();
-int alen();
-ARRAY *anew();
-ARRAY *afake();
-void aunshift();
-void afill();
# : Makefile.SH,v 9820Revision: 4.0.1.2 9820Date: 91/06/07 10:14:43 $
#
# $Log: makefile.sm,v $
+# Revision 4.1 92/08/07 17:18:37 lwall
+# Stage 6 Snapshot
+#
# Revision 4.0.1.1 92/06/08 11:50:00 lwall
# Initial revision
#
# : Makefile.SH,v 9820Revision: 4.0.1.2 9820Date: 91/06/07 10:14:43 $
#
# $Log: makefile.st,v $
+# Revision 4.1 92/08/07 17:18:40 lwall
+# Stage 6 Snapshot
+#
# Revision 4.0.1.1 92/06/08 11:50:13 lwall
# Initial revision
#
! # Ray Lischner (uunet!mntgfx!lisch) as of 5 Nov 1990
! # Johan Vromans -- upgrade to 4.0 pl 10
!
-! $header = '$RCSfile: perldb.diff,v $$Revision: 4.0.1.1 $$Date: 92/06/08 11:50:28 $';
+! $header = '$RCSfile: perldb.diff,v $$Revision: 4.1 $$Date: 92/08/07 17:18:44 $';
#
# This file is automatically included if you do perl -d.
# It's probably not useful to include this yourself.
--- 1,6 ----
package DB;
-! $header = '$RCSfile: perldb.diff,v $$Revision: 4.0.1.1 $$Date: 92/06/08 11:50:28 $';
+! $header = '$RCSfile: perldb.diff,v $$Revision: 4.1 $$Date: 92/08/07 17:18:44 $';
#
# This file is automatically included if you do perl -d.
# It's probably not useful to include this yourself.
# have a breakpoint. It also inserts a do 'perldb.pl' before the first line.
#
# $Log: perldb.diff,v $
+ # Revision 4.1 92/08/07 17:18:44 lwall
+ # Stage 6 Snapshot
+ #
# Revision 4.0.1.1 92/06/08 11:50:28 lwall
# Initial revision
#
-/* $RCSfile: acurses.mus,v $$Revision: 4.0.1.1 $$Date: 92/06/08 11:54:30 $
+/* $RCSfile: acurses.mus,v $$Revision: 4.1 $$Date: 92/08/07 17:19:04 $
*
* $Log: acurses.mus,v $
+ * Revision 4.1 92/08/07 17:19:04 lwall
+ * Stage 6 Snapshot
+ *
* Revision 4.0.1.1 92/06/08 11:54:30 lwall
* Initial revision
*
-/* $RCSfile: usersub.c,v $$Revision: 4.0.1.1 $$Date: 92/06/08 11:54:52 $
+/* $RCSfile: usersub.c,v $$Revision: 4.1 $$Date: 92/08/07 17:19:07 $
*
* $Log: usersub.c,v $
+ * Revision 4.1 92/08/07 17:19:07 lwall
+ * Stage 6 Snapshot
+ *
* Revision 4.0.1.1 92/06/08 11:54:52 lwall
* Initial revision
*
-/* $Revision: 4.0.1.1 $
+/* $Revision: 4.1 $
**
** Do shell-style pattern matching for ?, \, [], and * characters.
** Might not be robust in face of malformed patterns; e.g., "foo[a-"
--- /dev/null
+/* $RCSfile: array.c,v $$Revision: 4.1 $$Date: 92/08/07 17:18:22 $
+ *
+ * Copyright (c) 1991, Larry Wall
+ *
+ * You may distribute under the terms of either the GNU General Public
+ * License or the Artistic License, as specified in the README file.
+ *
+ * $Log: array.c,v $
+ * Revision 4.1 92/08/07 17:18:22 lwall
+ * Stage 6 Snapshot
+ *
+ * Revision 4.0.1.3 92/06/08 11:45:05 lwall
+ * patch20: Perl now distinguishes overlapped copies from non-overlapped
+ *
+ * Revision 4.0.1.2 91/11/05 16:00:14 lwall
+ * patch11: random cleanup
+ * patch11: passing non-existend array elements to subrouting caused core dump
+ *
+ * Revision 4.0.1.1 91/06/07 10:19:08 lwall
+ * patch4: new copyright notice
+ *
+ * Revision 4.0 91/03/20 01:03:32 lwall
+ * 4.0 baseline.
+ *
+ */
+
+#include "EXTERN.h"
+#include "perl.h"
+
+SV**
+av_fetch(ar,key,lval)
+register AV *ar;
+I32 key;
+I32 lval;
+{
+ SV *sv;
+
+ if (key < 0 || key > AvFILL(ar)) {
+ if (lval && key >= 0) {
+ if (AvREAL(ar))
+ sv = NEWSV(5,0);
+ else
+ sv = sv_mortalcopy(&sv_undef);
+ return av_store(ar,key,sv);
+ }
+ else
+ return 0;
+ }
+ if (!AvARRAY(ar)[key]) {
+ if (lval) {
+ sv = NEWSV(6,0);
+ return av_store(ar,key,sv);
+ }
+ return 0;
+ }
+ return &AvARRAY(ar)[key];
+}
+
+SV**
+av_store(ar,key,val)
+register AV *ar;
+I32 key;
+SV *val;
+{
+ I32 tmp;
+ SV** ary;
+
+ if (key < 0)
+ return 0;
+ if (key > AvMAX(ar)) {
+ I32 newmax;
+
+ if (AvALLOC(ar) != AvARRAY(ar)) {
+ tmp = AvARRAY(ar) - AvALLOC(ar);
+ Move(AvARRAY(ar), AvALLOC(ar), AvMAX(ar)+1, SV*);
+ Zero(AvALLOC(ar)+AvMAX(ar)+1, tmp, SV*);
+ AvMAX(ar) += tmp;
+ AvARRAY(ar) -= tmp;
+ if (key > AvMAX(ar) - 10) {
+ newmax = key + AvMAX(ar);
+ goto resize;
+ }
+ }
+ else {
+ if (AvALLOC(ar)) {
+ newmax = key + AvMAX(ar) / 5;
+ resize:
+ Renew(AvALLOC(ar),newmax+1, SV*);
+ Zero(&AvALLOC(ar)[AvMAX(ar)+1], newmax - AvMAX(ar), SV*);
+ }
+ else {
+ newmax = key < 4 ? 4 : key;
+ Newz(2,AvALLOC(ar), newmax+1, SV*);
+ }
+ AvARRAY(ar) = AvALLOC(ar);
+ AvMAX(ar) = newmax;
+ }
+ }
+ ary = AvARRAY(ar);
+ if (AvREAL(ar)) {
+ if (AvFILL(ar) < key) {
+ while (++AvFILL(ar) < key) {
+ if (ary[AvFILL(ar)] != Nullsv) {
+ sv_free(ary[AvFILL(ar)]);
+ ary[AvFILL(ar)] = Nullsv;
+ }
+ }
+ }
+ if (ary[key])
+ sv_free(ary[key]);
+ }
+ ary[key] = val;
+ return &ary[key];
+}
+
+AV *
+newAV()
+{
+ register AV *ar;
+
+ Newz(1,ar,1,AV);
+ SvREFCNT(ar) = 1;
+ sv_upgrade(ar,SVt_PVAV);
+ AvREAL_on(ar);
+ AvALLOC(ar) = AvARRAY(ar) = 0;
+ AvMAX(ar) = AvFILL(ar) = -1;
+ return ar;
+}
+
+AV *
+av_make(size,strp)
+register I32 size;
+register SV **strp;
+{
+ register AV *ar;
+ register I32 i;
+ register SV** ary;
+
+ Newz(3,ar,1,AV);
+ sv_upgrade(ar,SVt_PVAV);
+ New(4,ary,size+1,SV*);
+ AvALLOC(ar) = ary;
+ Zero(ary,size,SV*);
+ AvREAL_on(ar);
+ AvARRAY(ar) = ary;
+ AvFILL(ar) = size - 1;
+ AvMAX(ar) = size - 1;
+ for (i = 0; i < size; i++) {
+ if (*strp) {
+ ary[i] = NEWSV(7,0);
+ sv_setsv(ary[i], *strp);
+ }
+ strp++;
+ }
+ return ar;
+}
+
+AV *
+av_fake(size,strp)
+register I32 size;
+register SV **strp;
+{
+ register AV *ar;
+ register SV** ary;
+
+ Newz(3,ar,1,AV);
+ SvREFCNT(ar) = 1;
+ sv_upgrade(ar,SVt_PVAV);
+ New(4,ary,size+1,SV*);
+ AvALLOC(ar) = ary;
+ Copy(strp,ary,size,SV*);
+ AvREAL_off(ar);
+ AvARRAY(ar) = ary;
+ AvFILL(ar) = size - 1;
+ AvMAX(ar) = size - 1;
+ while (size--) {
+ if (*strp)
+ SvTEMP_off(*strp);
+ strp++;
+ }
+ return ar;
+}
+
+void
+av_clear(ar)
+register AV *ar;
+{
+ register I32 key;
+
+ if (!ar || !AvREAL(ar) || AvMAX(ar) < 0)
+ return;
+ /*SUPPRESS 560*/
+ if (key = AvARRAY(ar) - AvALLOC(ar)) {
+ AvMAX(ar) += key;
+ AvARRAY(ar) -= key;
+ }
+ for (key = 0; key <= AvMAX(ar); key++)
+ sv_free(AvARRAY(ar)[key]);
+ AvFILL(ar) = -1;
+ Zero(AvARRAY(ar), AvMAX(ar)+1, SV*);
+}
+
+void
+av_undef(ar)
+register AV *ar;
+{
+ register I32 key;
+
+ if (!ar)
+ return;
+ /*SUPPRESS 560*/
+ if (key = AvARRAY(ar) - AvALLOC(ar)) {
+ AvMAX(ar) += key;
+ AvARRAY(ar) -= key;
+ }
+ if (AvREAL(ar)) {
+ for (key = 0; key <= AvMAX(ar); key++)
+ sv_free(AvARRAY(ar)[key]);
+ }
+ Safefree(AvALLOC(ar));
+ AvALLOC(ar) = AvARRAY(ar) = 0;
+ AvMAX(ar) = AvFILL(ar) = -1;
+}
+
+void
+av_free(ar)
+AV *ar;
+{
+ av_undef(ar);
+ Safefree(ar);
+}
+
+bool
+av_push(ar,val)
+register AV *ar;
+SV *val;
+{
+ return av_store(ar,++(AvFILL(ar)),val) != 0;
+}
+
+SV *
+av_pop(ar)
+register AV *ar;
+{
+ SV *retval;
+
+ if (AvFILL(ar) < 0)
+ return Nullsv;
+ retval = AvARRAY(ar)[AvFILL(ar)];
+ AvARRAY(ar)[AvFILL(ar)--] = Nullsv;
+ return retval;
+}
+
+void
+av_popnulls(ar)
+register AV *ar;
+{
+ register I32 fill = AvFILL(ar);
+
+ while (fill >= 0 && !AvARRAY(ar)[fill])
+ fill--;
+ AvFILL(ar) = fill;
+}
+
+void
+av_unshift(ar,num)
+register AV *ar;
+register I32 num;
+{
+ register I32 i;
+ register SV **sstr,**dstr;
+
+ if (num <= 0)
+ return;
+ if (AvARRAY(ar) - AvALLOC(ar) >= num) {
+ AvMAX(ar) += num;
+ AvFILL(ar) += num;
+ while (num--)
+ *--AvARRAY(ar) = Nullsv;
+ }
+ else {
+ (void)av_store(ar,AvFILL(ar)+num,(SV*)0); /* maybe extend array */
+ dstr = AvARRAY(ar) + AvFILL(ar);
+ sstr = dstr - num;
+#ifdef BUGGY_MSC5
+ # pragma loop_opt(off) /* don't loop-optimize the following code */
+#endif /* BUGGY_MSC5 */
+ for (i = AvFILL(ar) - num; i >= 0; i--) {
+ *dstr-- = *sstr--;
+#ifdef BUGGY_MSC5
+ # pragma loop_opt() /* loop-optimization back to command-line setting */
+#endif /* BUGGY_MSC5 */
+ }
+ Zero(AvARRAY(ar), num, SV*);
+ }
+}
+
+SV *
+av_shift(ar)
+register AV *ar;
+{
+ SV *retval;
+
+ if (AvFILL(ar) < 0)
+ return Nullsv;
+ retval = *AvARRAY(ar);
+ *(AvARRAY(ar)++) = Nullsv;
+ AvMAX(ar)--;
+ AvFILL(ar)--;
+ return retval;
+}
+
+I32
+av_len(ar)
+register AV *ar;
+{
+ return AvFILL(ar);
+}
+
+void
+av_fill(ar, fill)
+register AV *ar;
+I32 fill;
+{
+ if (fill < 0)
+ fill = -1;
+ if (fill <= AvMAX(ar))
+ AvFILL(ar) = fill;
+ else {
+ AvFILL(ar) = fill - 1; /* don't clobber in-between values */
+ (void)av_store(ar,fill,Nullsv);
+ }
+}
--- /dev/null
+/* $RCSfile: array.h,v $$Revision: 4.1 $$Date: 92/08/07 17:18:24 $
+ *
+ * Copyright (c) 1991, Larry Wall
+ *
+ * You may distribute under the terms of either the GNU General Public
+ * License or the Artistic License, as specified in the README file.
+ *
+ * $Log: array.h,v $
+ * Revision 4.1 92/08/07 17:18:24 lwall
+ * Stage 6 Snapshot
+ *
+ * Revision 4.0.1.2 92/06/08 11:45:57 lwall
+ * patch20: removed implicit int declarations on funcions
+ *
+ * Revision 4.0.1.1 91/06/07 10:19:20 lwall
+ * patch4: new copyright notice
+ *
+ * Revision 4.0 91/03/20 01:03:44 lwall
+ * 4.0 baseline.
+ *
+ */
+
+struct xpvav {
+ char * xpv_pv; /* pointer to malloced string */
+ STRLEN xpv_cur; /* length of xp_pv as a C string */
+ STRLEN xpv_len; /* allocated size */
+ STRLEN xof_off; /* ptr is incremented by offset */
+ double xnv_nv; /* numeric value, if any */
+ MAGIC* xmg_magic; /* magic for scalar array */
+ HV* xmg_stash; /* class package */
+
+ MAGIC* xav_magic; /* magic for elements */
+
+ SV** xav_array;
+ SV** xav_alloc;
+ SV* xav_arylen;
+ I32 xav_max;
+ I32 xav_fill;
+ U8 xav_flags;
+};
+
+#define AVf_REAL 1 /* free old entries */
+
+#define Nullav Null(AV*)
+
+#define AvMAGIC(av) ((XPVAV*) SvANY(av))->xav_magic
+#define AvARRAY(av) ((XPVAV*) SvANY(av))->xav_array
+#define AvALLOC(av) ((XPVAV*) SvANY(av))->xav_alloc
+#define AvMAX(av) ((XPVAV*) SvANY(av))->xav_max
+#define AvFILL(av) ((XPVAV*) SvANY(av))->xav_fill
+#define AvARYLEN(av) ((XPVAV*) SvANY(av))->xav_arylen
+#define AvFLAGS(av) ((XPVAV*) SvANY(av))->xav_flags
+
+#define AvREAL(av) (((XPVAV*) SvANY(av))->xav_flags & AVf_REAL)
+#define AvREAL_on(av) (((XPVAV*) SvANY(av))->xav_flags |= AVf_REAL)
+#define AvREAL_off(av) (((XPVAV*) SvANY(av))->xav_flags &= ~AVf_REAL)
--- /dev/null
+###############################################################################
--- /dev/null
+#!/usr/local/bin/perl
+#
+#
+# c2ph (aka pstruct)
+# Tom Christiansen, <tchrist@convex.com>
+#
+# As pstruct, dump C structures as generated from 'cc -g -S' stabs.
+# As c2ph, do this PLUS generate perl code for getting at the structures.
+#
+# See the usage message for more. If this isn't enough, read the code.
+#
+
+$RCSID = '$RCSfile: c2ph.SH,v $$Revision: 4.1 $$Date: 92/08/07 17:19:10 $';
+
+
+######################################################################
+
+# some handy data definitions. many of these can be reset later.
+
+$bitorder = 'b'; # ascending; set to B for descending bit fields
+
+%intrinsics =
+%template = (
+ 'char', 'c',
+ 'unsigned char', 'C',
+ 'short', 's',
+ 'short int', 's',
+ 'unsigned short', 'S',
+ 'unsigned short int', 'S',
+ 'short unsigned int', 'S',
+ 'int', 'i',
+ 'unsigned int', 'I',
+ 'long', 'l',
+ 'long int', 'l',
+ 'unsigned long', 'L',
+ 'unsigned long', 'L',
+ 'long unsigned int', 'L',
+ 'unsigned long int', 'L',
+ 'long long', 'q',
+ 'long long int', 'q',
+ 'unsigned long long', 'Q',
+ 'unsigned long long int', 'Q',
+ 'float', 'f',
+ 'double', 'd',
+ 'pointer', 'p',
+ 'null', 'x',
+ 'neganull', 'X',
+ 'bit', $bitorder,
+);
+
+&buildscrunchlist;
+delete $intrinsics{'neganull'};
+delete $intrinsics{'bit'};
+delete $intrinsics{'null'};
+
+# use -s to recompute sizes
+%sizeof = (
+ 'char', '1',
+ 'unsigned char', '1',
+ 'short', '2',
+ 'short int', '2',
+ 'unsigned short', '2',
+ 'unsigned short int', '2',
+ 'short unsigned int', '2',
+ 'int', '4',
+ 'unsigned int', '4',
+ 'long', '4',
+ 'long int', '4',
+ 'unsigned long', '4',
+ 'unsigned long int', '4',
+ 'long unsigned int', '4',
+ 'long long', '8',
+ 'long long int', '8',
+ 'unsigned long long', '8',
+ 'unsigned long long int', '8',
+ 'float', '4',
+ 'double', '8',
+ 'pointer', '4',
+);
+
+($type_width, $member_width, $offset_width, $size_width) = (20, 20, 6, 5);
+
+($offset_fmt, $size_fmt) = ('d', 'd');
+
+$indent = 2;
+
+$CC = 'cc';
+$CFLAGS = '-g -S';
+$DEFINES = '';
+
+$perl++ if $0 =~ m#/?c2ph$#;
+
+require 'getopts.pl';
+
+eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_]+=)(.*)/ && shift;
+
+&Getopts('aixdpvtnws:') || &usage(0);
+
+$opt_d && $debug++;
+$opt_t && $trace++;
+$opt_p && $perl++;
+$opt_v && $verbose++;
+$opt_n && ($perl = 0);
+
+if ($opt_w) {
+ ($type_width, $member_width, $offset_width) = (45, 35, 8);
+}
+if ($opt_x) {
+ ($offset_fmt, $offset_width, $size_fmt, $size_width) = ( 'x', '08', 'x', 04 );
+}
+
+eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_]+=)(.*)/ && shift;
+
+sub PLUMBER {
+ select(STDERR);
+ print "oops, apperent pager foulup\n";
+ $isatty++;
+ &usage(1);
+}
+
+sub usage {
+ local($oops) = @_;
+ unless (-t STDOUT) {
+ select(STDERR);
+ } elsif (!$oops) {
+ $isatty++;
+ $| = 1;
+ print "hit <RETURN> for further explanation: ";
+ <STDIN>;
+ open (PIPE, "|". ($ENV{PAGER} || 'more'));
+ $SIG{PIPE} = PLUMBER;
+ select(PIPE);
+ }
+
+ print "usage: $0 [-dpnP] [var=val] [files ...]\n";
+
+ exit unless $isatty;
+
+ print <<EOF;
+
+Options:
+
+-w wide; short for: type_width=45 member_width=35 offset_width=8
+-x hex; short for: offset_fmt=x offset_width=08 size_fmt=x size_width=04
+
+-n do not generate perl code (default when invoked as pstruct)
+-p generate perl code (default when invoked as c2ph)
+-v generate perl code, with C decls as comments
+
+-i do NOT recompute sizes for intrinsic datatypes
+-a dump information on intrinsics also
+
+-t trace execution
+-d spew reams of debugging output
+
+-slist give comma-separated list a structures to dump
+
+
+Var Name Default Value Meaning
+
+EOF
+
+ &defvar('CC', 'which_compiler to call');
+ &defvar('CFLAGS', 'how to generate *.s files with stabs');
+ &defvar('DEFINES','any extra cflags or cpp defines, like -I, -D, -U');
+
+ print "\n";
+
+ &defvar('type_width', 'width of type field (column 1)');
+ &defvar('member_width', 'width of member field (column 2)');
+ &defvar('offset_width', 'width of offset field (column 3)');
+ &defvar('size_width', 'width of size field (column 4)');
+
+ print "\n";
+
+ &defvar('offset_fmt', 'sprintf format type for offset');
+ &defvar('size_fmt', 'sprintf format type for size');
+
+ print "\n";
+
+ &defvar('indent', 'how far to indent each nesting level');
+
+ print <<'EOF';
+
+ If any *.[ch] files are given, these will be catted together into
+ a temporary *.c file and sent through:
+ $CC $CFLAGS $DEFINES
+ and the resulting *.s groped for stab information. If no files are
+ supplied, then stdin is read directly with the assumption that it
+ contains stab information. All other liens will be ignored. At
+ most one *.s file should be supplied.
+
+EOF
+ close PIPE;
+ exit 1;
+}
+
+sub defvar {
+ local($var, $msg) = @_;
+ printf "%-16s%-15s %s\n", $var, eval "\$$var", $msg;
+}
+
+$recurse = 1;
+
+if (@ARGV) {
+ if (grep(!/\.[csh]$/,@ARGV)) {
+ warn "Only *.[csh] files expected!\n";
+ &usage;
+ }
+ elsif (grep(/\.s$/,@ARGV)) {
+ if (@ARGV > 1) {
+ warn "Only one *.s file allowed!\n";
+ &usage;
+ }
+ }
+ elsif (@ARGV == 1 && $ARGV[0] =~ /\.c$/) {
+ local($dir, $file) = $ARGV[0] =~ m#(.*/)?(.*)$#;
+ $chdir = "cd $dir; " if $dir;
+ &system("$chdir$CC $CFLAGS $DEFINES $file") && exit 1;
+ $ARGV[0] =~ s/\.c$/.s/;
+ }
+ else {
+ $TMP = "/tmp/c2ph.$$.c";
+ &system("cat @ARGV > $TMP") && exit 1;
+ &system("cd /tmp; $CC $CFLAGS $DEFINES $TMP") && exit 1;
+ unlink $TMP;
+ $TMP =~ s/\.c$/.s/;
+ @ARGV = ($TMP);
+ }
+}
+
+if ($opt_s) {
+ for (split(/[\s,]+/, $opt_s)) {
+ $interested{$_}++;
+ }
+}
+
+
+$| = 1 if $debug;
+
+main: {
+
+ if ($trace) {
+ if (-t && !@ARGV) {
+ print STDERR "reading from your keyboard: ";
+ } else {
+ print STDERR "reading from " . (@ARGV ? "@ARGV" : "<STDIN>").": ";
+ }
+ }
+
+STAB: while (<>) {
+ if ($trace && !($. % 10)) {
+ $lineno = $..'';
+ print STDERR $lineno, "\b" x length($lineno);
+ }
+ next unless /^\s*\.stabs\s+/;
+ $line = $_;
+ s/^\s*\.stabs\s+//;
+ &stab;
+ }
+ print STDERR "$.\n" if $trace;
+ unlink $TMP if $TMP;
+
+ &compute_intrinsics if $perl && !$opt_i;
+
+ print STDERR "resolving types\n" if $trace;
+
+ &resolve_types;
+ &adjust_start_addrs;
+
+ $sum = 2 + $type_width + $member_width;
+ $pmask1 = "%-${type_width}s %-${member_width}s";
+ $pmask2 = "%-${sum}s %${offset_width}${offset_fmt}%s %${size_width}${size_fmt}%s";
+
+ if ($perl) {
+ # resolve template -- should be in stab define order, but even this isn't enough.
+ print STDERR "\nbuilding type templates: " if $trace;
+ for $i (reverse 0..$#type) {
+ next unless defined($name = $type[$i]);
+ next unless defined $struct{$name};
+ $build_recursed = 0;
+ &build_template($name) unless defined $template{&psou($name)} ||
+ $opt_s && !$interested{$name};
+ }
+ print STDERR "\n\n" if $trace;
+ }
+
+ print STDERR "dumping structs: " if $trace;
+
+
+ foreach $name (sort keys %struct) {
+ next if $opt_s && !$interested{$name};
+ print STDERR "$name " if $trace;
+
+ undef @sizeof;
+ undef @typedef;
+ undef @offsetof;
+ undef @indices;
+ undef @typeof;
+
+ $mname = &munge($name);
+
+ $fname = &psou($name);
+
+ print "# " if $perl && $verbose;
+ $pcode = '';
+ print "$fname {\n" if !$perl || $verbose;
+ $template{$fname} = &scrunch($template{$fname}) if $perl;
+ &pstruct($name,$name,0);
+ print "# " if $perl && $verbose;
+ print "}\n" if !$perl || $verbose;
+ print "\n" if $perl && $verbose;
+
+ if ($perl) {
+ print "$pcode";
+
+ printf("\nsub %-32s { %4d; }\n\n", "${mname}'struct", $countof{$name});
+
+ print <<EOF;
+sub ${mname}'typedef {
+ local(\$${mname}'index) = shift;
+ defined \$${mname}'index
+ ? \$${mname}'typedef[\$${mname}'index]
+ : \$${mname}'typedef;
+}
+EOF
+
+ print <<EOF;
+sub ${mname}'sizeof {
+ local(\$${mname}'index) = shift;
+ defined \$${mname}'index
+ ? \$${mname}'sizeof[\$${mname}'index]
+ : \$${mname}'sizeof;
+}
+EOF
+
+ print <<EOF;
+sub ${mname}'offsetof {
+ local(\$${mname}'index) = shift;
+ defined \$${mname}index
+ ? \$${mname}'offsetof[\$${mname}'index]
+ : \$${mname}'sizeof;
+}
+EOF
+
+ print <<EOF;
+sub ${mname}'typeof {
+ local(\$${mname}'index) = shift;
+ defined \$${mname}index
+ ? \$${mname}'typeof[\$${mname}'index]
+ : '$name';
+}
+EOF
+
+
+ print "\$${mname}'typedef = '" . &scrunch($template{$fname})
+ . "';\n";
+
+ print "\$${mname}'sizeof = $sizeof{$name};\n\n";
+
+
+ print "\@${mname}'indices = (", &squishseq(@indices), ");\n";
+
+ print "\n";
+
+ print "\@${mname}'typedef[\@${mname}'indices] = (",
+ join("\n\t", '', @typedef), "\n );\n\n";
+ print "\@${mname}'sizeof[\@${mname}'indices] = (",
+ join("\n\t", '', @sizeof), "\n );\n\n";
+ print "\@${mname}'offsetof[\@${mname}'indices] = (",
+ join("\n\t", '', @offsetof), "\n );\n\n";
+ print "\@${mname}'typeof[\@${mname}'indices] = (",
+ join("\n\t", '', @typeof), "\n );\n\n";
+
+ $template_printed{$fname}++;
+ $size_printed{$fname}++;
+ }
+ print "\n";
+ }
+
+ print STDERR "\n" if $trace;
+
+ unless ($perl && $opt_a) {
+ print "\n1;\n";
+ exit;
+ }
+
+
+
+ foreach $name (sort bysizevalue keys %intrinsics) {
+ next if $size_printed{$name};
+ print '$',&munge($name),"'sizeof = ", $sizeof{$name}, ";\n";
+ }
+
+ print "\n";
+
+ sub bysizevalue { $sizeof{$a} <=> $sizeof{$b}; }
+
+
+ foreach $name (sort keys %intrinsics) {
+ print '$',&munge($name),"'typedef = '", $template{$name}, "';\n";
+ }
+
+ print "\n1;\n";
+
+ exit;
+}
+
+########################################################################################
+
+
+sub stab {
+ next unless /:[\$\w]+(\(\d+,\d+\))?=[\*\$\w]+/; # (\d+,\d+) is for sun
+ s/"// || next;
+ s/",([x\d]+),([x\d]+),([x\d]+),.*// || next;
+
+ next if /^\s*$/;
+
+ $size = $3 if $3;
+
+
+ $line = $_;
+
+ if (($name, $pdecl) = /^([\$ \w]+):[tT]((\d+)(=[rufs*](\d+))+)$/) {
+ print "$name is a typedef for some funky pointers: $pdecl\n" if $debug;
+ &pdecl($pdecl);
+ next;
+ }
+
+
+
+ if (/(([ \w]+):t(\d+|\(\d+,\d+\)))=r?(\d+|\(\d+,\d+\))(;\d+;\d+;)?/) {
+ local($ident) = $2;
+ push(@intrinsics, $ident);
+ $typeno = &typeno($3);
+ $type[$typeno] = $ident;
+ print STDERR "intrinsic $ident in new type $typeno\n" if $debug;
+ next;
+ }
+
+ if (($name, $typeordef, $typeno, $extra, $struct, $_)
+ = /^([\$ \w]+):([ustT])(\d+|\(\d+,\d+\))(=[rufs*](\d+))?(.*)$/)
+ {
+ $typeno = &typeno($typeno); # sun foolery
+ }
+ elsif (/^[\$\w]+:/) {
+ next; # variable
+ }
+ else {
+ warn "can't grok stab: <$_> in: $line " if $_;
+ next;
+ }
+
+ #warn "got size $size for $name\n";
+ $sizeof{$name} = $size if $size;
+
+ s/;[-\d]*;[-\d]*;$//; # we don't care about ranges
+
+ $typenos{$name} = $typeno;
+
+ unless (defined $type[$typeno]) {
+ &panic("type 0??") unless $typeno;
+ $type[$typeno] = $name unless defined $type[$typeno];
+ printf "new type $typeno is $name" if $debug;
+ if ($extra =~ /\*/ && defined $type[$struct]) {
+ print ", a typedef for a pointer to " , $type[$struct] if $debug;
+ }
+ } else {
+ printf "%s is type %d", $name, $typeno if $debug;
+ print ", a typedef for " , $type[$typeno] if $debug;
+ }
+ print "\n" if $debug;
+ #next unless $extra =~ /[su*]/;
+
+ #$type[$struct] = $name;
+
+ if ($extra =~ /[us*]/) {
+ &sou($name, $extra);
+ $_ = &sdecl($name, $_, 0);
+ }
+ elsif (/^=ar/) {
+ print "it's a bare array typedef -- that's pretty sick\n" if $debug;
+ $_ = "$typeno$_";
+ $scripts = '';
+ $_ = &adecl($_,1);
+
+ }
+ elsif (s/((\w+):t(\d+|\(\d+,\d+\)))?=r?(;\d+;\d+;)?//) { # the ?'s are for gcc
+ push(@intrinsics, $2);
+ $typeno = &typeno($3);
+ $type[$typeno] = $2;
+ print STDERR "intrinsic $2 in new type $typeno\n" if $debug;
+ }
+ elsif (s/^=e//) { # blessed by thy compiler; mine won't do this
+ &edecl;
+ }
+ else {
+ warn "Funny remainder for $name on line $_ left in $line " if $_;
+ }
+}
+
+sub typeno { # sun thinks types are (0,27) instead of just 27
+ local($_) = @_;
+ s/\(\d+,(\d+)\)/$1/;
+ $_;
+}
+
+sub pstruct {
+ local($what,$prefix,$base) = @_;
+ local($field, $fieldname, $typeno, $count, $offset, $entry);
+ local($fieldtype);
+ local($type, $tname);
+ local($mytype, $mycount, $entry2);
+ local($struct_count) = 0;
+ local($pad, $revpad, $length, $prepad, $lastoffset, $lastlength, $fmt);
+ local($bits,$bytes);
+ local($template);
+
+
+ local($mname) = &munge($name);
+
+ sub munge {
+ local($_) = @_;
+ s/[\s\$\.]/_/g;
+ $_;
+ }
+
+ local($sname) = &psou($what);
+
+ $nesting++;
+
+ for $field (split(/;/, $struct{$what})) {
+ $pad = $prepad = 0;
+ $entry = '';
+ ($fieldname, $typeno, $count, $offset, $length) = split(/,/, $field);
+
+ $type = $type[$typeno];
+
+ $type =~ /([^[]*)(\[.*\])?/;
+ $mytype = $1;
+ $count .= $2;
+ $fieldtype = &psou($mytype);
+
+ local($fname) = &psou($name);
+
+ if ($build_templates) {
+
+ $pad = ($offset - ($lastoffset + $lastlength))/8
+ if defined $lastoffset;
+
+ if (! $finished_template{$sname}) {
+ if ($isaunion{$what}) {
+ $template{$sname} .= 'X' x $revpad . ' ' if $revpad;
+ } else {
+ $template{$sname} .= 'x' x $pad . ' ' if $pad;
+ }
+ }
+
+ $template = &fetch_template($type) x
+ ($count ? &scripts2count($count) : 1);
+
+ if (! $finished_template{$sname}) {
+ $template{$sname} .= $template;
+ }
+
+ $revpad = $length/8 if $isaunion{$what};
+
+ ($lastoffset, $lastlength) = ($offset, $length);
+
+ } else {
+ print '# ' if $perl && $verbose;
+ $entry = sprintf($pmask1,
+ ' ' x ($nesting * $indent) . $fieldtype,
+ "$prefix.$fieldname" . $count);
+
+ $entry =~ s/(\*+)( )/$2$1/;
+
+ printf $pmask2,
+ $entry,
+ ($base+$offset)/8,
+ ($bits = ($base+$offset)%8) ? ".$bits" : " ",
+ $length/8,
+ ($bits = $length % 8) ? ".$bits": ""
+ if !$perl || $verbose;
+
+
+ if ($perl && $nesting == 1) {
+ $template = &scrunch(&fetch_template($type) x
+ ($count ? &scripts2count($count) : 1));
+ push(@sizeof, int($length/8) .",\t# $fieldname");
+ push(@offsetof, int($offset/8) .",\t# $fieldname");
+ push(@typedef, "'$template', \t# $fieldname");
+ $type =~ s/(struct|union) //;
+ push(@typeof, "'$type" . ($count ? $count : '') .
+ "',\t# $fieldname");
+ }
+
+ print ' ', ' ' x $indent x $nesting, $template
+ if $perl && $verbose;
+
+ print "\n" if !$perl || $verbose;
+
+ }
+ if ($perl) {
+ local($mycount) = defined $struct{$mytype} ? $countof{$mytype} : 1;
+ $mycount *= &scripts2count($count) if $count;
+ if ($nesting==1 && !$build_templates) {
+ $pcode .= sprintf("sub %-32s { %4d; }\n",
+ "${mname}'${fieldname}", $struct_count);
+ push(@indices, $struct_count);
+ }
+ $struct_count += $mycount;
+ }
+
+
+ &pstruct($type, "$prefix.$fieldname", $base+$offset)
+ if $recurse && defined $struct{$type};
+ }
+
+ $countof{$what} = $struct_count unless defined $countof{$whati};
+
+ $template{$sname} .= '$' if $build_templates;
+ $finished_template{$sname}++;
+
+ if ($build_templates && !defined $sizeof{$name}) {
+ local($fmt) = &scrunch($template{$sname});
+ print STDERR "no size for $name, punting with $fmt..." if $debug;
+ eval '$sizeof{$name} = length(pack($fmt, ()))';
+ if ($@) {
+ chop $@;
+ warn "couldn't get size for \$name: $@";
+ } else {
+ print STDERR $sizeof{$name}, "\n" if $debUg;
+ }
+ }
+
+ --$nesting;
+}
+
+
+sub psize {
+ local($me) = @_;
+ local($amstruct) = $struct{$me} ? 'struct ' : '';
+
+ print '$sizeof{\'', $amstruct, $me, '\'} = ';
+ printf "%d;\n", $sizeof{$me};
+}
+
+sub pdecl {
+ local($pdecl) = @_;
+ local(@pdecls);
+ local($tname);
+
+ warn "pdecl: $pdecl\n" if $debug;
+
+ $pdecl =~ s/\(\d+,(\d+)\)/$1/g;
+ $pdecl =~ s/\*//g;
+ @pdecls = split(/=/, $pdecl);
+ $typeno = $pdecls[0];
+ $tname = pop @pdecls;
+
+ if ($tname =~ s/^f//) { $tname = "$tname&"; }
+ #else { $tname = "$tname*"; }
+
+ for (reverse @pdecls) {
+ $tname .= s/^f// ? "&" : "*";
+ #$tname =~ s/^f(.*)/$1&/;
+ print "type[$_] is $tname\n" if $debug;
+ $type[$_] = $tname unless defined $type[$_];
+ }
+}
+
+
+
+sub adecl {
+ ($arraytype, $unknown, $lower, $upper) = ();
+ #local($typeno);
+ # global $typeno, @type
+ local($_, $typedef) = @_;
+
+ while (s/^((\d+)=)?ar(\d+);//) {
+ ($arraytype, $unknown) = ($2, $3);
+ if (s/^(\d+);(\d+);//) {
+ ($lower, $upper) = ($1, $2);
+ $scripts .= '[' . ($upper+1) . ']';
+ } else {
+ warn "can't find array bounds: $_";
+ }
+ }
+ if (s/^([\d*f=]*),(\d+),(\d+);//) {
+ ($start, $length) = ($2, $3);
+ local($whatis) = $1;
+ if ($whatis =~ /^(\d+)=/) {
+ $typeno = $1;
+ &pdecl($whatis);
+ } else {
+ $typeno = $whatis;
+ }
+ } elsif (s/^(\d+)(=[*suf]\d*)//) {
+ local($whatis) = $2;
+
+ if ($whatis =~ /[f*]/) {
+ &pdecl($whatis);
+ } elsif ($whatis =~ /[su]/) { #
+ print "$prefix.$fieldname is an array$scripts anon structs; disgusting\n"
+ if $debug;
+ #$type[$typeno] = $name unless defined $type[$typeno];
+ ##printf "new type $typeno is $name" if $debug;
+ $typeno = $1;
+ $type[$typeno] = "$prefix.$fieldname";
+ local($name) = $type[$typeno];
+ &sou($name, $whatis);
+ $_ = &sdecl($name, $_, $start+$offset);
+ 1;
+ $start = $start{$name};
+ $offset = $sizeof{$name};
+ $length = $offset;
+ } else {
+ warn "what's this? $whatis in $line ";
+ }
+ } elsif (/^\d+$/) {
+ $typeno = $_;
+ } else {
+ warn "bad array stab: $_ in $line ";
+ next STAB;
+ }
+ #local($wasdef) = defined($type[$typeno]) && $debug;
+ #if ($typedef) {
+ #print "redefining $type[$typeno] to " if $wasdef;
+ #$type[$typeno] = "$whatis$scripts"; # unless defined $type[$typeno];
+ #print "$type[$typeno]\n" if $wasdef;
+ #} else {
+ #$type[$arraytype] = $type[$typeno] unless defined $type[$arraytype];
+ #}
+ $type[$arraytype] = "$type[$typeno]$scripts" if defined $type[$typeno];
+ print "type[$arraytype] is $type[$arraytype]\n" if $debug;
+ print "$prefix.$fieldname is an array of $type[$arraytype]\n" if $debug;
+ $_;
+}
+
+
+
+sub sdecl {
+ local($prefix, $_, $offset) = @_;
+
+ local($fieldname, $scripts, $type, $arraytype, $unknown,
+ $whatis, $pdecl, $upper,$lower, $start,$length) = ();
+ local($typeno,$sou);
+
+
+SFIELD:
+ while (/^([^;]+);/) {
+ $scripts = '';
+ warn "sdecl $_\n" if $debug;
+ if (s/^([\$\w]+)://) {
+ $fieldname = $1;
+ } elsif (s/(\d+)=([us])(\d+|\(\d+,\d+\))//) { #
+ $typeno = &typeno($1);
+ $type[$typeno] = "$prefix.$fieldname";
+ local($name) = "$prefix.$fieldname";
+ &sou($name,$2);
+ $_ = &sdecl("$prefix.$fieldname", $_, $start+$offset);
+ $start = $start{$name};
+ $offset += $sizeof{$name};
+ #print "done with anon, start is $start, offset is $offset\n";
+ #next SFIELD;
+ } else {
+ warn "weird field $_ of $line" if $debug;
+ next STAB;
+ #$fieldname = &gensym;
+ #$_ = &sdecl("$prefix.$fieldname", $_, $start+$offset);
+ }
+
+ if (/^\d+=ar/) {
+ $_ = &adecl($_);
+ }
+ elsif (s/^(\d+|\(\d+,\d+\))?,(\d+),(\d+);//) {
+ ($start, $length) = ($2, $3);
+ &panic("no length?") unless $length;
+ $typeno = &typeno($1) if $1;
+ }
+ elsif (s/^((\d+|\(\d+,\d+\))(=[*f](\d+|\(\d+,\d+\)))+),(\d+),(\d+);//) {
+ ($pdecl, $start, $length) = ($1,$5,$6);
+ &pdecl($pdecl);
+ }
+ elsif (s/(\d+)=([us])(\d+|\(\d+,\d+\))//) { # the dratted anon struct
+ ($typeno, $sou) = ($1, $2);
+ $typeno = &typeno($typeno);
+ if (defined($type[$typeno])) {
+ warn "now how did we get type $1 in $fieldname of $line?";
+ } else {
+ print "anon type $typeno is $prefix.$fieldname\n" if $debug;
+ $type[$typeno] = "$prefix.$fieldname" unless defined $type[$typeno];
+ };
+ local($name) = "$prefix.$fieldname";
+ &sou($name,$sou);
+ print "anon ".($isastruct{$name}) ? "struct":"union"." for $prefix.$fieldname\n" if $debug;
+ $type[$typeno] = "$prefix.$fieldname";
+ $_ = &sdecl("$prefix.$fieldname", $_, $start+$offset);
+ $start = $start{$name};
+ $length = $sizeof{$name};
+ }
+ else {
+ warn "can't grok stab for $name ($_) in line $line ";
+ next STAB;
+ }
+
+ &panic("no length for $prefix.$fieldname") unless $length;
+ $struct{$name} .= join(',', $fieldname, $typeno, $scripts, $start, $length) . ';';
+ }
+ if (s/;\d*,(\d+),(\d+);//) {
+ local($start, $size) = ($1, $2);
+ $sizeof{$prefix} = $size;
+ print "start of $prefix is $start, size of $sizeof{$prefix}\n" if $debug;
+ $start{$prefix} = $start;
+ }
+ $_;
+}
+
+sub edecl {
+ s/;$//;
+ $enum{$name} = $_;
+ $_ = '';
+}
+
+sub resolve_types {
+ local($sou);
+ for $i (0 .. $#type) {
+ next unless defined $type[$i];
+ $_ = $type[$i];
+ unless (/\d/) {
+ print "type[$i] $type[$i]\n" if $debug;
+ next;
+ }
+ print "type[$i] $_ ==> " if $debug;
+ s/^(\d+)(\**)\&\*(\**)/"$2($3".&type($1) . ')()'/e;
+ s/^(\d+)\&/&type($1)/e;
+ s/^(\d+)/&type($1)/e;
+ s/(\*+)([^*]+)(\*+)/$1$3$2/;
+ s/\((\*+)(\w+)(\*+)\)/$3($1$2)/;
+ s/^(\d+)([\*\[].*)/&type($1).$2/e;
+ #s/(\d+)(\*|(\[[\[\]\d\*]+]\])+)/&type($1).$2/ge;
+ $type[$i] = $_;
+ print "$_\n" if $debug;
+ }
+}
+sub type { &psou($type[$_[0]] || "<UNDEFINED>"); }
+
+sub adjust_start_addrs {
+ for (sort keys %start) {
+ ($basename = $_) =~ s/\.[^.]+$//;
+ $start{$_} += $start{$basename};
+ print "start: $_ @ $start{$_}\n" if $debug;
+ }
+}
+
+sub sou {
+ local($what, $_) = @_;
+ /u/ && $isaunion{$what}++;
+ /s/ && $isastruct{$what}++;
+}
+
+sub psou {
+ local($what) = @_;
+ local($prefix) = '';
+ if ($isaunion{$what}) {
+ $prefix = 'union ';
+ } elsif ($isastruct{$what}) {
+ $prefix = 'struct ';
+ }
+ $prefix . $what;
+}
+
+sub scrunch {
+ local($_) = @_;
+
+ study;
+
+ s/\$//g;
+ s/ / /g;
+ 1 while s/(\w) \1/$1$1/g;
+
+ # i wanna say this, but perl resists my efforts:
+ # s/(\w)(\1+)/$2 . length($1)/ge;
+
+ &quick_scrunch;
+
+ s/ $//;
+
+ $_;
+}
+
+sub buildscrunchlist {
+ $scrunch_code = "sub quick_scrunch {\n";
+ for (values %intrinsics) {
+ $scrunch_code .= "\ts/($_{2,})/'$_' . length(\$1)/ge;\n";
+ }
+ $scrunch_code .= "}\n";
+ print "$scrunch_code" if $debug;
+ eval $scrunch_code;
+ &panic("can't eval scrunch_code $@ \nscrunch_code") if $@;
+}
+
+sub fetch_template {
+ local($mytype) = @_;
+ local($fmt);
+ local($count) = 1;
+
+ &panic("why do you care?") unless $perl;
+
+ if ($mytype =~ s/(\[\d+\])+$//) {
+ $count .= $1;
+ }
+
+ if ($mytype =~ /\*/) {
+ $fmt = $template{'pointer'};
+ }
+ elsif (defined $template{$mytype}) {
+ $fmt = $template{$mytype};
+ }
+ elsif (defined $struct{$mytype}) {
+ if (!defined $template{&psou($mytype)}) {
+ &build_template($mytype) unless $mytype eq $name;
+ }
+ elsif ($template{&psou($mytype)} !~ /\$$/) {
+ #warn "incomplete template for $mytype\n";
+ }
+ $fmt = $template{&psou($mytype)} || '?';
+ }
+ else {
+ warn "unknown fmt for $mytype\n";
+ $fmt = '?';
+ }
+
+ $fmt x $count . ' ';
+}
+
+sub compute_intrinsics {
+ local($TMP) = "/tmp/c2ph-i.$$.c";
+ open (TMP, ">$TMP") || die "can't open $TMP: $!";
+ select(TMP);
+
+ print STDERR "computing intrinsic sizes: " if $trace;
+
+ undef %intrinsics;
+
+ print <<'EOF';
+main() {
+ char *mask = "%d %s\n";
+EOF
+
+ for $type (@intrinsics) {
+ next if $type eq 'void';
+ print <<"EOF";
+ printf(mask,sizeof($type), "$type");
+EOF
+ }
+
+ print <<'EOF';
+ printf(mask,sizeof(char *), "pointer");
+ exit(0);
+}
+EOF
+ close TMP;
+