📄 configure
字号:
#! /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.)## $Header: Head.U,v 1.0 87/05/22 12:28:10 lwall Exp $## 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.): sanity checks: the user has a better chance than we do of setting a reasonable PATH: but add some directories we need that are probably not therePATH=.:${PATH}:/etc:/usr/lib:/libexport PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$)if test ! -t 0; then echo "Say 'sh Configure', not 'sh <Configure'" exit 1fi(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.)"if test ! -d ../UU; then if test ! -d UU; then mkdir UU fi cd UUficase "$1" in-d) shift; fastread='yes';;esacd_eunice=''eunicefix=''define=''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=''Log=''Header=''bin=''cc=''contains=''cppstdin=''cppminus=''d_charsprf=''d_flexfnam=''d_index=''d_voidsig=''d_dirheader=''d_unistd=''libc=''mansrc=''manext=''models=''split=''small=''medium=''large=''huge=''ccflags=''ldflags=''n=''c=''package=''registers=''reg1=''reg2=''reg3=''reg4=''reg5=''reg6=''reg7=''reg8=''reg9=''reg10=''reg11=''reg12=''reg13=''reg14=''reg15=''reg16=''spitshell=''shsharp=''sharpbang=''startsh=''voidflags=''defvoidused=''CONFIG='': set package namepackage=patchecho " "echo "Beginning of configuration questions for $package kit.": Eunice requires " " instead of "", can you believe itecho " "define='define'undef='/*undef'libpth='/usr/lib /usr/local/lib /lib /usr/ccs/lib'smallmach='pdp11 i8086 z8000 i80286 iAPX286'rmlist='kit[1-9]isdone kit[1-9][0-9]isdone'trap 'echo " "; rm -f $rmlist; exit 1' 1 2 3: We must find out about Eunice earlyeunicefix=':'if test -f /etc/unixtovms; then eunicefix=/etc/unixtovmsfiif test -f /etc/unixtovms.exe; then eunicefix=/etc/unixtovms.exefiattrlist="mc68000 sun gcos unix ibm gimpel interdata tss os mert pyr"attrlist="$attrlist vax pdp11 i8086 z8000 u3b2 u3b5 u3b20 u3b200"attrlist="$attrlist ns32000 ns16000 iAPX286 mc300 mc500 mc700 sparc"attrlist="$attrlist nsc32000 sinix xenix venix posix ansi M_XENIX"attrlist="$attrlist mc68k m68k __STDC__"pth=`echo $PATH | tr : ' '`d_newshome="../../NeWS"defvoidused=7: some greps do not return status, grrr.echo "grimblepritz" >grimbleif grep blurfldyick grimble >/dev/null 2>&1 ; then contains=containselif grep grimblepritz grimble >/dev/null 2>&1 ; then contains=grepelse contains=containsfirm -f grimble: the following should work in any shellcase "$contains" incontains*) echo " " echo "AGH! Grep doesn't return a status. Attempting remedial action." cat >contains <<'EOSS'grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmpEOSSchmod +x containsesac: first determine how to suppress newline on echo commandecho "Checking echo to see how to suppress newlines..."(echo "hi there\c" ; echo " ") >.echotmpif $contains c .echotmp >/dev/null 2>&1 ; then echo "...using -n." n='-n' c=''else cat <<'EOM'...using \cEOM n='' c='\c'fiecho $n "Type carriage return to continue. Your cursor should be here-->$c"read ansrm -f .echotmp: now set up to do reads with possible shell escape and default assignmentcat <<EOSC >myreadcase "\$fastread" inyes) ans=''; echo " " ;;*) ans='!';;esacwhile 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" ;; esacdonerp='Your answer:'case "\$ans" in'') ans="\$dflt";;esacEOSC: general instructionscat <<EOH This installation shell script will examine your system and ask you questionsto determine how the $package package should be installed. If you get stuckon a question, you may use a ! shell escape to start a subshell or executea command. Many of the questions will have default answers in squarebrackets--typing carriage return will give you the default.On some of the questions which ask for file or directory names you areallowed to use the ~name construct to specify the login directory belongingto "name", even if you don't have a shell which knows about that. Questionswhere this is allowed will be marked "(~name ok)".EOHrp="[Type carriage return to continue]"echo $n "$rp $c". myreadcat <<EOHMuch effort has been expended to ensure that this shell script will runon any Unix system. If despite that it blows up on you, your best bet isto 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 haveto generate a config.sh file by hand.This installation script affects things in two ways: 1) it may do directvariable substitutions on some of the files included in this kit, and2) it builds a config.h file for inclusion in C programs. You may editany 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 itcurrently. The easiest thing to do is to edit config.sh and rerun all theSH files. Configure will offer to let you do this before it runs the SH files.EOHrp="[Type carriage return to continue]"echo $n "$rp $c". myread: get old answers, if there is a config file out thereif test -f ../config.sh; then echo " " dflt=y 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.";; *) echo "Fetching default answers from your old config.sh file..." tmp="$n" ans="$c" . ../config.sh n="$tmp" c="$ans" ;; esacfi: find out where common programs areecho " "echo "Locating common programs..."cat <<EOSC >loc$startshcase \$# in0) exit 1;;esacthing=\$1shiftdflt=\$1shiftfor 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 ;; esacdoneecho \$dfltexit 1EOSCchmod +x loc$eunicefix locloclist="exprsedechocatrmtrgrep"trylist="testMcccpp"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." ;; esacdoneecho " "echo "Don't worry if any of the following aren't found..."ans=offhandfor 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 ;; esacdonecase "$egrep" inegrep) echo "Substituting grep for egrep." egrep=$grep ;;esaccase "$test" intest) echo "Hopefully test is built into your sh." ;;/bin/test) echo " " dflt=n rp="Is your "'"'"test"'"'" built into sh? [$dflt] (OK to guess)" echo $n "$rp $c" . myread case "$ans" in y*) test=test ;; esac ;;*) test=test ;;esaccase "$echo" inecho) 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" >foo1 echo $n "hi there$c" >foo2 if cmp foo1 foo2 >/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 <<FOOThey 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'thave echo built in and we may have to run some Bourne shell scripts. Thatmeans 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 $rm -f foo1 foo2 ;;*) : cross your fingers echo=echo ;;esacrmlist="$rmlist loc": get list of predefined functions in a handy placeecho " "if test -f /lib/libc.a; then echo "Your C library is in /lib/libc.a. You're normal." libc=/lib/libc.aelse if test -f /lib/clib -a -f /lib/libc; then echo "Your standard C library is in /lib/libc. Must be Domain/OS." libc=/lib/libc elif test -f /lib/libsys_s.a; then echo "Your C library is in /lib/libsys_s.a. Must be a NeXT." libc=/lib/libsys_s.a else ans=`loc libc.a blurfl/dyick $libpth` if test ! -f $ans; then ans=`loc clib blurfl/dyick $libpth` fi if test ! -f $ans; then ans=`loc libc blurfl/dyick $libpth` fi if test -f $ans; then echo "Your C library is in $ans, of all places." libc=$ans else if test -f "$libc"; then echo "Your C library is in $libc, like you said before." else cat <<EOM I can't seem to find your C library. I've looked in the following places: $libpthNone of these seems to contain your C library. What is the full nameEOM dflt=None $echo $n "of your C library? $c" rp='C library full name?' . myread libc="$ans" fi fi fifiecho " "$echo $n "Extracting names from $libc for later perusal...$c"nm $libc 2>/dev/null | sed -n -e 's/^.* T _//p' -e 's/^.* T //p' > libc.listif $contains '^printf$' libc.list >/dev/null 2>&1; then echo "done"else nm $libc 2>/dev/null | sed -n -e 's/^.* D _//p' -e 's/^.* D //p' > libc.list if $contains '^printf$' libc.list >/dev/null 2>&1; then echo "done" else echo " " echo "nm didn't seem to work right." echo "Trying ar instead..." if ar t $libc | sed -e 's/\.o$//' > libc.list; then echo "Ok." else echo "That didn't work either. Giving up." exit 1 fi fifirmlist="$rmlist libc.list": make some quick guesses about what we are up againstecho " "$echo $n "Hmm... $c"if $contains SIGTSTP /usr/include/signal.h >/dev/null 2>&1 ; then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -