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.7 1995/03/21 08:46:15 ram Exp $
23 # Generated on Tue Jun 6 12:25:20 EDT 1995 [metaconfig 3.0 PL55]
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`
60 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
61 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
62 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
63 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
64 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
65 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
66 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
67 paths="$paths /sbin /usr/sbin /usr/libexec"
73 *) test -d $p && PATH=$PATH:$p ;;
82 echo "Say 'sh $me', not 'sh <$me'"
86 : On HP-UX, large Configure scripts may exercise a bug in /bin/sh
87 if test -f /hp-ux -a -f /bin/ksh; then
88 if (PATH=.; alias -x) >/dev/null 2>&1; then
89 : already under /bin/ksh
92 (Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.)
98 : Warn them if they use ksh on other systems
99 (PATH=.; alias -x) >/dev/null 2>&1 && \
101 (I see you are using the Korn shell. Some ksh's blow up on $me,
102 especially on exotic machines. If yours does, try the Bourne shell instead.)
106 : Configure runs within the UU subdirectory
107 test -d UU || mkdir UU
547 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
550 : We must find out about Eunice early
552 if test -f /etc/unixtovms; then
553 eunicefix=/etc/unixtovms
555 if test -f /etc/unixtovms.exe; then
556 eunicefix=/etc/unixtovms.exe
559 : list of known cpp symbols, sorted alphabetically
560 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
561 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
562 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
563 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
564 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
565 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
566 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
567 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
568 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
569 al="$al VMS Xenix286"
570 al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI"
571 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
572 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
573 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
574 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
575 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
576 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
577 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
578 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
579 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
580 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
581 al="$al __SVR4_2__ __UMAXV__"
582 al="$al ____386BSD____ __alpha __alpha__ __amiga"
583 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
584 al="$al __host_mips__"
585 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
586 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
587 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
588 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
589 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
590 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
591 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
592 al="$al __mc88100 __mc88100__ __mips __mips__"
593 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
594 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
595 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
596 al="$al _host_mips _mips _unix"
597 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
598 al="$al apollo ardent att386 att3b"
599 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
600 al="$al cadmus clipper concurrent convex cray ctix"
601 al="$al dmert encore gcos gcx gimpel gould"
602 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
603 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
604 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
605 al="$al i186 i286 i386 i486 i8086"
606 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
607 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
608 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
609 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
610 al="$al mc88000 mc88100 merlin mert mips mvs n16"
611 al="$al ncl_el ncl_mr"
612 al="$al news1500 news1700 news1800 news1900 news3700"
613 al="$al news700 news800 news900 ns16000 ns32000"
614 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
615 al="$al parisc pc532 pdp11 plexus posix pyr"
616 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
617 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
618 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
619 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
620 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
621 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
626 : change the next line if compiling for Xenix/286 on Xenix/386
627 xlibpth='/usr/lib/386 /lib/386'
629 : general looking path for locating libraries
630 glibpth="/lib/pa1.1 /usr/lib/large /lib /usr/lib $xlibpth"
631 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
632 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib /usr/shlib"
634 : Private path used by Configure to find libraries. Its value
635 : is prepended to libpth. This variable takes care of special
636 : machines, like the mips. Usually, it should be empty.
639 : default library list
641 : full support for void wanted by default
644 : set useposix=false in your hint file to disable the POSIX extension.
646 : no include file wanted by default
649 : List of libraries we want.
650 libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl'
651 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
652 libswanted="$libswanted ucb bsd BSD PW x"
653 : We probably want to search /usr/shlib before most other libraries.
654 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
655 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
656 glibpth="/usr/shlib $glibpth"
657 : Do not use vfork unless overridden by a hint file.
659 : We might as well always be portable. It makes no difference for
660 : perl5, and makes people happy.
663 : script used to extract .SH files with variable substitutions
666 echo "Doing variable substitutions on .SH files..."
667 if test -f MANIFEST; then
668 shlist=`awk '{print $1}' <MANIFEST | grep '\.SH'`
669 : Pick up possible extension manifests.
670 for dir in ext/* ; do
671 if test -f $dir/MANIFEST; then
672 xxx=`awk '{print $1}' < $dir/MANIFEST |
673 sed -n "/\.SH$/ s@^@$dir/@p"`
674 shlist="$shlist $xxx"
679 echo "(Looking for .SH files under the current directory.)"
680 set x `find . -name "*.SH" -print`
684 0) set x *.SH; shift;;
686 if test ! -f $1; then
692 dir=`expr X$file : 'X\(.*\)/'`
693 file=`expr X$file : 'X.*/\(.*\)'`
694 (cd $dir && . ./$file)
701 if test -f config_h.SH; then
702 if test ! -f config.h; then
703 : oops, they left it out of MANIFEST, probably, so do it anyway.
709 : produce awk script to parse command line options
710 cat >options.awk <<'EOF'
712 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
714 len = length(optstr);
715 for (i = 1; i <= len; i++) {
716 c = substr(optstr, i, 1);
717 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
728 if (substr(str, 1, 1) != "-") {
729 printf("'%s'\n", str);
733 for (i = 2; i <= len; i++) {
734 c = substr(str, i, 1);
736 printf("-%s\n", substr(str, i));
742 printf("'%s'\n", substr(str, i + 1));
755 : process the command line options
756 set X `for arg in "$@"; do echo $arg; done | awk -f options.awk`
761 : set up default values
774 while test $# -gt 0; do
776 -d) shift; fastread=yes;;
777 -e) shift; alldone=cont;;
781 if test -r "$1"; then
784 echo "$me: cannot read config file $1." >&2
789 -h) shift; error=true;;
790 -r) shift; reuseval=true;;
791 -s) shift; silent=true;;
792 -E) shift; alldone=exit;;
793 -K) shift; knowitall=true;;
794 -O) shift; override=true;;
795 -S) shift; extractsh=true;;
800 echo "$me: use '-U symbol=', not '-D symbol='." >&2
801 echo "$me: ignoring -D $1" >&2
804 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
805 *) echo "$1='define'" >> optdef.sh;;
812 *=) echo "$1" >> optdef.sh;;
814 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
815 echo "$me: ignoring -U $1" >&2
817 *) echo "$1='undef'" >> optdef.sh;;
821 -V) echo "$me generated by metaconfig 3.0 PL55." >&2
824 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
832 Usage: $me [-dehrEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
833 [-U symbol] [-U symbol=]
834 -d : use defaults for all answers.
835 -e : go on without questioning past the production of config.sh.
836 -f : specify an alternate default configuration file.
837 -h : print this help message and exit (with an error status).
838 -r : reuse C symbols value if possible (skips costly nm extraction).
839 -s : silent mode, only echoes questions and essential information.
840 -D : define symbol to have some value:
841 -D symbol symbol gets the value 'define'
842 -D symbol=value symbol gets the value 'value'
843 -E : stop at the end of questions, after having produced config.sh.
844 -K : do not use unless you know what you are doing.
845 -O : let -D and -U override definitions from loaded configuration file.
846 -S : perform variable substitutions on all .SH files (can mix with -f)
847 -U : undefine symbol:
848 -U symbol symbol gets the value 'undef'
849 -U symbol= symbol gets completely empty
850 -V : print version number and exit (with a zero status).
858 true) exec 1>/dev/null;;
861 : run the defines and the undefines, if any, but leave the file out there...
868 '') config_sh='config.sh'; config='./config.sh';;
869 /*) config="$config_sh";;
870 *) config="./$config_sh";;
873 echo "Fetching answers from $config_sh..."
876 test "$override" && . ./optdef.sh
887 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
888 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
889 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
890 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
891 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
894 : Eunice requires " " instead of "", can you believe it
897 echo "Beginning of configuration questions for $package."
899 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
901 : Some greps do not return status, grrr.
902 echo "grimblepritz" >grimble
903 if grep blurfldyick grimble >/dev/null 2>&1 ; then
905 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
911 : the following should work in any shell
915 echo "AGH! Grep doesn't return a status. Attempting remedial action."
916 cat >contains <<'EOSS'
917 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
922 : first determine how to suppress newline on echo command
924 echo "Checking echo to see how to suppress newlines..."
925 (echo "hi there\c" ; echo " ") >.echotmp
926 if $contains c .echotmp >/dev/null 2>&1 ; then
937 echo $n "The star should be here-->$c"
941 : Now test for existence of everything in MANIFEST
943 if test -f ../MANIFEST; then
944 echo "First let's make sure your kit is complete. Checking..." >&4
945 awk '$1 !~ /PACK[A-Z]+/ {print $1}' ../MANIFEST | split -50
947 for filelist in x??; do
948 (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing)
950 if test -s missing; then
954 THIS PACKAGE SEEMS TO BE INCOMPLETE.
956 You have the option of continuing the configuration process, despite the
957 distinct possibility that your kit is damaged, by typing 'y'es. If you
958 do, don't blame me if something goes wrong. I advise you to type 'n'o
959 and contact the author (lwall@netlabs.com).
962 echo $n "Continue? [n] $c" >&4
966 echo "Continuing..." >&4
970 echo "ABORTING..." >&4
975 echo "Looks good..." >&4
978 echo "There is no MANIFEST file. I hope your kit is complete !"
982 : compute the number of columns on the terminal for proper question formatting
987 : set up the echo used in my read
988 myecho="case \"\$xxxm\" in
989 '') echo $n \"\$rp $c\" >&4;;
991 '') echo $n \"[\$xxxm] $c\";;
993 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
995 echo $n \"[\$xxxm] $c\" >&4
997 echo $n \"\$rp [\$xxxm] $c\" >&4
1003 : now set up to do reads with possible shell escape and default assignment
1008 case "\$fastread" in
1009 yes) case "\$dflt" in
1012 case "\$silent-\$rp" in
1017 *) case "\$silent" in
1018 true) case "\$rp" in
1023 while expr "X\$ans" : "X!" >/dev/null; do
1027 aok=''; eval "ans=\"\$answ\"" && aok=y
1032 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1037 echo "(OK, I'll run with -d after this question.)"
1040 echo "*** Sorry, \$1 not supported yet."
1052 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1062 echo "*** Substitution done -- please confirm."
1064 ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
1069 echo "*** Error -- try again."
1076 case "\$ans\$xxxm\$nostick" in
1088 : create .config dir to save info across Configure sessions
1089 test -d ../.config || mkdir ../.config
1090 cat >../.config/README <<EOF
1091 This directory created by Configure to save information that should
1092 persist across sessions.
1094 You may safely delete it if you wish.
1097 : general instructions
1100 user=`( (logname) 2>/dev/null || whoami) 2>&1`
1101 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1104 rp='Would you like to see the instructions?'
1115 This installation shell script will examine your system and ask you questions
1116 to determine how the perl5 package should be installed. If you get
1117 stuck on a question, you may use a ! shell escape to start a subshell or
1118 execute a command. Many of the questions will have default answers in square
1119 brackets; typing carriage return will give you the default.
1121 On some of the questions which ask for file or directory names you are allowed
1122 to use the ~name construct to specify the login directory belonging to "name",
1123 even if you don't have a shell which knows about that. Questions where this is
1124 allowed will be marked "(~name ok)".
1128 dflt='Type carriage return to continue'
1132 The prompter used in this script allows you to use shell variables and
1133 backticks in your answers. You may use $1, $2, etc... to refer to the words
1134 in the default answer, as if the default line was a set of arguments given to a
1135 script shell. This means you may also use $* to repeat the whole default line,
1136 so you do not have to re-type everything to add something to the default.
1138 Everytime there is a substitution, you will have to confirm. If there is an
1139 error (e.g. an unmatched backtick), the default answer will remain unchanged
1140 and you will be prompted again.
1142 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1143 the questions and use the computed defaults (or the previous answers if there
1144 was already a config.sh file). Type 'Configure -h' for a list of options.
1145 You may also start interactively and then answer '& -d' at any prompt to turn
1146 on the non-interactive behaviour for the remaining of the execution.
1152 Much effort has been expended to ensure that this shell script will run on any
1153 Unix system. If despite that it blows up on yours, your best bet is to edit
1154 Configure and run it again. If you can't run Configure for some reason,
1155 you'll have to generate a config.sh file by hand. Whatever problems you
1156 have, let me (lwall@netlabs.com) know how I blew it.
1158 This installation script affects things in two ways:
1160 1) it may do direct variable substitutions on some of the files included
1162 2) it builds a config.h file for inclusion in C programs. You may edit
1163 any of these files as the need arises after running this script.
1165 If you make a mistake on a question, there is no easy way to back up to it
1166 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1167 files. Configure will offer to let you do this before it runs the SH files.
1170 dflt='Type carriage return to continue'
1172 case "$firsttime" in
1173 true) echo $user >>../.config/instruct;;
1177 : see if sh knows # comments
1179 echo "Checking your sh to see if it knows about # comments..." >&4
1180 if `sh -c '#' >/dev/null 2>&1`; then
1181 echo "Your sh handles # comments correctly."
1185 echo "Okay, let's see if #! works on this system..."
1187 test -f $xcat || xcat=/usr/bin/cat
1192 if test -s today; then
1196 echo "#! $xcat" > try
1200 if test -s today; then
1204 echo "It's just a comment."
1209 echo "Your sh doesn't grok # comments--I will strip them later on."
1212 echo "exec grep -v '^[ ]*#'" >spitshell
1214 $eunicefix spitshell
1215 spitshell=`pwd`/spitshell
1217 echo "I presume that if # doesn't work, #! won't work either!"
1222 : figure out how to guarantee sh startup
1224 echo "Checking out how to guarantee sh startup..." >&4
1226 *bsd*|sys5*) startsh=$sharpbang"/$SYSTYPE/bin/sh";;
1227 *) startsh=$sharpbang'/bin/sh';;
1229 echo "Let's see if '$startsh' works..."
1239 echo "Yup, it does."
1241 echo "Nope. You may have to fix up the shell scripts to make sure sh runs them."
1245 : find out where common programs are
1247 echo "Locating common programs..." >&4
1260 if test -d \$dir/\$thing; then
1266 for thisthing in \$dir/\$thing; do
1267 : just loop through to pick last item
1269 if test -f \$thisthing; then
1272 elif test -f \$dir/\$thing.exe; then
1273 : on Eunice apparently
1317 pth=`echo $PATH | sed -e 's/:/ /g'`
1318 pth="$pth /lib /usr/lib"
1319 for file in $loclist; do
1320 xxx=`./loc $file $file $pth`
1325 echo $file is in $xxx.
1328 echo "I don't know where $file is. I hope it's in everyone's PATH."
1333 echo "Don't worry if any of the following aren't found..."
1335 for file in $trylist; do
1336 xxx=`./loc $file $file $pth`
1341 echo $file is in $xxx.
1344 echo "I don't see $file out there, $say."
1351 echo "Substituting grep for egrep."
1357 echo "Hopefully test is built into your sh."
1360 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1361 echo "Using the test built into your sh."
1369 echo "Hopefully echo is built into your sh."
1374 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1375 $echo $n "hi there$c" >foo1
1376 echo $n "hi there$c" >foo2
1377 if cmp foo1 foo2 >/dev/null 2>&1; then
1378 echo "They are compatible. In fact, they may be identical."
1385 They are not compatible! You are probably running ksh on a non-USG system.
1386 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1387 have echo built in and we may have to run some Bourne shell scripts. That
1388 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1391 $echo $n "The star should be here-->$c"
1398 : determine whether symbolic links are supported
1401 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1402 echo "Symbolic links are supported." >&4
1405 echo "Symbolic links are NOT supported." >&4
1410 : see whether [:lower:] and [:upper:] are supported character classes
1414 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1416 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1421 echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4
1424 : set up the translation script tr, must be called with ./tr of course
1428 '[A-Z][a-z]') exec $tr '$up' '$low';;
1429 '[a-z][A-Z]') exec $tr '$low' '$up';;
1436 : Try to determine whether config.sh was made on this system
1437 case "$config_sh" in
1439 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1440 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1441 ./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
1442 newmyuname="$myuname"
1444 case "$knowitall" in
1446 if test -f ../config.sh; then
1447 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1448 eval "`grep myuname= ../config.sh`"
1450 if test "X$myuname" = "X$newmyuname"; then
1458 : Get old answers from old config file if Configure was run on the
1459 : same system, otherwise use the hints.
1462 if test -f config.sh; then
1464 rp="I see a config.sh file. Shall I use it to set the defaults?"
1467 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1468 *) echo "Fetching default answers from your old config.sh file..." >&4
1479 if test ! -f config.sh; then
1482 First time through, eh? I have some defaults handy for the following systems:
1485 cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4
1487 : Half the following guesses are probably wrong... If you have better
1488 : tests or hints, please send them to lwall@netlabs.com
1489 : The metaconfig authors would also appreciate a copy...
1490 $test -f /irix && osname=irix
1491 $test -f /xenix && osname=sco_xenix
1492 $test -f /dynix && osname=dynix
1493 $test -f /dnix && osname=dnix
1494 $test -f /unicos && osname=unicos && osvers=`$uname -r`
1495 $test -f /bin/mips && /bin/mips && osname=mips
1496 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1497 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1498 $test -d /usr/apollo/bin && osname=apollo
1499 $test -f /etc/saf/_sactab && osname=svr4
1500 $test -d /usr/include/minix && osname=minix
1501 $test -d /MachTen && osname=machten && \
1502 osvers=`/usr/etc/version | $awk '{print $2}' | \
1503 $sed -e 's/[A-Za-z]$//'`
1504 if $test -f $uname; then
1512 umips) osname=umips ;;
1515 [23]100) osname=mips ;;
1516 next*) osname=next ;;
1517 news*) osname=news ;;
1519 if $test -f /etc/kconfig; then
1521 if test "$lns" = "ln -s"; then
1523 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1525 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
1534 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
1536 'not found') osvers="$4"."$3" ;;
1537 '<3240'|'<>3240') osvers=3.2.0 ;;
1538 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
1539 '=3250'|'>3250') osvers=3.2.5 ;;
1546 domainos) osname=apollo
1552 freebsd) osname=freebsd
1554 genix) osname=genix ;;
1559 *.10.*) osvers=10 ;;
1576 netbsd*) osname=netbsd
1579 bsd386) osname=bsd386
1582 next*) osname=next ;;
1583 solaris) osname=solaris
1585 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1592 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1596 titanos) osname=titanos
1605 ultrix) osname=ultrix
1611 osvers=`echo "$3" | sed 's/^[vt]//'`
1613 hp*) osname=hp_osf1 ;;
1614 mips) osname=mips_osf1 ;;
1620 $2) case "$osname" in
1624 : svr4.x or possibly later
1634 if test -f /stand/boot ; then
1635 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
1636 if test -n "$INITPROG" -a -f "$INITPROG"; then
1637 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
1638 if test -n "$isesix"; then
1646 *) if test -f /etc/systemid; then
1648 set `echo $3 | $sed 's/\./ /g'` $4
1649 if $test -f sco_$1_$2_$3.sh; then
1651 elif $test -f sco_$1_$2.sh; then
1653 elif $test -f sco_$1.sh; then
1658 '') : Still unknown. Probably a generic Sys V.
1667 *) case "$osname" in
1668 '') : Still unknown. Probably a generic BSD.
1676 if test -f /vmunix -a -f news_os.sh; then
1677 (what /vmunix | ../UU/tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1
1678 if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then
1681 $rm -f ../UU/kernel.what
1685 : Now look for a hint file osname_osvers, unless one has been
1686 : specified already.
1689 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
1690 : Also try without trailing minor version numbers.
1691 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
1692 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
1693 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
1694 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
1697 *) case "$osvers" in
1700 *) if $test -f $file.sh ; then
1702 elif $test -f $xfile.sh ; then
1704 elif $test -f $xxfile.sh ; then
1706 elif $test -f $xxxfile.sh ; then
1708 elif $test -f $xxxxfile.sh ; then
1710 elif $test -f "${osname}.sh" ; then
1721 dflt=`echo $hintfile | $sed 's/\.sh$//'`
1727 You may give one or more space-separated answers, or "none" if appropriate.
1728 If your OS version has no hints, DO NOT give a wrong version -- say "none".
1731 rp="Which of these apply, if any?"
1734 for file in $tans; do
1735 if $test -f $file.sh; then
1737 $cat $file.sh >> ../UU/config.sh
1738 elif $test X$tans = X -o X$tans = Xnone ; then
1741 : Give one chance to correct a possible typo.
1742 echo "$file.sh does not exist"
1744 rp="hint to use instead?"
1746 for file in $ans; do
1747 if $test -f "$file.sh"; then
1749 $cat $file.sh >> ../UU/config.sh
1750 elif $test X$ans = X -o X$ans = Xnone ; then
1753 echo "$file.sh does not exist -- ignored."
1760 : Remember our hint file for later.
1761 if $test -f "$file.sh" ; then
1773 echo "Fetching default answers from $config_sh..." >&4
1777 cp $config_sh config.sh 2>/dev/null
1786 test "$override" && . ./optdef.sh
1787 myuname="$newmyuname"
1789 : Restore computed paths
1790 for file in $loclist $trylist; do
1791 eval $file="\$_$file"
1796 Configure uses the operating system name and version to set some defaults.
1797 The default value is probably right if the name rings a bell. Otherwise,
1798 since spelling matters for me, either accept the default or answer "none"
1805 ''|' '|none) dflt=none ;;
1806 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
1809 *) dflt="$osname" ;;
1811 rp="Operating system name?"
1815 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
1817 : who configured the system
1818 cf_time=`$date 2>&1`
1819 (logname > .temp) >/dev/null 2>&1
1820 $test -s .temp || (whoami > .temp) >/dev/null 2>&1
1821 $test -s .temp || echo unknown > .temp
1825 : determine where manual pages are on this system
1829 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
1830 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
1831 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
1832 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
1833 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
1834 sysman=`./loc . /usr/man/man1 $syspath`
1837 if $test -d "$sysman"; then
1838 echo "System manual is in $sysman." >&4
1840 echo "Could not find manual pages in source form." >&4
1843 : see what memory models we can support
1846 $cat >pdp11.c <<'EOP'
1855 cc -o pdp11 pdp11.c >/dev/null 2>&1
1856 if ./pdp11 2>/dev/null; then
1857 dflt='unsplit split'
1859 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
1862 *) if $test -d /lib/small || $test -d /usr/lib/small; then
1867 if $test -d /lib/medium || $test -d /usr/lib/medium; then
1870 if $test -d /lib/large || $test -d /usr/lib/large; then
1873 if $test -d /lib/huge || $test -d /usr/lib/huge; then
1882 Some systems have different model sizes. On most systems they are called
1883 small, medium, large, and huge. On the PDP11 they are called unsplit and
1884 split. If your system doesn't support different memory models, say "none".
1885 If you wish to force everything to one memory model, say "none" here and
1886 put the appropriate flags later when it asks you for other cc and ld flags.
1887 Venix systems may wish to put "none" and let the compiler figure things out.
1888 (In the following question multiple model names should be space separated.)
1891 rp="Which memory models are supported?"
1906 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
1907 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
1914 rp="What flag indicates separate I and D space?"
1922 *large*|*small*|*medium*|*huge*)
1929 rp="What flag indicates large model?"
1939 *huge*) case "$huge" in
1943 rp="What flag indicates huge model?"
1953 *medium*) case "$medium" in
1957 rp="What flag indicates medium model?"
1964 *) medium="$large";;
1967 *small*) case "$small" in
1971 rp="What flag indicates small model?"
1982 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
1986 : make some quick guesses about what we are up against
1988 $echo $n "Hmm... $c"
1997 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
1998 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2000 echo "Looks kind of like an OSF/1 system, but we'll see..."
2002 elif test `echo abc | tr a-z A-Z` = Abc ; then
2003 xxx=`./loc addbib blurfl $pth`
2004 if $test -f $xxx; then
2005 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2009 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2010 echo "Looks kind of like an extended USG system, but we'll see..."
2012 echo "Looks kind of like a USG system, but we'll see..."
2016 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2017 echo "Looks kind of like a BSD system, but we'll see..."
2021 echo "Looks kind of like a Version 7 system, but we'll see..."
2024 case "$eunicefix" in
2027 There is, however, a strange, musty smell in the air that reminds me of
2028 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2032 : it so happens the Eunice I know will not run shell scripts in Unix format
2036 echo "Congratulations. You aren't running Eunice."
2040 if test -f /xenix; then
2041 echo "Actually, this looks more like a XENIX system..."
2046 echo "It's not Xenix..."
2051 if test -f /venix; then
2052 echo "Actually, this looks more like a VENIX system..."
2059 echo "Nor is it Venix..."
2062 chmod +x bsd usg v7 osf1 eunice xenix venix
2063 $eunicefix bsd usg v7 osf1 eunice xenix venix
2066 : see if we need a special compiler
2074 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2075 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2088 On some systems the default C compiler will not resolve multiple global
2089 references that happen to have the same name. On some such systems the "Mcc"
2090 command may be used to force these to be resolved. On other systems a "cc -M"
2091 command is required. (Note that the -M flag on other systems indicates a
2092 memory model to use!) If you have the Gnu C compiler, you might wish to use
2096 rp="What command will force resolution on this system?"
2104 rp="Use which C compiler?"
2109 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2110 $cat >gccvers.c <<EOM
2115 printf("%s\n", __VERSION__);
2117 printf("%s\n", "1");
2123 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
2124 gccversion=`./gccvers`
2125 case "$gccversion" in
2126 '') echo "You are not using GNU cc." ;;
2127 *) echo "You are using GNU cc $gccversion." ;;
2131 echo "*** WHOA THERE!!! ***" >&4
2132 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
2133 case "$knowitall" in
2135 echo " You'd better start hunting for one and let me know about it." >&4
2141 case "$gccversion" in
2142 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
2145 : decide how portable to be
2146 case "$d_portable" in
2152 I can set things up so that your shell scripts and binaries are more portable,
2153 at what may be a noticable cost in performance. In particular, if you
2154 ask to be portable, the following happens:
2156 1) Shell scripts will rely on the PATH variable rather than using
2157 the paths derived above.
2158 2) ~username interpretations will be done at run time rather than
2162 rp="Do you expect to run these scripts and binaries on multiple machines?"
2165 y*) d_portable="$define"
2167 *) d_portable="$undef" ;;
2170 : set up shell script to do ~ expansion
2176 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2179 if $test -f /bin/csh; then
2180 /bin/csh -f -c "glob \$1"
2185 name=\`$expr x\$1 : '..\([^/]*\)'\`
2186 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2187 if $test ! -d "\$dir"; then
2189 echo "\$me: can't locate home directory for: \$name" >&2
2194 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2210 : now set up to get a file name
2211 cat <<'EOSC' >getfile
2224 expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
2225 fn=`echo $fn | sed 's/(.*)//'`
2231 loc_file=`expr $fn : '.*:\(.*\)'`
2232 fn=`expr $fn : '\(.*\):.*'`
2240 */*) fullpath=true;;
2249 *e*) exp_file=true;;
2252 *p*) nopath_ok=true;;
2257 *d*) type='Directory';;
2258 *l*) type='Locate';;
2263 Locate) what='File';;
2268 case "$d_portable" in
2276 while test "$type"; do
2281 true) rp="$rp (~name ok)";;
2284 if test -f UU/getfile.ok && \
2285 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2304 value=`UU/filexp $ans`
2307 if test "$ans" != "$value"; then
2308 echo "(That expands to $value on this system.)"
2322 /*) value="$ansexp" ;;
2327 echo "I shall only accept a full path name, as in /bin/ls." >&4
2328 echo "Use a ! shell escape if you wish to check pathnames." >&4
2331 echo "Please give a full path name, starting with slash." >&4
2334 echo "Note that using ~name is ok provided it expands well." >&4
2347 if test -f "$ansexp"; then
2349 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2351 echo "($value is not a plain file, but that's ok.)"
2356 if test -d "$ansexp"; then
2361 if test -d "$ansexp"; then
2362 echo "(Looking for $loc_file in directory $value.)"
2363 value="$value/$loc_file"
2364 ansexp="$ansexp/$loc_file"
2366 if test -f "$ansexp"; then
2369 case "$nopath_ok" in
2370 true) case "$value" in
2372 *) echo "Assuming $value will be in people's path."
2388 if test "$fastread" = yes; then
2393 rp="$what $value doesn't exist. Use that name anyway?"
2414 : What should the include directory be ?
2416 $echo $n "Hmm... $c"
2420 if $test -f /bin/mips && /bin/mips; then
2421 echo "Looks like a MIPS system..."
2422 $cat >usr.c <<'EOCP'
2423 #ifdef SYSTYPE_BSD43
2427 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
2428 dflt='/bsd43/usr/include'
2432 mips_type='System V'
2434 $rm -f usr.c usr.out
2435 echo "and you're compiling with the $mips_type compiler and libraries."
2438 echo "Doesn't look like a MIPS system."
2449 rp='Where are the include files you want to use?'
2453 : see how we invoke the C preprocessor
2455 echo "Now, how can we feed standard input to your C preprocessor..." >&4
2456 cat <<'EOT' >testcpp.c
2462 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
2464 wrapper=`pwd`/cppstdin
2468 if $test "X$cppstdin" != "X" && \
2469 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
2470 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2472 echo "You used to use $cppstdin $cppminus so we'll use that again."
2474 '') echo "But let's see if we can live without a wrapper..." ;;
2476 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
2477 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2479 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
2482 echo "(However, $cpprun $cpplast does not work, let's see...)"
2490 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
2497 elif echo 'Maybe "'"$cc"' -E" will work...'; \
2498 $cc -E <testcpp.c >testcpp.out 2>&1; \
2499 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2500 echo "Yup, it does."
2503 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
2504 $cc -E - <testcpp.c >testcpp.out 2>&1; \
2505 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2506 echo "Yup, it does."
2509 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
2510 $cc -P <testcpp.c >testcpp.out 2>&1; \
2511 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2512 echo "Yipee, that works!"
2515 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
2516 $cc -P - <testcpp.c >testcpp.out 2>&1; \
2517 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2518 echo "At long last!"
2521 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
2522 $cpp <testcpp.c >testcpp.out 2>&1; \
2523 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2527 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
2528 $cpp - <testcpp.c >testcpp.out 2>&1; \
2529 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2530 echo "Hooray, it works! I was beginning to wonder."
2533 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
2534 $wrapper <testcpp.c >testcpp.out 2>&1; \
2535 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2541 rp="No dice. I can't find a C preprocessor. Name one:"
2545 $x_cpp <testcpp.c >testcpp.out 2>&1
2546 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
2547 echo "OK, that will do." >&4
2549 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
2564 echo "Perhaps can we force $cc -E using a wrapper..."
2565 if $wrapper <testcpp.c >testcpp.out 2>&1; \
2566 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
2572 echo "Nope, we'll have to live without it..."
2587 *) $rm -f $wrapper;;
2589 $rm -f testcpp.c testcpp.out
2591 : determine optimize, if desired, or use for debug flag also
2595 *) dflt="$optimize";;
2599 Some C compilers have problems with their optimizers, by default, $package
2600 compiles with the -O flag to use the optimizer. Alternately, you might want
2601 to use the symbolic debugger, which uses the -g flag (on traditional Unix
2602 systems). Either flag can be specified here. To use neither flag, specify
2606 rp="What optimizer/debugger flag should be used?"
2610 'none') optimize=" ";;
2616 case "$gccversion" in
2617 1*) dflt='-fpcc-struct-return' ;;
2620 *-g*) dflt="$dflt -DDEBUGGING";;
2622 case "$gccversion" in
2623 2*) if test -d /etc/conf/kconfig.d &&
2624 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
2633 case "$mips_type" in
2636 *) inclwanted="$inclwanted $usrinc/bsd";;
2638 for thisincl in $inclwanted; do
2639 if $test -d $thisincl; then
2640 if $test x$thisincl != x$usrinc; then
2643 *) dflt="$dflt -I$thisincl";;
2649 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
2651 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
2659 *) dflt="$dflt -D$2";;
2664 set signal.h __LANGUAGE_C__; eval $inctest
2666 set signal.h LANGUAGE_C; eval $inctest
2668 set signal.h NO_PROTOTYPE; eval $inctest
2669 set signal.h _NO_PROTO; eval $inctest
2676 *) dflt="$ccflags";;
2680 Your C compiler may want other flags. For this question you should include
2681 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
2682 but you should NOT include libraries or ld flags like -lwhatever. If you
2683 want $package to honor its debug switch, you should include -DDEBUGGING here.
2684 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE,
2685 -DHIDEMYMALLOC or -DCRIPPLED_CC.
2687 To use no flags, specify the word "none".
2693 rp="Any additional cc flags?"
2700 : the following weeds options from ccflags that are of no interest to cpp
2702 case "$gccversion" in
2703 1*) cppflags="$cppflags -D__GNUC__"
2705 case "$mips_type" in
2707 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
2713 echo "Let me guess what the preprocessor flags are..." >&4
2727 *) ftry="$previous $flag";;
2729 if $cppstdin -DLFRULB=bar $ftry $cppminus <cpp.c \
2730 >cpp1.out 2>/dev/null && \
2731 $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \
2732 >cpp2.out 2>/dev/null && \
2733 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
2734 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
2736 cppflags="$cppflags $ftry"
2746 *-*) echo "They appear to be: $cppflags";;
2748 $rm -f cpp.c cpp?.out
2752 : flags used in final linking phase
2754 '') if ./venix; then
2760 *-posix*) dflt="$dflt -posix" ;;
2766 *) dflt="$ldflags";;
2769 rp="Any additional ld flags (NOT including libraries)?"
2775 rmlist="$rmlist pdp11"
2779 echo "Checking your choice of C compiler and flags for coherency..." >&4
2780 set X $cc $optimize $ccflags try.c -o try $ldflags
2783 I've tried to compile and run a simple program with:
2788 and I got the following output:
2791 $cat > try.c <<'EOF'
2796 if sh -c "$cc $optimize $ccflags try.c -o try $ldflags" >>try.msg 2>&1; then
2797 if sh -c './try' >>try.msg 2>&1; then
2800 echo "The program compiled OK, but exited with status $?." >>try.msg
2801 rp="You have a problem. Shall I abort Configure"
2805 echo "I can't compile the test program." >>try.msg
2806 rp="You have a BIG problem. Shall I abort Configure"
2812 case "$knowitall" in
2814 echo "(The supplied flags might be incorrect with this C compiler.)"
2822 *) echo "Ok. Stopping Configure." >&4
2827 n) echo "OK, that should do.";;
2829 $rm -f try try.* core
2831 : Set private lib path
2834 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
2839 '') dlist="$plibpth $glibpth";;
2840 *) dlist="$libpth";;
2843 : Now check and see which directories actually exist, avoiding duplicates
2847 if $test -d $xxx; then
2850 *) libpth="$libpth $xxx";;
2856 Some systems have incompatible or broken versions of libraries. Among
2857 the directories listed in the question below, please remove any you
2858 know not to be holding relevant libraries, and add any that are needed.
2859 Say "none" for none.
2870 rp="Directories to use for library searches?"
2877 : compute shared library extension
2880 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
2890 On some systems, shared libraries may be available. Answer 'none' if
2891 you want to suppress searching of shared libraries for the remaining
2892 of this configuration.
2895 rp='What is the file extension used for shared libraries?'
2899 : Looking for optional libraries
2901 echo "Checking for optional libraries..." >&4
2906 case "$libswanted" in
2907 '') libswanted='c_s';;
2909 for thislib in $libswanted; do
2911 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
2912 echo "Found -l$thislib (shared)."
2915 *) dflt="$dflt -l$thislib";;
2917 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
2918 echo "Found -l$thislib (shared)."
2921 *) dflt="$dflt -l$thislib";;
2923 elif xxx=`./loc lib$thislib.a X $libpth`; $test -f "$xxx"; then
2924 echo "Found -l$thislib."
2927 *) dflt="$dflt -l$thislib";;
2929 elif xxx=`./loc lib${thislib}_s.a X $libpth`; $test -f "$xxx"; then
2930 echo "Found -l${thislib}_s."
2933 *) dflt="$dflt -l${thislib}_s";;
2935 elif xxx=`./loc Slib$thislib.a X $xlibpth`; $test -f "$xxx"; then
2936 echo "Found -l$thislib."
2939 *) dflt="$dflt -l$thislib";;
2942 echo "No -l$thislib."
2953 ' '|'') dflt='none';;
2958 Some versions of Unix support shared libraries, which make executables smaller
2959 but make load time slightly longer.
2961 On some systems, mostly newer Unix System V's, the shared library is included
2962 by putting the option "-lc_s" as the last thing on the cc command line when
2963 linking. Other systems use shared libraries by default. There may be other
2964 libraries needed to compile $package on your machine as well. If your system
2965 needs the "-lc_s" option, include it here. Include any other special libraries
2966 here as well. Say "none" for none.
2970 rp="Any additional libraries?"
2977 : see if nm is to be used to determine whether a symbol is defined or not
2980 dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null`
2981 if $test $dflt -gt 20; then
2996 I can use 'nm' to extract the symbols from your C libraries. This is a time
2997 consuming task which may generate huge output on the disk (up to 3 megabytes)
2998 but that should make the symbols extraction faster. The alternative is to skip
2999 the 'nm' extraction part and to compile a small test program instead to
3000 determine whether each symbol is present. If you have a fast C compiler and/or
3001 if your 'nm' output cannot be parsed, this may be the best solution.
3004 rp='Shall I use nm to extract C symbols from the libraries?'
3016 : nm options which may be necessary
3018 '') if $test -f /mach_boot; then
3020 elif $test -d /usr/ccs/lib; then
3022 elif $test -f /dgux; then
3031 : get list of predefined functions in a handy place
3036 *-lc_s*) libc=`./loc libc_s.a $libc $libpth`
3043 *) for thislib in $libs; do
3046 : Handle C library specially below.
3049 thislib=`echo $thislib | $sed -e 's/^-l//'`
3050 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
3052 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
3054 elif try=`./loc lib$thislib.a X $libpth`; $test -f "$try"; then
3056 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
3058 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
3060 elif try=`./loc Slib$thislib.a X $xlibpth`; $test -f "$try"; then
3065 libnames="$libnames $try"
3067 *) libnames="$libnames $thislib" ;;
3075 set /usr/ccs/lib/libc.$so
3076 $test -r $1 || set /usr/lib/libc.$so
3077 $test -r $1 || set /usr/shlib/libc.$so
3079 set `echo blurfl; echo /usr/lib/libc.$so.[0-9]* | \
3080 tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e '
3082 s/[0-9][0-9]*/0000&/g
3083 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
3086 sort | $sed -e 's/^.* //'`
3088 $test -r $1 || set /lib/libc.$so
3089 $test -r $1 || set /lib/libsys_s.a
3095 if $test -r "$1"; then
3096 echo "Your (shared) C library seems to be in $1."
3098 elif $test -r /lib/libc && $test -r /lib/clib; then
3099 echo "Your C library seems to be in both /lib/clib and /lib/libc."
3101 libc='/lib/clib /lib/libc'
3102 if $test -r /lib/syslib; then
3103 echo "(Your math library is in /lib/syslib.)"
3104 libc="$libc /lib/syslib"
3106 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
3107 echo "Your C library seems to be in $libc, as you said before."
3108 elif $test -r $incpath/usr/lib/libc.a; then
3109 libc=$incpath/usr/lib/libc.a;
3110 echo "Your C library seems to be in $libc. That's fine."
3111 elif $test -r /lib/libc.a; then
3113 echo "Your C library seems to be in $libc. You're normal."
3115 if tans=`./loc libc.a blurfl/dyick $libpth`; $test -r "$tans"; then
3117 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
3118 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
3119 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
3121 elif tans=`./loc Slibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
3123 elif tans=`./loc Mlibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
3126 tans=`./loc Llibc.a blurfl/dyick $xlibpth`
3128 if $test -r "$tans"; then
3129 echo "Your C library seems to be in $tans, of all places."
3135 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
3139 If the guess above is wrong (which it might be if you're using a strange
3140 compiler, or your machine supports multiple models), you can override it here.
3145 echo $libpth | tr ' ' '\012' | sort | uniq > libpath
3147 I can't seem to find your C library. I've looked in the following places:
3150 $sed 's/^/ /' libpath
3153 None of these seems to contain your C library. I need to get its name...
3158 rp='Where is your C library?'
3163 echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames
3164 set X `cat libnames`
3167 case $# in 1) xxx=file; esac
3168 echo "Extracting names from the following $xxx for later perusal:" >&4
3170 $sed 's/^/ /' libnames >&4
3172 $echo $n "This may take a while...$c" >&4
3174 nm $nm_opt $* 2>/dev/null >libc.tmp
3176 $grep fprintf libc.tmp > libc.ptf
3177 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
3178 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
3180 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx //p'";\
3182 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3184 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
3186 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3188 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
3190 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3192 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
3194 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3196 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
3198 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3200 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
3202 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3204 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
3205 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
3207 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3209 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
3211 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3213 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
3215 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3217 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
3219 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
3222 nm -p $* 2>/dev/null >libc.tmp
3223 $grep fprintf libc.tmp > libc.ptf
3224 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
3225 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
3231 echo "nm didn't seem to work right. Trying ar instead..." >&4
3233 if ar t $libc > libc.tmp; then
3234 for thisname in $libnames; do
3235 ar t $thisname >>libc.tmp
3237 $sed -e 's/\.o$//' < libc.tmp > libc.list
3240 echo "ar didn't seem to work right." >&4
3241 echo "Maybe this is a Cray...trying bld instead..." >&4
3242 if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list
3244 for thisname in $libnames; do
3246 $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
3247 ar t $thisname >>libc.tmp
3251 echo "That didn't work either. Giving up." >&4
3258 if $test -f /lib/syscalls.exp; then
3260 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
3261 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
3265 $rm -f libnames libpath
3267 : is a C symbol defined?
3270 -v) tf=libc.tmp; tc=""; tdc="";;
3271 -a) tf=libc.tmp; tc="[0]"; tdc=[];;
3272 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
3275 case "$reuseval-$4" in
3277 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
3283 if $contains $tlook $tf >/dev/null 2>&1;
3288 echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
3289 if $cc $ccflags -o t t.c $ldflags $libs >/dev/null 2>&1;
3297 $define) tval=true;;
3303 : set up the script used to warn in case of inconsistency
3307 echo "*** WHOA THERE!!! ***" >&4
3308 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3309 rp=" Keep the $hint value?"
3312 y) td=$was; tu=$was;;
3316 : define an is-in-libc? function
3317 inlibc='echo " "; td=$define; tu=$undef;
3318 sym=$1; var=$2; eval "was=\$$2";
3320 case "$reuseval$was" in
3330 echo "$sym() found." >&4;
3331 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
3333 echo "$sym() NOT found." >&4;
3334 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
3338 $define) echo "$sym() found." >&4;;
3339 *) echo "$sym() NOT found." >&4;;
3343 : see if gconvert exists
3344 : On some SVR4 systems, gconvert is present but can not be used
3345 : because it requires some other unavailable functions.
3346 : Therefore, do not use the nm extraction, but use a real compile
3347 : and link test instead.
3350 set gconvert d_gconvert
3354 case "$d_gconvert" in
3356 echo "We'll use it to convert floats into a string then." >&4
3357 d_Gconvert="gconvert((x),(n),(t),(b))"
3360 : Maybe we can emulate it with gcvt.
3366 : Test whether gcvt drops a trailing decimal point
3371 if (buf[0] != '1' || buf[1] != '\0')
3374 if (buf[0] != '0' || buf[1] != '\0')
3377 if (buf[0] != '-' || buf[1] != '1' || buf[2] != '\0')
3382 if $cc $ccflags $ldflags -o try try.c $libs > /dev/null 2>&1; then
3384 echo "Good, your gcvt() drops a trailing decimal point."
3385 echo "We'll use it to convert floats into a string." >&4
3386 d_Gconvert="gcvt((x),(n),(b))"
3388 echo "But your gcvt() keeps a trailing decimal point".
3392 echo "Hmm. I can't compile the gcvt test program."
3398 case "$d_Gconvert" in
3400 echo "I'll use sprintf instead to convert floats into a string." >&4
3401 d_Gconvert='sprintf((b),"%.*g",(n),(x))'
3406 : Initialize h_fcntl
3409 : Initialize h_sysfile
3412 : determine filename position in cpp output
3414 echo "Computing filename position in cpp output for #include directives..." >&4
3415 echo '#include <stdio.h>' > foo.c
3418 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
3419 $grep '^[ ]*#.*stdio\.h' | \
3420 while read cline; do
3423 while $test \$# -gt 0; do
3424 if $test -r \`echo \$1 | $tr -d '"'\`; then
3429 pos=\`expr \$pos + 1\`
3441 *) pos="${fieldn}th";;
3443 echo "Your cpp writes the filename in the $pos field of the line."
3445 : locate header file
3450 if test -f $usrinc/\$wanted; then
3451 echo "$usrinc/\$wanted"
3454 awkprg='{ print \$$fieldn }'
3455 echo "#include <\$wanted>" > foo\$\$.c
3456 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
3457 $grep "^[ ]*#.*\$wanted" | \
3458 while read cline; do
3459 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
3461 */\$wanted) echo "\$name"; exit 0;;
3472 : access call always available on UNIX
3476 : locate the flags for 'access()'
3480 $cat >access.c <<'EOCP'
3481 #include <sys/types.h>
3486 #include <sys/file.h>
3495 : check sys/file.h first, no particular reason here
3496 if $test `./findhdr sys/file.h` && \
3497 $cc $cppflags -DI_SYS_FILE access.c -o access >/dev/null 2>&1 ; then
3499 echo "<sys/file.h> defines the *_OK access constants." >&4
3500 elif $test `./findhdr fcntl.h` && \
3501 $cc $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then
3503 echo "<fcntl.h> defines the *_OK access constants." >&4
3504 elif $test `./findhdr unistd.h` && \
3505 $cc $cppflags -DI_UNISTD access.c -o access >/dev/null 2>&1 ; then
3506 echo "<unistd.h> defines the *_OK access constants." >&4
3508 echo "I can't find the four *_OK access constants--I'll use mine." >&4
3514 : see if alarm exists
3518 : determine the architecture name
3520 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3521 tarch=`arch`"-$osname"
3522 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3523 if uname -m > tmparch 2>&1 ; then
3524 tarch=`$sed -e 's/ /_/g' -e 's/$/'"-$osname/" tmparch`
3532 case "$myarchname" in
3535 echo "(Your architecture name used to be $myarchname.)"
3541 *) dflt="$archname";;
3543 rp='What is your architecture name'
3550 if test -d /afs; then
3551 echo "AFS may be running... I'll be extra cautious then..." >&4
3554 echo "AFS does not seem to be running..." >&4
3558 : determine root of directory hierarchy where package will be installed.
3561 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3569 By default, $package will be installed in $dflt/bin, manual
3570 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
3571 all installation directories. Typically set to /usr/local, but you
3572 may choose /usr if you wish to install $package among your system
3573 binaries. If you wish to have binaries under /bin but manual pages
3574 under /usr/local/man, that's ok: you will be prompted separately
3575 for each of the installation directories, the prefix being only used
3576 to set the defaults.
3580 rp='Installation prefix to use?'
3588 *) oldprefix="$prefix";;
3595 : set the prefixit variable, to compute a suitable default value
3596 prefixit='case "$3" in
3598 case "$oldprefix" in
3599 "") eval "$1=\"\$$2\"";;
3606 ""|" ") eval "$1=\"\$$2\"";;
3612 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3614 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3615 /*-$oldprefix/*|\~*-$oldprefix/*)
3616 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3617 *) eval "$1=\"\$$2\"";;
3621 : determine where private executables go
3622 set dflt privlib lib/$package
3626 There are some auxiliary files for $package that need to be put into a
3627 private library directory that is accessible by everyone.
3631 rp='Pathname where the private library files will reside?'
3633 if $test "X$privlibexp" != "X$ansexp"; then
3637 privlibexp="$ansexp"
3641 Since you are running AFS, I need to distinguish the directory in which
3642 private files reside from the directory in which they are installed (and from
3643 which they are presumably copied to the former directory by occult means).
3646 case "$installprivlib" in
3647 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
3648 *) dflt="$installprivlib";;
3651 rp='Where will private files be installed?'
3653 installprivlib="$ans"
3655 installprivlib="$privlibexp"
3658 : set the prefixup variable, to restore leading tilda escape
3659 prefixup='case "$prefixexp" in
3661 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3664 : determine where public architecture dependent libraries go
3671 dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
3675 *) dflt="$privlib/$archname";;
3678 *) dflt="$archlib";;
3682 $spackage contains architecture-dependent library files. If you are
3683 sharing libraries in a heterogeneous environment, you might store
3684 these files in a separate location. Otherwise, you can just include
3685 them with the rest of the public library files.
3689 rp='Where do you want to put the public architecture-dependent libraries?'
3692 archlibexp="$ansexp"
3697 Since you are running AFS, I need to distinguish the directory in which
3698 private files reside from the directory in which they are installed (and from
3699 which they are presumably copied to the former directory by occult means).
3702 case "$installarchlib" in
3703 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
3704 *) dflt="$installarchlib";;
3707 rp='Where will architecture-dependent library files be installed?'
3709 installarchlib="$ans"
3711 installarchlib="$archlibexp"
3713 if $test X"$archlib" = X"$privlib"; then
3719 : function used to set $1 to $val
3720 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3722 $define$undef) . ./whoa; eval "$var=\$td";;
3723 $undef$define) . ./whoa; eval "$var=\$tu";;
3724 *) eval "$var=$val";;
3727 : Look for GNU-cc style attribute checking
3729 echo "Checking whether your compiler can handle __attribute__ ..." >&4
3730 $cat >attrib.c <<'EOCP'
3732 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
3734 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
3735 if $contains 'warning' attrib.out >/dev/null 2>&1; then
3736 echo "Your C compiler doesn't fully support __attribute__."
3739 echo "Your C compiler supports __attribute__."
3743 echo "Your C compiler doesn't seem to understand __attribute__ at all."
3750 : see if bcmp exists
3754 : see if bcopy exists
3758 : see if setpgrp exists
3759 set setpgrp d_setpgrp
3762 : see which flavor of setpgrp is in use
3763 case "$d_setpgrp" in
3769 if (getuid() == 0) {
3770 printf("(I see you are running Configure as super-user...)\n");
3773 if (-1 == setpgrp(1, 1))
3778 if $cc $ccflags -o set set.c $ldflags $libs >/dev/null 2>&1; then
3781 0) echo "You have to use setpgrp() instead of setpgrp(pid, pgrp)." >&4
3783 *) echo "You have to use setpgrp(pid, pgrp) instead of setpgrp()." >&4
3788 xxx="USG one, i.e. you use setpgrp()."
3791 xxx="BSD one, i.e. you use setpgrp(pid, pgrp)."
3794 echo "Assuming your setpgrp is a $xxx" >&4
3803 : see if bzero exists
3807 : check for length of integer
3811 echo "Checking to see how big your integers are..." >&4
3812 $cat >try.c <<'EOCP'
3816 printf("%d\n", sizeof(int));
3819 if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then
3823 echo "(I can't seem to compile the test program. Guessing...)"
3830 rp="What is the size of an integer (in bytes)?"
3835 : see if signal is declared as pointer to function returning int or void
3837 xxx=`./findhdr signal.h`
3838 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
3839 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
3840 echo "You have int (*signal())() instead of void." >&4
3842 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
3843 echo "You have void (*signal())() instead of int." >&4
3845 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
3846 echo "You have int (*signal())() instead of void." >&4
3849 case "$d_voidsig" in
3851 echo "I can't determine whether signal handler returns void or int..." >&4
3853 rp="What type does your signal handler return?"
3860 echo "As you already told me, signal handler returns void." >&4;;
3862 echo "As you already told me, signal handler returns int." >&4;;
3867 case "$d_voidsig" in
3868 "$define") signal_t="void";;
3873 : check for ability to cast large floats to 32-bit ints.
3875 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
3876 if $test "$intsize" -eq 4; then
3882 #include <sys/types.h>
3884 $signal_t blech() { exit(3); }
3890 signal(SIGFPE, blech);
3892 f = (double) 0x7fffffff;
3896 if (i32 != ($xxx) f)
3901 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
3905 echo "(I can't seem to compile the test program--assuming it can't)"
3913 echo "Nope, it can't."
3920 : check for ability to cast negative floats to unsigned
3922 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
3924 #include <sys/types.h>
3926 $signal_t blech() { exit(7); }
3927 $signal_t blech_in_list() { exit(4); }
3928 unsigned long dummy_long(p) unsigned long p; { return p; }
3929 unsigned int dummy_int(p) unsigned int p; { return p; }
3930 unsigned short dummy_short(p) unsigned short p; { return p; }
3934 unsigned long along;
3936 unsigned short ashort;
3939 signal(SIGFPE, blech);
3940 along = (unsigned long)f;
3941 aint = (unsigned int)f;
3942 ashort = (unsigned short)f;
3943 if (along != (unsigned long)-123)
3945 if (aint != (unsigned int)-123)
3947 if (ashort != (unsigned short)-123)
3949 f = (double)0x40000000;
3952 along = (unsigned long)f;
3953 if (along != 0x80000000)
3957 along = (unsigned long)f;
3958 if (along != 0x7fffffff)
3962 along = (unsigned long)f;
3963 if (along != 0x80000001)
3967 signal(SIGFPE, blech_in_list);
3969 along = dummy_long((unsigned long)f);
3970 aint = dummy_int((unsigned int)f);
3971 ashort = dummy_short((unsigned short)f);
3972 if (along != (unsigned long)123)
3974 if (aint != (unsigned int)123)
3976 if (ashort != (unsigned short)123)
3982 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
3986 echo "(I can't seem to compile the test program--assuming it can't)"
3989 case "$castflags" in
3994 echo "Nope, it can't."
4001 : see if vprintf exists
4003 if set vprintf val -f d_vprintf; eval $csym; $val; then
4004 echo 'vprintf() found.' >&4
4006 $cat >vprintf.c <<'EOF'
4007 #include <varargs.h>
4009 main() { xxx("foo"); }
4018 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
4021 if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then
4022 echo "Your vsprintf() returns (int)." >&4
4025 echo "Your vsprintf() returns (char*)." >&4
4029 echo 'vprintf() NOT found.' >&4
4039 : see if chown exists
4043 : see if chroot exists
4047 : see if chsize exists
4051 : check for const keyword
4053 echo 'Checking to see if your C compiler knows about "const"...' >&4
4054 $cat >const.c <<'EOCP'
4055 typedef struct spug { int drokk; } spug;
4062 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
4064 echo "Yup, it does."
4067 echo "Nope, it doesn't."
4072 : see if crypt exists
4074 if set crypt val -f d_crypt; eval $csym; $val; then
4075 echo 'crypt() found.' >&4
4079 cryptlib=`./loc Slibcrypt.a "" $xlibpth`
4080 if $test -z "$cryptlib"; then
4081 cryptlib=`./loc Mlibcrypt.a "" $xlibpth`
4085 if $test -z "$cryptlib"; then
4086 cryptlib=`./loc Llibcrypt.a "" $xlibpth`
4090 if $test -z "$cryptlib"; then
4091 cryptlib=`./loc libcrypt.a "" $libpth`
4095 if $test -z "$cryptlib"; then
4096 echo 'crypt() NOT found.' >&4
4105 : get csh whereabouts
4107 'csh') val="$undef" ;;
4114 : see if cuserid exists
4115 set cuserid d_cuserid
4118 : define an alternate in-header-list? function
4119 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4120 cont=true; xxf="echo \"<\$1> found.\" >&4";
4121 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4122 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4124 case $# in 4) instead=instead;; *) instead="at last";; esac;
4125 while $test "$cont"; do
4127 var=$2; eval "was=\$$2";
4128 if $test "$xxx" && $test -r "$xxx";
4130 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4133 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4134 set $yyy; shift; shift; yyy=$@;
4135 case $# in 0) cont="";;
4136 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4137 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4138 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4139 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4143 do set $yyy; var=$2; eval "was=\$$2";
4144 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4145 set $yyy; shift; shift; yyy=$@;
4148 : see if this is a limits.h system
4149 set limits.h i_limits
4152 : see if this is a float.h system
4156 : See if number of significant digits in a double precision number is known
4158 $cat >dbl_dig.c <<EOM
4168 printf("Contains DBL_DIG");
4171 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
4172 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
4173 echo "DBL_DIG found." >&4
4176 echo "DBL_DIG NOT found." >&4
4183 : see if difftime exists
4184 set difftime d_difftime
4187 : see if this is a dirent system
4189 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
4191 echo "<dirent.h> found." >&4
4194 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
4195 echo "<sys/dir.h> found." >&4
4198 xinc=`./findhdr sys/ndir.h`
4200 echo "<dirent.h> NOT found." >&4
4205 : Look for type of directory structure.
4207 $cppstdin $cppflags $cppminus < "$xinc" > try.c
4209 case "$direntrytype" in
4212 $define) guess1='struct dirent' ;;
4213 *) guess1='struct direct' ;;
4216 *) guess1="$direntrytype"
4221 'struct dirent') guess2='struct direct' ;;
4222 *) guess2='struct dirent' ;;
4225 if $contains "$guess1" try.c >/dev/null 2>&1; then
4226 direntrytype="$guess1"
4227 echo "Your directory entries are $direntrytype." >&4
4228 elif $contains "$guess2" try.c >/dev/null 2>&1; then
4229 direntrytype="$guess2"
4230 echo "Your directory entries seem to be $direntrytype." >&4
4232 echo "I don't recognize your system's directory entries." >&4
4233 rp="What type is used for directory entries on this system?"
4241 : see if the directory entry stores field length
4243 $cppstdin $cppflags $cppminus < "$xinc" > try.c
4244 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
4245 echo "Good, your directory entry keeps length information in d_namlen." >&4
4248 echo "Your directory entry does not know about the d_namlen field." >&4
4255 : see if dlerror exists
4256 : On NetBSD and FreeBSD, dlerror might be available, but it is in
4257 : /usr/lib/crt0.o, not in any of the libraries. Therefore, do not
4258 : use the nm extraction, but use a real compile and link test instead.
4261 set dlerror d_dlerror
4265 : see if dld is available
4269 : see if dlopen exists
4270 : On NetBSD and FreeBSD, dlopen is available, but it is in
4271 : /usr/lib/crt0.o, not in any of the libraries. Therefore, do not
4272 : use the nm extraction, but use a real compile and link test instead.
4279 : determine which dynamic loading, if any, to compile in
4281 dldir="ext/DynaLoader"
4294 $define) dflt='y' ;;
4297 $define) dflt='y' ;;
4299 : Does a dl_xxx.xs file exist for this operating system
4300 $test -f ../$dldir/dl_${osname}.xs && dflt='y'
4303 rp="Do you wish to use dynamic loading?"
4310 if $test -f ../$dldir/dl_${osname}.xs ; then
4311 dflt="$dldir/dl_${osname}.xs"
4312 elif $test "$d_dlopen" = "$define" ; then
4313 dflt="$dldir/dl_dlopen.xs"
4314 elif $test "$i_dld" = "$define" ; then
4315 dflt="$dldir/dl_dld.xs"
4320 *) dflt="$dldir/$dlsrc"
4323 echo "The following dynamic loading files are available:"
4324 : Can not go over to $dldir because getfile has path hard-coded in.
4325 cd ..; ls -C $dldir/dl*.xs; cd UU
4326 rp="Source file to use for dynamic loading"
4331 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
4335 Some systems may require passing special flags to $cc -c to
4336 compile modules that will be used to create a shared library.
4337 To use no flags, say "none".
4340 case "$cccdlflags" in
4341 '') case "$gccversion" in
4342 '') case "$osname" in
4344 next) dflt='none' ;;
4345 solaris|svr4*|esix*) dflt='-Kpic' ;;
4346 sunos) dflt='-pic' ;;
4351 *) dflt="$cccdlflags" ;;
4353 rp="Any special flags to pass to $cc -c to compile shared library modules?"
4356 none) cccdlflags=' ' ;;
4357 *) cccdlflags="$ans" ;;
4362 Some systems use ld to create libraries that can be dynamically loaded,
4363 while other systems (such as those using ELF) use $cc.
4367 '') $cat >try.c <<'EOM'
4368 /* Test for whether ELF binaries are produced */
4373 int i = open("a.out",O_RDONLY);
4376 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
4377 exit(0); /* succeed (yes, it's ELF) */
4382 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
4384 You appear to have ELF support. I'll use $cc to build dynamic libraries.
4388 echo "I'll use ld to build dynamic libraries."
4397 rp="What command should be used to create dynamic libraries?"
4403 Some systems may require passing special flags to $ld to create a
4404 library that can be dynamically loaded. If your ld flags include
4405 -L/other/path options to locate libraries outside your loader's normal
4406 search path, you may need to specify those -L options here as well. To
4407 use no flags, say "none".
4410 case "$lddlflags" in
4411 '') case "$osname" in
4413 linux) dflt='-shared' ;;
4414 next) dflt='none' ;;
4415 solaris) dflt='-G' ;;
4416 sunos) dflt='-assert nodefinitions' ;;
4417 svr4*|esix*) dflt="-G $ldflags" ;;
4421 *) dflt="$lddlflags" ;;
4423 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
4426 none) lddlflags=' ' ;;
4427 *) lddlflags="$ans" ;;
4432 Some systems may require passing special flags to $cc to indicate that
4433 the resulting executable will use dynamic linking. To use no flags,
4437 case "$ccdlflags" in
4438 '') case "$osname" in
4439 hpux) dflt='-Wl,-E' ;;
4440 linux) dflt='-rdynamic' ;;
4441 next) dflt='none' ;;
4442 sunos) dflt='none' ;;
4445 *) dflt="$ccdlflags" ;;
4447 rp="Any special flags to pass to $cc to use dynamic loading?"
4450 none) ccdlflags=' ' ;;
4451 *) ccdlflags="$ans" ;;
4469 System V Release 4 systems can support dynamic loading
4470 only if libperl is created as a shared library.
4477 set d_shrplib; eval $setvar
4478 case "$d_shrplib" in
4482 Be sure to add the perl source directory to the LD_LIBRARY_PATH
4483 environment variable before running make:
4484 LD_LIBRARY_PATH=`cd ..;pwd`; export LD_LIBRARY_PATH
4486 setenv LD_LIBRARY_PATH `cd ..;pwd`
4491 case "$d_shrplib" in
4494 "") dflt="$archlib/CORE";;
4495 *) dflt="$shrpdir";;
4497 rp="What directory should we install the shared libperl into?"
4506 : see if dlfcn is available
4514 On a few systems, the dynamically loaded modules that perl generates and uses
4515 will need a different extension then shared libs. The default will probably
4523 rp='What is the extension of dynamically loaded modules'
4532 : Check if dlsym need a leading underscore
4538 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
4539 $cat >dyna.c <<'EOM'
4548 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
4550 #include <sys/types.h>
4564 int mode = RTLD_LAZY ;
4566 handle = dlopen("./dyna.$dlext", mode) ;
4567 if (handle == NULL) {
4571 symbol = dlsym(handle, "fred") ;
4572 if (symbol == NULL) {
4573 /* try putting a leading underscore */
4574 symbol = dlsym(handle, "_fred") ;
4575 if (symbol == NULL) {
4586 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
4587 $ld $lddlflags -o dyna.$dlext dyna.o > /dev/null 2>&1 &&
4588 $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
4591 1) echo "Test program failed using dlopen." >&4
4592 echo "Perhaps you should not use dynamic loading." >&4;;
4593 2) echo "Test program failed using dlsym." >&4
4594 echo "Perhaps you should not use dynamic loading." >&4;;
4595 3) echo "dlsym needs a leading underscore" >&4
4597 4) echo "dlsym doesn't need a leading underscore." >&4;;
4600 echo "I can't compile and run the test program." >&4
4605 $rm -f fred fred.? dyna.$dlext dyna.?
4610 : see if setuid scripts can be secure
4613 Some kernels have a bug that prevents setuid #! scripts from being
4614 secure. Some sites have disabled setuid #! scripts because of this.
4616 First let's decide if your kernel supports secure setuid #! scripts.
4617 (If setuid #! scripts would be secure but have been disabled anyway,
4618 don't say that they are secure if asked.)
4623 if $test -d /dev/fd; then
4624 echo "#!$ls" >reflect
4625 chmod +x,u+s reflect
4626 ./reflect >flect 2>&1
4627 if $contains "/dev/fd" flect >/dev/null; then
4628 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4632 If you are not sure if they are secure, I can check but I'll need a
4633 username and password different from the one you are using right now.
4634 If you don't have such a username or don't want me to test, simply
4638 rp='Other username to test security of setuid scripts with?'
4643 case "$d_suidsafe" in
4644 '') echo "I'll assume setuid scripts are *not* secure." >&4
4647 echo "Well, the $hint value is *not* secure." >&4
4649 *) echo "Well, the $hint value *is* secure." >&4
4654 $rm -f reflect flect
4655 echo "#!$ls" >reflect
4656 chmod +x,u+s reflect
4659 echo '"su" will (probably) prompt you for '"$ans's password."
4660 su $ans -c './reflect >flect'
4661 if $contains "/dev/fd" flect >/dev/null; then
4662 echo "Okay, it looks like setuid scripts are secure." >&4
4665 echo "I don't think setuid scripts are secure." >&4
4670 rp='Does your kernel have *secure* setuid scripts?'
4673 [yY]*) val="$define";;
4678 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4684 $rm -f reflect flect
4686 : now see if they want to do setuid emulation
4689 case "$d_suidsafe" in
4692 echo "No need to emulate SUID scripts since they are secure here." >& 4
4696 Some systems have disabled setuid scripts, especially systems where
4697 setuid scripts cannot be secure. On systems where setuid scripts have
4698 been disabled, the setuid/setgid bits on scripts are currently
4699 useless. It is possible for $package to detect those bits and emulate
4700 setuid/setgid in a secure fashion. This emulation will only work if
4701 setuid scripts have been disabled in your kernel.
4705 "$define") dflt=y ;;
4708 rp="Do you want to do setuid/setgid emulation?"
4711 [yY]*) val="$define";;
4719 : see if dup2 exists
4723 : see if fchmod exists
4727 : see if fchown exists
4731 : see if this is an fcntl system
4735 : see if fgetpos exists
4736 set fgetpos d_fgetpos
4739 : see if we can have long filenames
4741 rmlist="$rmlist /tmp/cf$$"
4742 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
4743 first=123456789abcdef
4744 second=/tmp/cf$$/$first
4745 $rm -f $first $second
4746 if (echo hi >$first) 2>/dev/null; then
4747 if $test -f 123456789abcde; then
4748 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
4751 if (echo hi >$second) 2>/dev/null; then
4752 if $test -f /tmp/cf$$/123456789abcde; then
4754 That's peculiar... You can have filenames longer than 14 characters, but only
4755 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
4756 I shall consider your system cannot support long filenames at all.
4760 echo 'You can have filenames longer than 14 characters.' >&4
4765 How confusing! Some of your filesystems are sane enough to allow filenames
4766 longer than 14 characters but some others like /tmp can't even think about them.
4767 So, for now on, I shall assume your kernel does not allow them at all.
4774 You can't have filenames longer than 14 chars. You can't even think about them!
4780 $rm -rf /tmp/cf$$ 123456789abcde*
4782 : see if flock exists
4786 : see if fork exists
4790 : see if pathconf exists
4791 set pathconf d_pathconf
4794 : see if fpathconf exists
4795 set fpathconf d_fpathconf
4798 : see if fsetpos exists
4799 set fsetpos d_fsetpos
4802 : see if gethostent exists
4803 set gethostent d_gethent
4806 : see if getlogin exists
4807 set getlogin d_getlogin
4810 : see if getpgrp exists
4811 set getpgrp d_getpgrp
4814 : see if getpgrp2 exists
4815 set getpgrp2 d_getpgrp2
4818 : see if getppid exists
4819 set getppid d_getppid
4822 : see if getpriority exists
4823 set getpriority d_getprior
4826 : see if this is a netinet/in.h or sys/in.h system
4827 set netinet/in.h i_niin sys/in.h i_sysin
4830 : see if htonl --and friends-- exists
4835 : Maybe they are macros.
4840 #include <sys/types.h>
4841 #$i_niin I_NETINET_IN
4844 #include <netinet/in.h>
4850 printf("Defined as a macro.");
4853 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
4854 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
4856 echo "But it seems to be defined as a macro." >&4
4864 : see which of string.h or strings.h is needed
4866 strings=`./findhdr string.h`
4867 if $test "$strings" && $test -r "$strings"; then
4868 echo "Using <string.h> instead of <strings.h>." >&4
4872 strings=`./findhdr strings.h`
4873 if $test "$strings" && $test -r "$strings"; then
4874 echo "Using <strings.h> instead of <string.h>." >&4
4876 echo "No string header found -- You'll surely have problems." >&4
4882 "$undef") strings=`./findhdr strings.h`;;
4883 *) strings=`./findhdr string.h`;;
4888 if set index val -f; eval $csym; $val; then
4889 if set strchr val -f d_strchr; eval $csym; $val; then
4890 if $contains strchr "$strings" >/dev/null 2>&1 ; then
4893 echo "strchr() found." >&4
4897 echo "index() found." >&4
4902 echo "index() found." >&4
4905 if set strchr val -f d_strchr; eval $csym; $val; then
4908 echo "strchr() found." >&4
4910 echo "No index() or strchr() found!" >&4
4915 set d_strchr; eval $setvar
4917 set d_index; eval $setvar
4921 $cat >isascii.c <<'EOCP'
4932 if $cc $ccflags $ldflags -o isascii isascii.c $libs >/dev/null 2>&1 ; then
4933 echo "isascii() found." >&4
4936 echo "isascii() NOT found." >&4
4943 : see if killpg exists
4947 : see if link exists
4951 : see if localeconv exists
4952 set localeconv d_locconv
4955 : see if lockf exists
4959 : see if lstat exists
4963 : see if mblen exists
4967 : see if mbstowcs exists
4968 set mbstowcs d_mbstowcs
4971 : see if mbtowc exists
4975 : see if memcmp exists
4979 : see if memcpy exists
4983 : see if memmove exists
4984 set memmove d_memmove
4987 : see if memset exists
4991 : see if mkdir exists
4995 : see if mkfifo exists
4999 : see if mktime exists
5003 : see if msgctl exists
5007 : see if msgget exists
5011 : see if msgsnd exists
5015 : see if msgrcv exists
5019 : see how much of the 'msg*(2)' library is present.
5022 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
5023 *"$undef"*) h_msg=false;;
5025 : we could also check for sys/ipc.h ...
5026 if $h_msg && $test `./findhdr sys/msg.h`; then
5027 echo "You have the full msg*(2) library." >&4
5030 echo "You don't have the full msg*(2) library." >&4
5036 : see if this is a malloc.h system
5037 set malloc.h i_malloc
5040 : see if stdlib is available
5041 set stdlib.h i_stdlib
5044 : determine which malloc to compile in
5046 case "$usemymalloc" in
5047 ''|y*|true) dflt='y' ;;
5048 n*|false) dflt='n' ;;
5049 *) dflt="$usemymalloc" ;;
5051 rp="Do you wish to attempt to use the malloc that comes with $package?"
5057 mallocsrc='malloc.c'
5058 mallocobj='malloc.o'
5059 d_mymalloc="$define"
5062 : Remove malloc from list of libraries to use
5063 echo "Removing unneeded -lmalloc from library list" >&4
5064 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5067 echo "libs = $libs" >&4
5079 : compute the return types of malloc and free
5081 $cat >malloc.c <<END
5085 #include <sys/types.h>
5099 case "$malloctype" in
5101 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5108 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5112 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5119 echo "Your system uses $freetype free(), it would seem." >&4
5121 : see if nice exists
5125 : Locate the flags for 'open()'
5127 $cat >open3.c <<'EOCP'
5128 #include <sys/types.h>
5133 #include <sys/file.h>
5144 : check sys/file.h first to get FREAD on Sun
5145 if $test `./findhdr sys/file.h` && \
5146 $cc $cppflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then
5148 echo "<sys/file.h> defines the O_* constants..." >&4
5150 echo "and you have the 3 argument form of open()." >&4
5153 echo "but not the 3 argument form of open(). Oh, well." >&4
5156 elif $test `./findhdr fcntl.h` && \
5157 $cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then
5159 echo "<fcntl.h> defines the O_* constants..." >&4
5161 echo "and you have the 3 argument form of open()." >&4
5164 echo "but not the 3 argument form of open(). Oh, well." >&4
5169 echo "I can't find the O_* constant definitions! You got problems." >&4
5175 : see if pause exists
5179 : see if pipe exists
5183 : see if this is a pwd.h system
5189 xxx=`./findhdr pwd.h`
5190 $cppstdin $cppflags $cppminus < $xxx >$$.h
5192 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
5200 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
5208 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
5216 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
5224 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
5232 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
5244 set d_pwquota; eval $setvar
5245 set d_pwage; eval $setvar
5246 set d_pwchange; eval $setvar
5247 set d_pwclass; eval $setvar
5248 set d_pwexpire; eval $setvar
5249 set d_pwcomment; eval $setvar
5253 : see if readdir and friends exist
5254 set readdir d_readdir
5256 set seekdir d_seekdir
5258 set telldir d_telldir
5260 set rewinddir d_rewinddir
5263 : see if readlink exists
5264 set readlink d_readlink
5267 : see if rename exists
5271 : see if rmdir exists
5275 : can bcopy handle overlapping blocks?
5280 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
5281 $cat >foo.c <<'EOCP'
5284 char buf[128], abc[128];
5290 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
5292 for (align = 7; align >= 0; align--) {
5293 for (len = 36; len; len--) {
5296 for (off = 1; off <= len; off++) {
5297 bcopy(b, b+off, len);
5298 bcopy(b+off, b, len);
5299 if (bcmp(b, abc, len))
5307 if $cc foo.c -o safebcpy $ccflags $ldflags $libs >/dev/null 2>&1 ; then
5308 if ./safebcpy 2>/dev/null; then
5312 echo "It can't, sorry."
5315 echo "(I can't compile the test program, so we'll assume not...)"
5319 $rm -f foo.* safebcpy core
5323 : can memcpy handle overlapping blocks?
5328 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
5329 $cat >foo.c <<'EOCP'
5332 char buf[128], abc[128];
5338 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
5340 for (align = 7; align >= 0; align--) {
5341 for (len = 36; len; len--) {
5343 memcpy(b, abc, len);
5344 for (off = 1; off <= len; off++) {
5345 memcpy(b+off, b, len);
5346 memcpy(b, b+off, len);
5347 if (memcmp(b, abc, len))
5355 if $cc foo.c -o safemcpy $ccflags $ldflags $libs >/dev/null 2>&1 ; then
5356 if ./safemcpy 2>/dev/null; then
5360 echo "It can't, sorry."
5363 echo "(I can't compile the test program, so we'll assume not...)"
5367 $rm -f foo.* safemcpy core
5371 : see if select exists
5375 : see if semctl exists
5379 : see if semget exists
5383 : see if semop exists
5387 : see how much of the 'sem*(2)' library is present.
5390 case "$d_semctl$d_semget$d_semop" in
5391 *"$undef"*) h_sem=false;;
5393 : we could also check for sys/ipc.h ...
5394 if $h_sem && $test `./findhdr sys/sem.h`; then
5395 echo "You have the full sem*(2) library." >&4
5398 echo "You don't have the full sem*(2) library." >&4
5404 : see if setegid exists
5405 set setegid d_setegid
5408 : see if seteuid exists
5409 set seteuid d_seteuid
5412 : see if setlinebuf exists
5413 set setlinebuf d_setlinebuf
5416 : see if setlocale exists
5417 set setlocale d_setlocale
5420 : see if setpgid exists
5421 set setpgid d_setpgid
5424 : see if setpgrp2 exists
5425 set setpgrp2 d_setpgrp2
5428 : see if setpriority exists
5429 set setpriority d_setprior
5432 : see if setregid exists
5433 set setregid d_setregid
5435 set setresgid d_setresgid
5438 : see if setreuid exists
5439 set setreuid d_setreuid
5441 set setresuid d_setresuid
5444 : see if setrgid exists
5445 set setrgid d_setrgid
5448 : see if setruid exists
5449 set setruid d_setruid
5452 : see if setsid exists
5456 : see if shmctl exists
5460 : see if shmget exists
5464 : see if shmat exists
5467 : see what shmat returns
5470 $cat >shmat.c <<'END'
5471 #include <sys/shm.h>
5474 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
5479 echo "and it returns ($shmattype)." >&4
5480 : see if a prototype for shmat is available
5481 $cppstdin $cppflags $cppminus < $usrinc/sys/shm.h > shmat.c 2>/dev/null
5482 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
5493 set d_shmatprototype
5496 : see if shmdt exists
5500 : see how much of the 'shm*(2)' library is present.
5503 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
5504 *"$undef"*) h_shm=false;;
5506 : we could also check for sys/ipc.h ...
5507 if $h_shm && $test `./findhdr sys/shm.h`; then
5508 echo "You have the full shm*(2) library." >&4
5511 echo "You don't have the full shm*(2) library." >&4
5517 : determine whether the user wants to include a site-specific library
5518 : in addition to privlib.
5521 Some sites may wish to specify a local directory for $package
5522 to search by default in addition to $privlib.
5523 If you don't want to use such an additional directory, answer 'none'.
5528 rp='Local directory for additional library files?'
5530 if $test "X$sitelibexp" != "X$ansexp"; then
5534 sitelibexp="$ansexp"
5538 Since you are running AFS, I need to distinguish the directory in which
5539 private files reside from the directory in which they are installed (and from
5540 which they are presumably copied to the former directory by occult means).
5543 case "$installsitelib" in
5544 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
5545 *) dflt="$installsitelib";;
5548 rp='Where will additional local files be installed?'
5550 installsitelib="$ans"
5552 installsitelib="$sitelibexp"
5555 case "$sitelibexp" in
5556 ''|' ') d_sitelib=undef ;;
5557 *) d_sitelib=define ;;
5562 : see whether socket exists
5564 $echo $n "Hmm... $c" >&4
5565 if set socket val -f d_socket; eval $csym; $val; then
5566 echo "Looks like you have Berkeley networking support." >&4
5568 if set setsockopt val -f; eval $csym; $val; then
5571 echo "...but it uses the old 4.1c interface, rather than 4.2" >&4
5575 if $contains socklib libc.list >/dev/null 2>&1; then
5576 echo "Looks like you have Berkeley networking support." >&4
5578 : we will have to assume that it supports the 4.2 BSD interface
5581 echo "You don't have Berkeley networking in libc.a..." >&4
5582 if test -f /usr/lib/libnet.a; then
5583 ( (nm $nm_opt /usr/lib/libnet.a | eval $nm_extract) || \
5584 ar t /usr/lib/libnet.a) 2>/dev/null >> libc.list
5585 if $contains socket libc.list >/dev/null 2>&1; then
5586 echo "...but the Wollongong group seems to have hacked it in." >&4
5588 sockethdr="-I/usr/netinclude"
5590 if $contains setsockopt libc.list >/dev/null 2>&1; then
5593 echo "...using the old 4.1c interface, rather than 4.2" >&4
5597 echo "or even in libnet.a, which is peculiar." >&4
5602 echo "or anywhere else I see." >&4
5609 : see if socketpair exists
5610 set socketpair d_sockpair
5613 : see if stat knows about block sizes
5615 xxx=`./findhdr sys/stat.h`
5616 if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then
5617 if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then
5618 echo "Your stat() knows about block sizes." >&4
5621 echo "Your stat() doesn't know about block sizes." >&4
5625 echo "Your stat() doesn't know about block sizes." >&4
5631 : see if _ptr and _cnt from stdio act std
5633 if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
5634 echo "(Looks like you have stdio.h from Linux.)"
5635 case "$stdio_ptr" in
5636 '') stdio_ptr='((fp)->_IO_read_ptr)'
5639 *) ptr_lval=$d_stdio_ptr_lval
5642 case "$stdio_cnt" in
5643 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
5646 *) cnt_lval=$d_stdio_cnt_lval
5649 case "$stdio_base" in
5650 '') stdio_base='((fp)->_IO_read_base)';;
5652 case "$stdio_bufsiz" in
5653 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
5656 case "$stdio_ptr" in
5657 '') stdio_ptr='((fp)->_ptr)'
5660 *) ptr_lval=$d_stdio_ptr_lval
5663 case "$stdio_cnt" in
5664 '') stdio_cnt='((fp)->_cnt)'
5667 *) cnt_lval=$d_stdio_cnt_lval
5670 case "$stdio_base" in
5671 '') stdio_base='((fp)->_base)';;
5673 case "$stdio_bufsiz" in
5674 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
5677 : test whether _ptr and _cnt really work
5678 echo "Checking how std your stdio is..." >&4
5681 #define FILE_ptr(fp) $stdio_ptr
5682 #define FILE_cnt(fp) $stdio_cnt
5684 FILE *fp = fopen("try.c", "r");
5687 18 <= FILE_cnt(fp) &&
5688 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
5695 if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1; then
5697 echo "Your stdio acts pretty std."
5700 echo "Your stdio isn't very std."
5703 echo "Your stdio doesn't appear very std."
5709 : Can _ptr be used as an lvalue. Only makes sense if we
5710 : have a known stdio implementation.
5711 case "$d_stdstdio" in
5712 $define) val=$ptr_lval ;;
5715 set d_stdio_ptr_lval
5719 : Can _cnt be used as an lvalue. Only makes sense if we
5720 : have a known stdio implementation.
5721 case "$d_stdstdio" in
5722 $define) val=$cnt_lval ;;
5725 set d_stdio_cnt_lval
5729 : see if _base is also standard
5731 case "$d_stdstdio" in
5735 #define FILE_base(fp) $stdio_base
5736 #define FILE_bufsiz(fp) $stdio_bufsiz
5738 FILE *fp = fopen("try.c", "r");
5741 19 <= FILE_bufsiz(fp) &&
5742 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
5748 if $cc $ccflags $ldflags -o try try.c $libs > /dev/null 2>&1; then
5750 echo "Even its _base field acts std."
5753 echo "But its _base field isn't std."
5756 echo "However, it seems to be lacking the _base field."
5764 : see if strcoll exists
5765 set strcoll d_strcoll
5768 : check for structure copying
5770 echo "Checking to see if your C compiler can copy structs..." >&4
5771 $cat >try.c <<'EOCP'
5781 if $cc -c try.c >/dev/null 2>&1 ; then
5786 echo "Nope, it can't."
5792 : see if strerror and/or sys_errlist[] exist
5794 if set strerror val -f d_strerror; eval $csym; $val; then
5795 echo 'strerror() found.' >&4
5796 d_strerror="$define"
5797 d_strerrm='strerror(e)'
5798 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
5799 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
5800 d_syserrlst="$define"
5802 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
5803 d_syserrlst="$undef"
5805 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
5806 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
5807 echo 'strerror() found in string header.' >&4
5808 d_strerror="$define"
5809 d_strerrm='strerror(e)'
5810 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
5811 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
5812 d_syserrlst="$define"
5814 echo "(You don't appear to have any sys_errlist[], how can this be?)"
5815 d_syserrlst="$undef"
5817 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
5818 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
5820 d_syserrlst="$define"
5821 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
5823 echo 'strerror() and sys_errlist[] NOT found.' >&4
5825 d_syserrlst="$undef"
5826 d_strerrm='"unknown"'
5829 : see if strxfrm exists
5830 set strxfrm d_strxfrm
5833 : see if symlink exists
5834 set symlink d_symlink
5837 : see if syscall exists
5838 set syscall d_syscall
5841 : see if sysconf exists
5842 set sysconf d_sysconf
5845 : see if system exists
5849 : see if tcgetpgrp exists
5850 set tcgetpgrp d_tcgetpgrp
5853 : see if tcsetpgrp exists
5854 set tcsetpgrp d_tcsetpgrp
5857 : define an is-a-typedef? function
5858 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
5860 "") inclist="sys/types.h";;
5862 eval "varval=\$$var";
5866 for inc in $inclist; do
5867 echo "#include <$inc>" >>temp.c;
5869 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
5870 if $contains $type temp.E >/dev/null 2>&1; then
5876 *) eval "$var=$varval";;
5879 : see if this is a sys/times.h system
5880 set sys/times.h i_systimes
5883 : see if times exists
5885 if set times val -f d_times; eval $csym; $val; then
5886 echo 'times() found.' >&4
5889 case "$i_systimes" in
5890 "$define") inc='sys/times.h';;
5892 set clock_t clocktype long stdio.h sys/types.h $inc
5896 rp="What type is returned by times() on this system?"
5900 echo 'times() NOT found, hope that will do.' >&4
5905 : see if truncate exists
5906 set truncate d_truncate
5909 : see if tzname[] exists
5911 if set tzname val -a d_tzname; eval $csym; $val; then
5913 echo 'tzname[] found.' >&4
5916 echo 'tzname[] NOT found.' >&4
5921 : see if umask exists
5925 : see if we have to deal with yellow pages, now NIS.
5926 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5927 if $test -f /usr/etc/nibindd; then
5929 echo "I'm fairly confident you're on a NeXT."
5931 rp='Do you get the hosts file via NetInfo?'
5940 y*) hostcat='nidump hosts .';;
5941 *) case "$hostcat" in
5942 nidump*) hostcat='';;
5952 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5960 rp='Are you getting the hosts file via yellow pages?'
5963 y*) hostcat='ypcat hosts';;
5964 *) hostcat='cat /etc/hosts';;
5970 : now get the host name
5972 echo "Figuring out host name..." >&4
5973 case "$myhostname" in
5975 echo 'Maybe "hostname" will work...'
5976 if tans=`sh -c hostname 2>&1` ; then
5984 if $test "$cont"; then
5986 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5987 if tans=`cat /etc/systemid 2>&1` ; then
5989 phostname='cat /etc/systemid'
5990 echo "Whadyaknow. Xenix always was a bit strange..."
5993 elif $test -r /etc/systemid; then
5994 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5997 if $test "$cont"; then
5998 echo 'No, maybe "uuname -l" will work...'
5999 if tans=`sh -c 'uuname -l' 2>&1` ; then
6001 phostname='uuname -l'
6003 echo 'Strange. Maybe "uname -n" will work...'
6004 if tans=`sh -c 'uname -n' 2>&1` ; then
6006 phostname='uname -n'
6008 echo 'Oh well, maybe I can mine it out of whoami.h...'
6009 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6010 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6011 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6013 case "$myhostname" in
6014 '') echo "Does this machine have an identity crisis or something?"
6017 echo "Well, you said $myhostname before..."
6018 phostname='echo $myhostname';;
6024 : you do not want to know about this
6029 if $test "$myhostname" ; then
6031 rp='Your host name appears to be "'$myhostname'".'" Right?"
6039 : bad guess or no guess
6040 while $test "X$myhostname" = X ; do
6042 rp="Please type the (one word) name of your host:"
6047 : translate upper to lower if necessary
6048 case "$myhostname" in
6050 echo "(Normalizing case in your host name)"
6051 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6055 : a little sanity check here
6056 case "$phostname" in
6059 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6060 $myhostname$mydomain|$myhostname) ;;
6062 case "$phostname" in
6064 echo "(That doesn't agree with your whoami.h file, by the way.)"
6067 echo "(That doesn't agree with your $phostname command, by the way.)"
6075 : see how we will look up host name
6078 : dummy stub to allow use of elif
6079 elif set uname val -f d_uname; eval $csym; $val; then
6082 uname() was found, but you're running xenix, and older versions of xenix
6083 have a broken uname(). If you don't really know whether your xenix is old
6084 enough to have a broken system call, use the default answer.
6091 rp='Is your uname() broken?'
6094 n*) d_uname="$define"; call=uname;;
6097 echo 'uname() found.' >&4
6102 case "$d_gethname" in
6103 '') d_gethname="$undef";;
6106 '') d_uname="$undef";;
6108 case "$d_phostname" in
6109 '') d_phostname="$undef";;
6112 : backward compatibility for d_hvfork
6113 if test X$d_hvfork != X; then
6117 : see if there is a vfork
6122 : Ok, but do we want to use it. vfork is reportedly unreliable in
6123 : perl on Solaris 2.x, and probably elsewhere.
6131 rp="Some systems have problems with vfork(). Do you want to use it?"
6136 echo "Ok, we won't use vfork()."
6145 $define) usevfork='true';;
6146 *) usevfork='false';;
6149 : see if this is an sysdir system
6150 set sys/dir.h i_sysdir
6153 : see if this is an sysndir system
6154 set sys/ndir.h i_sysndir
6157 : see if closedir exists
6158 set closedir d_closedir
6161 case "$d_closedir" in
6164 echo "Checking whether closedir() returns a status..." >&4
6165 cat > closedir.c <<EOM
6166 #$i_dirent I_DIRENT /**/
6167 #$i_sysdir I_SYS_DIR /**/
6168 #$i_sysndir I_SYS_NDIR /**/
6170 #if defined(I_DIRENT)
6172 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
6173 #include <sys/dir.h>
6177 #include <sys/ndir.h>
6181 #include <ndir.h> /* may be wrong in the future */
6183 #include <sys/dir.h>
6188 int main() { return closedir(opendir(".")); }
6190 if $cc $ccflags $ldflags -o closedir closedir.c $libs > /dev/null 2>&1; then
6191 if ./closedir > /dev/null 2>&1 ; then
6192 echo "Yes, it does."
6195 echo "No, it doesn't."
6199 echo "(I can't seem to compile the test program--assuming it doesn't)"
6210 : check for volatile keyword
6212 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
6213 $cat >try.c <<'EOCP'
6216 typedef struct _goo_struct goo_struct;
6217 goo_struct * volatile goo = ((goo_struct *)0);
6218 struct _goo_struct {
6223 typedef unsigned short foo_t;
6226 volatile foo_t blech;
6230 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
6232 echo "Yup, it does."
6235 echo "Nope, it doesn't."
6241 : see if there is a wait4
6245 : see if waitpid exists
6246 set waitpid d_waitpid
6249 : see if wcstombs exists
6250 set wcstombs d_wcstombs
6253 : see if wctomb exists
6257 : preserve RCS keywords in files with variable substitution, grrr
6262 Revision='$Revision'
6264 : check for alignment requirements
6266 case "$alignbytes" in
6267 '') echo "Checking alignment constraints..." >&4
6268 $cat >try.c <<'EOCP'
6275 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
6278 if $cc $ccflags try.c -o try >/dev/null 2>&1; then
6282 echo"(I can't seem to compile the test program...)"
6285 *) dflt="$alignbytes"
6288 rp="Doubles must be aligned on a how-many-byte boundary?"
6293 : determine where public executables go
6298 rp='Pathname where the public executables will reside?'
6300 if $test "X$ansexp" != "X$binexp"; then
6308 Since you are running AFS, I need to distinguish the directory in which
6309 executables reside from the directory in which they are installed (and from
6310 which they are presumably copied to the former directory by occult means).
6313 case "$installbin" in
6314 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
6315 *) dflt="$installbin";;
6318 rp='Where will public executables be installed?'
6322 installbin="$binexp"
6325 : check for ordering of bytes in a long
6326 case "$byteorder" in
6330 In the following, larger digits indicate more significance. A big-endian
6331 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
6332 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
6333 machines may have weird orders like 3412. A Cray will report 87654321. If
6334 the test program works the default is probably right.
6335 I'm now running the test program...
6337 $cat >try.c <<'EOCP'
6344 char c[sizeof(long)];
6347 if (sizeof(long) > 4)
6348 u.l = (0x08070605L << 32) | 0x04030201L;
6351 for (i = 0; i < sizeof(long); i++)
6352 printf("%c", u.c[i]+'0');
6356 if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then
6359 ????|????????) echo "(The test program ran ok.)";;
6360 *) echo "(The test program didn't run right for some reason.)";;
6365 (I can't seem to compile the test program. Guessing big-endian...)
6374 rp="What is the order of bytes in a long?"
6379 : how do we catenate cpp tokens here?
6381 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
6382 $cat >cpp_stuff.c <<'EOCP'
6383 #define RCAT(a,b)a/**/b
6384 #define ACAT(a,b)a ## b
6388 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
6389 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
6390 echo "Oh! Smells like ANSI's been here."
6391 echo "We can catify or stringify, separately or together!"
6393 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
6394 echo "Ah, yes! The good old days!"
6395 echo "However, in the good old days we don't know how to stringify and"
6396 echo "catify at the same time."
6400 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
6401 to have to edit the values of CAT[2-5] in config.h...
6403 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
6407 : see if this is a db.h system
6413 : Check the return type needed for hash
6415 echo "Checking return type needed for hash for Berkeley DB ..." >&4
6421 #include <sys/types.h>
6423 u_int32_t hash_cb (ptr, size)
6431 info.hash = hash_cb;
6434 if $cc $ccflags -c try.c >try.out 2>&1 ; then
6435 if $contains warning try.out >>/dev/null 2>&1 ; then
6438 db_hashtype='u_int32_t'
6441 echo "I can't seem to compile the test program." >&4
6445 echo "Your version of Berkeley DB uses $db_hashtype for hash."
6453 : Check the return type needed for prefix
6455 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
6461 #include <sys/types.h>
6463 size_t prefix_cb (key1, key2)
6471 info.prefix = prefix_cb;
6474 if $cc $ccflags -c try.c >try.out 2>&1 ; then
6475 if $contains warning try.out >>/dev/null 2>&1 ; then
6478 db_prefixtype='size_t'
6481 echo "I can't seem to compile the test program." >&4
6485 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
6487 *) db_prefixtype='int'
6491 : check for void type
6493 echo "Checking to see how well your C compiler groks the void type..." >&4
6496 Support flag bits are:
6497 1: basic void declarations.
6498 2: arrays of pointers to functions returning void.
6499 4: operations between pointers to and addresses of void functions.
6500 8: generic void pointers.
6503 case "$voidflags" in
6505 $cat >try.c <<'EOCP'
6511 extern void moo(); /* function returning void */
6512 void (*goo)(); /* ptr to func returning void */
6514 void *hue; /* generic ptr */
6528 if $cc -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6529 voidflags=$defvoidused
6530 echo "It appears to support void to the level $package wants ($defvoidused)."
6531 if $contains warning .out >/dev/null 2>&1; then
6532 echo "However, you might get some warnings that look like this:"
6536 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6537 if $cc -c -DTRY=1 try.c >/dev/null 2>&1 ; then
6538 echo "It supports 1..."
6539 if $cc -c -DTRY=3 try.c >/dev/null 2>&1 ; then
6540 echo "It also supports 2..."
6541 if $cc -c -DTRY=7 try.c >/dev/null 2>&1 ; then
6543 echo "And it supports 4 but not 8 definitely."
6545 echo "It doesn't support 4..."
6546 if $cc -c -DTRY=11 try.c >/dev/null 2>&1 ; then
6548 echo "But it supports 8."
6551 echo "Neither does it support 8."
6555 echo "It does not support 2..."
6556 if $cc -c -DTRY=13 try.c >/dev/null 2>&1 ; then
6558 echo "But it supports 4 and 8."
6560 if $cc -c -DTRY=5 try.c >/dev/null 2>&1 ; then
6562 echo "And it supports 4 but has not heard about 8."
6564 echo "However it supports 8 but not 4."
6569 echo "There is no support at all for void."
6575 rp="Your void support flags add up to what?"
6580 : see if dbm.h is available
6585 : see if dbmclose exists
6586 set dbmclose d_dbmclose
6588 case "$d_dbmclose" in
6591 echo "We won't be including <dbm.h>"
6600 : see if ndbm.h is available
6605 : see if dbm_open exists
6606 set dbm_open d_dbm_open
6608 case "$d_dbm_open" in
6611 echo "We won't be including <ndbm.h>"
6620 : see if gdbm.h is available
6625 : see if gdbm_open exists
6626 set gdbm_open d_gdbm_open
6628 case "$d_gdbm_open" in
6631 echo "We won't be including <gdbm.h>"
6641 echo "Looking for extensions..." >&4
6643 : If we are using the old config.sh, known_extensions may contain
6644 : old or inaccurate or duplicate values.
6646 : We do not use find because it might not be available.
6647 : We do not just use MANIFEST because the user may have dropped
6648 : some additional extensions into the source tree and expect them
6651 if $test -f $xxx/$xxx.xs; then
6652 known_extensions="$known_extensions $xxx"
6654 if $test -d $xxx; then
6657 if $test -f $yyy/$yyy.xs; then
6658 known_extensions="$known_extensions $xxx/$yyy"
6665 set X $known_extensions
6667 known_extensions="$*"
6670 : Now see which are supported on this system.
6672 for xxx in $known_extensions ; do
6674 DB_File) case "$i_db" in
6675 $define) avail_ext="$avail_ext $xxx" ;;
6678 GDBM_File) case "$i_gdbm" in
6679 $define) avail_ext="$avail_ext $xxx" ;;
6682 NDBM_File) case "$i_ndbm" in
6683 $define) avail_ext="$avail_ext $xxx" ;;
6686 ODBM_File) case "$i_dbm" in
6687 $define) avail_ext="$avail_ext $xxx" ;;
6690 POSIX) case "$useposix" in
6691 true|define|y) avail_ext="$avail_ext $xxx" ;;
6694 Socket) case "$d_socket" in
6695 $define) avail_ext="$avail_ext $xxx" ;;
6698 *) avail_ext="$avail_ext $xxx"
6710 A number of extensions are supplied with $package. You may choose to
6711 compile these extensions for dynamic loading (the default), compile
6712 them into the $package executable (static loading), or not include
6713 them at all. Answer "none" to include no extensions.
6716 case "$dynamic_ext" in
6717 '') dflt="$avail_ext" ;;
6718 *) dflt="$dynamic_ext" ;;
6723 rp="What extensions do you wish to load dynamically?"
6726 none) dynamic_ext=' ' ;;
6727 *) dynamic_ext="$ans" ;;
6730 case "$static_ext" in
6732 : Exclude those already listed in dynamic linking
6734 for xxx in $avail_ext; do
6735 case " $dynamic_ext " in
6737 *) dflt="$dflt $xxx" ;;
6744 *) dflt="$static_ext"
6751 rp="What extensions do you wish to load statically?"
6754 none) static_ext=' ' ;;
6755 *) static_ext="$ans" ;;
6760 A number of extensions are supplied with $package. Answer "none"
6761 to include no extensions.
6764 case "$static_ext" in
6765 '') dflt="$avail_ext" ;;
6766 *) dflt="$static_ext" ;;
6772 rp="What extensions do you wish to include?"
6775 none) static_ext=' ' ;;
6776 *) static_ext="$ans" ;;
6781 set X $dynamic_ext $static_ext
6785 : see what type file positions are declared as in the library
6786 set fpos_t fpostype long stdio.h sys/types.h
6790 rp="What is the type for file position used by fsetpos()?"
6794 : Store the full pathname to the sed program for use in the C program
6797 : see what type gids are declared as in the kernel
6798 set gid_t gidtype xxx stdio.h sys/types.h
6802 xxx=`./findhdr sys/user.h`
6803 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
6805 unsigned) dflt="$1 $2" ;;
6809 *) dflt="$gidtype";;
6812 rp="What is the type for group ids returned by getgid()?"
6816 : see if getgroups exists
6817 set getgroups d_getgrps
6820 : Find type of 2nd arg to getgroups
6822 case "$d_getgrps" in
6824 case "$groupstype" in
6825 '') dflt="$gidtype" ;;
6826 *) dflt="$groupstype" ;;
6829 What is the type of the second argument to getgroups()? Usually this
6830 is the same as group ids, $gidtype, but not always.
6833 rp='What type is the second argument to getgroups()?'
6837 *) groupstype="$gidtype";;
6840 : see what type lseek is declared as in the kernel
6841 set off_t lseektype long stdio.h sys/types.h
6845 rp="What type is lseek's offset on this system declared as?"
6849 : determine where manual pages go
6850 set man1dir man1dir none
6854 $spackage has manual pages available in source form.
6858 echo "However, you don't have nroff, so they're probably useless to you."
6860 '') man1dir="none";;
6863 echo "If you don't want the manual sources installed, answer 'none'."
6866 lookpath="$prefixexp/man/man1 $prefixexp/man/u_man/man1"
6867 lookpath="$lookpath $prefixexp/man/l_man/man1"
6868 lookpath="$lookpath /usr/local/man/man1 /opt/man/man1 /usr/man/manl"
6869 lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1"
6870 lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
6871 lookpath="$lookpath /usr/man/man.L"
6872 man1dir=`./loc . $prefixexp/man/man1 $lookpath`
6873 if $test -d "$man1dir"; then
6887 rp="Where do the main $spackage manual pages (source) go?"
6889 if test "X$man1direxp" != "X$ansexp"; then
6893 man1direxp="$ansexp"
6901 Since you are running AFS, I need to distinguish the directory in which
6902 manual pages reside from the directory in which they are installed (and from
6903 which they are presumably copied to the former directory by occult means).
6906 case "$installman1dir" in
6907 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
6908 *) dflt="$installman1dir";;
6911 rp='Where will man pages be installed?'
6913 installman1dir="$ans"
6915 installman1dir="$man1direxp"
6930 : determine where library module manual pages go
6931 set man3dir man3dir none
6935 $spackage has manual pages for many of the library modules.
6941 However, you don't have nroff, so they're probably useless to you.
6942 You can use the supplied perldoc script instead.
6945 '') man3dir="none";;
6949 case "$d_flexfnam" in
6952 However, your system can't handle the long file names like File::Basename.3.
6953 You can use the supplied perldoc script instead.
6956 '') man3dir="none";;
6960 echo "If you don't want the manual sources installed, answer 'none'."
6962 '') dflt="$privlib/man/man3" ;;
6964 *) dflt="$man3dir" ;;
6969 rp="Where do the $spackage library man pages (source) go?"
6971 if test "X$man3direxp" != "X$ansexp"; then
6976 man3direxp="$ansexp"
6984 Since you are running AFS, I need to distinguish the directory in which
6985 manual pages reside from the directory in which they are installed (and from
6986 which they are presumably copied to the former directory by occult means).
6989 case "$installman3dir" in
6990 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
6991 *) dflt="$installman3dir";;
6994 rp='Where will man pages be installed?'
6996 installman3dir="$ans"
6998 installman3dir="$man3direxp"
7013 : see what type is used for mode_t
7014 set mode_t modetype int stdio.h sys/types.h
7018 rp="What type is used for file modes?"
7022 : set the base revision
7025 : get the patchlevel
7027 echo "Getting the current patchlevel..." >&4
7028 if $test -r ../patchlevel.h;then
7029 patchlevel=`awk '/PATCHLEVEL/ {print $3}' < ../patchlevel.h`
7033 echo "(You have $package $baserev PL$patchlevel.)"
7035 : Cruising for prototypes
7037 echo "Checking out function prototypes..." >&4
7038 $cat >prototype.c <<'EOCP'
7039 main(int argc, char *argv[]) {
7042 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7043 echo "Your C compiler appears to support function prototypes."
7046 echo "Your C compiler doesn't seem to understand function prototypes."
7053 : check for size of random number generator
7057 echo "Checking to see how many bits your rand function produces..." >&4
7058 $cat >try.c <<'EOCP'
7063 register unsigned long tmp;
7064 register unsigned long max = 0L;
7066 for (i = 1000; i; i--) {
7067 tmp = (unsigned long)rand();
7068 if (tmp > max) max = tmp;
7070 for (i = 0; max; i++)
7075 if $cc try.c -o try >/dev/null 2>&1 ; then
7079 echo "(I can't seem to compile the test program...)"
7086 rp='How many bits does your rand() function produce?'
7091 : see if ar generates random libraries by itself
7093 echo "Checking how to generate random libraries on your machine..." >&4
7094 echo 'int bar1() { return bar2(); }' > bar1.c
7095 echo 'int bar2() { return 2; }' > bar2.c
7096 $cat > foo.c <<'EOP'
7097 main() { printf("%d\n", bar1()); exit(0); }
7099 $cc $ccflags -c bar1.c >/dev/null 2>&1
7100 $cc $ccflags -c bar2.c >/dev/null 2>&1
7101 $cc $ccflags -c foo.c >/dev/null 2>&1
7102 ar rc bar.a bar2.o bar1.o >/dev/null 2>&1
7103 if $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
7104 ./foobar >/dev/null 2>&1; then
7105 echo "ar appears to generate random libraries itself."
7108 elif ar ts bar.a >/dev/null 2>&1 &&
7109 $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
7110 ./foobar >/dev/null 2>&1; then
7111 echo "a table of contents needs to be added with 'ar ts'."
7118 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
7119 $test -f $ranlib || ranlib=''
7122 if $test -n "$ranlib"; then
7123 echo "your system has '$ranlib'; we'll use that."
7126 echo "your system doesn't seem to support random libraries"
7127 echo "so we'll use lorder and tsort to order the libraries."
7134 : determine where public executable scripts go
7135 set scriptdir scriptdir
7137 case "$scriptdir" in
7140 : guess some guesses
7141 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7142 $test -d /usr/share/bin && dflt=/usr/share/bin
7143 $test -d /usr/local/script && dflt=/usr/local/script
7144 $test -d $prefixexp/script && dflt=$prefixexp/script
7148 *) dflt="$scriptdir"
7153 Some installations have a separate directory just for executable scripts so
7154 that they can mount it across multiple architectures but keep the scripts in
7155 one spot. You might, for example, have a subdirectory of /usr/share for this.
7156 Or you might just lump your scripts in with all your other executables.
7160 rp='Where do you keep publicly executable scripts?'
7162 if $test "X$ansexp" != "X$scriptdirexp"; then
7166 scriptdirexp="$ansexp"
7170 Since you are running AFS, I need to distinguish the directory in which
7171 scripts reside from the directory in which they are installed (and from
7172 which they are presumably copied to the former directory by occult means).
7175 case "$installscript" in
7176 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
7177 *) dflt="$installscript";;
7180 rp='Where will public scripts be installed?'
7182 installscript="$ans"
7184 installscript="$scriptdirexp"
7187 : see if sys/select.h has to be included
7188 set sys/select.h i_sysselct
7191 : see if we should include time.h, sys/time.h, or both
7193 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
7194 $echo $n "I'm now running the test program...$c"
7195 $cat >try.c <<'EOCP'
7196 #include <sys/types.h>
7201 #ifdef SYSTIMEKERNEL
7204 #include <sys/time.h>
7207 #include <sys/select.h>
7216 struct timezone tzp;
7218 if (foo.tm_sec == foo.tm_sec)
7221 if (bar.tv_sec == bar.tv_sec)
7230 for s_timeval in '-DS_TIMEVAL' ''; do
7231 for i_systimek in '' '-DSYSTIMEKERNEL'; do
7232 for i_time in '' '-DI_TIME'; do
7233 for i_systime in '-DI_SYSTIME' ''; do
7237 $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \
7238 try.c -o try >/dev/null 2>&1 ; then
7239 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
7243 $echo $n "Succeeded with $flags$c"
7254 *SYSTIMEKERNEL*) i_systimek="$define"
7255 timeincl=`./findhdr sys/time.h`
7256 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
7257 *) i_systimek="$undef";;
7260 *I_TIME*) i_time="$define"
7261 timeincl=`./findhdr time.h`" $timeincl"
7262 echo "We'll include <time.h>." >&4;;
7263 *) i_time="$undef";;
7266 *I_SYSTIME*) i_systime="$define"
7267 timeincl=`./findhdr sys/time.h`" $timeincl"
7268 echo "We'll include <sys/time.h>." >&4;;
7269 *) i_systime="$undef";;
7273 : check for fd_set items
7276 Checking to see how well your C compiler handles fd_set and friends ...
7278 $cat >fd_set.c <<EOCP
7279 #$i_systime I_SYS_TIME
7280 #$i_sysselct I_SYS_SELECT
7281 #$d_socket HAS_SOCKET
7282 #include <sys/types.h>
7284 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
7287 #include <sys/time.h>
7290 #include <sys/select.h>
7300 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
7307 if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
7308 d_fds_bits="$define"
7310 echo "Well, your system knows about the normal fd_set typedef..." >&4
7312 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
7313 d_fd_macros="$define"
7316 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
7318 d_fd_macros="$undef"
7322 Hmm, your compiler has some difficulty with fd_set. Checking further...
7324 if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
7327 echo "Well, your system has some sort of fd_set available..." >&4
7329 echo "and you have the normal fd_set macros." >&4
7330 d_fd_macros="$define"
7333 but not the normal fd_set macros! Gross! More work for me...
7335 d_fd_macros="$undef"
7338 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
7341 d_fd_macros="$undef"
7347 : check for type of arguments to select. This will only really
7348 : work if the system supports prototypes and provides one for
7352 : Make initial guess
7353 case "$selecttype" in
7356 $define) xxx='fd_set *' ;;
7360 *) xxx="$selecttype"
7365 'fd_set *') yyy='int *' ;;
7366 'int *') yyy='fd_set *' ;;
7371 Checking to see what type of arguments are expected by select().
7374 #$i_systime I_SYS_TIME
7375 #$i_sysselct I_SYS_SELECT
7376 #$d_socket HAS_SOCKET
7377 #include <sys/types.h>
7379 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
7382 #include <sys/time.h>
7385 #include <sys/select.h>
7391 Select_fd_set_t readfds;
7392 Select_fd_set_t writefds;
7393 Select_fd_set_t exceptfds;
7394 struct timeval timeout;
7395 select(width, readfds, writefds, exceptfds, &timeout);
7399 if $cc $ccflags -c -DSelect_fd_set_t="$xxx" try.c >/dev/null 2>&1 ; then
7401 echo "Your system uses $xxx for the arguments to select." >&4
7402 elif $cc $ccflags -c -DSelect_fd_set_t="$yyy" try.c >/dev/null 2>&1 ; then
7404 echo "Your system uses $yyy for the arguments to select." >&4
7406 rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
7413 *) selecttype = 'int *'
7417 : generate list of signal names
7421 echo "Generating a list of signal names..." >&4
7422 xxx=`./findhdr signal.h`" "`./findhdr sys/signal.h`
7423 xxx="$xxx "`./findhdr linux/signal.h`
7424 set X `cat $xxx 2>&1 | $awk '
7425 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $3 ~ /^[1-9][0-9]*$/ {
7426 sig[$3] = substr($2,4,20)
7427 if (max < $3 && $3 < 60) {
7433 for (i = 1; i <= max; i++) {
7447 echo 'kill -l' >/tmp/foo$$
7448 set X `csh -f </tmp/foo$$`
7452 0)set HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM
7460 echo "The following signals are available:"
7462 echo $sig_name | $awk \
7463 'BEGIN { linelen = 0 }
7465 for (i = 1; i < NF; i++) {
7467 linelen = linelen + length(name)
7470 linelen = length(name)
7477 : see what type is used for size_t
7478 set size_t sizetype 'unsigned int' stdio.h sys/types.h
7482 rp="What type is used for the length parameter for string functions?"
7486 : see what type is used for signed size_t
7487 set ssize_t ssizetype int stdio.h sys/types.h
7490 $cat > ssize.c <<EOM
7492 #include <sys/types.h>
7493 #define Size_t $sizetype
7494 #define SSize_t $dflt
7497 if (sizeof(Size_t) == sizeof(SSize_t))
7499 else if (sizeof(Size_t) == sizeof(int))
7506 if $cc $ccflags $ldflags -o ssize ssize.c $libs > /dev/null 2>&1 ; then
7508 echo "I'll be using $ssizetype for functions returning a byte count." >&4
7510 echo "(I can't compile the test program--please enlighten me!)"
7513 I need a type that is the same size as $sizetype, but is guaranteed to
7514 be signed. Common values are int and long.
7517 rp="What signed type is the same size as $sizetype?"
7521 $rm -f ssize ssize.[co]
7523 : see what type of char stdio uses.
7525 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
7526 echo "Your stdio uses unsigned chars." >&4
7527 stdchar="unsigned char"
7529 echo "Your stdio uses signed chars." >&4
7533 : see if time exists
7535 if set time val -f d_time; eval $csym; $val; then
7536 echo 'time() found.' >&4
7538 set time_t timetype long stdio.h sys/types.h
7542 rp="What type is returned by time() on this system?"
7546 echo 'time() not found, hope that will do.' >&4
7553 : see what type uids are declared as in the kernel
7554 set uid_t uidtype xxx stdio.h sys/types.h
7558 xxx=`./findhdr sys/user.h`
7559 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
7561 unsigned) dflt="$1 $2" ;;
7565 *) dflt="$uidtype";;
7568 rp="What is the type for user ids returned by getuid()?"
7572 : see if this is a sys/file.h system
7577 : do we need to #include <sys/file.h> ?
7583 echo "We'll be including <sys/file.h>." >&4
7586 echo "We won't be including <sys/file.h>." >&4
7596 : see if fcntl.h is there
7601 : see if we can include fcntl.h
7607 echo "We'll be including <fcntl.h>." >&4
7611 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
7613 echo "We won't be including <fcntl.h>." >&4
7625 : see if this is an grp system
7629 : see if this is a math.h system
7633 : see if memory.h is available.
7638 : See if it conflicts with string.h
7644 $cppstdin $cppflags $cppminus < $strings > mem.h
7645 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
7647 echo "We won't be including <memory.h>."
7657 : see if net/errno.h is available
7662 : Unfortunately, it causes problems on some systems. Arrgh.
7668 #include <net/errno.h>
7674 if $cc $ccflags -c try.c >/dev/null 2>&1; then
7675 echo "We'll be including <net/errno.h>." >&4
7677 echo "We won't be including <net/errno.h>." >&4
7686 : get C preprocessor symbols handy
7688 $echo $n "Hmm... $c"
7689 echo $al | $tr ' ' '\012' >Cppsym.know
7701 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
7703 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
7706 unknown="\$unknown \$sym"
7716 echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
7718 exit 0; _ _ _ _\1\\ \1\\
7721 echo "exit 1; _ _ _" >>Cppsym\$\$
7722 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
7724 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
7730 $rm -f Cppsym\$\$ Cppsym2\$\$
7735 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
7737 : now check the C compiler for additional symbols
7743 for i in \`$cc -v -c tmp.c 2>&1\`
7746 -D*) echo "\$i" | $sed 's/^-D//';;
7747 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
7754 ./ccsym | $sort | $uniq >ccsym.raw
7755 $awk '/\=/ { print $0; next }
7756 { print $0"=1" }' ccsym.raw >ccsym.list
7757 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
7758 $comm -13 ccsym.true ccsym.list >ccsym.own
7759 $comm -12 ccsym.true ccsym.list >ccsym.com
7760 $comm -23 ccsym.true ccsym.list >ccsym.cpp
7763 if $test -z ccsym.raw; then
7764 echo "Your C compiler doesn't seem to define any symbol!" >&4
7766 echo "However, your C preprocessor defines the following ones:"
7769 if $test -s ccsym.com; then
7770 echo "Your C compiler and pre-processor define these symbols:"
7771 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
7774 $test "$silent" || sleep 1
7776 if $test -s ccsym.cpp; then
7777 $test "$also" && echo " "
7778 echo "Your C pre-processor ${also}defines the following $symbols:"
7779 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
7781 $test "$silent" || sleep 1
7783 if $test -s ccsym.own; then
7784 $test "$also" && echo " "
7785 echo "Your C compiler ${also}defines the following cpp variables:"
7786 $sed -e 's/\(.*\)=1/\1/' ccsym.own
7787 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
7788 $test "$silent" || sleep 1
7793 : see if this is a termio system
7797 if $test `./findhdr termios.h`; then
7798 set tcsetattr i_termios
7804 "$define") echo "You have POSIX termios.h... good!" >&4;;
7805 *) if ./Cppsym pyr; then
7806 case "`/bin/universe`" in
7807 ucb) if $test `./findhdr sgtty.h`; then
7809 echo "<sgtty.h> found." >&4
7811 echo "System is pyramid with BSD universe."
7812 echo "<sgtty.h> not found--you could have problems." >&4
7814 *) if $test `./findhdr termio.h`; then
7816 echo "<termio.h> found." >&4
7818 echo "System is pyramid with USG universe."
7819 echo "<termio.h> not found--you could have problems." >&4
7823 if $test `./findhdr termio.h`; then
7824 echo "<termio.h> found." >&4
7826 elif $test `./findhdr sgtty.h`; then
7827 echo "<sgtty.h> found." >&4
7830 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
7833 if $test `./findhdr sgtty.h`; then
7834 echo "<sgtty.h> found." >&4
7836 elif $test `./findhdr termio.h`; then
7837 echo "<termio.h> found." >&4
7840 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
7844 set i_termio; eval $setvar
7845 val=$val2; set i_sgtty; eval $setvar
7846 val=$val3; set i_termios; eval $setvar
7848 : see if stdarg is available
7850 if $test `./findhdr stdarg.h`; then
7851 echo "<stdarg.h> found." >&4
7854 echo "<stdarg.h> NOT found." >&4
7858 : see if varags is available
7860 if $test `./findhdr varargs.h`; then
7861 echo "<varargs.h> found." >&4
7863 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
7866 : set up the varargs testing programs
7867 $cat > varargs.c <<EOP
7872 #include <varargs.h>
7890 p = va_arg(ap, char *);
7895 $cat > varargs <<EOP
7896 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
7905 : now check which varargs header should be included
7910 if `./varargs I_STDARG`; then
7912 elif `./varargs I_VARARGS`; then
7917 if `./varargs I_VARARGS`; then
7924 echo "I could not find the definition for va_dcl... You have problems..." >&4
7925 val="$undef"; set i_stdarg; eval $setvar
7926 val="$undef"; set i_varargs; eval $setvar
7933 val="$define"; set i_stdarg; eval $setvar
7934 val="$undef"; set i_varargs; eval $setvar
7937 val="$undef"; set i_stdarg; eval $setvar
7938 val="$define"; set i_varargs; eval $setvar
7941 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
7945 : see if stddef is available
7946 set stddef.h i_stddef
7949 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
7950 set sys/filio.h i_sysfilio
7953 if $test `./findhdr sys/ioctl.h`; then
7955 echo '<sys/ioctl.h> found.' >&4
7958 if $test $i_sysfilio = "$define"; then
7959 echo '<sys/ioctl.h> NOT found.' >&4
7961 $test $i_sgtty = "$define" && xxx="sgtty.h"
7962 $test $i_termio = "$define" && xxx="termio.h"
7963 $test $i_termios = "$define" && xxx="termios.h"
7964 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
7970 : see if this is a sys/param system
7971 set sys/param.h i_sysparam
7974 : see if sys/stat.h is available
7975 set sys/stat.h i_sysstat
7978 : see if sys/types.h has to be included
7979 set sys/types.h i_systypes
7982 : see if this is a unistd.h system
7983 set unistd.h i_unistd
7986 : see if this is an utime system
7990 : see if this is a vfork system
8001 : Remove build directory name from cppstdin so it can be used from
8002 : either the present location or the final installed location.
8004 : Get out of the UU directory to get correct path name.
8008 echo "Stripping down cppstdin path name"
8014 : end of configuration questions
8016 echo "End of configuration questions."
8019 : back to where it started
8020 if test -d ../UU; then
8024 : configuration may be patched via a 'config.over' file
8025 if $test -f config.over; then
8028 rp='I see a config.over file. Do you wish to load it?'
8031 n*) echo "OK, I'll ignore it.";;
8033 echo "Configuration override changes have been loaded."
8038 : in case they want portability, strip down executable paths
8039 case "$d_portable" in
8042 echo "Stripping down executable paths..." >&4
8043 for file in $loclist $trylist; do
8049 : create config.sh file
8051 echo "Creating config.sh..." >&4
8052 $spitshell <<EOT >config.sh
8055 # This file was produced by running the Configure script. It holds all the
8056 # definitions figured out by Configure. Should you modify one of these values,
8057 # do not forget to propagate your changes by running "Configure -der". You may
8058 # instead choose to run each of the .SH files by yourself, or "Configure -S".
8061 # Configuration time: $cf_time
8062 # Configured by: $cf_by
8063 # Target system: $myuname
8073 Revision='$Revision'
8077 alignbytes='$alignbytes'
8078 aphostname='$aphostname'
8080 archlibexp='$archlibexp'
8081 archname='$archname'
8089 byteorder='$byteorder'
8091 castflags='$castflags'
8094 cccdlflags='$cccdlflags'
8095 ccdlflags='$ccdlflags'
8102 clocktype='$clocktype'
8104 compress='$compress'
8105 contains='$contains'
8109 cpp_stuff='$cpp_stuff'
8110 cppflags='$cppflags'
8112 cppminus='$cppminus'
8114 cppstdin='$cppstdin'
8115 cryptlib='$cryptlib'
8117 d_Gconvert='$d_Gconvert'
8118 d_access='$d_access'
8120 d_archlib='$d_archlib'
8121 d_attribut='$d_attribut'
8125 d_bsdpgrp='$d_bsdpgrp'
8127 d_casti32='$d_casti32'
8128 d_castneg='$d_castneg'
8129 d_charvspr='$d_charvspr'
8131 d_chroot='$d_chroot'
8132 d_chsize='$d_chsize'
8133 d_closedir='$d_closedir'
8137 d_cuserid='$d_cuserid'
8138 d_dbl_dig='$d_dbl_dig'
8139 d_difftime='$d_difftime'
8140 d_dirnamlen='$d_dirnamlen'
8141 d_dlerror='$d_dlerror'
8142 d_dlopen='$d_dlopen'
8143 d_dlsymun='$d_dlsymun'
8144 d_dosuid='$d_dosuid'
8146 d_eunice='$d_eunice'
8147 d_fchmod='$d_fchmod'
8148 d_fchown='$d_fchown'
8150 d_fd_macros='$d_fd_macros'
8151 d_fd_set='$d_fd_set'
8152 d_fds_bits='$d_fds_bits'
8153 d_fgetpos='$d_fgetpos'
8154 d_flexfnam='$d_flexfnam'
8157 d_fpathconf='$d_fpathconf'
8158 d_fsetpos='$d_fsetpos'
8159 d_getgrps='$d_getgrps'
8160 d_gethent='$d_gethent'
8161 d_gethname='$d_gethname'
8162 d_getlogin='$d_getlogin'
8163 d_getpgrp2='$d_getpgrp2'
8164 d_getpgrp='$d_getpgrp'
8165 d_getppid='$d_getppid'
8166 d_getprior='$d_getprior'
8169 d_isascii='$d_isascii'
8170 d_killpg='$d_killpg'
8172 d_locconv='$d_locconv'
8176 d_mbstowcs='$d_mbstowcs'
8177 d_mbtowc='$d_mbtowc'
8178 d_memcmp='$d_memcmp'
8179 d_memcpy='$d_memcpy'
8180 d_memmove='$d_memmove'
8181 d_memset='$d_memset'
8183 d_mkfifo='$d_mkfifo'
8184 d_mktime='$d_mktime'
8186 d_msgctl='$d_msgctl'
8187 d_msgget='$d_msgget'
8188 d_msgrcv='$d_msgrcv'
8189 d_msgsnd='$d_msgsnd'
8190 d_mymalloc='$d_mymalloc'
8192 d_oldsock='$d_oldsock'
8194 d_pathconf='$d_pathconf'
8196 d_phostname='$d_phostname'
8198 d_portable='$d_portable'
8200 d_pwchange='$d_pwchange'
8201 d_pwclass='$d_pwclass'
8202 d_pwcomment='$d_pwcomment'
8203 d_pwexpire='$d_pwexpire'
8204 d_pwquota='$d_pwquota'
8205 d_readdir='$d_readdir'
8206 d_readlink='$d_readlink'
8207 d_rename='$d_rename'
8208 d_rewinddir='$d_rewinddir'
8210 d_safebcpy='$d_safebcpy'
8211 d_safemcpy='$d_safemcpy'
8212 d_seekdir='$d_seekdir'
8213 d_select='$d_select'
8215 d_semctl='$d_semctl'
8216 d_semget='$d_semget'
8218 d_setegid='$d_setegid'
8219 d_seteuid='$d_seteuid'
8220 d_setlinebuf='$d_setlinebuf'
8221 d_setlocale='$d_setlocale'
8222 d_setpgid='$d_setpgid'
8223 d_setpgrp2='$d_setpgrp2'
8224 d_setpgrp='$d_setpgrp'
8225 d_setprior='$d_setprior'
8226 d_setregid='$d_setregid'
8227 d_setresgid='$d_setresgid'
8228 d_setresuid='$d_setresuid'
8229 d_setreuid='$d_setreuid'
8230 d_setrgid='$d_setrgid'
8231 d_setruid='$d_setruid'
8232 d_setsid='$d_setsid'
8235 d_shmatprototype='$d_shmatprototype'
8236 d_shmctl='$d_shmctl'
8238 d_shmget='$d_shmget'
8239 d_shrplib='$d_shrplib'
8240 d_sitelib='$d_sitelib'
8241 d_socket='$d_socket'
8242 d_sockpair='$d_sockpair'
8243 d_statblks='$d_statblks'
8244 d_stdio_cnt_lval='$d_stdio_cnt_lval'
8245 d_stdio_ptr_lval='$d_stdio_ptr_lval'
8246 d_stdiobase='$d_stdiobase'
8247 d_stdstdio='$d_stdstdio'
8248 d_strchr='$d_strchr'
8249 d_strcoll='$d_strcoll'
8250 d_strctcpy='$d_strctcpy'
8251 d_strerrm='$d_strerrm'
8252 d_strerror='$d_strerror'
8253 d_strxfrm='$d_strxfrm'
8254 d_suidsafe='$d_suidsafe'
8255 d_symlink='$d_symlink'
8256 d_syscall='$d_syscall'
8257 d_sysconf='$d_sysconf'
8258 d_sysernlst='$d_sysernlst'
8259 d_syserrlst='$d_syserrlst'
8260 d_system='$d_system'
8261 d_tcgetpgrp='$d_tcgetpgrp'
8262 d_tcsetpgrp='$d_tcsetpgrp'
8263 d_telldir='$d_telldir'
8266 d_truncate='$d_truncate'
8267 d_tzname='$d_tzname'
8271 d_void_closedir='$d_void_closedir'
8272 d_voidsig='$d_voidsig'
8273 d_voidtty='$d_voidtty'
8274 d_volatile='$d_volatile'
8275 d_vprintf='$d_vprintf'
8277 d_waitpid='$d_waitpid'
8278 d_wcstombs='$d_wcstombs'
8279 d_wctomb='$d_wctomb'
8282 db_hashtype='$db_hashtype'
8283 db_prefixtype='$db_prefixtype'
8284 defvoidused='$defvoidused'
8285 direntrytype='$direntrytype'
8288 dynamic_ext='$dynamic_ext'
8292 eunicefix='$eunicefix'
8294 extensions='$extensions'
8297 fpostype='$fpostype'
8298 freetype='$freetype'
8299 full_csh='$full_csh'
8300 full_sed='$full_sed'
8302 gccversion='$gccversion'
8306 groupcat='$groupcat'
8307 groupstype='$groupstype'
8309 h_sysfile='$h_sysfile'
8313 i_bsdioctl='$i_bsdioctl'
8316 i_dirent='$i_dirent'
8323 i_limits='$i_limits'
8324 i_malloc='$i_malloc'
8326 i_memory='$i_memory'
8328 i_neterrno='$i_neterrno'
8332 i_stdarg='$i_stdarg'
8333 i_stddef='$i_stddef'
8334 i_stdlib='$i_stdlib'
8335 i_string='$i_string'
8336 i_sysdir='$i_sysdir'
8337 i_sysfile='$i_sysfile'
8338 i_sysfilio='$i_sysfilio'
8340 i_sysioctl='$i_sysioctl'
8341 i_sysndir='$i_sysndir'
8342 i_sysparam='$i_sysparam'
8343 i_sysselct='$i_sysselct'
8344 i_syssockio='$i_syssockio'
8345 i_sysstat='$i_sysstat'
8346 i_systime='$i_systime'
8347 i_systimek='$i_systimek'
8348 i_systimes='$i_systimes'
8349 i_systypes='$i_systypes'
8350 i_termio='$i_termio'
8351 i_termios='$i_termios'
8353 i_unistd='$i_unistd'
8355 i_varargs='$i_varargs'
8356 i_varhdr='$i_varhdr'
8360 installarchlib='$installarchlib'
8361 installbin='$installbin'
8362 installman1dir='$installman1dir'
8363 installman3dir='$installman3dir'
8364 installprivlib='$installprivlib'
8365 installscript='$installscript'
8366 installsitelib='$installsitelib'
8368 known_extensions='$known_extensions'
8372 lddlflags='$lddlflags'
8378 libswanted='$libswanted'
8387 lseektype='$lseektype'
8391 mallocobj='$mallocobj'
8392 mallocsrc='$mallocsrc'
8393 malloctype='$malloctype'
8395 man1direxp='$man1direxp'
8398 man3direxp='$man3direxp'
8402 mips_type='$mips_type'
8405 modetype='$modetype'
8408 myarchname='$myarchname'
8409 mydomain='$mydomain'
8410 myhostname='$myhostname'
8415 optimize='$optimize'
8416 orderlib='$orderlib'
8421 patchlevel='$patchlevel'
8424 phostname='$phostname'
8429 prefixexp='$prefixexp'
8431 privlibexp='$privlibexp'
8432 prototype='$prototype'
8433 randbits='$randbits'
8438 scriptdir='$scriptdir'
8439 scriptdirexp='$scriptdirexp'
8441 selecttype='$selecttype'
8442 sendmail='$sendmail'
8445 sharpbang='$sharpbang'
8446 shmattype='$shmattype'
8449 sig_name='$sig_name'
8450 signal_t='$signal_t'
8452 sitelibexp='$sitelibexp'
8453 sizetype='$sizetype'
8458 sockethdr='$sockethdr'
8459 socketlib='$socketlib'
8461 spackage='$spackage'
8462 spitshell='$spitshell'
8464 ssizetype='$ssizetype'
8466 static_ext='$static_ext'
8468 stdio_base='$stdio_base'
8469 stdio_bufsiz='$stdio_bufsiz'
8470 stdio_cnt='$stdio_cnt'
8471 stdio_ptr='$stdio_ptr'
8479 timeincl='$timeincl'
8480 timetype='$timetype'
8488 usemymalloc='$usemymalloc'
8490 useposix='$useposix'
8491 usevfork='$usevfork'
8495 voidflags='$voidflags'
8500 : add special variables
8501 $test -f patchlevel.h && \
8502 awk '/^#define/ {printf "%s=%s\n",$2,$3}' patchlevel.h >>config.sh
8503 echo "CONFIG=true" >>config.sh
8505 : propagate old symbols
8506 if $test -f UU/config.sh; then
8507 <UU/config.sh sort | uniq >UU/oldconfig.sh
8508 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
8509 sort | uniq -u >UU/oldsyms
8510 set X `cat UU/oldsyms`
8516 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
8518 echo "# Variables propagated from previous config.sh file." >>config.sh
8519 for sym in `cat UU/oldsyms`; do
8520 echo " Propagating $hint variable "'$'"$sym..."
8521 eval 'tmp="$'"${sym}"'"'
8523 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
8529 : Finish up by extracting the .SH files
8543 If you'd like to make any changes to the config.sh file before I begin
8544 to configure things, do it as a shell escape now (e.g. !vi config.sh).
8547 rp="Press return or use a shell escape to edit config.sh:"
8552 *) : in case they cannot read
8558 : if this fails, just run all the .SH files by hand
8565 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
8572 Now you need to generate make dependencies by running "make depend".
8573 You might prefer to run it in background: "make depend > makedepend.out &"
8574 It can take a while, so you might not want to run it right now.
8579 rp="Run make depend now?"
8583 make depend && echo "Now you must run a make."
8586 echo "You must run 'make depend' then 'make'."
8589 elif test -f [Mm]akefile; then
8591 echo "Now you must run a make."
8596 $rm -f kit*isdone ark*isdone