3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Configure,v 3.0.1.11 1997/02/28 14:52:55 ram Exp $
23 # Generated on Fri Feb 28 15:36:04 MET 1997 [metaconfig 3.0 PL60]
28 SCO csh still thinks true is false. Write to SCO today and tell them that next
29 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
31 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
32 we'd have to do is go in and swap the && and || tokens, wherever they are.)
34 [End of diatribe. We now return you to your regularly scheduled programming...]
38 OOPS! You naughty creature! You didn't run Configure with sh!
39 I will attempt to remedy the situation by running sh for you...
42 true || cat /tmp/c1$$ /tmp/c2$$
43 true || exec sh $0 $argv:q
45 (exit $?0) || cat /tmp/c2$$
46 (exit $?0) || exec sh $0 $argv:q
47 rm -f /tmp/c1$$ /tmp/c2$$
49 : compute my invocation name
53 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
58 : Proper PATH separator
60 : On OS/2 this directory should exist if this is not floppy only system :-]
63 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
64 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
68 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
69 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
70 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
71 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
72 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
73 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
74 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
75 paths="$paths /sbin /usr/sbin /usr/libexec"
81 *) test -d $p && PATH=$PATH$p_$p ;;
88 : shall we be using ksh?
94 if (PATH=.; alias -x) >/dev/null 2>&1; then
97 if test -f /hp-ux -a -f /bin/ksh; then
98 needksh='to avoid sh bug in "here document" expansion'
100 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
101 if test X`/usr/bin/uname -v` = X4; then
102 avoidksh="to avoid AIX 4's /bin/sh"
106 case "$inksh/$needksh" in
113 case "$inksh/$avoidksh" in
119 case "$inksh/$needksh-$avoidksh-" in
122 (I see you are using the Korn shell. Some ksh's blow up on $me,
123 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
129 echo "(Feeding myself to $newsh $reason.)"
131 Configure|*/Configure) exec $newsh $0 "$@";;
132 *) exec $newsh Configure "$@";;
137 : Configure runs within the UU subdirectory
138 test -d UU || mkdir UU
293 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
296 : We must find out about Eunice early
298 if test -f /etc/unixtovms; then
299 eunicefix=/etc/unixtovms
301 if test -f /etc/unixtovms.exe; then
302 eunicefix=/etc/unixtovms.exe
305 : No trailing extension on UNIX executables
307 : Extra object files, if any, needed on this platform.
312 usrinc='/usr/include'
314 : Find the basic shell for Bourne shell scripts
318 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
321 if test -f "$xxx"; then
324 : Build up a list and do a single loop so we can 'break' out.
325 pth=`echo $PATH | sed -e "s/$p_/ /g"`
326 for xxx in sh bash ksh pdksh ash; do
328 try="$try ${p}/${xxx}"
332 if test -f "$xxx"; then
335 elif test -f "$xxx.exe"; then
346 $me: Fatal Error: I can't find a Bourne Shell anywhere.
348 Usually it's in /bin/sh. How did you even get this far?
349 Please contact me (Raphael Manfredi) at Raphael_Manfredi@grenoble.hp.com and
350 we'll try to straighten this all out.
356 : see if sh knows # comments
357 if `$sh -c '#' >/dev/null 2>&1`; then
361 test -f $xcat || xcat=/usr/bin/cat
366 if test -s today; then
369 echo "#! $xcat" > try
373 if test -s today; then
381 echo "Your $sh doesn't grok # comments--I will strip them later on."
384 echo "exec grep -v '^[ ]*#'" >spitshell
387 spitshell=`pwd`/spitshell
389 echo "I presume that if # doesn't work, #! won't work either!"
394 : figure out how to guarantee sh startup
396 '') startsh=${sharpbang}${sh} ;;
408 : echo "Yup, it does."
410 echo "Hmm... '$startsh' does not guarantee sh startup..."
411 echo "You may have to fix up the shell scripts to make sure $sh runs them."
415 : produce awk script to parse command line options
416 cat >options.awk <<'EOF'
418 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
420 len = length(optstr);
421 for (i = 1; i <= len; i++) {
422 c = substr(optstr, i, 1);
423 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
434 if (substr(str, 1, 1) != "-") {
435 printf("'%s'\n", str);
439 for (i = 2; i <= len; i++) {
440 c = substr(str, i, 1);
442 printf("-%s\n", substr(str, i));
448 printf("'%s'\n", substr(str, i + 1));
461 : process the command line options
462 set X `for arg in "$@"; do echo "X$arg"; done |
463 sed -e s/X// | awk -f options.awk`
468 : set up default values
485 while test $# -gt 0; do
487 -d) shift; fastread=yes;;
488 -e) shift; alldone=cont;;
492 if test -r "$1"; then
495 echo "$me: cannot read config file $1." >&2
500 -h) shift; error=true;;
501 -r) shift; reuseval=true;;
502 -s) shift; silent=true; realsilent=true;;
503 -E) shift; alldone=exit;;
504 -K) shift; knowitall=true;;
505 -O) shift; override=true;;
506 -S) shift; silent=true; extractsh=true;;
511 echo "$me: use '-U symbol=', not '-D symbol='." >&2
512 echo "$me: ignoring -D $1" >&2
515 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
516 *) echo "$1='define'" >> optdef.sh;;
523 *=) echo "$1" >> optdef.sh;;
525 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
526 echo "$me: ignoring -U $1" >&2
528 *) echo "$1='undef'" >> optdef.sh;;
532 -V) echo "$me generated by metaconfig 3.0 PL60." >&2
535 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
543 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
544 [-U symbol] [-U symbol=]
545 -d : use defaults for all answers.
546 -e : go on without questioning past the production of config.sh.
547 -f : specify an alternate default configuration file.
548 -h : print this help message and exit (with an error status).
549 -r : reuse C symbols value if possible (skips costly nm extraction).
550 -s : silent mode, only echoes questions and essential information.
551 -D : define symbol to have some value:
552 -D symbol symbol gets the value 'define'
553 -D symbol=value symbol gets the value 'value'
554 -E : stop at the end of questions, after having produced config.sh.
555 -K : do not use unless you know what you are doing.
556 -O : let -D and -U override definitions from loaded configuration file.
557 -S : perform variable substitutions on all .SH files (can mix with -f)
558 -U : undefine symbol:
559 -U symbol symbol gets the value 'undef'
560 -U symbol= symbol gets completely empty
561 -V : print version number and exit (with a zero status).
568 case "$fastread$alldone" in
572 echo "Say 'sh Configure', not 'sh <Configure'"
580 true) exec 1>/dev/null;;
583 : run the defines and the undefines, if any, but leave the file out there...
589 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
590 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
591 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
592 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
593 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
596 : Some greps do not return status, grrr.
597 echo "grimblepritz" >grimble
598 if grep blurfldyick grimble >/dev/null 2>&1 ; then
600 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
606 : the following should work in any shell
610 echo "AGH! Grep doesn't return a status. Attempting remedial action."
611 cat >contains <<'EOSS'
612 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
617 : first determine how to suppress newline on echo command
619 echo "Checking echo to see how to suppress newlines..."
620 (echo "hi there\c" ; echo " ") >.echotmp
621 if $contains c .echotmp >/dev/null 2>&1 ; then
632 echo $n "The star should be here-->$c"
636 : compute the number of columns on the terminal for proper question formatting
641 : set up the echo used in my read
642 myecho="case \"\$xxxm\" in
643 '') echo $n \"\$rp $c\" >&4;;
645 '') echo $n \"[\$xxxm] $c\";;
647 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
649 echo $n \"[\$xxxm] $c\" >&4
651 echo $n \"\$rp [\$xxxm] $c\" >&4
657 : now set up to do reads with possible shell escape and default assignment
664 yes) case "\$dflt" in
667 case "\$silent-\$rp" in
672 *) case "\$silent" in
678 while expr "X\$ans" : "X!" >/dev/null; do
682 aok=''; eval "ans=\\"\$answ\\"" && aok=y
690 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
699 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
704 echo "(OK, I'll run with -d after this question.)" >&4
707 echo "*** Sorry, \$1 not supported yet." >&4
717 echo "*** Substitution done -- please confirm."
719 ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
724 echo "*** Error -- try again."
731 case "\$ans\$xxxm\$nostick" in
743 : Find the path to the source tree
745 '') src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
755 if test -f $rsrc/Configure && \
756 $contains "^package=$package" $rsrc/Configure >/dev/null 2>&1
758 : found it, so we are ok.
761 for src in . .. ../.. ../../.. ../../../..; do
762 if test -f ../$src/Configure && \
763 $contains "^package=$package" ../$src/Configure >/dev/null 2>&1
774 rp="Directory where sources for $package are located?"
778 if test -f $rsrc/Configure && \
779 $contains "^package=$package" $rsrc/Configure >/dev/null 2>&1
781 echo "Ok, I've found them under $src"
783 echo "Sorry, I can't seem to be able to locate $package sources." >&4
790 echo "Sources for $package found in $src" >&4
794 : script used to extract .SH files with variable substitutions
797 echo "Doing variable substitutions on .SH files..."
798 if test -f $src/MANIFEST; then
799 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH'`
801 echo "(Looking for .SH files under the source directory.)"
802 set x `(cd $src; find . -name "*.SH" -print)`
806 0) set x `(cd $src; echo *.SH)`; shift;;
808 if test ! -f $src/$1; then
815 if test ! -d "$name"; then
816 create="$name $create";
817 name=`echo $name | sed -e "s|^[^/]*$||"`;
818 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
823 for file in $create; do
832 dir=`expr X$file : 'X\(.*\)/'`
833 file=`expr X$file : 'X.*/\(.*\)'`
834 (cd $dir && . ./$file)
844 dir=`expr X$file : 'X\(.*\)/'`
845 file=`expr X$file : 'X.*/\(.*\)'`
846 (set x $dir; shift; eval $mkdir_p)
856 if test -f $src/config_h.SH; then
857 if test ! -f config.h; then
858 : oops, they left it out of MANIFEST, probably, so do it anyway.
864 : extract files and exit if asked to do so
867 case "$realsilent" in
872 '') config_sh='config.sh'; config="$rsrc/config.sh";;
873 /*) config="$config_sh";;
874 *) config="$rsrc/$config_sh";;
877 echo "Fetching answers from $config_sh..."
879 test "$override" && . ./optdef.sh
889 : Eunice requires " " instead of "", can you believe it
892 echo "Beginning of configuration questions for $package."
894 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
896 : Now test for existence of everything in MANIFEST
898 if test -f $rsrc/MANIFEST; then
899 echo "First let's make sure your kit is complete. Checking..." >&4
900 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
903 for filelist in x??; do
904 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
906 if test -s missing; then
910 THIS PACKAGE SEEMS TO BE INCOMPLETE.
912 You have the option of continuing the configuration process, despite the
913 distinct possibility that your kit is damaged, by typing 'y'es. If you
914 do, don't blame me if something goes wrong. I advise you to type 'n'o
915 and contact the author (Raphael_Manfredi@grenoble.hp.com).
918 echo $n "Continue? [n] $c" >&4
922 echo "Continuing..." >&4
926 echo "ABORTING..." >&4
934 echo "There is no MANIFEST file. I hope your kit is complete !"
938 : create .config dir to save info across Configure sessions
939 test -d ../.config || mkdir ../.config
940 cat >../.config/README <<EOF
941 This directory created by Configure to save information that should
942 persist across sessions for $package.
944 You may safely delete it if you wish.
947 : general instructions
950 user=`(logname) 2>/dev/null`
952 '') user=`whoami 2>&1`;;
954 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
957 rp='Would you like to see the instructions?'
968 This installation shell script will examine your system and ask you questions
969 to determine how the dist package should be installed. If you get
970 stuck on a question, you may use a ! shell escape to start a subshell or
971 execute a command. Many of the questions will have default answers in square
972 brackets; typing carriage return will give you the default.
974 On some of the questions which ask for file or directory names you are allowed
975 to use the ~name construct to specify the login directory belonging to "name",
976 even if you don't have a shell which knows about that. Questions where this is
977 allowed will be marked "(~name ok)".
981 dflt='Type carriage return to continue'
985 The prompter used in this script allows you to use shell variables and
986 backticks in your answers. You may use $1, $2, etc... to refer to the words
987 in the default answer, as if the default line was a set of arguments given to a
988 script shell. This means you may also use $* to repeat the whole default line,
989 so you do not have to re-type everything to add something to the default.
991 Everytime there is a substitution, you will have to confirm. If there is an
992 error (e.g. an unmatched backtick), the default answer will remain unchanged
993 and you will be prompted again.
995 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
996 the questions and use the computed defaults (or the previous answers if there
997 was already a config.sh file). Type 'Configure -h' for a list of options.
998 You may also start interactively and then answer '& -d' at any prompt to turn
999 on the non-interactive behaviour for the remaining of the execution.
1005 Much effort has been expended to ensure that this shell script will run on any
1006 Unix system. If despite that it blows up on yours, your best bet is to edit
1007 Configure and run it again. If you can't run Configure for some reason,
1008 you'll have to generate a config.sh file by hand. Whatever problems you
1009 have, let me (Raphael_Manfredi@grenoble.hp.com) know how I blew it.
1011 This installation script affects things in two ways:
1013 1) it may do direct variable substitutions on some of the files included
1015 2) it builds a config.h file for inclusion in C programs. You may edit
1016 any of these files as the need arises after running this script.
1018 If you make a mistake on a question, there is no easy way to back up to it
1019 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1020 files. Configure will offer to let you do this before it runs the SH files.
1023 dflt='Type carriage return to continue'
1025 case "$firsttime" in
1026 true) echo $user >>../.config/instruct;;
1030 : find out where common programs are
1032 echo "Locating common programs..." >&4
1045 if test -d \$dir/\$thing; then
1051 for thisthing in \$dir/\$thing; do
1052 : just loop through to pick last item
1054 if test -f \$thisthing; then
1057 elif test -f \$dir/\$thing.exe; then
1058 : on Eunice apparently
1109 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1110 pth="$pth /lib /usr/lib"
1111 for file in $loclist; do
1115 if test -f "$xxx"; then
1118 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1119 xxx=`./loc $file $file $pth`
1122 '') xxx=`./loc $file $file $pth`;;
1123 *) xxx=`./loc $xxx $xxx $pth`;;
1129 echo $file is in $xxx.
1132 echo $file is in $xxx.
1135 echo "I don't know where '$file' is, and my life depends on it." >&4
1136 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1142 echo "Don't worry if any of the following aren't found..."
1144 for file in $trylist; do
1148 if test -f "$xxx"; then
1151 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1152 xxx=`./loc $file $file $pth`
1155 '') xxx=`./loc $file $file $pth`;;
1156 *) xxx=`./loc $xxx $xxx $pth`;;
1162 echo $file is in $xxx.
1165 echo $file is in $xxx.
1168 echo "I don't see $file out there, $say."
1175 echo "Substituting grep for egrep."
1181 echo "Substituting cp for ln."
1187 echo "Hopefully test is built into your sh."
1190 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1191 echo "Using the test built into your sh."
1199 echo "Hopefully echo is built into your sh."
1204 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1205 $echo $n "hi there$c" >foo1
1206 echo $n "hi there$c" >foo2
1207 if cmp foo1 foo2 >/dev/null 2>&1; then
1208 echo "They are compatible. In fact, they may be identical."
1215 They are not compatible! You are probably running ksh on a non-USG system.
1216 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1217 have echo built in and we may have to run some Bourne shell scripts. That
1218 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1221 $echo $n "The star should be here-->$c"
1228 : determine whether symbolic links are supported
1231 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1232 echo "Symbolic links are supported." >&4
1235 echo "Symbolic links are NOT supported." >&4
1240 : see whether [:lower:] and [:upper:] are supported character classes
1244 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1246 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1251 echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4
1254 : set up the translation script tr, must be called with ./tr of course
1258 '[A-Z][a-z]') exec $tr '$up' '$low';;
1259 '[a-z][A-Z]') exec $tr '$low' '$up';;
1266 : Try to determine whether config.sh was made on this system
1267 case "$config_sh" in
1269 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1270 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1271 ./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
1272 newmyuname="$myuname"
1274 case "$knowitall" in
1276 if test -f ../config.sh; then
1277 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1278 eval "`grep myuname= ../config.sh`"
1280 if test "X$myuname" = "X$newmyuname"; then
1288 : Get old answers, if there is a config file out there
1291 if test -f ../config.sh; then
1293 rp="I see a config.sh file. Shall I use it to set the defaults?"
1296 n*|N*) echo "OK, I'll ignore it.";;
1297 *) echo "Fetching default answers from your old config.sh file..." >&4
1311 echo "Fetching default answers from $config_sh..." >&4
1315 cp $config_sh config.sh 2>/dev/null
1325 test "$override" && . ./optdef.sh
1326 myuname="$newmyuname"
1328 : Restore computed paths
1329 for file in $loclist $trylist; do
1330 eval $file="\$_$file"
1333 : who configured the system
1334 cf_time=`$date 2>&1`
1335 cf_by=`(logname) 2>/dev/null`
1338 cf_by=`(whoami) 2>/dev/null`
1340 "") cf_by=unknown ;;
1347 $define|true) afs=true ;;
1348 $undef|false) afs=false ;;
1349 *) if test -d /afs; then
1357 echo "AFS may be running... I'll be extra cautious then..." >&4
1359 echo "AFS does not seem to be running..." >&4
1362 : determine where manual pages are on this system
1366 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
1367 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
1368 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
1369 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
1370 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
1371 sysman=`./loc . /usr/man/man1 $syspath`
1374 if $test -d "$sysman"; then
1375 echo "System manual is in $sysman." >&4
1377 echo "Could not find manual pages in source form." >&4
1380 : decide how portable to be
1381 case "$d_portable" in
1387 I can set things up so that your shell scripts and binaries are more portable,
1388 at what may be a noticable cost in performance. In particular, if you
1389 ask to be portable, the following happens:
1391 1) Shell scripts will rely on the PATH variable rather than using
1392 the paths derived above.
1393 2) ~username interpretations will be done at run time rather than
1397 rp="Do you expect to run these scripts and binaries on multiple machines?"
1400 y*) d_portable="$define"
1402 *) d_portable="$undef" ;;
1405 : set up shell script to do ~ expansion
1411 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
1414 if $test -f /bin/csh; then
1415 /bin/csh -f -c "glob \$1"
1420 name=\`$expr x\$1 : '..\([^/]*\)'\`
1421 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
1422 if $test ! -d "\$dir"; then
1424 echo "\$me: can't locate home directory for: \$name" >&2
1429 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
1445 : now set up to get a file name
1449 cat <<'EOSC' >>getfile
1462 expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
1463 fn=`echo $fn | sed 's/(.*)//'`
1469 loc_file=`expr $fn : '.*:\(.*\)'`
1470 fn=`expr $fn : '\(.*\):.*'`
1478 */*) fullpath=true;;
1487 *e*) exp_file=true;;
1490 *p*) nopath_ok=true;;
1495 *d*) type='Directory';;
1496 *l*) type='Locate';;
1501 Locate) what='File';;
1506 case "$d_portable" in
1514 while test "$type"; do
1519 true) rp="$rp (~name ok)";;
1522 if test -f UU/getfile.ok && \
1523 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
1542 value=`UU/filexp $ans`
1545 if test "$ans" != "$value"; then
1546 echo "(That expands to $value on this system.)"
1560 /*) value="$ansexp" ;;
1565 echo "I shall only accept a full path name, as in /bin/ls." >&4
1566 echo "Use a ! shell escape if you wish to check pathnames." >&4
1569 echo "Please give a full path name, starting with slash." >&4
1572 echo "Note that using ~name is ok provided it expands well." >&4
1585 if test -f "$ansexp"; then
1587 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
1589 echo "($value is not a plain file, but that's ok.)"
1594 if test -d "$ansexp"; then
1599 if test -d "$ansexp"; then
1600 echo "(Looking for $loc_file in directory $value.)"
1601 value="$value/$loc_file"
1602 ansexp="$ansexp/$loc_file"
1604 if test -f "$ansexp"; then
1607 case "$nopath_ok" in
1608 true) case "$value" in
1610 *) echo "Assuming $value will be in people's path."
1626 if test "$fastread" = yes; then
1631 rp="$what $value doesn't exist. Use that name anyway?"
1652 : determine root of directory hierarchy where package will be installed.
1655 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
1663 By default, $package will be installed in $dflt/bin, manual
1664 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
1665 all installation directories. Typically set to /usr/local, but you
1666 may choose /usr if you wish to install $package among your system
1667 binaries. If you wish to have binaries under /bin but manual pages
1668 under /usr/local/man, that's ok: you will be prompted separately
1669 for each of the installation directories, the prefix being only used
1670 to set the defaults.
1674 rp='Installation prefix to use?'
1682 *) oldprefix="$prefix";;
1689 : set the prefixit variable, to compute a suitable default value
1690 prefixit='case "$3" in
1692 case "$oldprefix" in
1693 "") eval "$1=\"\$$2\"";;
1700 ""|" ") eval "$1=\"\$$2\"";;
1706 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
1708 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
1709 /*-$oldprefix/*|\~*-$oldprefix/*)
1710 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
1711 *) eval "$1=\"\$$2\"";;
1715 : set the prefixup variable, to restore leading tilda escape
1716 prefixup='case "$prefixexp" in
1718 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
1721 : determine where manual pages go
1722 set mansrc mansrc none
1726 $spackage has manual pages available in source form.
1730 echo "However, you don't have nroff, so they're probably useless to you."
1735 echo "If you don't want the manual sources installed, answer 'none'."
1738 lookpath="$prefixexp/man/man1 $prefixexp/man/u_man/man1"
1739 lookpath="$lookpath $prefixexp/man/l_man/man1"
1740 lookpath="$lookpath /usr/local/man/man1 /opt/man/man1 /usr/man/manl"
1741 lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1"
1742 lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
1743 lookpath="$lookpath /usr/man/man.L"
1744 mansrc=`./loc . $prefixexp/man/man1 $lookpath`
1745 if $test -d "$mansrc"; then
1759 rp='Where do the manual pages (source) go?'
1761 if test "X$mansrcexp" != "X$ansexp"; then
1770 if $afs && $test "$mansrc"; then
1773 Since you are running AFS, I need to distinguish the directory in which
1774 manual pages reside from the directory in which they are installed (and from
1775 which they are presumably copied to the former directory by occult means).
1778 case "$installmansrc" in
1779 '') dflt=`echo $mansrcexp | sed 's#^/afs/#/afs/.#'`;;
1780 *) dflt="$installmansrc";;
1783 rp='Where will man pages be installed?'
1785 installmansrc="$ans"
1787 installmansrc="$mansrcexp"
1802 : determine where private executables go
1803 set dflt privlib lib/$package
1807 There are some auxiliary files for $package that need to be put into a
1808 private library directory that is accessible by everyone.
1812 rp='Pathname where the private library files will reside?'
1814 if $test "X$privlibexp" != "X$ansexp"; then
1818 privlibexp="$ansexp"
1822 Since you are running AFS, I need to distinguish the directory in which
1823 private files reside from the directory in which they are installed (and from
1824 which they are presumably copied to the former directory by occult means).
1827 case "$installprivlib" in
1828 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
1829 *) dflt="$installprivlib";;
1832 rp='Where will private files be installed?'
1834 installprivlib="$ans"
1836 installprivlib="$privlibexp"
1839 : determine where public executable scripts go
1840 set scriptdir scriptdir
1842 case "$scriptdir" in
1845 : guess some guesses
1846 $test -d /usr/share/scripts && dflt=/usr/share/scripts
1847 $test -d /usr/share/bin && dflt=/usr/share/bin
1848 $test -d /usr/local/script && dflt=/usr/local/script
1849 $test -d $prefixexp/script && dflt=$prefixexp/script
1853 *) dflt="$scriptdir"
1858 Some installations have a separate directory just for executable scripts so
1859 that they can mount it across multiple architectures but keep the scripts in
1860 one spot. You might, for example, have a subdirectory of /usr/share for this.
1861 Or you might just lump your scripts in with all your other executables.
1865 rp='Where do you keep publicly executable scripts?'
1867 if $test "X$ansexp" != "X$scriptdirexp"; then
1871 scriptdirexp="$ansexp"
1875 Since you are running AFS, I need to distinguish the directory in which
1876 scripts reside from the directory in which they are installed (and from
1877 which they are presumably copied to the former directory by occult means).
1880 case "$installscript" in
1881 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
1882 *) dflt="$installscript";;
1885 rp='Where will public scripts be installed?'
1887 installscript="$ans"
1889 installscript="$scriptdirexp"
1892 : preserve RCS keywords in files with variable substitution, grrr
1898 : set the base revision
1901 : make some quick guesses about what we are up against
1903 $echo $n "Hmm... $c"
1913 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
1914 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
1916 echo "Looks kind of like an OSF/1 system, but we'll see..."
1918 elif test `echo abc | tr a-z A-Z` = Abc ; then
1919 xxx=`./loc addbib blurfl $pth`
1920 if $test -f $xxx; then
1921 echo "Looks kind of like a USG system with BSD features, but we'll see..."
1925 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
1926 echo "Looks kind of like an extended USG system, but we'll see..."
1928 echo "Looks kind of like a USG system, but we'll see..."
1932 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
1933 echo "Looks kind of like a BSD system, but we'll see..."
1937 echo "Looks kind of like a Version 7 system, but we'll see..."
1940 case "$eunicefix" in
1943 There is, however, a strange, musty smell in the air that reminds me of
1944 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
1948 : it so happens the Eunice I know will not run shell scripts in Unix format
1952 echo "Congratulations. You aren't running Eunice."
1960 I have the feeling something is not exactly right, however...don't tell me...
1961 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
1966 if test -f /xenix; then
1967 echo "Actually, this looks more like a XENIX system..."
1972 echo "It's not Xenix..."
1977 if test -f /venix; then
1978 echo "Actually, this looks more like a VENIX system..."
1985 echo "Nor is it Venix..."
1988 chmod +x bsd usg v7 osf1 eunice xenix venix os2
1989 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
1992 : see if we have to deal with yellow pages, now NIS.
1993 if $test -d /usr/etc/yp || $test -d /etc/yp; then
1994 if $test -f /usr/etc/nibindd; then
1996 echo "I'm fairly confident you're on a NeXT."
1998 rp='Do you get the passwd file via NetInfo?'
2007 y*) passcat='nidump passwd .'
2009 *) echo "You told me, so don't blame me."
2016 rp='Do you get the hosts file via NetInfo?'
2025 y*) hostcat='nidump hosts .';;
2026 *) case "$hostcat" in
2027 nidump*) hostcat='';;
2037 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
2045 rp='Are you getting the passwd file via yellow pages?'
2048 y*) passcat='ypcat passwd'
2050 *) passcat='cat /etc/passwd'
2060 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
2068 rp='Are you getting the hosts file via yellow pages?'
2071 y*) hostcat='ypcat hosts';;
2072 *) hostcat='cat /etc/hosts';;
2078 '') hostcat='cat /etc/hosts';;
2081 '') groupcat='cat /etc/group';;
2084 '') passcat='cat /etc/passwd';;
2087 : now get the host name
2089 echo "Figuring out host name..." >&4
2090 case "$myhostname" in
2092 echo 'Maybe "hostname" will work...'
2093 if tans=`sh -c hostname 2>&1` ; then
2101 if $test "$cont"; then
2103 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
2104 if tans=`cat /etc/systemid 2>&1` ; then
2106 phostname='cat /etc/systemid'
2107 echo "Whadyaknow. Xenix always was a bit strange..."
2110 elif $test -r /etc/systemid; then
2111 echo "(What is a non-Xenix system doing with /etc/systemid?)"
2114 if $test "$cont"; then
2115 echo 'No, maybe "uuname -l" will work...'
2116 if tans=`sh -c 'uuname -l' 2>&1` ; then
2118 phostname='uuname -l'
2120 echo 'Strange. Maybe "uname -n" will work...'
2121 if tans=`sh -c 'uname -n' 2>&1` ; then
2123 phostname='uname -n'
2125 echo 'Oh well, maybe I can mine it out of whoami.h...'
2126 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
2127 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
2128 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
2130 case "$myhostname" in
2131 '') echo "Does this machine have an identity crisis or something?"
2134 echo "Well, you said $myhostname before..."
2135 phostname='echo $myhostname';;
2141 : you do not want to know about this
2146 if $test "$myhostname" ; then
2148 rp='Your host name appears to be "'$myhostname'".'" Right?"
2156 : bad guess or no guess
2157 while $test "X$myhostname" = X ; do
2159 rp="Please type the (one word) name of your host:"
2164 : translate upper to lower if necessary
2165 case "$myhostname" in
2167 echo "(Normalizing case in your host name)"
2168 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
2172 case "$myhostname" in
2174 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
2175 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
2176 echo "(Trimming domain name from host name--host name is now $myhostname)"
2178 *) case "$mydomain" in
2181 : If we use NIS, try ypmatch.
2182 : Is there some reason why this was not done before?
2183 test "X$hostcat" = "Xypcat hosts" &&
2184 ypmatch "$myhostname" hosts 2>/dev/null |\
2185 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
2188 : Extract only the relevant hosts, reducing file size,
2189 : remove comments, insert trailing space for later use.
2190 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
2191 /[ ]$myhostname[ . ]/p" > hosts
2194 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
2195 END { print sum }" hosts` = x1 || tmp_re="[ ]"
2196 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
2197 hosts | $sort | $uniq | \
2198 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
2199 case `$echo X$dflt` in
2200 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
2203 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
2208 tans=`./loc resolv.conf X /etc /usr/etc`
2209 if $test -f "$tans"; then
2210 echo "(Attempting domain name extraction from $tans)"
2211 dflt=.`$sed -n -e 's/ / /g' \
2212 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
2213 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
2215 .) dflt=.`$sed -n -e 's/ / /g' \
2216 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
2217 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
2224 .) echo "(No help from resolv.conf either -- attempting clever guess)"
2225 dflt=.`sh -c domainname 2>/dev/null`
2228 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
2233 .) echo "(Lost all hope -- silly guess then)"
2239 *) dflt="$mydomain";;
2243 rp="What is your domain name?"
2253 : translate upper to lower if necessary
2256 echo "(Normalizing case in your domain name)"
2257 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
2261 : a little sanity check here
2262 case "$phostname" in
2265 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
2266 $myhostname$mydomain|$myhostname) ;;
2268 case "$phostname" in
2270 echo "(That doesn't agree with your whoami.h file, by the way.)"
2273 echo "(That doesn't agree with your $phostname command, by the way.)"
2283 I need to get your e-mail address in Internet format if possible, i.e.
2284 something like user@host.domain. Please answer accurately since I have
2285 no easy means to double check it. The default value provided below
2286 is most probably close to the reality but may not be valid from outside
2287 your organization...
2291 while test "$cont"; do
2293 '') dflt="$cf_by@$myhostname$mydomain";;
2294 *) dflt="$cf_email";;
2296 rp='What is your e-mail address?'
2302 rp='Address does not look like an Internet one. Use it anyway?'
2316 : determine default editor
2318 case "$defeditor" in
2322 *) dflt=/usr/ucb/vi;;
2325 *) dflt="$defeditor"
2329 rp="What is the default editor on your system?"
2333 : locate a BSD compatible install program
2335 echo "Looking for a BSD-compatible install program..." >&4
2341 for file in ginstall installbsd scoinst install; do
2342 if $test -f $dir/$file; then
2343 tryit="$tryit $dir/$file"
2354 if $cc try.c -o try >/dev/null 2>&1; then
2356 strip try >/dev/null 2>&1
2358 echo "(I can't seem to compile a trivial C program -- bypassing.)"
2367 \$1 -c -m 764 try.ns d
2368 \$1 -c -s -m 642 try.ns d/try
2374 for prog in $tryit; do
2375 $echo $n "Checking $prog... $c"
2376 ./tryinst $prog >/dev/null 2>&1
2377 if $test -d foo/bar; then
2380 (ls -l d/try >try.ls; ls -l d/try.ns >tryno.ls) 2>/dev/null
2381 if (cmp -s d/try try && cmp -s d/try.ns try.ns && \
2382 $contains 'rwxrw-r--' tryno.ls && \
2383 $contains 'rw-r---w-' try.ls) >/dev/null 2>&1
2386 echo "ok, that will do."
2389 echo "not good$either."
2393 $rm -rf foo d tryinst try try*.ls try.*
2396 echo "Hopefully, $package comes with its own install script!"
2401 *) dflt="$install";;
2405 I will be requiring a BSD-compatible install program (one that allows
2406 options like -s to strip executables or -m to specify a file mode) to
2409 If the question below contains a fully qualified default path, then it
2410 is probably ok. If it is an unqualified name such as 'install', then it
2411 means I was unable to find out a good install program I could use. If
2412 you know of one, please tell me about it. If the default is './install',
2413 then I shall be using the install script supplied with $package.
2416 fn='/fe~(install,./install)'
2417 rp='Which install program shall I use?'
2421 : how can we create nested directories?
2423 echo "Ok, let's see how we can create nested directories..." >&4
2424 case "$installdir" in
2428 $mkdir -p foo/bar >/dev/null 2>&1
2429 if $test -d foo/bar; then
2430 echo "Great, we can build them using 'mkdir -p'."
2432 elif eval "$install -d foo/bar"; $test -d foo/bar; then
2433 creatdir="install -d"
2434 echo "It looks like '$creatdir' will do it for us."
2438 eval "$creatdir foo/bar" >/dev/null 2>&1
2439 if $test -d foo/bar; then
2440 echo "Ah! We can use '$creatdir' to do just that."
2447 echo "Heck! Another ancient system lacking the comfort of modern ones!"
2448 echo "You can thank $package for bringing you its own install script!"
2449 installdir='./install -d'
2451 *) installdir="$creatdir";;
2454 *) echo "As you already told me, '$installdir' should work.";;
2457 : determine the name of a reasonable mailer
2460 if $test -f "$sendmail"; then
2462 elif $test -f "$smail"; then
2464 elif $test -f "$rmail"; then
2466 elif $test -f /bin/mail; then
2476 I need the full pathname of the program used to deliver mail on your system.
2477 A typical answer would be /usr/lib/sendmail or /bin/rmail, but you may choose
2478 any other program, as long as it can be fed from standard input and will
2479 honour any user-supplied headers.
2483 rp='Mail transport agent to be used?'
2487 : see how we invoke the C preprocessor
2489 echo "Now, how can we feed standard input to your C preprocessor..." >&4
2490 cat <<'EOT' >testcpp.c
2496 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
2498 wrapper=`pwd`/cppstdin
2502 if $test "X$cppstdin" != "X" && \
2503 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
2504 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2506 echo "You used to use $cppstdin $cppminus so we'll use that again."
2508 '') echo "But let's see if we can live without a wrapper..." ;;
2510 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
2511 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2513 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
2516 echo "(However, $cpprun $cpplast does not work, let's see...)"
2524 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
2531 elif echo 'Maybe "'"$cc"' -E" will work...'; \
2532 $cc -E <testcpp.c >testcpp.out 2>&1; \
2533 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2534 echo "Yup, it does."
2537 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
2538 $cc -E - <testcpp.c >testcpp.out 2>&1; \
2539 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2540 echo "Yup, it does."
2543 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
2544 $cc -P <testcpp.c >testcpp.out 2>&1; \
2545 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2546 echo "Yipee, that works!"
2549 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
2550 $cc -P - <testcpp.c >testcpp.out 2>&1; \
2551 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2552 echo "At long last!"
2555 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
2556 $cpp <testcpp.c >testcpp.out 2>&1; \
2557 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2561 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
2562 $cpp - <testcpp.c >testcpp.out 2>&1; \
2563 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2564 echo "Hooray, it works! I was beginning to wonder."
2567 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
2568 $wrapper <testcpp.c >testcpp.out 2>&1; \
2569 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2575 rp="No dice. I can't find a C preprocessor. Name one:"
2579 $x_cpp <testcpp.c >testcpp.out 2>&1
2580 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2581 echo "OK, that will do." >&4
2583 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
2598 echo "Perhaps can we force $cc -E using a wrapper..."
2599 if $wrapper <testcpp.c >testcpp.out 2>&1; \
2600 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2606 echo "Nope, we'll have to live without it..."
2621 *) $rm -f $wrapper;;
2623 $rm -f testcpp.c testcpp.out
2625 : Define several unixisms.
2626 : Hints files or command line option can be used to override them.
2634 : find out how to generate dependencies
2636 echo "Checking how to generate makefile dependencies on your machine..." >&4
2638 $cat >dep.c <<'EOCP'
2641 $cat >dep.h <<'EOCP'
2652 *) flags="$flags $arg";;
2660 if test -x "$mkdep" &&
2661 $mkdep dep.c >dep.out 2>/dev/null &&
2662 $contains "dep\$_o:.*dep\.h" dep.out >/dev/null 2>&1
2664 echo "$mkdep works."
2672 $spitshell > ../mkdep <<EOM
2677 $cpp -M -I. $cppflags \$flags \$srcfile 2>/dev/null
2684 if $mkdep dep.c >dep.out 2>/dev/null &&
2685 $contains "dep$_o:.*dep\.h" dep.out >/dev/null 2>&1
2687 echo "Looks like we can use $cpp -M."
2696 $spitshell > ../mkdep <<EOM
2701 $cc -MM -I. $cppflags \$flags \$srcfile 2>/dev/null
2708 if $mkdep dep.c >dep.out 2>/dev/null &&
2709 $contains "dep$_o: dep.h" dep.out >/dev/null 2>&1
2711 echo "Looks like we can use $cc -MM."
2720 $spitshell >../mkdep <<EOS
2730 filebase=\`basename \$srcfile \$c\`
2731 <\$srcfile $cpp $cppminus $cppflags -I. \$flags 2>/dev/null | \\
2732 $sed -e '/^# *[0-9]/!d' \\
2733 -e 's/^.*"\(.*\)".*\$/'\$filebase'$_o: \1/' \\
2735 -e 's|: *$|: '\$srcfile'|' | \\
2736 $grep -v '^#' | $sort | $uniq
2743 if $mkdep dep.c >dep.out 2>/dev/null &&
2744 $contains "dep$_o:.*dep\.h" dep.out >/dev/null 2>&1
2746 echo "A shell script using $cpp does the trick."
2748 echo "$cpp doesn't seem to be any use at all."
2749 $spitshell >../mkdep <<EOS
2756 while test \$# -gt 0
2764 dir=\`echo \$1 | sed -e 's/^-I//'\`
2772 trap "$rm -f /tmp/mkdep\$\$; exit 1" 1 2 3 15
2780 filebase=\`basename \$srcfile \$c\`
2781 echo \$filebase$_o: \$srcfile
2782 $grep '^#[ ]*include' \$srcfile /dev/null | \
2783 $sed -n -e 's/#[ ]*include[ ]*//' \\
2784 -e '/<\(.*\)>/ d' \\
2785 -e 's/:[^"]*"\([^"]*\)".*/: \1/' \\
2786 -e "s/\\.c:/$_o:/p" > /tmp/mkdep\$\$
2788 while read file dep; do
2789 for dir in \$inc; do
2790 if $test -f "\$dir/\$dep"; then
2795 echo "\$file: \$dep" | $sed -e 's,: \./,: ,'
2796 done </tmp/mkdep\$\$
2798 $rm -f /tmp/mkdep\$\$
2805 if $mkdep dep.c >dep.out 2>/dev/null &&
2806 $contains "dep$_o:.*dep\.h" dep.out >/dev/null 2>&1
2810 I can use a script with grep instead, but it will make some incorrect
2811 dependencies, since it doesn't understand about conditional compilation.
2812 Moreover, some dependencies may be missing, because scanning won't be
2813 a recursive process.
2814 If you have a program which generates makefile dependencies, you may want
2815 to use it. If not, you can use the script and edit the Makefile by hand
2822 I can't seem to generate makefile dependencies at all! Perhaps you have a
2823 program that does? If you don't, you might look at the mkdep script to
2824 see if you can create one which works.
2831 rp="Name of program to make makefile dependencies?"
2834 $rm -f dep.c dep.h dep$_o dep.out
2836 : find out how to find out full name
2837 case "$d_berknames" in
2854 Does your /etc/passwd file keep full names in Berkeley/V7 format (name first
2855 thing after ':' in GCOS field)? In that case, a typical entry in the password
2856 file looks like this:
2858 guest:**paswword**:10:100:Mister Guest User:/usr/users:/bin/sh
2861 rp="Berkeley/V7 format for full name in /etc/passwd?"
2864 y*) d_passnames="$define"
2865 d_berknames="$define"
2870 case "$d_usgnames" in
2883 Does your passwd file keep full names in USG format (name sandwiched between a
2884 '-' and a '(')? In that case, a typical entry in the password file looks like
2887 guest:**paswword**:10:100:000-Mister Guest User(000):/usr/users:/bin/sh
2890 rp="USG format for full name in /etc/passwd?"
2893 n*) echo "Full name will be taken from ~/.fullname"
2894 d_passnames="$undef"
2895 d_berknames="$undef"
2900 d_passnames="$define"
2901 d_berknames="$undef"
2902 d_usgnames="$define"
2908 : get organization name
2909 longshots='/local/src /usr/src/new /usr/src/local /usr/local/src'
2911 '') if xxx=`./loc news/src/defs.h x $longshots`; then
2912 dflt=`$sed -n 's/^.*MYORG[ ]*"\(.*\)".*$/\1/p' $xxx`
2917 *) dflt="$orgname";;
2921 Please type the name of your organization as you want it to appear on the
2922 Organization line of outgoing articles. (It's nice if this also specifies
2923 your location. Your city name is probably sufficient if well known.)
2926 University of Southern North Dakota, Hoople
2928 You may also put the name of a file, as long as it begins with a slash.
2935 while test "X$orgname" = "X"; do
2941 : locate the preferred pager for this system
2955 '') dflt=/usr/ucb/more;;
2962 rp='What pager is used on your system?'
2966 : get the patchlevel
2968 echo "Getting the current patchlevel..." >&4
2969 if $test -r $rsrc/patchlevel.h;then
2970 patchlevel=`awk '/PATCHLEVEL/ {print $3}' < $rsrc/patchlevel.h`
2974 echo "(You have $package $baserev PL$patchlevel.)"
2976 : determine perl absolute location
2979 if test -f /usr/bin/perl; then
2984 *) dflt=/usr/bin/perl;;
2993 rp="Where is perl located on your system?"
2997 : figure out how to guarantee perl startup
2998 case "$sharpbang" in
3005 if ./xtry >/dev/null 2>&1; then
3008 I can use the #! construct to start perl on your system. This will make
3009 startup of perl scripts faster, but may cause problems if you want to share
3010 those scripts and perl is not in a standard place (/usr/bin/perl) on all your
3011 platforms. The alternative is to force a shell by starting the script with a
3012 single ':' character.
3019 I could use the #! construct to start perl on your system, but using
3021 would be too long for your kernel to grok. Indeed, most systems do
3022 limit the size of the leading #! string to 32 characters.
3028 case "$startperl" in
3030 '') case "$d_portable" in
3035 rp='Shall I use #! to start up perl?'
3038 y*|Y*) startperl="#!$perlpath";;
3039 *) startperl=": # use perl";;
3041 *) startperl=": # use perl";;
3044 : notify author that his package is used
3045 if $test -f ../.config/mailauthor &&
3046 cmp $rsrc/patchlevel.h ../.config/mailauthor >/dev/null 2>&1
3048 status="say that you're using $package";
3049 case "$mailpatches" in
3050 true) status='have patches mailed to you as they are issued';;
3052 case "$notifypatches" in
3053 true) status='be notified when new patches are issued';;
3057 You have already sent the author of $package (Raphael_Manfredi@grenoble.hp.com) mail to
3058 $status. If you wish, you may modify
3059 your previous request by sending a new mail with different options.
3062 rp='Should I send a status update to Raphael_Manfredi@grenoble.hp.com?'
3067 If you are able to send mail to the Internet, the author of $package would
3068 really appreciate you letting me send off a quick note, just to say that you've
3069 tried it. The author is more likely to spend time maintaining $package if it's
3070 known that many people are using it, and you can even ask to get sent new
3071 patches automagically this way if you wish. To protect your privacy, all I'll
3072 say in the mail is the version of $package that you're using.
3075 rp='Should I send mail to Raphael_Manfredi@grenoble.hp.com?'
3077 $test -f ../.config/nomail && dflt=n
3083 echo "Great! Your cooperation is really appreciated."
3086 Some braindead sites do not set a proper return address in the From: header of
3087 their outgoing mail, making it impossible to reply to mail they generate.
3088 If your site is broken in this way, write to your system administrator and get
3089 it fixed!!! In the mean time, you can manually specify the Internet e-mail
3090 address by which the author can get back to you, should there be a need to do
3091 so. If manually specified, it should be something like "user@domain.top".
3092 If your mail system generates addresses correctly, specify "none".
3097 *) dflt="$usermail";;
3099 rp='Manually specify a return address to use:'
3104 none) usermail='-';;
3105 *) usermail="$ans";;
3109 echo "(Address does not look like an Internet one -- ignoring it.)"
3117 rp='Would you like to have new patches automatically mailed to you?'
3118 case "$mailpatches" in
3124 [yY]*) opt=' mailpatches'; mailpatches=true;;
3128 rp='Ok, would you like to simply be notified of new patches?'
3129 case "$notifypatches" in
3136 [yY]*) opt=' notifypatches'; notifypatches=true;;
3138 echo "Fine, I'll simply say that you've tried it then."
3144 echo "Sending mail to Raphael_Manfredi@grenoble.hp.com..." >&4
3146 $mailer Raphael_Manfredi@grenoble.hp.com <<EOM >/dev/null 2>&1
3149 To: Raphael_Manfredi@grenoble.hp.com
3151 $atsh package $usermail $package $baserev $patchlevel$opt
3153 $rm -f ../.config/mailauthor ../.config/nomail
3154 cp $rsrc/patchlevel.h ../.config/mailauthor
3159 echo "Oh well, maybe next time."
3160 cp /dev/null ../.config/nomail
3166 : figure out their full name
3168 '') case "$nametype" in
3170 fn=`./filexp ~/.fullname`
3172 $test -f $fn && xxx=other
3181 cf_name=`$passcat | grep "^$cf_by:" | \
3182 sed -e 's/^[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\):.*/\1/' \
3186 cf_name=`$passcat | grep "^$cf_by:" | \
3187 sed -e 's/^[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\):.*/\1/' \
3188 -e 's/[^-]*-\(.*\)(.*)/\1/'`
3200 echo "Pleased to meet you, $cf_name."
3202 : offer to join the mailing list
3203 list_request='majordomo@foretune.co.jp'
3204 list_sub="subscribe dist-users $cf_email"
3205 list_unsub="unsubscribe dist-users $cf_email"
3206 list_name="dist-users"
3209 There is a mailing list for discussion about $package and related issues.
3210 This is the preferred place to ask questions about the program and discuss
3211 modifications and additions with the author and other users. If you are able
3212 to send mail to the Internet, you are encouraged to subscribe. You need only
3213 ever subscribe once, and you can unsubscribe automatically at any time in the
3214 future. If you have already subscribed and you wish to unsubscribe now, you
3215 may do so by answering "unsubscribe". Answer "subscribe" to subscribe to the
3219 rp="Subscribe to or unsubscribe from the $list_name mailing list?"
3225 You will be sent a message from the list server to let you know when your
3226 subscription has been successful and telling you how to submit articles and
3227 how to unsubscribe again when necessary. You may also unsubscribe by running
3228 this script again and asking it to do so for you.
3231 echo "Sending mail to subscribe you to the $list_name list..." >&4
3232 $mailer $list_request <<EOM >/dev/null 2>&1
3239 [uU]*) echo "Sending mail to unsubscribe you from the $list_name list..." >&4
3240 $mailer $list_request <<EOM >/dev/null 2>&1
3249 : end of configuration questions
3251 echo "End of configuration questions."
3254 : back to where it started
3255 if test -d ../UU; then
3259 : configuration may be patched via a 'config.over' file
3260 if $test -f config.over; then
3263 rp='I see a config.over file. Do you wish to load it?'
3266 n*) echo "OK, I'll ignore it.";;
3268 echo "Configuration override changes have been loaded."
3273 : in case they want portability, strip down executable paths
3274 case "$d_portable" in
3277 echo "Stripping down executable paths..." >&4
3278 for file in $loclist $trylist; do
3284 : create config.sh file
3286 echo "Creating config.sh..." >&4
3287 $spitshell <<EOT >config.sh
3290 # This file was produced by running the Configure script. It holds all the
3291 # definitions figured out by Configure. Should you modify one of these values,
3292 # do not forget to propagate your changes by running "Configure -der". You may
3293 # instead choose to run each of the .SH files by yourself, or "Configure -S".
3296 # Package name : $package
3297 # Source directory : $src
3298 # Configuration time: $cf_time
3299 # Configured by : $cf_by
3300 # Target system : $myuname
3310 Revision='$Revision'
3315 archobjs='$archobjs'
3324 cf_email='$cf_email'
3330 compress='$compress'
3331 contains='$contains'
3336 cppminus='$cppminus'
3338 cppstdin='$cppstdin'
3340 d_berknames='$d_berknames'
3342 d_eunice='$d_eunice'
3343 d_passnames='$d_passnames'
3344 d_portable='$d_portable'
3345 d_usgnames='$d_usgnames'
3348 defeditor='$defeditor'
3352 eunicefix='$eunicefix'
3355 firstmakefile='$firstmakefile'
3359 groupcat='$groupcat'
3365 installdir='$installdir'
3366 installmansrc='$installmansrc'
3367 installprivlib='$installprivlib'
3368 installscript='$installscript'
3380 mailpatches='$mailpatches'
3383 make_set_make='$make_set_make'
3386 mansrcexp='$mansrcexp'
3391 mydomain='$mydomain'
3392 myhostname='$myhostname'
3395 nametype='$nametype'
3396 notifypatches='$notifypatches'
3404 patchlevel='$patchlevel'
3406 perlpath='$perlpath'
3408 phostname='$phostname'
3412 prefixexp='$prefixexp'
3414 privlibexp='$privlibexp'
3417 scriptdir='$scriptdir'
3418 scriptdirexp='$scriptdirexp'
3420 sendmail='$sendmail'
3423 sharpbang='$sharpbang'
3428 spackage='$spackage'
3429 spitshell='$spitshell'
3431 startperl='$startperl'
3444 usermail='$usermail'
3451 : add special variables
3452 $test -f $src/patchlevel.h && \
3453 awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
3454 echo "CONFIG=true" >>config.sh
3456 : propagate old symbols
3457 if $test -f UU/config.sh; then
3458 <UU/config.sh sort | uniq >UU/oldconfig.sh
3459 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
3460 sort | uniq -u >UU/oldsyms
3461 set X `cat UU/oldsyms`
3467 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
3469 echo "# Variables propagated from previous config.sh file." >>config.sh
3470 for sym in `cat UU/oldsyms`; do
3471 echo " Propagating $hint variable "'$'"$sym..."
3472 eval 'tmp="$'"${sym}"'"'
3474 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
3480 : Finish up by extracting the .SH files
3494 If you'd like to make any changes to the config.sh file before I begin
3495 to configure things, do it as a shell escape now (e.g. !vi config.sh).
3498 rp="Press return or use a shell escape to edit config.sh:"
3503 *) : in case they cannot read
3509 : if this fails, just run all the .SH files by hand
3516 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
3523 Now you need to generate make dependencies by running "make depend".
3524 You might prefer to run it in background: "make depend > makedepend.out &"
3525 It can take a while, so you might not want to run it right now.
3530 rp="Run make depend now?"
3534 make depend && echo "Now you must run a make."
3537 echo "You must run 'make depend' then 'make'."
3540 elif test -f [Mm]akefile; then
3542 echo "Now you must run a make."
3547 $rm -f kit*isdone ark*isdone