home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!news.tek.com!master!saab!billr
- From: billr@saab.CNA.TEK.COM (Bill Randle)
- Newsgroups: comp.sources.games
- Subject: v17i016: gbp - Galactic Bloodshed+, an empire-like war game, Part04/21
- Message-ID: <4544@master.CNA.TEK.COM>
- Date: 12 Feb 93 17:30:10 GMT
- Sender: news@master.CNA.TEK.COM
- Lines: 2239
- Approved: billr@saab.CNA.TEK.COM
- Xref: uunet comp.sources.games:1695
-
- Submitted-by: deragon@harpo.cs.nyu.edu (Seeker)
- Posting-number: Volume 17, Issue 16
- Archive-name: gbp/Part04
- Supersedes: gb3: Volume 10, Issue 1-14
- Environment: sockets, curses
-
-
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 4 (of 21)."
- # Contents: Configure hdrs/file.h misc/welcome.txt
- # Wrapped by billr@saab on Fri Feb 12 09:14:24 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'Configure' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Configure'\"
- else
- echo shar: Extracting \"'Configure'\" \(41100 characters\)
- sed "s/^X//" >'Configure' <<'END_OF_FILE'
- X#! /bin/sh
- X#
- X# If these # comments don't work, trim them. Don't worry about any other
- X# shell scripts, Configure will trim # comments from them for you.
- X#
- X# (If you are trying to port this package to a machine without sh, I would
- X# suggest you cut out the prototypical config.h from the end of Configure
- X# and edit it to reflect your system. Some packages may include samples
- X# of config.h for certain machines, so you might look for one of those.)
- X#
- X# $Header: /files/home/users/syd/elm.rel/RCS/Configure,v 4.1 90/04/28 22:40:46 syd Exp $
- X#
- X# Yes, you may rip this off to use in other distribution packages.
- X# (Note: this Configure script was generated automatically. Rather than
- X# working with this copy of Configure, you may wish to get metaconfig.)
- X#
- X# ident "%W% %G% %Q%"
- X#
- X: sanity checks
- XPATH=".:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc:/usr/new:/usr/new/bin:/usr/nbin:$PATH"
- Xexport PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$)
- X
- Xif test ! -t 0; then
- X echo "Say 'sh Configure', not 'sh <Configure'"
- X exit 1
- Xfi
- X
- X(alias) >/dev/null 2>&1 && \
- X echo "(I see you are using the Korn shell. Some ksh's blow up on Configure," && \
- X echo "especially on exotic machines. If yours does, try the Bourne shell instead.)"
- X
- Xif test ! -d ../UU; then
- X if test ! -d UU; then
- X mkdir UU
- X fi
- X cd UU
- Xfi
- X
- Xcase "$1" in
- X-d) shift; fastread='yes';;
- Xesac
- X
- XLog=''
- XHeader=''
- Xbin=''
- Xbyteorder=''
- Xcontains=''
- Xcppstdin=''
- Xcppminus=''
- Xd_getopt=''
- Xhostname=''
- Xserver='' ###
- Xport='' ###
- Xd_multiple_comm=''
- Xd_threshloading=''
- Xd_autoscrap=''
- Xd_superpod=''
- Xmaxlogsize=''
- Xgbpath=''
- Xmydomain=''
- Xspore_success_rate=''
- Xi_time=''
- Xi_systime=''
- Xd_systimekernel=''
- Xn=''
- Xc=''
- Xpackage=''
- Xshsharp=''
- Xexpr=''
- Xsed=''
- Xecho=''
- Xcat=''
- Xrm=''
- Xmv=''
- Xcp=''
- Xar=''
- Xranlib=''
- Xtail=''
- Xtr=''
- Xmkdir=''
- Xsort=''
- Xuniq=''
- Xgrep=''
- Xtrylist=''
- Xtest=''
- Xinews=''
- Xegrep=''
- Xmore=''
- Xpg=''
- XMcc=''
- Xvi=''
- Xcpp=''
- Xperl=''
- Xemacs=''
- Xls=''
- Xshar=''
- Xuname=''
- Xuuname=''
- Xline=''
- Xchgrp=''
- Xchmod=''
- Xlint=''
- Xsleep=''
- Xpr=''
- Xtar=''
- Xln=''
- Xlpr=''
- Xlp=''
- Xtouch=''
- Xmake=''
- Xdate=''
- Xcsh=''
- Xc_date=''
- Xd_gethname=''
- Xd_douname=''
- Xd_phostname=''
- Xd_host_comp=''
- Xd_index=''
- Xsplit=''
- Xoptimize=''
- Xccflags=''
- Xcppflags=''
- Xldflags=''
- Xcc=''
- Xlibs=''
- Xtmpdir=''
- XCONFIG=''
- X: set package name
- Xpackage=GB+
- X
- Xecho " "
- Xecho "Beginning of configuration questions for $package kit."
- X: Eunice requires " " instead of "", can you believe it
- Xecho " "
- X
- Xdefine='define'
- Xundef='undef'
- X: change the next line if compiling for Xenix/286 on Xenix/386
- Xxlibpth='/usr/lib/386 /lib/386 /lib'
- Xlibpth='/usr/lib /usr/local/lib /usr/lib/large /lib '$xlibpth' /lib/large /usr/lib/small /lib/small'
- Xsmallmach='pdp11 i8086 z8000 i80286 iAPX286'
- Xrmlist='kit[1-9]isdone kit[1-9][0-9]isdone'
- Xtrap 'echo " "; rm -f $rmlist; exit 1' 1 2 3
- X
- X: We must find out about Eunice early
- Xeunicefix=':'
- Xif test -f /etc/unixtovms; then
- X eunicefix=/etc/unixtovms
- Xfi
- Xif test -f /etc/unixtovms.exe; then
- X eunicefix=/etc/unixtovms.exe
- Xfi
- X
- X: Now test for existence of everything in MANIFEST
- X
- X#echo "First let's make sure your kit is complete. Checking..."
- X#(cd ..; awk '' `awk '$1 !~ /PACKINGLIST/ {print $1}' MANIFEST` >/dev/null || kill $$)
- X#echo "Looks good..."
- X#
- Xattrlist="mc68000 sun gcos unix ibm gimpel interdata tss os mert pyr"
- Xattrlist="$attrlist vax pdp11 i8086 z8000 u3b2 u3b5 u3b20 u3b200"
- Xattrlist="$attrlist hpux hp9000s300 hp9000s500 hp9000s800"
- Xattrlist="$attrlist ns32000 ns16000 iAPX286 mc300 mc500 mc700 sparc"
- Xattrlist="$attrlist nsc32000 sinix xenix venix posix ansi M_XENIX"
- Xattrlist="$attrlist $mc68k __STDC__ UTS M_I8086 M_I186 M_I286 M_I386"
- Xattrlist="$attrlist i186 __m88k__ m88k DGUX __DGUX__"
- Xd_newshome="/usr/NeWS"
- Xdefvoidused=7
- Xpth="/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 /usr/convex"
- X
- X: check for out bin directory
- Xif test ! -d ../bin; then
- X echo "Making bin directory"
- X mkdir ../bin
- Xelse
- X echo "Found bin directory"
- Xfi
- X
- X: some greps do not return status, grrr.
- Xecho "grimblepritz" >grimble
- Xif grep blurfldyick grimble >/dev/null 2>&1 ; then
- X contains=contains
- Xelif grep grimblepritz grimble >/dev/null 2>&1 ; then
- X contains=grep
- Xelse
- X contains=contains
- Xfi
- Xrm -f grimble
- X: the following should work in any shell
- Xcase "$contains" in
- Xcontains*)
- X echo " "
- X echo "AGH! Grep doesn't return a status. Attempting remedial action."
- X cat >contains <<'EOSS'
- Xgrep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
- XEOSS
- Xchmod +x contains
- Xesac
- X
- X: see if sh knows # comments
- Xecho " "
- Xecho "Checking your sh to see if it knows about # comments..."
- Xif sh -c '#' >/dev/null 2>&1 ; then
- X echo "Your sh handles # comments correctly."
- X shsharp=true
- X spitshell=cat
- X echo " "
- X echo "Okay, let's see if #! works on this system..."
- X echo "#!/bin/echo hi" > try
- X $eunicefix try
- X chmod +x try
- X ./try > today
- X if $contains hi today >/dev/null 2>&1; then
- X echo "It does."
- X sharpbang='#!'
- X else
- X echo "#! /bin/echo hi" > try
- X $eunicefix try
- X chmod +x try
- X ./try > today
- X if test -s today; then
- X echo "It does."
- X sharpbang='#! '
- X else
- X echo "It doesn't."
- X sharpbang=': use '
- X fi
- X fi
- Xelse
- X echo "Your sh doesn't grok # comments--I will strip them later on."
- X shsharp=false
- X echo "exec grep -v '^#'" >spitshell
- X chmod +x spitshell
- X $eunicefix spitshell
- X spitshell=`pwd`/spitshell
- X echo "I presume that if # doesn't work, #! won't work either!"
- X sharpbang=': use '
- Xfi
- X
- X: figure out how to guarantee sh startup
- Xecho " "
- Xecho "Checking out how to guarantee sh startup..."
- Xstartsh=$sharpbang'/bin/sh'
- Xecho "Let's see if '$startsh' works..."
- Xcat >try <<EOSS
- X$startsh
- Xset abc
- Xtest "$?abc" != 1
- XEOSS
- X
- Xchmod +x try
- X$eunicefix try
- Xif ./try; then
- X echo "Yup, it does."
- Xelse
- X echo "Nope. You may have to fix up the shell scripts to make sure sh runs them."
- Xfi
- Xrm -f try today
- X
- X: first determine how to suppress newline on echo command
- Xecho "Checking echo to see how to suppress newlines..."
- X(echo "hi there\c" ; echo " ") >.echotmp
- Xif $contains c .echotmp >/dev/null 2>&1 ; then
- X echo "...using -n."
- X n='-n'
- X c=''
- Xelse
- X cat <<'EOM'
- X...using \c
- XEOM
- X n=''
- X c='\c'
- Xfi
- Xecho $n "Type carriage return to continue. Your cursor should be here-->$c"
- Xread ans
- Xrm -f .echotmp
- X
- X: now set up to do reads with possible shell escape and default assignment
- Xcat <<EOSC >myread
- Xcase "\$fastread" in
- Xyes) ans=''; echo " " ;;
- X*) ans='!';;
- Xesac
- Xwhile expr "X\$ans" : "X!" >/dev/null; do
- X read ans
- X case "\$ans" in
- X !)
- X sh
- X echo " "
- X echo $n "\$rp $c"
- X ;;
- X !*)
- X set \`expr "X\$ans" : "X!\(.*\)\$"\`
- X sh -c "\$*"
- X echo " "
- X echo $n "\$rp $c"
- X ;;
- X esac
- Xdone
- Xrp='Your answer:'
- Xcase "\$ans" in
- X'') ans="\$dflt";;
- Xesac
- XEOSC
- X
- X: general instructions
- Xcat <<EOH
- X
- XThis installation shell script will examine your system and ask you questions
- Xto determine how the $package package should be installed. If you get stuck
- Xon a question, you may use a ! shell escape to start a subshell or execute
- Xa command. Many of the questions will have default answers in square
- Xbrackets--typing carriage return will give you the default.
- X
- XOn some of the questions which ask for file or directory names you are
- Xallowed to use the ~name construct to specify the login directory belonging
- Xto "name", even if you don't have a shell which knows about that. Questions
- Xwhere this is allowed will be marked "(~name ok)".
- X
- XEOH
- Xrp="[Type carriage return to continue]"
- Xecho $n "$rp $c"
- X. myread
- Xcat <<EOH
- X
- XMuch effort has been expended to ensure that this shell script will run
- Xon any Unix system. If despite that it blows up on you, your best bet is
- Xto edit Configure and run it again. Also, let me (lwall@jpl-devvax.jpl.nasa.gov)
- Xknow how I blew it. If you can't run Configure for some reason, you'll have
- Xto generate a config.sh file by hand.
- X
- XThis installation script affects things in two ways: 1) it may do direct
- Xvariable substitutions on some of the files included in this kit, and
- X2) it builds a config.h file for inclusion in C programs. You may edit
- Xany of these files as the need arises after running this script.
- X
- XIf you make a mistake on a question, there is no easy way to back up to it
- Xcurrently. The easiest thing to do is to edit config.sh and rerun all the
- XSH files. Configure will offer to let you do this before it runs the SH files.
- X
- XEOH
- Xrp="[Type carriage return to continue]"
- Xecho $n "$rp $c"
- X. myread
- X
- X: get old answers, if there is a config file out there
- Xif test -f ../config.sh; then
- X echo " "
- X dflt=y
- X rp="I see a config.sh file. Did Configure make it on THIS system? [$dflt]"
- X echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X n*) echo "OK, I'll ignore it.";;
- X *) echo "Fetching default answers from your old config.sh file..."
- X tmp="$n"
- X ans="$c"
- X . ../config.sh
- X n="$tmp"
- X c="$ans"
- X ;;
- X esac
- Xfi
- X
- X: find out where common programs are
- Xecho " "
- Xecho "Locating common programs..."
- Xcat <<EOSC >loc
- X$startsh
- Xcase \$# in
- X0) exit 1;;
- Xesac
- Xthing=\$1
- Xshift
- Xdflt=\$1
- Xshift
- Xfor dir in \$*; do
- X case "\$thing" in
- X .)
- X if test -d \$dir/\$thing; then
- X echo \$dir
- X exit 0
- X fi
- X ;;
- X *)
- X if test -f \$dir/\$thing; then
- X echo \$dir/\$thing
- X exit 0
- X elif test -f \$dir/\$thing.exe; then
- X : on Eunice apparently
- X echo \$dir/\$thing
- X exit 0
- X fi
- X ;;
- X esac
- Xdone
- Xecho \$dflt
- Xexit 1
- XEOSC
- Xchmod +x loc
- X$eunicefix loc
- Xloclist="
- Xcat
- Xchgrp
- Xchmod
- Xcp
- Xecho
- Xexpr
- Xgrep
- Xln
- Xls
- Xmake
- Xmv
- Xrm
- Xsed
- Xar
- Xranlib
- Xsleep
- Xtouch
- Xtr
- X"
- Xtrylist="
- XMcc
- Xcpp
- Xdate
- Xemacs
- Xline
- Xlint
- Xlp
- Xlpr
- Xmore
- Xpg
- Xpr
- Xshar
- Xtar
- Xtest
- Xuname
- Xuuname
- Xvi
- X"
- Xfor file in $loclist; do
- X xxx=`loc $file $file $pth`
- X eval $file=$xxx
- X eval _$file=$xxx
- X case "$xxx" in
- X /*)
- X echo $file is in $xxx.
- X ;;
- X *)
- X echo "I don't know where $file is. I hope it's in everyone's PATH."
- X ;;
- X esac
- Xdone
- Xecho " "
- Xecho "Don't worry if any of the following aren't found..."
- Xans=offhand
- Xfor file in $trylist; do
- X xxx=`loc $file $file $pth`
- X eval $file=$xxx
- X eval _$file=$xxx
- X case "$xxx" in
- X /*)
- X echo $file is in $xxx.
- X ;;
- X *)
- X echo "I don't see $file out there, $ans."
- X ans=either
- X ;;
- X esac
- Xdone
- Xcase "$egrep" in
- Xegrep)
- X echo "Substituting grep for egrep."
- X egrep=$grep
- X ;;
- Xesac
- Xcase "$test" in
- Xtest)
- X echo "Hopefully test is built into your sh."
- X ;;
- X/bin/test)
- X if sh -c "PATH= test true" >/dev/null 2>&1; then
- X echo "Using the test built into your sh."
- X test=test
- X fi
- X ;;
- X*)
- X test=test
- X ;;
- Xesac
- Xcase "$echo" in
- Xecho)
- X echo "Hopefully echo is built into your sh."
- X ;;
- X/bin/echo)
- X echo " "
- X echo "Checking compatibility between /bin/echo and builtin echo (if any)..."
- X $echo $n "hi there$c" >foo1
- X echo $n "hi there$c" >foo2
- X if cmp foo1 foo2 >/dev/null 2>&1; then
- X echo "They are compatible. In fact, they may be identical."
- X else
- X case "$n" in
- X '-n') n='' c='\c' ans='\c' ;;
- X *) n='-n' c='' ans='-n' ;;
- X esac
- X cat <<FOO
- XThey are not compatible! You are probably running ksh on a non-USG system.
- XI'll have to use /bin/echo instead of the builtin, since Bourne shell doesn't
- Xhave echo built in and we may have to run some Bourne shell scripts. That
- Xmeans I'll have to use $ans to suppress newlines now. Life is ridiculous.
- X
- XFOO
- X rp="Your cursor should be here-->"
- X $echo $n "$rp$c"
- X . myread
- X fi
- X $rm -f foo1 foo2
- X ;;
- X*)
- X : cross your fingers
- X echo=echo
- X ;;
- Xesac
- Xrmlist="$rmlist loc"
- X
- X: set up shell script to do ~ expansion
- Xcat >filexp <<EOSS
- X$startsh
- X: expand filename
- Xcase "\$1" in
- X ~/*|~)
- X echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
- X ;;
- X ~*)
- X if $test -f /bin/csh; then
- X /bin/csh -f -c "glob \$1"
- X echo ""
- X else
- X name=\`$expr x\$1 : '..\([^/]*\)'\`
- X dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
- X if $test ! -d "\$dir"; then
- X me=\`basename \$0\`
- X echo "\$me: can't locate home directory for: \$name" >&2
- X exit 1
- X fi
- X case "\$1" in
- X */*)
- X echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
- X ;;
- X *)
- X echo \$dir
- X ;;
- X esac
- X fi
- X ;;
- X*)
- X echo \$1
- X ;;
- Xesac
- XEOSS
- Xchmod +x filexp
- X$eunicefix filexp
- X
- X: see if date exists, if so, init c_date
- Xif $test ! "x$date" = "x" ; then
- X c_date=`$date +"%m/%d/%y %H:%M"`
- Xelse
- X c_date='date was unavailable at configuration'
- Xfi
- X
- X: make some quick guesses about what we are up against
- Xecho " "
- X$echo $n "Hmm... $c"
- Xif $test -n "$uname"; then
- X uname_os=`uname -s`
- X uname_rel=`uname -r`
- X uname_rel=`expr "$uname" : "\(...\).*"`
- Xelse
- X uname_os=unknown
- X uname_rel=unknown
- Xfi
- Xcat /usr/include/signal.h /usr/include/sys/signal.h >foo
- Xif test `echo abc | tr a-z A-Z` = Abc ; then
- X echo "Looks kind of like a USG system, but we'll see..."
- X echo exit 1 >bsd
- X echo exit 0 >usg
- X echo exit 1 >v7
- Xelif $contains SIGTSTP foo >/dev/null 2>&1 ; then
- X if $test "$uname_os" = "SunOs" -a "$uname_rel" = "4.1" ; then
- X echo "Looks like SunOs 4.1, a USG system, but we'll see..."
- X echo exit 1 >bsd
- X echo exit 0 >usg
- X echo exit 1 >v7
- X else
- X echo "Looks kind of like a BSD system, but we'll see..."
- X echo exit 0 >bsd
- X echo exit 1 >usg
- X echo exit 1 >v7
- X fi
- Xelse
- X echo "Looks kind of like a version 7 system, but we'll see..."
- X echo exit 1 >bsd
- X echo exit 1 >usg
- X echo exit 0 >v7
- Xfi
- Xcase "$eunicefix" in
- X*unixtovms*)
- X cat <<'EOI'
- XThere is, however, a strange, musty smell in the air that reminds me of
- Xsomething...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
- XEOI
- X echo "exit 0" >eunice
- X d_eunice="$define"
- X ;;
- X*)
- X echo " "
- X echo "Congratulations. You aren't running Eunice."
- X d_eunice="$undef"
- X echo "exit 1" >eunice
- X ;;
- Xesac
- Xif test -f /xenix; then
- X echo "Actually, this looks more like a XENIX system..."
- X echo "exit 0" >xenix
- Xelse
- X echo " "
- X echo "It's not Xenix..."
- X echo "exit 1" >xenix
- Xfi
- Xchmod +x xenix
- X$eunicefix xenix
- Xif test -f /venix; then
- X echo "Actually, this looks more like a VENIX system..."
- X echo "exit 0" >venix
- Xelse
- X echo " "
- X if xenix; then
- X : null
- X else
- X echo "Nor is it Venix..."
- X fi
- X echo "exit 1" >venix
- Xfi
- Xchmod +x bsd usg v7 eunice venix
- X$eunicefix bsd usg v7 eunice venix
- Xrm -rf foo
- Xrmlist="$rmlist bsd usg v7 eunice venix xenix"
- X
- X
- X: default clear to no extra flags
- Xxencf=
- Xxenlf=
- Xd_xenix="$undef"
- Xd_bsd="$undef"
- X: see if we are xenix
- Xif xenix; then
- X d_xenix="$define"
- X: now are we a 286
- X case "`uname -p`" in
- X i80286)
- X xencf="-LARGE -Ml2et32"
- X xenlf="-Ml2t32 -F 5600 -SEG 512"
- X esac
- Xfi
- Xif bsd; then
- X d_bsd="$define"
- Xfi
- X
- X: see if we need a special compiler
- Xecho " "
- Xif usg; then
- X case "$cc" in
- X '')
- X case "$Mcc" in
- X /*) dflt='Mcc'
- X ;;
- X *)
- X case "$large" in
- X -M*)
- X dflt='cc'
- X ;;
- X *)
- X if $contains '\-M' $mansrc/cc.1 >/dev/null 2>&1 ; then
- X dflt='cc -M'
- X else
- X dflt='cc'
- X fi
- X ;;
- X esac
- X ;;
- X esac
- X ;;
- X *) dflt="$cc";;
- X esac
- X $cat <<'EOM'
- X
- XOn some systems the default C compiler will not resolve multiple global
- Xreferences that happen to have the same name. On some such systems the
- X"Mcc" command may be used to force these to be resolved. On other systems
- Xa "cc -M" command is required. (Note that the -M flag on other systems
- Xindicates a memory model to use!) If you have the Gnu C compiler, you
- Xmight wish to use that instead. What command will force resolution on
- X
- X For building GB+, we recommend GCC, since it is faster.
- XEOM
- X $echo $n "this system? [$dflt] $c"
- X rp="Command to resolve multiple refs? [$dflt]"
- X . myread
- X cc="$ans"
- Xelse
- X case "$cc" in
- X '') dflt=gcc;;
- X *) dflt="$cc";;
- X esac
- X rp="Use which C compiler? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X cc="$ans"
- Xfi
- Xcase "$cc" in
- Xgcc*) cpp=`loc gcc-cpp $cpp $pth`;;
- Xesac
- X
- X: determine optimize, if desired, or use for debug flag also
- Xcase "$optimize" in
- X' ') dflt="none"
- X ;;
- X'') dflt="-O";
- X ;;
- X*) dflt="$optimize"
- X ;;
- Xesac
- Xcat <<EOH
- X
- XSome C compilers have problems with their optimizers, by default, $package
- Xcompiles with the -O flag to use the optimizer. Alternately, you might
- Xwant to use the symbolic debugger, which uses the -g flag (on traditional
- XUnix systems). Either flag can be specified here. To use neither flag,
- Xspecify the word "none".
- X
- XEOH
- Xrp="What optimizer/debugger flag should be used? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xoptimize="$ans"
- Xcase "$optimize" in
- X'none') optimize=" "
- X ;;
- Xesac
- X
- Xcase "$ccflags" in
- X'') case "$cc" in
- X *gcc*) dflt='-fpcc-struct-return';;
- X *) dflt='';;
- X esac
- X ;;
- X*) dflt="$ccflags";;
- Xesac
- Xfor thisincl in $inclwanted; do
- X if test -d $thisincl; then
- X case "$dflt" in
- X *$thisincl*);;
- X *) dflt="$dflt -I$thisincl";;
- X esac
- X fi
- Xdone
- Xcase "$optimize" in
- X-g*)
- X case "$dflt" in
- X *DEBUG*);;
- X *) dflt="$dflt -DDEBUG";;
- X esac
- X ;;
- Xesac
- Xcase "$dflt" in
- X'') dflt=none;;
- Xesac
- Xif $test -n "$xencf" ; then
- X $echo "Xenix 286 system, using compiler flags $xencf"
- X $echo "do not respecify these flags below."
- X $echo ""
- Xfi
- Xcat <<EOH
- X
- XYour C compiler may want other flags. For this question you should
- Xinclude -I/whatever and -DWHATEVER flags and any other flags used by
- Xthe C compiler, but you should NOT include libraries or ld flags like
- X-lwhatever. To use no flags, specify the word "none".
- X
- XEOH
- Xrp="Any additional cc flags? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- Xnone) ans='';
- Xesac
- Xccflags="$ans"
- X
- X: the following weeds options from ccflags that are of no interest to cpp
- Xcppflags="$ccflags"
- Xcase "$cc" in
- X*gcc*) cppflags="$cppflags -D__GNUC__";;
- Xesac
- Xcase "$cppflags" in
- X'');;
- X*) set X $cppflags
- X cppflags=''
- X for flag do
- X case $flag in
- X -D*|-I*) cppflags="$cppflags $flag";;
- X esac
- X done
- X case "$cppflags" in
- X *-*) echo "(C preprocessor flags: $cppflags)";;
- X esac
- X ;;
- Xesac
- X
- Xif $test -n "$xenlf" ; then
- X $echo "Xenix 286 system, using linker flags $xenlf"
- X $echo "do not respecify these flags below"
- X $echo ""
- Xfi
- Xcase "$ldflags" in
- X'') if venix; then
- X dflt='-i -z'
- X else
- X dflt='none'
- X fi
- X ;;
- X*) dflt="$ldflags";;
- Xesac
- Xecho " "
- Xrp="Any additional ld flags (NOT including libraries)? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- Xnone) ans='';
- Xesac
- Xldflags="$ans"
- Xrmlist="$rmlist pdp11"
- X
- Xecho " "
- Xecho "Checking for optional libraries..."
- Xcase "$libs" in
- X'') dflt='';;
- X*) dflt="$libs";;
- Xesac
- Xcase "$libswanted" in
- X'') libswanted='c_s';;
- Xesac
- Xfor thislib in $libswanted; do
- X case "$thislib" in
- X dbm) thatlib=ndbm;;
- X *_s) thatlib=NONE;;
- X *) thatlib="${thislib}_s";;
- X *) thatlib=NONE;;
- X esac
- X xxx=`loc lib$thislib.a X /usr/lib /usr/local/lib /lib`
- X if test -f $xxx; then
- X echo "Found -l$thislib."
- X case "$dflt" in
- X *-l$thislib*|*-l$thatlib*);;
- X *) dflt="$dflt -l$thislib";;
- X esac
- X else
- X xxx=`loc lib$thislib.a X $libpth`
- X if test -f $xxx; then
- X echo "Found $xxx."
- X case "$dflt" in
- X *$xxx*);;
- X *) dflt="$dflt $xxx";;
- X esac
- X else
- X xxx=`loc Slib$thislib.a X $xlibpth`
- X if test -f $xxx; then
- X echo "Found -l$thislib."
- X case "$dflt" in
- X *-l$thislib*|*-l$thatlib*);;
- X *) dflt="$dflt -l$thislib";;
- X esac
- X else
- X echo "No -l$thislib."
- X fi
- X fi
- X fi
- Xdone
- Xset X $dflt
- Xshift
- Xdflt="$*"
- Xcase "$dflt" in
- X'') dflt='none';;
- Xesac
- X
- X$cat <<EOM
- X
- XSome versions of Unix support shared libraries, which make
- Xexecutables smaller but make load time slightly longer.
- X
- XOn some systems, mostly newer Unix System V's, the shared library
- Xis included by putting the option "-lc_s" as the last thing on the
- Xcc command line when linking. Other systems use shared libraries
- Xby default. There may be other libraries needed to compile $package
- Xon your machine as well. If your system needs the "-lc_s" option,
- Xinclude it here. Include any other special libraries here as well.
- XSay "none" for none.
- XEOM
- X
- Xecho " "
- Xrp="Any additional libraries? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- Xnone) ans='';
- Xesac
- Xlibs="$ans"
- X
- X: check for ordering of bytes in a long
- Xcase "$byteorder" in
- X'')
- Xcat <<'EOM'
- X
- XIn the following, larger digits indicate more significance. A big-endian
- Xmachine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
- Xlittle-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
- Xmachines may have weird orders like 3412. A Cray will report 87654321. If
- Xthe test program works the default is probably right.
- XI'm now running the test program...
- XEOM
- X $cat >try.c <<'EOCP'
- X#include <stdio.h>
- Xmain()
- X{
- X int i;
- X union {
- X unsigned long l;
- X char c[sizeof(long)];
- X } u;
- X
- X if (sizeof(long) > 4)
- X u.l = 0x0807060504030201;
- X else
- X u.l = 0x04030201;
- X for (i=0; i < sizeof(long); i++)
- X printf("%c",u.c[i]+'0');
- X printf("\n");
- X}
- XEOCP
- X if $cc try.c -o try >/dev/null 2>&1 ; then
- X dflt=`./try`
- X case "$dflt" in
- X ????|????????) echo "(The test program ran ok.)";;
- X *) echo "(The test program didn't run right for some reason.)";;
- X esac
- X else
- X dflt='4321'
- X echo "(I can't seem to compile the test program. Guessing big-endian...)"
- X fi
- X ;;
- X*)
- X echo " "
- X dflt="$byteorder"
- X ;;
- Xesac
- Xrp="What is the order of bytes in a long? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xbyteorder="$ans"
- X$rm -f try.c try
- X
- X: get list of predefined functions in a handy place
- Xecho " "
- Xcase "$libc" in
- X'') libc=unknown;;
- Xesac
- Xcase "$libpth" in
- X'') libpth='/lib /usr/lib /usr/local/lib';;
- Xesac
- Xcase "$libs" in
- X*-lc_s*) libc=`loc libc_s.a $libc $libpth`
- Xesac
- Xlibnames='';
- Xcase "$libs" in
- X'') ;;
- X*) for thislib in $libs; do
- X case "$thislib" in
- X -l*) thislib=`expr X$thislib : 'X-l\(.*\)'`
- X try=`loc lib$thislib.a blurfl/dyick $libpth`
- X if test ! -f $try; then
- X try=`loc lib$thislib blurfl/dyick $libpth`
- X if test ! -f $try; then
- X try=`loc $thislib blurfl/dyick $libpth`
- X if test ! -f $try; then
- X try=`loc Slib$thislib.a blurfl/dyick $xlibpth`
- X if test ! -f $try; then
- X try=''
- X fi
- X fi
- X fi
- X fi
- X libnames="$libnames $try"
- X ;;
- X *) libnames="$libnames $thislib" ;;
- X esac
- X done
- X ;;
- Xesac
- Xset /usr/lib/libc.so.[0-9]*
- Xeval set \$$#
- Xif test -f "$1"; then
- X echo "Your shared C library is in $1."
- X libc="$1"
- Xelif test -f $libc; then
- X echo "Your C library is in $libc, like you said before."
- Xelif test -f /lib/libc.a; then
- X echo "Your C library is in /lib/libc.a. You're normal."
- X libc=/lib/libc.a
- Xelse
- X if test "$uname_os" != DomainOS ; then
- X ans=`loc libc.a blurfl/dyick $libpth`
- X fi
- X if test ! -f "$ans"; then
- X ans=`loc libc blurfl/dyick $libpth`
- X fi
- X if test ! -f "$ans"; then
- X ans=`loc clib blurfl/dyick $libpth`
- X fi
- X if test ! -f "$ans"; then
- X ans=`loc Slibc.a blurfl/dyick $xlibpth`
- X fi
- X if test ! -f "$ans"; then
- X ans=`loc Mlibc.a blurfl/dyick $xlibpth`
- X fi
- X if test ! -f "$ans"; then
- X ans=`loc Llibc.a blurfl/dyick $xlibpth`
- X fi
- X if test -f "$ans"; then
- X echo "Your C library is in $ans, of all places."
- X libc=$ans
- X else
- X cat <<EOM
- X
- XI can't seem to find your C library. I've looked in the following places:
- X
- X $libpth
- X
- XNone of these seems to contain your C library. What is the full name
- XEOM
- X dflt=None
- X $echo $n "of your C library? $c"
- X rp='C library full name?'
- X . myread
- X libc="$ans"
- X fi
- Xfi
- Xecho " "
- Xset `echo $libc $libnames | tr ' ' '\012' | sort | uniq`
- X$echo $n "Extracting names from $* for later perusal...$c"
- Xnm $* 2>/dev/null >libc.tmp
- X$sed -n -e 's/^.* [AT] *_[_.]*//p' -e 's/^.* [AT] //p' <libc.tmp >libc.list
- Xif $contains '^printf$' libc.list >/dev/null 2>&1; then
- X echo "done"
- Xelse
- X $sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p' <libc.tmp >libc.list
- X $contains '^printf$' libc.list >/dev/null 2>&1 || \
- X $sed -n -e 's/^.* D __*//p' -e 's/^.* D //p' <libc.tmp >libc.list
- X $contains '^printf$' libc.list >/dev/null 2>&1 || \
- X $sed -n -e 's/^_//' \
- X -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p' <libc.tmp >libc.list
- X if $contains '^printf$' libc.list >/dev/null 2>&1; then
- X echo "done"
- X else
- X echo " "
- X echo "nm didn't seem to work right."
- X echo "Trying ar instead..."
- X if ar t $libc > libc.tmp; then
- X for thisname in $libnames; do
- X ar t $thisname >>libc.tmp
- X done
- X $sed -e 's/\.o$//' < libc.tmp > libc.list
- X echo "Ok."
- X else
- X echo "ar didn't seem to work right."
- X echo "Maybe this is a Cray...trying bld instead..."
- X if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list; then
- X for thisname in $libnames; do
- X bld t $libnames | \
- X $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
- X ar t $thisname >>libc.tmp
- X done
- X echo "Ok."
- X else
- X echo "That didn't work either. Giving up."
- X exit 1
- X fi
- X fi
- X fi
- Xfi
- X
- Xinlibc='echo " ";
- Xif $contains "^$1\$" libc.list >/dev/null 2>&1;
- Xthen echo "$1() found"; eval "$2=$define";
- Xelse echo "$1() not found"; eval "$2=$undef"; fi'
- X
- Xrmlist="$rmlist libc.tmp libc.list"
- X
- X: now get the host name
- Xecho " "
- Xecho "Figuring out host name..."
- Xecho 'Maybe "hostname" will work...'
- Xif ans=`sh -c hostname 2>&1` ; then
- X hostname=$ans
- X phostname=hostname
- Xelse
- X if xenix; then
- X echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
- X if ans=`cat /etc/systemid 2>&1` ; then
- X hostname=$ans
- X phostname='cat /etc/systemid'
- X echo "Whadyaknow. Xenix always was a bit strange..."
- X else
- X echo 'No, maybe "uuname -l" will work...'
- X if ans=`sh -c 'uuname -l' 2>&1` ; then
- X hostname=$ans
- X phostname='uuname -l'
- X else
- X echo 'Strange. Maybe "uname -n" will work...'
- X if ans=`sh -c 'uname -n' 2>&1` ; then
- X hostname=$ans
- X phostname='uname -n'
- X else
- X echo 'Oh well, maybe I can mine it out of whoami.h...'
- X if ans=`sh -c $contains' sysname /usr/include/whoami.h' 2>&1` ; then
- X hostname=`echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'`
- X phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' </usr/include/whoami.h"
- X else
- X case "$hostname" in
- X '') echo "Does this machine have an identity crisis or something?"
- X phostname=''
- X ;;
- X *) echo "Well, you said $hostname before...";;
- X esac
- X fi
- X fi
- X fi
- X fi
- X else
- X if $test -r /etc/systemid ; then
- X echo "What is a non-Xenix system doing with /etc/systemid?"
- X fi
- X echo 'No, maybe "uuname -l" will work...'
- X if $test -n "$uuname" && ans=`sh -c "$uuname -l" 2>&1` ; then
- X hostname=$ans
- X phostname="$uuname -l"
- X else
- X echo 'Strange. Maybe "uname -n" will work...'
- X if $test -n "$uname" && ans=`sh -c "$uname -n" 2>&1` ; then
- X hostname=$ans
- X phostname="$uname -n"
- X else
- X if ans=`cat /etc/systemid 2>&1` ; then
- X hostname=$ans
- X phostname='cat /etc/systemid'
- X echo "Well, I'll use the systemid file anyway..."
- X else
- X echo 'Oh well, maybe I can mine it out of whoami.h...'
- X if ans=`sh -c $contains' sysname /usr/include/whoami.h' 2>&1` ; then
- X hostname=`echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'`
- X phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' </usr/include/whoami.h"
- X else
- X case "$hostname" in
- X '') echo "Does this machine have an identity crisis or something?"
- X phostname=''
- X ;;
- X *) echo "Well, you said $hostname before...";;
- X esac
- X fi
- X fi
- X fi
- X fi
- X fi
- Xfi
- X: you do not want to know about this
- Xset $hostname
- Xhostname=$1
- X
- X: translate upper to lower if necessary
- Xcase "$hostname" in
- X *[A-Z]*)
- X hostname=`echo $hostname | tr '[A-Z]' '[a-z]'`
- X echo "(Normalizing case in your host name)"
- X ;;
- Xesac
- X
- X: verify guess
- Xif $test "$hostname" ; then
- X dflt=y
- X echo 'Your host name appears to be "'$hostname'".'
- X echo $n "Is this correct? [$dflt] "
- X . myread
- X case "$ans" in
- X y*) ;;
- X *) hostname='' ;;
- X esac
- Xfi
- X
- X: bad guess or no guess
- Xwhile $test "X$hostname" = X ; do
- X dflt=''
- X rp="Please type the (one word) name of your host:"
- X $echo $n "$rp $c"
- X . myread
- X hostname="$ans"
- Xdone
- X
- Xecho " "
- Xcase "$hostname" in
- X*.*)
- X dflt=`$expr "X$hostname" : "X[^.]*\(\..*\)"`
- X hostname=`$expr "X$hostname" : "X\([^.]*\)\."`
- X echo "(Trimming domain name from host name--host name is now $hostname)"
- X ;;
- X*) case "$mydomain" in
- X '') dflt='.UUCP';;
- X *) dflt="$mydomain";;
- X esac
- X ;;
- Xesac
- X
- Xecho " "
- X: verify guess
- Xif $test "$hostname" ; then
- X dflt=y
- X echo $n 'Will the GB server be running on '$hostname?' [y] '
- X . myread
- X case "$ans" in
- X y*) ;;
- X *) hostname='' ;;
- X esac
- Xfi
- X
- X: bad guess or no guess
- Xwhile $test "X$hostname" = X ; do
- X dflt=''
- X rp="Please type the (one word) name of your host: "
- X $echo $n "$rp $c"
- X . myread
- X hostname="$ans"
- Xdone
- X
- X
- X
- X: find domain name
- Xecho " "
- Xecho "Trying to figure out your domainname"
- Xif ans=`sh -c domainname 2>&1` ; then
- X mydomain=$ans
- X phostname=hostname
- Xelse
- Xrp="What is your domain name? [$dflt] "
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- X'') ;;
- X.*) ;;
- X*) ans=".$ans";;
- Xesac
- Xmydomain="$ans"
- Xfi
- X
- X: verify guess
- Xif $test "$hostname" ; then
- X dflt=y
- X echo 'Your host domain name appears to be "'$mydomain'".'
- X echo $n "Is this correct? [$dflt] "
- X . myread
- X case "$ans" in
- X y*) ;;
- X *) mydomain='' ;;
- X esac
- Xfi
- X
- X: bad guess or no guess
- Xwhile $test "X$mydomain" = X ; do
- X dflt=''
- X rp="Please type your domainname in: "
- X $echo $n "$rp $c"
- X . myread
- X mydomain="$ans"
- Xdone
- X
- X
- X: be very verbose...
- Xecho " "
- Xecho "So let me get this straight... the GB server will be running on"
- Xecho "the machine $hostname.$mydomain."
- X: verify guess
- X dflt=y
- X rp="Is this correct? [$dflt]"
- X# $echo $n "Is this correct? [$dflt] $c "
- X $echo $n $rp $c
- X . myread
- X case "$ans" in
- X y*) host=$hostname.$mydomain;;
- X *) host='' ;;
- X esac
- X
- X: bad guess or no guess
- Xwhile $test "X$host" = X ; do
- X dflt=''
- X rp="Please type the machine name _and_ domain name of the server host: "
- X $echo $n "$rp $c"
- X . myread
- X hostserver="$ans"
- X host="$ans"
- Xdone
- X
- X: get the port number...
- X dflt="2010"
- X rp="What port would you like the server to run on? [$dflt] "
- X $echo $n "$rp $c"
- X . myread
- X port="$ans"
- X echo " "
- X
- X: get the top level path.
- X echo " "
- X dflt=`(cd ..; pwd)`
- X echo "This question will determine where the data files pertaining to"
- X echo "$package will be kept. It is usually kept in this directory."
- X echo " "
- X rp="Where would you like create the Data/News/Tele Directorys? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X gbpath="$ans"
- X echo " "
- X
- X: Ask about using threshloading.
- X dflt=y
- X rp="Would you like to use threshloading in the game? [$dflt]"
- X echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X n*) echo "Ok, we won't then!"
- X d_threshloading="$undef"
- X ;;
- X *) echo "Ok, setting #define THRESHLOADING"
- X d_threshloading="$define"
- X ;;
- X esac
- X
- X: Ask about using autoscrap.
- X dflt=y
- X rp="Would you like to use autocsrap in the game? [$dflt]"
- X echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X n*) echo "Ok, we won't then!"
- X d_autoscrap="$undef"
- X ;;
- X *) echo "Ok, setting #define AUTOSCRAP"
- X d_autoscrap="$define"
- X ;;
- X esac
- X
- X: Ask about using superpods.
- X dflt=y
- X rp="Would you like to use superpods in the game (9r/75% success)? [$dflt]"
- X echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X n*) echo "Ok, we won't then!"
- X spore_success_rate="25"
- X d_superpod="$undef"
- X ;;
- X *) echo "Ok, setting #define SUPER_PODS"
- X spore_success_rate="75"
- X d_superpod="$define"
- X ;;
- X esac
- X
- X: Ask about using multi_comm_chan.
- X dflt=n
- X rp="Would you like to use multiple comm channels in the game? [$dflt]"
- X echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X n*) echo "Ok, we won't then!"
- X d_multi_comm="$undef"
- X ;;
- X *) echo "Ok, setting #define MULTIPLE_COMM_CHANNELS"
- X d_multi_comm="$define"
- X ;;
- X esac
- X
- X: see if getopt exists
- Xset getopt d_getopt
- Xeval $inlibc
- X
- X: see how we invoke the C preprocessor
- Xecho " "
- Xecho "Now, how can we feed standard input to your C preprocessor..."
- Xcat <<'EOT' >testcpp.c
- X#define ABC abc
- X#define XYZ xyz
- XABC.XYZ
- XEOT
- Xecho 'Maybe "'"$cc"' -E" will work...'
- X$cc -E <testcpp.c >testcpp.out 2>&1
- X: try to force gcc preprocessor if that is the compiler they are using
- Xcase $? in
- X0) cppstdin="$cc -E";;
- X*) case "$cc" in
- X *gcc*)
- X cd ..
- X echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
- X echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
- X chmod 755 cppstdin
- X cppstdin=`pwd`/cppstdin
- X cppminus='';
- X cd UU
- X $cppstdin <testcpp.c >testcpp.out 2>&1
- X ;;
- X esac
- X ;;
- Xesac
- Xif $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Yup, it does."
- X cppstdin="$cc -E"
- X cppminus='';
- Xelse
- X echo 'Nope, maybe "'$cpp'" will work...'
- X $cpp <testcpp.c >testcpp.out 2>&1
- X if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Yup, it does."
- X cppstdin="$cpp"
- X cppminus='';
- X else
- X echo 'No such luck...maybe "'$cpp' -" will work...'
- X $cpp - <testcpp.c >testcpp.out 2>&1
- X if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "It works!"
- X cppstdin="$cpp"
- X cppminus='-';
- X else
- X echo 'Nixed again...maybe "'"$cc"' -E -" will work...'
- X $cc -E - <testcpp.c >testcpp.out 2>&1
- X if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Hooray, it works! I was beginning to wonder."
- X cppstdin="$cc -E"
- X cppminus='-';
- X else
- X echo 'Nope...maybe "'"$cc"' -P" will work...'
- X $cc -P <testcpp.c >testcpp.out 2>&1
- X if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Yup, that does."
- X cppstdin="$cc -P"
- X cppminus='';
- X else
- X echo 'Nope...maybe "'"$cc"' -P -" will work...'
- X $cc -P - <testcpp.c >testcpp.out 2>&1
- X if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Yup, that does."
- X cppstdin="$cc -P"
- X cppminus='-';
- X else
- X echo 'Hmm...perhaps you already told me...'
- X case "$cppstdin" in
- X '') ;;
- X *) $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1;;
- X esac
- X if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Hooray, you did! I was beginning to wonder."
- X else
- X echo 'Uh-uh. Time to get fancy...'
- X cd ..
- X echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
- X echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
- X chmod 755 cppstdin
- X cppstdin=`pwd`/cppstdin
- X cppminus='';
- X cd UU
- X $cppstdin <testcpp.c >testcpp.out 2>&1
- X if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Eureka!."
- X else
- X dflt=blurfl
- X $echo $n "No dice. I can't find a C preprocessor. Name one: $c"
- X rp='Name a C preprocessor:'
- X . myread
- X cppstdin="$ans"
- X $cppstdin <testcpp.c >testcpp.out 2>&1
- X if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "OK, that will do."
- X else
- X echo "Sorry, I can't get that to work. Go find one."
- X exit 1
- X fi
- X fi
- X fi
- X fi
- X fi
- X fi
- X fi
- X fi
- Xfi
- Xrm -f testcpp.c testcpp.out
- X
- X: get C preprocessor symbols handy
- Xecho " "
- Xecho $attrlist | $tr '[ - ]' '[\012-\012]' >Cppsym.know
- X$cat <<EOSS >Cppsym
- X$startsh
- Xcase "\$1" in
- X-l) list=true
- X shift
- X ;;
- Xesac
- Xunknown=''
- Xcase "\$list\$#" in
- X1|2)
- X for sym do
- X if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
- X exit 0
- X elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
- X :
- X else
- X unknown="\$unknown \$sym"
- X fi
- X done
- X set X \$unknown
- X shift
- X ;;
- Xesac
- Xcase \$# in
- X0) exit 1;;
- Xesac
- Xecho \$* | $tr '[ - ]' '[\012-\012]' | $sed -e 's/\(.*\)/\\
- X#ifdef \1\\
- Xexit 0; _ _ _ _\1\\ \1\\
- X#endif\\
- X/' >/tmp/Cppsym\$\$
- Xecho exit 1 >>/tmp/Cppsym\$\$
- X$cppstdin $cppminus </tmp/Cppsym\$\$ >/tmp/Cppsym2\$\$
- Xcase "\$list" in
- Xtrue) awk 'NF > 5 {print substr(\$6,2,100)}' </tmp/Cppsym2\$\$ ;;
- X*)
- X sh /tmp/Cppsym2\$\$
- X status=\$?
- X ;;
- Xesac
- X$rm -f /tmp/Cppsym\$\$ /tmp/Cppsym2\$\$
- Xexit \$status
- XEOSS
- Xchmod +x Cppsym
- X$eunicefix Cppsym
- Xecho "Your C preprocessor defines the following symbols:"
- XCppsym -l $attrlist >Cppsym.true
- Xcat Cppsym.true
- Xrmlist="$rmlist Cppsym Cppsym.know Cppsym.true"
- X
- X
- X: see if we should include time.h, sys/time.h, or both
- Xcat <<'EOM'
- X
- XTesting to see if we should include <time.h>, <sys/time.h> or both.
- XI'm now running the test program...
- XEOM
- X$cat >try.c <<'EOCP'
- X#ifdef I_TIME
- X#include <time.h>
- X#endif
- X#ifdef I_SYSTIME
- X#ifdef SYSTIMEKERNEL
- X#define KERNEL
- X#endif
- X#include <sys/time.h>
- X#endif
- Xmain()
- X{
- X struct tm foo;
- X#ifdef S_TIMEVAL
- X struct timeval bar;
- X#endif
- X if (foo.tm_sec == foo.tm_sec)
- X exit(0);
- X#ifdef S_TIMEVAL
- X if (bar.tv_sec == bar.tv_sec)
- X exit(0);
- X#endif
- X exit(1);
- X}
- XEOCP
- Xflags=''
- Xfor s_timeval in '-DS_TIMEVAL' ''; do
- X for d_systimekernel in '' '-DSYSTIMEKERNEL'; do
- X for i_time in '' '-DI_TIME'; do
- X for i_systime in '-DI_SYSTIME' ''; do
- X case "$flags" in
- X '') echo Trying $i_time $i_systime $d_systimekernel $s_timeval
- X if $cc $ccflags $i_time $i_systime $d_systimekernel $s_timeval \
- X try.c -o try >/dev/null 2>&1 ; then
- X set X $i_time $i_systime $d_systimekernel $s_timeval
- X shift
- X flags="$*"
- X echo Succeeded with $flags
- X fi
- X ;;
- X esac
- X done
- X done
- X done
- Xdone
- Xcase "$flags" in
- X*SYSTIMEKERNEL*) d_systimekernel="$define";;
- X*) d_systimekernel="$undef";;
- Xesac
- Xcase "$flags" in
- X*I_TIME*) i_time="$define";;
- X*) i_time="$undef";;
- Xesac
- Xcase "$flags" in
- X*I_SYSTIME*) i_systime="$define";;
- X*) i_systime="$undef";;
- Xesac
- X$rm -f try.c try
- X
- Xtimeincl=""
- Xif $test "$i_time" = define ; then
- X timeincl="/usr/include/time.h"
- Xfi
- Xif $test "$i_systime" = define ; then
- X timeincl="$timeincl /usr/include/sys/time.h"
- Xfi
- X$cat $timeincl /dev/null | $cppstdin $cppminus > try.c 2>&1
- Xif $contains 'tz_minuteswest' try.c > /dev/null 2>&1 ; then
- X echo "You have tz_minuteswest defined in $timeincl rather than timezone."
- X d_tz_min="$define"
- Xelse
- X echo "You have timezone defined in $timeincl rather than tz_minuteswest."
- X d_tz_min="$undef"
- Xfi
- X$rm -f try.c
- X
- Xecho " "
- Xecho "End of configuration questions."
- Xecho " "
- X
- X: create config.sh file
- Xecho " "
- Xif test -d ../UU; then
- X cd ..
- Xfi
- Xecho "Creating config.sh..."
- X$spitshell <<EOT >config.sh
- X$startsh
- X# config.sh
- X# This file was produced by running the Configure script.
- X
- Xhost='$host'
- Xport='$port'
- Xd_threshloading='$d_threshloading'
- Xd_autoscrap='$d_autoscrap'
- Xd_superpod='$d_superpod'
- Xd_multi_comm='$d_multi_comm'
- Xmaxlogsize='100000'
- Xgbpath='$gbpath'
- Xdefine='$define'
- XLog='$Log'
- XHeader='$Header'
- Xbin='$bin'
- Xbyteorder='$byteorder'
- Xcppstdin='$cppstdin'
- Xcppminus='$cppminus'
- Xd_getopt='$d_getopt'
- Xd_havetlib='$d_havetlib'
- Xtermlib='$termlib'
- Xhostname='$hostname'
- Xphostname='$phostname'
- Xmydomain='$mydomain'
- Xspore_success_rate='$spore_success_rate'
- Xi_time='$i_time'
- Xi_systime='$i_systime'
- Xd_systimekernel='$d_systimekernel'
- Xn='$n'
- Xc='$c'
- Xpackage='$package'
- Xexpr='$expr'
- Xsed='$sed'
- Xecho='$echo'
- Xcat='$cat'
- Xrm='$rm'
- Xmv='$mv'
- Xcp='$cp'
- Xtail='$tail'
- Xtr='$tr'
- Xmkdir='$mkdir'
- Xsort='$sort'
- Xuniq='$uniq'
- Xgrep='$grep'
- Xtrylist='$trylist'
- Xtest='$test'
- Xinews='$inews'
- Xegrep='$egrep'
- Xmore='$more'
- Xpg='$pg'
- XMcc='$Mcc'
- Xvi='$vi'
- Xcpp='$cpp'
- Xperl='$perl'
- Xemacs='$emacs'
- Xls='$ls'
- Xshar='$shar'
- Xuname='$uname'
- Xuuname='$uuname'
- Xline='$line'
- Xchgrp='$chgrp'
- Xchmod='$chmod'
- Xlint='$lint'
- Xsleep='$sleep'
- Xpr='$pr'
- Xtar='$tar'
- Xranlib='$ranlib'
- Xar='$ar'
- Xln='$ln'
- Xlpr='$lpr'
- Xlp='$lp'
- Xtouch='$touch'
- Xmake='$make'
- Xdate='$date'
- Xcsh='$csh'
- Xc_date='$c_date'
- Xd_cuserid='$d_cuserid'
- Xd_gethname='$d_gethname'
- Xd_index='$d_index'
- Xd_mmdf='$d_mmdf'
- Xd_newauto='$d_newauto'
- Xd_networkorder='$d_networkorder'
- Xd_pidcheck='$d_pidcheck'
- Xd_ptem='$d_ptem'
- Xd_setgid='$d_setgid'
- Xd_strcspn='$d_strcspn'
- Xd_strspn='$d_strspn'
- Xd_strings='$d_strings'
- Xd_pwdinsys='$d_pwdinsys'
- Xstrings='$strings'
- Xincludepath='$includepath'
- Xlib='$lib'
- Xlibc='$libc'
- Xsplit='$split'
- Xoptimize='$optimize'
- Xccflags='$ccflags'
- Xcppflags='$cppflags'
- Xldflags='$ldflags'
- Xcc='$cc'
- Xlibs='$libs'
- Xd_xenix='$d_xenix'
- Xd_bsd='$d_bsd'
- XCONFIG=true
- XEOT
- X
- XCONFIG=true
- X
- Xecho " "
- Xdflt=''
- Xfastread=''
- Xecho "If you didn't make any mistakes, then just type a carriage return here."
- Xrp="If you need to edit config.sh, do it as a shell escape here:"
- X$echo $n "$rp $c"
- X. UU/myread
- Xcase "$ans" in
- X'') ;;
- X*) : in case they cannot read
- X eval $ans;;
- Xesac
- X: if this fails, just run all the .SH files by hand
- X. ./config.sh
- X
- Xecho " "
- Xecho "Doing variable substitutions on .SH files..."
- Xset x `awk '{print $1}' <MANIFEST | $grep '\.SH'`
- Xshift
- Xcase $# in
- X0) set x *.SH; shift;;
- Xesac
- Xif test ! -f $1; then
- X shift
- Xfi
- Xfor file in $*; do
- X case "$file" in
- X */*)
- X dir=`$expr X$file : 'X\(.*\)/'`
- X file=`$expr X$file : 'X.*/\(.*\)'`
- X (cd $dir && . $file)
- X ;;
- X *)
- X . $file
- X ;;
- X esac
- Xdone
- Xif test -f config.h.SH; then
- X if test ! -f config.h; then
- X : oops, they left it out of MANIFEST, probably, so do it anyway.
- X . config.h.SH
- X fi
- Xfi
- X
- Xecho " "
- Xecho "Now I am going to create links for the utilites files"
- Xfor i in rand.c perm.c files.c shlmisc.c files_rw.c files_shl.c max.c
- Xdo
- X echo "ln -s server/$i utils/$i"
- X ln -s ../server/$i utils/$i
- Xdone
- X
- Xif test -f Makefile; then
- X echo " "
- X echo "Now you must run a make."
- Xelse
- X echo "Done."
- Xfi
- X
- X$rm -f kit*isdone
- X: the following is currently useless
- Xcd UU && $rm -f $rmlist
- X: since this removes it all anyway
- Xcd .. && $rm -rf UU
- X: end of Configure
- END_OF_FILE
- if test 41100 -ne `wc -c <'Configure'`; then
- echo shar: \"'Configure'\" unpacked with wrong size!
- fi
- chmod +x 'Configure'
- # end of 'Configure'
- fi
- if test -f 'hdrs/file.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'hdrs/file.h'\"
- else
- echo shar: Extracting \"'hdrs/file.h'\" \(11720 characters\)
- sed "s/^X//" >'hdrs/file.h' <<'END_OF_FILE'
- X/*
- X * @(#)file.h 3.1 (ULTRIX) 4/20/90
- X */
- X
- X
- X/************************************************************************
- X * *
- X * Copyright (c) 1985 - 1989 by *
- X * Digital Equipment Corporation, Maynard, MA *
- X * All rights reserved. *
- X * *
- X * This software is furnished under a license and may be used and *
- X * copied only in accordance with the terms of such license and *
- X * with the inclusion of the above copyright notice. This *
- X * software or any other copies thereof may not be provided or *
- X * otherwise made available to any other person. No title to and *
- X * ownership of the software is hereby transferred. *
- X * *
- X * This software is derived from software received from the *
- X * University of California, Berkeley, and from Bell *
- X * Laboratories. Use, duplication, or disclosure is subject to *
- X * restrictions under license agreements with University of *
- X * California and with AT&T. *
- X * *
- X * The information in this software is subject to change without *
- X * notice and should not be construed as a commitment by Digital *
- X * Equipment Corporation. *
- X * *
- X * Digital assumes no responsibility for the use or reliability *
- X * of its software on equipment which is not supplied by Digital. *
- X * *
- X ************************************************************************/
- X/************************************************************************
- X * Modification History *
- X * *
- X * David L Ballenger, 28-Mar-1985 *
- X * 0001 Modify so that <fcntl.h> can simply include this file. This *
- X * file already contains all the definitions contained in *
- X * <fcntl.h>, plus all the definitions that would need to be added *
- X * to <fcntl.h> from the BRL version for System V emulation. No *
- X * sense in defining things in multiple places. *
- X * *
- X * Larry Cohen, 4-April-1985 *
- X * 0002 Changes to support open block if in use capability *
- X * FBLKINUSE *
- X * O_BLKINUSE - open blocks if IINUSE bit in inode is set *
- X * *
- X * FBLKANDSET *
- X * O_BLKANDSET - open blocks if IINUSE bit in inode is set *
- X * and sets after open succeeds. *
- X * *
- X * Greg Depp 8-April-1985 *
- X * 0003 Added DTYPE_PORT to define System V IPC Named Pipe type *
- X * *
- X * Stephen Reilly, 09-Sept-85 *
- X * Modified to handle the new lockf code. *
- X * *
- X * Paul Shaughnessy, 24-December-1985 *
- X * 0004 Added syncronous write capability in open and fcntl system *
- X * calls. *
- X * *
- X * 11-Mar-86 Larry Palmer *
- X * Added flag to mark a file as being used by n-bufferring. *
- X * *
- X * Tim Burke, 10-June-1986 *
- X * 0005 Inserted FTERMIO and O_TERMIO which tells if the program is to *
- X * run as a System V program. If so use a "RAW" type of default *
- X * settings rather that the normal "COOKED" style on terminal *
- X * line defaults. *
- X * *
- X * Tim Burke, 1-Dec-1987 *
- X * 0006 Inserted O_NONBLOCK which will be used to specify *
- X * the POSIX no delay open and I/O. *
- X * *
- X * Mark Parenti, 13-Jan-1988 *
- X * 0007 Moved define of R_OK, etc to KERNEL only as they are *
- X * defined in <unistd.h> for user level. Add O_ACCMODE POSIX *
- X * definition and change types of some structure entries. *
- X * *
- X * Mark Parenti, 15-Jan-1988 *
- X * 0008 Change definition of R_OK, etc. conditional on the previous *
- X * declaration of R_OK, etc. This allows existing programs *
- X * which use file.h for the above definitions to continue to *
- X * compile. *
- X * Paul Shaughnessy, 10-Feb-1988 *
- X * 0009 Added a PIPE flag, and changed definition of POSIX NONBLOCK *
- X * flag. *
- X * *
- X * 22-Aug-88 Paul Shaughnessy *
- X * Added FCNTLONLYSET define to aid in cleaning *
- X * up F_GETFL and F_SETFL fcntl(2) requests. *
- X * *
- X * Jon Reeves 30-May-1989 *
- X * Added parens around O_ACCMODE definition; moved unruly comments *
- X * Changed protection variable name for ANSI compliance *
- X * *
- X * Jon Reeves 11-Jul-1989 *
- X * Added function declarations for X/Open compliance *
- X * *
- X * Paul Shaughnessy 17-Jan-1990 *
- X * Added _POSIX_SOURCE and _XOPEN_SOURCE test macros *
- X * *
- X ************************************************************************/
- X
- X/*
- X !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- X ! WARNING !!!!!!!! This header file is described in XOPEN. To add macros !
- X ! or defines or structures, you must inclose them as follows: !
- X ! #if !defined(_POSIX_SOURCE) !
- X ! #endif !
- X ! Failure to do so, will break compatibility with the standard. !
- X !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- X*/
- X
- X/* Don't define things twice. This protects from a source file which
- X * includes both <fcntl.h> and <sys/file.h>
- X */
- X#ifndef _FCNTL_H_
- X#define _FCNTL_H_
- X
- X#if !defined(KERNEL)
- X#include <sys/types.h>
- X#endif
- X
- X#ifdef KERNEL && !defined(_POSIX_SOURCE)
- X/*
- X * Descriptor table entry.
- X * One for each kernel object.
- X */
- Xstruct file {
- X int f_flag; /* see below */
- X short f_type; /* descriptor type */
- X short f_count; /* reference count */
- X short f_msgcount; /* references from message queue */
- X struct fileops {
- X/* return function arguments */
- X int (*fo_rw)( /* fp,uio,rw */ );
- X int (*fo_ioctl)( /* fp,com,data,cred */ );
- X int (*fo_select)( /* fp,which */ );
- X int (*fo_close)( /* fp */ );
- X } *f_ops;
- X caddr_t f_data; /* inode */
- X off_t f_offset;
- X struct ucred *f_cred;
- X struct lock_t f_lk;
- X};
- X
- Xextern struct lock_t lk_file;
- Xstruct file *file, *fileNFILE;
- Xint nfile;
- Xstruct file *getf();
- Xstruct file *falloc();
- X#endif /* KERNEL && NOT _POSIX_SOURCE */
- X
- X/*
- X * flags - also some values are used by fcntl(2)
- X */
- X#define _FOPEN (-1)
- X#define _FREAD 00001 /* descriptor read/receive'able */
- X#define _FWRITE 00002 /* descriptor write/send'able */
- X#define _FNDELAY 00004 /* no delay */
- X#define _FAPPEND 00010 /* append on each write */
- X#define _FMARK 00020 /* mark during gc() */
- X#define _FDEFER 00040 /* defer for next gc pass */
- X#define _FASYNC 00100 /* signal pgrp when data ready */
- X#define _FSHLOCK 00200 /* shared lock present */
- X#define _FEXLOCK 00400 /* exclusive lock present */
- X#define _FCREAT 01000 /* create if nonexistant */
- X#define _FTRUNC 02000 /* truncate to zero length */
- X#define _FEXCL 04000 /* error if already created */
- X#define _FBLKINUSE 010000 /* block if "in use" *0002*/
- X#define _FBLKANDSET (020000|_FBLKINUSE)/* block, test and set "in use" */
- X#define _FSYNCRON 0100000 /* Write file syncronously *0004*/
- X#define _FNBUF 0200000 /* file used for n-buffering */
- X#define _FNBLOCK 0400000 /* POSIX no delay */
- X#define _FTERMIO 01000000 /* termio style program */
- X#define _FNOCTTY 02000000 /* termio no controlling tty */
- X#if !defined(_POSIX_SOURCE)
- X#define FOPEN _FOPEN
- X#define FREAD _FREAD
- X#define FWRITE _FWRITE
- X#define FNDELAY _FNDELAY
- X#define FAPPEND _FAPPEND
- X#define FMARK _FMARK
- X#define FDEFER _FDEFER
- X#define FASYNC _FASYNC
- X#define FSHLOCK _FSHLOCK
- X#define FEXLOCK _FEXLOCK
- X#define FCREAT _FCREAT
- X#define FTRUNC _FTRUNC
- X#define FEXCL _FEXCL
- X#define FBLKINUSE _FBLKINUSE
- X#define FBLKANDSET _FBLKANDSET
- X#define FSYNCRON _FSYNCRON
- X#define FNBUF _FNBUF
- X#define FNBLOCK _FNBLOCK
- X#define FTERMIO _FTERMIO
- X#define FNOCTTY _FNOCTTY
- X
- X/* bits to save after open */
- X#define FMASK 0510113 /* 0004 */
- X/*
- X * FCNTLCANT are flags that are used by the kernel exclusively;
- X * the user can't set them via fcntl(2).
- X */
- X#define FCNTLCANT (FREAD|FWRITE|FMARK|FDEFER|FSHLOCK|FEXLOCK|FNBUF)
- X/*
- X * FCNLTONLYSET are a set of flags that the user may set via a F_SETFL
- X * fcntl(2) request.
- X */
- X#define FCNTLONLYSET (FNDELAY|FAPPEND|FASYNC|FSYNCRON|FNBLOCK)
- X
- X#endif /* NOT _POSIX_SOURCE */
- X
- X/*
- X * Base, POSIX, and XOPEN defines....
- X *
- X * File access modes for open() and fcntl()
- X */
- X#define O_RDONLY 000 /* open for reading */
- X#define O_RDWR 002 /* open for read & write */
- X#define O_WRONLY 001 /* open for writing */
- X/*
- X * File status flags for open() and fcntl()
- X */
- X#define O_APPEND _FAPPEND /* append on each write */
- X#define O_NONBLOCK _FNBLOCK /* POSIX non-blocking I/O */
- X#if !defined(_POSIX_SOURCE) || defined(_XOPEN_SOURCE)
- X#define O_SYNC _FSYNCRON /* system V synchronous write */
- X#define O_NDELAY _FNDELAY /* non-blocking open */
- X#endif
- X/*
- X * Values for oflag used by open()
- X */
- X#define O_CREAT _FCREAT /* open with file create */
- X#define O_EXCL _FEXCL /* error on create if file exists */
- X#define O_NOCTTY _FNOCTTY /* POSIX don't give controlling tty */
- X#define O_TRUNC _FTRUNC /* open with truncation */
- X#if !defined(_POSIX_SOURCE)
- X#define O_BLKINUSE _FBLKINUSE /* block if "in use" *0002*/
- X#define O_BLKANDSET _FBLKANDSET /* block, test and set "in use" */
- X#define O_FSYNC _FSYNCRON /* syncronous write *0004*/
- X#define O_TERMIO _FTERMIO /* termio style program */
- X#endif /* NOT _POSIX_SOURCE */
- X/*
- X * mask for use with file access modes
- X */
- X#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
- X/*
- X * Values for cmd used by fcntl()
- X */
- X#define F_DUPFD 0 /* Duplicate fildes */
- X#define F_GETFD 1 /* Get fildes flags */
- X#define F_SETFD 2 /* Set fildes flags */
- X#define F_GETFL 3 /* Get file flags */
- X#define F_SETFL 4 /* Set file flags */
- X#define F_GETLK 7 /* Get file lock */
- X#define F_SETLK 8 /* Set file lock */
- X#define F_SETLKW 9 /* Set file lock and wait */
- X#if !defined(_POSIX_SOURCE)
- X#define F_GETOWN 5 /* Get owner */
- X#define F_SETOWN 6 /* Set owner */
- X#define F_SETSYN 10 /* Set syncronous write *0004*/
- X#define F_CLRSYN 11 /* Clear syncronous write *0004*/
- X#endif /* NOT _POSIX_SOURCE */
- X/*
- X * file descriptor flags used by fcntl(2)
- X */
- X#define FD_CLOEXEC 1 /* Close file descriptor on exec() */
- X
- X/* file segment locking set data type - information passed to system by user */
- X#if !defined(F_RDLCK) || defined(POSIX)
- Xstruct flock {
- X short l_type;
- X short l_whence;
- X off_t l_start;
- X off_t l_len; /* len = 0 means until end of file */
- X#ifndef POSIX
- X int l_pid;
- X#else
- X pid_t l_pid;
- X#endif
- X};
- X#endif /* NOT F_RDLCK or POSIX */
- X/*
- X * file segment locking types
- X */
- X#define F_RDLCK 01 /* Read lock */
- X#define F_WRLCK 02 /* Write lock */
- X#define F_UNLCK 03 /* Remove lock(s) */
- X
- X#if !defined(_POSIX_SOURCE)
- X/*
- X * Flock call.
- X */
- X#define LOCK_SH 1 /* shared lock */
- X#define LOCK_EX 2 /* exclusive lock */
- X#define LOCK_NB 4 /* don't block when locking */
- X#define LOCK_UN 8 /* unlock */
- X/*
- X * Lseek call.
- X */
- X#define L_SET 0 /* absolute offset */
- X#define L_INCR 1 /* relative to current offset */
- X#define L_XTND 2 /* relative to end of file */
- X
- X/*
- X * Access call.
- X * These are defined here for use by access() system call. User level
- X * programs should get these definitions from <unistd.h>. Included here
- X * for historical reasons.
- X */
- X#ifndef R_OK
- X#define F_OK 0 /* does file exist */
- X#define X_OK 1 /* is it executable by caller */
- X#define W_OK 2 /* writable by caller */
- X#define R_OK 4 /* readable by caller */
- X#endif /* R_OK */
- X
- X#ifdef KERNEL
- X#define GETF(fp, fd) { \
- X if ((unsigned)(fd) >= NOFILE || ((fp) = u.u_ofile[fd]) == NULL) { \
- X u.u_error = EBADF; \
- X return; \
- X } \
- X}
- X#define DTYPE_INODE 1 /* file */
- X#define DTYPE_SOCKET 2 /* communications endpoint */
- X#define DTYPE_PORT 3 /* port (named pipe) 0003 */
- X#define DTYPE_PIPE 4 /* pipe */
- X#endif /* KERNEL */
- X
- X#endif /* NOT _POSIX_SOURCE */
- X
- X#if !defined(KERNEL) || defined(POSIX)
- X/* Function declarations for X/Open compliance */
- Xint creat(), fcntl(), open();
- X#endif
- X
- X#endif /* _FCNTL_H_ */
- END_OF_FILE
- if test 11720 -ne `wc -c <'hdrs/file.h'`; then
- echo shar: \"'hdrs/file.h'\" unpacked with wrong size!
- fi
- # end of 'hdrs/file.h'
- fi
- if test -f 'misc/welcome.txt' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'misc/welcome.txt'\"
- else
- echo shar: Extracting \"'misc/welcome.txt'\" \(0 characters\)
- sed "s/^X//" >'misc/welcome.txt' <<'END_OF_FILE'
- END_OF_FILE
- if test 0 -ne `wc -c <'misc/welcome.txt'`; then
- echo shar: \"'misc/welcome.txt'\" unpacked with wrong size!
- fi
- # end of 'misc/welcome.txt'
- fi
- echo shar: End of archive 4 \(of 21\).
- cp /dev/null ark4isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 21 archives.
- echo "Now type './buildfiles.sh'"
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-