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 so you may fetch it yourself from your nearest
18 # archive site. Check with Archie if you don't know where that can be.)
21 # $Id: Head.U,v 3.0.1.3 1993/12/15 08:15:07 ram Exp $
23 # Generated on Sat Apr 2 17:29:14 EST 1994 [metaconfig 3.0 PL22]
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$$
50 PATH=".:$PATH:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin"
51 PATH=$PATH:'/usr/5bin:/etc:/usr/gnu/bin:/usr/new:/usr/new/bin:/usr/nbin'
52 PATH=$PATH:'/sys5.3/bin:/sys5.3/usr/bin:/bsd4.3/bin:/bsd4.3/usr/ucb'
53 PATH=$PATH:'/bsd4.3/usr/bin:/usr/bsd:/bsd43/bin:/usr/ccs/bin'
54 PATH=$PATH:'/etc:/usr/lib:/usr/ucblib:/lib:/usr/ccs/lib'
55 PATH=$PATH:'/sbin:/usr/sbin:/usr/libexec'
59 echo "Say 'sh Configure', not 'sh <Configure'"
63 : On HP-UX, large Configure scripts may exercise a bug in /bin/sh
64 if test -f /hp-ux -a -f /bin/ksh; then
65 if (PATH=.; alias -x) >/dev/null 2>&1; then
66 : already under /bin/ksh
69 (Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.)
74 : Warn them if they use ksh on other systems
75 (PATH=.; alias -x) >/dev/null 2>&1 && \
77 (I see you are using the Korn shell. Some ksh's blow up on Configure,
78 especially on exotic machines. If yours does, try the Bourne shell instead.)
82 : Configure runs within the UU subdirectory
83 test -d UU || mkdir UU
405 : script used to extract .SH files with variable substitutions
408 echo "Doing variable substitutions on .SH files..."
409 if test -f MANIFEST; then
410 set x `awk '{print $1}' <MANIFEST | grep '\.SH'`
412 echo "(Looking for .SH files under the current directory.)"
413 set x `find . -name "*.SH" -print`
417 0) set x *.SH; shift;;
419 if test ! -f $1; then
425 dir=`expr X$file : 'X\(.*\)/'`
426 file=`expr X$file : 'X.*/\(.*\)'`
427 (cd $dir && . ./$file)
434 if test -f config_h.SH; then
435 if test ! -f config.h; then
436 : oops, they left it out of MANIFEST, probably, so do it anyway.
442 : produce awk script to parse command line options
443 cat >options.awk <<'EOF'
445 optstr = "deEf:hrsSV"; # getopt-style specification
447 len = length(optstr);
448 for (i = 1; i <= len; i++) {
449 c = substr(optstr, i, 1);
450 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
461 if (substr(str, 1, 1) != "-") {
462 printf("'%s'\n", str);
466 for (i = 2; i <= len; i++) {
467 c = substr(str, i, 1);
469 printf("-%s\n", substr(str, i));
475 printf("'%s'\n", substr(str, i + 1));
488 : process the command line options
489 set X `for arg in "$@"; do echo $arg; done | awk -f options.awk`
494 : set up default values
504 while test $# -gt 0; do
506 -d) shift; fastread=yes;;
507 -e) shift; alldone=cont;;
511 if test -r "$1"; then
514 echo "Configure: cannot read config file $1." >&2
519 -h) shift; error=true;;
520 -r) shift; reuseval=true;;
521 -s) shift; silent=true;;
522 -E) shift; alldone=exit;;
523 -S) shift; extractsh=true;;
524 -V) echo "Configure generated by metaconfig 3.0 PL22." >&2
527 -*) echo "Configure: unknown option $1" >&2; shift; error=true;;
535 Usage: Configure [-dehrESV] [-f config.sh]
536 -d : use defaults for all answers.
537 -e : go on without questioning past the production of config.sh.
538 -f : specify an alternate default configuration file.
539 -h : print this help message and exit (with an error status).
540 -r : reuse C symbols value if possible (skips costly nm extraction).
541 -s : silent mode, only echoes questions and essential information.
542 -E : stop at the end of questions, after having produced config.sh.
543 -S : perform variable substitutions on all .SH files (can mix with -f)
544 -V : print version number and exit (with a zero status).
552 true) exec 1>/dev/null;;
558 '') config_sh='config.sh'; config='./config.sh';;
559 /*) config="$config_sh";;
560 *) config="./$config_sh";;
563 echo "Fetching answers from $config_sh..."
577 : Eunice requires " " instead of "", can you believe it
580 echo "Beginning of configuration questions for $package."
584 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
587 trap 'echo " "; rm -rf $rmlist; exit 1' 1 2 3 15
589 : We must find out about Eunice early
591 if test -f /etc/unixtovms; then
592 eunicefix=/etc/unixtovms
594 if test -f /etc/unixtovms.exe; then
595 eunicefix=/etc/unixtovms.exe
598 : list of known cpp symbols
599 attrlist="__alpha __bsdi__ BSD_NET2 DGUX M_I186 M_I286 M_I386"
600 attrlist="$attrlist M_I8086 M_XENIX UTS __DGUX__"
601 attrlist="$attrlist _AIX __STDC__ __m88k__ ansi bsd4_2 gcos gimpel"
602 attrlist="$attrlist hp9000s300 hp9000s400 hp9000s500 hp9000s700"
603 attrlist="$attrlist hp9000s800 hpux"
604 attrlist="$attrlist i186 i386 i486 i8086 iAPX286 ibm interdata"
605 attrlist="$attrlist m88k mc300 mc500 mc68000 mc68k mc700 mert"
606 attrlist="$attrlist mips NeXT ns16000 ns32000 nsc32000 os"
607 attrlist="$attrlist __osf__ pdp11 posix"
608 attrlist="$attrlist pyr sinix sony sparc sun tower tower32 tower32_600"
609 attrlist="$attrlist tower32_800 tss u3b2 u3b20 u3b200 u3b5 ultrix unix"
610 attrlist="$attrlist __unix__ vax venix xenix z8000"
613 : List of extensions we want:
616 : no include file wanted by default
621 : change the next line if compiling for Xenix/286 on Xenix/386
622 xlibpth='/usr/lib/386 /lib/386'
624 : general looking path for locating libraries
625 libpth="/usr/lib/large /lib /usr/lib $xlibpth /lib/large"
626 libpth="$libpth /usr/lib/small /lib/small"
627 libpth="$libpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
629 : Private path used by Configure to find libraries. Its value
630 : is prepend to libpth. This variable takes care of special
631 : machines, like the mips. Usually, it should be empty.
634 libswanted="net socket nsl inet nm sdbm gdbm ndbm dbm malloc dl dld sun m c_s posix cposix ndir dir ucb bsd BSD PW x"
636 : full support for void wanted by default
640 : Some greps do not return status, grrr.
641 echo "grimblepritz" >grimble
642 if grep blurfldyick grimble >/dev/null 2>&1 ; then
644 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
650 : the following should work in any shell
654 echo "AGH! Grep doesn't return a status. Attempting remedial action."
655 cat >contains <<'EOSS'
656 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
661 : first determine how to suppress newline on echo command
663 echo "Checking echo to see how to suppress newlines..."
664 (echo "hi there\c" ; echo " ") >.echotmp
665 if $contains c .echotmp >/dev/null 2>&1 ; then
676 echo $n "The star should be here-->$c"
680 : Now test for existence of everything in MANIFEST
682 if test -f ../MANIFEST; then
683 echo "First let's make sure your kit is complete. Checking..." >&4
684 awk '$1 !~ /PACK[A-Z]+/ {print $1}' ../MANIFEST | split -50
686 for filelist in x??; do
687 (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing)
689 if test -s missing; then
693 THIS PACKAGE SEEMS TO BE INCOMPLETE.
695 You have the option of continuing the configuration process, despite the
696 distinct possibility that your kit is damaged, by typing 'y'es. If you
697 do, don't blame me if something goes wrong. I advise you to type 'n'o
698 and contact the author (lwall@netlabs.com).
701 echo $n "Continue? [n] $c" >&4
705 echo "Continuing..." >&4
709 echo "ABORTING..." >&4
714 echo "Looks good..." >&4
717 echo "There is no MANIFEST file. I hope your kit is complete !"
721 : compute the number of columns on the terminal for proper question formatting
726 : set up the echo used in my read
727 myecho="case \"\$xxxm\" in
728 '') echo $n \"\$rp $c\" >&4;;
730 '') echo $n \"[\$xxxm] $c\";;
732 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
734 echo $n \"[\$xxxm] $c\" >&4
736 echo $n \"\$rp [\$xxxm] $c\" >&4
742 : now set up to do reads with possible shell escape and default assignment
748 yes) case "\$dflt" in
751 case "\$silent-\$rp" in
756 *) case "\$silent" in
762 while expr "X\$ans" : "X!" >/dev/null; do
766 aok=''; eval "ans=\"\$answ\"" && aok=y
776 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
786 echo "*** Substitution done -- please confirm."
788 ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
793 echo "*** Error -- try again."
800 case "\$ans\$xxxm\$nostick" in
812 : create .config dir to save info across Configure sessions
813 test -d ../.config || mkdir ../.config
814 cat >../.config/README <<EOF
815 This directory created by Configure to save information that should
816 persist across sessions.
818 You may safely delete it if you wish.
821 : general instructions
824 user=`( (logname) 2>/dev/null || whoami) 2>&1`
825 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
828 rp='Would you like to see the instructions?'
839 This installation shell script will examine your system and ask you questions
840 to determine how the perl package should be installed. If you get
841 stuck on a question, you may use a ! shell escape to start a subshell or
842 execute a command. Many of the questions will have default answers in square
843 brackets; typing carriage return will give you the default.
845 On some of the questions which ask for file or directory names you are allowed
846 to use the ~name construct to specify the login directory belonging to "name",
847 even if you don't have a shell which knows about that. Questions where this is
848 allowed will be marked "(~name ok)".
852 dflt='Type carriage return to continue'
856 The prompter used in this script allows you to use shell variables and
857 backticks in your answers. You may use $1, $2, etc... to refer to the words
858 in the default answer, as if the default line was a set of arguments given to a
859 script shell. This means you may also use $* to repeat the whole default line,
860 so you do not have to re-type everything to add something to the default.
862 Everytime there is a substitution, you will have to confirm. If there is an
863 error (e.g. an unmatched backtick), the default answer will remain unchanged
864 and you will be prompted again.
866 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
867 the questions and use the computed defaults (or the previous answers if there
868 was already a config.sh file). Type 'Configure -h' for a list of options.
874 Much effort has been expended to ensure that this shell script will run on any
875 Unix system. If despite that it blows up on yours, your best bet is to edit
876 Configure and run it again. Also, let me (lwall@netlabs.com)
877 know how I blew it. If you can't run Configure for some reason, you'll have to
878 generate a config.sh file by hand.
880 This installation script affects things in two ways:
882 1) it may do direct variable substitutions on some of the files included
884 2) it builds a config.h file for inclusion in C programs. You may edit
885 any of these files as the need arises after running this script.
887 If you make a mistake on a question, there is no easy way to back up to it
888 currently. The easiest thing to do is to edit config.sh and rerun all the SH
889 files. Configure will offer to let you do this before it runs the SH files.
892 dflt='Type carriage return to continue'
895 true) echo $user >>../.config/instruct;;
899 : see if sh knows # comments
901 echo "Checking your sh to see if it knows about # comments..." >&4
902 if sh -c '#' >/dev/null 2>&1 ; then
903 echo "Your sh handles # comments correctly."
907 echo "Okay, let's see if #! works on this system..."
908 echo "#!/bin/cat" >try
912 if test -s today; then
916 echo "#! /bin/cat" > try
920 if test -s today; then
924 echo "It's just a comment."
929 echo "Your sh doesn't grok # comments--I will strip them later on."
931 echo "exec grep -v '^[ ]*#'" >spitshell
934 spitshell=`pwd`/spitshell
935 echo "I presume that if # doesn't work, #! won't work either!"
940 : figure out how to guarantee sh startup
942 echo "Checking out how to guarantee sh startup..." >&4
944 *bsd*|sys5*) startsh=$sharpbang"/$SYSTYPE/bin/sh";;
945 *) startsh=$sharpbang'/bin/sh';;
947 echo "Let's see if '$startsh' works..."
959 echo "Nope. You may have to fix up the shell scripts to make sure sh runs them."
963 : find out where common programs are
965 echo "Locating common programs..." >&4
978 if test -d \$dir/\$thing; then
984 if test -f \$dir/\$thing; then
987 elif test -f \$dir/\$thing.exe; then
988 : on Eunice apparently
1030 pth=`echo $PATH | sed -e 's/:/ /g'`
1031 pth="$pth /lib /usr/lib"
1032 for file in $loclist; do
1033 xxx=`./loc $file $file $pth`
1038 echo $file is in $xxx.
1041 echo "I don't know where $file is. I hope it's in everyone's PATH."
1046 echo "Don't worry if any of the following aren't found..."
1048 for file in $trylist; do
1049 xxx=`./loc $file $file $pth`
1054 echo $file is in $xxx.
1057 echo "I don't see $file out there, $say."
1064 echo "Substituting grep for egrep."
1070 echo "Hopefully test is built into your sh."
1073 if sh -c "PATH= test true" >/dev/null 2>&1; then
1074 echo "Using the test built into your sh."
1082 echo "Hopefully echo is built into your sh."
1087 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1088 $echo $n "hi there$c" >foo1
1089 echo $n "hi there$c" >foo2
1090 if cmp foo1 foo2 >/dev/null 2>&1; then
1091 echo "They are compatible. In fact, they may be identical."
1098 They are not compatible! You are probably running ksh on a non-USG system.
1099 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1100 have echo built in and we may have to run some Bourne shell scripts. That
1101 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1104 $echo $n "The star should be here-->$c"
1111 : Try to determine whether config.sh was made on this system
1112 case "$config_sh" in
1114 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1115 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' | \
1116 tr '[A-Z]' '[a-z]' | tr '\012' ' '`
1118 if test "$fastread" = yes; then
1120 elif test -f ../config.sh; then
1122 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1123 eval "old`grep myuname= ../config.sh`"
1125 if test "X$myuname" = "X$oldmyuname"; then
1130 : Get old answers from old config file if Configure was run on the
1131 : same system, otherwise use the hints.
1134 if test -f config.sh; then
1136 rp="I see a config.sh file. Shall I use it to set the defaults?"
1139 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1140 *) echo "Fetching default answers from your old config.sh file..." >&4
1151 if test ! -f config.sh; then
1154 First time through, eh? I have some defaults handy for the following systems:
1157 cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4
1159 : Half the following guesses are probably wrong... If you have better
1160 : tests or hints, please send them to lwall@netlabs.com
1161 : The metaconfig authors would also appreciate a copy...
1162 $test -f /irix && dflt="$dflt sgi"
1163 $test -f /xenix && dflt="$dflt sco_xenix"
1164 $test -f /dynix && dflt="$dflt dynix"
1165 $test -f /dnix && dflt="$dflt dnix"
1166 $test -f /bin/mips && /bin/mips && dflt="$dflt mips"
1167 $test -d /NextApps && test -f /usr/adm/software_version && dflt="$dflt next"
1168 $test -d /usr/include/minix && dflt="$dflt minix"
1169 if $test -f $uname; then
1173 $test -f $5.sh && dflt="$dflt $5"
1176 fps*) dflt="$dflt fps";;
1179 umips) dflt="$dflt umips";;
1180 *) dflt="$dflt mips";;
1182 [23]100) dflt="$dflt mips";;
1183 next*) dflt="$dflt next" ;;
1184 news*) dflt="$dflt news" ;;
1185 i386*) if $test -f /etc/kconfig; then
1186 if $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1187 dflt="$dflt isc_3_2_3"
1188 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
1189 dflt="$dflt isc_3_2_2"
1191 : i386.sh hint is wrong for Interactive.
1192 dflt=`echo $dflt | $sed 's/i386//'`
1198 aix) dflt="$dflt aix_rs" ;;
1199 sun[Oo][Ss]) case "$3" in
1200 [34]*) vers=`echo $3 | $sed 's/\./_/g'`
1201 dflt="$dflt sunos_$vers" ;;
1202 5*) vers=`echo $3 | $sed 's/^5/2/g'`
1203 dflt="$dflt solaris_$vers" ;;
1206 [sS]olaris) case "$3" in
1207 5*) vers=`echo $3 | $sed 's/^5/2/g'`
1208 dflt="$dflt solaris_$vers" ;;
1211 dnix) dflt="$dflt dnix" ;;
1212 dgux) dflt="$dflt dgux" ;;
1213 genix) dflt="$dflt genix" ;;
1214 hp*ux) dflt="$dflt hpux" ;;
1215 next) dflt="$dflt next" ;;
1216 irix) dflt="$dflt sgi" ;;
1217 ultrix) case "$3" in
1218 3*) dflt="$dflt ultrix_3" ;;
1219 4*) dflt="$dflt ultrix_4" ;;
1222 uts) dflt="$dflt uts" ;;
1225 *) if test -f /etc/systemid; then
1226 set `echo $3 | $sed 's/\./ /g'` $4
1227 if $test -f sco_$1_$2_$3.sh; then
1228 dflt="$dflt sco_$1_$2_$3"
1229 elif $test -f sco_$1_$2.sh; then
1230 dflt="$dflt sco_$1_$2"
1231 elif $test -f sco_$1.sh; then
1240 if test -f /vmunix -a -f news_os.sh; then
1241 (what /vmunix | tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1
1242 if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then
1243 dflt="$dflt news_os"
1245 $rm -f ../UU/kernel.what
1248 set X `echo $dflt | tr ' ' '\012' | sort | uniq`
1252 if $test -f "$file.sh"; then
1264 You may give one or more space-separated answers, or "none" if appropriate.
1265 If your OS version has no hints, DO NOT give a wrong version -- say "none".
1268 rp="Which of these apply, if any?"
1270 for file in $ans; do
1271 if $test -f $file.sh; then
1273 $cat $file.sh >> ../UU/config.sh
1274 elif $test X$ans = X -o X$ans = Xnone ; then
1277 echo "$file.sh does not exist -- ignored"
1287 echo "Fetching default answers from $config_sh..." >&4
1291 cp $config_sh config.sh 2>/dev/null
1301 : Restore computed paths
1302 for file in $loclist $trylist; do
1303 eval $file="\$_$file"
1306 : who configured the system
1307 cf_time=`$date 2>&1`
1308 cf_by=`( (logname) 2>/dev/null || whoami) 2>&1`
1310 : determine where manual pages are on this system
1314 syspath='/usr/man/man1 /usr/man/man1 /usr/man/mann'
1315 syspath="$syspath /usr/man/manl /usr/man/local/man1"
1316 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
1317 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
1318 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
1319 syspath="$syspath /usr/man/man.L /local/man/man1"
1320 sysman=`./loc . $syspath`
1323 if $test -d "$sysman"; then
1324 echo "System manual is in $sysman." >&4
1326 echo "Could not find manual pages in source form." >&4
1329 : see what memory models we can support
1332 $cat >pdp11.c <<'EOP'
1341 cc -o pdp11 pdp11.c >/dev/null 2>&1
1342 if ./pdp11 2>/dev/null; then
1343 dflt='unsplit split'
1345 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
1348 *) if $test -d /lib/small || $test -d /usr/lib/small; then
1353 if $test -d /lib/medium || $test -d /usr/lib/medium; then
1356 if $test -d /lib/large || $test -d /usr/lib/large; then
1359 if $test -d /lib/huge || $test -d /usr/lib/huge; then
1368 Some systems have different model sizes. On most systems they are called
1369 small, medium, large, and huge. On the PDP11 they are called unsplit and
1370 split. If your system doesn't support different memory models, say "none".
1371 If you wish to force everything to one memory model, say "none" here and
1372 put the appropriate flags later when it asks you for other cc and ld flags.
1373 Venix systems may wish to put "none" and let the compiler figure things out.
1374 (In the following question multiple model names should be space separated.)
1377 rp="Which memory models are supported?"
1392 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
1393 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
1400 rp="What flag indicates separate I and D space?"
1408 *large*|*small*|*medium*|*huge*)
1415 rp="What flag indicates large model?"
1425 *huge*) case "$huge" in
1429 rp="What flag indicates huge model?"
1439 *medium*) case "$medium" in
1443 rp="What flag indicates medium model?"
1450 *) medium="$large";;
1453 *small*) case "$small" in
1457 rp="What flag indicates small model?"
1468 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
1472 : make some quick guesses about what we are up against
1474 $echo $n "Hmm... $c"
1483 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
1484 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
1486 echo "Looks kind of like an OSF/1 system, but we'll see..."
1488 elif test `echo abc | tr a-z A-Z` = Abc ; then
1489 xxx=`./loc addbib blurfl $pth`
1490 if $test -f $xxx; then
1491 echo "Looks kind of like a USG system with BSD features, but we'll see..."
1495 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
1496 echo "Looks kind of like an extended USG system, but we'll see..."
1498 echo "Looks kind of like a USG system, but we'll see..."
1502 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
1503 echo "Looks kind of like a BSD system, but we'll see..."
1507 echo "Looks kind of like a Version 7 system, but we'll see..."
1510 case "$eunicefix" in
1513 There is, however, a strange, musty smell in the air that reminds me of
1514 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
1518 : it so happens the Eunice I know will not run shell scripts in Unix format
1522 echo "Congratulations. You aren't running Eunice."
1526 if test -f /xenix; then
1527 echo "Actually, this looks more like a XENIX system..."
1532 echo "It's not Xenix..."
1537 if test -f /venix; then
1538 echo "Actually, this looks more like a VENIX system..."
1545 echo "Nor is it Venix..."
1548 chmod +x bsd usg v7 osf1 eunice xenix venix
1549 $eunicefix bsd usg v7 osf1 eunice xenix venix
1552 : see if we need a special compiler
1560 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
1561 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
1574 On some systems the default C compiler will not resolve multiple global
1575 references that happen to have the same name. On some such systems the "Mcc"
1576 command may be used to force these to be resolved. On other systems a "cc -M"
1577 command is required. (Note that the -M flag on other systems indicates a
1578 memory model to use!) If you have the Gnu C compiler, you might wish to use
1582 rp="What command will force resolution on this system?"
1590 rp="Use which C compiler?"
1595 gcc*) echo "Checking out which version of gcc"
1596 $cat >gccvers.c <<EOM
1609 case '1': printf("1\n"); break;
1610 case '2': printf("2\n"); break;
1611 case '3': printf("3\n"); break;
1621 if $cc -o gccvers $ccflags gccvers.c >/dev/null 2>&1; then
1622 gccversion=`./gccvers`
1623 echo "You appear to have version $gccversion."
1625 echo "Doesn't appear to be GNU cc."
1628 if $test "$gccversion" = '1'; then
1629 cpp=`./loc gcc-cpp $cpp $pth`
1633 : decide how portable to be
1634 case "$d_portable" in
1640 I can set things up so that your shell scripts and binaries are more portable,
1641 at what may be a noticable cost in performance. In particular, if you
1642 ask to be portable, the following happens:
1644 1) Shell scripts will rely on the PATH variable rather than using
1645 the paths derived above.
1646 2) ~username interpretations will be done at run time rather than
1650 rp="Do you expect to run these scripts and binaries on multiple machines?"
1653 y*) d_portable="$define"
1654 for file in $loclist $trylist; do
1658 *) d_portable="$undef" ;;
1661 : set up shell script to do ~ expansion
1667 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
1670 if $test -f /bin/csh; then
1671 /bin/csh -f -c "glob \$1"
1676 name=\`$expr x\$1 : '..\([^/]*\)'\`
1677 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
1678 if $test ! -d "\$dir"; then
1680 echo "\$me: can't locate home directory for: \$name" >&2
1685 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
1701 : now set up to get a file name
1702 cat <<'EOSC' >getfile
1716 */*) fullpath=true;;
1725 *e*) exp_file=true;;
1730 *d*) type='Directory';;
1731 *l*) type='Locate'; fn=`expr $fn : '.*:\(.*\)'`;;
1736 Locate) what='File';;
1741 case "$d_portable" in
1749 while test "$type"; do
1754 true) rp="$rp (~name ok)";;
1770 value=`UU/filexp $ans`
1773 if test "$ans" != "$value"; then
1774 echo "(That is $value on this particular system.)"
1788 /*) value="$ansexp" ;;
1793 echo "I shall only accept a full path name, as in /bin/ls." >&4
1794 echo "Use a ! shell escape if you wish to check pathnames." >&4
1797 echo "Please give a full path name, starting with slash." >&4
1800 echo "Note that using ~name is ok provided it expands well." >&4
1813 if test -f "$ansexp"; then
1815 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
1817 echo "($value is not a plain file, but that's ok.)"
1822 if test -d "$ansexp"; then
1827 if test -d "$value"; then
1828 echo "(Looking for $fn in directory $value.)"
1831 if test -f "$value"; then
1844 if test "$fastread" = yes; then
1849 rp="$what $value doesn't exist. Use that name anyway?"
1869 : What should the include directory be ?
1871 $echo $n "Hmm... $c"
1873 '') dflt='/usr/include';;
1878 if $test -f /bin/mips && /bin/mips; then
1879 echo "Looks like a MIPS system..."
1880 $cat >usr.c <<'EOCP'
1881 #ifdef SYSTYPE_BSD43
1885 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
1886 dflt='/bsd43/usr/include'
1890 mips_type='System V'
1892 $rm -f usr.c usr.out
1893 echo "and you're compiling with the $mips_type compiler and libraries."
1895 echo "Doesn't look like a MIPS system."
1902 rp='Where are the include files you want to use?'
1906 : determine optimize, if desired, or use for debug flag also
1910 *) dflt="$optimize";;
1914 Some C compilers have problems with their optimizers, by default, $package
1915 compiles with the -O flag to use the optimizer. Alternately, you might want
1916 to use the symbolic debugger, which uses the -g flag (on traditional Unix
1917 systems). Either flag can be specified here. To use neither flag, specify
1921 rp="What optimizer/debugger flag should be used?"
1925 'none') optimize=" ";;
1930 *gcc*) if $test "$gccversion" = "1"; then
1931 dflt='-fpcc-struct-return'
1936 *-g*) dflt="$dflt -DDEBUGGING";;
1939 *gcc*) if test -d /etc/conf/kconfig.d &&
1940 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
1947 *) dflt="$ccflags" ;;
1950 case "$mips_type" in
1953 *) inclwanted="$inclwanted $usrinc/bsd";;
1955 for thisincl in $inclwanted; do
1956 if $test -d $thisincl; then
1957 if $test x$thisincl != x$usrinc; then
1960 *) dflt="$dflt -I$thisincl";;
1966 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
1968 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
1976 *) dflt="$dflt -D$2";;
1981 set signal.h __LANGUAGE_C__; eval $inctest
1983 set signal.h LANGUAGE_C; eval $inctest
1985 set signal.h NO_PROTOTYPE; eval $inctest
1986 set signal.h _NO_PROTO; eval $inctest
1993 Your C compiler may want other flags. For this question you should include
1994 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
1995 but you should NOT include libraries or ld flags like -lwhatever. If you
1996 want $package to honor its debug switch, you should include -DDEBUGGING here.
1997 To use no flags, specify the word "none".
1999 Your C compiler might also need additional flags, such as -DJMPCLOBBER
2005 rp="Any additional cc flags?"
2012 : the following weeds options from ccflags that are of no interest to cpp
2015 *gcc*) if $test "$gccversion" = "1"; then
2016 cppflags="$cppflags -D__GNUC__"
2019 case "$mips_type" in
2021 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
2030 -D*|-I*|-traditional|-ansi|-nostdinc) cppflags="$cppflags $flag";;
2034 *-*) echo "(C preprocessor flags: $cppflags)";;
2039 : flags used in final linking phase
2047 *) dflt="$ldflags";;
2050 rp="Any additional ld flags (NOT including libraries)?"
2056 rmlist="$rmlist pdp11"
2058 : Initialize h_fcntl
2061 : Initialize h_sysfile
2064 : Set private lib path
2067 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
2070 libpth="$plibpth $libpth"
2071 : Now check and see which directories actually exist.
2075 if $test -d $yyy; then
2081 Some systems have incompatible or broken versions of libraries. Where
2082 should I look for libraries?
2087 rp="Directories to use for library searches?"
2093 : Looking for optional libraries
2095 echo "Checking for optional libraries..." >&4
2100 case "$libswanted" in
2101 '') libswanted='c_s';;
2103 for thislib in $libswanted; do
2107 *) thatlib="${thislib}_s";;
2109 xxx=`./loc lib$thislib.a X $libpth`
2110 yyy=`./loc lib$thatlib.a X $libpth`
2111 zzz=`./loc lib$thislib.so.[0-9]'*' $libpth`
2112 if $test -f $xxx; then
2113 echo "Found -l$thislib."
2115 "*-l$thislib *.*"|"*-l$thatlib *.*") ;;
2116 *) dflt="$dflt -l$thislib";;
2118 elif $test -f $yyy; then
2119 echo "Found -l$thatlib."
2121 "*-l$thislib *.*"|"*-l$thatlib *.*") ;;
2122 *) dflt="$dflt -l$thatlib";;
2124 elif $test -f $zzz; then
2125 echo "Found -$thislib."
2127 "*-l$thislib *.*"|"*-l$thatlib *.*") ;;
2128 *) dflt="$dflt -l$thislib";;
2131 xxx=`./loc Slib$thislib.a X $xlibpth`
2132 yyy=`./loc Slib$thatlib.a X $xlibpth`
2133 if $test -f $xxx; then
2134 echo "Found -l$thislib."
2136 "*-l$thislib *.*"|"*-l$thatlib *.*") ;;
2137 *) dflt="$dflt -l$thislib";;
2139 elif $test -f $yyy; then
2140 echo "Found -l$thatlib."
2142 "*-l$thislib *.*"|"*-l$thatlib *.*") ;;
2143 *) dflt="$dflt -l$thatlib";;
2146 echo "No -l$thislib."
2158 ' '|'') dflt='none';;
2163 Some versions of Unix support shared libraries, which make executables smaller
2164 but make load time slightly longer.
2166 On some systems, mostly newer Unix System V's, the shared library is included
2167 by putting the option "-lc_s" as the last thing on the cc command line when
2168 linking. Other systems use shared libraries by default. There may be other
2169 libraries needed to compile $package on your machine as well. If your system
2170 needs the "-lc_s" option, include it here. Include any other special libraries
2171 here as well. Say "none" for none.
2175 rp="Any additional libraries?"
2182 : see if nm is to be used to determine whether a symbol is defined or not
2185 dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null`
2186 if $test $dflt -gt 20; then
2201 I can use 'nm' to extract the symbols from your C libraries. This is a time
2202 consuming task which may generate huge output on the disk (up to 3 megabytes)
2203 but that should make the symbols extraction faster. The alternative is to skip
2204 the 'nm' extraction part and to compile a small test program instead to
2205 determine whether each symbol is present. If you have a fast C compiler and/or
2206 if your 'nm' output cannot be parsed, this may be the best solution.
2209 rp='Shall I use nm to extract C symbols from the libraries?'
2221 : nm options which may be necessary
2223 '') if $test -f /mach_boot; then
2225 elif $test -d /usr/ccs/lib; then
2227 elif $test -f /dgux; then
2236 : get list of predefined functions in a handy place
2241 *-lc_s*) libc=`./loc libc_s.a $libc $libpth`
2245 libpth="$plibpth $libpth"
2249 *) for thislib in $libs; do
2252 thislib=`expr X$thislib : 'X-l\(.*\)'`
2253 try=`./loc lib$thislib.a blurfl/dyick $libpth`
2254 if test ! -f $try; then
2255 try=`./loc lib$thislib blurfl/dyick $libpth`
2256 if test ! -f $try; then
2257 try=`./loc lib$thislib.so.'*' blurfl/dyick $libpth`
2258 if test ! -f $try; then
2259 try=`./loc $thislib blurfl/dyick $libpth`
2260 if test ! -f $try; then
2261 try=`./loc Slib$thislib.a blurfl/dyick $xlibpth`
2262 if test ! -f $try; then
2269 libnames="$libnames $try"
2271 *) libnames="$libnames $thislib" ;;
2279 set /usr/ccs/lib/libc.so
2280 $test -r $1 || set /usr/lib/libc.so
2281 $test -r $1 || set /usr/shlib/libc.so
2282 $test -r $1 || set /usr/lib/libc.so.[0-9]*
2283 $test -r $1 || set /lib/libsys_s.a
2290 if $test -r "$1"; then
2291 echo "Your (shared) C library seems to be in $1."
2293 elif $test -r /lib/libc && $test -r /lib/clib; then
2294 echo "Your C library seems to be in both /lib/clib and /lib/libc."
2296 libc='/lib/clib /lib/libc'
2297 if $test -r /lib/syslib; then
2298 echo "(Your math library is in /lib/syslib.)"
2299 libc="$libc /lib/syslib"
2301 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
2302 echo "Your C library seems to be in $libc, as you said before."
2303 elif $test -r $incpath/usr/lib/libc.a; then
2304 libc=$incpath/usr/lib/libc.a;
2305 echo "Your C library seems to be in $libc. That's fine."
2306 elif $test -r /lib/libc.a; then
2308 echo "Your C library seems to be in $libc. You're normal."
2310 if tans=`./loc libc.a blurfl/dyick $libpth`; $test -r "$tans"; then
2312 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
2313 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
2314 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
2316 elif tans=`./loc Slibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
2318 elif tans=`./loc Mlibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
2321 tans=`./loc Llibc.a blurfl/dyick $xlibpth`
2323 if $test -r "$tans"; then
2324 echo "Your C library seems to be in $tans, of all places."
2330 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
2334 If the guess above is wrong (which it might be if you're using a strange
2335 compiler, or your machine supports multiple models), you can override it here.
2340 echo $libpth | tr ' ' '\012' | sort | uniq > libpath
2342 I can't seem to find your C library. I've looked in the following places:
2345 $sed 's/^/ /' libpath
2348 None of these seems to contain your C library. I need to get its name...
2353 rp='Where is your C library?'
2358 echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames
2359 set X `cat libnames`
2362 case $# in 1) xxx=file; esac
2363 echo "Extracting names from the following $xxx for later perusal:" >&4
2365 $sed 's/^/ /' libnames >&4
2367 $echo $n "This may take a while...$c" >&4
2369 nm $nm_opt $* 2>/dev/null >libc.tmp
2371 $grep fprintf libc.tmp > libc.ptf
2372 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
2373 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
2374 if com="$sed -n -e 's/^.* [ADTS] *_[_.]*//p' -e 's/^.* [ADTS] //p'";\
2376 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
2378 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
2380 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
2382 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
2384 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
2386 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
2388 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
2390 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
2392 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
2394 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
2396 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
2398 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
2399 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
2401 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
2403 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
2405 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
2407 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
2409 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
2412 nm -p $* 2>/dev/null >libc.tmp
2413 com="$sed -n -e 's/^.* [ADTS] *_[_.]*//p' -e 's/^.* [ADTS] //p'";\
2414 eval "<libc.tmp $com >libc.list"
2415 if $contains '^fprintf$' libc.list >/dev/null 2>&1; then
2420 echo "nm didn't seem to work right. Trying ar instead..." >&4
2422 if ar t $libc > libc.tmp; then
2423 for thisname in $libnames; do
2424 ar t $thisname >>libc.tmp
2426 $sed -e 's/\.o$//' < libc.tmp > libc.list
2429 echo "ar didn't seem to work right." >&4
2430 echo "Maybe this is a Cray...trying bld instead..." >&4
2431 if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list; then
2432 for thisname in $libnames; do
2434 $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
2435 ar t $thisname >>libc.tmp
2439 echo "That didn't work either. Giving up." >&4
2446 if $test -f /lib/syscalls.exp; then
2448 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
2449 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
2453 $rm -f libnames libpath
2455 : is a C symbol defined?
2458 -v) tf=libc.tmp; tc=""; tdc="";;
2459 -a) tf=libc.tmp; tc="[0]"; tdc=[];;
2460 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
2463 case "$reuseval-$4" in
2465 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
2471 if $contains $tlook $tf >/dev/null 2>&1;
2476 echo "main() { extern int $1$tdc; printf(\"%d\", $1$tc); }" > t.c;
2477 if $cc $ccflags -o t t.c $ldflags $libs >/dev/null 2>&1;
2485 $define) tval=true;;
2491 : set up the script used to warn in case of inconsistency
2495 echo "*** WHOA THERE!!! ***" >&4
2496 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2497 rp=" Keep the $hint value?"
2500 y) td=$was; tu=$was;;
2504 : define an is-in-libc? function
2505 inlibc='echo " "; td=$define; tu=$undef;
2506 sym=$1; var=$2; eval "was=\$$2";
2508 case "$reuseval$was" in
2518 echo "$sym() found." >&4;
2519 case "$was" in $undef) . whoa; esac; eval "$var=\$td";;
2521 echo "$sym() NOT found." >&4;
2522 case "$was" in $define) . whoa; esac; eval "$var=\$tu";;
2526 $define) echo "$sym() found." >&4;;
2527 *) echo "$sym() NOT found." >&4;;
2531 : see how we invoke the C preprocessor
2533 echo "Now, how can we feed standard input to your C preprocessor..." >&4
2534 cat <<'EOT' >testcpp.c
2540 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
2542 wrapper=`pwd`/cppstdin
2546 if $test "X$cppstdin" != "X" && \
2547 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
2548 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2550 echo "You used to use $cppstdin $cppminus so we'll use that again."
2552 '') echo "But let's see if we can live without a wrapper..." ;;
2554 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
2555 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2557 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
2560 echo "(However, $cpprun $cpplast does not work, let's see...)"
2568 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
2575 elif echo 'Maybe "'"$cc"' -E" will work...'; \
2576 $cc -E <testcpp.c >testcpp.out 2>&1; \
2577 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2578 echo "Yup, it does."
2581 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
2582 $cc -E - <testcpp.c >testcpp.out 2>&1; \
2583 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2584 echo "Yup, it does."
2587 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
2588 $cc -P <testcpp.c >testcpp.out 2>&1; \
2589 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2590 echo "Yipee, that works!"
2593 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
2594 $cc -P - <testcpp.c >testcpp.out 2>&1; \
2595 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2596 echo "At long last!"
2599 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
2600 $cpp <testcpp.c >testcpp.out 2>&1; \
2601 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2605 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
2606 $cpp - <testcpp.c >testcpp.out 2>&1; \
2607 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2608 echo "Hooray, it works! I was beginning to wonder."
2611 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
2612 $wrapper <testcpp.c >testcpp.out 2>&1; \
2613 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2619 rp="No dice. I can't find a C preprocessor. Name one:"
2623 $x_cpp <testcpp.c >testcpp.out 2>&1
2624 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2625 echo "OK, that will do." >&4
2627 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
2642 echo "Perhaps can we force $cc -E using a wrapper..."
2643 if $wrapper <testcpp.c >testcpp.out 2>&1; \
2644 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2650 echo "Nope, we'll have to live without it..."
2665 *) $rm -f $wrapper;;
2667 $rm -f testcpp.c testcpp.out
2669 : determine filename position in cpp output
2671 echo "Computing filename position in cpp output for #include directives..." >&4
2672 echo '#include <stdio.h>' > foo.c
2675 $cppstdin $cppminus $cppflags <foo.c 2>/dev/null | \
2676 $grep '^[ ]*#.*stdio\.h' | \
2677 while read cline; do
2680 while $test \$# -gt 0; do
2681 if $test -r \`echo \$1 | $tr -d '"'\`; then
2686 pos=\`expr \$pos + 1\`
2698 *) pos="${fieldn}th";;
2700 echo "Your cpp writes the filename in the $pos field of the line."
2702 : locate header file
2707 if test -f $usrinc/\$wanted; then
2708 echo "$usrinc/\$wanted"
2711 awkprg='{ print \$$fieldn }'
2712 echo "#include <\$wanted>" > foo\$\$.c
2713 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
2714 $grep "^[ ]*#.*\$wanted" | \
2715 while read cline; do
2716 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
2718 */\$wanted) echo "\$name"; exit 0;;
2729 : access call always available on UNIX
2733 : locate the flags for 'access()'
2737 $cat >access.c <<'EOCP'
2738 #include <sys/types.h>
2743 #include <sys/file.h>
2752 : check sys/file.h first, no particular reason here
2753 if $test `./findhdr sys/file.h` && \
2754 $cc $cppflags -DI_SYS_FILE access.c -o access >/dev/null 2>&1 ; then
2756 echo "<sys/file.h> defines the *_OK access constants." >&4
2757 elif $test `./findhdr fcntl.h` && \
2758 $cc $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then
2760 echo "<fcntl.h> defines the *_OK access constants." >&4
2762 echo "I can't find the four *_OK access constants--I'll use mine." >&4
2768 : see if bcmp exists
2772 : see if bcopy exists
2776 : see if bzero exists
2780 : check for length of integer
2784 echo "Checking to see how big your integers are..." >&4
2785 $cat >try.c <<'EOCP'
2789 printf("%d\n", sizeof(int));
2792 if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then
2796 echo "(I can't seem to compile the test program. Guessing...)"
2803 rp="What is the size of an integer (in bytes)?"
2808 : function used to set $1 to $val
2809 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2811 $define$undef) . whoa; eval "$var=\$td";;
2812 $undef$define) . whoa; eval "$var=\$tu";;
2813 *) eval "$var=$val";;
2816 : check for ability to cast large floats to 32-bit ints.
2818 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
2819 if $test "$intsize" -ge 4; then
2826 #include <sys/types.h>
2828 blech() { exit(3); }
2834 signal(SIGFPE, blech);
2836 f = (double) 0x7fffffff;
2840 if (i32 != ( $xxx )f)
2845 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
2856 echo "Nope, it can't."
2862 : check for ability to cast negative floats to unsigned
2864 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
2865 $cat >try.c <<'EOCP'
2867 blech() { exit(3); }
2871 unsigned long along;
2873 unsigned short ashort;
2876 signal(SIGFPE, blech);
2877 along = (unsigned long)f;
2878 aint = (unsigned int)f;
2879 ashort = (unsigned short)f;
2880 if (along != (unsigned long)-123)
2882 if (aint != (unsigned int)-123)
2884 if (ashort != (unsigned short)-123)
2886 f = (double)0x40000000;
2889 along = (unsigned long)f;
2890 if (along != 0x80000000)
2894 along = (unsigned long)f;
2895 if (along != 0x7fffffff)
2899 along = (unsigned long)f;
2900 if (along != 0x80000001)
2906 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
2912 case "$castflags" in
2917 echo "Nope, it can't."
2924 : see if sprintf is declared as int or pointer to char
2926 $cat >ucbsprf.c <<'EOF'
2931 exit((unsigned long)sprintf(buf,"%s","foo") > 10L);
2934 if $cc ucbsprf.c -o ucbsprf >/dev/null 2>&1 && ./ucbsprf; then
2935 echo "Your sprintf() returns (int)." >&4
2938 echo "Your sprintf() returns (char*)." >&4
2945 : see if vprintf exists
2947 if set vprintf val -f d_vprintf; eval $csym; $val; then
2948 echo 'vprintf() found.' >&4
2950 $cat >vprintf.c <<'EOF'
2951 #include <varargs.h>
2953 main() { xxx("foo"); }
2962 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
2965 if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then
2966 echo "Your vsprintf() returns (int)." >&4
2969 echo "Your vsprintf() returns (char*)." >&4
2973 echo 'vprintf() NOT found.' >&4
2983 : see if chsize exists
2987 : check for const keyword
2989 echo 'Checking to see if your C compiler knows about "const"...' >&4
2990 $cat >const.c <<'EOCP'
2991 typedef struct spug { int drokk; } spug;
2998 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
3000 echo "Yup, it does."
3003 echo "Nope, it doesn't."
3008 : see if crypt exists
3010 if set crypt val -f d_crypt; eval $csym; $val; then
3011 echo 'crypt() found.' >&4
3015 cryptlib=`./loc Slibcrypt.a "" $xlibpth`
3016 if $test -z "$cryptlib"; then
3017 cryptlib=`./loc Mlibcrypt.a "" $xlibpth`
3021 if $test -z "$cryptlib"; then
3022 cryptlib=`./loc Llibcrypt.a "" $xlibpth`
3026 if $test -z "$cryptlib"; then
3027 cryptlib=`./loc libcrypt.a "" $libpth`
3031 if $test -z "$cryptlib"; then
3032 echo 'crypt() NOT found.' >&4
3041 : get csh whereabouts
3043 'csh') val="$undef" ;;
3049 : see if this is a dirent system
3051 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
3053 echo "<dirent.h> found." >&4
3056 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
3057 echo "<sys/dir.h> found." >&4
3060 xinc=`./findhdr sys/ndir.h`
3062 echo "<dirent.h> NOT found." >&4
3067 : see if the directory entry stores field length
3069 if $contains 'd_namlen' $xinc >/dev/null 2>&1; then
3070 echo "Good, your directory entry keeps length information in d_namlen." >&4
3073 echo "Your directory entry does not know about the d_namlen field." >&4
3079 : now see if they want to do setuid emulation
3087 Some sites have disabled setuid #! scripts because of a bug in the kernel
3088 that prevents them from being secure. If you are on such a system, the
3089 setuid/setgid bits on scripts are currently useless. It is possible for
3090 $package to detect those bits and emulate setuid/setgid in a secure fashion
3091 until a better solution is devised for the kernel problem.
3094 rp="Do you want to do setuid/setgid emulation?"
3097 y*) d_dosuid="$define";;
3098 *) d_dosuid="$undef";;
3101 : see if dup2 exists
3105 : see if fchmod exists
3109 : see if fchown exists
3113 : see if this is an fcntl system
3117 : see if we can have long filenames
3119 rmlist="$rmlist /tmp/cf$$"
3120 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
3121 first=123456789abcdef
3122 second=/tmp/cf$$/$first
3123 $rm -f $first $second
3124 if (echo hi >$first) 2>/dev/null; then
3125 if $test -f 123456789abcde; then
3126 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
3129 if (echo hi >$second) 2>/dev/null; then
3130 if $test -f /tmp/cf$$/123456789abcde; then
3132 That's peculiar... You can have filenames longer than 14 characters, but only
3133 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
3134 I shall consider your system cannot support long filenames at all.
3138 echo 'You can have filenames longer than 14 characters.' >&4
3143 How confusing! Some of your filesystems are sane enough to allow filenames
3144 longer than 14 characters but some others like /tmp can't even think about them.
3145 So, for now on, I shall assume your kernel does not allow them at all.
3152 You can't have filenames longer than 14 chars. You can't even think about them!
3158 $rm -rf /tmp/cf$$ 123456789abcde*
3160 : see if flock exists
3164 : see if gethostent exists
3165 set gethostent d_gethent
3168 : see if getpgrp exists
3169 set getpgrp d_getpgrp
3172 : see if getpgrp2 exists
3173 set getpgrp2 d_getpgrp2
3176 : see if getpriority exists
3177 set getpriority d_getprior
3180 : see if htonl --and friends-- exists
3186 $cat >isascii.c <<'EOCP'
3197 if $cc $cppflags -o isascii isascii.c >/dev/null 2>&1 ; then
3198 echo "isascii() found."
3201 echo "isascii() NOT found."
3207 : see if killpg exists
3211 : see if link exists
3215 : see if lstat exists
3219 : see if memcmp exists
3223 : see if memcpy exists
3227 : see if memmove exists
3228 set memmove d_memmove
3231 : see if memset exists
3235 : see if mkdir exists
3239 : see if msgctl exists
3243 : see if msgget exists
3247 : see if msgsnd exists
3251 : see if msgrcv exists
3255 : see how much of the 'msg*(2)' library is present.
3258 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
3259 *"$undef"*) h_msg=false;;
3261 : we could also check for sys/ipc.h ...
3262 if $h_msg && $test `./findhdr sys/msg.h`; then
3263 echo "You have the full msg*(2) library." >&4
3266 echo "You don't have the full msg*(2) library." >&4
3274 : see whether socket exists
3276 $echo $n "Hmm... $c" >&4
3277 if set socket val -f d_socket; eval $csym; $val; then
3278 echo "Looks like you have Berkeley networking support." >&4
3280 if set setsockopt val -f; eval $csym; $val; then
3283 echo "...but it uses the old 4.1c interface, rather than 4.2" >&4
3287 if $contains socklib libc.list >/dev/null 2>&1; then
3288 echo "Looks like you have Berkeley networking support." >&4
3290 : we will have to assume that it supports the 4.2 BSD interface
3293 echo "You don't have Berkeley networking in libc.a..." >&4
3294 if test -f /usr/lib/libnet.a; then
3295 ( (nm $nm_opt /usr/lib/libnet.a | eval $nm_extract) || \
3296 ar t /usr/lib/libnet.a) 2>/dev/null >> libc.list
3297 if $contains socket libc.list >/dev/null 2>&1; then
3298 echo "...but the Wollongong group seems to have hacked it in." >&4
3300 sockethdr="-I/usr/netinclude"
3302 if $contains setsockopt libc.list >/dev/null 2>&1; then
3305 echo "...using the old 4.1c interface, rather than 4.2" >&4
3309 echo "or even in libnet.a, which is peculiar." >&4
3314 echo "or anywhere else I see." >&4
3321 : see if socketpair exists
3322 set socketpair d_sockpair
3325 : Locate the flags for 'open()'
3327 $cat >open3.c <<'EOCP'
3328 #include <sys/types.h>
3333 #include <sys/file.h>
3344 : check sys/file.h first to get FREAD on Sun
3345 if $test `./findhdr sys/file.h` && \
3346 $cc $cppflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then
3348 echo "<sys/file.h> defines the O_* constants..." >&4
3350 echo "and you have the 3 argument form of open()." >&4
3353 echo "but not the 3 argument form of open(). Oh, well." >&4
3356 elif $test `./findhdr fcntl.h` && \
3357 $cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then
3359 echo "<fcntl.h> defines the O_* constants..." >&4
3361 echo "and you have the 3 argument form of open()." >&4
3364 echo "but not the 3 argument form of open(). Oh, well." >&4
3369 echo "I can't find the O_* constant definitions! You got problems." >&4
3375 : see if this is a pwd system
3377 xxx=`./findhdr pwd.h`
3378 if $test "$xxx"; then
3380 echo "<pwd.h> found." >&4
3381 $cppstdin $cppflags < $xxx >$$.h
3382 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
3387 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
3392 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
3393 d_pwchange="$define"
3397 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
3402 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
3403 d_pwexpire="$define"
3407 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
3408 d_pwcomment="$define"
3410 d_pwcomment="$undef"
3420 d_pwcomment="$undef"
3421 echo "<pwd.h> NOT found." >&4
3424 : see if readdir exists
3425 set readdir d_readdir
3428 : see if rename exists
3432 : see if rmdir exists
3436 : can bcopy handle overlapping blocks?
3441 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
3442 $cat >foo.c <<'EOCP'
3451 for (align = 7; align >= 0; align--) {
3452 for (len = 36; len; len--) {
3454 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", b, len);
3455 for (off = 1; off <= len; off++) {
3456 bcopy(b, b+off, len);
3457 bcopy(b+off, b, len);
3458 if (bcmp(b, "abcdefghijklmnopqrstuvwxyz0123456789", len))
3466 if $cc foo.c -o safebcpy $ccflags $libs >/dev/null 2>&1 ; then
3467 if ./safebcpy 2>/dev/null; then
3471 echo "It can't, sorry."
3474 echo "(I can't compile the test program, so we'll assume not...)"
3478 $rm -f foo.* safebcpy core
3482 : can memcpy handle overlapping blocks?
3487 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
3488 $cat >foo.c <<'EOCP'
3497 for (align = 7; align >= 0; align--) {
3498 for (len = 36; len; len--) {
3500 memcpy("abcdefghijklmnopqrstuvwxyz0123456789", b, len);
3501 for (off = 1; off <= len; off++) {
3502 memcpy(b, b+off, len);
3503 memcpy(b+off, b, len);
3504 if (memcmp(b, "abcdefghijklmnopqrstuvwxyz0123456789", len))
3512 if $cc foo.c -o safemcpy $ccflags $libs >/dev/null 2>&1 ; then
3513 if ./safemcpy 2>/dev/null; then
3517 echo "It can't, sorry."
3520 echo "(I can't compile the test program, so we'll assume not...)"
3524 $rm -f foo.* safemcpy core
3528 : see if select exists
3532 : see if semctl exists
3536 : see if semget exists
3540 : see if semop exists
3544 : see how much of the 'sem*(2)' library is present.
3547 case "$d_semctl$d_semget$d_semop" in
3548 *"$undef"*) h_sem=false;;
3550 : we could also check for sys/ipc.h ...
3551 if $h_sem && $test `./findhdr sys/sem.h`; then
3552 echo "You have the full sem*(2) library." >&4
3555 echo "You don't have the full sem*(2) library." >&4
3561 : see if setegid exists
3562 set setegid d_setegid
3565 : see if seteuid exists
3566 set seteuid d_seteuid
3569 : see if setlocale exists
3570 set setlocale d_setlocale
3572 : see if setpgid exists
3573 set setpgid d_setpgid
3576 : see if setpgrp exists
3577 set setpgrp d_setpgrp
3580 : see if setpgrp2 exists
3581 set setpgrp2 d_setpgrp2
3584 : see if setpriority exists
3585 set setpriority d_setprior
3588 : see if setregid exists
3589 set setregid d_setregid
3591 set setresgid d_setresgid
3594 : see if setreuid exists
3595 set setreuid d_setreuid
3597 set setresuid d_setresuid
3600 : see if setrgid exists
3601 set setrgid d_setrgid
3604 : see if setruid exists
3605 set setruid d_setruid
3608 : see if setsid exists
3612 : see if shmctl exists
3616 : see if shmget exists
3620 : see if shmat exists
3624 : see if shmdt exists
3628 : see how much of the 'shm*(2)' library is present.
3631 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
3632 *"$undef"*) h_shm=false;;
3634 : we could also check for sys/ipc.h ...
3635 if $h_shm && $test `./findhdr sys/shm.h`; then
3636 echo "You have the full shm*(2) library." >&4
3639 echo "You don't have the full shm*(2) library." >&4
3645 : see if stat knows about block sizes
3647 xxx=`./findhdr sys/stat.h`
3648 if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then
3649 if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then
3650 echo "Your stat() knows about block sizes." >&4
3653 echo "Your stat() doesn't know about block sizes." >&4
3657 echo "Your stat() doesn't know about block sizes." >&4
3663 : see if stdio is really std
3665 xxx=`./findhdr stdio.h`
3666 if $contains 'char.*_ptr;' "$xxx" >/dev/null 2>&1 ; then
3667 if $contains '_cnt;' "$xxx" >/dev/null 2>&1 ; then
3668 echo "Your stdio is pretty std." >&4
3671 echo "Your stdio isn't very std." >&4
3675 echo "Your stdio isn't very std." >&4
3681 : see which of string.h or strings.h is needed
3683 strings=`./findhdr string.h`
3684 if $test "$strings" && $test -r "$strings"; then
3685 echo "Using <string.h> instead of <strings.h>." >&4
3689 strings=`./findhdr strings.h`
3690 if $test "$strings" && $test -r "$strings"; then
3691 echo "Using <strings.h> instead of <string.h>." >&4
3693 echo "No string header found -- You'll surely have problems." >&4
3699 "$undef") strings=`./findhdr strings.h`;;
3700 *) strings=`./findhdr string.h`;;
3705 if set index val -f; eval $csym; $val; then
3706 if set strchr val -f d_strchr; eval $csym; $val; then
3707 if $contains strchr "$strings" >/dev/null 2>&1 ; then
3710 echo "strchr() found." >&4
3714 echo "index() found." >&4
3719 echo "index() found." >&4
3722 if set strchr val -f d_strchr; eval $csym; $val; then
3725 echo "strchr() found." >&4
3727 echo "No index() or strchr() found!" >&4
3732 set d_strchr; eval $setvar
3734 set d_index; eval $setvar
3736 : check for structure copying
3738 echo "Checking to see if your C compiler can copy structs..." >&4
3739 $cat >try.c <<'EOCP'
3749 if $cc -c try.c >/dev/null 2>&1 ; then
3754 echo "Nope, it can't."
3760 : see if strerror and/or sys_errlist[] exist
3762 if set strerror val -f d_strerror; eval $csym; $val; then
3763 echo 'strerror() found.' >&4
3764 d_strerror="$define"
3766 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
3767 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
3768 d_syserrlst="$define"
3770 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
3771 d_syserrlst="$undef"
3773 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
3774 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
3775 echo 'strerror() found in string header.' >&4
3776 d_strerror="$define"
3778 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
3779 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
3780 d_syserrlst="$define"
3782 echo "(You don't appear to have any sys_errlist[], how can this be?)"
3783 d_syserrlst="$undef"
3785 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
3786 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
3788 d_syserrlst="$define"
3791 echo 'strerror() and sys_errlist[] NOT found.' >&4
3793 d_syserrlst="$undef"
3797 : see if symlink exists
3798 set symlink d_symlink
3801 : see if syscall exists
3802 set syscall d_syscall
3805 : see if system exists
3809 : see if times exists
3811 if set times val -f d_times; eval $csym; $val; then
3812 echo 'times() found.' >&4
3814 case "$clocktype" in
3816 if $contains 'clock_t;' `./findhdr sys/types.h` >/dev/null 2>&1 ; then
3818 elif $contains 'clock_t;' `./findhdr sys/times.h` >/dev/null 2>&1; then
3824 *) dflt="$clocktype"
3828 rp="What type is returned by times() on this sytem?"
3832 echo 'times() not found, hope that will do.' >&4
3837 : see if truncate exists
3838 set truncate d_truncate
3841 : see if we have to deal with yellow pages, now NIS.
3842 if $test -d /usr/etc/yp || $test -d /etc/yp; then
3843 if $test -f /usr/etc/nibindd; then
3845 echo "I'm fairly confident you're on a NeXT."
3847 rp='Do you get the hosts file via NetInfo?'
3856 y*) hostcat='nidump hosts .';;
3857 *) hostcat='cat /etc/hosts';;
3865 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
3873 rp='Are you getting the hosts file via yellow pages?'
3876 y*) hostcat='ypcat hosts';;
3877 *) hostcat='cat /etc/hosts';;
3883 : now get the host name
3885 echo "Figuring out host name..." >&4
3886 case "$myhostname" in
3888 echo 'Maybe "hostname" will work...'
3889 if tans=`sh -c hostname 2>&1` ; then
3897 if $test "$cont"; then
3899 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
3900 if tans=`cat /etc/systemid 2>&1` ; then
3902 phostname='cat /etc/systemid'
3903 echo "Whadyaknow. Xenix always was a bit strange..."
3906 elif $test -r /etc/systemid; then
3907 echo "(What is a non-Xenix system doing with /etc/systemid?)"
3910 if $test "$cont"; then
3911 echo 'No, maybe "uuname -l" will work...'
3912 if tans=`sh -c 'uuname -l' 2>&1` ; then
3914 phostname='uuname -l'
3916 echo 'Strange. Maybe "uname -n" will work...'
3917 if tans=`sh -c 'uname -n' 2>&1` ; then
3919 phostname='uname -n'
3921 echo 'Oh well, maybe I can mine it out of whoami.h...'
3922 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
3923 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
3924 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
3926 case "$myhostname" in
3927 '') echo "Does this machine have an identity crisis or something?"
3930 echo "Well, you said $myhostname before..."
3931 phostname='echo $myhostname';;
3937 : you do not want to know about this
3941 : translate upper to lower if necessary
3942 case "$myhostname" in
3944 myhostname=`echo $myhostname | tr '[A-Z]' '[a-z]'`
3945 echo "(Normalizing case in your host name)"
3950 if $test "$myhostname" ; then
3952 rp='Your host name appears to be "'$myhostname'".'" Right?"
3960 : bad guess or no guess
3961 while $test "X$myhostname" = X ; do
3963 rp="Please type the (one word) name of your host:"
3968 : a little sanity check here
3969 case "$phostname" in
3972 case `$phostname` in
3973 $myhostname$mydomain|$myhostname) ;;
3975 case "$phostname" in
3977 echo "(That doesn't agree with your whoami.h file, by the way.)"
3980 echo "(That doesn't agree with your $phostname command, by the way.)"
3988 : see how we will look up host name
3991 : dummy stub to allow use of elif
3992 elif set uname val -f d_uname; eval $csym; $val; then
3995 uname() was found, but you're running xenix, and older versions of xenix
3996 have a broken uname(). If you don't really know whether your xenix is old
3997 enough to have a broken system call, use the default answer.
4004 rp='Is your uname() broken?'
4007 n*) d_uname="$define"; call=uname;;
4010 echo 'uname() found.' >&4
4015 case "$d_gethname" in
4016 '') d_gethname="$undef";;
4019 '') d_uname="$undef";;
4021 case "$d_phostname" in
4022 '') d_phostname="$undef";;
4025 : backward compatibility for d_hvfork
4026 if test X$d_hvfork != X; then
4030 : see if there is a vfork
4034 : see if signal is declared as pointer to function returning int or void
4036 xxx=`./findhdr signal.h`
4037 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
4038 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
4039 echo "You have int (*signal())() instead of void." >&4
4042 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
4043 echo "You have void (*signal())() instead of int." >&4
4046 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
4047 echo "You have int (*signal())() instead of void." >&4
4051 case "$d_voidsig" in
4053 echo "I can't determine whether signal handler returns void or int..." >&4
4055 rp="What type does your signal handler returns?"
4058 void) val="$define"; signal_t="void";;
4059 *) val="$undef"; signal_t="int";;
4061 *) echo "As you already told me, signal handler returns $signal_t." >&4;;
4068 : check for volatile keyword
4070 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
4071 $cat >try.c <<'EOCP'
4074 typedef struct _goo_struct goo_struct;
4075 goo_struct * volatile goo = ((goo_struct *)0);
4076 struct _goo_struct {
4081 typedef unsigned short foo_t;
4084 volatile foo_t blech;
4088 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
4090 echo "Yup, it does."
4093 echo "Nope, it doesn't."
4099 : see if there is a wait4
4103 : see if waitpid exists
4104 set waitpid d_waitpid
4107 : preserve RCS keywords in files with variable substitution, grrr
4112 Revision='$Revision'
4114 : check for alignment requirements
4116 case "$alignbytes" in
4117 '') echo "Checking alignment constraints..." >&4
4118 $cat >try.c <<'EOCP'
4125 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
4128 if $cc $ccflags try.c -o try >/dev/null 2>&1; then
4132 echo"(I can't seem to compile the test program...)"
4135 *) dflt="$alignbytes"
4138 rp="Doubles must be aligned on a how-many-byte boundary?"
4145 if test -d /afs; then
4146 echo "AFS may be running... I'll be extra cautious then..." >&4
4149 echo "AFS does not seem to be running..." >&4
4153 : determine where public executables go
4157 dflt=`./loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin`
4164 rp='Pathname where the public executables will reside?'
4171 Since you are running AFS, I need to distinguish the directory in which
4172 executables reside from the directory in which they are installed (and from
4173 which they are presumably copied to the former directory by occult means).
4176 case "$installbin" in
4177 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
4178 *) dflt="$installbin";;
4181 rp='Where will public executables be installed?'
4185 installbin="$binexp"
4188 : check for ordering of bytes in a long
4189 case "$byteorder" in
4193 In the following, larger digits indicate more significance. A big-endian
4194 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
4195 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
4196 machines may have weird orders like 3412. A Cray will report 87654321. If
4197 the test program works the default is probably right.
4198 I'm now running the test program...
4200 $cat >try.c <<'EOCP'
4207 char c[sizeof(long)];
4210 if (sizeof(long) > 4)
4211 u.l = (0x08070605L << 32) | 0x04030201L;
4214 for (i = 0; i < sizeof(long); i++)
4215 printf("%c", u.c[i]+'0');
4219 if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then
4222 ????|????????) echo "(The test program ran ok.)";;
4223 *) echo "(The test program didn't run right for some reason.)";;
4228 (I can't seem to compile the test program. Guessing big-endian...)
4237 rp="What is the order of bytes in a long?"
4242 : define an alternate in-header-list? function
4243 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4244 cont=true; xxf="echo \"<\$1> found.\" >&4";
4245 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4246 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4248 case $# in 4) instead=instead;; *) instead="at last";; esac;
4249 while $test "$cont"; do
4251 var=$2; eval "was=\$$2";
4252 if $test "$xxx" && $test -r "$xxx";
4254 eval "case \"\$$var\" in $undef) . whoa; esac"; eval "$var=\$td";
4257 eval "case \"\$$var\" in $define) . whoa; esac"; eval "$var=\$tu"; fi;
4258 set $yyy; shift; shift; yyy=$@;
4259 case $# in 0) cont="";;
4260 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4261 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4262 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4263 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4267 do set $yyy; var=$2; eval "was=\$$2";
4268 eval "case \"\$$var\" in $define) . whoa; esac"; eval "$var=\$tu";
4269 set $yyy; shift; shift; yyy=$@;
4272 : see if dlfcn is available
4276 : determine which dynamic loading, if any, to compile in
4281 'define') dflt='y' ;;
4285 'define') dflt='y' ;;
4290 rp="Do you wish to attempt to use dynamic loading?"
4294 y*) usedl='define'; dlsrc='dl.c'; dlobj='dl.o';;
4295 *) usedl='undef'; dlsrc=''; dlobj='';;
4298 case "$extensions" in
4299 ' '|'') echo "Looking for extensions..."
4303 dflt="`$find ext -type f -name \*.xs -print`"
4306 *) dflt='ext/dbm/NDBM_File.xs ext/dbm/ODBM_File.xs ext/dbm/GDBM_File.xs ext/dbm/SDBM_File.xs ext/posix/POSIX.xs'
4311 *) dflt="$extensions" ;;
4313 rp="What extensions do you wish to include?"
4317 : see what type gids are declared as in the kernel
4320 if $contains 'gid_t;' `./findhdr sys/types.h` >/dev/null 2>&1 ; then
4323 xxx=`./findhdr sys/user.h`
4324 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
4326 unsigned) dflt="$1 $2" ;;
4331 *) dflt="$gidtype";;
4334 rp="What is the type for group ids returned by getgid()?"
4337 : see if getgroups exists
4338 set getgroups d_getgrps
4341 case "$d_getgrps" in
4343 case "$groupstype" in
4344 '') dflt="$gidtype" ;;
4345 *) dflt="$groupstype" ;;
4349 What is the type of the second argument to getgroups()? Usually this
4350 is the same as group ids, "$gidtype", but not always.
4352 rp="What type is the second arguement to getgroups()?"
4356 *) groupstype="$gidtype";;
4358 : determine where private executables go
4361 dflt=/usr/lib/$package
4362 $test -d /usr/local/lib && dflt=/usr/local/lib/$package
4363 $test -d /local/lib && dflt=/local/lib/$package
4370 There are some auxiliary files for $package that need to be put into a
4371 private library directory that is accessible by everyone.
4375 rp='Pathname where private library files will reside?'
4378 privlibexp="$ansexp"
4382 Since you are running AFS, I need to distinguish the directory in which
4383 private files reside from the directory in which they are installed (and from
4384 which they are presumably copied to the former directory by occult means).
4387 case "$installprivlib" in
4388 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
4389 *) dflt="$installprivlib";;
4392 rp='Where will private files be installed?'
4394 installprivlib="$ans"
4396 installprivlib="$privlibexp"
4399 : determine where public libraries go
4401 '') dflt=`./loc . "." /usr/local/lib /usr/lib /lib`;;
4406 rp='Where do you want to put the public libraries?'
4411 : determine which malloc to compile in
4412 : Old versions had dflt='y' only for bsd or v7.
4414 case "$usemymalloc" in
4422 *) dflt="$usemymalloc"
4425 rp="Do you wish to attempt to use the malloc that comes with $package?"
4429 y*) mallocsrc='malloc.c'; mallocobj='malloc.o';;
4430 *) mallocsrc=''; mallocobj='';;
4433 : compute the type returned by malloc
4435 case "$malloctype" in
4437 if $test `./findhdr malloc.h`; then
4438 echo "#include <malloc.h>" > malloc.c
4441 $cat >>malloc.c <<'END'
4444 if $cc $ccflags -c malloc.c >/dev/null 2>&1; then
4452 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4454 : determine where manual pages go
4457 $package has manual pages available in source form.
4461 echo "However, you don't have nroff, so they're probably useless to you."
4466 echo "If you don't want the manual sources installed, answer 'none'."
4469 lookpath='/usr/local/man/man1 /usr/local/man/man1 /usr/man/manl'
4470 lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1"
4471 lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
4472 lookpath="$lookpath /usr/man/man.L"
4473 mansrc=`./loc . $lookpath`
4474 if $test -d "$mansrc"; then
4485 rp='Where do the manual pages (source) go?'
4492 Since you are running AFS, I need to distinguish the directory in which
4493 manual pages reside from the directory in which they are installed (and from
4494 which they are presumably copied to the former directory by occult means).
4497 case "$installmansrc" in
4498 '') dflt=`echo $mansrcexp | sed 's#^/afs/#/afs/.#'`;;
4499 *) dflt="$installmansrc";;
4502 rp='Where will man pages be installed?'
4504 installmansrc="$ans"
4506 installmansrc="$mansrcexp"
4522 : Cruising for prototypes
4524 echo "Checking out function prototypes..." >&4
4525 $cat >prototype.c <<'EOCP'
4526 main(int argc, char *argv[]) {
4529 if $cc -c prototype.c >prototype.out 2>&1 ; then
4530 echo "Your C compiler appears to support function prototypes."
4533 echo "Your C compiler doesn't seem to understand function prototypes."
4540 : check for size of random number generator
4544 echo "Checking to see how many bits your rand function produces..." >&4
4545 $cat >try.c <<'EOCP'
4550 register unsigned long tmp;
4551 register unsigned long max = 0L;
4553 for (i = 1000; i; i--) {
4554 tmp = (unsigned long)rand();
4555 if (tmp > max) max = tmp;
4557 for (i = 0; max; i++)
4562 if $cc try.c -o try >/dev/null 2>&1 ; then
4566 echo "(I can't seem to compile the test program...)"
4573 rp='How many bits does your rand() function produce?'
4578 : determine where public executables go
4579 case "$scriptdir" in
4582 : guess some guesses
4583 $test -d /usr/share/scripts && dflt=/usr/share/scripts
4584 $test -d /usr/share/bin && dflt=/usr/share/bin
4585 $test -d /usr/local/script && dflt=/usr/local/script
4587 *) dflt="$scriptdir"
4592 Some installations have a separate directory just for executable scripts so
4593 that they can mount it across multiple architectures but keep the scripts in
4594 one spot. You might, for example, have a subdirectory of /usr/share for this.
4595 Or you might just lump your scripts in with all your other executables.
4599 rp='Where do you keep publicly executable scripts?'
4602 scriptdirexp="$ansexp"
4606 Since you are running AFS, I need to distinguish the directory in which
4607 scripts reside from the directory in which they are installed (and from
4608 which they are presumably copied to the former directory by occult means).
4611 case "$installscript" in
4612 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
4613 *) dflt="$installscript";;
4616 rp='Where will public scripts be installed?'
4618 installscript="$ans"
4620 installscript="$scriptdirexp"
4623 : generate list of signal names
4627 echo "Generating a list of signal names..." >&4
4628 xxx=`./findhdr signal.h`" "`./findhdr sys/signal.h`
4629 set X `cat $xxx 2>&1 | $awk '
4630 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $3 ~ /^[1-9][0-9]*$/ {
4631 sig[$3] = substr($2,4,20)
4632 if (max < $3 && $3 < 60) {
4638 for (i = 1; i <= max; i++) {
4652 echo 'kill -l' >/tmp/foo$$
4653 set X `csh -f </tmp/foo$$`
4657 0)set HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM
4665 echo "The following signals are available:"
4666 echo $sig_name | tr ' ' '\012' | $sed 's/^/ SIG/'
4668 : see what type of char stdio uses.
4670 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
4671 echo "Your stdio uses unsigned chars." >&4
4672 stdchar="unsigned char"
4674 echo "Your stdio uses signed chars." >&4
4678 : see what type uids are declared as in the kernel
4681 if $contains 'uid_t;' `./findhdr sys/types.h` >/dev/null 2>&1 ; then
4684 xxx=`./findhdr sys/user.h`
4685 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
4687 unsigned) dflt="$1 $2" ;;
4692 *) dflt="$uidtype";;
4695 rp="What type are user ids on this system declared as?"
4699 : check for void type
4702 Checking to see how well your C compiler groks the void type...
4704 Support flag bits are:
4705 1: basic void declarations.
4706 2: arrays of pointers to functions returning void.
4707 4: operations between pointers to and addresses of void functions.
4708 8: generic void pointers.
4711 case "$voidflags" in
4713 $cat >try.c <<'EOCP'
4719 extern void moo(); /* function returning void */
4720 void (*goo)(); /* ptr to func returning void */
4722 void *hue; /* generic ptr */
4736 if $cc -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4737 voidflags=$defvoidused
4738 echo "It appears to support void to the level $package wants ($defvoidused)."
4739 if $contains warning .out >/dev/null 2>&1; then
4740 echo "However, you might get some warnings that look like this:"
4744 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4745 if $cc -c -DTRY=1 try.c >/dev/null 2>&1 ; then
4746 echo "It supports 1..."
4747 if $cc -c -DTRY=3 try.c >/dev/null 2>&1 ; then
4748 echo "It also supports 2..."
4749 if $cc -c -DTRY=7 try.c >/dev/null 2>&1 ; then
4751 echo "And it supports 4 but not 8 definitely."
4753 echo "It doesn't support 4..."
4754 if $cc -c -DTRY=11 try.c >/dev/null 2>&1 ; then
4756 echo "But it supports 8."
4759 echo "Neither does it support 8."
4763 echo "It does not support 2..."
4764 if $cc -c -DTRY=13 try.c >/dev/null 2>&1 ; then
4766 echo "But it supports 4 and 8."
4768 if $cc -c -DTRY=5 try.c >/dev/null 2>&1 ; then
4770 echo "And it supports 4 but has not heard about 8."
4772 echo "However it supports 8 but not 4."
4777 echo "There is no support at all for void."
4783 rp="Your void support flags add up to what?"
4788 : determine compiler compiler
4797 if $test -f "$byacc"; then
4801 if $test -f "$bison"; then
4802 rp="$rp or bison -y"
4805 $package no longer requires a compiler compiler, so the following is
4808 rp="Which compiler compiler ($rp) shall I use?"
4817 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
4823 : see if we have the old dbm
4827 : see if this is a sys/file.h system
4832 : do we need to #include <sys/file.h> ?
4838 echo "We'll be including <sys/file.h>." >&4
4841 echo "We won't be including <sys/file.h>." >&4
4851 : see if fcntl.h is there
4856 : see if we can include fcntl.h
4862 echo "We'll be including <fcntl.h>." >&4
4866 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
4868 echo "We won't be including <fcntl.h>." >&4
4880 : see if gdbm.h is available
4884 : see if this is an grp system
4888 : see if ndbm.h is available
4892 : see if there are directory access routines out there
4894 if $test `./findhdr ndir.h` && \
4895 ( $test -r /usr/lib/libndir.a || $test -r /usr/local/lib/libndir.a ); then
4896 echo "Ndir library found." >&4
4897 if $test -r /usr/lib/libndir.a; then
4900 ndirlib="/usr/local/lib/libndir.a"
4909 if set readdir val -f; eval $csym; $val; then
4910 echo "No ndir library found, but you have readdir() so we'll use that." >&4
4915 echo "No ndir library found--using ./ndir.c." >&4
4922 : see if this is a netinet/in.h or sys/in.h system
4923 set netinet/in.h i_niin sys/in.h i_sysin
4926 : see if stdarg is available
4927 set stdarg.h i_stdarg
4930 : see if stddef is available
4931 set stddef.h i_stddef
4934 : see if this is an sysdir system
4935 set sys/dir.h i_sysdir
4938 : get C preprocessor symbols handy
4940 echo $attrlist | $tr ' ' '\012' >Cppsym.know
4952 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
4954 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
4957 unknown="\$unknown \$sym"
4967 echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
4969 exit 0; _ _ _ _\1\\ \1\\
4972 echo "exit 1; _ _ _" >>Cppsym\$\$
4973 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
4975 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
4981 $rm -f Cppsym\$\$ Cppsym2\$\$
4986 echo "Your C preprocessor defines the following symbols:"
4987 Cppsym -l $attrlist >Cppsym.true
4990 : see if this is a termio system
4994 if $test `./findhdr termios.h`; then
4995 set tcsetattr i_termios
5001 "$define") echo "You have POSIX termios.h... good!" >&4;;
5002 *) if Cppsym pyr; then
5003 case "`/bin/universe`" in
5004 ucb) if $test `./findhdr sgtty.h`; then
5006 echo "<sgtty.h> found." >&4
5008 echo "System is pyramid with BSD universe."
5009 echo "<sgtty.h> not found--you could have problems." >&4
5011 *) if $test `./findhdr termio.h`; then
5013 echo "<termio.h> found." >&4
5015 echo "System is pyramid with USG universe."
5016 echo "<termio.h> not found--you could have problems." >&4
5020 if $test `./findhdr termio.h`; then
5021 echo "<termio.h> found." >&4
5023 elif $test `./findhdr sgtty.h`; then
5024 echo "<sgtty.h> found." >&4
5027 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
5030 if $test `./findhdr sgtty.h`; then
5031 echo "<sgtty.h> found." >&4
5033 elif $test `./findhdr termio.h`; then
5034 echo "<termio.h> found." >&4
5037 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
5041 set i_termio; eval $setvar
5042 val=$val2; set i_sgtty; eval $setvar
5043 val=$val3; set i_termios; eval $setvar
5045 : see if ioctl defs are in sgtty/termio or sys/ioctl
5047 if $test `./findhdr sys/ioctl.h`; then
5049 echo "<sys/ioctl.h> found." >&4
5052 $test $i_termio = "$define" && xxx="termio.h"
5053 $test $i_termios = "$define" && xxx="termios.h"
5054 $test $i_sgtty = "$define" && xxx="sgtty.h"
5055 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
5060 : see if this is an sysndir system
5061 set sys/ndir.h i_sysndir
5064 : see if sys/select.h has to be included
5065 set sys/select.h i_sysselct
5068 : see if we should include time.h, sys/time.h, or both
5070 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
5071 $echo $n "I'm now running the test program...$c"
5072 $cat >try.c <<'EOCP'
5073 #include <sys/types.h>
5078 #ifdef SYSTIMEKERNEL
5081 #include <sys/time.h>
5084 #include <sys/select.h>
5093 struct timezone tzp;
5095 if (foo.tm_sec == foo.tm_sec)
5098 if (bar.tv_sec == bar.tv_sec)
5107 for s_timeval in '-DS_TIMEVAL' ''; do
5108 for i_systimek in '' '-DSYSTIMEKERNEL'; do
5109 for i_time in '' '-DI_TIME'; do
5110 for i_systime in '-DI_SYSTIME' ''; do
5114 $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \
5115 try.c -o try >/dev/null 2>&1 ; then
5116 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
5120 $echo $n "Succeeded with $flags$c"
5131 *SYSTIMEKERNEL*) i_systimek="$define"
5132 timeincl=`./findhdr sys/time.h`
5133 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
5134 *) i_systimek="$undef";;
5137 *I_TIME*) i_time="$define"
5138 timeincl=`./findhdr time.h`" $timeincl"
5139 echo "We'll include <time.h>." >&4;;
5140 *) i_time="$undef";;
5143 *I_SYSTIME*) i_systime="$define"
5144 timeincl=`./findhdr sys/time.h`" $timeincl"
5145 echo "We'll include <sys/time.h>." >&4;;
5146 *) i_systime="$undef";;
5150 : see if this is an utime system
5154 : see if this is a varargs system
5156 if $test `./findhdr varargs.h`; then
5158 echo "<varargs.h> found." >&4
5161 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
5166 : set up the varargs testing programs
5167 $cat > varargs.c <<EOP
5172 #include <varargs.h>
5190 p = va_arg(ap, char *);
5195 $cat > varargs <<EOP
5196 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
5205 : now check which varargs header should be included
5210 if `./varargs I_STDARG`; then
5213 elif `./varargs I_VARARGS`; then
5214 i_varhdr='varargs.h'
5219 if `./varargs I_VARARGS`; then
5220 i_varhdr='varargs.h'
5226 echo "I could not find the definition for va_dcl... You have problems..." >&4
5228 *) echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
5232 : see if this is a vfork system
5236 : end of configuration questions
5238 echo "End of configuration questions."
5241 : back to where it started
5242 if test -d ../UU; then
5246 : configuration may be patched via a 'config.over' file
5247 if $test -f config.over; then
5250 rp='I see a config.over file. Do you wish to load it?'
5253 n*) echo "OK, I'll ignore it.";;
5255 echo "Configuration override changes have been loaded."
5260 : create config.sh file
5262 echo "Creating config.sh..." >&4
5263 $spitshell <<EOT >config.sh
5266 # This file was produced by running the Configure script. It holds all the
5267 # definitions figured out by Configure. Should you modify one of these values,
5268 # do not forget to propagate your changes by running "Configure -der". You may
5269 # instead choose to run each of the .SH files by yourself, or "Configure -S".
5272 # Configuration time: $cf_time
5273 # Configured by: $cf_by
5274 # Target system: $myuname
5276 extensions='$extensions'
5278 d_eunice='$d_eunice'
5280 eunicefix='$eunicefix'
5290 compress='$compress'
5327 sendmail='$sendmail'
5355 Revision='$Revision'
5359 alignbytes='$alignbytes'
5362 installbin='$installbin'
5363 byteorder='$byteorder'
5365 gccversion='$gccversion'
5367 cppflags='$cppflags'
5370 optimize='$optimize'
5373 contains='$contains'
5375 cppminus='$cppminus'
5377 cppstdin='$cppstdin'
5378 d_access='$d_access'
5382 d_casti32='$d_casti32'
5383 castflags='$castflags'
5384 d_castneg='$d_castneg'
5385 d_charsprf='$d_charsprf'
5386 d_chsize='$d_chsize'
5388 cryptlib='$cryptlib'
5391 d_dosuid='$d_dosuid'
5393 d_fchmod='$d_fchmod'
5394 d_fchown='$d_fchown'
5396 d_flexfnam='$d_flexfnam'
5398 d_getgrps='$d_getgrps'
5399 d_gethent='$d_gethent'
5400 aphostname='$aphostname'
5401 d_gethname='$d_gethname'
5402 d_phostname='$d_phostname'
5404 d_getpgrp2='$d_getpgrp2'
5405 d_getpgrp='$d_getpgrp'
5406 d_getprior='$d_getprior'
5408 d_isascii='$d_isascii'
5409 d_killpg='$d_killpg'
5412 d_memcmp='$d_memcmp'
5413 d_memcpy='$d_memcpy'
5414 d_memmove='$d_memmove'
5415 d_memset='$d_memset'
5418 d_msgctl='$d_msgctl'
5419 d_msgget='$d_msgget'
5420 d_msgrcv='$d_msgrcv'
5421 d_msgsnd='$d_msgsnd'
5423 d_portable='$d_portable'
5424 d_readdir='$d_readdir'
5425 d_rename='$d_rename'
5427 d_safebcpy='$d_safebcpy'
5428 d_safemcpy='$d_safemcpy'
5429 d_select='$d_select'
5431 d_semctl='$d_semctl'
5432 d_semget='$d_semget'
5434 d_setegid='$d_setegid'
5435 d_seteuid='$d_seteuid'
5436 d_setlocale='$d_setlocale'
5437 d_setpgid='$d_setpgid'
5438 d_setpgrp2='$d_setpgrp2'
5439 d_bsdpgrp='$d_bsdpgrp'
5440 d_setpgrp='$d_setpgrp'
5441 d_setprior='$d_setprior'
5442 d_setregid='$d_setregid'
5443 d_setresgid='$d_setresgid'
5444 d_setresuid='$d_setresuid'
5445 d_setreuid='$d_setreuid'
5446 d_setrgid='$d_setrgid'
5447 d_setruid='$d_setruid'
5448 d_setsid='$d_setsid'
5451 d_shmctl='$d_shmctl'
5453 d_shmget='$d_shmget'
5454 d_oldsock='$d_oldsock'
5455 d_socket='$d_socket'
5456 d_sockpair='$d_sockpair'
5457 sockethdr='$sockethdr'
5458 socketlib='$socketlib'
5459 d_statblks='$d_statblks'
5460 d_stdstdio='$d_stdstdio'
5462 d_strchr='$d_strchr'
5463 d_strctcpy='$d_strctcpy'
5464 d_strerrm='$d_strerrm'
5465 d_strerror='$d_strerror'
5466 d_sysernlst='$d_sysernlst'
5467 d_syserrlst='$d_syserrlst'
5468 d_symlink='$d_symlink'
5469 d_syscall='$d_syscall'
5470 d_system='$d_system'
5471 clocktype='$clocktype'
5473 d_truncate='$d_truncate'
5474 d_usendir='$d_usendir'
5480 d_voidsig='$d_voidsig'
5481 signal_t='$signal_t'
5482 d_volatile='$d_volatile'
5483 d_charvspr='$d_charvspr'
5484 d_vprintf='$d_vprintf'
5486 d_waitpid='$d_waitpid'
5491 groupstype='$groupstype'
5493 h_sysfile='$h_sysfile'
5495 d_dirnamlen='$d_dirnamlen'
5496 i_dirent='$i_dirent'
5505 d_pwchange='$d_pwchange'
5506 d_pwclass='$d_pwclass'
5507 d_pwcomment='$d_pwcomment'
5508 d_pwexpire='$d_pwexpire'
5509 d_pwquota='$d_pwquota'
5511 i_stdarg='$i_stdarg'
5512 i_stddef='$i_stddef'
5513 i_string='$i_string'
5515 i_sysdir='$i_sysdir'
5516 i_sysfile='$i_sysfile'
5517 d_voidtty='$d_voidtty'
5518 i_bsdioctl='$i_bsdioctl'
5519 i_sysioctl='$i_sysioctl'
5520 i_syssockio='$i_syssockio'
5521 i_sysndir='$i_sysndir'
5522 i_sysselct='$i_sysselct'
5524 i_termio='$i_termio'
5525 i_termios='$i_termios'
5526 i_systime='$i_systime'
5527 i_systimek='$i_systimek'
5529 timeincl='$timeincl'
5531 i_varargs='$i_varargs'
5532 i_varhdr='$i_varhdr'
5542 mallocobj='$mallocobj'
5543 mallocsrc='$mallocsrc'
5544 malloctype='$malloctype'
5545 usemymalloc='$usemymalloc'
5546 installmansrc='$installmansrc'
5549 mansrcexp='$mansrcexp'
5556 mydomain='$mydomain'
5557 myhostname='$myhostname'
5558 phostname='$phostname'
5561 groupcat='$groupcat'
5565 spackage='$spackage'
5566 installprivlib='$installprivlib'
5568 privlibexp='$privlibexp'
5569 prototype='$prototype'
5570 randbits='$randbits'
5571 installscript='$installscript'
5572 scriptdir='$scriptdir'
5573 scriptdirexp='$scriptdirexp'
5574 sig_name='$sig_name'
5575 sharpbang='$sharpbang'
5577 spitshell='$spitshell'
5587 mips_type='$mips_type'
5589 defvoidused='$defvoidused'
5590 voidflags='$voidflags'
5592 yaccflags='$yaccflags'
5595 : add special variables
5596 $test -f patchlevel.h && \
5597 awk '/^#define/ {printf "%s=%s\n",$2,$3}' patchlevel.h >>config.sh
5598 echo "CONFIG=true" >>config.sh
5600 : propagate old symbols
5601 if $test -f UU/config.sh; then
5602 <UU/config.sh sort | uniq >UU/oldconfig.sh
5603 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
5604 sort | uniq -u >UU/oldsyms
5605 set X `cat UU/oldsyms`
5611 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
5613 echo "# Variables propagated from previous config.sh file." >>config.sh
5614 for sym in `cat UU/oldsyms`; do
5615 echo " Propagating $hint variable "'$'"$sym..."
5616 eval 'tmp="$'"${sym}"'"'
5618 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
5624 : Finish up by extracting the .SH files
5637 echo "If you didn't make any mistakes, then just type a carriage return here."
5638 rp="If you need to edit config.sh, do it as a shell escape here:"
5643 *) : in case they cannot read
5649 : if this fails, just run all the .SH files by hand
5656 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
5663 Now you need to generate make dependencies by running "make depend".
5664 You might prefer to run it in background: "make depend > makedepend.out &"
5665 It can take a while, so you might not want to run it right now.
5670 rp="Run make depend now?"
5674 make depend && echo "Now you must run a make."
5677 echo "You must run 'make depend' then 'make'."
5680 elif test -f [Mm]akefile; then
5682 echo "Now you must run a make."
5687 $rm -f kit*isdone ark*isdone