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 Aug 23 15:01:14 EDT 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 older exotic systems. If yours does, try the Bourne
115 : Configure runs within the UU subdirectory
116 test -d UU || mkdir UU
600 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
603 : We must find out about Eunice early
605 if test -f /etc/unixtovms; then
606 eunicefix=/etc/unixtovms
608 if test -f /etc/unixtovms.exe; then
609 eunicefix=/etc/unixtovms.exe
612 : list of known cpp symbols, sorted alphabetically
613 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
614 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
615 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
616 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
617 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
618 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
619 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
620 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
621 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
622 al="$al VMS Xenix286"
623 al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI"
624 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
625 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
626 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
627 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
628 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
629 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
630 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
631 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
632 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
633 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
634 al="$al __SVR4_2__ __UMAXV__"
635 al="$al ____386BSD____ __alpha __alpha__ __amiga"
636 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
637 al="$al __host_mips__"
638 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
639 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
640 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
641 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
642 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
643 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
644 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
645 al="$al __mc88100 __mc88100__ __mips __mips__"
646 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
647 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
648 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
649 al="$al _host_mips _mips _unix"
650 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
651 al="$al apollo ardent att386 att3b"
652 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
653 al="$al cadmus clipper concurrent convex cray ctix"
654 al="$al dmert encore gcos gcx gimpel gould"
655 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
656 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
657 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
658 al="$al i186 i286 i386 i486 i8086"
659 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
660 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
661 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
662 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
663 al="$al mc88000 mc88100 merlin mert mips mvs n16"
664 al="$al ncl_el ncl_mr"
665 al="$al news1500 news1700 news1800 news1900 news3700"
666 al="$al news700 news800 news900 ns16000 ns32000"
667 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
668 al="$al parisc pc532 pdp11 plexus posix pyr"
669 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
670 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
671 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
672 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
673 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
674 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
679 : default library list
681 : set useposix=false in your hint file to disable the POSIX extension.
683 : set useopcode=false in your hint file to disable the Opcode extension.
685 : Define several unixisms. These can be used in hint files.
687 : Extra object files, if any, needed on this platform.
689 : Possible local include directories to search.
690 : Set locincpth to "" in a hint file to defeat local include searches.
691 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
692 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
694 : no include file wanted by default
697 : change the next line if compiling for Xenix/286 on Xenix/386
698 xlibpth='/usr/lib/386 /lib/386'
700 : Possible local library directories to search.
701 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
702 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
704 : general looking path for locating libraries
705 glibpth="/lib/pa1.1 /usr/shlib /usr/lib/large /lib /usr/lib"
706 glibpth="$glibpth $xlibpth /lib/large /usr/lib/small /lib/small"
707 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/shlib"
709 : Private path used by Configure to find libraries. Its value
710 : is prepended to libpth. This variable takes care of special
711 : machines, like the mips. Usually, it should be empty.
714 : full support for void wanted by default
717 : List of libraries we want.
718 libswanted='sfio net socket inet nsl nm ndbm gdbm dbm db malloc dl'
719 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
720 libswanted="$libswanted ucb bsd BSD PW x"
721 : We probably want to search /usr/shlib before most other libraries.
722 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
723 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
724 glibpth="/usr/shlib $glibpth"
725 : Do not use vfork unless overridden by a hint file.
728 : Find the basic shell for Bourne shell scripts
731 : SYSTYPE is for some older MIPS systems.
732 : I do not know if it is still needed.
734 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
737 if test -f "$xxx"; then
740 : Build up a list and do a single loop so we can 'break' out.
741 pth=`echo $PATH | sed -e "s/$p_/ /g"`
742 for xxx in sh bash ksh pdksh ash; do
744 try="$try ${p}/${xxx}"
748 if test -f "$xxx"; then
750 echo "Your Bourne shell appears to be in $sh."
752 elif test -f "$xxx.exe"; then
754 echo "Hmm. Your Bourne shell appears to be in $sh."
764 $me: Fatal Error: I can't find a Bourne Shell anywhere.
765 Usually it's in /bin/sh. How did you even get this far?
766 Please contact me (Andy Dougherty) at doughera@lafcol.lafayette.edu and
767 we'll try to straigten this all out.
773 : see if sh knows # comments
774 if `$sh -c '#' >/dev/null 2>&1`; then
779 test -f $xcat || xcat=/usr/bin/cat
784 if test -s today; then
787 echo "#! $xcat" > try
791 if test -s today; then
794 echo "Okay, let's see if #! works on this system..."
795 echo "It's just a comment."
800 echo "Your $sh doesn't grok # comments--I will strip them later on."
803 echo "exec grep -v '^[ ]*#'" >spitshell
806 spitshell=`pwd`/spitshell
808 echo "I presume that if # doesn't work, #! won't work either!"
813 : figure out how to guarantee sh startup
815 '') startsh=${sharpbang}${sh} ;;
827 : echo "Yup, it does."
829 echo "Hmm. '$startsh' didn't work."
830 echo "You may have to fix up the shell scripts to make sure sh runs them."
834 : script used to extract .SH files with variable substitutions
838 cat >>extract <<'EOS'
840 echo "Doing variable substitutions on .SH files..."
841 if test -f MANIFEST; then
842 shlist=`awk '{print $1}' <MANIFEST | grep '\.SH'`
843 : Pick up possible extension manifests.
844 for dir in ext/* ; do
845 if test -f $dir/MANIFEST; then
846 xxx=`awk '{print $1}' < $dir/MANIFEST |
847 sed -n "/\.SH$/ s@^@$dir/@p"`
848 shlist="$shlist $xxx"
853 echo "(Looking for .SH files under the current directory.)"
854 set x `find . -name "*.SH" -print`
858 0) set x *.SH; shift;;
860 if test ! -f $1; then
866 dir=`expr X$file : 'X\(.*\)/'`
867 file=`expr X$file : 'X.*/\(.*\)'`
868 (cd $dir && . ./$file)
875 if test -f config_h.SH; then
876 if test ! -f config.h; then
877 : oops, they left it out of MANIFEST, probably, so do it anyway.
883 : produce awk script to parse command line options
884 cat >options.awk <<'EOF'
886 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
888 len = length(optstr);
889 for (i = 1; i <= len; i++) {
890 c = substr(optstr, i, 1);
891 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
902 if (substr(str, 1, 1) != "-") {
903 printf("'%s'\n", str);
907 for (i = 2; i <= len; i++) {
908 c = substr(str, i, 1);
910 printf("-%s\n", substr(str, i));
916 printf("'%s'\n", substr(str, i + 1));
929 : process the command line options
930 set X `for arg in "$@"; do echo "X$arg"; done |
931 sed -e s/X// | awk -f options.awk`
936 : set up default values
949 while test $# -gt 0; do
951 -d) shift; fastread=yes;;
952 -e) shift; alldone=cont;;
956 if test -r "$1"; then
959 echo "$me: cannot read config file $1." >&2
964 -h) shift; error=true;;
965 -r) shift; reuseval=true;;
966 -s) shift; silent=true;;
967 -E) shift; alldone=exit;;
968 -K) shift; knowitall=true;;
969 -O) shift; override=true;;
970 -S) shift; extractsh=true;;
975 echo "$me: use '-U symbol=', not '-D symbol='." >&2
976 echo "$me: ignoring -D $1" >&2
979 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
980 *) echo "$1='define'" >> optdef.sh;;
987 *=) echo "$1" >> optdef.sh;;
989 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
990 echo "$me: ignoring -U $1" >&2
992 *) echo "$1='undef'" >> optdef.sh;;
996 -V) echo "$me generated by metaconfig 3.0 PL60." >&2
999 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1007 Usage: $me [-dehrEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1008 [-U symbol] [-U symbol=]
1009 -d : use defaults for all answers.
1010 -e : go on without questioning past the production of config.sh.
1011 -f : specify an alternate default configuration file.
1012 -h : print this help message and exit (with an error status).
1013 -r : reuse C symbols value if possible (skips costly nm extraction).
1014 -s : silent mode, only echoes questions and essential information.
1015 -D : define symbol to have some value:
1016 -D symbol symbol gets the value 'define'
1017 -D symbol=value symbol gets the value 'value'
1018 -E : stop at the end of questions, after having produced config.sh.
1019 -K : do not use unless you know what you are doing.
1020 -O : let -D and -U override definitions from loaded configuration file.
1021 -S : perform variable substitutions on all .SH files (can mix with -f)
1022 -U : undefine symbol:
1023 -U symbol symbol gets the value 'undef'
1024 -U symbol= symbol gets completely empty
1025 -V : print version number and exit (with a zero status).
1033 true) exec 1>/dev/null;;
1036 : run the defines and the undefines, if any, but leave the file out there...
1040 case "$extractsh" in
1042 case "$config_sh" in
1043 '') config_sh='config.sh'; config='./config.sh';;
1044 /*) config="$config_sh";;
1045 *) config="./$config_sh";;
1048 echo "Fetching answers from $config_sh..."
1051 test "$override" && . ./optdef.sh
1062 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1063 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1064 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1065 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1066 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1069 : Eunice requires " " instead of "", can you believe it
1072 echo "Beginning of configuration questions for $package."
1074 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1076 : Some greps do not return status, grrr.
1077 echo "grimblepritz" >grimble
1078 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1080 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1086 : the following should work in any shell
1090 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1091 cat >contains <<'EOSS'
1092 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1097 : first determine how to suppress newline on echo command
1099 echo "Checking echo to see how to suppress newlines..."
1100 (echo "hi there\c" ; echo " ") >.echotmp
1101 if $contains c .echotmp >/dev/null 2>&1 ; then
1112 echo $n "The star should be here-->$c"
1116 : Now test for existence of everything in MANIFEST
1118 if test -f ../MANIFEST; then
1119 echo "First let's make sure your kit is complete. Checking..." >&4
1120 awk '$1 !~ /PACK[A-Z]+/ {print $1}' ../MANIFEST | split -50
1122 for filelist in x??; do
1123 (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing)
1125 if test -s missing; then
1129 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1131 You have the option of continuing the configuration process, despite the
1132 distinct possibility that your kit is damaged, by typing 'y'es. If you
1133 do, don't blame me if something goes wrong. I advise you to type 'n'o
1134 and contact the author (doughera@lafcol.lafayette.edu).
1137 echo $n "Continue? [n] $c" >&4
1141 echo "Continuing..." >&4
1145 echo "ABORTING..." >&4
1150 echo "Looks good..." >&4
1153 echo "There is no MANIFEST file. I hope your kit is complete !"
1157 : compute the number of columns on the terminal for proper question formatting
1162 : set up the echo used in my read
1163 myecho="case \"\$xxxm\" in
1164 '') echo $n \"\$rp $c\" >&4;;
1166 '') echo $n \"[\$xxxm] $c\";;
1168 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1170 echo $n \"[\$xxxm] $c\" >&4
1172 echo $n \"\$rp [\$xxxm] $c\" >&4
1178 : now set up to do reads with possible shell escape and default assignment
1183 case "\$fastread" in
1184 yes) case "\$dflt" in
1187 case "\$silent-\$rp" in
1192 *) case "\$silent" in
1193 true) case "\$rp" in
1198 while expr "X\$ans" : "X!" >/dev/null; do
1202 aok=''; eval "ans=\"\$answ\"" && aok=y
1207 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1212 echo "(OK, I'll run with -d after this question.)" >&4
1215 echo "*** Sorry, \$1 not supported yet." >&4
1227 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1237 echo "*** Substitution done -- please confirm."
1239 ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
1244 echo "*** Error -- try again."
1251 case "\$ans\$xxxm\$nostick" in
1263 : create .config dir to save info across Configure sessions
1264 test -d ../.config || mkdir ../.config
1265 cat >../.config/README <<EOF
1266 This directory created by Configure to save information that should
1267 persist across sessions.
1269 You may safely delete it if you wish.
1272 : general instructions
1275 user=`(logname) 2>/dev/null`
1277 user=`whoami 2>&1` ;;
1279 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1282 rp='Would you like to see the instructions?'
1293 This installation shell script will examine your system and ask you questions
1294 to determine how the perl5 package should be installed. If you get
1295 stuck on a question, you may use a ! shell escape to start a subshell or
1296 execute a command. Many of the questions will have default answers in square
1297 brackets; typing carriage return will give you the default.
1299 On some of the questions which ask for file or directory names you are allowed
1300 to use the ~name construct to specify the login directory belonging to "name",
1301 even if you don't have a shell which knows about that. Questions where this is
1302 allowed will be marked "(~name ok)".
1306 dflt='Type carriage return to continue'
1310 The prompter used in this script allows you to use shell variables and
1311 backticks in your answers. You may use $1, $2, etc... to refer to the words
1312 in the default answer, as if the default line was a set of arguments given to a
1313 script shell. This means you may also use $* to repeat the whole default line,
1314 so you do not have to re-type everything to add something to the default.
1316 Everytime there is a substitution, you will have to confirm. If there is an
1317 error (e.g. an unmatched backtick), the default answer will remain unchanged
1318 and you will be prompted again.
1320 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1321 the questions and use the computed defaults (or the previous answers if there
1322 was already a config.sh file). Type 'Configure -h' for a list of options.
1323 You may also start interactively and then answer '& -d' at any prompt to turn
1324 on the non-interactive behaviour for the remaining of the execution.
1330 Much effort has been expended to ensure that this shell script will run on any
1331 Unix system. If despite that it blows up on yours, your best bet is to edit
1332 Configure and run it again. If you can't run Configure for some reason,
1333 you'll have to generate a config.sh file by hand. Whatever problems you
1334 have, let me (doughera@lafcol.lafayette.edu) know how I blew it.
1336 This installation script affects things in two ways:
1338 1) it may do direct variable substitutions on some of the files included
1340 2) it builds a config.h file for inclusion in C programs. You may edit
1341 any of these files as the need arises after running this script.
1343 If you make a mistake on a question, there is no easy way to back up to it
1344 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1345 files. Configure will offer to let you do this before it runs the SH files.
1348 dflt='Type carriage return to continue'
1350 case "$firsttime" in
1351 true) echo $user >>../.config/instruct;;
1355 : find out where common programs are
1357 echo "Locating common programs..." >&4
1370 if test -d \$dir/\$thing; then
1376 for thisthing in \$dir/\$thing; do
1377 : just loop through to pick last item
1379 if test -f \$thisthing; then
1382 elif test -f \$dir/\$thing.exe; then
1383 : on Eunice apparently
1433 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1434 pth="$pth /lib /usr/lib"
1435 for file in $loclist; do
1436 xxx=`./loc $file $file $pth`
1441 echo $file is in $xxx.
1444 echo $file is in $xxx.
1447 echo "I don't know where '$file' is, and my life depends on it." >&4
1448 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1454 echo "Don't worry if any of the following aren't found..."
1456 for file in $trylist; do
1457 xxx=`./loc $file $file $pth`
1462 echo $file is in $xxx.
1465 echo $file is in $xxx.
1468 echo "I don't see $file out there, $say."
1475 echo "Substituting grep for egrep."
1481 echo "Substituting cp for ln."
1487 echo "Hopefully test is built into your sh."
1490 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1491 echo "Using the test built into your sh."
1499 echo "Hopefully echo is built into your sh."
1504 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1505 $echo $n "hi there$c" >foo1
1506 echo $n "hi there$c" >foo2
1507 if cmp foo1 foo2 >/dev/null 2>&1; then
1508 echo "They are compatible. In fact, they may be identical."
1515 They are not compatible! You are probably running ksh on a non-USG system.
1516 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1517 have echo built in and we may have to run some Bourne shell scripts. That
1518 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1521 $echo $n "The star should be here-->$c"
1528 : determine whether symbolic links are supported
1531 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1532 echo "Symbolic links are supported." >&4
1535 echo "Symbolic links are NOT supported." >&4
1540 : see whether [:lower:] and [:upper:] are supported character classes
1544 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1546 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1551 echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4
1554 : set up the translation script tr, must be called with ./tr of course
1558 '[A-Z][a-z]') exec $tr '$up' '$low';;
1559 '[a-z][A-Z]') exec $tr '$low' '$up';;
1566 : Try to determine whether config.sh was made on this system
1567 case "$config_sh" in
1569 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1570 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1571 ./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
1572 newmyuname="$myuname"
1574 case "$knowitall" in
1576 if test -f ../config.sh; then
1577 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1578 eval "`grep myuname= ../config.sh`"
1580 if test "X$myuname" = "X$newmyuname"; then
1588 : Get old answers from old config file if Configure was run on the
1589 : same system, otherwise use the hints.
1592 if test -f config.sh; then
1594 rp="I see a config.sh file. Shall I use it to set the defaults?"
1597 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1598 *) echo "Fetching default answers from your old config.sh file..." >&4
1609 if test ! -f config.sh; then
1612 First time through, eh? I have some defaults handy for the following systems:
1615 cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4
1617 : Half the following guesses are probably wrong... If you have better
1618 : tests or hints, please send them to doughera@lafcol.lafayette.edu
1619 : The metaconfig authors would also appreciate a copy...
1620 $test -f /irix && osname=irix
1621 $test -f /xenix && osname=sco_xenix
1622 $test -f /dynix && osname=dynix
1623 $test -f /dnix && osname=dnix
1624 $test -f /unicos && osname=unicos && osvers=`$uname -r`
1625 $test -f /bin/mips && /bin/mips && osname=mips
1626 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1627 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1628 $test -d /usr/apollo/bin && osname=apollo
1629 $test -f /etc/saf/_sactab && osname=svr4
1630 $test -d /usr/include/minix && osname=minix
1631 if $test -d /MachTen; then
1633 if $test -x /sbin/version; then
1634 osvers=`/sbin/version | $awk '{print $2}' |
1635 $sed -e 's/[A-Za-z]$//'`
1636 elif $test -x /usr/etc/version; then
1637 osvers=`/usr/etc/version | $awk '{print $2}' |
1638 $sed -e 's/[A-Za-z]$//'`
1643 if $test -f $uname; then
1651 umips) osname=umips ;;
1654 [23]100) osname=mips ;;
1655 next*) osname=next ;;
1656 news*) osname=news ;;
1658 if $test -f /etc/kconfig; then
1660 if test "$lns" = "ln -s"; then
1662 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1664 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
1673 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
1675 'not found') osvers="$4"."$3" ;;
1676 '<3240'|'<>3240') osvers=3.2.0 ;;
1677 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
1678 '=3250'|'>3250') osvers=3.2.5 ;;
1685 domainos) osname=apollo
1691 dynixptx*) osname=dynixptx
1694 freebsd) osname=freebsd
1696 genix) osname=genix ;;
1701 *.10.*) osvers=10 ;;
1718 netbsd*) osname=netbsd
1721 bsd386) osname=bsd386
1724 next*) osname=next ;;
1725 solaris) osname=solaris
1727 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1734 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1738 titanos) osname=titanos
1747 ultrix) osname=ultrix
1753 osvers=`echo "$3" | sed 's/^[vt]//'`
1755 hp*) osname=hp_osf1 ;;
1756 mips) osname=mips_osf1 ;;
1762 $2) case "$osname" in
1766 : svr4.x or possibly later
1776 if test -f /stand/boot ; then
1777 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
1778 if test -n "$INITPROG" -a -f "$INITPROG"; then
1779 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
1780 if test -n "$isesix"; then
1788 *) if test -f /etc/systemid; then
1790 set `echo $3 | $sed 's/\./ /g'` $4
1791 if $test -f sco_$1_$2_$3.sh; then
1793 elif $test -f sco_$1_$2.sh; then
1795 elif $test -f sco_$1.sh; then
1800 '') : Still unknown. Probably a generic Sys V.
1809 *) case "$osname" in
1810 '') : Still unknown. Probably a generic BSD.
1818 if test -f /vmunix -a -f news_os.sh; then
1819 (what /vmunix | ../UU/tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1
1820 if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then
1823 $rm -f ../UU/kernel.what
1824 elif test -d c:/.; then
1831 : Now look for a hint file osname_osvers, unless one has been
1832 : specified already.
1835 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
1836 : Also try without trailing minor version numbers.
1837 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
1838 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
1839 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
1840 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
1843 *) case "$osvers" in
1846 *) if $test -f $file.sh ; then
1848 elif $test -f $xfile.sh ; then
1850 elif $test -f $xxfile.sh ; then
1852 elif $test -f $xxxfile.sh ; then
1854 elif $test -f $xxxxfile.sh ; then
1856 elif $test -f "${osname}.sh" ; then
1867 dflt=`echo $hintfile | $sed 's/\.sh$//'`
1873 You may give one or more space-separated answers, or "none" if appropriate.
1874 If your OS version has no hints, DO NOT give a wrong version -- say "none".
1877 rp="Which of these apply, if any?"
1880 for file in $tans; do
1881 if $test -f $file.sh; then
1883 $cat $file.sh >> ../UU/config.sh
1884 elif $test X$tans = X -o X$tans = Xnone ; then
1887 : Give one chance to correct a possible typo.
1888 echo "$file.sh does not exist"
1890 rp="hint to use instead?"
1892 for file in $ans; do
1893 if $test -f "$file.sh"; then
1895 $cat $file.sh >> ../UU/config.sh
1896 elif $test X$ans = X -o X$ans = Xnone ; then
1899 echo "$file.sh does not exist -- ignored."
1906 : Remember our hint file for later.
1907 if $test -f "$file.sh" ; then
1919 echo "Fetching default answers from $config_sh..." >&4
1923 cp $config_sh config.sh 2>/dev/null
1933 test "$override" && . ./optdef.sh
1934 myuname="$newmyuname"
1936 : Restore computed paths
1937 for file in $loclist $trylist; do
1938 eval $file="\$_$file"
1943 Configure uses the operating system name and version to set some defaults.
1944 The default value is probably right if the name rings a bell. Otherwise,
1945 since spelling matters for me, either accept the default or answer "none"
1952 ''|' '|none) dflt=none ;;
1953 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
1956 *) dflt="$osname" ;;
1958 rp="Operating system name?"
1962 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
1968 ''|' '|none) dflt=none ;;
1969 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
1970 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
1972 ''|' ') dflt=none ;;
1977 *) dflt="$osvers" ;;
1979 rp="Operating system version?"
1988 : who configured the system
1989 cf_time=`$date 2>&1`
1990 cf_by=`(logname) 2>/dev/null`
1991 case "$cf_by" in "")
1992 cf_by=`(whoami) 2>/dev/null`
1993 case "$cf_by" in "")
1998 : determine the architecture name
2000 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
2001 tarch=`arch`"-$osname"
2002 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
2003 if uname -m > tmparch 2>&1 ; then
2004 tarch=`$sed -e 's/ /_/g' -e 's/$/'"-$osname/" tmparch`
2012 case "$myarchname" in
2015 echo "(Your architecture name used to be $myarchname.)"
2021 *) dflt="$archname";;
2023 rp='What is your architecture name'
2030 if test -d /afs; then
2031 echo "AFS may be running... I'll be extra cautious then..." >&4
2034 echo "AFS does not seem to be running..." >&4
2038 : decide how portable to be. Allow command line overrides.
2039 case "$d_portable" in
2041 *) d_portable="$define" ;;
2044 : set up shell script to do ~ expansion
2050 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2053 if $test -f /bin/csh; then
2054 /bin/csh -f -c "glob \$1"
2059 name=\`$expr x\$1 : '..\([^/]*\)'\`
2060 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2061 if $test ! -d "\$dir"; then
2063 echo "\$me: can't locate home directory for: \$name" >&2
2068 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2084 : now set up to get a file name
2085 cat <<'EOSC' >getfile
2098 expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
2099 fn=`echo $fn | sed 's/(.*)//'`
2105 loc_file=`expr $fn : '.*:\(.*\)'`
2106 fn=`expr $fn : '\(.*\):.*'`
2114 */*) fullpath=true;;
2123 *e*) exp_file=true;;
2126 *p*) nopath_ok=true;;
2131 *d*) type='Directory';;
2132 *l*) type='Locate';;
2137 Locate) what='File';;
2142 case "$d_portable" in
2150 while test "$type"; do
2155 true) rp="$rp (~name ok)";;
2158 if test -f UU/getfile.ok && \
2159 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2178 value=`UU/filexp $ans`
2181 if test "$ans" != "$value"; then
2182 echo "(That expands to $value on this system.)"
2196 /*) value="$ansexp" ;;
2201 echo "I shall only accept a full path name, as in /bin/ls." >&4
2202 echo "Use a ! shell escape if you wish to check pathnames." >&4
2205 echo "Please give a full path name, starting with slash." >&4
2208 echo "Note that using ~name is ok provided it expands well." >&4
2221 if test -f "$ansexp"; then
2223 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2225 echo "($value is not a plain file, but that's ok.)"
2230 if test -d "$ansexp"; then
2235 if test -d "$ansexp"; then
2236 echo "(Looking for $loc_file in directory $value.)"
2237 value="$value/$loc_file"
2238 ansexp="$ansexp/$loc_file"
2240 if test -f "$ansexp"; then
2243 case "$nopath_ok" in
2244 true) case "$value" in
2246 *) echo "Assuming $value will be in people's path."
2262 if test "$fastread" = yes; then
2267 rp="$what $value doesn't exist. Use that name anyway?"
2288 : determine root of directory hierarchy where package will be installed.
2291 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
2299 By default, $package will be installed in $dflt/bin, manual
2300 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2301 all installation directories. Typically set to /usr/local, but you
2302 may choose /usr if you wish to install $package among your system
2303 binaries. If you wish to have binaries under /bin but manual pages
2304 under /usr/local/man, that's ok: you will be prompted separately
2305 for each of the installation directories, the prefix being only used
2306 to set the defaults.
2310 rp='Installation prefix to use?'
2318 *) oldprefix="$prefix";;
2325 : set the prefixit variable, to compute a suitable default value
2326 prefixit='case "$3" in
2328 case "$oldprefix" in
2329 "") eval "$1=\"\$$2\"";;
2336 ""|" ") eval "$1=\"\$$2\"";;
2342 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
2344 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
2345 /*-$oldprefix/*|\~*-$oldprefix/*)
2346 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
2347 *) eval "$1=\"\$$2\"";;
2351 : determine where private library files go
2352 : Usual default is /usr/local/lib/perl5. Also allow things like
2353 : /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
2355 *perl*) set dflt privlib lib ;;
2356 *) set dflt privlib lib/$package ;;
2361 There are some auxiliary files for $package that need to be put into a
2362 private library directory that is accessible by everyone.
2366 rp='Pathname where the private library files will reside?'
2368 if $test "X$privlibexp" != "X$ansexp"; then
2372 privlibexp="$ansexp"
2376 Since you are running AFS, I need to distinguish the directory in which
2377 private files reside from the directory in which they are installed (and from
2378 which they are presumably copied to the former directory by occult means).
2381 case "$installprivlib" in
2382 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
2383 *) dflt="$installprivlib";;
2386 rp='Where will private files be installed?'
2388 installprivlib="$ans"
2390 installprivlib="$privlibexp"
2393 : set the base revision
2396 : get the patchlevel
2398 echo "Getting the current patchlevel..." >&4
2399 if $test -r ../patchlevel.h;then
2400 patchlevel=`awk '/PATCHLEVEL/ {print $3}' ../patchlevel.h`
2401 subversion=`awk '/SUBVERSION/ {print $3}' ../patchlevel.h`
2406 echo "(You have $package $baserev patchlevel $patchlevel subversion $subversion.)"
2408 : set the prefixup variable, to restore leading tilda escape
2409 prefixup='case "$prefixexp" in
2411 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
2414 : determine where public architecture dependent libraries go
2420 '') dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
2424 *) version=`LC_ALL=C;export LC_ALL;\
2425 echo $baserev $patchlevel $subversion | \
2426 $awk '{print $1 + $2/1000.0 + $3/100000.0}'`
2427 dflt="$privlib/$archname/$version"
2431 *) dflt="$archlib";;
2435 $spackage contains architecture-dependent library files. If you are
2436 sharing libraries in a heterogeneous environment, you might store
2437 these files in a separate location. Otherwise, you can just include
2438 them with the rest of the public library files.
2442 rp='Where do you want to put the public architecture-dependent libraries?'
2445 archlibexp="$ansexp"
2450 Since you are running AFS, I need to distinguish the directory in which
2451 private files reside from the directory in which they are installed (and from
2452 which they are presumably copied to the former directory by occult means).
2455 case "$installarchlib" in
2456 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
2457 *) dflt="$installarchlib";;
2460 rp='Where will architecture-dependent library files be installed?'
2462 installarchlib="$ans"
2464 installarchlib="$archlibexp"
2466 if $test X"$archlib" = X"$privlib"; then
2472 : set up the script used to warn in case of inconsistency
2476 echo "*** WHOA THERE!!! ***" >&4
2477 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2478 rp=" Keep the $hint value?"
2481 y) td=$was; tu=$was;;
2485 : function used to set $1 to $val
2486 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2488 $define$undef) . ./whoa; eval "$var=\$td";;
2489 $undef$define) . ./whoa; eval "$var=\$tu";;
2490 *) eval "$var=$val";;
2493 : make some quick guesses about what we are up against
2495 $echo $n "Hmm... $c"
2505 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2506 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2508 echo "Looks kind of like an OSF/1 system, but we'll see..."
2510 elif test `echo abc | tr a-z A-Z` = Abc ; then
2511 xxx=`./loc addbib blurfl $pth`
2512 if $test -f $xxx; then
2513 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2517 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2518 echo "Looks kind of like an extended USG system, but we'll see..."
2520 echo "Looks kind of like a USG system, but we'll see..."
2524 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2525 echo "Looks kind of like a BSD system, but we'll see..."
2529 echo "Looks kind of like a Version 7 system, but we'll see..."
2532 case "$eunicefix" in
2535 There is, however, a strange, musty smell in the air that reminds me of
2536 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2540 : it so happens the Eunice I know will not run shell scripts in Unix format
2544 echo "Congratulations. You aren't running Eunice."
2548 : Detect OS2. The p_ variable is set above in the Head.U unit.
2553 I have the feeling something is not exactly right, however...don't tell me...
2554 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2559 if test -f /xenix; then
2560 echo "Actually, this looks more like a XENIX system..."
2565 echo "It's not Xenix..."
2570 if test -f /venix; then
2571 echo "Actually, this looks more like a VENIX system..."
2578 echo "Nor is it Venix..."
2581 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2582 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2585 : see if setuid scripts can be secure
2588 Some kernels have a bug that prevents setuid #! scripts from being
2589 secure. Some sites have disabled setuid #! scripts because of this.
2591 First let's decide if your kernel supports secure setuid #! scripts.
2592 (If setuid #! scripts would be secure but have been disabled anyway,
2593 don't say that they are secure if asked.)
2598 if $test -d /dev/fd; then
2599 echo "#!$ls" >reflect
2600 chmod +x,u+s reflect
2601 ./reflect >flect 2>&1
2602 if $contains "/dev/fd" flect >/dev/null; then
2603 echo "Congratulations, your kernel has secure setuid scripts!" >&4
2607 If you are not sure if they are secure, I can check but I'll need a
2608 username and password different from the one you are using right now.
2609 If you don't have such a username or don't want me to test, simply
2613 rp='Other username to test security of setuid scripts with?'
2618 case "$d_suidsafe" in
2619 '') echo "I'll assume setuid scripts are *not* secure." >&4
2622 echo "Well, the $hint value is *not* secure." >&4
2624 *) echo "Well, the $hint value *is* secure." >&4
2629 $rm -f reflect flect
2630 echo "#!$ls" >reflect
2631 chmod +x,u+s reflect
2634 echo '"su" will (probably) prompt you for '"$ans's password."
2635 su $ans -c './reflect >flect'
2636 if $contains "/dev/fd" flect >/dev/null; then
2637 echo "Okay, it looks like setuid scripts are secure." >&4
2640 echo "I don't think setuid scripts are secure." >&4
2645 rp='Does your kernel have *secure* setuid scripts?'
2648 [yY]*) val="$define";;
2653 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
2654 echo "(That's for file descriptors, not floppy disks.)"
2660 $rm -f reflect flect
2662 : now see if they want to do setuid emulation
2665 case "$d_suidsafe" in
2668 echo "No need to emulate SUID scripts since they are secure here." >& 4
2672 Some systems have disabled setuid scripts, especially systems where
2673 setuid scripts cannot be secure. On systems where setuid scripts have
2674 been disabled, the setuid/setgid bits on scripts are currently
2675 useless. It is possible for $package to detect those bits and emulate
2676 setuid/setgid in a secure fashion. This emulation will only work if
2677 setuid scripts have been disabled in your kernel.
2681 "$define") dflt=y ;;
2684 rp="Do you want to do setuid/setgid emulation?"
2687 [yY]*) val="$define";;
2695 : determine where site specific libraries go.
2699 '') dflt="$privlib/site_perl" ;;
2700 *) dflt="$sitelib" ;;
2704 The installation process will also create a directory for
2705 site-specific extensions and modules. Some users find it convenient
2706 to place all local files in this directory rather than in the main
2707 distribution directory.
2711 rp='Pathname for the site-specific library files?'
2713 if $test "X$sitelibexp" != "X$ansexp"; then
2717 sitelibexp="$ansexp"
2721 Since you are running AFS, I need to distinguish the directory in which
2722 private files reside from the directory in which they are installed (and from
2723 which they are presumably copied to the former directory by occult means).
2726 case "$installsitelib" in
2727 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
2728 *) dflt="$installsitelib";;
2731 rp='Where will private files be installed?'
2733 installsitelib="$ans"
2735 installsitelib="$sitelibexp"
2738 : determine where site specific architecture-dependent libraries go.
2739 xxx=`echo $sitelib/$archname | sed 's!^$prefix!!'`
2740 : xxx is usuually lib/site_perl/archname.
2741 set sitearch sitearch none
2744 '') dflt="$sitelib/$archname" ;;
2745 *) dflt="$sitearch" ;;
2749 The installation process will also create a directory for
2750 architecture-dependent site-specific extensions and modules.
2754 rp='Pathname for the site-specific architecture-dependent library files?'
2756 if $test "X$sitearchexp" != "X$ansexp"; then
2760 sitearchexp="$ansexp"
2764 Since you are running AFS, I need to distinguish the directory in which
2765 private files reside from the directory in which they are installed (and from
2766 which they are presumably copied to the former directory by occult means).
2769 case "$installsitearch" in
2770 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
2771 *) dflt="$installsitearch";;
2774 rp='Where will private files be installed?'
2776 installsitearch="$ans"
2778 installsitearch="$sitearchexp"
2781 : determine where old public architecture dependent libraries might be
2782 case "$oldarchlib" in
2783 '') case "$privlib" in
2785 *) dflt="$privlib/$archname"
2789 *) dflt="$oldarchlib"
2792 if $test ! -d "$dflt/auto"; then
2797 In 5.001, Perl stored architecture-dependent library files in a directory
2798 with a name such as $privlib/$archname,
2799 and this directory contained files from the standard extensions and
2800 files from any additional extensions you might have added. Starting
2801 with version 5.002, all the architecture-dependent standard extensions
2802 will go into a version-specific directory such as
2804 while locally-added extensions will go into
2807 If you wish Perl to continue to search the old architecture-dependent
2808 library for your local extensions, give the path to that directory.
2809 If you do not wish to use your old architecture-dependent library
2810 files, answer 'none'.
2814 rp='Directory for your old 5.001 architecture-dependent libraries?'
2817 oldarchlibexp="$ansexp"
2818 case "$oldarchlib" in
2819 ''|' ') val="$undef" ;;
2825 : determine where public executables go
2830 rp='Pathname where the public executables will reside?'
2832 if $test "X$ansexp" != "X$binexp"; then
2840 Since you are running AFS, I need to distinguish the directory in which
2841 executables reside from the directory in which they are installed (and from
2842 which they are presumably copied to the former directory by occult means).
2845 case "$installbin" in
2846 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
2847 *) dflt="$installbin";;
2850 rp='Where will public executables be installed?'
2854 installbin="$binexp"
2857 : determine where manual pages are on this system
2861 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2862 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2863 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2864 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2865 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2866 sysman=`./loc . /usr/man/man1 $syspath`
2869 if $test -d "$sysman"; then
2870 echo "System manual is in $sysman." >&4
2872 echo "Could not find manual pages in source form." >&4
2875 : determine where manual pages go
2876 set man1dir man1dir none
2880 $spackage has manual pages available in source form.
2884 echo "However, you don't have nroff, so they're probably useless to you."
2886 '') man1dir="none";;
2889 echo "If you don't want the manual sources installed, answer 'none'."
2894 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
2895 lookpath="$lookpath $prefixexp/man/p_man/man1"
2896 lookpath="$lookpath $prefixexp/man/u_man/man1"
2897 lookpath="$lookpath $prefixexp/man/man.1"
2898 : If prefix contains 'perl' then we want to keep the man pages
2899 : under the prefix directory. Otherwise, look in a variety of
2900 : other possible places. This is debatable, but probably a
2901 : good compromise. Well, apparently not.
2902 : Experience has shown people expect man1dir to be under prefix,
2903 : so we now always put it there. Users who want other behavior
2904 : can answer interactively or use a command line option.
2905 : Does user have System V-style man paths.
2907 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
2908 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
2918 rp="Where do the main $spackage manual pages (source) go?"
2920 if $test "X$man1direxp" != "X$ansexp"; then
2924 man1direxp="$ansexp"
2932 Since you are running AFS, I need to distinguish the directory in which
2933 manual pages reside from the directory in which they are installed (and from
2934 which they are presumably copied to the former directory by occult means).
2937 case "$installman1dir" in
2938 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
2939 *) dflt="$installman1dir";;
2942 rp='Where will man pages be installed?'
2944 installman1dir="$ans"
2946 installman1dir="$man1direxp"
2949 : What suffix to use on installed man pages
2956 rp="What suffix should be used for the main $spackage man pages?"
2958 '') case "$man1dir" in
2972 *) dflt="$man1ext";;
2979 : see if we can have long filenames
2981 rmlist="$rmlist /tmp/cf$$"
2982 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
2983 first=123456789abcdef
2984 second=/tmp/cf$$/$first
2985 $rm -f $first $second
2986 if (echo hi >$first) 2>/dev/null; then
2987 if $test -f 123456789abcde; then
2988 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
2991 if (echo hi >$second) 2>/dev/null; then
2992 if $test -f /tmp/cf$$/123456789abcde; then
2994 That's peculiar... You can have filenames longer than 14 characters, but only
2995 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
2996 I shall consider your system cannot support long filenames at all.
3000 echo 'You can have filenames longer than 14 characters.' >&4
3005 How confusing! Some of your filesystems are sane enough to allow filenames
3006 longer than 14 characters but some others like /tmp can't even think about them.
3007 So, for now on, I shall assume your kernel does not allow them at all.
3014 You can't have filenames longer than 14 chars. You can't even think about them!
3020 $rm -rf /tmp/cf$$ 123456789abcde*
3022 : determine where library module manual pages go
3023 set man3dir man3dir none
3027 $spackage has manual pages for many of the library modules.
3033 However, you don't have nroff, so they're probably useless to you.
3034 You can use the supplied perldoc script instead.
3037 '') man3dir="none";;
3041 case "$d_flexfnam" in
3044 However, your system can't handle the long file names like File::Basename.3.
3045 You can use the supplied perldoc script instead.
3048 '') man3dir="none";;
3052 echo "If you don't want the manual sources installed, answer 'none'."
3053 : We dont use /usr/local/man/man3 because some man programs will
3054 : only show the /usr/local/man/man3 contents, and not the system ones,
3055 : thus man less will show the perl module less.pm, but not the system
3056 : less command. We might also conflict with TCL man pages.
3057 : However, something like /opt/perl/man/man3 is fine.
3059 '') case "$prefix" in
3060 *perl*) dflt=`echo $man1dir |
3061 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
3062 *) dflt="$privlib/man/man3" ;;
3066 *) dflt="$man3dir" ;;
3071 rp="Where do the $spackage library man pages (source) go?"
3073 if test "X$man3direxp" != "X$ansexp"; then
3078 man3direxp="$ansexp"
3086 Since you are running AFS, I need to distinguish the directory in which
3087 manual pages reside from the directory in which they are installed (and from
3088 which they are presumably copied to the former directory by occult means).
3091 case "$installman3dir" in
3092 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
3093 *) dflt="$installman3dir";;
3096 rp='Where will man pages be installed?'
3098 installman3dir="$ans"
3100 installman3dir="$man3direxp"
3103 : What suffix to use on installed man pages
3110 rp="What suffix should be used for the $spackage library man pages?"
3112 '') case "$man3dir" in
3126 *) dflt="$man3ext";;
3133 : see what memory models we can support
3136 $cat >pdp11.c <<'EOP'
3145 cc -o pdp11 pdp11.c >/dev/null 2>&1
3146 if ./pdp11 2>/dev/null; then
3147 dflt='unsplit split'
3149 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3152 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3157 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3160 if $test -d /lib/large || $test -d /usr/lib/large; then
3163 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3172 Some systems have different model sizes. On most systems they are called
3173 small, medium, large, and huge. On the PDP11 they are called unsplit and
3174 split. If your system doesn't support different memory models, say "none".
3175 If you wish to force everything to one memory model, say "none" here and
3176 put the appropriate flags later when it asks you for other cc and ld flags.
3177 Venix systems may wish to put "none" and let the compiler figure things out.
3178 (In the following question multiple model names should be space separated.)
3181 rp="Which memory models are supported?"
3196 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3197 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3204 rp="What flag indicates separate I and D space?"
3212 *large*|*small*|*medium*|*huge*)
3219 rp="What flag indicates large model?"
3229 *huge*) case "$huge" in
3233 rp="What flag indicates huge model?"
3243 *medium*) case "$medium" in
3247 rp="What flag indicates medium model?"
3254 *) medium="$large";;
3257 *small*) case "$small" in
3261 rp="What flag indicates small model?"
3272 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3276 : see if we need a special compiler
3284 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3285 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3298 On some systems the default C compiler will not resolve multiple global
3299 references that happen to have the same name. On some such systems the "Mcc"
3300 command may be used to force these to be resolved. On other systems a "cc -M"
3301 command is required. (Note that the -M flag on other systems indicates a
3302 memory model to use!) If you have the Gnu C compiler, you might wish to use
3306 rp="What command will force resolution on this system?"
3314 rp="Use which C compiler?"
3319 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3320 $cat >gccvers.c <<EOM
3325 printf("%s\n", __VERSION__);
3327 printf("%s\n", "1");
3333 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3334 gccversion=`./gccvers`
3335 case "$gccversion" in
3336 '') echo "You are not using GNU cc." ;;
3337 *) echo "You are using GNU cc $gccversion." ;;
3341 echo "*** WHOA THERE!!! ***" >&4
3342 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3343 case "$knowitall" in
3345 echo " You'd better start hunting for one and let me know about it." >&4
3351 case "$gccversion" in
3352 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3355 : What should the include directory be ?
3357 $echo $n "Hmm... $c"
3361 if $test -f /bin/mips && /bin/mips; then
3362 echo "Looks like a MIPS system..."
3363 $cat >usr.c <<'EOCP'
3364 #ifdef SYSTYPE_BSD43
3368 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3369 dflt='/bsd43/usr/include'
3373 mips_type='System V'
3375 $rm -f usr.c usr.out
3376 echo "and you're compiling with the $mips_type compiler and libraries."
3380 echo "Doesn't look like a MIPS system."
3391 case "$xxx_prompt" in
3393 rp='Where are the include files you want to use?'
3401 : see if we have to deal with yellow pages, now NIS.
3402 if $test -d /usr/etc/yp || $test -d /etc/yp; then
3403 if $test -f /usr/etc/nibindd; then
3405 echo "I'm fairly confident you're on a NeXT."
3407 rp='Do you get the hosts file via NetInfo?'
3416 y*) hostcat='nidump hosts .';;
3417 *) case "$hostcat" in
3418 nidump*) hostcat='';;
3428 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
3436 rp='Are you getting the hosts file via yellow pages?'
3439 y*) hostcat='ypcat hosts';;
3440 *) hostcat='cat /etc/hosts';;
3446 : now get the host name
3448 echo "Figuring out host name..." >&4
3449 case "$myhostname" in
3451 echo 'Maybe "hostname" will work...'
3452 if tans=`sh -c hostname 2>&1` ; then
3460 if $test "$cont"; then
3462 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
3463 if tans=`cat /etc/systemid 2>&1` ; then
3465 phostname='cat /etc/systemid'
3466 echo "Whadyaknow. Xenix always was a bit strange..."
3469 elif $test -r /etc/systemid; then
3470 echo "(What is a non-Xenix system doing with /etc/systemid?)"
3473 if $test "$cont"; then
3474 echo 'No, maybe "uuname -l" will work...'
3475 if tans=`sh -c 'uuname -l' 2>&1` ; then
3477 phostname='uuname -l'
3479 echo 'Strange. Maybe "uname -n" will work...'
3480 if tans=`sh -c 'uname -n' 2>&1` ; then
3482 phostname='uname -n'
3484 echo 'Oh well, maybe I can mine it out of whoami.h...'
3485 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
3486 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
3487 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
3489 case "$myhostname" in
3490 '') echo "Does this machine have an identity crisis or something?"
3493 echo "Well, you said $myhostname before..."
3494 phostname='echo $myhostname';;
3500 : you do not want to know about this
3505 if $test "$myhostname" ; then
3507 rp='Your host name appears to be "'$myhostname'".'" Right?"
3515 : bad guess or no guess
3516 while $test "X$myhostname" = X ; do
3518 rp="Please type the (one word) name of your host:"
3523 : translate upper to lower if necessary
3524 case "$myhostname" in
3526 echo "(Normalizing case in your host name)"
3527 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
3531 case "$myhostname" in
3533 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
3534 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
3535 echo "(Trimming domain name from host name--host name is now $myhostname)"
3537 *) case "$mydomain" in
3540 : If we use NIS, try ypmatch.
3541 : Is there some reason why this was not done before?
3542 test "X$hostcat" = "Xypcat hosts" &&
3543 ypmatch "$myhostname" hosts 2>/dev/null |\
3544 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
3547 : Extract only the relevant hosts, reducing file size,
3548 : remove comments, insert trailing space for later use.
3549 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
3550 /[ ]$myhostname[ . ]/p" > hosts
3553 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
3554 END { print sum }" hosts` = x1 || tmp_re="[ ]"
3555 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
3556 hosts | $sort | $uniq | \
3557 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
3558 case `$echo X$dflt` in
3559 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
3562 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
3567 tans=`./loc resolv.conf X /etc /usr/etc`
3568 if $test -f "$tans"; then
3569 echo "(Attempting domain name extraction from $tans)"
3570 : Why was there an Egrep here, when Sed works?
3571 dflt=.`$sed -n -e 's/^domain[ ]*\(.*\)/\1/p' $tans \
3572 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
3577 .) echo "(No help from resolv.conf either -- attempting clever guess)"
3578 dflt=.`sh -c domainname 2>/dev/null`
3581 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
3586 .) echo "(Lost all hope -- silly guess then)"
3592 *) dflt="$mydomain";;
3596 rp="What is your domain name?"
3606 : translate upper to lower if necessary
3609 echo "(Normalizing case in your domain name)"
3610 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
3614 : a little sanity check here
3615 case "$phostname" in
3618 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
3619 $myhostname$mydomain|$myhostname) ;;
3621 case "$phostname" in
3623 echo "(That doesn't agree with your whoami.h file, by the way.)"
3626 echo "(That doesn't agree with your $phostname command, by the way.)"
3636 I need to get your e-mail address in Internet format if possible, i.e.
3637 something like user@host.domain. Please answer accurately since I have
3638 no easy means to double check it. The default value provided below
3639 is most probably close to the reality but may not be valid from outside
3640 your organization...
3644 while test "$cont"; do
3646 '') dflt="$cf_by@$myhostname$mydomain";;
3647 *) dflt="$cf_email";;
3649 rp='What is your e-mail address?'
3655 rp='Address does not look like an Internet one. Use it anyway?'
3671 If you or somebody else will be maintaining perl at your site, please
3672 fill in the correct e-mail address here so that they may be contacted
3673 if necessary. Currently, the "perlbug" program included with perl
3674 will send mail to this address in addition to perlbug@perl.com. You may
3675 enter "none" for no administrator.
3678 case "$perladmin" in
3679 '') dflt="$cf_email";;
3680 *) dflt="$perladmin";;
3682 rp='Perl administrator e-mail address'
3686 : determine where public executable scripts go
3687 set scriptdir scriptdir
3689 case "$scriptdir" in
3692 : guess some guesses
3693 $test -d /usr/share/scripts && dflt=/usr/share/scripts
3694 $test -d /usr/share/bin && dflt=/usr/share/bin
3695 $test -d /usr/local/script && dflt=/usr/local/script
3696 $test -d $prefixexp/script && dflt=$prefixexp/script
3700 *) dflt="$scriptdir"
3705 Some installations have a separate directory just for executable scripts so
3706 that they can mount it across multiple architectures but keep the scripts in
3707 one spot. You might, for example, have a subdirectory of /usr/share for this.
3708 Or you might just lump your scripts in with all your other executables.
3712 rp='Where do you keep publicly executable scripts?'
3714 if $test "X$ansexp" != "X$scriptdirexp"; then
3718 scriptdirexp="$ansexp"
3722 Since you are running AFS, I need to distinguish the directory in which
3723 scripts reside from the directory in which they are installed (and from
3724 which they are presumably copied to the former directory by occult means).
3727 case "$installscript" in
3728 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
3729 *) dflt="$installscript";;
3732 rp='Where will public scripts be installed?'
3734 installscript="$ans"
3736 installscript="$scriptdirexp"
3739 : determine perl absolute location
3741 '') perlpath=$binexp/perl ;;
3744 : figure out how to guarantee perl startup
3745 case "$startperl" in
3747 case "$sharpbang" in
3751 I can use the #! construct to start perl on your system. This will
3752 make startup of perl scripts faster, but may cause problems if you
3753 want to share those scripts and perl is not in a standard place
3754 ($perlpath) on all your platforms. The alternative is to force
3755 a shell by starting the script with a single ':' character.
3759 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
3762 none) startperl=": # use perl";;
3763 *) startperl="#!$ans";;
3766 *) startperl=": # use perl"
3771 echo "I'll use $startperl to start perl scripts."
3775 Previous version of $package used the standard IO mechanisms as defined in
3776 <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
3777 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
3778 the default and is the only supported mechanism. This abstraction
3779 layer can use AT&T's sfio (if you already have sfio installed) or
3780 fall back on standard IO. This PerlIO abstraction layer is
3781 experimental and may cause problems with some extension modules.
3783 If this doesn't make any sense to you, just accept the default 'n'.
3785 case "$useperlio" in
3786 $define|true|[yY]*) dflt='y';;
3789 rp='Use the experimental PerlIO abstraction layer?'
3796 echo "Ok, doing things the stdio way"
3803 : see how we invoke the C preprocessor
3805 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3806 cat <<'EOT' >testcpp.c
3812 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3814 wrapper=`pwd`/cppstdin
3818 if $test "X$cppstdin" != "X" && \
3819 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3820 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3822 echo "You used to use $cppstdin $cppminus so we'll use that again."
3824 '') echo "But let's see if we can live without a wrapper..." ;;
3826 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3827 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3829 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3832 echo "(However, $cpprun $cpplast does not work, let's see...)"
3840 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3847 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3848 $cc -E <testcpp.c >testcpp.out 2>&1; \
3849 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3850 echo "Yup, it does."
3853 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3854 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3855 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3856 echo "Yup, it does."
3859 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3860 $cc -P <testcpp.c >testcpp.out 2>&1; \
3861 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3862 echo "Yipee, that works!"
3865 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3866 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3867 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3868 echo "At long last!"
3871 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3872 $cpp <testcpp.c >testcpp.out 2>&1; \
3873 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3877 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3878 $cpp - <testcpp.c >testcpp.out 2>&1; \
3879 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3880 echo "Hooray, it works! I was beginning to wonder."
3883 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3884 $wrapper <testcpp.c >testcpp.out 2>&1; \
3885 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3891 rp="No dice. I can't find a C preprocessor. Name one:"
3895 $x_cpp <testcpp.c >testcpp.out 2>&1
3896 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3897 echo "OK, that will do." >&4
3899 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3914 echo "Perhaps can we force $cc -E using a wrapper..."
3915 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3916 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3922 echo "Nope, we'll have to live without it..."
3937 *) $rm -f $wrapper;;
3939 $rm -f testcpp.c testcpp.out
3941 : Set private lib path
3944 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3949 '') dlist="$loclibpth $plibpth $glibpth";;
3950 *) dlist="$libpth";;
3953 : Now check and see which directories actually exist, avoiding duplicates
3957 if $test -d $xxx; then
3960 *) libpth="$libpth $xxx";;
3966 Some systems have incompatible or broken versions of libraries. Among
3967 the directories listed in the question below, please remove any you
3968 know not to be holding relevant libraries, and add any that are needed.
3969 Say "none" for none.
3980 rp="Directories to use for library searches?"
3987 : determine optimize, if desired, or use for debug flag also
3991 *) dflt="$optimize";;
3995 Some C compilers have problems with their optimizers. By default, $package
3996 compiles with the -O flag to use the optimizer. Alternately, you might want
3997 to use the symbolic debugger, which uses the -g flag (on traditional Unix
3998 systems). Either flag can be specified here. To use neither flag, specify
4002 rp="What optimizer/debugger flag should be used?"
4006 'none') optimize=" ";;
4010 : We will not override a previous value, but we might want to
4011 : augment a hint file
4014 case "$gccversion" in
4015 1*) dflt='-fpcc-struct-return' ;;
4018 *-g*) dflt="$dflt -DDEBUGGING";;
4020 case "$gccversion" in
4021 2*) if test -d /etc/conf/kconfig.d &&
4022 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4031 case "$mips_type" in
4032 *BSD*|'') inclwanted="$locincpth $usrinc";;
4033 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4035 for thisincl in $inclwanted; do
4036 if $test -d $thisincl; then
4037 if $test x$thisincl != x$usrinc; then
4040 *) dflt="$dflt -I$thisincl";;
4046 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4048 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4056 *) dflt="$dflt -D$2";;
4061 set signal.h __LANGUAGE_C__; eval $inctest
4063 set signal.h LANGUAGE_C; eval $inctest
4065 set signal.h NO_PROTOTYPE; eval $inctest
4066 set signal.h _NO_PROTO; eval $inctest
4069 none|recommended) dflt="$ccflags $dflt" ;;
4070 *) dflt="$ccflags";;
4078 Your C compiler may want other flags. For this question you should include
4079 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4080 but you should NOT include libraries or ld flags like -lwhatever. If you
4081 want $package to honor its debug switch, you should include -DDEBUGGING here.
4082 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE,
4083 -DHIDEMYMALLOC or -DCRIPPLED_CC.
4085 To use no flags, specify the word "none".
4091 rp="Any additional cc flags?"
4098 : the following weeds options from ccflags that are of no interest to cpp
4100 case "$gccversion" in
4101 1*) cppflags="$cppflags -D__GNUC__"
4103 case "$mips_type" in
4105 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4111 echo "Let me guess what the preprocessor flags are..." >&4
4125 *) ftry="$previous $flag";;
4127 if $cppstdin -DLFRULB=bar $ftry $cppminus <cpp.c \
4128 >cpp1.out 2>/dev/null && \
4129 $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \
4130 >cpp2.out 2>/dev/null && \
4131 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4132 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4134 cppflags="$cppflags $ftry"
4144 *-*) echo "They appear to be: $cppflags";;
4146 $rm -f cpp.c cpp?.out
4150 : flags used in final linking phase
4153 '') if ./venix; then
4159 *-posix*) dflt="$dflt -posix" ;;
4162 *) dflt="$ldflags";;
4165 : Try to guess additional flags to pick up local libraries.
4166 for thislibdir in $libpth; do
4167 case " $loclibpth " in
4170 *"-L$thislibdir "*) ;;
4171 *) dflt="$dflt -L$thislibdir" ;;
4183 Your C linker may need flags. For this question you should
4184 include -L/whatever and any other flags used by the C linker, but you
4185 should NOT include libraries like -lwhatever.
4187 Make sure you include the appropriate -L/path flags if your C linker
4188 does not normally search all of the directories you specified above,
4191 To use no flags, specify the word "none".
4195 rp="Any additional ld flags (NOT including libraries)?"
4201 rmlist="$rmlist pdp11"
4205 echo "Checking your choice of C compiler and flags for coherency..." >&4
4206 set X $cc $optimize $ccflags $ldflags try.c -o try
4209 I've tried to compile and run a simple program with:
4214 and I got the following output:
4217 $cat > try.c <<'EOF'
4222 if sh -c "$cc $optimize $ccflags try.c -o try $ldflags" >>try.msg 2>&1; then
4223 if sh -c './try' >>try.msg 2>&1; then
4226 echo "The program compiled OK, but exited with status $?." >>try.msg
4227 rp="You have a problem. Shall I abort Configure"
4231 echo "I can't compile the test program." >>try.msg
4232 rp="You have a BIG problem. Shall I abort Configure"
4238 case "$knowitall" in
4240 echo "(The supplied flags might be incorrect with this C compiler.)"
4248 *) echo "Ok. Stopping Configure." >&4
4253 n) echo "OK, that should do.";;
4255 $rm -f try try.* core
4257 : compute shared library extension
4260 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4270 On some systems, shared libraries may be available. Answer 'none' if
4271 you want to suppress searching of shared libraries for the remaining
4272 of this configuration.
4275 rp='What is the file extension used for shared libraries?'
4279 : Looking for optional libraries
4281 echo "Checking for optional libraries..." >&4
4286 case "$libswanted" in
4287 '') libswanted='c_s';;
4289 for thislib in $libswanted; do
4291 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
4292 echo "Found -l$thislib (shared)."
4295 *) dflt="$dflt -l$thislib";;
4297 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4298 echo "Found -l$thislib (shared)."
4301 *) dflt="$dflt -l$thislib";;
4303 elif xxx=`./loc lib$thislib.a X $libpth`; $test -f "$xxx"; then
4304 echo "Found -l$thislib."
4307 *) dflt="$dflt -l$thislib";;
4309 elif xxx=`./loc $thislib.a X $libpth`; $test -f "$xxx"; then
4310 echo "Found -l$thislib."
4313 *) dflt="$dflt -l$thislib";;
4315 elif xxx=`./loc lib${thislib}_s.a X $libpth`; $test -f "$xxx"; then
4316 echo "Found -l${thislib}_s."
4319 *) dflt="$dflt -l${thislib}_s";;
4321 elif xxx=`./loc Slib$thislib.a X $xlibpth`; $test -f "$xxx"; then
4322 echo "Found -l$thislib."
4325 *) dflt="$dflt -l$thislib";;
4328 echo "No -l$thislib."
4339 ' '|'') dflt='none';;
4344 Some versions of Unix support shared libraries, which make executables smaller
4345 but make load time slightly longer.
4347 On some systems, mostly System V Release 3's, the shared library is included
4348 by putting the option "-lc_s" as the last thing on the cc command line when
4349 linking. Other systems use shared libraries by default. There may be other
4350 libraries needed to compile $package on your machine as well. If your system
4351 needs the "-lc_s" option, include it here. Include any other special libraries
4352 here as well. Say "none" for none.
4356 rp="Any additional libraries?"
4363 : see if nm is to be used to determine whether a symbol is defined or not
4366 dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null`
4367 if $test $dflt -gt 20; then
4382 I can use 'nm' to extract the symbols from your C libraries. This is a time
4383 consuming task which may generate huge output on the disk (up to 3 megabytes)
4384 but that should make the symbols extraction faster. The alternative is to skip
4385 the 'nm' extraction part and to compile a small test program instead to
4386 determine whether each symbol is present. If you have a fast C compiler and/or
4387 if your 'nm' output cannot be parsed, this may be the best solution.
4390 rp='Shall I use nm to extract C symbols from the libraries?'
4402 : nm options which may be necessary
4404 '') if $test -f /mach_boot; then
4406 elif $test -d /usr/ccs/lib; then
4408 elif $test -f /dgux; then
4415 : nm options which may be necessary for shared libraries but illegal
4416 : for archive libraries. Thank you, Linux.
4417 case "$nm_so_opt" in
4418 '') case "$myuname" in
4420 if nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4421 nm_so_opt='--dynamic'
4430 : get list of predefined functions in a handy place
4435 *-lc_s*) libc=`./loc libc_s.a $libc $libpth`
4442 *) for thislib in $libs; do
4445 : Handle C library specially below.
4448 thislib=`echo $thislib | $sed -e 's/^-l//'`
4449 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4451 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4453 elif try=`./loc lib$thislib.a X $libpth`; $test -f "$try"; then
4455 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4457 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4459 elif try=`./loc Slib$thislib.a X $xlibpth`; $test -f "$try"; then
4464 libnames="$libnames $try"
4466 *) libnames="$libnames $thislib" ;;
4475 for xxx in $libpth; do
4476 $test -r $1 || set $xxx/libc.$so
4477 : The messy sed command sorts on library version numbers.
4479 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4480 tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e '
4482 s/[0-9][0-9]*/0000&/g
4483 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4486 sort | $sed -e 's/^.* //'`
4489 $test -r $1 || set /usr/ccs/lib/libc.$so
4490 $test -r $1 || set /lib/libsys_s.a
4496 if $test -r "$1"; then
4497 echo "Your (shared) C library seems to be in $1."
4499 elif $test -r /lib/libc && $test -r /lib/clib; then
4500 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4502 libc='/lib/clib /lib/libc'
4503 if $test -r /lib/syslib; then
4504 echo "(Your math library is in /lib/syslib.)"
4505 libc="$libc /lib/syslib"
4507 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4508 echo "Your C library seems to be in $libc, as you said before."
4509 elif $test -r $incpath/usr/lib/libc.a; then
4510 libc=$incpath/usr/lib/libc.a;
4511 echo "Your C library seems to be in $libc. That's fine."
4512 elif $test -r /lib/libc.a; then
4514 echo "Your C library seems to be in $libc. You're normal."
4516 if tans=`./loc libc.a blurfl/dyick $libpth`; $test -r "$tans"; then
4518 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4519 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4520 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4522 elif tans=`./loc Slibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4524 elif tans=`./loc Mlibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4527 tans=`./loc Llibc.a blurfl/dyick $xlibpth`
4529 if $test -r "$tans"; then
4530 echo "Your C library seems to be in $tans, of all places."
4536 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4540 If the guess above is wrong (which it might be if you're using a strange
4541 compiler, or your machine supports multiple models), you can override it here.
4546 echo $libpth | tr ' ' '\012' | sort | uniq > libpath
4548 I can't seem to find your C library. I've looked in the following places:
4551 $sed 's/^/ /' libpath
4554 None of these seems to contain your C library. I need to get its name...
4559 rp='Where is your C library?'
4564 echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames
4565 set X `cat libnames`
4568 case $# in 1) xxx=file; esac
4569 echo "Extracting names from the following $xxx for later perusal:" >&4
4571 $sed 's/^/ /' libnames >&4
4573 $echo $n "This may take a while...$c" >&4
4575 : Linux may need the special Dynamic option to nm for shared libraries.
4576 : In general, this is stored in the nm_so_opt variable.
4577 : Unfortunately, that option may be fatal on non-shared libraries.
4578 for nm_libs_ext in $*; do
4579 case $nm_libs_ext in
4580 *$so*) nm $nm_so_opt $nm_opt $nm_libs_ext 2>/dev/null ;;
4581 *) nm $nm_opt $nm_libs_ext 2>/dev/null ;;
4586 $grep fprintf libc.tmp > libc.ptf
4587 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4588 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4590 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx //p'";\
4592 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4594 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4596 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4598 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4600 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4602 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4604 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4606 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4608 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4610 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4612 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4614 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4615 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4617 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4619 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4621 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4623 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4625 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4627 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4629 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4631 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4633 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4636 nm -p $* 2>/dev/null >libc.tmp
4637 $grep fprintf libc.tmp > libc.ptf
4638 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4639 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4645 echo "nm didn't seem to work right. Trying ar instead..." >&4
4647 if ar t $libc > libc.tmp; then
4648 for thisname in $libnames; do
4649 ar t $thisname >>libc.tmp
4651 $sed -e 's/\.o$//' < libc.tmp > libc.list
4654 echo "ar didn't seem to work right." >&4
4655 echo "Maybe this is a Cray...trying bld instead..." >&4
4656 if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list
4658 for thisname in $libnames; do
4660 $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
4661 ar t $thisname >>libc.tmp
4665 echo "That didn't work either. Giving up." >&4
4672 if $test -f /lib/syscalls.exp; then
4674 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4675 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
4679 $rm -f libnames libpath
4681 : is a C symbol defined?
4684 -v) tf=libc.tmp; tc=""; tdc="";;
4685 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4686 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4689 case "$reuseval-$4" in
4691 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4697 if $contains $tlook $tf >/dev/null 2>&1;
4702 echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4703 if $cc $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
4711 $define) tval=true;;
4717 : define an is-in-libc? function
4718 inlibc='echo " "; td=$define; tu=$undef;
4719 sym=$1; var=$2; eval "was=\$$2";
4721 case "$reuseval$was" in
4731 echo "$sym() found." >&4;
4732 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
4734 echo "$sym() NOT found." >&4;
4735 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
4739 $define) echo "$sym() found." >&4;;
4740 *) echo "$sym() NOT found." >&4;;
4744 : Check how to convert floats to strings.
4746 echo "Checking for an efficient way to convert floats to strings."
4749 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
4750 char *myname = "gconvert";
4753 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
4754 char *myname = "gcvt";
4757 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
4758 char *myname = "sprintf";
4764 checkit(expect, got)
4768 if (strcmp(expect, got)) {
4769 printf("%s oddity: Expected %s, got %s\n",
4770 myname, expect, got);
4781 /* This must be 1st test on (which?) platform */
4782 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
4783 Gconvert(0.1, 8, 0, buf);
4784 checkit("0.1", buf);
4786 Gconvert(1.0, 8, 0, buf);
4789 Gconvert(0.0, 8, 0, buf);
4792 Gconvert(-1.0, 8, 0, buf);
4795 /* Some Linux gcvt's give 1.e+5 here. */
4796 Gconvert(100000.0, 8, 0, buf);
4797 checkit("100000", buf);
4799 /* Some Linux gcvt's give -1.e+5 here. */
4800 Gconvert(-100000.0, 8, 0, buf);
4801 checkit("-100000", buf);
4806 case "$d_Gconvert" in
4807 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
4808 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
4809 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
4810 *) xxx_list='gconvert gcvt sprintf' ;;
4813 for xxx_convert in $xxx_list; do
4814 echo "Trying $xxx_convert"
4816 if $cc $ccflags -DTRY_$xxx_convert $ldflags -o try \
4817 try.c $libs > /dev/null 2>&1 ; then
4818 echo "$xxx_convert" found. >&4
4820 echo "I'll use $xxx_convert to convert floats into a string." >&4
4823 echo "...But $xxx_convert didn't work as I expected."
4826 echo "$xxx_convert NOT found." >&4
4830 case "$xxx_convert" in
4831 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
4832 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
4833 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
4836 : Initialize h_fcntl
4839 : Initialize h_sysfile
4842 : determine filename position in cpp output
4844 echo "Computing filename position in cpp output for #include directives..." >&4
4845 echo '#include <stdio.h>' > foo.c
4848 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4849 $grep '^[ ]*#.*stdio\.h' | \
4850 while read cline; do
4853 while $test \$# -gt 0; do
4854 if $test -r \`echo \$1 | $tr -d '"'\`; then
4859 pos=\`expr \$pos + 1\`
4871 *) pos="${fieldn}th";;
4873 echo "Your cpp writes the filename in the $pos field of the line."
4875 : locate header file
4880 if test -f $usrinc/\$wanted; then
4881 echo "$usrinc/\$wanted"
4884 awkprg='{ print \$$fieldn }'
4885 echo "#include <\$wanted>" > foo\$\$.c
4886 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4887 $grep "^[ ]*#.*\$wanted" | \
4888 while read cline; do
4889 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4891 */\$wanted) echo "\$name"; exit 0;;
4902 : access call always available on UNIX
4906 : locate the flags for 'access()'
4910 $cat >access.c <<'EOCP'
4911 #include <sys/types.h>
4916 #include <sys/file.h>
4925 : check sys/file.h first, no particular reason here
4926 if $test `./findhdr sys/file.h` && \
4927 $cc $cppflags -DI_SYS_FILE access.c -o access >/dev/null 2>&1 ; then
4929 echo "<sys/file.h> defines the *_OK access constants." >&4
4930 elif $test `./findhdr fcntl.h` && \
4931 $cc $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then
4933 echo "<fcntl.h> defines the *_OK access constants." >&4
4934 elif $test `./findhdr unistd.h` && \
4935 $cc $cppflags -DI_UNISTD access.c -o access >/dev/null 2>&1 ; then
4936 echo "<unistd.h> defines the *_OK access constants." >&4
4938 echo "I can't find the four *_OK access constants--I'll use mine." >&4
4944 : see if alarm exists
4948 : Look for GNU-cc style attribute checking
4950 echo "Checking whether your compiler can handle __attribute__ ..." >&4
4951 $cat >attrib.c <<'EOCP'
4953 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
4955 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
4956 if $contains 'warning' attrib.out >/dev/null 2>&1; then
4957 echo "Your C compiler doesn't fully support __attribute__."
4960 echo "Your C compiler supports __attribute__."
4964 echo "Your C compiler doesn't seem to understand __attribute__ at all."
4971 : see if bcmp exists
4975 : see if bcopy exists
4979 : see if setpgrp exists
4980 set setpgrp d_setpgrp
4983 : see which flavor of setpgrp is in use
4984 case "$d_setpgrp" in
4990 if (getuid() == 0) {
4991 printf("(I see you are running Configure as super-user...)\n");
4994 if (-1 == setpgrp(1, 1))
4999 if $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1; then
5002 0) echo "You have to use setpgrp() instead of setpgrp(pid, pgrp)." >&4
5004 *) echo "You have to use setpgrp(pid, pgrp) instead of setpgrp()." >&4
5009 xxx="USG one, i.e. you use setpgrp()."
5012 xxx="BSD one, i.e. you use setpgrp(pid, pgrp)."
5015 echo "Assuming your setpgrp is a $xxx" >&4
5024 : see if bzero exists
5028 : check for length of integer
5032 echo "Checking to see how big your integers are..." >&4
5033 $cat >try.c <<'EOCP'
5037 printf("%d\n", sizeof(int));
5041 if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
5043 echo "Your integers are $intsize bytes long."
5046 echo "(I can't seem to compile the test program. Guessing...)"
5047 rp="What is the size of an integer (in bytes)?"
5055 : see if signal is declared as pointer to function returning int or void
5057 xxx=`./findhdr signal.h`
5058 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
5059 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
5060 echo "You have int (*signal())() instead of void." >&4
5062 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
5063 echo "You have void (*signal())() instead of int." >&4
5065 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
5066 echo "You have int (*signal())() instead of void." >&4
5069 case "$d_voidsig" in
5071 echo "I can't determine whether signal handler returns void or int..." >&4
5073 rp="What type does your signal handler return?"
5080 echo "As you already told me, signal handler returns void." >&4;;
5082 echo "As you already told me, signal handler returns int." >&4;;
5087 case "$d_voidsig" in
5088 "$define") signal_t="void";;
5093 : check for ability to cast large floats to 32-bit ints.
5095 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
5096 if $test "$intsize" -eq 4; then
5102 #include <sys/types.h>
5104 $signal_t blech() { exit(3); }
5110 signal(SIGFPE, blech);
5112 f = (double) 0x7fffffff;
5116 if (i32 != ($xxx) f)
5121 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
5125 echo "(I can't seem to compile the test program--assuming it can't)"
5133 echo "Nope, it can't."
5140 : check for ability to cast negative floats to unsigned
5142 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
5144 #include <sys/types.h>
5146 $signal_t blech() { exit(7); }
5147 $signal_t blech_in_list() { exit(4); }
5148 unsigned long dummy_long(p) unsigned long p; { return p; }
5149 unsigned int dummy_int(p) unsigned int p; { return p; }
5150 unsigned short dummy_short(p) unsigned short p; { return p; }
5154 unsigned long along;
5156 unsigned short ashort;
5159 signal(SIGFPE, blech);
5160 along = (unsigned long)f;
5161 aint = (unsigned int)f;
5162 ashort = (unsigned short)f;
5163 if (along != (unsigned long)-123)
5165 if (aint != (unsigned int)-123)
5167 if (ashort != (unsigned short)-123)
5169 f = (double)0x40000000;
5172 along = (unsigned long)f;
5173 if (along != 0x80000000)
5177 along = (unsigned long)f;
5178 if (along != 0x7fffffff)
5182 along = (unsigned long)f;
5183 if (along != 0x80000001)
5187 signal(SIGFPE, blech_in_list);
5189 along = dummy_long((unsigned long)f);
5190 aint = dummy_int((unsigned int)f);
5191 ashort = dummy_short((unsigned short)f);
5192 if (along != (unsigned long)123)
5194 if (aint != (unsigned int)123)
5196 if (ashort != (unsigned short)123)
5202 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
5206 echo "(I can't seem to compile the test program--assuming it can't)"
5209 case "$castflags" in
5214 echo "Nope, it can't."
5221 : see if vprintf exists
5223 if set vprintf val -f d_vprintf; eval $csym; $val; then
5224 echo 'vprintf() found.' >&4
5226 $cat >vprintf.c <<'EOF'
5227 #include <varargs.h>
5229 main() { xxx("foo"); }
5238 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
5241 if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then
5242 echo "Your vsprintf() returns (int)." >&4
5245 echo "Your vsprintf() returns (char*)." >&4
5249 echo 'vprintf() NOT found.' >&4
5259 : see if chown exists
5263 : see if chroot exists
5267 : see if chsize exists
5271 : check for const keyword
5273 echo 'Checking to see if your C compiler knows about "const"...' >&4
5274 $cat >const.c <<'EOCP'
5275 typedef struct spug { int drokk; } spug;
5282 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
5284 echo "Yup, it does."
5287 echo "Nope, it doesn't."
5292 : see if crypt exists
5294 if set crypt val -f d_crypt; eval $csym; $val; then
5295 echo 'crypt() found.' >&4
5299 cryptlib=`./loc Slibcrypt.a "" $xlibpth`
5300 if $test -z "$cryptlib"; then
5301 cryptlib=`./loc Mlibcrypt.a "" $xlibpth`
5305 if $test -z "$cryptlib"; then
5306 cryptlib=`./loc Llibcrypt.a "" $xlibpth`
5310 if $test -z "$cryptlib"; then
5311 cryptlib=`./loc libcrypt.a "" $libpth`
5315 if $test -z "$cryptlib"; then
5316 echo 'crypt() NOT found.' >&4
5325 : get csh whereabouts
5327 'csh') val="$undef" ;;
5334 : see if cuserid exists
5335 set cuserid d_cuserid
5338 : define an alternate in-header-list? function
5339 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5340 cont=true; xxf="echo \"<\$1> found.\" >&4";
5341 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5342 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5344 case $# in 4) instead=instead;; *) instead="at last";; esac;
5345 while $test "$cont"; do
5347 var=$2; eval "was=\$$2";
5348 if $test "$xxx" && $test -r "$xxx";
5350 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5353 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5354 set $yyy; shift; shift; yyy=$@;
5355 case $# in 0) cont="";;
5356 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5357 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5358 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5359 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5363 do set $yyy; var=$2; eval "was=\$$2";
5364 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5365 set $yyy; shift; shift; yyy=$@;
5368 : see if this is a limits.h system
5369 set limits.h i_limits
5372 : see if this is a float.h system
5376 : See if number of significant digits in a double precision number is known
5378 $cat >dbl_dig.c <<EOM
5388 printf("Contains DBL_DIG");
5391 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
5392 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
5393 echo "DBL_DIG found." >&4
5396 echo "DBL_DIG NOT found." >&4
5403 : see if difftime exists
5404 set difftime d_difftime
5407 : see if this is a dirent system
5409 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
5411 echo "<dirent.h> found." >&4
5414 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
5415 echo "<sys/dir.h> found." >&4
5418 xinc=`./findhdr sys/ndir.h`
5420 echo "<dirent.h> NOT found." >&4
5425 : Look for type of directory structure.
5427 $cppstdin $cppflags $cppminus < "$xinc" > try.c
5429 case "$direntrytype" in
5432 $define) guess1='struct dirent' ;;
5433 *) guess1='struct direct' ;;
5436 *) guess1="$direntrytype"
5441 'struct dirent') guess2='struct direct' ;;
5442 *) guess2='struct dirent' ;;
5445 if $contains "$guess1" try.c >/dev/null 2>&1; then
5446 direntrytype="$guess1"
5447 echo "Your directory entries are $direntrytype." >&4
5448 elif $contains "$guess2" try.c >/dev/null 2>&1; then
5449 direntrytype="$guess2"
5450 echo "Your directory entries seem to be $direntrytype." >&4
5452 echo "I don't recognize your system's directory entries." >&4
5453 rp="What type is used for directory entries on this system?"
5461 : see if the directory entry stores field length
5463 $cppstdin $cppflags $cppminus < "$xinc" > try.c
5464 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
5465 echo "Good, your directory entry keeps length information in d_namlen." >&4
5468 echo "Your directory entry does not know about the d_namlen field." >&4
5475 : see if dlerror exists
5478 set dlerror d_dlerror
5482 : see if dld is available
5486 : see if dlopen exists
5493 : determine which dynamic loading, if any, to compile in
5495 dldir="ext/DynaLoader"
5508 $define) dflt='y' ;;
5511 $define) dflt='y' ;;
5513 : Does a dl_xxx.xs file exist for this operating system
5514 $test -f ../$dldir/dl_${osname}.xs && dflt='y'
5517 rp="Do you wish to use dynamic loading?"
5524 if $test -f ../$dldir/dl_${osname}.xs ; then
5525 dflt="$dldir/dl_${osname}.xs"
5526 elif $test "$d_dlopen" = "$define" ; then
5527 dflt="$dldir/dl_dlopen.xs"
5528 elif $test "$i_dld" = "$define" ; then
5529 dflt="$dldir/dl_dld.xs"
5534 *) dflt="$dldir/$dlsrc"
5537 echo "The following dynamic loading files are available:"
5538 : Can not go over to $dldir because getfile has path hard-coded in.
5539 cd ..; ls -C $dldir/dl*.xs; cd UU
5540 rp="Source file to use for dynamic loading"
5545 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5549 Some systems may require passing special flags to $cc -c to
5550 compile modules that will be used to create a shared library.
5551 To use no flags, say "none".
5554 case "$cccdlflags" in
5555 '') case "$gccversion" in
5556 '') case "$osname" in
5558 next) dflt='none' ;;
5559 solaris|svr4*|esix*) dflt='-Kpic' ;;
5560 irix*) dflt='-KPIC' ;;
5561 sunos) dflt='-pic' ;;
5566 *) dflt="$cccdlflags" ;;
5568 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5571 none) cccdlflags=' ' ;;
5572 *) cccdlflags="$ans" ;;
5577 Some systems use ld to create libraries that can be dynamically loaded,
5578 while other systems (such as those using ELF) use $cc.
5582 '') $cat >try.c <<'EOM'
5583 /* Test for whether ELF binaries are produced */
5588 int i = open("a.out",O_RDONLY);
5591 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5592 exit(0); /* succeed (yes, it's ELF) */
5597 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5599 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5603 echo "I'll use ld to build dynamic libraries."
5612 rp="What command should be used to create dynamic libraries?"
5618 Some systems may require passing special flags to $ld to create a
5619 library that can be dynamically loaded. If your ld flags include
5620 -L/other/path options to locate libraries outside your loader's normal
5621 search path, you may need to specify those -L options here as well. To
5622 use no flags, say "none".
5625 case "$lddlflags" in
5626 '') case "$osname" in
5628 linux|irix*) dflt='-shared' ;;
5629 next) dflt='none' ;;
5630 solaris) dflt='-G' ;;
5631 sunos) dflt='-assert nodefinitions' ;;
5632 svr4*|esix*) dflt="-G $ldflags" ;;
5636 *) dflt="$lddlflags" ;;
5639 : Try to guess additional flags to pick up local libraries.
5640 for thisflag in $ldflags; do
5645 *) dflt="$dflt $thisflag" ;;
5655 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5658 none) lddlflags=' ' ;;
5659 *) lddlflags="$ans" ;;
5664 Some systems may require passing special flags to $cc to indicate that
5665 the resulting executable will use dynamic linking. To use no flags,
5669 case "$ccdlflags" in
5670 '') case "$osname" in
5671 hpux) dflt='-Wl,-E' ;;
5672 linux) dflt='-rdynamic' ;;
5673 next) dflt='none' ;;
5674 sunos) dflt='none' ;;
5677 *) dflt="$ccdlflags" ;;
5679 rp="Any special flags to pass to $cc to use dynamic loading?"
5682 none) ccdlflags=' ' ;;
5683 *) ccdlflags="$ans" ;;
5694 : see if dlfcn is available
5702 On a few systems, the dynamically loaded modules that perl generates and uses
5703 will need a different extension then shared libs. The default will probably
5711 rp='What is the extension of dynamically loaded modules'
5720 : Define several unixisms. Hints files or command line options
5721 : can be used to override them.
5734 : Which makefile gets called first. This is used by make depend.
5735 case "$firstmakefile" in
5736 '') firstmakefile='makefile';;
5739 : Check if dlsym need a leading underscore
5745 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
5746 $cat >dyna.c <<'EOM'
5755 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
5757 #include <sys/types.h>
5771 int mode = RTLD_LAZY ;
5773 handle = dlopen("./dyna.$dlext", mode) ;
5774 if (handle == NULL) {
5778 symbol = dlsym(handle, "fred") ;
5779 if (symbol == NULL) {
5780 /* try putting a leading underscore */
5781 symbol = dlsym(handle, "_fred") ;
5782 if (symbol == NULL) {
5793 : Call the object file tmp-dyna.o in case dlext=o.
5794 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
5795 mv dyna${obj_ext} tmp-dyna${obj_ext} > /dev/null 2>&1 &&
5796 $ld $lddlflags -o dyna.$dlext tmp-dyna${obj_ext} > /dev/null 2>&1 &&
5797 $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
5800 1) echo "Test program failed using dlopen." >&4
5801 echo "Perhaps you should not use dynamic loading." >&4;;
5802 2) echo "Test program failed using dlsym." >&4
5803 echo "Perhaps you should not use dynamic loading." >&4;;
5804 3) echo "dlsym needs a leading underscore" >&4
5806 4) echo "dlsym doesn't need a leading underscore." >&4;;
5809 echo "I can't compile and run the test program." >&4
5814 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
5819 : see if dup2 exists
5823 : Locate the flags for 'open()'
5825 $cat >open3.c <<'EOCP'
5826 #include <sys/types.h>
5831 #include <sys/file.h>
5842 : check sys/file.h first to get FREAD on Sun
5843 if $test `./findhdr sys/file.h` && \
5844 $cc $cppflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then
5846 echo "<sys/file.h> defines the O_* constants..." >&4
5848 echo "and you have the 3 argument form of open()." >&4
5851 echo "but not the 3 argument form of open(). Oh, well." >&4
5854 elif $test `./findhdr fcntl.h` && \
5855 $cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then
5857 echo "<fcntl.h> defines the O_* constants..." >&4
5859 echo "and you have the 3 argument form of open()." >&4
5862 echo "but not the 3 argument form of open(). Oh, well." >&4
5867 echo "I can't find the O_* constant definitions! You got problems." >&4
5873 : check for non-blocking I/O stuff
5874 case "$h_sysfile" in
5875 true) echo "#include <sys/file.h>" > head.c;;
5878 true) echo "#include <fcntl.h>" > head.c;;
5879 *) echo "#include <sys/fcntl.h>" > head.c;;
5884 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
5885 case "$o_nonblock" in
5888 $cat >>try.c <<'EOCP'
5891 printf("O_NONBLOCK\n");
5895 printf("O_NDELAY\n");
5899 printf("FNDELAY\n");
5905 if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then
5907 case "$o_nonblock" in
5908 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
5909 *) echo "Seems like we can use $o_nonblock.";;
5912 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
5915 *) echo "Using $hint value $o_nonblock.";;
5917 $rm -f try try.* .out core
5920 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
5926 #include <sys/types.h>
5928 #define MY_O_NONBLOCK $o_nonblock
5930 $signal_t blech(x) int x; { exit(3); }
5932 $cat >> try.c <<'EOCP'
5940 pipe(pd); /* Down: child -> parent */
5941 pipe(pu); /* Up: parent -> child */
5944 close(pd[1]); /* Parent reads from pd[0] */
5945 close(pu[0]); /* Parent writes (blocking) to pu[1] */
5946 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
5948 signal(SIGALRM, blech);
5950 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
5952 sprintf(string, "%d\n", ret);
5953 write(2, string, strlen(string));
5956 if (errno == EAGAIN) {
5962 if (errno == EWOULDBLOCK)
5963 printf("EWOULDBLOCK\n");
5966 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
5967 sleep(2); /* Give it time to close our pipe */
5969 ret = read(pd[0], buf, 1); /* Should read EOF */
5971 sprintf(string, "%d\n", ret);
5972 write(3, string, strlen(string));
5976 close(pd[0]); /* We write to pd[1] */
5977 close(pu[1]); /* We read from pu[0] */
5978 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
5979 close(pd[1]); /* Pipe pd is now fully closed! */
5980 exit(0); /* Bye bye, thank you for playing! */
5983 if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then
5984 echo "$startsh" >mtry
5985 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
5987 ./mtry >/dev/null 2>&1
5989 0) eagain=`$cat try.out`;;
5990 1) echo "Could not perform non-blocking setting!";;
5991 2) echo "I did a successful read() for something that was not there!";;
5992 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
5993 *) echo "Something terribly wrong happened during testing.";;
5995 rd_nodata=`$cat try.ret`
5996 echo "A read() system call with no data present returns $rd_nodata."
5997 case "$rd_nodata" in
6000 echo "(That's peculiar, fixing that to be -1.)"
6006 echo "Forcing errno EAGAIN on read() with no data available."
6010 echo "Your read() sets errno to $eagain when no data is available."
6013 status=`$cat try.err`
6015 0) echo "And it correctly returns 0 to signal EOF.";;
6016 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
6017 *) echo "However, your read() returns '$status' on EOF??";;
6020 if test "$status" -eq "$rd_nodata"; then
6021 echo "WARNING: you can't distinguish between EOF and no data!"
6025 echo "I can't compile the test program--assuming errno EAGAIN will do."
6032 echo "Using $hint value $eagain."
6033 echo "Your read() returns $rd_nodata when no data is present."
6034 case "$d_eofnblk" in
6035 "$define") echo "And you can see EOF because read() returns 0.";;
6036 "$undef") echo "But you can't see EOF status from read() returned value.";;
6038 echo "(Assuming you can't see EOF status from read anyway.)"
6044 $rm -f try try.* .out core head.c mtry
6046 : see if fchmod exists
6050 : see if fchown exists
6054 : see if this is an fcntl system
6058 : see if fgetpos exists
6059 set fgetpos d_fgetpos
6062 : see if flock exists
6066 : see if fork exists
6070 : see if pathconf exists
6071 set pathconf d_pathconf
6074 : see if fpathconf exists
6075 set fpathconf d_fpathconf
6078 : see if fsetpos exists
6079 set fsetpos d_fsetpos
6082 : see if gethostent exists
6083 set gethostent d_gethent
6086 : see if getlogin exists
6087 set getlogin d_getlogin
6090 : see if getpgrp exists
6091 set getpgrp d_getpgrp
6094 : see if getpgrp2 exists
6095 set getpgrp2 d_getpgrp2
6098 : see if getppid exists
6099 set getppid d_getppid
6102 : see if getpriority exists
6103 set getpriority d_getprior
6106 : see if this is a netinet/in.h or sys/in.h system
6107 set netinet/in.h i_niin sys/in.h i_sysin
6110 : see if htonl --and friends-- exists
6115 : Maybe they are macros.
6120 #include <sys/types.h>
6121 #$i_niin I_NETINET_IN
6124 #include <netinet/in.h>
6130 printf("Defined as a macro.");
6133 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
6134 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
6136 echo "But it seems to be defined as a macro." >&4
6144 : see which of string.h or strings.h is needed
6146 strings=`./findhdr string.h`
6147 if $test "$strings" && $test -r "$strings"; then
6148 echo "Using <string.h> instead of <strings.h>." >&4
6152 strings=`./findhdr strings.h`
6153 if $test "$strings" && $test -r "$strings"; then
6154 echo "Using <strings.h> instead of <string.h>." >&4
6156 echo "No string header found -- You'll surely have problems." >&4
6162 "$undef") strings=`./findhdr strings.h`;;
6163 *) strings=`./findhdr string.h`;;
6168 if set index val -f; eval $csym; $val; then
6169 if set strchr val -f d_strchr; eval $csym; $val; then
6170 if $contains strchr "$strings" >/dev/null 2>&1 ; then
6173 echo "strchr() found." >&4
6177 echo "index() found." >&4
6182 echo "index() found." >&4
6185 if set strchr val -f d_strchr; eval $csym; $val; then
6188 echo "strchr() found." >&4
6190 echo "No index() or strchr() found!" >&4
6195 set d_strchr; eval $setvar
6197 set d_index; eval $setvar
6201 $cat >isascii.c <<'EOCP'
6212 if $cc $ccflags $ldflags -o isascii isascii.c $libs >/dev/null 2>&1 ; then
6213 echo "isascii() found." >&4
6216 echo "isascii() NOT found." >&4
6223 : see if killpg exists
6227 : see if link exists
6231 : see if localeconv exists
6232 set localeconv d_locconv
6235 : see if lockf exists
6239 : see if lstat exists
6243 : see if mblen exists
6247 : see if mbstowcs exists
6248 set mbstowcs d_mbstowcs
6251 : see if mbtowc exists
6255 : see if memcmp exists
6259 : see if memcpy exists
6263 : see if memmove exists
6264 set memmove d_memmove
6267 : see if memset exists
6271 : see if mkdir exists
6275 : see if mkfifo exists
6279 : see if mktime exists
6283 : see if msgctl exists
6287 : see if msgget exists
6291 : see if msgsnd exists
6295 : see if msgrcv exists
6299 : see how much of the 'msg*(2)' library is present.
6302 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
6303 *"$undef"*) h_msg=false;;
6305 : we could also check for sys/ipc.h ...
6306 if $h_msg && $test `./findhdr sys/msg.h`; then
6307 echo "You have the full msg*(2) library." >&4
6310 echo "You don't have the full msg*(2) library." >&4
6316 : see if this is a malloc.h system
6317 set malloc.h i_malloc
6320 : see if stdlib is available
6321 set stdlib.h i_stdlib
6324 : determine which malloc to compile in
6326 case "$usemymalloc" in
6327 ''|y*|true) dflt='y' ;;
6328 n*|false) dflt='n' ;;
6329 *) dflt="$usemymalloc" ;;
6331 rp="Do you wish to attempt to use the malloc that comes with $package?"
6337 mallocsrc='malloc.c'
6338 mallocobj='malloc.o'
6339 d_mymalloc="$define"
6342 : Remove malloc from list of libraries to use
6343 echo "Removing unneeded -lmalloc from library list" >&4
6344 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6347 echo "libs = $libs" >&4
6359 : compute the return types of malloc and free
6361 $cat >malloc.c <<END
6365 #include <sys/types.h>
6379 case "$malloctype" in
6381 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6388 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6392 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6399 echo "Your system uses $freetype free(), it would seem." >&4
6401 : see if nice exists
6405 : see if pause exists
6409 : see if pipe exists
6413 : see if poll exists
6417 : see if this is a pwd.h system
6423 xxx=`./findhdr pwd.h`
6424 $cppstdin $cppflags $cppminus < $xxx >$$.h
6426 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
6434 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
6442 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
6450 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
6458 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
6466 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
6478 set d_pwquota; eval $setvar
6479 set d_pwage; eval $setvar
6480 set d_pwchange; eval $setvar
6481 set d_pwclass; eval $setvar
6482 set d_pwexpire; eval $setvar
6483 set d_pwcomment; eval $setvar
6487 : see if readdir and friends exist
6488 set readdir d_readdir
6490 set seekdir d_seekdir
6492 set telldir d_telldir
6494 set rewinddir d_rewinddir
6497 : see if readlink exists
6498 set readlink d_readlink
6501 : see if rename exists
6505 : see if rmdir exists
6509 : see if memory.h is available.
6514 : See if it conflicts with string.h
6520 $cppstdin $cppflags $cppminus < $strings > mem.h
6521 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
6523 echo "We won't be including <memory.h>."
6533 : see if this is a unistd.h system
6534 set unistd.h i_unistd
6537 : can bcopy handle overlapping blocks?
6542 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
6549 $cat >>foo.c <<'EOCP'
6553 # include <memory.h>
6556 # include <stdlib.h>
6559 # include <string.h>
6561 # include <strings.h>
6564 # include <unistd.h> /* Needed for NetBSD */
6568 char buf[128], abc[128];
6574 /* Copy "abcde..." string to char abc[] so that gcc doesn't
6575 try to store the string in read-only memory. */
6576 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
6578 for (align = 7; align >= 0; align--) {
6579 for (len = 36; len; len--) {
6582 for (off = 1; off <= len; off++) {
6583 bcopy(b, b+off, len);
6584 bcopy(b+off, b, len);
6585 if (bcmp(b, abc, len))
6593 if $cc $ccflags $ldflags foo.c -o safebcpy $libs >/dev/null 2>&1; then
6594 if ./safebcpy 2>/dev/null; then
6598 echo "It can't, sorry."
6599 case "$d_memmove" in
6600 "$define") echo "But that's Ok since you have memmove()." ;;
6604 echo "(I can't compile the test program, so we'll assume not...)"
6605 case "$d_memmove" in
6606 "$define") echo "But that's Ok since you have memmove()." ;;
6611 $rm -f foo.* safebcpy core
6615 : can memcpy handle overlapping blocks?
6620 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
6627 $cat >>foo.c <<'EOCP'
6631 # include <memory.h>
6634 # include <stdlib.h>
6637 # include <string.h>
6639 # include <strings.h>
6642 # include <unistd.h> /* Needed for NetBSD */
6646 char buf[128], abc[128];
6652 /* Copy "abcde..." string to char abc[] so that gcc doesn't
6653 try to store the string in read-only memory. */
6654 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
6656 for (align = 7; align >= 0; align--) {
6657 for (len = 36; len; len--) {
6659 memcpy(b, abc, len);
6660 for (off = 1; off <= len; off++) {
6661 memcpy(b+off, b, len);
6662 memcpy(b, b+off, len);
6663 if (memcmp(b, abc, len))
6671 if $cc $ccflags $ldflags foo.c -o safemcpy $libs >/dev/null 2>&1; then
6672 if ./safemcpy 2>/dev/null; then
6676 echo "It can't, sorry."
6677 case "$d_memmove" in
6678 "$define") echo "But that's Ok since you have memmove()." ;;
6682 echo "(I can't compile the test program, so we'll assume not...)"
6683 case "$d_memmove" in
6684 "$define") echo "But that's Ok since you have memmove()." ;;
6689 $rm -f foo.* safemcpy core
6693 : see if select exists
6697 : see if semctl exists
6701 : see if semget exists
6705 : see if semop exists
6709 : see how much of the 'sem*(2)' library is present.
6712 case "$d_semctl$d_semget$d_semop" in
6713 *"$undef"*) h_sem=false;;
6715 : we could also check for sys/ipc.h ...
6716 if $h_sem && $test `./findhdr sys/sem.h`; then
6717 echo "You have the full sem*(2) library." >&4
6720 echo "You don't have the full sem*(2) library." >&4
6726 : see if setegid exists
6727 set setegid d_setegid
6730 : see if seteuid exists
6731 set seteuid d_seteuid
6734 : see if setlinebuf exists
6735 set setlinebuf d_setlinebuf
6738 : see if setlocale exists
6739 set setlocale d_setlocale
6742 : see if setpgid exists
6743 set setpgid d_setpgid
6746 : see if setpgrp2 exists
6747 set setpgrp2 d_setpgrp2
6750 : see if setpriority exists
6751 set setpriority d_setprior
6754 : see if setregid exists
6755 set setregid d_setregid
6757 set setresgid d_setresgid
6760 : see if setreuid exists
6761 set setreuid d_setreuid
6763 set setresuid d_setresuid
6766 : see if setrgid exists
6767 set setrgid d_setrgid
6770 : see if setruid exists
6771 set setruid d_setruid
6774 : see if setsid exists
6778 : see if sfio.h is available
6783 : see if sfio library is available
6794 : Ok, but do we want to use it.
6798 true|$define|[yY]*) dflt='y';;
6801 echo "$package can use the sfio library, but it is experimental."
6802 rp="You seem to have sfio available, do you want to try using it?"
6806 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
6811 *) case "$usesfio" in
6813 echo "Sorry, cannot find sfio on this machine" >&4
6814 echo "Ignoring your setting of usesfio=$usesfio" >&4
6822 $define) usesfio='true';;
6823 *) usesfio='false';;
6826 : see if shmctl exists
6830 : see if shmget exists
6834 : see if shmat exists
6837 : see what shmat returns
6840 $cat >shmat.c <<'END'
6841 #include <sys/shm.h>
6844 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
6849 echo "and it returns ($shmattype)." >&4
6850 : see if a prototype for shmat is available
6851 xxx=`./findhdr sys/shm.h`
6852 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
6853 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
6864 set d_shmatprototype
6867 : see if shmdt exists
6871 : see how much of the 'shm*(2)' library is present.
6874 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
6875 *"$undef"*) h_shm=false;;
6877 : we could also check for sys/ipc.h ...
6878 if $h_shm && $test `./findhdr sys/shm.h`; then
6879 echo "You have the full shm*(2) library." >&4
6882 echo "You don't have the full shm*(2) library." >&4
6889 : see if we have sigaction
6890 if set sigaction val -f d_sigaction; eval $csym; $val; then
6891 echo 'sigaction() found.' >&4
6894 echo 'sigaction NOT found.' >&4
6898 $cat > set.c <<'EOP'
6899 /* Solaris 2.5_x86 with SunWorks Pro C 3.0.1 doesn't have a complete
6900 sigaction structure if compiled with cc -Xc. This compile test
6901 will fail then. <doughera@lafcol.lafayette.edu>
6904 #include <sys/types.h>
6908 struct sigaction act, oact;
6912 if $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1; then
6915 echo "But you don't seem to have a useable struct sigaction." >&4
6918 set d_sigaction; eval $setvar
6919 $rm -f set set.o set.c
6921 : see if sigsetjmp exists
6923 case "$d_sigsetjmp" in
6931 if (sigsetjmp(env,1))
6938 if $cc $ccflags $ldflags -o set set.c $libs > /dev/null 2>&1 ; then
6939 if ./set >/dev/null 2>&1; then
6940 echo "POSIX sigsetjmp found." >&4
6944 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
6950 echo "sigsetjmp not found." >&4
6954 *) val="$d_sigsetjmp"
6955 case "$d_sigsetjmp" in
6956 $define) echo "POSIX sigsetjmp found." >&4;;
6957 $undef) echo "sigsetjmp not found." >&4;;
6967 : see whether socket exists
6969 $echo $n "Hmm... $c" >&4
6970 if set socket val -f d_socket; eval $csym; $val; then
6971 echo "Looks like you have Berkeley networking support." >&4
6973 if set setsockopt val -f; eval $csym; $val; then
6976 echo "...but it uses the old 4.1c interface, rather than 4.2" >&4
6980 if $contains socklib libc.list >/dev/null 2>&1; then
6981 echo "Looks like you have Berkeley networking support." >&4
6983 : we will have to assume that it supports the 4.2 BSD interface
6986 echo "You don't have Berkeley networking in libc.a..." >&4
6987 if test -f /usr/lib/libnet.a; then
6988 ( (nm $nm_opt /usr/lib/libnet.a | eval $nm_extract) || \
6989 ar t /usr/lib/libnet.a) 2>/dev/null >> libc.list
6990 if $contains socket libc.list >/dev/null 2>&1; then
6991 echo "...but the Wollongong group seems to have hacked it in." >&4
6993 sockethdr="-I/usr/netinclude"
6995 if $contains setsockopt libc.list >/dev/null 2>&1; then
6998 echo "...using the old 4.1c interface, rather than 4.2" >&4
7002 echo "or even in libnet.a, which is peculiar." >&4
7007 echo "or anywhere else I see." >&4
7014 : see if socketpair exists
7015 set socketpair d_sockpair
7018 : see if stat knows about block sizes
7020 xxx=`./findhdr sys/stat.h`
7021 if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then
7022 if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then
7023 echo "Your stat() knows about block sizes." >&4
7026 echo "Your stat() doesn't know about block sizes." >&4
7030 echo "Your stat() doesn't know about block sizes." >&4
7036 : see if _ptr and _cnt from stdio act std
7038 if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
7039 echo "(Looks like you have stdio.h from Linux.)"
7040 case "$stdio_ptr" in
7041 '') stdio_ptr='((fp)->_IO_read_ptr)'
7044 *) ptr_lval=$d_stdio_ptr_lval;;
7046 case "$stdio_cnt" in
7047 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
7050 *) cnt_lval=$d_stdio_cnt_lval;;
7052 case "$stdio_base" in
7053 '') stdio_base='((fp)->_IO_read_base)';;
7055 case "$stdio_bufsiz" in
7056 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
7059 case "$stdio_ptr" in
7060 '') stdio_ptr='((fp)->_ptr)'
7063 *) ptr_lval=$d_stdio_ptr_lval;;
7065 case "$stdio_cnt" in
7066 '') stdio_cnt='((fp)->_cnt)'
7069 *) cnt_lval=$d_stdio_cnt_lval;;
7071 case "$stdio_base" in
7072 '') stdio_base='((fp)->_base)';;
7074 case "$stdio_bufsiz" in
7075 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
7078 : test whether _ptr and _cnt really work
7079 echo "Checking how std your stdio is..." >&4
7082 #define FILE_ptr(fp) $stdio_ptr
7083 #define FILE_cnt(fp) $stdio_cnt
7085 FILE *fp = fopen("try.c", "r");
7088 18 <= FILE_cnt(fp) &&
7089 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
7096 if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1; then
7098 echo "Your stdio acts pretty std."
7101 echo "Your stdio isn't very std."
7104 echo "Your stdio doesn't appear very std."
7110 : Can _ptr be used as an lvalue?
7111 case "$d_stdstdio$ptr_lval" in
7112 $define$define) val=$define ;;
7115 set d_stdio_ptr_lval
7118 : Can _cnt be used as an lvalue?
7119 case "$d_stdstdio$cnt_lval" in
7120 $define$define) val=$define ;;
7123 set d_stdio_cnt_lval
7126 : How to access the stdio _filbuf or __filbuf function.
7127 : If this fails, check how the getc macro in stdio.h works.
7128 case "${d_stdio_ptr_lval}${d_stdio_cnt_lval}" in
7130 : Try $hint value, if any, then _filbuf, __filbuf, _fill, then punt.
7131 : _fill is for os/2.
7133 for filbuf in $stdio_filbuf '_filbuf(fp)' '__filbuf(fp) ' '_fill(fp)' ; do
7136 #define FILE_ptr(fp) $stdio_ptr
7137 #define FILE_cnt(fp) $stdio_cnt
7138 #define FILE_filbuf(fp) $filbuf
7140 FILE *fp = fopen("try.c", "r");
7143 c = FILE_filbuf(fp); /* Just looking for linker errors.*/
7147 if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1 && ./try; then
7148 echo "Your stdio appears to use $filbuf"
7149 stdio_filbuf="$filbuf"
7153 echo "Hmm. $filbuf doesn't seem to work."
7158 notok) echo "I can't figure out how to access _filbuf"
7159 echo "I'll just have to work around it."
7160 d_stdio_ptr_lval="$undef"
7161 d_stdio_cnt_lval="$undef"
7168 : see if _base is also standard
7170 case "$d_stdstdio" in
7174 #define FILE_base(fp) $stdio_base
7175 #define FILE_bufsiz(fp) $stdio_bufsiz
7177 FILE *fp = fopen("try.c", "r");
7180 19 <= FILE_bufsiz(fp) &&
7181 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
7187 if $cc $ccflags $ldflags -o try try.c $libs > /dev/null 2>&1; then
7189 echo "And its _base field acts std."
7192 echo "But its _base field isn't std."
7195 echo "However, it seems to be lacking the _base field."
7203 : see if strcoll exists
7204 set strcoll d_strcoll
7207 : check for structure copying
7209 echo "Checking to see if your C compiler can copy structs..." >&4
7210 $cat >try.c <<'EOCP'
7220 if $cc -c try.c >/dev/null 2>&1 ; then
7225 echo "Nope, it can't."
7231 : see if strerror and/or sys_errlist[] exist
7233 if set strerror val -f d_strerror; eval $csym; $val; then
7234 echo 'strerror() found.' >&4
7235 d_strerror="$define"
7236 d_strerrm='strerror(e)'
7237 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
7238 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
7239 d_syserrlst="$define"
7241 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
7242 d_syserrlst="$undef"
7244 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
7245 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
7246 echo 'strerror() found in string header.' >&4
7247 d_strerror="$define"
7248 d_strerrm='strerror(e)'
7249 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
7250 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
7251 d_syserrlst="$define"
7253 echo "(You don't appear to have any sys_errlist[], how can this be?)"
7254 d_syserrlst="$undef"
7256 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
7257 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
7259 d_syserrlst="$define"
7260 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
7262 echo 'strerror() and sys_errlist[] NOT found.' >&4
7264 d_syserrlst="$undef"
7265 d_strerrm='"unknown"'
7268 : see if strxfrm exists
7269 set strxfrm d_strxfrm
7272 : see if symlink exists
7273 set symlink d_symlink
7276 : see if syscall exists
7277 set syscall d_syscall
7280 : see if sysconf exists
7281 set sysconf d_sysconf
7284 : see if system exists
7288 : see if tcgetpgrp exists
7289 set tcgetpgrp d_tcgetpgrp
7292 : see if tcsetpgrp exists
7293 set tcsetpgrp d_tcsetpgrp
7296 : define an is-a-typedef? function
7297 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
7299 "") inclist="sys/types.h";;
7301 eval "varval=\$$var";
7305 for inc in $inclist; do
7306 echo "#include <$inc>" >>temp.c;
7308 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
7309 if $contains $type temp.E >/dev/null 2>&1; then
7315 *) eval "$var=\$varval";;
7318 : see if this is a sys/times.h system
7319 set sys/times.h i_systimes
7322 : see if times exists
7324 if set times val -f d_times; eval $csym; $val; then
7325 echo 'times() found.' >&4
7328 case "$i_systimes" in
7329 "$define") inc='sys/times.h';;
7331 set clock_t clocktype long stdio.h sys/types.h $inc
7335 rp="What type is returned by times() on this system?"
7339 echo 'times() NOT found, hope that will do.' >&4
7344 : see if truncate exists
7345 set truncate d_truncate
7348 : see if tzname[] exists
7350 if set tzname val -a d_tzname; eval $csym; $val; then
7352 echo 'tzname[] found.' >&4
7355 echo 'tzname[] NOT found.' >&4
7360 : see if umask exists
7364 : see how we will look up host name
7367 : dummy stub to allow use of elif
7368 elif set uname val -f d_uname; eval $csym; $val; then
7371 uname() was found, but you're running xenix, and older versions of xenix
7372 have a broken uname(). If you don't really know whether your xenix is old
7373 enough to have a broken system call, use the default answer.
7380 rp='Is your uname() broken?'
7383 n*) d_uname="$define"; call=uname;;
7386 echo 'uname() found.' >&4
7391 case "$d_gethname" in
7392 '') d_gethname="$undef";;
7395 '') d_uname="$undef";;
7397 case "$d_phostname" in
7398 '') d_phostname="$undef";;
7401 : backward compatibility for d_hvfork
7402 if test X$d_hvfork != X; then
7406 : see if there is a vfork
7411 : Ok, but do we want to use it. vfork is reportedly unreliable in
7412 : perl on Solaris 2.x, and probably elsewhere.
7420 rp="Some systems have problems with vfork(). Do you want to use it?"
7425 echo "Ok, we won't use vfork()."
7434 $define) usevfork='true';;
7435 *) usevfork='false';;
7438 : see if this is an sysdir system
7439 set sys/dir.h i_sysdir
7442 : see if this is an sysndir system
7443 set sys/ndir.h i_sysndir
7446 : see if closedir exists
7447 set closedir d_closedir
7450 case "$d_closedir" in
7453 echo "Checking whether closedir() returns a status..." >&4
7454 cat > closedir.c <<EOM
7455 #$i_dirent I_DIRENT /**/
7456 #$i_sysdir I_SYS_DIR /**/
7457 #$i_sysndir I_SYS_NDIR /**/
7459 #if defined(I_DIRENT)
7461 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
7462 #include <sys/dir.h>
7466 #include <sys/ndir.h>
7470 #include <ndir.h> /* may be wrong in the future */
7472 #include <sys/dir.h>
7477 int main() { return closedir(opendir(".")); }
7479 if $cc $ccflags $ldflags -o closedir closedir.c $libs > /dev/null 2>&1; then
7480 if ./closedir > /dev/null 2>&1 ; then
7481 echo "Yes, it does."
7484 echo "No, it doesn't."
7488 echo "(I can't seem to compile the test program--assuming it doesn't)"
7499 : check for volatile keyword
7501 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
7502 $cat >try.c <<'EOCP'
7505 typedef struct _goo_struct goo_struct;
7506 goo_struct * volatile goo = ((goo_struct *)0);
7507 struct _goo_struct {
7512 typedef unsigned short foo_t;
7515 volatile foo_t blech;
7519 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
7521 echo "Yup, it does."
7524 echo "Nope, it doesn't."
7530 : see if there is a wait4
7534 : see if waitpid exists
7535 set waitpid d_waitpid
7538 : see if wcstombs exists
7539 set wcstombs d_wcstombs
7542 : see if wctomb exists
7546 : preserve RCS keywords in files with variable substitution, grrr
7551 Revision='$Revision'
7553 : check for alignment requirements
7555 case "$alignbytes" in
7556 '') echo "Checking alignment constraints..." >&4
7557 $cat >try.c <<'EOCP'
7564 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
7567 if $cc $ccflags try.c -o try >/dev/null 2>&1; then
7571 echo"(I can't seem to compile the test program...)"
7574 *) dflt="$alignbytes"
7577 rp="Doubles must be aligned on a how-many-byte boundary?"
7582 : check for ordering of bytes in a long
7583 case "$byteorder" in
7587 In the following, larger digits indicate more significance. A big-endian
7588 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
7589 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
7590 machines may have weird orders like 3412. A Cray will report 87654321. If
7591 the test program works the default is probably right.
7592 I'm now running the test program...
7594 $cat >try.c <<'EOCP'
7601 char c[sizeof(long)];
7604 if (sizeof(long) > 4)
7605 u.l = (0x08070605L << 32) | 0x04030201L;
7608 for (i = 0; i < sizeof(long); i++)
7609 printf("%c", u.c[i]+'0');
7615 if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
7618 [1-4][1-4][1-4][1-4]|12345678|87654321)
7619 echo "(The test program ran ok.)"
7620 echo "byteorder=$dflt"
7623 ????|????????) echo "(The test program ran ok.)" ;;
7624 *) echo "(The test program didn't run right for some reason.)" ;;
7629 (I can't seem to compile the test program. Guessing big-endian...)
7632 case "$xxx_prompt" in
7634 rp="What is the order of bytes in a long?"
7645 : how do we catenate cpp tokens here?
7647 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
7648 $cat >cpp_stuff.c <<'EOCP'
7649 #define RCAT(a,b)a/**/b
7650 #define ACAT(a,b)a ## b
7654 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
7655 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
7656 echo "Oh! Smells like ANSI's been here."
7657 echo "We can catify or stringify, separately or together!"
7659 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
7660 echo "Ah, yes! The good old days!"
7661 echo "However, in the good old days we don't know how to stringify and"
7662 echo "catify at the same time."
7666 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
7667 to have to edit the values of CAT[2-5] in config.h...
7669 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
7673 : see if this is a db.h system
7679 : Check the return type needed for hash
7681 echo "Checking return type needed for hash for Berkeley DB ..." >&4
7687 #include <sys/types.h>
7689 u_int32_t hash_cb (ptr, size)
7697 info.hash = hash_cb;
7700 if $cc $ccflags -c try.c >try.out 2>&1 ; then
7701 if $contains warning try.out >>/dev/null 2>&1 ; then
7704 db_hashtype='u_int32_t'
7707 echo "I can't seem to compile the test program." >&4
7711 echo "Your version of Berkeley DB uses $db_hashtype for hash."
7719 : Check the return type needed for prefix
7721 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
7727 #include <sys/types.h>
7729 size_t prefix_cb (key1, key2)
7737 info.prefix = prefix_cb;
7740 if $cc $ccflags -c try.c >try.out 2>&1 ; then
7741 if $contains warning try.out >>/dev/null 2>&1 ; then
7744 db_prefixtype='size_t'
7747 echo "I can't seem to compile the test program." >&4
7751 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
7753 *) db_prefixtype='int'
7757 : check for void type
7759 echo "Checking to see how well your C compiler groks the void type..." >&4
7762 Support flag bits are:
7763 1: basic void declarations.
7764 2: arrays of pointers to functions returning void.
7765 4: operations between pointers to and addresses of void functions.
7766 8: generic void pointers.
7769 case "$voidflags" in
7771 $cat >try.c <<'EOCP'
7777 extern void moo(); /* function returning void */
7778 void (*goo)(); /* ptr to func returning void */
7780 void *hue; /* generic ptr */
7795 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
7796 voidflags=$defvoidused
7797 echo "It appears to support void to the level $package wants ($defvoidused)."
7798 if $contains warning .out >/dev/null 2>&1; then
7799 echo "However, you might get some warnings that look like this:"
7803 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
7804 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
7805 echo "It supports 1..."
7806 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
7807 echo "It also supports 2..."
7808 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
7810 echo "And it supports 4 but not 8 definitely."
7812 echo "It doesn't support 4..."
7813 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
7815 echo "But it supports 8."
7818 echo "Neither does it support 8."
7822 echo "It does not support 2..."
7823 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
7825 echo "But it supports 4 and 8."
7827 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
7829 echo "And it supports 4 but has not heard about 8."
7831 echo "However it supports 8 but not 4."
7836 echo "There is no support at all for void."
7841 : Only prompt user if support does not match the level we want
7842 case "$voidflags" in
7846 rp="Your void support flags add up to what?"
7853 : see what type file positions are declared as in the library
7854 set fpos_t fpostype long stdio.h sys/types.h
7858 rp="What is the type for file position used by fsetpos()?"
7862 : Store the full pathname to the sed program for use in the C program
7865 : see what type gids are declared as in the kernel
7866 set gid_t gidtype xxx stdio.h sys/types.h
7870 xxx=`./findhdr sys/user.h`
7871 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
7873 unsigned) dflt="$1 $2" ;;
7877 *) dflt="$gidtype";;
7880 rp="What is the type for group ids returned by getgid()?"
7884 : see if getgroups exists
7885 set getgroups d_getgrps
7888 : Find type of 2nd arg to getgroups
7890 case "$d_getgrps" in
7892 case "$groupstype" in
7893 '') dflt="$gidtype" ;;
7894 *) dflt="$groupstype" ;;
7897 What is the type of the second argument to getgroups()? Usually this
7898 is the same as group ids, $gidtype, but not always.
7901 rp='What type is the second argument to getgroups()?'
7905 *) groupstype="$gidtype";;
7911 # No dynamic loading being used, so don't bother even to prompt.
7914 *) case "$useshrplib" in
7915 '') case "$osname" in
7916 svr4|dgux|dynixptx|esix|powerux)
7918 also='Building a shared libperl is required for dynamic loading to work on your system.'
7923 also='Building a shared libperl is needed for MAB support.'
7941 The perl executable is normally obtained by linking perlmain.c with
7942 libperl${lib_ext}, any static extensions (usually just DynaLoader), and
7943 any other libraries needed on this system (such as -lm, etc.). Since
7944 your system supports dynamic loading, it is probably possible to build
7945 a shared libperl.$so. If you will have more than one executable linked
7946 to libperl.$so, this will significantly reduce the size of each
7947 executable, but it may have a noticeable affect on performance. The
7948 default is probably sensible for your system.
7951 rp="Build a shared libperl.$so (y/n)"
7956 # Why does next4 have to be so different?
7957 case "${osname}${osvers}" in
7958 next4*) xxx='DYLD_LIBRARY_PATH' ;;
7959 *) xxx='LD_LIBRARY_PATH' ;;
7963 To build perl, you must add the current working directory to your
7964 $xxx environtment variable before running make. You can do
7966 $xxx=\`pwd\`; export $xxx
7967 for Bourne-style shells, or
7969 for Csh-style shells. You *MUST* do this before running make.
7973 *) useshrplib='false' ;;
7978 case "$useshrplib" in
7982 # Figure out a good name for libperl.so. Since it gets stored in
7983 # a version-specific architecture-dependent library, the version
7984 # number isn't really that important, except for making cc/ld happy.
7986 # A name such as libperl5.so.3.1
7987 majmin="libperl5.$so.$patchlevel.$subversion"
7988 # A name such as libperl5.so.301
7989 majonly=`echo $patchlevel $subversion |
7990 $awk '{printf "%d%02d", $1, $2}'`
7991 majonly=libperl5.$so.$majonly
7992 # I'd prefer to keep the os-specific stuff here to a minimum, and
7993 # rely on figuring it out from the naming of libc.
7994 case "${osname}${osvers}" in
7997 # XXX How handle the --version stuff for MAB?
7999 *) # Try to guess based on whether libc has major.minor.
8001 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8002 *libc.$so.[0-9]*) dflt=$majonly ;;
8003 *) dflt=libperl5.$so ;;
8013 I need to select a good name for the shared libperl. If your system uses
8014 library names with major and minor numbers, then you might want something
8015 like $majmin. Alternatively, if your system uses a single version
8016 number for shared libraries, then you might want to use $majonly.
8017 Or, your system might be quite happy with a simple libperl5.$so.
8019 Since the shared libperl will get installed into a version-specific
8020 architecture-dependent directory, the version number of the shared perl
8021 library probably isn't important, so the default should be o.k.
8024 rp='What name do you want to give to the shared libperl?'
8027 echo "Ok, I'll use $libperl"
8030 libperl="libperl${lib_ext}"
8034 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8038 WARNING: Use of the shrpdir variable for the installation locaion of
8039 the shared libperl5.$so is not supported. It was never documented and
8040 will not work in this version. Let me (doughera@lafcol.lafayette.edu) know of any
8041 problems this may cause.
8047 But your current setting of $shrpdir is
8048 the default anyway, so it's harmless.
8053 And your current attempted setting of $shrpdir
8054 conflicts with the value of $archlibexp/CORE that
8055 installperl will use.
8062 : see what type lseek is declared as in the kernel
8063 set off_t lseektype long stdio.h sys/types.h
8067 rp="What type is lseek's offset on this system declared as?"
8074 make=`./loc make make $pth`
8076 /*) echo make is in $make. ;;
8077 ?:[\\/]*) echo make is in $make. ;;
8078 *) echo "I don't know where 'make' is, and my life depends on it." >&4
8079 echo "Go find a make program or fix your PATH setting!" >&4
8084 *) echo make is in $make. ;;
8087 $echo $n "Checking if your $make program sets \$(MAKE)... $c" >&4
8088 case "$make_set_make" in
8090 $sed 's/^X //' > testmake.mak << 'EOF'
8092 X @echo 'ac_maketemp="$(MAKE)"'
8094 : GNU make sometimes prints "make[1]: Entering...", which would confuse us.
8095 case "`$make -f testmake.mak 2>/dev/null`" in
8096 *ac_maketemp=*) make_set_make='#' ;;
8097 *) make_set_make="MAKE=$make" ;;
8102 case "$make_set_make" in
8103 '#') echo "Yup, it does." >&4 ;;
8104 *) echo "Nope, it doesn't." >&4 ;;
8107 : see what type is used for mode_t
8108 set mode_t modetype int stdio.h sys/types.h
8112 rp="What type is used for file modes?"
8116 : locate the preferred pager for this system
8130 '') dflt=/usr/ucb/more;;
8137 rp='What pager is used on your system?'
8141 : Cruising for prototypes
8143 echo "Checking out function prototypes..." >&4
8144 $cat >prototype.c <<'EOCP'
8145 main(int argc, char *argv[]) {
8148 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8149 echo "Your C compiler appears to support function prototypes."
8152 echo "Your C compiler doesn't seem to understand function prototypes."
8159 : check for size of random number generator
8163 echo "Checking to see how many bits your rand function produces..." >&4
8169 # include <unistd.h>
8172 # include <stdlib.h>
8175 $cat >>try.c <<'EOCP'
8179 register unsigned long tmp;
8180 register unsigned long max = 0L;
8182 for (i = 1000; i; i--) {
8183 tmp = (unsigned long)rand();
8184 if (tmp > max) max = tmp;
8186 for (i = 0; max; i++)
8191 if $cc try.c -o try >/dev/null 2>&1 ; then
8195 echo "(I can't seem to compile the test program...)"
8202 rp='How many bits does your rand() function produce?'
8207 : see if ar generates random libraries by itself
8209 echo "Checking how to generate random libraries on your machine..." >&4
8210 echo 'int bar1() { return bar2(); }' > bar1.c
8211 echo 'int bar2() { return 2; }' > bar2.c
8212 $cat > foo.c <<'EOP'
8213 main() { printf("%d\n", bar1()); exit(0); }
8215 $cc $ccflags -c bar1.c >/dev/null 2>&1
8216 $cc $ccflags -c bar2.c >/dev/null 2>&1
8217 $cc $ccflags -c foo.c >/dev/null 2>&1
8218 ar rc bar.a bar2.o bar1.o >/dev/null 2>&1
8219 if $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
8220 ./foobar >/dev/null 2>&1; then
8221 echo "ar appears to generate random libraries itself."
8224 elif ar ts bar.a >/dev/null 2>&1 &&
8225 $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
8226 ./foobar >/dev/null 2>&1; then
8227 echo "a table of contents needs to be added with 'ar ts'."
8234 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
8235 $test -f $ranlib || ranlib=''
8238 if $test -n "$ranlib"; then
8239 echo "your system has '$ranlib'; we'll use that."
8242 echo "your system doesn't seem to support random libraries"
8243 echo "so we'll use lorder and tsort to order the libraries."
8250 : see if sys/select.h has to be included
8251 set sys/select.h i_sysselct
8254 : see if we should include time.h, sys/time.h, or both
8256 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8257 $echo $n "I'm now running the test program...$c"
8258 $cat >try.c <<'EOCP'
8259 #include <sys/types.h>
8264 #ifdef SYSTIMEKERNEL
8267 #include <sys/time.h>
8270 #include <sys/select.h>
8279 struct timezone tzp;
8281 if (foo.tm_sec == foo.tm_sec)
8284 if (bar.tv_sec == bar.tv_sec)
8291 for s_timezone in '-DS_TIMEZONE' ''; do
8293 for s_timeval in '-DS_TIMEVAL' ''; do
8294 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8295 for i_time in '' '-DI_TIME'; do
8296 for i_systime in '-DI_SYSTIME' ''; do
8300 $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \
8301 try.c -o try >/dev/null 2>&1 ; then
8302 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8306 $echo $n "Succeeded with $flags$c"
8318 *SYSTIMEKERNEL*) i_systimek="$define"
8319 timeincl=`./findhdr sys/time.h`
8320 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8321 *) i_systimek="$undef";;
8324 *I_TIME*) i_time="$define"
8325 timeincl=`./findhdr time.h`" $timeincl"
8326 echo "We'll include <time.h>." >&4;;
8327 *) i_time="$undef";;
8330 *I_SYSTIME*) i_systime="$define"
8331 timeincl=`./findhdr sys/time.h`" $timeincl"
8332 echo "We'll include <sys/time.h>." >&4;;
8333 *) i_systime="$undef";;
8337 : check for fd_set items
8340 Checking to see how well your C compiler handles fd_set and friends ...
8342 $cat >fd_set.c <<EOCP
8343 #$i_systime I_SYS_TIME
8344 #$i_sysselct I_SYS_SELECT
8345 #$d_socket HAS_SOCKET
8346 #include <sys/types.h>
8348 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8351 #include <sys/time.h>
8354 #include <sys/select.h>
8364 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8371 if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
8372 d_fds_bits="$define"
8374 echo "Well, your system knows about the normal fd_set typedef..." >&4
8376 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8377 d_fd_macros="$define"
8380 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8382 d_fd_macros="$undef"
8386 Hmm, your compiler has some difficulty with fd_set. Checking further...
8388 if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
8391 echo "Well, your system has some sort of fd_set available..." >&4
8393 echo "and you have the normal fd_set macros." >&4
8394 d_fd_macros="$define"
8397 but not the normal fd_set macros! Gross! More work for me...
8399 d_fd_macros="$undef"
8402 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8405 d_fd_macros="$undef"
8411 : check for type of arguments to select. This will only really
8412 : work if the system supports prototypes and provides one for
8416 : Make initial guess
8417 case "$selecttype" in
8420 $define) xxx='fd_set *' ;;
8424 *) xxx="$selecttype"
8429 'fd_set *') yyy='int *' ;;
8430 'int *') yyy='fd_set *' ;;
8435 Checking to see what type of arguments are expected by select().
8438 #$i_systime I_SYS_TIME
8439 #$i_sysselct I_SYS_SELECT
8440 #$d_socket HAS_SOCKET
8441 #include <sys/types.h>
8443 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8446 #include <sys/time.h>
8449 #include <sys/select.h>
8454 Select_fd_set_t readfds;
8455 Select_fd_set_t writefds;
8456 Select_fd_set_t exceptfds;
8457 struct timeval timeout;
8458 select(width, readfds, writefds, exceptfds, &timeout);
8462 if $cc $ccflags -c -DSelect_fd_set_t="$xxx" try.c >/dev/null 2>&1 ; then
8464 echo "Your system uses $xxx for the arguments to select." >&4
8465 elif $cc $ccflags -c -DSelect_fd_set_t="$yyy" try.c >/dev/null 2>&1 ; then
8467 echo "Your system uses $yyy for the arguments to select." >&4
8469 rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
8476 *) selecttype='int *'
8480 : Trace out the files included by signal.h, then look for SIGxxx names.
8481 : Remove SIGARRAYSIZE used by HPUX.
8482 : Remove SIGTYP void lines used by OS2.
8483 xxx=`echo '#include <signal.h>' |
8484 $cppstdin $cppminus $cppflags 2>/dev/null |
8485 $grep '^[ ]*#.*include' |
8486 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
8487 : Check this list of files to be sure we have parsed the cpp output ok.
8488 : This will also avoid potentially non-existent files, such
8491 for xx in $xxx /dev/null ; do
8492 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
8494 : If we have found no files, at least try signal.h
8496 '') xxxfiles=`./findhdr signal.h` ;;
8499 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ {
8500 print substr($2, 4, 20)
8502 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
8503 print substr($3, 4, 20)
8505 : Append some common names just in case the awk scan failed.
8506 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
8507 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
8508 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
8509 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
8510 : generate a few handy files for later
8511 $cat > signal.c <<'EOP'
8512 #include <sys/types.h>
8516 /* Strange style to avoid deeply-nested #if/#else/#endif */
8519 # define NSIG (_NSIG)
8525 # define NSIG (SIGMAX+1)
8531 # define NSIG (SIG_MAX+1)
8537 # define NSIG (MAXSIG+1)
8543 # define NSIG (MAX_SIG+1)
8548 # ifdef SIGARRAYSIZE
8549 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
8555 # define NSIG (_sys_nsig) /* Solaris 2.5 */
8559 /* Default to some arbitrary number that's big enough to get most
8560 of the common signals.
8566 printf("NSIG %d\n", NSIG);
8569 echo $xxx | $tr ' ' '\012' | $sort | $uniq | $awk '
8571 printf "#ifdef SIG"; printf $1; printf "\n"
8572 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
8573 printf $1; printf ");\n"
8580 $cat >signal.awk <<'EOP'
8582 $1 ~ /^NSIG$/ { nsig = $2 }
8583 ($1 !~ /^NSIG$/) && (NF == 2) {
8584 if ($2 > maxsig) { maxsig = $2 }
8586 dup_name[ndups] = $1
8597 if (nsig == 0) { nsig = maxsig + 1 }
8598 for (n = 1; n < nsig; n++) {
8600 printf("%s %d\n", sig_name[n], sig_num[n])
8603 printf("NUM%d %d\n", n, n)
8606 for (n = 0; n < ndups; n++) {
8607 printf("%s %d\n", dup_name[n], dup_num[n])
8611 $cat >signal_cmd <<EOS
8613 $test -s signal.lst && exit 0
8614 if $cc $ccflags signal.c -o signal $ldflags >/dev/null 2>&1; then
8615 ./signal | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
8617 echo "(I can't seem be able to compile the test program -- Guessing)"
8618 echo 'kill -l' >signal
8619 set X \`csh -f <signal\`
8623 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
8625 echo \$@ | $tr ' ' '\012' | \
8626 $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
8628 $rm -f signal.c signal signal.o
8630 chmod a+x signal_cmd
8631 $eunicefix signal_cmd
8633 : generate list of signal names
8643 echo "Generating a list of signal names and numbers..." >&4
8645 sig_name=`$awk '{printf "%s ", $1}' signal.lst`
8646 sig_name="ZERO $sig_name"
8647 sig_num=`$awk '{printf "%d ", $2}' signal.lst`
8648 sig_num="0 $sig_num"
8651 echo "The following signals are available:"
8653 echo $sig_name | $awk \
8654 'BEGIN { linelen = 0 }
8656 for (i = 1; i <= NF; i++) {
8658 linelen = linelen + length(name)
8661 linelen = length(name)
8667 $rm -f signal signal.c signal.awk signal.lst signal_cmd
8669 : see what type is used for size_t
8670 set size_t sizetype 'unsigned int' stdio.h sys/types.h
8674 rp="What type is used for the length parameter for string functions?"
8678 : see what type is used for signed size_t
8679 set ssize_t ssizetype int stdio.h sys/types.h
8682 $cat > ssize.c <<EOM
8684 #include <sys/types.h>
8685 #define Size_t $sizetype
8686 #define SSize_t $dflt
8689 if (sizeof(Size_t) == sizeof(SSize_t))
8691 else if (sizeof(Size_t) == sizeof(int))
8699 if $cc $ccflags $ldflags -o ssize ssize.c $libs > /dev/null 2>&1 &&
8700 ./ssize > /dev/null 2>&1 ; then
8702 echo "I'll be using $ssizetype for functions returning a byte count." >&4
8704 echo "(I can't compile and run the test program--please enlighten me!)"
8707 I need a type that is the same size as $sizetype, but is guaranteed to
8708 be signed. Common values are int and long.
8711 rp="What signed type is the same size as $sizetype?"
8715 $rm -f ssize ssize.[co]
8717 : see what type of char stdio uses.
8719 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
8720 echo "Your stdio uses unsigned chars." >&4
8721 stdchar="unsigned char"
8723 echo "Your stdio uses signed chars." >&4
8727 : see if time exists
8729 if set time val -f d_time; eval $csym; $val; then
8730 echo 'time() found.' >&4
8732 set time_t timetype long stdio.h sys/types.h
8736 rp="What type is returned by time() on this system?"
8740 echo 'time() not found, hope that will do.' >&4
8747 : see what type uids are declared as in the kernel
8748 set uid_t uidtype xxx stdio.h sys/types.h
8752 xxx=`./findhdr sys/user.h`
8753 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
8755 unsigned) dflt="$1 $2" ;;
8759 *) dflt="$uidtype";;
8762 rp="What is the type for user ids returned by getuid()?"
8766 : see if dbm.h is available
8767 : see if dbmclose exists
8768 set dbmclose d_dbmclose
8771 case "$d_dbmclose" in
8781 *) set rpcsvc/dbm.h i_rpcsvcdbm
8786 *) echo "We won't be including <dbm.h>"
8796 : see if this is a sys/file.h system
8801 : do we need to include sys/file.h ?
8807 echo "We'll be including <sys/file.h>." >&4
8810 echo "We won't be including <sys/file.h>." >&4
8820 : see if fcntl.h is there
8825 : see if we can include fcntl.h
8831 echo "We'll be including <fcntl.h>." >&4
8835 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
8837 echo "We won't be including <fcntl.h>." >&4
8849 : see if this is an grp system
8853 : see if locale.h is available
8854 set locale.h i_locale
8857 : see if this is a math.h system
8861 : see if ndbm.h is available
8866 : see if dbm_open exists
8867 set dbm_open d_dbm_open
8869 case "$d_dbm_open" in
8872 echo "We won't be including <ndbm.h>"
8881 : see if net/errno.h is available
8886 : Unfortunately, it causes problems on some systems. Arrgh.
8892 #include <net/errno.h>
8898 if $cc $ccflags -c try.c >/dev/null 2>&1; then
8899 echo "We'll be including <net/errno.h>." >&4
8901 echo "We won't be including <net/errno.h>." >&4
8910 : get C preprocessor symbols handy
8912 $echo $n "Hmm... $c"
8913 echo $al | $tr ' ' '\012' >Cppsym.know
8925 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
8927 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
8930 unknown="\$unknown \$sym"
8940 echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
8942 exit 0; _ _ _ _\1\\ \1\\
8945 echo "exit 1; _ _ _" >>Cppsym\$\$
8946 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
8948 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
8954 $rm -f Cppsym\$\$ Cppsym2\$\$
8959 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
8961 : now check the C compiler for additional symbols
8967 for i in \`$cc -v -c tmp.c 2>&1\`
8970 -D*) echo "\$i" | $sed 's/^-D//';;
8971 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
8978 ./ccsym | $sort | $uniq >ccsym.raw
8979 $awk '/\=/ { print $0; next }
8980 { print $0"=1" }' ccsym.raw >ccsym.list
8981 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
8982 $comm -13 ccsym.true ccsym.list >ccsym.own
8983 $comm -12 ccsym.true ccsym.list >ccsym.com
8984 $comm -23 ccsym.true ccsym.list >ccsym.cpp
8987 if $test -z ccsym.raw; then
8988 echo "Your C compiler doesn't seem to define any symbol!" >&4
8990 echo "However, your C preprocessor defines the following ones:"
8993 if $test -s ccsym.com; then
8994 echo "Your C compiler and pre-processor define these symbols:"
8995 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
8998 $test "$silent" || sleep 1
9000 if $test -s ccsym.cpp; then
9001 $test "$also" && echo " "
9002 echo "Your C pre-processor ${also}defines the following $symbols:"
9003 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
9005 $test "$silent" || sleep 1
9007 if $test -s ccsym.own; then
9008 $test "$also" && echo " "
9009 echo "Your C compiler ${also}defines the following cpp variables:"
9010 $sed -e 's/\(.*\)=1/\1/' ccsym.own
9011 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
9012 $test "$silent" || sleep 1
9017 : see if this is a termio system
9021 if $test `./findhdr termios.h`; then
9022 set tcsetattr i_termios
9028 "$define") echo "You have POSIX termios.h... good!" >&4;;
9029 *) if ./Cppsym pyr; then
9030 case "`/bin/universe`" in
9031 ucb) if $test `./findhdr sgtty.h`; then
9033 echo "<sgtty.h> found." >&4
9035 echo "System is pyramid with BSD universe."
9036 echo "<sgtty.h> not found--you could have problems." >&4
9038 *) if $test `./findhdr termio.h`; then
9040 echo "<termio.h> found." >&4
9042 echo "System is pyramid with USG universe."
9043 echo "<termio.h> not found--you could have problems." >&4
9047 if $test `./findhdr termio.h`; then
9048 echo "<termio.h> found." >&4
9050 elif $test `./findhdr sgtty.h`; then
9051 echo "<sgtty.h> found." >&4
9054 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
9057 if $test `./findhdr sgtty.h`; then
9058 echo "<sgtty.h> found." >&4
9060 elif $test `./findhdr termio.h`; then
9061 echo "<termio.h> found." >&4
9064 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
9068 set i_termio; eval $setvar
9069 val=$val2; set i_sgtty; eval $setvar
9070 val=$val3; set i_termios; eval $setvar
9072 : see if stdarg is available
9074 if $test `./findhdr stdarg.h`; then
9075 echo "<stdarg.h> found." >&4
9078 echo "<stdarg.h> NOT found." >&4
9082 : see if varags is available
9084 if $test `./findhdr varargs.h`; then
9085 echo "<varargs.h> found." >&4
9087 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
9090 : set up the varargs testing programs
9091 $cat > varargs.c <<EOP
9096 #include <varargs.h>
9114 p = va_arg(ap, char *);
9119 $cat > varargs <<EOP
9121 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
9130 : now check which varargs header should be included
9135 if `./varargs I_STDARG`; then
9137 elif `./varargs I_VARARGS`; then
9142 if `./varargs I_VARARGS`; then
9149 echo "I could not find the definition for va_dcl... You have problems..." >&4
9150 val="$undef"; set i_stdarg; eval $setvar
9151 val="$undef"; set i_varargs; eval $setvar
9158 val="$define"; set i_stdarg; eval $setvar
9159 val="$undef"; set i_varargs; eval $setvar
9162 val="$undef"; set i_stdarg; eval $setvar
9163 val="$define"; set i_varargs; eval $setvar
9166 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
9170 : see if stddef is available
9171 set stddef.h i_stddef
9174 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
9175 set sys/filio.h i_sysfilio
9178 if $test `./findhdr sys/ioctl.h`; then
9180 echo '<sys/ioctl.h> found.' >&4
9183 if $test $i_sysfilio = "$define"; then
9184 echo '<sys/ioctl.h> NOT found.' >&4
9186 $test $i_sgtty = "$define" && xxx="sgtty.h"
9187 $test $i_termio = "$define" && xxx="termio.h"
9188 $test $i_termios = "$define" && xxx="termios.h"
9189 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
9195 : see if this is a sys/param system
9196 set sys/param.h i_sysparam
9199 : see if sys/resource.h has to be included
9200 set sys/resource.h i_sysresrc
9203 : see if sys/stat.h is available
9204 set sys/stat.h i_sysstat
9207 : see if sys/types.h has to be included
9208 set sys/types.h i_systypes
9211 : see if this is a sys/un.h system
9212 set sys/un.h i_sysun
9215 : see if this is a syswait system
9216 set sys/wait.h i_syswait
9219 : see if this is an utime system
9223 : see if this is a values.h system
9224 set values.h i_values
9227 : see if this is a vfork system
9238 : see if gdbm.h is available
9243 : see if gdbm_open exists
9244 set gdbm_open d_gdbm_open
9246 case "$d_gdbm_open" in
9249 echo "We won't be including <gdbm.h>"
9259 echo "Looking for extensions..." >&4
9261 : If we are using the old config.sh, known_extensions may contain
9262 : old or inaccurate or duplicate values.
9264 : We do not use find because it might not be available.
9265 : We do not just use MANIFEST because the user may have dropped
9266 : some additional extensions into the source tree and expect them
9269 if $test -f $xxx/$xxx.xs; then
9270 known_extensions="$known_extensions $xxx"
9272 if $test -d $xxx; then
9275 if $test -f $yyy/$yyy.xs; then
9276 known_extensions="$known_extensions $xxx/$yyy"
9283 set X $known_extensions
9285 known_extensions="$*"
9288 : Now see which are supported on this system.
9290 for xxx in $known_extensions ; do
9292 DB_File) case "$i_db" in
9293 $define) avail_ext="$avail_ext $xxx" ;;
9296 GDBM_File) case "$i_gdbm" in
9297 $define) avail_ext="$avail_ext $xxx" ;;
9300 NDBM_File) case "$i_ndbm" in
9301 $define) avail_ext="$avail_ext $xxx" ;;
9304 ODBM_File) case "${i_dbm}${i_rpcsvcdbm}" in
9305 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
9308 POSIX) case "$useposix" in
9309 true|define|y) avail_ext="$avail_ext $xxx" ;;
9312 Opcode) case "$useopcode" in
9313 true|define|y) avail_ext="$avail_ext $xxx" ;;
9316 Socket) case "$d_socket" in
9317 $define) avail_ext="$avail_ext $xxx" ;;
9320 *) avail_ext="$avail_ext $xxx"
9332 A number of extensions are supplied with $package. You may choose to
9333 compile these extensions for dynamic loading (the default), compile
9334 them into the $package executable (static loading), or not include
9335 them at all. Answer "none" to include no extensions.
9338 case "$dynamic_ext" in
9339 '') dflt="$avail_ext" ;;
9340 *) dflt="$dynamic_ext" ;;
9345 rp="What extensions do you wish to load dynamically?"
9348 none) dynamic_ext=' ' ;;
9349 *) dynamic_ext="$ans" ;;
9352 case "$static_ext" in
9354 : Exclude those already listed in dynamic linking
9356 for xxx in $avail_ext; do
9357 case " $dynamic_ext " in
9359 *) dflt="$dflt $xxx" ;;
9366 *) dflt="$static_ext"
9373 rp="What extensions do you wish to load statically?"
9376 none) static_ext=' ' ;;
9377 *) static_ext="$ans" ;;
9382 A number of extensions are supplied with $package. Answer "none"
9383 to include no extensions.
9386 case "$static_ext" in
9387 '') dflt="$avail_ext" ;;
9388 *) dflt="$static_ext" ;;
9394 rp="What extensions do you wish to include?"
9397 none) static_ext=' ' ;;
9398 *) static_ext="$ans" ;;
9403 set X $dynamic_ext $static_ext
9407 : Remove build directory name from cppstdin so it can be used from
9408 : either the present location or the final installed location.
9410 : Get out of the UU directory to get correct path name.
9414 echo "Stripping down cppstdin path name"
9420 : end of configuration questions
9422 echo "End of configuration questions."
9425 : back to where it started
9426 if test -d ../UU; then
9430 : configuration may be patched via a 'config.over' file
9431 if $test -f config.over; then
9434 rp='I see a config.over file. Do you wish to load it?'
9437 n*) echo "OK, I'll ignore it.";;
9439 echo "Configuration override changes have been loaded."
9444 : in case they want portability, strip down executable paths
9445 case "$d_portable" in
9448 echo "Stripping down executable paths..." >&4
9449 for file in $loclist $trylist; do
9455 : create config.sh file
9457 echo "Creating config.sh..." >&4
9458 $spitshell <<EOT >config.sh
9461 # This file was produced by running the Configure script. It holds all the
9462 # definitions figured out by Configure. Should you modify one of these values,
9463 # do not forget to propagate your changes by running "Configure -der". You may
9464 # instead choose to run each of the .SH files by yourself, or "Configure -S".
9467 # Configuration time: $cf_time
9468 # Configured by: $cf_by
9469 # Target system: $myuname
9479 Revision='$Revision'
9483 alignbytes='$alignbytes'
9484 aphostname='$aphostname'
9487 archlibexp='$archlibexp'
9488 archname='$archname'
9489 archobjs='$archobjs'
9497 byteorder='$byteorder'
9499 castflags='$castflags'
9502 cccdlflags='$cccdlflags'
9503 ccdlflags='$ccdlflags'
9506 cf_email='$cf_email'
9511 clocktype='$clocktype'
9513 compress='$compress'
9514 contains='$contains'
9518 cpp_stuff='$cpp_stuff'
9519 cppflags='$cppflags'
9521 cppminus='$cppminus'
9523 cppstdin='$cppstdin'
9524 cryptlib='$cryptlib'
9526 d_Gconvert='$d_Gconvert'
9527 d_access='$d_access'
9529 d_archlib='$d_archlib'
9530 d_attribut='$d_attribut'
9534 d_bsdpgrp='$d_bsdpgrp'
9536 d_casti32='$d_casti32'
9537 d_castneg='$d_castneg'
9538 d_charvspr='$d_charvspr'
9540 d_chroot='$d_chroot'
9541 d_chsize='$d_chsize'
9542 d_closedir='$d_closedir'
9546 d_cuserid='$d_cuserid'
9547 d_dbl_dig='$d_dbl_dig'
9548 d_difftime='$d_difftime'
9549 d_dirnamlen='$d_dirnamlen'
9550 d_dlerror='$d_dlerror'
9551 d_dlopen='$d_dlopen'
9552 d_dlsymun='$d_dlsymun'
9553 d_dosuid='$d_dosuid'
9555 d_eofnblk='$d_eofnblk'
9556 d_eunice='$d_eunice'
9557 d_fchmod='$d_fchmod'
9558 d_fchown='$d_fchown'
9560 d_fd_macros='$d_fd_macros'
9561 d_fd_set='$d_fd_set'
9562 d_fds_bits='$d_fds_bits'
9563 d_fgetpos='$d_fgetpos'
9564 d_flexfnam='$d_flexfnam'
9567 d_fpathconf='$d_fpathconf'
9568 d_fsetpos='$d_fsetpos'
9569 d_getgrps='$d_getgrps'
9570 d_gethent='$d_gethent'
9571 d_gethname='$d_gethname'
9572 d_getlogin='$d_getlogin'
9573 d_getpgrp2='$d_getpgrp2'
9574 d_getpgrp='$d_getpgrp'
9575 d_getppid='$d_getppid'
9576 d_getprior='$d_getprior'
9579 d_isascii='$d_isascii'
9580 d_killpg='$d_killpg'
9582 d_locconv='$d_locconv'
9586 d_mbstowcs='$d_mbstowcs'
9587 d_mbtowc='$d_mbtowc'
9588 d_memcmp='$d_memcmp'
9589 d_memcpy='$d_memcpy'
9590 d_memmove='$d_memmove'
9591 d_memset='$d_memset'
9593 d_mkfifo='$d_mkfifo'
9594 d_mktime='$d_mktime'
9596 d_msgctl='$d_msgctl'
9597 d_msgget='$d_msgget'
9598 d_msgrcv='$d_msgrcv'
9599 d_msgsnd='$d_msgsnd'
9600 d_mymalloc='$d_mymalloc'
9602 d_oldarchlib='$d_oldarchlib'
9603 d_oldsock='$d_oldsock'
9605 d_pathconf='$d_pathconf'
9607 d_phostname='$d_phostname'
9610 d_portable='$d_portable'
9612 d_pwchange='$d_pwchange'
9613 d_pwclass='$d_pwclass'
9614 d_pwcomment='$d_pwcomment'
9615 d_pwexpire='$d_pwexpire'
9616 d_pwquota='$d_pwquota'
9617 d_readdir='$d_readdir'
9618 d_readlink='$d_readlink'
9619 d_rename='$d_rename'
9620 d_rewinddir='$d_rewinddir'
9622 d_safebcpy='$d_safebcpy'
9623 d_safemcpy='$d_safemcpy'
9624 d_seekdir='$d_seekdir'
9625 d_select='$d_select'
9627 d_semctl='$d_semctl'
9628 d_semget='$d_semget'
9630 d_setegid='$d_setegid'
9631 d_seteuid='$d_seteuid'
9632 d_setlinebuf='$d_setlinebuf'
9633 d_setlocale='$d_setlocale'
9634 d_setpgid='$d_setpgid'
9635 d_setpgrp2='$d_setpgrp2'
9636 d_setpgrp='$d_setpgrp'
9637 d_setprior='$d_setprior'
9638 d_setregid='$d_setregid'
9639 d_setresgid='$d_setresgid'
9640 d_setresuid='$d_setresuid'
9641 d_setreuid='$d_setreuid'
9642 d_setrgid='$d_setrgid'
9643 d_setruid='$d_setruid'
9644 d_setsid='$d_setsid'
9648 d_shmatprototype='$d_shmatprototype'
9649 d_shmctl='$d_shmctl'
9651 d_shmget='$d_shmget'
9652 d_sigaction='$d_sigaction'
9653 d_sigsetjmp='$d_sigsetjmp'
9654 d_socket='$d_socket'
9655 d_sockpair='$d_sockpair'
9656 d_statblks='$d_statblks'
9657 d_stdio_cnt_lval='$d_stdio_cnt_lval'
9658 d_stdio_ptr_lval='$d_stdio_ptr_lval'
9659 d_stdiobase='$d_stdiobase'
9660 d_stdstdio='$d_stdstdio'
9661 d_strchr='$d_strchr'
9662 d_strcoll='$d_strcoll'
9663 d_strctcpy='$d_strctcpy'
9664 d_strerrm='$d_strerrm'
9665 d_strerror='$d_strerror'
9666 d_strxfrm='$d_strxfrm'
9667 d_suidsafe='$d_suidsafe'
9668 d_symlink='$d_symlink'
9669 d_syscall='$d_syscall'
9670 d_sysconf='$d_sysconf'
9671 d_sysernlst='$d_sysernlst'
9672 d_syserrlst='$d_syserrlst'
9673 d_system='$d_system'
9674 d_tcgetpgrp='$d_tcgetpgrp'
9675 d_tcsetpgrp='$d_tcsetpgrp'
9676 d_telldir='$d_telldir'
9679 d_truncate='$d_truncate'
9680 d_tzname='$d_tzname'
9684 d_void_closedir='$d_void_closedir'
9685 d_voidsig='$d_voidsig'
9686 d_voidtty='$d_voidtty'
9687 d_volatile='$d_volatile'
9688 d_vprintf='$d_vprintf'
9690 d_waitpid='$d_waitpid'
9691 d_wcstombs='$d_wcstombs'
9692 d_wctomb='$d_wctomb'
9695 db_hashtype='$db_hashtype'
9696 db_prefixtype='$db_prefixtype'
9697 defvoidused='$defvoidused'
9698 direntrytype='$direntrytype'
9701 dynamic_ext='$dynamic_ext'
9706 eunicefix='$eunicefix'
9709 extensions='$extensions'
9711 firstmakefile='$firstmakefile'
9713 fpostype='$fpostype'
9714 freetype='$freetype'
9715 full_csh='$full_csh'
9716 full_sed='$full_sed'
9718 gccversion='$gccversion'
9722 groupcat='$groupcat'
9723 groupstype='$groupstype'
9726 h_sysfile='$h_sysfile'
9730 i_bsdioctl='$i_bsdioctl'
9733 i_dirent='$i_dirent'
9740 i_limits='$i_limits'
9741 i_locale='$i_locale'
9742 i_malloc='$i_malloc'
9744 i_memory='$i_memory'
9746 i_neterrno='$i_neterrno'
9749 i_rpcsvcdbm='$i_rpcsvcdbm'
9752 i_stdarg='$i_stdarg'
9753 i_stddef='$i_stddef'
9754 i_stdlib='$i_stdlib'
9755 i_string='$i_string'
9756 i_sysdir='$i_sysdir'
9757 i_sysfile='$i_sysfile'
9758 i_sysfilio='$i_sysfilio'
9760 i_sysioctl='$i_sysioctl'
9761 i_sysndir='$i_sysndir'
9762 i_sysparam='$i_sysparam'
9763 i_sysresrc='$i_sysresrc'
9764 i_sysselct='$i_sysselct'
9765 i_syssockio='$i_syssockio'
9766 i_sysstat='$i_sysstat'
9767 i_systime='$i_systime'
9768 i_systimek='$i_systimek'
9769 i_systimes='$i_systimes'
9770 i_systypes='$i_systypes'
9772 i_syswait='$i_syswait'
9773 i_termio='$i_termio'
9774 i_termios='$i_termios'
9776 i_unistd='$i_unistd'
9778 i_values='$i_values'
9779 i_varargs='$i_varargs'
9780 i_varhdr='$i_varhdr'
9784 installarchlib='$installarchlib'
9785 installbin='$installbin'
9786 installman1dir='$installman1dir'
9787 installman3dir='$installman3dir'
9788 installprivlib='$installprivlib'
9789 installscript='$installscript'
9790 installsitearch='$installsitearch'
9791 installsitelib='$installsitelib'
9793 known_extensions='$known_extensions'
9797 lddlflags='$lddlflags'
9805 libswanted='$libswanted'
9811 locincpth='$locincpth'
9812 loclibpth='$loclibpth'
9816 lseektype='$lseektype'
9820 make_set_make='$make_set_make'
9821 mallocobj='$mallocobj'
9822 mallocsrc='$mallocsrc'
9823 malloctype='$malloctype'
9825 man1direxp='$man1direxp'
9828 man3direxp='$man3direxp'
9832 mips_type='$mips_type'
9835 modetype='$modetype'
9838 myarchname='$myarchname'
9839 mydomain='$mydomain'
9840 myhostname='$myhostname'
9844 nm_so_opt='$nm_so_opt'
9846 o_nonblock='$o_nonblock'
9848 oldarchlib='$oldarchlib'
9849 oldarchlibexp='$oldarchlibexp'
9850 optimize='$optimize'
9851 orderlib='$orderlib'
9857 patchlevel='$patchlevel'
9858 path_sep='$path_sep'
9860 perladmin='$perladmin'
9861 perlpath='$perlpath'
9863 phostname='$phostname'
9868 prefixexp='$prefixexp'
9870 privlibexp='$privlibexp'
9871 prototype='$prototype'
9872 randbits='$randbits'
9874 rd_nodata='$rd_nodata'
9878 scriptdir='$scriptdir'
9879 scriptdirexp='$scriptdirexp'
9881 selecttype='$selecttype'
9882 sendmail='$sendmail'
9885 sharpbang='$sharpbang'
9886 shmattype='$shmattype'
9888 sig_name='$sig_name'
9890 signal_t='$signal_t'
9891 sitearch='$sitearch'
9892 sitearchexp='$sitearchexp'
9894 sitelibexp='$sitelibexp'
9895 sizetype='$sizetype'
9900 sockethdr='$sockethdr'
9901 socketlib='$socketlib'
9903 spackage='$spackage'
9904 spitshell='$spitshell'
9906 ssizetype='$ssizetype'
9907 startperl='$startperl'
9909 static_ext='$static_ext'
9911 stdio_base='$stdio_base'
9912 stdio_bufsiz='$stdio_bufsiz'
9913 stdio_cnt='$stdio_cnt'
9914 stdio_filbuf='$stdio_filbuf'
9915 stdio_ptr='$stdio_ptr'
9918 subversion='$subversion'
9924 timeincl='$timeincl'
9925 timetype='$timetype'
9933 usemymalloc='$usemymalloc'
9935 useopcode='$useopcode'
9936 useperlio='$useperlio'
9937 useposix='$useposix'
9939 useshrplib='$useshrplib'
9940 usevfork='$usevfork'
9944 voidflags='$voidflags'
9950 : add special variables
9951 $test -f patchlevel.h && \
9952 awk '/^#define/ {printf "%s=%s\n",$2,$3}' patchlevel.h >>config.sh
9953 echo "CONFIG=true" >>config.sh
9955 : propagate old symbols
9956 if $test -f UU/config.sh; then
9957 <UU/config.sh sort | uniq >UU/oldconfig.sh
9958 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
9959 sort | uniq -u >UU/oldsyms
9960 set X `cat UU/oldsyms`
9966 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
9968 echo "# Variables propagated from previous config.sh file." >>config.sh
9969 for sym in `cat UU/oldsyms`; do
9970 echo " Propagating $hint variable "'$'"$sym..."
9971 eval 'tmp="$'"${sym}"'"'
9973 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
9979 : Finish up by extracting the .SH files
9993 If you'd like to make any changes to the config.sh file before I begin
9994 to configure things, do it as a shell escape now (e.g. !vi config.sh).
9997 rp="Press return or use a shell escape to edit config.sh:"
10002 *) : in case they cannot read
10003 sh 1>&4 -c "$ans";;
10008 : if this fails, just run all the .SH files by hand
10015 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
10022 Now you need to generate make dependencies by running "make depend".
10023 You might prefer to run it in background: "make depend > makedepend.out &"
10024 It can take a while, so you might not want to run it right now.
10029 rp="Run make depend now?"
10033 make depend && echo "Now you must run a make."
10036 echo "You must run 'make depend' then 'make'."
10039 elif test -f [Mm]akefile; then
10041 echo "Now you must run a make."
10046 $rm -f kit*isdone ark*isdone