Path: utzoo!utgpu!cs.utexas.edu!yale!cs.yale.edu!weedeater.math.yale.edu From: craig@weedeater.math.yale.edu (Craig Kolb) Newsgroups: alt.sources Subject: kit 2.0, Part 02/02 Message-ID: <29164@cs.yale.edu> Date: 1 Mar 91 18:49:27 GMT Sender: news@cs.yale.edu Organization: Yale University Department of Mathematics Lines: 1328 Nntp-Posting-Host: weedeater.math.yale.edu #! /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 'Configure' <<'END_OF_FILE' X#! /bin/sh X# X# If these # comments don't work, trim them. Don't worry about any X# other 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'd X# suggest you cut out the prototypical config.h from the end of this X# file and edit it to reflect your system. Some packages may include X# samples of config.h for certain machines, so you might look for one X# of those.) 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# Write to ram@educ.emse.fr (Raphael Manfredi) and I will send you X# my version which slightly differs from the original written by X# Larry Wall.) X X# $Id: Configure,v 2.0 91/02/19 15:48:32 ram Exp $ X X: save PATH defined by user Xuser_path=$PATH X X: sanity checks XPATH='.:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin' XPATH=$PATH:'/usr/5bin:/etc:/usr/gnu/bin:/usr/new:/usr/new/bin:/usr/nbin' XPATH=$PATH:'/sys5.3/bin:/sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb' XPATH=$PATH:'/bsd4.3/usr/bin:/usr/bsd' 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 /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 Xd_eunice='' Xd_xenix='' Xd_bsd='' Xdefine='' Xeunicefix='' Xloclist='' Xexpr='' Xawk='' Xsed='' Xecho='' Xcat='' Xchgrp='' Xchmod='' Xchown='' Xrm='' Xmv='' Xcp='' Xtail='' Xtr='' Xmkdir='' Xsort='' Xuniq='' Xgrep='' Xtrylist='' Xtest='' Xinews='' Xegrep='' Xmore='' Xpg='' XMcc='' Xvi='' Xmail='' Xbison='' Xcpp='' Xperl='' XLog='' XHeader='' XId='' Xbin='' Xcontains='' Xdefeditor='' Xmansrc='' Xmanext='' Xmodels='' Xsplit='' Xsmall='' Xmedium='' Xlarge='' Xhuge='' Xccflags='' Xldflags='' Xcc='' Xcppflags='' Xoptimize='' Xn='' Xc='' Xpackage='' Xscriptdir='' Xspitshell='' Xshsharp='' Xsharpbang='' Xstartsh='' Xsysman='' Xmailer='' XCONFIG='' X: set package name Xpackage=kit 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 Xxlibpath='/usr/lib/386 /lib/386' Xlibpth='/usr/lib /usr/local/lib /usr/lib/large /lib '$xlibpth' /lib/large' Xlibpth=$libpth' /usr/lib/small /lib/small' Xsmallmach='pdp11 i8086 z8000 i80286 iAPX286' Xrmlist='ark[1-9]isdone ark[1-9][0-9]isdone' Xtrap 'echo " "; rm -f $rmlist; exit 1' 1 2 3 15 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 Xif ls blurfl >/dev/null 2>&1; then X if awk '' blurfl >/dev/null 2>&1; then X check='cat' X else X check='awk ""' X fi Xelse X check='ls' Xfi X X: Now test for existence of everything in MANIFEST Xif test -f ../MANIFEST; then X echo "First let's make sure your kit is complete. Checking..." X : some grep do not return a proper exit status X grep '^---' ../MANIFEST > .grepmani 2>/dev/null X if test -s .grepmani; then X(cd ..; eval $check `awk '!/^.*\/$/{if (b) print $1} X/^---/{b=1}' MANIFEST` || kill $$) >/dev/null X else X(cd ..; eval $check `awk '!/^.*\/$/{print $1}' MANIFEST` || kill $$) >/dev/null X fi X echo "Looks good..." Xelse X echo "No MANIFEST found. Hope your kit is complete !" Xfi Xrm -f .grepmani X Xpth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/5bin" Xpth=$pth" /usr/lbin /etc /usr/new /usr/new/bin /usr/nbin /usr/gnu/bin" Xpth=$pth" /usr/plx /vol/local/bin /usr/lib /lib /usr/local/lib" Xpth=$pth" /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/bin" Xpth=$pth" /bsd4.3/usr/ucb /usr/bsd" X: add PATH from user Xpth=$pth" "`echo $user_path | sed -e 's/:/ /g'` Xinclwanted='' 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 Xrm -f try today 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 <.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 "The star should be here-->$c" Xecho '*' Xrm -f .echotmp X X: now set up to do reads with possible shell escape and default assignment Xcat <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 <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 Xchown Xecho Xexpr Xgrep Xrm Xsed X" Xtrylist=" Xtest 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 <filexp <&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: determine where public executables go Xcase "$bin" in X'') X dflt=`loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin` X ;; X*) dflt="$bin" X ;; Xesac Xcont=true Xwhile $test "$cont" ; do X echo " " X rp="Where do you want to put the public executables? (~name ok) [$dflt]" X $echo $n "$rp $c" X . myread X bin="$ans" X bin=`filexp $bin` X if test -d $bin; then X cont='' X else X dflt=n X rp="Directory $bin doesn't exist. Use that name anyway? [$dflt]" X $echo $n "$rp $c" X . myread X dflt='' X case "$ans" in X y*) cont='';; X esac X fi Xdone X X: determine where manual pages are on this system Xecho " " Xcase "$sysman" in X '') sysman=`loc . /usr/man/man1 /usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1 /usr/man/u_man/man1 /usr/share/man/man1 /usr/catman/u_man/man1 /usr/man/l_man/man1 /usr/local/man/u_man/man1 /usr/local/man/l_man/man1 /usr/man/man.L` X ;; Xesac Xif test -d "$sysman"; then X echo "System manual is in $sysman." Xfi X X: make some quick guesses about what we are up against Xecho " " X$echo $n "Hmm... $c" Xcat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null Xif test `echo abc | tr a-z A-Z` = Abc ; then X if $contains SIGTSTP foo >/dev/null 2>&1 ; then X echo "Looks kind of like an USG system with BSD features, but we'll see..." X else X echo "Looks kind of like an USG system, but we'll see..." X fi X d_bsd="$undef" 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 echo "Looks kind of like a BSD system, but we'll see..." X d_bsd="$define" X echo exit 0 >bsd X echo exit 1 >usg X echo exit 1 >v7 Xelse X echo "Looks kind of like a Version 7 system, but we'll see..." X d_bsd="$undef" 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 eunicefix=unixtovms X d_eunice="$define" X: it so happens the Eunice I know will not run shell scripts in Unix format X ;; X*) X echo " " X echo "Congratulations. You aren't running Eunice." X eunicefix=':' 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 X d_xenix="$define" Xelse X echo " " X echo "It's not Xenix..." X echo "exit 1" >xenix X d_xenix="$undef" 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 -f foo Xrmlist="$rmlist bsd usg v7 eunice venix xenix" X X: see what memory models we can support Xcase "$models" in X'') X cat >pdp11.c <<'EOP' Xmain() { X#ifdef pdp11 X exit(0); X#else X exit(1); X#endif X} XEOP X cc -o pdp11 pdp11.c >/dev/null 2>&1 X if pdp11 2>/dev/null; then X dflt='unsplit split' X else X ans=`loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge` X case "$ans" in X X) dflt='none';; X *) if $test -d /lib/small || $test -d /usr/lib/small; then X dflt='small' X else X dflt='' X fi X if $test -d /lib/medium || $test -d /usr/lib/medium; then X dflt="$dflt medium" X fi X if $test -d /lib/large || $test -d /usr/lib/large; then X dflt="$dflt large" X fi X if $test -d /lib/huge || $test -d /usr/lib/huge; then X dflt="$dflt huge" X fi X esac X fi;; X*) dflt="$models";; Xesac X$cat </dev/null 2>&1 || \ X $contains '\-i' $mansrc/cc.1 >/dev/null 2>&1; then X dflt='-i' X else X dflt='none' X fi;; X *) dflt="$split";; X esac X rp="What flag indicates separate I and D space? [$dflt]" X $echo $n "$rp $c" X . myread X case "$ans" in X none) ans='';; X esac X split="$ans" X unsplit='';; X*large*|*small*|*medium*|*huge*) X case "$model" in X *large*) X case "$large" in X '') dflt='-Ml';; X *) dflt="$large";; X esac X rp="What flag indicates large model? [$dflt]" X $echo $n "$rp $c" X . myread X case "$ans" in X none) ans=''; X esac X large="$ans";; X *) large='';; X esac X case "$model" in X *huge*) case "$huge" in X '') dflt='-Mh';; X *) dflt="$huge";; X esac X rp="What flag indicates huge model? [$dflt]" X $echo $n "$rp $c" X . myread X case "$ans" in X none) ans=''; X esac X huge="$ans";; X *) huge="$large";; X esac X case "$model" in X *medium*) case "$medium" in X '') dflt='-Mm';; X *) dflt="$medium";; X esac X rp="What flag indicates medium model? [$dflt]" X $echo $n "$rp $c" X . myread X case "$ans" in X none) ans=''; X esac X medium="$ans";; X *) medium="$large";; X esac X case "$model" in X *small*) case "$small" in X '') dflt='none';; X *) dflt="$small";; X esac X rp="What flag indicates small model? [$dflt]" X $echo $n "$rp $c" X . myread X case "$ans" in X none) ans=''; X esac X small="$ans";; X *) small='';; X esac X ;; X*) X echo "Unrecognized memory models--you may have to edit Makefile.SH" X ;; Xesac 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 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=cc;; 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'') dflt="-O";; X*) dflt="$optimize";; Xesac Xcat </dev/null 2>&1; then X case "$dflt" in X *LANGUAGE_C*);; X *) dflt="$dflt -DLANGUAGE_C";; X esac Xfi Xcase "$dflt" in X'') dflt=none;; Xesac Xcat <config.sh X$startsh X# config.sh X# This file was produced by running the Configure script. X Xd_eunice='$d_eunice' Xd_xenix='$d_xenix' Xd_bsd='$d_bsd' Xdefine='$define' Xeunicefix='$eunicefix' Xloclist='$loclist' Xexpr='$expr' Xawk='$awk' Xsed='$sed' Xecho='$echo' Xcat='$cat' Xchgrp='$chgrp' Xchmod='$chmod' Xchown='$chown' 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' Xmail='$mail' Xbison='$bison' Xcpp='$cpp' Xperl='$perl' XLog='$Log' XHeader='$Header' XId='$Id' Xbin='$bin' Xcontains='$contains' Xdefeditor='$defeditor' Xmansrc='$mansrc' Xmanext='$manext' Xmodels='$models' Xsplit='$split' Xsmall='$small' Xmedium='$medium' Xlarge='$large' Xhuge='$huge' Xccflags='$ccflags' Xldflags='$ldflags' Xcc='$cc' Xcppflags='$cppflags' Xoptimize='$optimize' Xn='$n' Xc='$c' Xpackage='$package' Xscriptdir='$scriptdir' Xspitshell='$spitshell' Xshsharp='$shsharp' Xsharpbang='$sharpbang' Xstartsh='$startsh' Xsysman='$sysman' Xmailer='$mailer' 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. ./config.sh X Xecho " " Xecho "Doing variable substitutions on .SH files..." Xif test -f MANIFEST; then X set x `awk '{print $1}' /dev/null 2>&1; then X dflt=n X $cat < makedepend.out &" XIt can take a while, so you might not want to run it right now. X XEOM X rp="Run make depend now? [$dflt]" X $echo $n "$rp $c" X . UU/myread X case "$ans" in X y*) make depend X echo "Now you must run a make." X ;; X *) echo "You must run 'make depend' then 'make'." X ;; X esac Xelif 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 27274 -ne `wc -c <'Configure'`; then echo shar: \"'Configure'\" unpacked with wrong size! fi chmod +x 'Configure' # end of 'Configure' fi echo shar: End of archive 2 \(of 2\). cp /dev/null ark2isdone MISSING="" for I in 1 2 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked both archives. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0