⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configure

📁 早期freebsd实现
💻
📖 第 1 页 / 共 5 页
字号:
#! /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$$ <<EOFARGGGHHHH!!!!!Your csh still thinks true is false.  Write to your vendor today and tellthem that next year Configure ought to "rm /bin/csh" unless they fix theirblasted shell. :-)[End of diatribe.  We now return you to your regularly scheduledprogramming...]EOFcat >/tmp/c2$$ <<EOFOOPS!  You naughty creature!  You didn't run Configure with sh!I will attempt to remedy the situation by running sh for you...EOFtrue || cat /tmp/c1$$ /tmp/c2$$true || exec sh $0export PATH || cat /tmp/c2$$export PATH || exec sh $0rm -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 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.)"unset CDPATHif test ! -d ../UU; then    if test ! -d UU; then	mkdir UU    fi    cd UUficase "$1" in-d) shift; fastread='yes';;esacd_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 packagepackage=perl: Here we go...echo " "echo "Beginning of configuration questions for $package kit.": Eunice requires " " instead of "", can you believe itecho " "define='define'undef='undef': change the next line if compiling for Xenix/286 on Xenix/386xlibpth='/usr/lib/386 /lib/386': the hints files may add more components to libpthtest -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 earlyeunicefix=':'if test -f /etc/unixtovms; then    eunicefix=/etc/unixtovmsfiif test -f /etc/unixtovms.exe; then    eunicefix=/etc/unixtovms.exefiattrlist="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=errnolisth_fcntl=falseh_sys_file=falseserve_shm=""serve_msg="$undef"serve_inet_udp=""serve_inet_tcp=""serve_unix_udp=""serve_unix_tcp=""d_ndir=ndirvoidwant=1voidwant=7libswanted="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 MANIFESTecho "First let's make sure your kit is complete.  Checking..."awk '$1 !~ /PACKINGLIST/ {print $1}' ../MANIFEST | split -100rm -f missingfor filelist in x??; do    (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing)doneif 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 junkelse    echo "Looks good..."fi: some greps do not return status, grrr.echo "grimblepritz" >contains.txtif grep blurfldyick contains.txt >/dev/null 2>&1 ; then    contains=containselif grep grimblepritz contains.txt >/dev/null 2>&1 ; then    contains=grepelse    contains=containsfi: 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: see if sh knows # commentsecho " "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    fielse    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 startupecho " "echo "Checking out how to guarantee sh startup..."startsh=$sharpbang'/bin/sh'echo "Let's see if '$startsh' works..."cat >start.sh <<EOSS$startshset abctest "$?abc" != 1EOSSchmod +x start.sh$eunicefix start.shif ./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 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 ans: 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 run on anyUnix system.  If despite that it blows up on you, your best bet is to editConfigure 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: 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 loc

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -