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.8 1995/07/25 13:40:02 ram Exp $
23 # Generated on Fri Feb 9 14:09:07 EST 1996 [metaconfig 3.0 PL60]
28 SCO csh still thinks true is false. Write to SCO today and tell them that next
29 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
31 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
32 we'd have to do is go in and swap the && and || tokens, wherever they are.)
34 [End of diatribe. We now return you to your regularly scheduled programming...]
38 OOPS! You naughty creature! You didn't run Configure with sh!
39 I will attempt to remedy the situation by running sh for you...
42 true || cat /tmp/c1$$ /tmp/c2$$
43 true || exec sh $0 $argv:q
45 (exit $?0) || cat /tmp/c2$$
46 (exit $?0) || exec sh $0 $argv:q
47 rm -f /tmp/c1$$ /tmp/c2$$
49 : compute my invocation name
53 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
58 : Proper PATH separator
60 : On OS/2 this directory should exist if this is not floppy only system :-]
63 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
64 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
68 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
69 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
70 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
71 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
72 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
73 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
74 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
75 paths="$paths /sbin /usr/sbin /usr/libexec"
81 *) test -d $p && PATH=$PATH$p_$p ;;
90 echo "Say 'sh $me', not 'sh <$me'"
94 : On HP-UX, large Configure scripts may exercise a bug in /bin/sh
95 if test -f /hp-ux -a -f /bin/ksh; then
96 if (PATH=.; alias -x) >/dev/null 2>&1; then
97 : already under /bin/ksh
100 (Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.)
103 exec /bin/ksh $0 "$@"
106 : Warn them if they use ksh on other systems
107 (PATH=.; alias -x) >/dev/null 2>&1 && \
109 (I see you are using the Korn shell. Some ksh's blow up on $me,
110 especially on exotic machines. If yours does, try the Bourne shell instead.)
114 : Configure runs within the UU subdirectory
115 test -d UU || mkdir UU
589 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
592 : We must find out about Eunice early
594 if test -f /etc/unixtovms; then
595 eunicefix=/etc/unixtovms
597 if test -f /etc/unixtovms.exe; then
598 eunicefix=/etc/unixtovms.exe
601 : list of known cpp symbols, sorted alphabetically
602 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
603 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
604 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
605 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
606 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
607 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
608 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
609 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
610 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
611 al="$al VMS Xenix286"
612 al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI"
613 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
614 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
615 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
616 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
617 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
618 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
619 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
620 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
621 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
622 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
623 al="$al __SVR4_2__ __UMAXV__"
624 al="$al ____386BSD____ __alpha __alpha__ __amiga"
625 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
626 al="$al __host_mips__"
627 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
628 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
629 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
630 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
631 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
632 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
633 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
634 al="$al __mc88100 __mc88100__ __mips __mips__"
635 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
636 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
637 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
638 al="$al _host_mips _mips _unix"
639 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
640 al="$al apollo ardent att386 att3b"
641 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
642 al="$al cadmus clipper concurrent convex cray ctix"
643 al="$al dmert encore gcos gcx gimpel gould"
644 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
645 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
646 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
647 al="$al i186 i286 i386 i486 i8086"
648 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
649 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
650 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
651 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
652 al="$al mc88000 mc88100 merlin mert mips mvs n16"
653 al="$al ncl_el ncl_mr"
654 al="$al news1500 news1700 news1800 news1900 news3700"
655 al="$al news700 news800 news900 ns16000 ns32000"
656 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
657 al="$al parisc pc532 pdp11 plexus posix pyr"
658 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
659 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
660 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
661 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
662 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
663 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
668 : default library list
670 : set useposix=false in your hint file to disable the POSIX extension.
672 : set usesafe=false in your hint if you want to skip the Safe extension.
674 : Define several unixisms. These can be used in hint files.
676 : Extra object files, if any, needed on this platform.
678 : Possible local include directories to search.
679 : Set locincpth to "" in a hint file to defeat local include searches.
680 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
681 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
683 : no include file wanted by default
686 : change the next line if compiling for Xenix/286 on Xenix/386
687 xlibpth='/usr/lib/386 /lib/386'
689 : Possible local library directories to search.
690 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
691 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
693 : general looking path for locating libraries
694 glibpth="/lib/pa1.1 /usr/shlib /usr/lib/large /lib /usr/lib"
695 glibpth="$glibpth $xlibpth /lib/large /usr/lib/small /lib/small"
696 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/shlib"
698 : Private path used by Configure to find libraries. Its value
699 : is prepended to libpth. This variable takes care of special
700 : machines, like the mips. Usually, it should be empty.
703 : full support for void wanted by default
706 : List of libraries we want.
707 libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl'
708 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
709 libswanted="$libswanted ucb bsd BSD PW x"
710 : We probably want to search /usr/shlib before most other libraries.
711 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
712 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
713 glibpth="/usr/shlib $glibpth"
714 : Do not use vfork unless overridden by a hint file.
717 : script used to extract .SH files with variable substitutions
720 echo "Doing variable substitutions on .SH files..."
721 if test -f MANIFEST; then
722 shlist=`awk '{print $1}' <MANIFEST | grep '\.SH'`
723 : Pick up possible extension manifests.
724 for dir in ext/* ; do
725 if test -f $dir/MANIFEST; then
726 xxx=`awk '{print $1}' < $dir/MANIFEST |
727 sed -n "/\.SH$/ s@^@$dir/@p"`
728 shlist="$shlist $xxx"
733 echo "(Looking for .SH files under the current directory.)"
734 set x `find . -name "*.SH" -print`
738 0) set x *.SH; shift;;
740 if test ! -f $1; then
746 dir=`expr X$file : 'X\(.*\)/'`
747 file=`expr X$file : 'X.*/\(.*\)'`
748 (cd $dir && . ./$file)
755 if test -f config_h.SH; then
756 if test ! -f config.h; then
757 : oops, they left it out of MANIFEST, probably, so do it anyway.
763 : produce awk script to parse command line options
764 cat >options.awk <<'EOF'
766 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
768 len = length(optstr);
769 for (i = 1; i <= len; i++) {
770 c = substr(optstr, i, 1);
771 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
782 if (substr(str, 1, 1) != "-") {
783 printf("'%s'\n", str);
787 for (i = 2; i <= len; i++) {
788 c = substr(str, i, 1);
790 printf("-%s\n", substr(str, i));
796 printf("'%s'\n", substr(str, i + 1));
809 : process the command line options
810 set X `for arg in "$@"; do echo "X$arg"; done |
811 sed -e s/X// | awk -f options.awk`
816 : set up default values
829 while test $# -gt 0; do
831 -d) shift; fastread=yes;;
832 -e) shift; alldone=cont;;
836 if test -r "$1"; then
839 echo "$me: cannot read config file $1." >&2
844 -h) shift; error=true;;
845 -r) shift; reuseval=true;;
846 -s) shift; silent=true;;
847 -E) shift; alldone=exit;;
848 -K) shift; knowitall=true;;
849 -O) shift; override=true;;
850 -S) shift; extractsh=true;;
855 echo "$me: use '-U symbol=', not '-D symbol='." >&2
856 echo "$me: ignoring -D $1" >&2
859 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
860 *) echo "$1='define'" >> optdef.sh;;
867 *=) echo "$1" >> optdef.sh;;
869 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
870 echo "$me: ignoring -U $1" >&2
872 *) echo "$1='undef'" >> optdef.sh;;
876 -V) echo "$me generated by metaconfig 3.0 PL60." >&2
879 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
887 Usage: $me [-dehrEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
888 [-U symbol] [-U symbol=]
889 -d : use defaults for all answers.
890 -e : go on without questioning past the production of config.sh.
891 -f : specify an alternate default configuration file.
892 -h : print this help message and exit (with an error status).
893 -r : reuse C symbols value if possible (skips costly nm extraction).
894 -s : silent mode, only echoes questions and essential information.
895 -D : define symbol to have some value:
896 -D symbol symbol gets the value 'define'
897 -D symbol=value symbol gets the value 'value'
898 -E : stop at the end of questions, after having produced config.sh.
899 -K : do not use unless you know what you are doing.
900 -O : let -D and -U override definitions from loaded configuration file.
901 -S : perform variable substitutions on all .SH files (can mix with -f)
902 -U : undefine symbol:
903 -U symbol symbol gets the value 'undef'
904 -U symbol= symbol gets completely empty
905 -V : print version number and exit (with a zero status).
913 true) exec 1>/dev/null;;
916 : run the defines and the undefines, if any, but leave the file out there...
923 '') config_sh='config.sh'; config='./config.sh';;
924 /*) config="$config_sh";;
925 *) config="./$config_sh";;
928 echo "Fetching answers from $config_sh..."
931 test "$override" && . ./optdef.sh
942 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
943 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
944 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
945 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
946 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
949 : Eunice requires " " instead of "", can you believe it
952 echo "Beginning of configuration questions for $package."
954 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
956 : Some greps do not return status, grrr.
957 echo "grimblepritz" >grimble
958 if grep blurfldyick grimble >/dev/null 2>&1 ; then
960 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
966 : the following should work in any shell
970 echo "AGH! Grep doesn't return a status. Attempting remedial action."
971 cat >contains <<'EOSS'
972 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
977 : first determine how to suppress newline on echo command
979 echo "Checking echo to see how to suppress newlines..."
980 (echo "hi there\c" ; echo " ") >.echotmp
981 if $contains c .echotmp >/dev/null 2>&1 ; then
992 echo $n "The star should be here-->$c"
996 : Now test for existence of everything in MANIFEST
998 if test -f ../MANIFEST; then
999 echo "First let's make sure your kit is complete. Checking..." >&4
1000 awk '$1 !~ /PACK[A-Z]+/ {print $1}' ../MANIFEST | split -50
1002 for filelist in x??; do
1003 (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing)
1005 if test -s missing; then
1009 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1011 You have the option of continuing the configuration process, despite the
1012 distinct possibility that your kit is damaged, by typing 'y'es. If you
1013 do, don't blame me if something goes wrong. I advise you to type 'n'o
1014 and contact the author (lwall@sems.com).
1017 echo $n "Continue? [n] $c" >&4
1021 echo "Continuing..." >&4
1025 echo "ABORTING..." >&4
1030 echo "Looks good..." >&4
1033 echo "There is no MANIFEST file. I hope your kit is complete !"
1037 : compute the number of columns on the terminal for proper question formatting
1042 : set up the echo used in my read
1043 myecho="case \"\$xxxm\" in
1044 '') echo $n \"\$rp $c\" >&4;;
1046 '') echo $n \"[\$xxxm] $c\";;
1048 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1050 echo $n \"[\$xxxm] $c\" >&4
1052 echo $n \"\$rp [\$xxxm] $c\" >&4
1058 : now set up to do reads with possible shell escape and default assignment
1063 case "\$fastread" in
1064 yes) case "\$dflt" in
1067 case "\$silent-\$rp" in
1072 *) case "\$silent" in
1073 true) case "\$rp" in
1078 while expr "X\$ans" : "X!" >/dev/null; do
1082 aok=''; eval "ans=\"\$answ\"" && aok=y
1087 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1092 echo "(OK, I'll run with -d after this question.)" >&4
1095 echo "*** Sorry, \$1 not supported yet." >&4
1107 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1117 echo "*** Substitution done -- please confirm."
1119 ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
1124 echo "*** Error -- try again."
1131 case "\$ans\$xxxm\$nostick" in
1143 : create .config dir to save info across Configure sessions
1144 test -d ../.config || mkdir ../.config
1145 cat >../.config/README <<EOF
1146 This directory created by Configure to save information that should
1147 persist across sessions.
1149 You may safely delete it if you wish.
1152 : general instructions
1155 user=`( (logname) 2>/dev/null || whoami) 2>&1`
1156 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1159 rp='Would you like to see the instructions?'
1170 This installation shell script will examine your system and ask you questions
1171 to determine how the perl5 package should be installed. If you get
1172 stuck on a question, you may use a ! shell escape to start a subshell or
1173 execute a command. Many of the questions will have default answers in square
1174 brackets; typing carriage return will give you the default.
1176 On some of the questions which ask for file or directory names you are allowed
1177 to use the ~name construct to specify the login directory belonging to "name",
1178 even if you don't have a shell which knows about that. Questions where this is
1179 allowed will be marked "(~name ok)".
1183 dflt='Type carriage return to continue'
1187 The prompter used in this script allows you to use shell variables and
1188 backticks in your answers. You may use $1, $2, etc... to refer to the words
1189 in the default answer, as if the default line was a set of arguments given to a
1190 script shell. This means you may also use $* to repeat the whole default line,
1191 so you do not have to re-type everything to add something to the default.
1193 Everytime there is a substitution, you will have to confirm. If there is an
1194 error (e.g. an unmatched backtick), the default answer will remain unchanged
1195 and you will be prompted again.
1197 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1198 the questions and use the computed defaults (or the previous answers if there
1199 was already a config.sh file). Type 'Configure -h' for a list of options.
1200 You may also start interactively and then answer '& -d' at any prompt to turn
1201 on the non-interactive behaviour for the remaining of the execution.
1207 Much effort has been expended to ensure that this shell script will run on any
1208 Unix system. If despite that it blows up on yours, your best bet is to edit
1209 Configure and run it again. If you can't run Configure for some reason,
1210 you'll have to generate a config.sh file by hand. Whatever problems you
1211 have, let me (lwall@sems.com) know how I blew it.
1213 This installation script affects things in two ways:
1215 1) it may do direct variable substitutions on some of the files included
1217 2) it builds a config.h file for inclusion in C programs. You may edit
1218 any of these files as the need arises after running this script.
1220 If you make a mistake on a question, there is no easy way to back up to it
1221 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1222 files. Configure will offer to let you do this before it runs the SH files.
1225 dflt='Type carriage return to continue'
1227 case "$firsttime" in
1228 true) echo $user >>../.config/instruct;;
1232 : see if sh knows # comments
1234 echo "Checking your sh to see if it knows about # comments..." >&4
1235 if `sh -c '#' >/dev/null 2>&1`; then
1236 echo "Your sh handles # comments correctly."
1240 echo "Okay, let's see if #! works on this system..."
1242 test -f $xcat || xcat=/usr/bin/cat
1247 if test -s today; then
1251 echo "#! $xcat" > try
1255 if test -s today; then
1259 echo "It's just a comment."
1264 echo "Your sh doesn't grok # comments--I will strip them later on."
1267 echo "exec grep -v '^[ ]*#'" >spitshell
1269 $eunicefix spitshell
1270 spitshell=`pwd`/spitshell
1272 echo "I presume that if # doesn't work, #! won't work either!"
1277 : figure out how to guarantee sh startup
1279 echo "Checking out how to guarantee sh startup..." >&4
1281 *bsd*|sys5*) startsh=$sharpbang"/$SYSTYPE/bin/sh";;
1282 *) startsh=$sharpbang'/bin/sh';;
1284 echo "Let's see if '$startsh' works..."
1294 echo "Yup, it does."
1296 echo "Nope. You may have to fix up the shell scripts to make sure sh runs them."
1300 : find out where common programs are
1302 echo "Locating common programs..." >&4
1315 if test -d \$dir/\$thing; then
1321 for thisthing in \$dir/\$thing; do
1322 : just loop through to pick last item
1324 if test -f \$thisthing; then
1327 elif test -f \$dir/\$thing.exe; then
1328 : on Eunice apparently
1376 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1377 pth="$pth /lib /usr/lib"
1378 for file in $loclist; do
1379 xxx=`./loc $file $file $pth`
1384 echo $file is in $xxx.
1387 echo $file is in $xxx.
1390 echo "I don't know where '$file' is, and my life depends on it." >&4
1391 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1397 echo "Don't worry if any of the following aren't found..."
1399 for file in $trylist; do
1400 xxx=`./loc $file $file $pth`
1405 echo $file is in $xxx.
1408 echo $file is in $xxx.
1411 echo "I don't see $file out there, $say."
1418 echo "Substituting grep for egrep."
1424 echo "Hopefully test is built into your sh."
1427 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1428 echo "Using the test built into your sh."
1436 echo "Hopefully echo is built into your sh."
1441 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1442 $echo $n "hi there$c" >foo1
1443 echo $n "hi there$c" >foo2
1444 if cmp foo1 foo2 >/dev/null 2>&1; then
1445 echo "They are compatible. In fact, they may be identical."
1452 They are not compatible! You are probably running ksh on a non-USG system.
1453 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1454 have echo built in and we may have to run some Bourne shell scripts. That
1455 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1458 $echo $n "The star should be here-->$c"
1465 : determine whether symbolic links are supported
1468 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1469 echo "Symbolic links are supported." >&4
1472 echo "Symbolic links are NOT supported." >&4
1477 : see whether [:lower:] and [:upper:] are supported character classes
1481 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1483 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1488 echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4
1491 : set up the translation script tr, must be called with ./tr of course
1495 '[A-Z][a-z]') exec $tr '$up' '$low';;
1496 '[a-z][A-Z]') exec $tr '$low' '$up';;
1503 : Try to determine whether config.sh was made on this system
1504 case "$config_sh" in
1506 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1507 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1508 ./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
1509 newmyuname="$myuname"
1511 case "$knowitall" in
1513 if test -f ../config.sh; then
1514 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1515 eval "`grep myuname= ../config.sh`"
1517 if test "X$myuname" = "X$newmyuname"; then
1525 : Get old answers from old config file if Configure was run on the
1526 : same system, otherwise use the hints.
1529 if test -f config.sh; then
1531 rp="I see a config.sh file. Shall I use it to set the defaults?"
1534 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1535 *) echo "Fetching default answers from your old config.sh file..." >&4
1546 if test ! -f config.sh; then
1549 First time through, eh? I have some defaults handy for the following systems:
1552 cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4
1554 : Half the following guesses are probably wrong... If you have better
1555 : tests or hints, please send them to lwall@sems.com
1556 : The metaconfig authors would also appreciate a copy...
1557 $test -f /irix && osname=irix
1558 $test -f /xenix && osname=sco_xenix
1559 $test -f /dynix && osname=dynix
1560 $test -f /dnix && osname=dnix
1561 $test -f /unicos && osname=unicos && osvers=`$uname -r`
1562 $test -f /bin/mips && /bin/mips && osname=mips
1563 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1564 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1565 $test -d /usr/apollo/bin && osname=apollo
1566 $test -f /etc/saf/_sactab && osname=svr4
1567 $test -d /usr/include/minix && osname=minix
1568 if $test -d /MachTen; then
1570 if $test -x /sbin/version; then
1571 osvers=`/sbin/version | $awk '{print $2}' |
1572 $sed -e 's/[A-Za-z]$//'`
1573 elif $test -x /usr/etc/version; then
1574 osvers=`/usr/etc/version | $awk '{print $2}' |
1575 $sed -e 's/[A-Za-z]$//'`
1580 if $test -f $uname; then
1588 umips) osname=umips ;;
1591 [23]100) osname=mips ;;
1592 next*) osname=next ;;
1593 news*) osname=news ;;
1595 if $test -f /etc/kconfig; then
1597 if test "$lns" = "ln -s"; then
1599 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1601 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
1610 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
1612 'not found') osvers="$4"."$3" ;;
1613 '<3240'|'<>3240') osvers=3.2.0 ;;
1614 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
1615 '=3250'|'>3250') osvers=3.2.5 ;;
1622 domainos) osname=apollo
1628 freebsd) osname=freebsd
1630 genix) osname=genix ;;
1635 *.10.*) osvers=10 ;;
1652 netbsd*) osname=netbsd
1655 bsd386) osname=bsd386
1658 next*) osname=next ;;
1659 solaris) osname=solaris
1661 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1668 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1672 titanos) osname=titanos
1681 ultrix) osname=ultrix
1687 osvers=`echo "$3" | sed 's/^[vt]//'`
1689 hp*) osname=hp_osf1 ;;
1690 mips) osname=mips_osf1 ;;
1696 $2) case "$osname" in
1700 : svr4.x or possibly later
1710 if test -f /stand/boot ; then
1711 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
1712 if test -n "$INITPROG" -a -f "$INITPROG"; then
1713 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
1714 if test -n "$isesix"; then
1722 *) if test -f /etc/systemid; then
1724 set `echo $3 | $sed 's/\./ /g'` $4
1725 if $test -f sco_$1_$2_$3.sh; then
1727 elif $test -f sco_$1_$2.sh; then
1729 elif $test -f sco_$1.sh; then
1734 '') : Still unknown. Probably a generic Sys V.
1743 *) case "$osname" in
1744 '') : Still unknown. Probably a generic BSD.
1752 if test -f /vmunix -a -f news_os.sh; then
1753 (what /vmunix | ../UU/tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1
1754 if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then
1757 $rm -f ../UU/kernel.what
1758 elif test -d c:/.; then
1765 : Now look for a hint file osname_osvers, unless one has been
1766 : specified already.
1769 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
1770 : Also try without trailing minor version numbers.
1771 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
1772 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
1773 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
1774 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
1777 *) case "$osvers" in
1780 *) if $test -f $file.sh ; then
1782 elif $test -f $xfile.sh ; then
1784 elif $test -f $xxfile.sh ; then
1786 elif $test -f $xxxfile.sh ; then
1788 elif $test -f $xxxxfile.sh ; then
1790 elif $test -f "${osname}.sh" ; then
1801 dflt=`echo $hintfile | $sed 's/\.sh$//'`
1807 You may give one or more space-separated answers, or "none" if appropriate.
1808 If your OS version has no hints, DO NOT give a wrong version -- say "none".
1811 rp="Which of these apply, if any?"
1814 for file in $tans; do
1815 if $test -f $file.sh; then
1817 $cat $file.sh >> ../UU/config.sh
1818 elif $test X$tans = X -o X$tans = Xnone ; then
1821 : Give one chance to correct a possible typo.
1822 echo "$file.sh does not exist"
1824 rp="hint to use instead?"
1826 for file in $ans; do
1827 if $test -f "$file.sh"; then
1829 $cat $file.sh >> ../UU/config.sh
1830 elif $test X$ans = X -o X$ans = Xnone ; then
1833 echo "$file.sh does not exist -- ignored."
1840 : Remember our hint file for later.
1841 if $test -f "$file.sh" ; then
1853 echo "Fetching default answers from $config_sh..." >&4
1857 cp $config_sh config.sh 2>/dev/null
1866 test "$override" && . ./optdef.sh
1867 myuname="$newmyuname"
1869 : Restore computed paths
1870 for file in $loclist $trylist; do
1871 eval $file="\$_$file"
1876 Configure uses the operating system name and version to set some defaults.
1877 The default value is probably right if the name rings a bell. Otherwise,
1878 since spelling matters for me, either accept the default or answer "none"
1885 ''|' '|none) dflt=none ;;
1886 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
1889 *) dflt="$osname" ;;
1891 rp="Operating system name?"
1895 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
1897 : who configured the system
1898 cf_time=`$date 2>&1`
1899 (logname > .temp) >/dev/null 2>&1
1900 $test -s .temp || (whoami > .temp) >/dev/null 2>&1
1901 $test -s .temp || echo unknown > .temp
1905 : determine the architecture name
1907 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
1908 tarch=`arch`"-$osname"
1909 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
1910 if uname -m > tmparch 2>&1 ; then
1911 tarch=`$sed -e 's/ /_/g' -e 's/$/'"-$osname/" tmparch`
1919 case "$myarchname" in
1922 echo "(Your architecture name used to be $myarchname.)"
1928 *) dflt="$archname";;
1930 rp='What is your architecture name'
1937 if test -d /afs; then
1938 echo "AFS may be running... I'll be extra cautious then..." >&4
1941 echo "AFS does not seem to be running..." >&4
1945 : decide how portable to be. Allow command line overrides.
1946 case "$d_portable" in
1948 *) d_portable="$define" ;;
1951 : set up shell script to do ~ expansion
1957 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
1960 if $test -f /bin/csh; then
1961 /bin/csh -f -c "glob \$1"
1966 name=\`$expr x\$1 : '..\([^/]*\)'\`
1967 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
1968 if $test ! -d "\$dir"; then
1970 echo "\$me: can't locate home directory for: \$name" >&2
1975 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
1991 : now set up to get a file name
1992 cat <<'EOSC' >getfile
2005 expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
2006 fn=`echo $fn | sed 's/(.*)//'`
2012 loc_file=`expr $fn : '.*:\(.*\)'`
2013 fn=`expr $fn : '\(.*\):.*'`
2021 */*) fullpath=true;;
2030 *e*) exp_file=true;;
2033 *p*) nopath_ok=true;;
2038 *d*) type='Directory';;
2039 *l*) type='Locate';;
2044 Locate) what='File';;
2049 case "$d_portable" in
2057 while test "$type"; do
2062 true) rp="$rp (~name ok)";;
2065 if test -f UU/getfile.ok && \
2066 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2085 value=`UU/filexp $ans`
2088 if test "$ans" != "$value"; then
2089 echo "(That expands to $value on this system.)"
2103 /*) value="$ansexp" ;;
2108 echo "I shall only accept a full path name, as in /bin/ls." >&4
2109 echo "Use a ! shell escape if you wish to check pathnames." >&4
2112 echo "Please give a full path name, starting with slash." >&4
2115 echo "Note that using ~name is ok provided it expands well." >&4
2128 if test -f "$ansexp"; then
2130 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2132 echo "($value is not a plain file, but that's ok.)"
2137 if test -d "$ansexp"; then
2142 if test -d "$ansexp"; then
2143 echo "(Looking for $loc_file in directory $value.)"
2144 value="$value/$loc_file"
2145 ansexp="$ansexp/$loc_file"
2147 if test -f "$ansexp"; then
2150 case "$nopath_ok" in
2151 true) case "$value" in
2153 *) echo "Assuming $value will be in people's path."
2169 if test "$fastread" = yes; then
2174 rp="$what $value doesn't exist. Use that name anyway?"
2195 : determine root of directory hierarchy where package will be installed.
2198 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
2206 By default, $package will be installed in $dflt/bin, manual
2207 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2208 all installation directories. Typically set to /usr/local, but you
2209 may choose /usr if you wish to install $package among your system
2210 binaries. If you wish to have binaries under /bin but manual pages
2211 under /usr/local/man, that's ok: you will be prompted separately
2212 for each of the installation directories, the prefix being only used
2213 to set the defaults.
2217 rp='Installation prefix to use?'
2225 *) oldprefix="$prefix";;
2232 : set the prefixit variable, to compute a suitable default value
2233 prefixit='case "$3" in
2235 case "$oldprefix" in
2236 "") eval "$1=\"\$$2\"";;
2243 ""|" ") eval "$1=\"\$$2\"";;
2249 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
2251 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
2252 /*-$oldprefix/*|\~*-$oldprefix/*)
2253 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
2254 *) eval "$1=\"\$$2\"";;
2258 : determine where private library files go
2259 : Usual default is /usr/local/lib/perl5. Also allow things like
2260 : /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
2262 *perl*) set dflt privlib lib ;;
2263 *) set dflt privlib lib/$package ;;
2268 There are some auxiliary files for $package that need to be put into a
2269 private library directory that is accessible by everyone.
2273 rp='Pathname where the private library files will reside?'
2275 if $test "X$privlibexp" != "X$ansexp"; then
2279 privlibexp="$ansexp"
2283 Since you are running AFS, I need to distinguish the directory in which
2284 private files reside from the directory in which they are installed (and from
2285 which they are presumably copied to the former directory by occult means).
2288 case "$installprivlib" in
2289 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
2290 *) dflt="$installprivlib";;
2293 rp='Where will private files be installed?'
2295 installprivlib="$ans"
2297 installprivlib="$privlibexp"
2300 : set the base revision
2303 : get the patchlevel
2305 echo "Getting the current patchlevel..." >&4
2306 if $test -r ../patchlevel.h;then
2307 patchlevel=`awk '/PATCHLEVEL/ {print $3}' < ../patchlevel.h`
2311 echo "(You have $package $baserev PL$patchlevel.)"
2313 : set the prefixup variable, to restore leading tilda escape
2314 prefixup='case "$prefixexp" in
2316 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
2319 : determine where public architecture dependent libraries go
2326 dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
2330 *) version=`echo $baserev $patchlevel | $awk '{print $1 + $2/1000.0}'`
2331 dflt="$privlib/$archname/$version"
2335 *) dflt="$archlib";;
2339 $spackage contains architecture-dependent library files. If you are
2340 sharing libraries in a heterogeneous environment, you might store
2341 these files in a separate location. Otherwise, you can just include
2342 them with the rest of the public library files.
2346 rp='Where do you want to put the public architecture-dependent libraries?'
2349 archlibexp="$ansexp"
2354 Since you are running AFS, I need to distinguish the directory in which
2355 private files reside from the directory in which they are installed (and from
2356 which they are presumably copied to the former directory by occult means).
2359 case "$installarchlib" in
2360 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
2361 *) dflt="$installarchlib";;
2364 rp='Where will architecture-dependent library files be installed?'
2366 installarchlib="$ans"
2368 installarchlib="$archlibexp"
2370 if $test X"$archlib" = X"$privlib"; then
2376 : set up the script used to warn in case of inconsistency
2380 echo "*** WHOA THERE!!! ***" >&4
2381 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2382 rp=" Keep the $hint value?"
2385 y) td=$was; tu=$was;;
2389 : function used to set $1 to $val
2390 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2392 $define$undef) . ./whoa; eval "$var=\$td";;
2393 $undef$define) . ./whoa; eval "$var=\$tu";;
2394 *) eval "$var=$val";;
2397 : make some quick guesses about what we are up against
2399 $echo $n "Hmm... $c"
2408 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2409 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2411 echo "Looks kind of like an OSF/1 system, but we'll see..."
2413 elif test `echo abc | tr a-z A-Z` = Abc ; then
2414 xxx=`./loc addbib blurfl $pth`
2415 if $test -f $xxx; then
2416 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2420 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2421 echo "Looks kind of like an extended USG system, but we'll see..."
2423 echo "Looks kind of like a USG system, but we'll see..."
2427 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2428 echo "Looks kind of like a BSD system, but we'll see..."
2432 echo "Looks kind of like a Version 7 system, but we'll see..."
2435 case "$eunicefix" in
2438 There is, however, a strange, musty smell in the air that reminds me of
2439 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2443 : it so happens the Eunice I know will not run shell scripts in Unix format
2447 echo "Congratulations. You aren't running Eunice."
2451 if test -f /xenix; then
2452 echo "Actually, this looks more like a XENIX system..."
2457 echo "It's not Xenix..."
2462 if test -f /venix; then
2463 echo "Actually, this looks more like a VENIX system..."
2470 echo "Nor is it Venix..."
2473 chmod +x bsd usg v7 osf1 eunice xenix venix
2474 $eunicefix bsd usg v7 osf1 eunice xenix venix
2477 : see if setuid scripts can be secure
2480 Some kernels have a bug that prevents setuid #! scripts from being
2481 secure. Some sites have disabled setuid #! scripts because of this.
2483 First let's decide if your kernel supports secure setuid #! scripts.
2484 (If setuid #! scripts would be secure but have been disabled anyway,
2485 don't say that they are secure if asked.)
2490 if $test -d /dev/fd; then
2491 echo "#!$ls" >reflect
2492 chmod +x,u+s reflect
2493 ./reflect >flect 2>&1
2494 if $contains "/dev/fd" flect >/dev/null; then
2495 echo "Congratulations, your kernel has secure setuid scripts!" >&4
2499 If you are not sure if they are secure, I can check but I'll need a
2500 username and password different from the one you are using right now.
2501 If you don't have such a username or don't want me to test, simply
2505 rp='Other username to test security of setuid scripts with?'
2510 case "$d_suidsafe" in
2511 '') echo "I'll assume setuid scripts are *not* secure." >&4
2514 echo "Well, the $hint value is *not* secure." >&4
2516 *) echo "Well, the $hint value *is* secure." >&4
2521 $rm -f reflect flect
2522 echo "#!$ls" >reflect
2523 chmod +x,u+s reflect
2526 echo '"su" will (probably) prompt you for '"$ans's password."
2527 su $ans -c './reflect >flect'
2528 if $contains "/dev/fd" flect >/dev/null; then
2529 echo "Okay, it looks like setuid scripts are secure." >&4
2532 echo "I don't think setuid scripts are secure." >&4
2537 rp='Does your kernel have *secure* setuid scripts?'
2540 [yY]*) val="$define";;
2545 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
2551 $rm -f reflect flect
2553 : now see if they want to do setuid emulation
2556 case "$d_suidsafe" in
2559 echo "No need to emulate SUID scripts since they are secure here." >& 4
2563 Some systems have disabled setuid scripts, especially systems where
2564 setuid scripts cannot be secure. On systems where setuid scripts have
2565 been disabled, the setuid/setgid bits on scripts are currently
2566 useless. It is possible for $package to detect those bits and emulate
2567 setuid/setgid in a secure fashion. This emulation will only work if
2568 setuid scripts have been disabled in your kernel.
2572 "$define") dflt=y ;;
2575 rp="Do you want to do setuid/setgid emulation?"
2578 [yY]*) val="$define";;
2586 : determine where site specific libraries go.
2590 '') dflt="$privlib/site_perl" ;;
2591 *) dflt="$sitelib" ;;
2595 The installation process will also create a directory for
2596 site-specific extensions and modules. Some users find it convenient
2597 to place all local files in this directory rather than in the main
2598 distribution directory.
2602 rp='Pathname for the site-specific library files?'
2604 if $test "X$sitelibexp" != "X$ansexp"; then
2608 sitelibexp="$ansexp"
2612 Since you are running AFS, I need to distinguish the directory in which
2613 private files reside from the directory in which they are installed (and from
2614 which they are presumably copied to the former directory by occult means).
2617 case "$installsitelib" in
2618 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
2619 *) dflt="$installsitelib";;
2622 rp='Where will private files be installed?'
2624 installsitelib="$ans"
2626 installsitelib="$sitelibexp"
2629 : determine where site specific architecture-dependent libraries go.
2630 xxx=`echo $sitelib/$archname | sed 's!^$prefix!!'`
2631 : xxx is usuually lib/site_perl/archname.
2632 set sitearch sitearch none
2635 '') dflt="$sitelib/$archname" ;;
2636 *) dflt="$sitearch" ;;
2640 The installation process will also create a directory for
2641 architecture-dependent site-specific extensions and modules.
2645 rp='Pathname for the site-specific architecture-dependent library files?'
2647 if $test "X$sitearchexp" != "X$ansexp"; then
2651 sitearchexp="$ansexp"
2655 Since you are running AFS, I need to distinguish the directory in which
2656 private files reside from the directory in which they are installed (and from
2657 which they are presumably copied to the former directory by occult means).
2660 case "$installsitearch" in
2661 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
2662 *) dflt="$installsitearch";;
2665 rp='Where will private files be installed?'
2667 installsitearch="$ans"
2669 installsitearch="$sitearchexp"
2672 : determine where old public architecture dependent libraries might be
2673 case "$oldarchlib" in
2674 '') case "$privlib" in
2676 *) dflt="$privlib/$archname"
2680 *) dflt="$oldarchlib"
2683 if $test ! -d "$dflt/auto"; then
2688 In 5.001, Perl stored architecture-dependent library files in a library
2689 with a name such as $privlib/$archname,
2690 and this directory contained files from the standard extensions and
2691 files from any additional extensions you might have added. Starting
2692 with version 5.002, all the architecture-dependent standard extensions
2693 will go into $archlib,
2694 while locally-added extensions will go into
2697 If you wish Perl to continue to search the old architecture-dependent
2698 library for your local extensions, give the path to that directory.
2699 If you do not wish to use your old architecture-dependent library
2700 files, answer 'none'.
2704 rp='Directory for your old 5.001 architecture-dependent libraries?'
2707 oldarchlibexp="$ansexp"
2708 case "$oldarchlib" in
2709 ''|' ') val="$undef" ;;
2715 : determine where public executables go
2720 rp='Pathname where the public executables will reside?'
2722 if $test "X$ansexp" != "X$binexp"; then
2730 Since you are running AFS, I need to distinguish the directory in which
2731 executables reside from the directory in which they are installed (and from
2732 which they are presumably copied to the former directory by occult means).
2735 case "$installbin" in
2736 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
2737 *) dflt="$installbin";;
2740 rp='Where will public executables be installed?'
2744 installbin="$binexp"
2747 : determine where manual pages are on this system
2751 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2752 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2753 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2754 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2755 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2756 sysman=`./loc . /usr/man/man1 $syspath`
2759 if $test -d "$sysman"; then
2760 echo "System manual is in $sysman." >&4
2762 echo "Could not find manual pages in source form." >&4
2765 : determine where manual pages go
2766 set man1dir man1dir none
2770 $spackage has manual pages available in source form.
2774 echo "However, you don't have nroff, so they're probably useless to you."
2776 '') man1dir="none";;
2779 echo "If you don't want the manual sources installed, answer 'none'."
2784 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
2785 lookpath="$lookpath $prefixexp/man/p_man/man1"
2786 lookpath="$lookpath $prefixexp/man/u_man/man1"
2787 lookpath="$lookpath $prefixexp/man/man.1"
2788 : If prefix contains 'perl' then we want to keep the man pages
2789 : under the prefix directory. Otherwise, look in a variety of
2790 : other possible places. This is debatable, but probably a
2791 : good compromise. Well, apparently not.
2792 : Experience has shown people expect man1dir to be under prefix,
2793 : so we now always put it there. Users who want other behavior
2794 : can answer interactively or use a command line option.
2795 : Does user have System V-style man paths.
2797 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
2798 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
2808 rp="Where do the main $spackage manual pages (source) go?"
2810 if $test "X$man1direxp" != "X$ansexp"; then
2814 man1direxp="$ansexp"
2822 Since you are running AFS, I need to distinguish the directory in which
2823 manual pages reside from the directory in which they are installed (and from
2824 which they are presumably copied to the former directory by occult means).
2827 case "$installman1dir" in
2828 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
2829 *) dflt="$installman1dir";;
2832 rp='Where will man pages be installed?'
2834 installman1dir="$ans"
2836 installman1dir="$man1direxp"
2839 : What suffix to use on installed man pages
2846 rp="What suffix should be used for the main $spackage man pages?"
2848 '') case "$man1dir" in
2862 *) dflt="$man1ext";;
2869 : see if we can have long filenames
2871 rmlist="$rmlist /tmp/cf$$"
2872 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
2873 first=123456789abcdef
2874 second=/tmp/cf$$/$first
2875 $rm -f $first $second
2876 if (echo hi >$first) 2>/dev/null; then
2877 if $test -f 123456789abcde; then
2878 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
2881 if (echo hi >$second) 2>/dev/null; then
2882 if $test -f /tmp/cf$$/123456789abcde; then
2884 That's peculiar... You can have filenames longer than 14 characters, but only
2885 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
2886 I shall consider your system cannot support long filenames at all.
2890 echo 'You can have filenames longer than 14 characters.' >&4
2895 How confusing! Some of your filesystems are sane enough to allow filenames
2896 longer than 14 characters but some others like /tmp can't even think about them.
2897 So, for now on, I shall assume your kernel does not allow them at all.
2904 You can't have filenames longer than 14 chars. You can't even think about them!
2910 $rm -rf /tmp/cf$$ 123456789abcde*
2912 : determine where library module manual pages go
2913 set man3dir man3dir none
2917 $spackage has manual pages for many of the library modules.
2923 However, you don't have nroff, so they're probably useless to you.
2924 You can use the supplied perldoc script instead.
2927 '') man3dir="none";;
2931 case "$d_flexfnam" in
2934 However, your system can't handle the long file names like File::Basename.3.
2935 You can use the supplied perldoc script instead.
2938 '') man3dir="none";;
2942 echo "If you don't want the manual sources installed, answer 'none'."
2943 : We dont use /usr/local/man/man3 because some man programs will
2944 : only show the /usr/local/man/man3 contents, and not the system ones,
2945 : thus man less will show the perl module less.pm, but not the system
2946 : less command. We might also conflict with TCL man pages.
2947 : However, something like /opt/perl/man/man3 is fine.
2949 '') case "$prefix" in
2950 *perl*) dflt=`echo $man1dir |
2951 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
2952 *) dflt="$privlib/man/man3" ;;
2956 *) dflt="$man3dir" ;;
2961 rp="Where do the $spackage library man pages (source) go?"
2963 if test "X$man3direxp" != "X$ansexp"; then
2968 man3direxp="$ansexp"
2976 Since you are running AFS, I need to distinguish the directory in which
2977 manual pages reside from the directory in which they are installed (and from
2978 which they are presumably copied to the former directory by occult means).
2981 case "$installman3dir" in
2982 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
2983 *) dflt="$installman3dir";;
2986 rp='Where will man pages be installed?'
2988 installman3dir="$ans"
2990 installman3dir="$man3direxp"
2993 : What suffix to use on installed man pages
3000 rp="What suffix should be used for the $spackage library man pages?"
3002 '') case "$man3dir" in
3016 *) dflt="$man3ext";;
3023 : see what memory models we can support
3026 $cat >pdp11.c <<'EOP'
3035 cc -o pdp11 pdp11.c >/dev/null 2>&1
3036 if ./pdp11 2>/dev/null; then
3037 dflt='unsplit split'
3039 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3042 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3047 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3050 if $test -d /lib/large || $test -d /usr/lib/large; then
3053 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3062 Some systems have different model sizes. On most systems they are called
3063 small, medium, large, and huge. On the PDP11 they are called unsplit and
3064 split. If your system doesn't support different memory models, say "none".
3065 If you wish to force everything to one memory model, say "none" here and
3066 put the appropriate flags later when it asks you for other cc and ld flags.
3067 Venix systems may wish to put "none" and let the compiler figure things out.
3068 (In the following question multiple model names should be space separated.)
3071 rp="Which memory models are supported?"
3086 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3087 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3094 rp="What flag indicates separate I and D space?"
3102 *large*|*small*|*medium*|*huge*)
3109 rp="What flag indicates large model?"
3119 *huge*) case "$huge" in
3123 rp="What flag indicates huge model?"
3133 *medium*) case "$medium" in
3137 rp="What flag indicates medium model?"
3144 *) medium="$large";;
3147 *small*) case "$small" in
3151 rp="What flag indicates small model?"
3162 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3166 : see if we need a special compiler
3174 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3175 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3188 On some systems the default C compiler will not resolve multiple global
3189 references that happen to have the same name. On some such systems the "Mcc"
3190 command may be used to force these to be resolved. On other systems a "cc -M"
3191 command is required. (Note that the -M flag on other systems indicates a
3192 memory model to use!) If you have the Gnu C compiler, you might wish to use
3196 rp="What command will force resolution on this system?"
3204 rp="Use which C compiler?"
3209 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3210 $cat >gccvers.c <<EOM
3215 printf("%s\n", __VERSION__);
3217 printf("%s\n", "1");
3223 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3224 gccversion=`./gccvers`
3225 case "$gccversion" in
3226 '') echo "You are not using GNU cc." ;;
3227 *) echo "You are using GNU cc $gccversion." ;;
3231 echo "*** WHOA THERE!!! ***" >&4
3232 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3233 case "$knowitall" in
3235 echo " You'd better start hunting for one and let me know about it." >&4
3241 case "$gccversion" in
3242 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3245 : What should the include directory be ?
3247 $echo $n "Hmm... $c"
3251 if $test -f /bin/mips && /bin/mips; then
3252 echo "Looks like a MIPS system..."
3253 $cat >usr.c <<'EOCP'
3254 #ifdef SYSTYPE_BSD43
3258 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3259 dflt='/bsd43/usr/include'
3263 mips_type='System V'
3265 $rm -f usr.c usr.out
3266 echo "and you're compiling with the $mips_type compiler and libraries."
3270 echo "Doesn't look like a MIPS system."
3281 case "$xxx_prompt" in
3283 rp='Where are the include files you want to use?'
3291 : see if we have to deal with yellow pages, now NIS.
3292 if $test -d /usr/etc/yp || $test -d /etc/yp; then
3293 if $test -f /usr/etc/nibindd; then
3295 echo "I'm fairly confident you're on a NeXT."
3297 rp='Do you get the hosts file via NetInfo?'
3306 y*) hostcat='nidump hosts .';;
3307 *) case "$hostcat" in
3308 nidump*) hostcat='';;
3318 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
3326 rp='Are you getting the hosts file via yellow pages?'
3329 y*) hostcat='ypcat hosts';;
3330 *) hostcat='cat /etc/hosts';;
3336 : now get the host name
3338 echo "Figuring out host name..." >&4
3339 case "$myhostname" in
3341 echo 'Maybe "hostname" will work...'
3342 if tans=`sh -c hostname 2>&1` ; then
3350 if $test "$cont"; then
3352 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
3353 if tans=`cat /etc/systemid 2>&1` ; then
3355 phostname='cat /etc/systemid'
3356 echo "Whadyaknow. Xenix always was a bit strange..."
3359 elif $test -r /etc/systemid; then
3360 echo "(What is a non-Xenix system doing with /etc/systemid?)"
3363 if $test "$cont"; then
3364 echo 'No, maybe "uuname -l" will work...'
3365 if tans=`sh -c 'uuname -l' 2>&1` ; then
3367 phostname='uuname -l'
3369 echo 'Strange. Maybe "uname -n" will work...'
3370 if tans=`sh -c 'uname -n' 2>&1` ; then
3372 phostname='uname -n'
3374 echo 'Oh well, maybe I can mine it out of whoami.h...'
3375 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
3376 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
3377 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
3379 case "$myhostname" in
3380 '') echo "Does this machine have an identity crisis or something?"
3383 echo "Well, you said $myhostname before..."
3384 phostname='echo $myhostname';;
3390 : you do not want to know about this
3395 if $test "$myhostname" ; then
3397 rp='Your host name appears to be "'$myhostname'".'" Right?"
3405 : bad guess or no guess
3406 while $test "X$myhostname" = X ; do
3408 rp="Please type the (one word) name of your host:"
3413 : translate upper to lower if necessary
3414 case "$myhostname" in
3416 echo "(Normalizing case in your host name)"
3417 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
3421 case "$myhostname" in
3423 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
3424 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
3425 echo "(Trimming domain name from host name--host name is now $myhostname)"
3427 *) case "$mydomain" in
3430 : If we use NIS, try ypmatch.
3431 : Is there some reason why this was not done before?
3432 test "X$hostcat" = "Xypcat hosts" &&
3433 ypmatch "$myhostname" hosts 2>/dev/null |\
3434 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
3437 : Extract only the relevant hosts, reducing file size,
3438 : remove comments, insert trailing space for later use.
3439 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
3440 /[ ]$myhostname[ . ]/p" > hosts
3443 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
3444 END { print sum }" hosts` = x1 || tmp_re="[ ]"
3445 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
3446 hosts | $sort | $uniq | \
3447 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
3448 case `$echo X$dflt` in
3449 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
3452 .) echo "(You do not have fully-qualified names in /etc/hosts)"
3457 tans=`./loc resolv.conf X /etc /usr/etc`
3458 if $test -f "$tans"; then
3459 echo "(Attempting domain name extraction from $tans)"
3460 : Why was there an Egrep here, when Sed works?
3461 dflt=.`$sed -n -e 's/^domain[ ]*\(.*\)/\1/p' $tans \
3462 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
3467 .) echo "(No help from resolv.conf either -- attempting clever guess)"
3468 dflt=.`sh -c domainname 2>/dev/null`
3471 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
3476 .) echo "(Lost all hope -- silly guess then)"
3482 *) dflt="$mydomain";;
3486 rp="What is your domain name?"
3496 : translate upper to lower if necessary
3499 echo "(Normalizing case in your domain name)"
3500 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
3504 : a little sanity check here
3505 case "$phostname" in
3508 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
3509 $myhostname$mydomain|$myhostname) ;;
3511 case "$phostname" in
3513 echo "(That doesn't agree with your whoami.h file, by the way.)"
3516 echo "(That doesn't agree with your $phostname command, by the way.)"
3526 I need to get your e-mail address in Internet format if possible, i.e.
3527 something like user@host.domain. Please answer accurately since I have
3528 no easy means to double check it. The default value provided below
3529 is most probably close to the reality but may not be valid from outside
3530 your organization...
3534 while test "$cont"; do
3536 '') dflt="$cf_by@$myhostname$mydomain";;
3537 *) dflt="$cf_email";;
3539 rp='What is your e-mail address?'
3545 rp='Address does not look like an Internet one. Use it anyway?'
3561 If you or somebody else will be maintaining perl at your site, please
3562 fill in the correct e-mail address here so that they may be contacted
3563 if necessary. Currently, the "perlbug" program included with perl
3564 will send mail to this address in addition to perlbug@perl.com. You may
3565 enter "none" for no administrator.
3568 case "$perladmin" in
3569 '') dflt="$cf_email";;
3570 *) dflt="$perladmin";;
3572 rp='Perl administrator e-mail address'
3576 : determine where public executable scripts go
3577 set scriptdir scriptdir
3579 case "$scriptdir" in
3582 : guess some guesses
3583 $test -d /usr/share/scripts && dflt=/usr/share/scripts
3584 $test -d /usr/share/bin && dflt=/usr/share/bin
3585 $test -d /usr/local/script && dflt=/usr/local/script
3586 $test -d $prefixexp/script && dflt=$prefixexp/script
3590 *) dflt="$scriptdir"
3595 Some installations have a separate directory just for executable scripts so
3596 that they can mount it across multiple architectures but keep the scripts in
3597 one spot. You might, for example, have a subdirectory of /usr/share for this.
3598 Or you might just lump your scripts in with all your other executables.
3602 rp='Where do you keep publicly executable scripts?'
3604 if $test "X$ansexp" != "X$scriptdirexp"; then
3608 scriptdirexp="$ansexp"
3612 Since you are running AFS, I need to distinguish the directory in which
3613 scripts reside from the directory in which they are installed (and from
3614 which they are presumably copied to the former directory by occult means).
3617 case "$installscript" in
3618 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
3619 *) dflt="$installscript";;
3622 rp='Where will public scripts be installed?'
3624 installscript="$ans"
3626 installscript="$scriptdirexp"
3629 : determine perl absolute location
3631 '') perlpath=$binexp/perl ;;
3634 : figure out how to guarantee perl startup
3635 case "$startperl" in
3637 case "$sharpbang" in
3641 I can use the #! construct to start perl on your system. This will
3642 make startup of perl scripts faster, but may cause problems if you
3643 want to share those scripts and perl is not in a standard place
3644 ($perlpath) on all your platforms. The alternative is to force
3645 a shell by starting the script with a single ':' character.
3649 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
3652 none) startperl=": # use perl";;
3653 *) startperl="#!$ans";;
3656 *) startperl=": # use perl"
3661 echo "I'll use $startperl to start perl scripts."
3663 : see how we invoke the C preprocessor
3665 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3666 cat <<'EOT' >testcpp.c
3672 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3674 wrapper=`pwd`/cppstdin
3678 if $test "X$cppstdin" != "X" && \
3679 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3680 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3682 echo "You used to use $cppstdin $cppminus so we'll use that again."
3684 '') echo "But let's see if we can live without a wrapper..." ;;
3686 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3687 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3689 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3692 echo "(However, $cpprun $cpplast does not work, let's see...)"
3700 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3707 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3708 $cc -E <testcpp.c >testcpp.out 2>&1; \
3709 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3710 echo "Yup, it does."
3713 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3714 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3715 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3716 echo "Yup, it does."
3719 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3720 $cc -P <testcpp.c >testcpp.out 2>&1; \
3721 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3722 echo "Yipee, that works!"
3725 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3726 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3727 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3728 echo "At long last!"
3731 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3732 $cpp <testcpp.c >testcpp.out 2>&1; \
3733 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3737 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3738 $cpp - <testcpp.c >testcpp.out 2>&1; \
3739 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3740 echo "Hooray, it works! I was beginning to wonder."
3743 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3744 $wrapper <testcpp.c >testcpp.out 2>&1; \
3745 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3751 rp="No dice. I can't find a C preprocessor. Name one:"
3755 $x_cpp <testcpp.c >testcpp.out 2>&1
3756 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3757 echo "OK, that will do." >&4
3759 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3774 echo "Perhaps can we force $cc -E using a wrapper..."
3775 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3776 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3782 echo "Nope, we'll have to live without it..."
3797 *) $rm -f $wrapper;;
3799 $rm -f testcpp.c testcpp.out
3801 : Set private lib path
3804 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3809 '') dlist="$loclibpth $plibpth $glibpth";;
3810 *) dlist="$libpth";;
3813 : Now check and see which directories actually exist, avoiding duplicates
3817 if $test -d $xxx; then
3820 *) libpth="$libpth $xxx";;
3826 Some systems have incompatible or broken versions of libraries. Among
3827 the directories listed in the question below, please remove any you
3828 know not to be holding relevant libraries, and add any that are needed.
3829 Say "none" for none.
3840 rp="Directories to use for library searches?"
3847 : determine optimize, if desired, or use for debug flag also
3851 *) dflt="$optimize";;
3855 Some C compilers have problems with their optimizers, by default, $package
3856 compiles with the -O flag to use the optimizer. Alternately, you might want
3857 to use the symbolic debugger, which uses the -g flag (on traditional Unix
3858 systems). Either flag can be specified here. To use neither flag, specify
3862 rp="What optimizer/debugger flag should be used?"
3866 'none') optimize=" ";;
3870 : We will not override a previous value, but we might want to
3871 : augment a hint file
3874 case "$gccversion" in
3875 1*) dflt='-fpcc-struct-return' ;;
3878 *-g*) dflt="$dflt -DDEBUGGING";;
3880 case "$gccversion" in
3881 2*) if test -d /etc/conf/kconfig.d &&
3882 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3891 case "$mips_type" in
3892 *BSD*|'') inclwanted="$locincpth $usrinc";;
3893 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3895 for thisincl in $inclwanted; do
3896 if $test -d $thisincl; then
3897 if $test x$thisincl != x$usrinc; then
3900 *) dflt="$dflt -I$thisincl";;
3906 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3908 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3916 *) dflt="$dflt -D$2";;
3921 set signal.h __LANGUAGE_C__; eval $inctest
3923 set signal.h LANGUAGE_C; eval $inctest
3925 set signal.h NO_PROTOTYPE; eval $inctest
3926 set signal.h _NO_PROTO; eval $inctest
3929 none|recommended) dflt="$ccflags $dflt" ;;
3930 *) dflt="$ccflags";;
3938 Your C compiler may want other flags. For this question you should include
3939 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3940 but you should NOT include libraries or ld flags like -lwhatever. If you
3941 want $package to honor its debug switch, you should include -DDEBUGGING here.
3942 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE,
3943 -DHIDEMYMALLOC or -DCRIPPLED_CC.
3945 To use no flags, specify the word "none".
3951 rp="Any additional cc flags?"
3958 : the following weeds options from ccflags that are of no interest to cpp
3960 case "$gccversion" in
3961 1*) cppflags="$cppflags -D__GNUC__"
3963 case "$mips_type" in
3965 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3971 echo "Let me guess what the preprocessor flags are..." >&4
3985 *) ftry="$previous $flag";;
3987 if $cppstdin -DLFRULB=bar $ftry $cppminus <cpp.c \
3988 >cpp1.out 2>/dev/null && \
3989 $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \
3990 >cpp2.out 2>/dev/null && \
3991 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3992 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3994 cppflags="$cppflags $ftry"
4004 *-*) echo "They appear to be: $cppflags";;
4006 $rm -f cpp.c cpp?.out
4010 : flags used in final linking phase
4013 '') if ./venix; then
4019 *-posix*) dflt="$dflt -posix" ;;
4022 *) dflt="$ldflags";;
4025 : Try to guess additional flags to pick up local libraries.
4026 for thislibdir in $libpth; do
4027 case " $loclibpth " in
4030 *"-L$thislibdir "*) ;;
4031 *) dflt="$dflt -L$thislibdir" ;;
4043 Your C linker may need flags. For this question you should
4044 include -L/whatever and any other flags used by the C linker, but you
4045 should NOT include libraries like -lwhatever.
4047 Make sure you include the appropriate -L/path flags if your C linker
4048 does not normally search all of the directories you specified above,
4051 To use no flags, specify the word "none".
4055 rp="Any additional ld flags (NOT including libraries)?"
4061 rmlist="$rmlist pdp11"
4065 echo "Checking your choice of C compiler and flags for coherency..." >&4
4066 set X $cc $optimize $ccflags $ldflags try.c -o try
4069 I've tried to compile and run a simple program with:
4074 and I got the following output:
4077 $cat > try.c <<'EOF'
4082 if sh -c "$cc $optimize $ccflags try.c -o try $ldflags" >>try.msg 2>&1; then
4083 if sh -c './try' >>try.msg 2>&1; then
4086 echo "The program compiled OK, but exited with status $?." >>try.msg
4087 rp="You have a problem. Shall I abort Configure"
4091 echo "I can't compile the test program." >>try.msg
4092 rp="You have a BIG problem. Shall I abort Configure"
4098 case "$knowitall" in
4100 echo "(The supplied flags might be incorrect with this C compiler.)"
4108 *) echo "Ok. Stopping Configure." >&4
4113 n) echo "OK, that should do.";;
4115 $rm -f try try.* core
4117 : compute shared library extension
4120 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4130 On some systems, shared libraries may be available. Answer 'none' if
4131 you want to suppress searching of shared libraries for the remaining
4132 of this configuration.
4135 rp='What is the file extension used for shared libraries?'
4139 : Looking for optional libraries
4141 echo "Checking for optional libraries..." >&4
4146 case "$libswanted" in
4147 '') libswanted='c_s';;
4149 for thislib in $libswanted; do
4151 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
4152 echo "Found -l$thislib (shared)."
4155 *) dflt="$dflt -l$thislib";;
4157 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4158 echo "Found -l$thislib (shared)."
4161 *) dflt="$dflt -l$thislib";;
4163 elif xxx=`./loc lib$thislib.a X $libpth`; $test -f "$xxx"; then
4164 echo "Found -l$thislib."
4167 *) dflt="$dflt -l$thislib";;
4169 elif xxx=`./loc $thislib.a X $libpth`; $test -f "$xxx"; then
4170 echo "Found -l$thislib."
4173 *) dflt="$dflt -l$thislib";;
4175 elif xxx=`./loc lib${thislib}_s.a X $libpth`; $test -f "$xxx"; then
4176 echo "Found -l${thislib}_s."
4179 *) dflt="$dflt -l${thislib}_s";;
4181 elif xxx=`./loc Slib$thislib.a X $xlibpth`; $test -f "$xxx"; then
4182 echo "Found -l$thislib."
4185 *) dflt="$dflt -l$thislib";;
4188 echo "No -l$thislib."
4199 ' '|'') dflt='none';;
4204 Some versions of Unix support shared libraries, which make executables smaller
4205 but make load time slightly longer.
4207 On some systems, mostly newer Unix System V's, the shared library is included
4208 by putting the option "-lc_s" as the last thing on the cc command line when
4209 linking. Other systems use shared libraries by default. There may be other
4210 libraries needed to compile $package on your machine as well. If your system
4211 needs the "-lc_s" option, include it here. Include any other special libraries
4212 here as well. Say "none" for none.
4216 rp="Any additional libraries?"
4223 : see if nm is to be used to determine whether a symbol is defined or not
4226 dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null`
4227 if $test $dflt -gt 20; then
4242 I can use 'nm' to extract the symbols from your C libraries. This is a time
4243 consuming task which may generate huge output on the disk (up to 3 megabytes)
4244 but that should make the symbols extraction faster. The alternative is to skip
4245 the 'nm' extraction part and to compile a small test program instead to
4246 determine whether each symbol is present. If you have a fast C compiler and/or
4247 if your 'nm' output cannot be parsed, this may be the best solution.
4250 rp='Shall I use nm to extract C symbols from the libraries?'
4262 : nm options which may be necessary
4264 '') if $test -f /mach_boot; then
4266 elif $test -d /usr/ccs/lib; then
4268 elif $test -f /dgux; then
4275 : nm options which may be necessary for shared libraries but illegal
4276 : for archive libraries. Thank you, Linux.
4277 case "$nm_so_opt" in
4278 '') case "$myuname" in
4280 if nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4281 nm_so_opt='--dynamic'
4290 : get list of predefined functions in a handy place
4295 *-lc_s*) libc=`./loc libc_s.a $libc $libpth`
4302 *) for thislib in $libs; do
4305 : Handle C library specially below.
4308 thislib=`echo $thislib | $sed -e 's/^-l//'`
4309 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4311 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4313 elif try=`./loc lib$thislib.a X $libpth`; $test -f "$try"; then
4315 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4317 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4319 elif try=`./loc Slib$thislib.a X $xlibpth`; $test -f "$try"; then
4324 libnames="$libnames $try"
4326 *) libnames="$libnames $thislib" ;;
4335 for xxx in $libpth; do
4336 $test -r $1 || set $xxx/libc.$so
4337 : The messy sed command sorts on library version numbers.
4339 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4340 tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e '
4342 s/[0-9][0-9]*/0000&/g
4343 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4346 sort | $sed -e 's/^.* //'`
4349 $test -r $1 || set /usr/ccs/lib/libc.$so
4350 $test -r $1 || set /lib/libsys_s.a
4356 if $test -r "$1"; then
4357 echo "Your (shared) C library seems to be in $1."
4359 elif $test -r /lib/libc && $test -r /lib/clib; then
4360 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4362 libc='/lib/clib /lib/libc'
4363 if $test -r /lib/syslib; then
4364 echo "(Your math library is in /lib/syslib.)"
4365 libc="$libc /lib/syslib"
4367 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4368 echo "Your C library seems to be in $libc, as you said before."
4369 elif $test -r $incpath/usr/lib/libc.a; then
4370 libc=$incpath/usr/lib/libc.a;
4371 echo "Your C library seems to be in $libc. That's fine."
4372 elif $test -r /lib/libc.a; then
4374 echo "Your C library seems to be in $libc. You're normal."
4376 if tans=`./loc libc.a blurfl/dyick $libpth`; $test -r "$tans"; then
4378 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4379 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4380 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4382 elif tans=`./loc Slibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4384 elif tans=`./loc Mlibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4387 tans=`./loc Llibc.a blurfl/dyick $xlibpth`
4389 if $test -r "$tans"; then
4390 echo "Your C library seems to be in $tans, of all places."
4396 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4400 If the guess above is wrong (which it might be if you're using a strange
4401 compiler, or your machine supports multiple models), you can override it here.
4406 echo $libpth | tr ' ' '\012' | sort | uniq > libpath
4408 I can't seem to find your C library. I've looked in the following places:
4411 $sed 's/^/ /' libpath
4414 None of these seems to contain your C library. I need to get its name...
4419 rp='Where is your C library?'
4424 echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames
4425 set X `cat libnames`
4428 case $# in 1) xxx=file; esac
4429 echo "Extracting names from the following $xxx for later perusal:" >&4
4431 $sed 's/^/ /' libnames >&4
4433 $echo $n "This may take a while...$c" >&4
4435 : Linux may need the special Dynamic option to nm for shared libraries.
4436 : In general, this is stored in the nm_so_opt variable.
4437 : Unfortunately, that option may be fatal on non-shared libraries.
4438 for nm_libs_ext in $*; do
4439 case $nm_libs_ext in
4440 *$so*) nm $nm_so_opt $nm_opt $nm_libs_ext 2>/dev/null ;;
4441 *) nm $nm_opt $nm_libs_ext 2>/dev/null ;;
4446 $grep fprintf libc.tmp > libc.ptf
4447 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4448 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4450 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx //p'";\
4452 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4454 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4456 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4458 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4460 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4462 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4464 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4466 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4468 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4470 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4472 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4474 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4475 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4477 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4479 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4481 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4483 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4485 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4487 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4489 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4491 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4493 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4496 nm -p $* 2>/dev/null >libc.tmp
4497 $grep fprintf libc.tmp > libc.ptf
4498 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4499 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4505 echo "nm didn't seem to work right. Trying ar instead..." >&4
4507 if ar t $libc > libc.tmp; then
4508 for thisname in $libnames; do
4509 ar t $thisname >>libc.tmp
4511 $sed -e 's/\.o$//' < libc.tmp > libc.list
4514 echo "ar didn't seem to work right." >&4
4515 echo "Maybe this is a Cray...trying bld instead..." >&4
4516 if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list
4518 for thisname in $libnames; do
4520 $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
4521 ar t $thisname >>libc.tmp
4525 echo "That didn't work either. Giving up." >&4
4532 if $test -f /lib/syscalls.exp; then
4534 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4535 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
4539 $rm -f libnames libpath
4541 : is a C symbol defined?
4544 -v) tf=libc.tmp; tc=""; tdc="";;
4545 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4546 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4549 case "$reuseval-$4" in
4551 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4557 if $contains $tlook $tf >/dev/null 2>&1;
4562 echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4563 if $cc $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
4571 $define) tval=true;;
4577 : define an is-in-libc? function
4578 inlibc='echo " "; td=$define; tu=$undef;
4579 sym=$1; var=$2; eval "was=\$$2";
4581 case "$reuseval$was" in
4591 echo "$sym() found." >&4;
4592 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
4594 echo "$sym() NOT found." >&4;
4595 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
4599 $define) echo "$sym() found." >&4;;
4600 *) echo "$sym() NOT found." >&4;;
4604 : Check how to convert floats to strings.
4606 echo "Checking for an efficient way to convert floats to strings."
4609 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
4612 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
4615 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
4619 Gconvert(1.0, 8, 0, buf);
4620 if (buf[0] != '1' || buf[1] != '\0')
4622 Gconvert(0.0, 8, 0, buf);
4623 if (buf[0] != '0' || buf[1] != '\0')
4625 Gconvert(-1.0, 8, 0, buf);
4626 if (buf[0] != '-' || buf[1] != '1' || buf[2] != '\0')
4631 case "$d_Gconvert" in
4632 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
4633 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
4634 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
4635 *) xxx_list='gconvert gcvt sprintf' ;;
4638 for xxx_convert in $xxx_list; do
4639 echo "Trying $xxx_convert"
4641 if $cc $ccflags -DTRY_$xxx_convert $ldflags -o try \
4642 try.c $libs > /dev/null 2>&1 ; then
4643 echo "$xxx_convert" found. >&4
4645 echo "Good, $xxx_convert drops a trailing decimal point."
4646 echo "I'll use $xxx_convert to convert floats into a string." >&4
4649 echo "But $xxx_convert keeps a trailing decimal point".
4652 echo "$xxx_convert NOT found." >&4
4656 case "$xxx_convert" in
4657 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
4658 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
4659 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
4662 : Initialize h_fcntl
4665 : Initialize h_sysfile
4668 : determine filename position in cpp output
4670 echo "Computing filename position in cpp output for #include directives..." >&4
4671 echo '#include <stdio.h>' > foo.c
4674 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4675 $grep '^[ ]*#.*stdio\.h' | \
4676 while read cline; do
4679 while $test \$# -gt 0; do
4680 if $test -r \`echo \$1 | $tr -d '"'\`; then
4685 pos=\`expr \$pos + 1\`
4697 *) pos="${fieldn}th";;
4699 echo "Your cpp writes the filename in the $pos field of the line."
4701 : locate header file
4706 if test -f $usrinc/\$wanted; then
4707 echo "$usrinc/\$wanted"
4710 awkprg='{ print \$$fieldn }'
4711 echo "#include <\$wanted>" > foo\$\$.c
4712 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4713 $grep "^[ ]*#.*\$wanted" | \
4714 while read cline; do
4715 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4717 */\$wanted) echo "\$name"; exit 0;;
4728 : access call always available on UNIX
4732 : locate the flags for 'access()'
4736 $cat >access.c <<'EOCP'
4737 #include <sys/types.h>
4742 #include <sys/file.h>
4751 : check sys/file.h first, no particular reason here
4752 if $test `./findhdr sys/file.h` && \
4753 $cc $cppflags -DI_SYS_FILE access.c -o access >/dev/null 2>&1 ; then
4755 echo "<sys/file.h> defines the *_OK access constants." >&4
4756 elif $test `./findhdr fcntl.h` && \
4757 $cc $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then
4759 echo "<fcntl.h> defines the *_OK access constants." >&4
4760 elif $test `./findhdr unistd.h` && \
4761 $cc $cppflags -DI_UNISTD access.c -o access >/dev/null 2>&1 ; then
4762 echo "<unistd.h> defines the *_OK access constants." >&4
4764 echo "I can't find the four *_OK access constants--I'll use mine." >&4
4770 : see if alarm exists
4774 : Look for GNU-cc style attribute checking
4776 echo "Checking whether your compiler can handle __attribute__ ..." >&4
4777 $cat >attrib.c <<'EOCP'
4779 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
4781 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
4782 if $contains 'warning' attrib.out >/dev/null 2>&1; then
4783 echo "Your C compiler doesn't fully support __attribute__."
4786 echo "Your C compiler supports __attribute__."
4790 echo "Your C compiler doesn't seem to understand __attribute__ at all."
4797 : see if bcmp exists
4801 : see if bcopy exists
4805 : see if setpgrp exists
4806 set setpgrp d_setpgrp
4809 : see which flavor of setpgrp is in use
4810 case "$d_setpgrp" in
4816 if (getuid() == 0) {
4817 printf("(I see you are running Configure as super-user...)\n");
4820 if (-1 == setpgrp(1, 1))
4825 if $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1; then
4828 0) echo "You have to use setpgrp() instead of setpgrp(pid, pgrp)." >&4
4830 *) echo "You have to use setpgrp(pid, pgrp) instead of setpgrp()." >&4
4835 xxx="USG one, i.e. you use setpgrp()."
4838 xxx="BSD one, i.e. you use setpgrp(pid, pgrp)."
4841 echo "Assuming your setpgrp is a $xxx" >&4
4850 : see if bzero exists
4854 : check for length of integer
4858 echo "Checking to see how big your integers are..." >&4
4859 $cat >try.c <<'EOCP'
4863 printf("%d\n", sizeof(int));
4867 if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
4869 echo "Your integers are $intsize bytes long."
4872 echo "(I can't seem to compile the test program. Guessing...)"
4873 rp="What is the size of an integer (in bytes)?"
4881 : see if signal is declared as pointer to function returning int or void
4883 xxx=`./findhdr signal.h`
4884 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
4885 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
4886 echo "You have int (*signal())() instead of void." >&4
4888 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
4889 echo "You have void (*signal())() instead of int." >&4
4891 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
4892 echo "You have int (*signal())() instead of void." >&4
4895 case "$d_voidsig" in
4897 echo "I can't determine whether signal handler returns void or int..." >&4
4899 rp="What type does your signal handler return?"
4906 echo "As you already told me, signal handler returns void." >&4;;
4908 echo "As you already told me, signal handler returns int." >&4;;
4913 case "$d_voidsig" in
4914 "$define") signal_t="void";;
4919 : check for ability to cast large floats to 32-bit ints.
4921 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
4922 if $test "$intsize" -eq 4; then
4928 #include <sys/types.h>
4930 $signal_t blech() { exit(3); }
4936 signal(SIGFPE, blech);
4938 f = (double) 0x7fffffff;
4942 if (i32 != ($xxx) f)
4947 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
4951 echo "(I can't seem to compile the test program--assuming it can't)"
4959 echo "Nope, it can't."
4966 : check for ability to cast negative floats to unsigned
4968 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
4970 #include <sys/types.h>
4972 $signal_t blech() { exit(7); }
4973 $signal_t blech_in_list() { exit(4); }
4974 unsigned long dummy_long(p) unsigned long p; { return p; }
4975 unsigned int dummy_int(p) unsigned int p; { return p; }
4976 unsigned short dummy_short(p) unsigned short p; { return p; }
4980 unsigned long along;
4982 unsigned short ashort;
4985 signal(SIGFPE, blech);
4986 along = (unsigned long)f;
4987 aint = (unsigned int)f;
4988 ashort = (unsigned short)f;
4989 if (along != (unsigned long)-123)
4991 if (aint != (unsigned int)-123)
4993 if (ashort != (unsigned short)-123)
4995 f = (double)0x40000000;
4998 along = (unsigned long)f;
4999 if (along != 0x80000000)
5003 along = (unsigned long)f;
5004 if (along != 0x7fffffff)
5008 along = (unsigned long)f;
5009 if (along != 0x80000001)
5013 signal(SIGFPE, blech_in_list);
5015 along = dummy_long((unsigned long)f);
5016 aint = dummy_int((unsigned int)f);
5017 ashort = dummy_short((unsigned short)f);
5018 if (along != (unsigned long)123)
5020 if (aint != (unsigned int)123)
5022 if (ashort != (unsigned short)123)
5028 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
5032 echo "(I can't seem to compile the test program--assuming it can't)"
5035 case "$castflags" in
5040 echo "Nope, it can't."
5047 : see if vprintf exists
5049 if set vprintf val -f d_vprintf; eval $csym; $val; then
5050 echo 'vprintf() found.' >&4
5052 $cat >vprintf.c <<'EOF'
5053 #include <varargs.h>
5055 main() { xxx("foo"); }
5064 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
5067 if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then
5068 echo "Your vsprintf() returns (int)." >&4
5071 echo "Your vsprintf() returns (char*)." >&4
5075 echo 'vprintf() NOT found.' >&4
5085 : see if chown exists
5089 : see if chroot exists
5093 : see if chsize exists
5097 : check for const keyword
5099 echo 'Checking to see if your C compiler knows about "const"...' >&4
5100 $cat >const.c <<'EOCP'
5101 typedef struct spug { int drokk; } spug;
5108 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
5110 echo "Yup, it does."
5113 echo "Nope, it doesn't."
5118 : see if crypt exists
5120 if set crypt val -f d_crypt; eval $csym; $val; then
5121 echo 'crypt() found.' >&4
5125 cryptlib=`./loc Slibcrypt.a "" $xlibpth`
5126 if $test -z "$cryptlib"; then
5127 cryptlib=`./loc Mlibcrypt.a "" $xlibpth`
5131 if $test -z "$cryptlib"; then
5132 cryptlib=`./loc Llibcrypt.a "" $xlibpth`
5136 if $test -z "$cryptlib"; then
5137 cryptlib=`./loc libcrypt.a "" $libpth`
5141 if $test -z "$cryptlib"; then
5142 echo 'crypt() NOT found.' >&4
5151 : get csh whereabouts
5153 'csh') val="$undef" ;;
5160 : see if cuserid exists
5161 set cuserid d_cuserid
5164 : define an alternate in-header-list? function
5165 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5166 cont=true; xxf="echo \"<\$1> found.\" >&4";
5167 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5168 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5170 case $# in 4) instead=instead;; *) instead="at last";; esac;
5171 while $test "$cont"; do
5173 var=$2; eval "was=\$$2";
5174 if $test "$xxx" && $test -r "$xxx";
5176 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5179 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5180 set $yyy; shift; shift; yyy=$@;
5181 case $# in 0) cont="";;
5182 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5183 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5184 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5185 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5189 do set $yyy; var=$2; eval "was=\$$2";
5190 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5191 set $yyy; shift; shift; yyy=$@;
5194 : see if this is a limits.h system
5195 set limits.h i_limits
5198 : see if this is a float.h system
5202 : See if number of significant digits in a double precision number is known
5204 $cat >dbl_dig.c <<EOM
5214 printf("Contains DBL_DIG");
5217 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
5218 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
5219 echo "DBL_DIG found." >&4
5222 echo "DBL_DIG NOT found." >&4
5229 : see if difftime exists
5230 set difftime d_difftime
5233 : see if this is a dirent system
5235 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
5237 echo "<dirent.h> found." >&4
5240 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
5241 echo "<sys/dir.h> found." >&4
5244 xinc=`./findhdr sys/ndir.h`
5246 echo "<dirent.h> NOT found." >&4
5251 : Look for type of directory structure.
5253 $cppstdin $cppflags $cppminus < "$xinc" > try.c
5255 case "$direntrytype" in
5258 $define) guess1='struct dirent' ;;
5259 *) guess1='struct direct' ;;
5262 *) guess1="$direntrytype"
5267 'struct dirent') guess2='struct direct' ;;
5268 *) guess2='struct dirent' ;;
5271 if $contains "$guess1" try.c >/dev/null 2>&1; then
5272 direntrytype="$guess1"
5273 echo "Your directory entries are $direntrytype." >&4
5274 elif $contains "$guess2" try.c >/dev/null 2>&1; then
5275 direntrytype="$guess2"
5276 echo "Your directory entries seem to be $direntrytype." >&4
5278 echo "I don't recognize your system's directory entries." >&4
5279 rp="What type is used for directory entries on this system?"
5287 : see if the directory entry stores field length
5289 $cppstdin $cppflags $cppminus < "$xinc" > try.c
5290 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
5291 echo "Good, your directory entry keeps length information in d_namlen." >&4
5294 echo "Your directory entry does not know about the d_namlen field." >&4
5301 : see if dlerror exists
5304 set dlerror d_dlerror
5308 : see if dld is available
5312 : see if dlopen exists
5319 : determine which dynamic loading, if any, to compile in
5321 dldir="ext/DynaLoader"
5334 $define) dflt='y' ;;
5337 $define) dflt='y' ;;
5339 : Does a dl_xxx.xs file exist for this operating system
5340 $test -f ../$dldir/dl_${osname}.xs && dflt='y'
5343 rp="Do you wish to use dynamic loading?"
5350 if $test -f ../$dldir/dl_${osname}.xs ; then
5351 dflt="$dldir/dl_${osname}.xs"
5352 elif $test "$d_dlopen" = "$define" ; then
5353 dflt="$dldir/dl_dlopen.xs"
5354 elif $test "$i_dld" = "$define" ; then
5355 dflt="$dldir/dl_dld.xs"
5360 *) dflt="$dldir/$dlsrc"
5363 echo "The following dynamic loading files are available:"
5364 : Can not go over to $dldir because getfile has path hard-coded in.
5365 cd ..; ls -C $dldir/dl*.xs; cd UU
5366 rp="Source file to use for dynamic loading"
5371 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5375 Some systems may require passing special flags to $cc -c to
5376 compile modules that will be used to create a shared library.
5377 To use no flags, say "none".
5380 case "$cccdlflags" in
5381 '') case "$gccversion" in
5382 '') case "$osname" in
5384 next) dflt='none' ;;
5385 solaris|svr4*|esix*) dflt='-Kpic' ;;
5386 sunos) dflt='-pic' ;;
5391 *) dflt="$cccdlflags" ;;
5393 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5396 none) cccdlflags=' ' ;;
5397 *) cccdlflags="$ans" ;;
5402 Some systems use ld to create libraries that can be dynamically loaded,
5403 while other systems (such as those using ELF) use $cc.
5407 '') $cat >try.c <<'EOM'
5408 /* Test for whether ELF binaries are produced */
5413 int i = open("a.out",O_RDONLY);
5416 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5417 exit(0); /* succeed (yes, it's ELF) */
5422 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5424 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5428 echo "I'll use ld to build dynamic libraries."
5437 rp="What command should be used to create dynamic libraries?"
5443 Some systems may require passing special flags to $ld to create a
5444 library that can be dynamically loaded. If your ld flags include
5445 -L/other/path options to locate libraries outside your loader's normal
5446 search path, you may need to specify those -L options here as well. To
5447 use no flags, say "none".
5450 case "$lddlflags" in
5451 '') case "$osname" in
5453 linux) dflt='-shared' ;;
5454 next) dflt='none' ;;
5455 solaris) dflt='-G' ;;
5456 sunos) dflt='-assert nodefinitions' ;;
5457 svr4*|esix*) dflt="-G $ldflags" ;;
5461 *) dflt="$lddlflags" ;;
5464 : Try to guess additional flags to pick up local libraries.
5465 for thisflag in $ldflags; do
5470 *) dflt="$dflt $thisflag" ;;
5480 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5483 none) lddlflags=' ' ;;
5484 *) lddlflags="$ans" ;;
5489 Some systems may require passing special flags to $cc to indicate that
5490 the resulting executable will use dynamic linking. To use no flags,
5494 case "$ccdlflags" in
5495 '') case "$osname" in
5496 hpux) dflt='-Wl,-E' ;;
5497 linux) dflt='-rdynamic' ;;
5498 next) dflt='none' ;;
5499 sunos) dflt='none' ;;
5502 *) dflt="$ccdlflags" ;;
5504 rp="Any special flags to pass to $cc to use dynamic loading?"
5507 none) ccdlflags=' ' ;;
5508 *) ccdlflags="$ans" ;;
5526 System V Release 4 systems can support dynamic loading
5527 only if libperl is created as a shared library.
5534 set d_shrplib; eval $setvar
5535 case "$d_shrplib" in
5539 Be sure to add the perl source directory to the LD_LIBRARY_PATH
5540 environment variable before running make:
5541 LD_LIBRARY_PATH=`cd ..;pwd`; export LD_LIBRARY_PATH
5543 setenv LD_LIBRARY_PATH `cd ..;pwd`
5548 case "$d_shrplib" in
5551 "") dflt="$archlib/CORE";;
5552 *) dflt="$shrpdir";;
5554 rp="What directory should we install the shared libperl into?"
5563 : see if dlfcn is available
5571 On a few systems, the dynamically loaded modules that perl generates and uses
5572 will need a different extension then shared libs. The default will probably
5580 rp='What is the extension of dynamically loaded modules'
5589 : Check if dlsym need a leading underscore
5595 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
5596 $cat >dyna.c <<'EOM'
5605 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
5607 #include <sys/types.h>
5621 int mode = RTLD_LAZY ;
5623 handle = dlopen("./dyna.$dlext", mode) ;
5624 if (handle == NULL) {
5628 symbol = dlsym(handle, "fred") ;
5629 if (symbol == NULL) {
5630 /* try putting a leading underscore */
5631 symbol = dlsym(handle, "_fred") ;
5632 if (symbol == NULL) {
5643 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
5644 $ld $lddlflags -o dyna.$dlext dyna.o > /dev/null 2>&1 &&
5645 $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
5648 1) echo "Test program failed using dlopen." >&4
5649 echo "Perhaps you should not use dynamic loading." >&4;;
5650 2) echo "Test program failed using dlsym." >&4
5651 echo "Perhaps you should not use dynamic loading." >&4;;
5652 3) echo "dlsym needs a leading underscore" >&4
5654 4) echo "dlsym doesn't need a leading underscore." >&4;;
5657 echo "I can't compile and run the test program." >&4
5662 $rm -f fred fred.? dyna.$dlext dyna.?
5667 : see if dup2 exists
5671 : Locate the flags for 'open()'
5673 $cat >open3.c <<'EOCP'
5674 #include <sys/types.h>
5679 #include <sys/file.h>
5690 : check sys/file.h first to get FREAD on Sun
5691 if $test `./findhdr sys/file.h` && \
5692 $cc $cppflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then
5694 echo "<sys/file.h> defines the O_* constants..." >&4
5696 echo "and you have the 3 argument form of open()." >&4
5699 echo "but not the 3 argument form of open(). Oh, well." >&4
5702 elif $test `./findhdr fcntl.h` && \
5703 $cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then
5705 echo "<fcntl.h> defines the O_* constants..." >&4
5707 echo "and you have the 3 argument form of open()." >&4
5710 echo "but not the 3 argument form of open(). Oh, well." >&4
5715 echo "I can't find the O_* constant definitions! You got problems." >&4
5721 : check for non-blocking I/O stuff
5722 case "$h_sysfile" in
5723 true) echo "#include <sys/file.h>" > head.c;;
5726 true) echo "#include <fcntl.h>" > head.c;;
5727 *) echo "#include <sys/fcntl.h>" > head.c;;
5732 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
5733 case "$o_nonblock" in
5736 $cat >>try.c <<'EOCP'
5739 printf("O_NONBLOCK\n");
5743 printf("O_NDELAY\n");
5747 printf("FNDELAY\n");
5753 if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then
5755 case "$o_nonblock" in
5756 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
5757 *) echo "Seems like we can use $o_nonblock.";;
5760 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
5763 *) echo "Using $hint value $o_nonblock.";;
5765 $rm -f try try.* .out core
5768 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
5774 #include <sys/types.h>
5776 #define MY_O_NONBLOCK $o_nonblock
5778 $signal_t blech(x) int x; { exit(3); }
5780 $cat >> try.c <<'EOCP'
5788 pipe(pd); /* Down: child -> parent */
5789 pipe(pu); /* Up: parent -> child */
5792 close(pd[1]); /* Parent reads from pd[0] */
5793 close(pu[0]); /* Parent writes (blocking) to pu[1] */
5794 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
5796 signal(SIGALRM, blech);
5798 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
5800 sprintf(string, "%d\n", ret);
5801 write(2, string, strlen(string));
5804 if (errno == EAGAIN) {
5810 if (errno == EWOULDBLOCK)
5811 printf("EWOULDBLOCK\n");
5814 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
5815 sleep(2); /* Give it time to close our pipe */
5817 ret = read(pd[0], buf, 1); /* Should read EOF */
5819 sprintf(string, "%d\n", ret);
5820 write(3, string, strlen(string));
5824 close(pd[0]); /* We write to pd[1] */
5825 close(pu[1]); /* We read from pu[0] */
5826 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
5827 close(pd[1]); /* Pipe pd is now fully closed! */
5828 exit(0); /* Bye bye, thank you for playing! */
5831 if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then
5832 echo "$startsh" >mtry
5833 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
5835 ./mtry >/dev/null 2>&1
5837 0) eagain=`$cat try.out`;;
5838 1) echo "Could not perform non-blocking setting!";;
5839 2) echo "I did a successful read() for something that was not there!";;
5840 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
5841 *) echo "Something terribly wrong happened during testing.";;
5843 rd_nodata=`$cat try.ret`
5844 echo "A read() system call with no data present returns $rd_nodata."
5845 case "$rd_nodata" in
5848 echo "(That's peculiar, fixing that to be -1.)"
5854 echo "Forcing errno EAGAIN on read() with no data available."
5858 echo "Your read() sets errno to $eagain when no data is available."
5861 status=`$cat try.err`
5863 0) echo "And it correctly returns 0 to signal EOF.";;
5864 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
5865 *) echo "However, your read() returns '$status' on EOF??";;
5868 if test "$status" -eq "$rd_nodata"; then
5869 echo "WARNING: you can't distinguish between EOF and no data!"
5873 echo "I can't compile the test program--assuming errno EAGAIN will do."
5880 echo "Using $hint value $eagain."
5881 echo "Your read() returns $rd_nodata when no data is present."
5882 case "$d_eofnblk" in
5883 "$define") echo "And you can see EOF because read() returns 0.";;
5884 "$undef") echo "But you can't see EOF status from read() returned value.";;
5886 echo "(Assuming you can't see EOF status from read anyway.)"
5892 $rm -f try try.* .out core head.c mtry
5894 : see if fchmod exists
5898 : see if fchown exists
5902 : see if this is an fcntl system
5906 : see if fgetpos exists
5907 set fgetpos d_fgetpos
5910 : see if flock exists
5914 : see if fork exists
5918 : see if pathconf exists
5919 set pathconf d_pathconf
5922 : see if fpathconf exists
5923 set fpathconf d_fpathconf
5926 : see if fsetpos exists
5927 set fsetpos d_fsetpos
5930 : see if gethostent exists
5931 set gethostent d_gethent
5934 : see if getlogin exists
5935 set getlogin d_getlogin
5938 : see if getpgrp exists
5939 set getpgrp d_getpgrp
5942 : see if getpgrp2 exists
5943 set getpgrp2 d_getpgrp2
5946 : see if getppid exists
5947 set getppid d_getppid
5950 : see if getpriority exists
5951 set getpriority d_getprior
5954 : see if this is a netinet/in.h or sys/in.h system
5955 set netinet/in.h i_niin sys/in.h i_sysin
5958 : see if htonl --and friends-- exists
5963 : Maybe they are macros.
5968 #include <sys/types.h>
5969 #$i_niin I_NETINET_IN
5972 #include <netinet/in.h>
5978 printf("Defined as a macro.");
5981 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
5982 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
5984 echo "But it seems to be defined as a macro." >&4
5992 : see which of string.h or strings.h is needed
5994 strings=`./findhdr string.h`
5995 if $test "$strings" && $test -r "$strings"; then
5996 echo "Using <string.h> instead of <strings.h>." >&4
6000 strings=`./findhdr strings.h`
6001 if $test "$strings" && $test -r "$strings"; then
6002 echo "Using <strings.h> instead of <string.h>." >&4
6004 echo "No string header found -- You'll surely have problems." >&4
6010 "$undef") strings=`./findhdr strings.h`;;
6011 *) strings=`./findhdr string.h`;;
6016 if set index val -f; eval $csym; $val; then
6017 if set strchr val -f d_strchr; eval $csym; $val; then
6018 if $contains strchr "$strings" >/dev/null 2>&1 ; then
6021 echo "strchr() found." >&4
6025 echo "index() found." >&4
6030 echo "index() found." >&4
6033 if set strchr val -f d_strchr; eval $csym; $val; then
6036 echo "strchr() found." >&4
6038 echo "No index() or strchr() found!" >&4
6043 set d_strchr; eval $setvar
6045 set d_index; eval $setvar
6049 $cat >isascii.c <<'EOCP'
6060 if $cc $ccflags $ldflags -o isascii isascii.c $libs >/dev/null 2>&1 ; then
6061 echo "isascii() found." >&4
6064 echo "isascii() NOT found." >&4
6071 : see if killpg exists
6075 : see if link exists
6079 : see if localeconv exists
6080 set localeconv d_locconv
6083 : see if lockf exists
6087 : see if lstat exists
6091 : see if mblen exists
6095 : see if mbstowcs exists
6096 set mbstowcs d_mbstowcs
6099 : see if mbtowc exists
6103 : see if memcmp exists
6107 : see if memcpy exists
6111 : see if memmove exists
6112 set memmove d_memmove
6115 : see if memset exists
6119 : see if mkdir exists
6123 : see if mkfifo exists
6127 : see if mktime exists
6131 : see if msgctl exists
6135 : see if msgget exists
6139 : see if msgsnd exists
6143 : see if msgrcv exists
6147 : see how much of the 'msg*(2)' library is present.
6150 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
6151 *"$undef"*) h_msg=false;;
6153 : we could also check for sys/ipc.h ...
6154 if $h_msg && $test `./findhdr sys/msg.h`; then
6155 echo "You have the full msg*(2) library." >&4
6158 echo "You don't have the full msg*(2) library." >&4
6164 : see if this is a malloc.h system
6165 set malloc.h i_malloc
6168 : see if stdlib is available
6169 set stdlib.h i_stdlib
6172 : determine which malloc to compile in
6174 case "$usemymalloc" in
6175 ''|y*|true) dflt='y' ;;
6176 n*|false) dflt='n' ;;
6177 *) dflt="$usemymalloc" ;;
6179 rp="Do you wish to attempt to use the malloc that comes with $package?"
6185 mallocsrc='malloc.c'
6186 mallocobj='malloc.o'
6187 d_mymalloc="$define"
6190 : Remove malloc from list of libraries to use
6191 echo "Removing unneeded -lmalloc from library list" >&4
6192 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6195 echo "libs = $libs" >&4
6207 : compute the return types of malloc and free
6209 $cat >malloc.c <<END
6213 #include <sys/types.h>
6227 case "$malloctype" in
6229 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6236 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6240 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6247 echo "Your system uses $freetype free(), it would seem." >&4
6249 : see if nice exists
6253 : see if pause exists
6257 : see if pipe exists
6261 : see if poll exists
6265 : see if this is a pwd.h system
6271 xxx=`./findhdr pwd.h`
6272 $cppstdin $cppflags $cppminus < $xxx >$$.h
6274 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
6282 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
6290 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
6298 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
6306 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
6314 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
6326 set d_pwquota; eval $setvar
6327 set d_pwage; eval $setvar
6328 set d_pwchange; eval $setvar
6329 set d_pwclass; eval $setvar
6330 set d_pwexpire; eval $setvar
6331 set d_pwcomment; eval $setvar
6335 : see if readdir and friends exist
6336 set readdir d_readdir
6338 set seekdir d_seekdir
6340 set telldir d_telldir
6342 set rewinddir d_rewinddir
6345 : see if readlink exists
6346 set readlink d_readlink
6349 : see if rename exists
6353 : see if rmdir exists
6357 : can bcopy handle overlapping blocks?
6362 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
6363 $cat >foo.c <<'EOCP'
6366 char buf[128], abc[128];
6372 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
6374 for (align = 7; align >= 0; align--) {
6375 for (len = 36; len; len--) {
6378 for (off = 1; off <= len; off++) {
6379 bcopy(b, b+off, len);
6380 bcopy(b+off, b, len);
6381 if (bcmp(b, abc, len))
6389 if $cc $ccflags $ldflags foo.c -o safebcpy $libs >/dev/null 2>&1; then
6390 if ./safebcpy 2>/dev/null; then
6394 echo "It can't, sorry."
6397 echo "(I can't compile the test program, so we'll assume not...)"
6401 $rm -f foo.* safebcpy core
6405 : can memcpy handle overlapping blocks?
6410 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
6411 $cat >foo.c <<'EOCP'
6414 char buf[128], abc[128];
6420 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
6422 for (align = 7; align >= 0; align--) {
6423 for (len = 36; len; len--) {
6425 memcpy(b, abc, len);
6426 for (off = 1; off <= len; off++) {
6427 memcpy(b+off, b, len);
6428 memcpy(b, b+off, len);
6429 if (memcmp(b, abc, len))
6437 if $cc $ccflags $ldflags foo.c -o safemcpy $libs >/dev/null 2>&1; then
6438 if ./safemcpy 2>/dev/null; then
6442 echo "It can't, sorry."
6445 echo "(I can't compile the test program, so we'll assume not...)"
6449 $rm -f foo.* safemcpy core
6453 : see if select exists
6457 : see if semctl exists
6461 : see if semget exists
6465 : see if semop exists
6469 : see how much of the 'sem*(2)' library is present.
6472 case "$d_semctl$d_semget$d_semop" in
6473 *"$undef"*) h_sem=false;;
6475 : we could also check for sys/ipc.h ...
6476 if $h_sem && $test `./findhdr sys/sem.h`; then
6477 echo "You have the full sem*(2) library." >&4
6480 echo "You don't have the full sem*(2) library." >&4
6486 : see if setegid exists
6487 set setegid d_setegid
6490 : see if seteuid exists
6491 set seteuid d_seteuid
6494 : see if setlinebuf exists
6495 set setlinebuf d_setlinebuf
6498 : see if setlocale exists
6499 set setlocale d_setlocale
6502 : see if setpgid exists
6503 set setpgid d_setpgid
6506 : see if setpgrp2 exists
6507 set setpgrp2 d_setpgrp2
6510 : see if setpriority exists
6511 set setpriority d_setprior
6514 : see if setregid exists
6515 set setregid d_setregid
6517 set setresgid d_setresgid
6520 : see if setreuid exists
6521 set setreuid d_setreuid
6523 set setresuid d_setresuid
6526 : see if setrgid exists
6527 set setrgid d_setrgid
6530 : see if setruid exists
6531 set setruid d_setruid
6534 : see if setsid exists
6538 : see if shmctl exists
6542 : see if shmget exists
6546 : see if shmat exists
6549 : see what shmat returns
6552 $cat >shmat.c <<'END'
6553 #include <sys/shm.h>
6556 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
6561 echo "and it returns ($shmattype)." >&4
6562 : see if a prototype for shmat is available
6563 xxx=`./findhdr sys/shm.h`
6564 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
6565 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
6576 set d_shmatprototype
6579 : see if shmdt exists
6583 : see how much of the 'shm*(2)' library is present.
6586 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
6587 *"$undef"*) h_shm=false;;
6589 : we could also check for sys/ipc.h ...
6590 if $h_shm && $test `./findhdr sys/shm.h`; then
6591 echo "You have the full shm*(2) library." >&4
6594 echo "You don't have the full shm*(2) library." >&4
6600 : see if sigvector exists -- since sigvec will match the substring
6602 if set sigvector val -f d_sigvectr; eval $csym; $val; then
6603 echo 'sigvector() found--you must be running HP-UX.' >&4
6604 val="$define"; set d_sigvectr; eval $setvar
6605 val="$define"; set d_sigvec; eval $setvar
6607 : try the original name
6609 if set sigvec val -f d_sigvec; eval $csym; $val; then
6610 echo 'sigvec() found.' >&4
6611 val="$define"; set d_sigvec; eval $setvar
6613 echo 'sigvec() not found--race conditions with signals may occur.' >&4
6614 val="$undef"; set d_sigvec; eval $setvar
6618 : see if we have sigaction
6619 set sigaction d_sigaction
6624 : see whether socket exists
6626 $echo $n "Hmm... $c" >&4
6627 if set socket val -f d_socket; eval $csym; $val; then
6628 echo "Looks like you have Berkeley networking support." >&4
6630 if set setsockopt val -f; eval $csym; $val; then
6633 echo "...but it uses the old 4.1c interface, rather than 4.2" >&4
6637 if $contains socklib libc.list >/dev/null 2>&1; then
6638 echo "Looks like you have Berkeley networking support." >&4
6640 : we will have to assume that it supports the 4.2 BSD interface
6643 echo "You don't have Berkeley networking in libc.a..." >&4
6644 if test -f /usr/lib/libnet.a; then
6645 ( (nm $nm_opt /usr/lib/libnet.a | eval $nm_extract) || \
6646 ar t /usr/lib/libnet.a) 2>/dev/null >> libc.list
6647 if $contains socket libc.list >/dev/null 2>&1; then
6648 echo "...but the Wollongong group seems to have hacked it in." >&4
6650 sockethdr="-I/usr/netinclude"
6652 if $contains setsockopt libc.list >/dev/null 2>&1; then
6655 echo "...using the old 4.1c interface, rather than 4.2" >&4
6659 echo "or even in libnet.a, which is peculiar." >&4
6664 echo "or anywhere else I see." >&4
6671 : see if socketpair exists
6672 set socketpair d_sockpair
6675 : see if stat knows about block sizes
6677 xxx=`./findhdr sys/stat.h`
6678 if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then
6679 if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then
6680 echo "Your stat() knows about block sizes." >&4
6683 echo "Your stat() doesn't know about block sizes." >&4
6687 echo "Your stat() doesn't know about block sizes." >&4
6693 : see if _ptr and _cnt from stdio act std
6695 if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
6696 echo "(Looks like you have stdio.h from Linux.)"
6697 case "$stdio_ptr" in
6698 '') stdio_ptr='((fp)->_IO_read_ptr)'
6701 *) ptr_lval=$d_stdio_ptr_lval;;
6703 case "$stdio_cnt" in
6704 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
6707 *) cnt_lval=$d_stdio_cnt_lval;;
6709 case "$stdio_base" in
6710 '') stdio_base='((fp)->_IO_read_base)';;
6712 case "$stdio_bufsiz" in
6713 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
6716 case "$stdio_ptr" in
6717 '') stdio_ptr='((fp)->_ptr)'
6720 *) ptr_lval=$d_stdio_ptr_lval;;
6722 case "$stdio_cnt" in
6723 '') stdio_cnt='((fp)->_cnt)'
6726 *) cnt_lval=$d_stdio_cnt_lval;;
6728 case "$stdio_base" in
6729 '') stdio_base='((fp)->_base)';;
6731 case "$stdio_bufsiz" in
6732 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
6735 : test whether _ptr and _cnt really work
6736 echo "Checking how std your stdio is..." >&4
6739 #define FILE_ptr(fp) $stdio_ptr
6740 #define FILE_cnt(fp) $stdio_cnt
6742 FILE *fp = fopen("try.c", "r");
6745 18 <= FILE_cnt(fp) &&
6746 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
6753 if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1; then
6755 echo "Your stdio acts pretty std."
6758 echo "Your stdio isn't very std."
6761 echo "Your stdio doesn't appear very std."
6767 : Can _ptr be used as an lvalue?
6768 case "$d_stdstdio$ptr_lval" in
6769 $define$define) val=$define ;;
6772 set d_stdio_ptr_lval
6775 : Can _cnt be used as an lvalue?
6776 case "$d_stdstdio$cnt_lval" in
6777 $define$define) val=$define ;;
6780 set d_stdio_cnt_lval
6783 : see if _base is also standard
6785 case "$d_stdstdio" in
6789 #define FILE_base(fp) $stdio_base
6790 #define FILE_bufsiz(fp) $stdio_bufsiz
6792 FILE *fp = fopen("try.c", "r");
6795 19 <= FILE_bufsiz(fp) &&
6796 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
6802 if $cc $ccflags $ldflags -o try try.c $libs > /dev/null 2>&1; then
6804 echo "Even its _base field acts std."
6807 echo "But its _base field isn't std."
6810 echo "However, it seems to be lacking the _base field."
6818 : see if strcoll exists
6819 set strcoll d_strcoll
6822 : check for structure copying
6824 echo "Checking to see if your C compiler can copy structs..." >&4
6825 $cat >try.c <<'EOCP'
6835 if $cc -c try.c >/dev/null 2>&1 ; then
6840 echo "Nope, it can't."
6846 : see if strerror and/or sys_errlist[] exist
6848 if set strerror val -f d_strerror; eval $csym; $val; then
6849 echo 'strerror() found.' >&4
6850 d_strerror="$define"
6851 d_strerrm='strerror(e)'
6852 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
6853 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
6854 d_syserrlst="$define"
6856 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
6857 d_syserrlst="$undef"
6859 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
6860 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
6861 echo 'strerror() found in string header.' >&4
6862 d_strerror="$define"
6863 d_strerrm='strerror(e)'
6864 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
6865 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
6866 d_syserrlst="$define"
6868 echo "(You don't appear to have any sys_errlist[], how can this be?)"
6869 d_syserrlst="$undef"
6871 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
6872 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
6874 d_syserrlst="$define"
6875 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
6877 echo 'strerror() and sys_errlist[] NOT found.' >&4
6879 d_syserrlst="$undef"
6880 d_strerrm='"unknown"'
6883 : see if strxfrm exists
6884 set strxfrm d_strxfrm
6887 : see if symlink exists
6888 set symlink d_symlink
6891 : see if syscall exists
6892 set syscall d_syscall
6895 : see if sysconf exists
6896 set sysconf d_sysconf
6899 : see if system exists
6903 : see if tcgetpgrp exists
6904 set tcgetpgrp d_tcgetpgrp
6907 : see if tcsetpgrp exists
6908 set tcsetpgrp d_tcsetpgrp
6911 : define an is-a-typedef? function
6912 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
6914 "") inclist="sys/types.h";;
6916 eval "varval=\$$var";
6920 for inc in $inclist; do
6921 echo "#include <$inc>" >>temp.c;
6923 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
6924 if $contains $type temp.E >/dev/null 2>&1; then
6930 *) eval "$var=\$varval";;
6933 : see if this is a sys/times.h system
6934 set sys/times.h i_systimes
6937 : see if times exists
6939 if set times val -f d_times; eval $csym; $val; then
6940 echo 'times() found.' >&4
6943 case "$i_systimes" in
6944 "$define") inc='sys/times.h';;
6946 set clock_t clocktype long stdio.h sys/types.h $inc
6950 rp="What type is returned by times() on this system?"
6954 echo 'times() NOT found, hope that will do.' >&4
6959 : see if truncate exists
6960 set truncate d_truncate
6963 : see if tzname[] exists
6965 if set tzname val -a d_tzname; eval $csym; $val; then
6967 echo 'tzname[] found.' >&4
6970 echo 'tzname[] NOT found.' >&4
6975 : see if umask exists
6979 : see how we will look up host name
6982 : dummy stub to allow use of elif
6983 elif set uname val -f d_uname; eval $csym; $val; then
6986 uname() was found, but you're running xenix, and older versions of xenix
6987 have a broken uname(). If you don't really know whether your xenix is old
6988 enough to have a broken system call, use the default answer.
6995 rp='Is your uname() broken?'
6998 n*) d_uname="$define"; call=uname;;
7001 echo 'uname() found.' >&4
7006 case "$d_gethname" in
7007 '') d_gethname="$undef";;
7010 '') d_uname="$undef";;
7012 case "$d_phostname" in
7013 '') d_phostname="$undef";;
7016 : backward compatibility for d_hvfork
7017 if test X$d_hvfork != X; then
7021 : see if there is a vfork
7026 : Ok, but do we want to use it. vfork is reportedly unreliable in
7027 : perl on Solaris 2.x, and probably elsewhere.
7035 rp="Some systems have problems with vfork(). Do you want to use it?"
7040 echo "Ok, we won't use vfork()."
7049 $define) usevfork='true';;
7050 *) usevfork='false';;
7053 : see if this is an sysdir system
7054 set sys/dir.h i_sysdir
7057 : see if this is an sysndir system
7058 set sys/ndir.h i_sysndir
7061 : see if closedir exists
7062 set closedir d_closedir
7065 case "$d_closedir" in
7068 echo "Checking whether closedir() returns a status..." >&4
7069 cat > closedir.c <<EOM
7070 #$i_dirent I_DIRENT /**/
7071 #$i_sysdir I_SYS_DIR /**/
7072 #$i_sysndir I_SYS_NDIR /**/
7074 #if defined(I_DIRENT)
7076 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
7077 #include <sys/dir.h>
7081 #include <sys/ndir.h>
7085 #include <ndir.h> /* may be wrong in the future */
7087 #include <sys/dir.h>
7092 int main() { return closedir(opendir(".")); }
7094 if $cc $ccflags $ldflags -o closedir closedir.c $libs > /dev/null 2>&1; then
7095 if ./closedir > /dev/null 2>&1 ; then
7096 echo "Yes, it does."
7099 echo "No, it doesn't."
7103 echo "(I can't seem to compile the test program--assuming it doesn't)"
7114 : check for volatile keyword
7116 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
7117 $cat >try.c <<'EOCP'
7120 typedef struct _goo_struct goo_struct;
7121 goo_struct * volatile goo = ((goo_struct *)0);
7122 struct _goo_struct {
7127 typedef unsigned short foo_t;
7130 volatile foo_t blech;
7134 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
7136 echo "Yup, it does."
7139 echo "Nope, it doesn't."
7145 : see if there is a wait4
7149 : see if waitpid exists
7150 set waitpid d_waitpid
7153 : see if wcstombs exists
7154 set wcstombs d_wcstombs
7157 : see if wctomb exists
7161 : preserve RCS keywords in files with variable substitution, grrr
7166 Revision='$Revision'
7168 : check for alignment requirements
7170 case "$alignbytes" in
7171 '') echo "Checking alignment constraints..." >&4
7172 $cat >try.c <<'EOCP'
7179 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
7182 if $cc $ccflags try.c -o try >/dev/null 2>&1; then
7186 echo"(I can't seem to compile the test program...)"
7189 *) dflt="$alignbytes"
7192 rp="Doubles must be aligned on a how-many-byte boundary?"
7197 : Define several unixisms. Hints files or command line options
7198 : can be used to override them.
7211 : Which makefile gets called first. This is used by make depend.
7212 case "$firstmakefile" in
7213 '') firstmakefile='makefile';;
7216 : check for ordering of bytes in a long
7217 case "$byteorder" in
7221 In the following, larger digits indicate more significance. A big-endian
7222 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
7223 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
7224 machines may have weird orders like 3412. A Cray will report 87654321. If
7225 the test program works the default is probably right.
7226 I'm now running the test program...
7228 $cat >try.c <<'EOCP'
7235 char c[sizeof(long)];
7238 if (sizeof(long) > 4)
7239 u.l = (0x08070605L << 32) | 0x04030201L;
7242 for (i = 0; i < sizeof(long); i++)
7243 printf("%c", u.c[i]+'0');
7249 if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
7252 [1-4][1-4][1-4][1-4]|12345678|87654321)
7253 echo "(The test program ran ok.)"
7254 echo "byteorder=$dflt"
7257 ????|????????) echo "(The test program ran ok.)" ;;
7258 *) echo "(The test program didn't run right for some reason.)" ;;
7263 (I can't seem to compile the test program. Guessing big-endian...)
7266 case "$xxx_prompt" in
7268 rp="What is the order of bytes in a long?"
7279 : how do we catenate cpp tokens here?
7281 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
7282 $cat >cpp_stuff.c <<'EOCP'
7283 #define RCAT(a,b)a/**/b
7284 #define ACAT(a,b)a ## b
7288 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
7289 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
7290 echo "Oh! Smells like ANSI's been here."
7291 echo "We can catify or stringify, separately or together!"
7293 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
7294 echo "Ah, yes! The good old days!"
7295 echo "However, in the good old days we don't know how to stringify and"
7296 echo "catify at the same time."
7300 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
7301 to have to edit the values of CAT[2-5] in config.h...
7303 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
7307 : see if this is a db.h system
7313 : Check the return type needed for hash
7315 echo "Checking return type needed for hash for Berkeley DB ..." >&4
7321 #include <sys/types.h>
7323 u_int32_t hash_cb (ptr, size)
7331 info.hash = hash_cb;
7334 if $cc $ccflags -c try.c >try.out 2>&1 ; then
7335 if $contains warning try.out >>/dev/null 2>&1 ; then
7338 db_hashtype='u_int32_t'
7341 echo "I can't seem to compile the test program." >&4
7345 echo "Your version of Berkeley DB uses $db_hashtype for hash."
7353 : Check the return type needed for prefix
7355 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
7361 #include <sys/types.h>
7363 size_t prefix_cb (key1, key2)
7371 info.prefix = prefix_cb;
7374 if $cc $ccflags -c try.c >try.out 2>&1 ; then
7375 if $contains warning try.out >>/dev/null 2>&1 ; then
7378 db_prefixtype='size_t'
7381 echo "I can't seem to compile the test program." >&4
7385 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
7387 *) db_prefixtype='int'
7391 : check for void type
7393 echo "Checking to see how well your C compiler groks the void type..." >&4
7396 Support flag bits are:
7397 1: basic void declarations.
7398 2: arrays of pointers to functions returning void.
7399 4: operations between pointers to and addresses of void functions.
7400 8: generic void pointers.
7403 case "$voidflags" in
7405 $cat >try.c <<'EOCP'
7411 extern void moo(); /* function returning void */
7412 void (*goo)(); /* ptr to func returning void */
7414 void *hue; /* generic ptr */
7428 if $cc -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
7429 voidflags=$defvoidused
7430 echo "It appears to support void to the level $package wants ($defvoidused)."
7431 if $contains warning .out >/dev/null 2>&1; then
7432 echo "However, you might get some warnings that look like this:"
7436 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
7437 if $cc -c -DTRY=1 try.c >/dev/null 2>&1 ; then
7438 echo "It supports 1..."
7439 if $cc -c -DTRY=3 try.c >/dev/null 2>&1 ; then
7440 echo "It also supports 2..."
7441 if $cc -c -DTRY=7 try.c >/dev/null 2>&1 ; then
7443 echo "And it supports 4 but not 8 definitely."
7445 echo "It doesn't support 4..."
7446 if $cc -c -DTRY=11 try.c >/dev/null 2>&1 ; then
7448 echo "But it supports 8."
7451 echo "Neither does it support 8."
7455 echo "It does not support 2..."
7456 if $cc -c -DTRY=13 try.c >/dev/null 2>&1 ; then
7458 echo "But it supports 4 and 8."
7460 if $cc -c -DTRY=5 try.c >/dev/null 2>&1 ; then
7462 echo "And it supports 4 but has not heard about 8."
7464 echo "However it supports 8 but not 4."
7469 echo "There is no support at all for void."
7474 : Only prompt user if support does not match the level we want
7475 case "$voidflags" in
7479 rp="Your void support flags add up to what?"
7486 : see what type file positions are declared as in the library
7487 set fpos_t fpostype long stdio.h sys/types.h
7491 rp="What is the type for file position used by fsetpos()?"
7495 : Store the full pathname to the sed program for use in the C program
7498 : see what type gids are declared as in the kernel
7499 set gid_t gidtype xxx stdio.h sys/types.h
7503 xxx=`./findhdr sys/user.h`
7504 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
7506 unsigned) dflt="$1 $2" ;;
7510 *) dflt="$gidtype";;
7513 rp="What is the type for group ids returned by getgid()?"
7517 : see if getgroups exists
7518 set getgroups d_getgrps
7521 : Find type of 2nd arg to getgroups
7523 case "$d_getgrps" in
7525 case "$groupstype" in
7526 '') dflt="$gidtype" ;;
7527 *) dflt="$groupstype" ;;
7530 What is the type of the second argument to getgroups()? Usually this
7531 is the same as group ids, $gidtype, but not always.
7534 rp='What type is the second argument to getgroups()?'
7538 *) groupstype="$gidtype";;
7541 : see what type lseek is declared as in the kernel
7542 set off_t lseektype long stdio.h sys/types.h
7546 rp="What type is lseek's offset on this system declared as?"
7550 : see what type is used for mode_t
7551 set mode_t modetype int stdio.h sys/types.h
7555 rp="What type is used for file modes?"
7559 : locate the preferred pager for this system
7573 '') dflt=/usr/ucb/more;;
7580 rp='What pager is used on your system?'
7584 : Cruising for prototypes
7586 echo "Checking out function prototypes..." >&4
7587 $cat >prototype.c <<'EOCP'
7588 main(int argc, char *argv[]) {
7591 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7592 echo "Your C compiler appears to support function prototypes."
7595 echo "Your C compiler doesn't seem to understand function prototypes."
7602 : check for size of random number generator
7606 echo "Checking to see how many bits your rand function produces..." >&4
7607 $cat >try.c <<'EOCP'
7612 register unsigned long tmp;
7613 register unsigned long max = 0L;
7615 for (i = 1000; i; i--) {
7616 tmp = (unsigned long)rand();
7617 if (tmp > max) max = tmp;
7619 for (i = 0; max; i++)
7624 if $cc try.c -o try >/dev/null 2>&1 ; then
7628 echo "(I can't seem to compile the test program...)"
7635 rp='How many bits does your rand() function produce?'
7640 : see if ar generates random libraries by itself
7642 echo "Checking how to generate random libraries on your machine..." >&4
7643 echo 'int bar1() { return bar2(); }' > bar1.c
7644 echo 'int bar2() { return 2; }' > bar2.c
7645 $cat > foo.c <<'EOP'
7646 main() { printf("%d\n", bar1()); exit(0); }
7648 $cc $ccflags -c bar1.c >/dev/null 2>&1
7649 $cc $ccflags -c bar2.c >/dev/null 2>&1
7650 $cc $ccflags -c foo.c >/dev/null 2>&1
7651 ar rc bar.a bar2.o bar1.o >/dev/null 2>&1
7652 if $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
7653 ./foobar >/dev/null 2>&1; then
7654 echo "ar appears to generate random libraries itself."
7657 elif ar ts bar.a >/dev/null 2>&1 &&
7658 $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
7659 ./foobar >/dev/null 2>&1; then
7660 echo "a table of contents needs to be added with 'ar ts'."
7667 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
7668 $test -f $ranlib || ranlib=''
7671 if $test -n "$ranlib"; then
7672 echo "your system has '$ranlib'; we'll use that."
7675 echo "your system doesn't seem to support random libraries"
7676 echo "so we'll use lorder and tsort to order the libraries."
7683 : see if sys/select.h has to be included
7684 set sys/select.h i_sysselct
7687 : see if we should include time.h, sys/time.h, or both
7689 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
7690 $echo $n "I'm now running the test program...$c"
7691 $cat >try.c <<'EOCP'
7692 #include <sys/types.h>
7697 #ifdef SYSTIMEKERNEL
7700 #include <sys/time.h>
7703 #include <sys/select.h>
7712 struct timezone tzp;
7714 if (foo.tm_sec == foo.tm_sec)
7717 if (bar.tv_sec == bar.tv_sec)
7724 for s_timezone in '-DS_TIMEZONE' ''; do
7726 for s_timeval in '-DS_TIMEVAL' ''; do
7727 for i_systimek in '' '-DSYSTIMEKERNEL'; do
7728 for i_time in '' '-DI_TIME'; do
7729 for i_systime in '-DI_SYSTIME' ''; do
7733 $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \
7734 try.c -o try >/dev/null 2>&1 ; then
7735 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
7739 $echo $n "Succeeded with $flags$c"
7751 *SYSTIMEKERNEL*) i_systimek="$define"
7752 timeincl=`./findhdr sys/time.h`
7753 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
7754 *) i_systimek="$undef";;
7757 *I_TIME*) i_time="$define"
7758 timeincl=`./findhdr time.h`" $timeincl"
7759 echo "We'll include <time.h>." >&4;;
7760 *) i_time="$undef";;
7763 *I_SYSTIME*) i_systime="$define"
7764 timeincl=`./findhdr sys/time.h`" $timeincl"
7765 echo "We'll include <sys/time.h>." >&4;;
7766 *) i_systime="$undef";;
7770 : check for fd_set items
7773 Checking to see how well your C compiler handles fd_set and friends ...
7775 $cat >fd_set.c <<EOCP
7776 #$i_systime I_SYS_TIME
7777 #$i_sysselct I_SYS_SELECT
7778 #$d_socket HAS_SOCKET
7779 #include <sys/types.h>
7781 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
7784 #include <sys/time.h>
7787 #include <sys/select.h>
7797 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
7804 if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
7805 d_fds_bits="$define"
7807 echo "Well, your system knows about the normal fd_set typedef..." >&4
7809 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
7810 d_fd_macros="$define"
7813 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
7815 d_fd_macros="$undef"
7819 Hmm, your compiler has some difficulty with fd_set. Checking further...
7821 if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
7824 echo "Well, your system has some sort of fd_set available..." >&4
7826 echo "and you have the normal fd_set macros." >&4
7827 d_fd_macros="$define"
7830 but not the normal fd_set macros! Gross! More work for me...
7832 d_fd_macros="$undef"
7835 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
7838 d_fd_macros="$undef"
7844 : check for type of arguments to select. This will only really
7845 : work if the system supports prototypes and provides one for
7849 : Make initial guess
7850 case "$selecttype" in
7853 $define) xxx='fd_set *' ;;
7857 *) xxx="$selecttype"
7862 'fd_set *') yyy='int *' ;;
7863 'int *') yyy='fd_set *' ;;
7868 Checking to see what type of arguments are expected by select().
7871 #$i_systime I_SYS_TIME
7872 #$i_sysselct I_SYS_SELECT
7873 #$d_socket HAS_SOCKET
7874 #include <sys/types.h>
7876 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
7879 #include <sys/time.h>
7882 #include <sys/select.h>
7888 Select_fd_set_t readfds;
7889 Select_fd_set_t writefds;
7890 Select_fd_set_t exceptfds;
7891 struct timeval timeout;
7892 select(width, readfds, writefds, exceptfds, &timeout);
7896 if $cc $ccflags -c -DSelect_fd_set_t="$xxx" try.c >/dev/null 2>&1 ; then
7898 echo "Your system uses $xxx for the arguments to select." >&4
7899 elif $cc $ccflags -c -DSelect_fd_set_t="$yyy" try.c >/dev/null 2>&1 ; then
7901 echo "Your system uses $yyy for the arguments to select." >&4
7903 rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
7910 *) selecttype='int *'
7914 : Trace out the files included by signal.h, then look for SIGxxx names.
7915 : Remove SIGARRAYSIZE used by HPUX.
7916 : Remove SIGTYP void lines used by OS2.
7917 xxx=`echo '#include <signal.h>' |
7918 $cppstdin $cppminus $cppflags 2>/dev/null |
7919 $grep '^[ ]*#.*include' |
7920 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
7921 : Check this list of files to be sure we have parsed the cpp output ok.
7922 : This will also avoid potentially non-existent files, such
7925 for xx in $xxx /dev/null ; do
7926 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
7928 : If we have found no files, at least try signal.h
7930 '') xxxfiles=`./findhdr signal.h` ;;
7933 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ {
7934 print substr($2, 4, 20)
7936 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
7937 print substr($3, 4, 20)
7939 : Append some common names just in case the awk scan failed.
7940 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
7941 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
7942 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
7943 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
7944 : generate a few handy files for later
7945 $cat > signal.c <<'EOP'
7946 #include <sys/types.h>
7950 printf("NSIG %d\n", NSIG);
7953 printf("NSIG %d\n", _NSIG);
7957 echo $xxx | $tr ' ' '\012' | $sort | $uniq | $awk '
7959 printf "#ifdef SIG"; printf $1; printf "\n"
7960 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
7961 printf $1; printf ");\n"
7968 $cat >signal.awk <<'EOP'
7970 $1 ~ /^NSIG$/ { nsig = $2 }
7971 ($1 !~ /^NSIG$/) && (NF == 2) {
7972 if ($2 > maxsig) { maxsig = $2 }
7974 dup_name[ndups] = $1
7985 if (nsig == 0) { nsig = maxsig + 1 }
7986 for (n = 1; n < nsig; n++) {
7988 printf("%s %d\n", sig_name[n], sig_num[n])
7991 printf("NUM%d %d\n", n, n)
7994 for (n = 0; n < ndups; n++) {
7995 printf("%s %d\n", dup_name[n], dup_num[n])
7999 $cat >signal_cmd <<EOS
8001 $test -s signal.lst && exit 0
8002 if $cc $ccflags signal.c -o signal $ldflags >/dev/null 2>&1; then
8003 ./signal | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
8005 echo "(I can't seem be able to compile the test program -- Guessing)"
8006 echo 'kill -l' >signal
8007 set X \`csh -f <signal\`
8011 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
8013 echo \$@ | $tr ' ' '\012' | \
8014 $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
8016 $rm -f signal.c signal signal.o
8018 chmod a+x signal_cmd
8019 $eunicefix signal_cmd
8021 : generate list of signal names
8031 echo "Generating a list of signal names and numbers..." >&4
8033 sig_name=`$awk '{printf "%s ", $1}' signal.lst`
8034 sig_name="ZERO $sig_name"
8035 sig_num=`$awk '{printf "%d ", $2}' signal.lst`
8036 sig_num="0 $sig_num"
8039 echo "The following signals are available:"
8041 echo $sig_name | $awk \
8042 'BEGIN { linelen = 0 }
8044 for (i = 1; i <= NF; i++) {
8046 linelen = linelen + length(name)
8049 linelen = length(name)
8055 $rm -f signal signal.c signal.awk signal.lst signal_cmd
8057 : see what type is used for size_t
8058 set size_t sizetype 'unsigned int' stdio.h sys/types.h
8062 rp="What type is used for the length parameter for string functions?"
8066 : see what type is used for signed size_t
8067 set ssize_t ssizetype int stdio.h sys/types.h
8070 $cat > ssize.c <<EOM
8072 #include <sys/types.h>
8073 #define Size_t $sizetype
8074 #define SSize_t $dflt
8077 if (sizeof(Size_t) == sizeof(SSize_t))
8079 else if (sizeof(Size_t) == sizeof(int))
8086 if $cc $ccflags $ldflags -o ssize ssize.c $libs > /dev/null 2>&1 ; then
8088 echo "I'll be using $ssizetype for functions returning a byte count." >&4
8090 echo "(I can't compile the test program--please enlighten me!)"
8093 I need a type that is the same size as $sizetype, but is guaranteed to
8094 be signed. Common values are int and long.
8097 rp="What signed type is the same size as $sizetype?"
8101 $rm -f ssize ssize.[co]
8103 : see what type of char stdio uses.
8105 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
8106 echo "Your stdio uses unsigned chars." >&4
8107 stdchar="unsigned char"
8109 echo "Your stdio uses signed chars." >&4
8113 : see if time exists
8115 if set time val -f d_time; eval $csym; $val; then
8116 echo 'time() found.' >&4
8118 set time_t timetype long stdio.h sys/types.h
8122 rp="What type is returned by time() on this system?"
8126 echo 'time() not found, hope that will do.' >&4
8133 : see what type uids are declared as in the kernel
8134 set uid_t uidtype xxx stdio.h sys/types.h
8138 xxx=`./findhdr sys/user.h`
8139 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
8141 unsigned) dflt="$1 $2" ;;
8145 *) dflt="$uidtype";;
8148 rp="What is the type for user ids returned by getuid()?"
8152 : see if dbm.h is available
8153 : see if dbmclose exists
8154 set dbmclose d_dbmclose
8157 case "$d_dbmclose" in
8167 *) set rpcsvc/dbm.h i_rpcsvcdbm
8172 *) echo "We won't be including <dbm.h>"
8182 : see if this is a sys/file.h system
8187 : do we need to include sys/file.h ?
8193 echo "We'll be including <sys/file.h>." >&4
8196 echo "We won't be including <sys/file.h>." >&4
8206 : see if fcntl.h is there
8211 : see if we can include fcntl.h
8217 echo "We'll be including <fcntl.h>." >&4
8221 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
8223 echo "We won't be including <fcntl.h>." >&4
8235 : see if this is an grp system
8239 : see if locale.h is available
8240 set locale.h i_locale
8243 : see if this is a math.h system
8247 : see if memory.h is available.
8252 : See if it conflicts with string.h
8258 $cppstdin $cppflags $cppminus < $strings > mem.h
8259 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
8261 echo "We won't be including <memory.h>."
8271 : see if ndbm.h is available
8276 : see if dbm_open exists
8277 set dbm_open d_dbm_open
8279 case "$d_dbm_open" in
8282 echo "We won't be including <ndbm.h>"
8291 : see if net/errno.h is available
8296 : Unfortunately, it causes problems on some systems. Arrgh.
8302 #include <net/errno.h>
8308 if $cc $ccflags -c try.c >/dev/null 2>&1; then
8309 echo "We'll be including <net/errno.h>." >&4
8311 echo "We won't be including <net/errno.h>." >&4
8320 : get C preprocessor symbols handy
8322 $echo $n "Hmm... $c"
8323 echo $al | $tr ' ' '\012' >Cppsym.know
8335 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
8337 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
8340 unknown="\$unknown \$sym"
8350 echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
8352 exit 0; _ _ _ _\1\\ \1\\
8355 echo "exit 1; _ _ _" >>Cppsym\$\$
8356 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
8358 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
8364 $rm -f Cppsym\$\$ Cppsym2\$\$
8369 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
8371 : now check the C compiler for additional symbols
8377 for i in \`$cc -v -c tmp.c 2>&1\`
8380 -D*) echo "\$i" | $sed 's/^-D//';;
8381 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
8388 ./ccsym | $sort | $uniq >ccsym.raw
8389 $awk '/\=/ { print $0; next }
8390 { print $0"=1" }' ccsym.raw >ccsym.list
8391 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
8392 $comm -13 ccsym.true ccsym.list >ccsym.own
8393 $comm -12 ccsym.true ccsym.list >ccsym.com
8394 $comm -23 ccsym.true ccsym.list >ccsym.cpp
8397 if $test -z ccsym.raw; then
8398 echo "Your C compiler doesn't seem to define any symbol!" >&4
8400 echo "However, your C preprocessor defines the following ones:"
8403 if $test -s ccsym.com; then
8404 echo "Your C compiler and pre-processor define these symbols:"
8405 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
8408 $test "$silent" || sleep 1
8410 if $test -s ccsym.cpp; then
8411 $test "$also" && echo " "
8412 echo "Your C pre-processor ${also}defines the following $symbols:"
8413 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
8415 $test "$silent" || sleep 1
8417 if $test -s ccsym.own; then
8418 $test "$also" && echo " "
8419 echo "Your C compiler ${also}defines the following cpp variables:"
8420 $sed -e 's/\(.*\)=1/\1/' ccsym.own
8421 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
8422 $test "$silent" || sleep 1
8427 : see if this is a termio system
8431 if $test `./findhdr termios.h`; then
8432 set tcsetattr i_termios
8438 "$define") echo "You have POSIX termios.h... good!" >&4;;
8439 *) if ./Cppsym pyr; then
8440 case "`/bin/universe`" in
8441 ucb) if $test `./findhdr sgtty.h`; then
8443 echo "<sgtty.h> found." >&4
8445 echo "System is pyramid with BSD universe."
8446 echo "<sgtty.h> not found--you could have problems." >&4
8448 *) if $test `./findhdr termio.h`; then
8450 echo "<termio.h> found." >&4
8452 echo "System is pyramid with USG universe."
8453 echo "<termio.h> not found--you could have problems." >&4
8457 if $test `./findhdr termio.h`; then
8458 echo "<termio.h> found." >&4
8460 elif $test `./findhdr sgtty.h`; then
8461 echo "<sgtty.h> found." >&4
8464 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
8467 if $test `./findhdr sgtty.h`; then
8468 echo "<sgtty.h> found." >&4
8470 elif $test `./findhdr termio.h`; then
8471 echo "<termio.h> found." >&4
8474 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
8478 set i_termio; eval $setvar
8479 val=$val2; set i_sgtty; eval $setvar
8480 val=$val3; set i_termios; eval $setvar
8482 : see if stdarg is available
8484 if $test `./findhdr stdarg.h`; then
8485 echo "<stdarg.h> found." >&4
8488 echo "<stdarg.h> NOT found." >&4
8492 : see if varags is available
8494 if $test `./findhdr varargs.h`; then
8495 echo "<varargs.h> found." >&4
8497 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
8500 : set up the varargs testing programs
8501 $cat > varargs.c <<EOP
8506 #include <varargs.h>
8524 p = va_arg(ap, char *);
8529 $cat > varargs <<EOP
8531 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
8540 : now check which varargs header should be included
8545 if `./varargs I_STDARG`; then
8547 elif `./varargs I_VARARGS`; then
8552 if `./varargs I_VARARGS`; then
8559 echo "I could not find the definition for va_dcl... You have problems..." >&4
8560 val="$undef"; set i_stdarg; eval $setvar
8561 val="$undef"; set i_varargs; eval $setvar
8568 val="$define"; set i_stdarg; eval $setvar
8569 val="$undef"; set i_varargs; eval $setvar
8572 val="$undef"; set i_stdarg; eval $setvar
8573 val="$define"; set i_varargs; eval $setvar
8576 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
8580 : see if stddef is available
8581 set stddef.h i_stddef
8584 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
8585 set sys/filio.h i_sysfilio
8588 if $test `./findhdr sys/ioctl.h`; then
8590 echo '<sys/ioctl.h> found.' >&4
8593 if $test $i_sysfilio = "$define"; then
8594 echo '<sys/ioctl.h> NOT found.' >&4
8596 $test $i_sgtty = "$define" && xxx="sgtty.h"
8597 $test $i_termio = "$define" && xxx="termio.h"
8598 $test $i_termios = "$define" && xxx="termios.h"
8599 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
8605 : see if this is a sys/param system
8606 set sys/param.h i_sysparam
8609 : see if sys/stat.h is available
8610 set sys/stat.h i_sysstat
8613 : see if sys/types.h has to be included
8614 set sys/types.h i_systypes
8617 : see if this is a sys/un.h system
8618 set sys/un.h i_sysun
8621 : see if this is a unistd.h system
8622 set unistd.h i_unistd
8625 : see if this is an utime system
8629 : see if this is a vfork system
8640 : see if gdbm.h is available
8645 : see if gdbm_open exists
8646 set gdbm_open d_gdbm_open
8648 case "$d_gdbm_open" in
8651 echo "We won't be including <gdbm.h>"
8661 echo "Looking for extensions..." >&4
8663 : If we are using the old config.sh, known_extensions may contain
8664 : old or inaccurate or duplicate values.
8666 : We do not use find because it might not be available.
8667 : We do not just use MANIFEST because the user may have dropped
8668 : some additional extensions into the source tree and expect them
8671 if $test -f $xxx/$xxx.xs; then
8672 known_extensions="$known_extensions $xxx"
8674 if $test -d $xxx; then
8677 if $test -f $yyy/$yyy.xs; then
8678 known_extensions="$known_extensions $xxx/$yyy"
8685 set X $known_extensions
8687 known_extensions="$*"
8690 : Now see which are supported on this system.
8692 for xxx in $known_extensions ; do
8694 DB_File) case "$i_db" in
8695 $define) avail_ext="$avail_ext $xxx" ;;
8698 GDBM_File) case "$i_gdbm" in
8699 $define) avail_ext="$avail_ext $xxx" ;;
8702 NDBM_File) case "$i_ndbm" in
8703 $define) avail_ext="$avail_ext $xxx" ;;
8706 ODBM_File) case "${i_dbm}${i_rpcsvcdbm}" in
8707 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
8710 POSIX) case "$useposix" in
8711 true|define|y) avail_ext="$avail_ext $xxx" ;;
8714 SAFE) case "$usesafe" in
8715 true|define|y) avail_ext="$avail_ext $xxx" ;;
8718 Socket) case "$d_socket" in
8719 $define) avail_ext="$avail_ext $xxx" ;;
8722 *) avail_ext="$avail_ext $xxx"
8734 A number of extensions are supplied with $package. You may choose to
8735 compile these extensions for dynamic loading (the default), compile
8736 them into the $package executable (static loading), or not include
8737 them at all. Answer "none" to include no extensions.
8740 case "$dynamic_ext" in
8741 '') dflt="$avail_ext" ;;
8742 *) dflt="$dynamic_ext" ;;
8747 rp="What extensions do you wish to load dynamically?"
8750 none) dynamic_ext=' ' ;;
8751 *) dynamic_ext="$ans" ;;
8754 case "$static_ext" in
8756 : Exclude those already listed in dynamic linking
8758 for xxx in $avail_ext; do
8759 case " $dynamic_ext " in
8761 *) dflt="$dflt $xxx" ;;
8768 *) dflt="$static_ext"
8775 rp="What extensions do you wish to load statically?"
8778 none) static_ext=' ' ;;
8779 *) static_ext="$ans" ;;
8784 A number of extensions are supplied with $package. Answer "none"
8785 to include no extensions.
8788 case "$static_ext" in
8789 '') dflt="$avail_ext" ;;
8790 *) dflt="$static_ext" ;;
8796 rp="What extensions do you wish to include?"
8799 none) static_ext=' ' ;;
8800 *) static_ext="$ans" ;;
8805 set X $dynamic_ext $static_ext
8809 : Remove build directory name from cppstdin so it can be used from
8810 : either the present location or the final installed location.
8812 : Get out of the UU directory to get correct path name.
8816 echo "Stripping down cppstdin path name"
8822 : end of configuration questions
8824 echo "End of configuration questions."
8827 : back to where it started
8828 if test -d ../UU; then
8832 : configuration may be patched via a 'config.over' file
8833 if $test -f config.over; then
8836 rp='I see a config.over file. Do you wish to load it?'
8839 n*) echo "OK, I'll ignore it.";;
8841 echo "Configuration override changes have been loaded."
8846 : in case they want portability, strip down executable paths
8847 case "$d_portable" in
8850 echo "Stripping down executable paths..." >&4
8851 for file in $loclist $trylist; do
8857 : create config.sh file
8859 echo "Creating config.sh..." >&4
8860 $spitshell <<EOT >config.sh
8863 # This file was produced by running the Configure script. It holds all the
8864 # definitions figured out by Configure. Should you modify one of these values,
8865 # do not forget to propagate your changes by running "Configure -der". You may
8866 # instead choose to run each of the .SH files by yourself, or "Configure -S".
8869 # Configuration time: $cf_time
8870 # Configured by: $cf_by
8871 # Target system: $myuname
8881 Revision='$Revision'
8885 alignbytes='$alignbytes'
8886 aphostname='$aphostname'
8889 archlibexp='$archlibexp'
8890 archname='$archname'
8891 archobjs='$archobjs'
8899 byteorder='$byteorder'
8901 castflags='$castflags'
8904 cccdlflags='$cccdlflags'
8905 ccdlflags='$ccdlflags'
8908 cf_email='$cf_email'
8913 clocktype='$clocktype'
8915 compress='$compress'
8916 contains='$contains'
8920 cpp_stuff='$cpp_stuff'
8921 cppflags='$cppflags'
8923 cppminus='$cppminus'
8925 cppstdin='$cppstdin'
8926 cryptlib='$cryptlib'
8928 d_Gconvert='$d_Gconvert'
8929 d_access='$d_access'
8931 d_archlib='$d_archlib'
8932 d_attribut='$d_attribut'
8936 d_bsdpgrp='$d_bsdpgrp'
8938 d_casti32='$d_casti32'
8939 d_castneg='$d_castneg'
8940 d_charvspr='$d_charvspr'
8942 d_chroot='$d_chroot'
8943 d_chsize='$d_chsize'
8944 d_closedir='$d_closedir'
8948 d_cuserid='$d_cuserid'
8949 d_dbl_dig='$d_dbl_dig'
8950 d_difftime='$d_difftime'
8951 d_dirnamlen='$d_dirnamlen'
8952 d_dlerror='$d_dlerror'
8953 d_dlopen='$d_dlopen'
8954 d_dlsymun='$d_dlsymun'
8955 d_dosuid='$d_dosuid'
8957 d_eofnblk='$d_eofnblk'
8958 d_eunice='$d_eunice'
8959 d_fchmod='$d_fchmod'
8960 d_fchown='$d_fchown'
8962 d_fd_macros='$d_fd_macros'
8963 d_fd_set='$d_fd_set'
8964 d_fds_bits='$d_fds_bits'
8965 d_fgetpos='$d_fgetpos'
8966 d_flexfnam='$d_flexfnam'
8969 d_fpathconf='$d_fpathconf'
8970 d_fsetpos='$d_fsetpos'
8971 d_getgrps='$d_getgrps'
8972 d_gethent='$d_gethent'
8973 d_gethname='$d_gethname'
8974 d_getlogin='$d_getlogin'
8975 d_getpgrp2='$d_getpgrp2'
8976 d_getpgrp='$d_getpgrp'
8977 d_getppid='$d_getppid'
8978 d_getprior='$d_getprior'
8981 d_isascii='$d_isascii'
8982 d_killpg='$d_killpg'
8984 d_locconv='$d_locconv'
8988 d_mbstowcs='$d_mbstowcs'
8989 d_mbtowc='$d_mbtowc'
8990 d_memcmp='$d_memcmp'
8991 d_memcpy='$d_memcpy'
8992 d_memmove='$d_memmove'
8993 d_memset='$d_memset'
8995 d_mkfifo='$d_mkfifo'
8996 d_mktime='$d_mktime'
8998 d_msgctl='$d_msgctl'
8999 d_msgget='$d_msgget'
9000 d_msgrcv='$d_msgrcv'
9001 d_msgsnd='$d_msgsnd'
9002 d_mymalloc='$d_mymalloc'
9004 d_oldarchlib='$d_oldarchlib'
9005 d_oldsock='$d_oldsock'
9007 d_pathconf='$d_pathconf'
9009 d_phostname='$d_phostname'
9012 d_portable='$d_portable'
9014 d_pwchange='$d_pwchange'
9015 d_pwclass='$d_pwclass'
9016 d_pwcomment='$d_pwcomment'
9017 d_pwexpire='$d_pwexpire'
9018 d_pwquota='$d_pwquota'
9019 d_readdir='$d_readdir'
9020 d_readlink='$d_readlink'
9021 d_rename='$d_rename'
9022 d_rewinddir='$d_rewinddir'
9024 d_safebcpy='$d_safebcpy'
9025 d_safemcpy='$d_safemcpy'
9026 d_seekdir='$d_seekdir'
9027 d_select='$d_select'
9029 d_semctl='$d_semctl'
9030 d_semget='$d_semget'
9032 d_setegid='$d_setegid'
9033 d_seteuid='$d_seteuid'
9034 d_setlinebuf='$d_setlinebuf'
9035 d_setlocale='$d_setlocale'
9036 d_setpgid='$d_setpgid'
9037 d_setpgrp2='$d_setpgrp2'
9038 d_setpgrp='$d_setpgrp'
9039 d_setprior='$d_setprior'
9040 d_setregid='$d_setregid'
9041 d_setresgid='$d_setresgid'
9042 d_setresuid='$d_setresuid'
9043 d_setreuid='$d_setreuid'
9044 d_setrgid='$d_setrgid'
9045 d_setruid='$d_setruid'
9046 d_setsid='$d_setsid'
9049 d_shmatprototype='$d_shmatprototype'
9050 d_shmctl='$d_shmctl'
9052 d_shmget='$d_shmget'
9053 d_shrplib='$d_shrplib'
9054 d_sigaction='$d_sigaction'
9055 d_sigintrp='$d_sigintrp'
9056 d_sigvec='$d_sigvec'
9057 d_sigvectr='$d_sigvectr'
9058 d_socket='$d_socket'
9059 d_sockpair='$d_sockpair'
9060 d_statblks='$d_statblks'
9061 d_stdio_cnt_lval='$d_stdio_cnt_lval'
9062 d_stdio_ptr_lval='$d_stdio_ptr_lval'
9063 d_stdiobase='$d_stdiobase'
9064 d_stdstdio='$d_stdstdio'
9065 d_strchr='$d_strchr'
9066 d_strcoll='$d_strcoll'
9067 d_strctcpy='$d_strctcpy'
9068 d_strerrm='$d_strerrm'
9069 d_strerror='$d_strerror'
9070 d_strxfrm='$d_strxfrm'
9071 d_suidsafe='$d_suidsafe'
9072 d_symlink='$d_symlink'
9073 d_syscall='$d_syscall'
9074 d_sysconf='$d_sysconf'
9075 d_sysernlst='$d_sysernlst'
9076 d_syserrlst='$d_syserrlst'
9077 d_system='$d_system'
9078 d_tcgetpgrp='$d_tcgetpgrp'
9079 d_tcsetpgrp='$d_tcsetpgrp'
9080 d_telldir='$d_telldir'
9083 d_truncate='$d_truncate'
9084 d_tzname='$d_tzname'
9088 d_void_closedir='$d_void_closedir'
9089 d_voidsig='$d_voidsig'
9090 d_voidtty='$d_voidtty'
9091 d_volatile='$d_volatile'
9092 d_vprintf='$d_vprintf'
9094 d_waitpid='$d_waitpid'
9095 d_wcstombs='$d_wcstombs'
9096 d_wctomb='$d_wctomb'
9099 db_hashtype='$db_hashtype'
9100 db_prefixtype='$db_prefixtype'
9101 defvoidused='$defvoidused'
9102 direntrytype='$direntrytype'
9105 dynamic_ext='$dynamic_ext'
9110 eunicefix='$eunicefix'
9113 extensions='$extensions'
9115 firstmakefile='$firstmakefile'
9117 fpostype='$fpostype'
9118 freetype='$freetype'
9119 full_csh='$full_csh'
9120 full_sed='$full_sed'
9122 gccversion='$gccversion'
9126 groupcat='$groupcat'
9127 groupstype='$groupstype'
9129 h_sysfile='$h_sysfile'
9133 i_bsdioctl='$i_bsdioctl'
9136 i_dirent='$i_dirent'
9143 i_limits='$i_limits'
9144 i_locale='$i_locale'
9145 i_malloc='$i_malloc'
9147 i_memory='$i_memory'
9149 i_neterrno='$i_neterrno'
9152 i_rpcsvcdbm='$i_rpcsvcdbm'
9154 i_stdarg='$i_stdarg'
9155 i_stddef='$i_stddef'
9156 i_stdlib='$i_stdlib'
9157 i_string='$i_string'
9158 i_sysdir='$i_sysdir'
9159 i_sysfile='$i_sysfile'
9160 i_sysfilio='$i_sysfilio'
9162 i_sysioctl='$i_sysioctl'
9163 i_sysndir='$i_sysndir'
9164 i_sysparam='$i_sysparam'
9165 i_sysselct='$i_sysselct'
9166 i_syssockio='$i_syssockio'
9167 i_sysstat='$i_sysstat'
9168 i_systime='$i_systime'
9169 i_systimek='$i_systimek'
9170 i_systimes='$i_systimes'
9171 i_systypes='$i_systypes'
9173 i_termio='$i_termio'
9174 i_termios='$i_termios'
9176 i_unistd='$i_unistd'
9178 i_varargs='$i_varargs'
9179 i_varhdr='$i_varhdr'
9183 installarchlib='$installarchlib'
9184 installbin='$installbin'
9185 installman1dir='$installman1dir'
9186 installman3dir='$installman3dir'
9187 installprivlib='$installprivlib'
9188 installscript='$installscript'
9189 installsitearch='$installsitearch'
9190 installsitelib='$installsitelib'
9192 known_extensions='$known_extensions'
9196 lddlflags='$lddlflags'
9203 libswanted='$libswanted'
9209 locincpth='$locincpth'
9210 loclibpth='$loclibpth'
9214 lseektype='$lseektype'
9218 mallocobj='$mallocobj'
9219 mallocsrc='$mallocsrc'
9220 malloctype='$malloctype'
9222 man1direxp='$man1direxp'
9225 man3direxp='$man3direxp'
9229 mips_type='$mips_type'
9232 modetype='$modetype'
9235 myarchname='$myarchname'
9236 mydomain='$mydomain'
9237 myhostname='$myhostname'
9241 nm_so_opt='$nm_so_opt'
9243 o_nonblock='$o_nonblock'
9245 oldarchlib='$oldarchlib'
9246 oldarchlibexp='$oldarchlibexp'
9247 optimize='$optimize'
9248 orderlib='$orderlib'
9254 patchlevel='$patchlevel'
9255 path_sep='$path_sep'
9257 perladmin='$perladmin'
9258 perlpath='$perlpath'
9260 phostname='$phostname'
9265 prefixexp='$prefixexp'
9267 privlibexp='$privlibexp'
9268 prototype='$prototype'
9269 randbits='$randbits'
9271 rd_nodata='$rd_nodata'
9275 scriptdir='$scriptdir'
9276 scriptdirexp='$scriptdirexp'
9278 selecttype='$selecttype'
9279 sendmail='$sendmail'
9282 sharpbang='$sharpbang'
9283 shmattype='$shmattype'
9286 sig_name='$sig_name'
9288 signal_t='$signal_t'
9289 sitearch='$sitearch'
9290 sitearchexp='$sitearchexp'
9292 sitelibexp='$sitelibexp'
9293 sizetype='$sizetype'
9298 sockethdr='$sockethdr'
9299 socketlib='$socketlib'
9301 spackage='$spackage'
9302 spitshell='$spitshell'
9304 ssizetype='$ssizetype'
9305 startperl='$startperl'
9307 static_ext='$static_ext'
9309 stdio_base='$stdio_base'
9310 stdio_bufsiz='$stdio_bufsiz'
9311 stdio_cnt='$stdio_cnt'
9312 stdio_ptr='$stdio_ptr'
9320 timeincl='$timeincl'
9321 timetype='$timetype'
9329 usemymalloc='$usemymalloc'
9331 useposix='$useposix'
9333 usevfork='$usevfork'
9337 voidflags='$voidflags'
9342 : add special variables
9343 $test -f patchlevel.h && \
9344 awk '/^#define/ {printf "%s=%s\n",$2,$3}' patchlevel.h >>config.sh
9345 echo "CONFIG=true" >>config.sh
9347 : propagate old symbols
9348 if $test -f UU/config.sh; then
9349 <UU/config.sh sort | uniq >UU/oldconfig.sh
9350 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
9351 sort | uniq -u >UU/oldsyms
9352 set X `cat UU/oldsyms`
9358 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
9360 echo "# Variables propagated from previous config.sh file." >>config.sh
9361 for sym in `cat UU/oldsyms`; do
9362 echo " Propagating $hint variable "'$'"$sym..."
9363 eval 'tmp="$'"${sym}"'"'
9365 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
9371 : Finish up by extracting the .SH files
9385 If you'd like to make any changes to the config.sh file before I begin
9386 to configure things, do it as a shell escape now (e.g. !vi config.sh).
9389 rp="Press return or use a shell escape to edit config.sh:"
9394 *) : in case they cannot read
9400 : if this fails, just run all the .SH files by hand
9407 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
9414 Now you need to generate make dependencies by running "make depend".
9415 You might prefer to run it in background: "make depend > makedepend.out &"
9416 It can take a while, so you might not want to run it right now.
9421 rp="Run make depend now?"
9425 make depend && echo "Now you must run a make."
9428 echo "You must run 'make depend' then 'make'."
9431 elif test -f [Mm]akefile; then
9433 echo "Now you must run a make."
9438 $rm -f kit*isdone ark*isdone