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 30 11:30:25 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
1606 : Older versions did not always set $sh. Catch re-use of such
1615 if test ! -f config.sh; then
1618 First time through, eh? I have some defaults handy for the following systems:
1621 cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4
1623 : Half the following guesses are probably wrong... If you have better
1624 : tests or hints, please send them to doughera@lafcol.lafayette.edu
1625 : The metaconfig authors would also appreciate a copy...
1626 $test -f /irix && osname=irix
1627 $test -f /xenix && osname=sco_xenix
1628 $test -f /dynix && osname=dynix
1629 $test -f /dnix && osname=dnix
1630 $test -f /unicos && osname=unicos && osvers=`$uname -r`
1631 $test -f /bin/mips && /bin/mips && osname=mips
1632 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1633 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1634 $test -d /usr/apollo/bin && osname=apollo
1635 $test -f /etc/saf/_sactab && osname=svr4
1636 $test -d /usr/include/minix && osname=minix
1637 if $test -d /MachTen; then
1639 if $test -x /sbin/version; then
1640 osvers=`/sbin/version | $awk '{print $2}' |
1641 $sed -e 's/[A-Za-z]$//'`
1642 elif $test -x /usr/etc/version; then
1643 osvers=`/usr/etc/version | $awk '{print $2}' |
1644 $sed -e 's/[A-Za-z]$//'`
1649 if $test -f $uname; then
1657 umips) osname=umips ;;
1660 [23]100) osname=mips ;;
1661 next*) osname=next ;;
1662 news*) osname=news ;;
1664 if $test -f /etc/kconfig; then
1666 if test "$lns" = "ln -s"; then
1668 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1670 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
1679 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
1681 'not found') osvers="$4"."$3" ;;
1682 '<3240'|'<>3240') osvers=3.2.0 ;;
1683 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
1684 '=3250'|'>3250') osvers=3.2.5 ;;
1691 domainos) osname=apollo
1697 dynixptx*) osname=dynixptx
1700 freebsd) osname=freebsd
1702 genix) osname=genix ;;
1707 *.10.*) osvers=10 ;;
1724 netbsd*) osname=netbsd
1727 bsd386) osname=bsd386
1730 next*) osname=next ;;
1731 solaris) osname=solaris
1733 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1740 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1744 titanos) osname=titanos
1753 ultrix) osname=ultrix
1759 osvers=`echo "$3" | sed 's/^[vt]//'`
1761 hp*) osname=hp_osf1 ;;
1762 mips) osname=mips_osf1 ;;
1768 $2) case "$osname" in
1772 : svr4.x or possibly later
1782 if test -f /stand/boot ; then
1783 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
1784 if test -n "$INITPROG" -a -f "$INITPROG"; then
1785 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
1786 if test -n "$isesix"; then
1794 *) if test -f /etc/systemid; then
1796 set `echo $3 | $sed 's/\./ /g'` $4
1797 if $test -f sco_$1_$2_$3.sh; then
1799 elif $test -f sco_$1_$2.sh; then
1801 elif $test -f sco_$1.sh; then
1806 '') : Still unknown. Probably a generic Sys V.
1815 *) case "$osname" in
1816 '') : Still unknown. Probably a generic BSD.
1824 if test -f /vmunix -a -f news_os.sh; then
1825 (what /vmunix | ../UU/tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1
1826 if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then
1829 $rm -f ../UU/kernel.what
1830 elif test -d c:/.; then
1837 : Now look for a hint file osname_osvers, unless one has been
1838 : specified already.
1841 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
1842 : Also try without trailing minor version numbers.
1843 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
1844 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
1845 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
1846 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
1849 *) case "$osvers" in
1852 *) if $test -f $file.sh ; then
1854 elif $test -f $xfile.sh ; then
1856 elif $test -f $xxfile.sh ; then
1858 elif $test -f $xxxfile.sh ; then
1860 elif $test -f $xxxxfile.sh ; then
1862 elif $test -f "${osname}.sh" ; then
1873 dflt=`echo $hintfile | $sed 's/\.sh$//'`
1879 You may give one or more space-separated answers, or "none" if appropriate.
1880 If your OS version has no hints, DO NOT give a wrong version -- say "none".
1883 rp="Which of these apply, if any?"
1886 for file in $tans; do
1887 if $test -f $file.sh; then
1889 $cat $file.sh >> ../UU/config.sh
1890 elif $test X$tans = X -o X$tans = Xnone ; then
1893 : Give one chance to correct a possible typo.
1894 echo "$file.sh does not exist"
1896 rp="hint to use instead?"
1898 for file in $ans; do
1899 if $test -f "$file.sh"; then
1901 $cat $file.sh >> ../UU/config.sh
1902 elif $test X$ans = X -o X$ans = Xnone ; then
1905 echo "$file.sh does not exist -- ignored."
1912 : Remember our hint file for later.
1913 if $test -f "$file.sh" ; then
1925 echo "Fetching default answers from $config_sh..." >&4
1929 cp $config_sh config.sh 2>/dev/null
1939 test "$override" && . ./optdef.sh
1940 myuname="$newmyuname"
1942 : Restore computed paths
1943 for file in $loclist $trylist; do
1944 eval $file="\$_$file"
1949 Configure uses the operating system name and version to set some defaults.
1950 The default value is probably right if the name rings a bell. Otherwise,
1951 since spelling matters for me, either accept the default or answer "none"
1958 ''|' '|none) dflt=none ;;
1959 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
1962 *) dflt="$osname" ;;
1964 rp="Operating system name?"
1968 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
1974 ''|' '|none) dflt=none ;;
1975 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
1976 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
1978 ''|' ') dflt=none ;;
1983 *) dflt="$osvers" ;;
1985 rp="Operating system version?"
1994 : who configured the system
1995 cf_time=`$date 2>&1`
1996 cf_by=`(logname) 2>/dev/null`
1997 case "$cf_by" in "")
1998 cf_by=`(whoami) 2>/dev/null`
1999 case "$cf_by" in "")
2004 : determine the architecture name
2006 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
2007 tarch=`arch`"-$osname"
2008 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
2009 if uname -m > tmparch 2>&1 ; then
2010 tarch=`$sed -e 's/ /_/g' -e 's/$/'"-$osname/" tmparch`
2018 case "$myarchname" in
2021 echo "(Your architecture name used to be $myarchname.)"
2027 *) dflt="$archname";;
2029 rp='What is your architecture name'
2036 if test -d /afs; then
2037 echo "AFS may be running... I'll be extra cautious then..." >&4
2040 echo "AFS does not seem to be running..." >&4
2044 : decide how portable to be. Allow command line overrides.
2045 case "$d_portable" in
2047 *) d_portable="$define" ;;
2050 : set up shell script to do ~ expansion
2056 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2059 if $test -f /bin/csh; then
2060 /bin/csh -f -c "glob \$1"
2065 name=\`$expr x\$1 : '..\([^/]*\)'\`
2066 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2067 if $test ! -d "\$dir"; then
2069 echo "\$me: can't locate home directory for: \$name" >&2
2074 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2090 : now set up to get a file name
2091 cat <<'EOSC' >getfile
2104 expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
2105 fn=`echo $fn | sed 's/(.*)//'`
2111 loc_file=`expr $fn : '.*:\(.*\)'`
2112 fn=`expr $fn : '\(.*\):.*'`
2120 */*) fullpath=true;;
2129 *e*) exp_file=true;;
2132 *p*) nopath_ok=true;;
2137 *d*) type='Directory';;
2138 *l*) type='Locate';;
2143 Locate) what='File';;
2148 case "$d_portable" in
2156 while test "$type"; do
2161 true) rp="$rp (~name ok)";;
2164 if test -f UU/getfile.ok && \
2165 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2184 value=`UU/filexp $ans`
2187 if test "$ans" != "$value"; then
2188 echo "(That expands to $value on this system.)"
2202 /*) value="$ansexp" ;;
2207 echo "I shall only accept a full path name, as in /bin/ls." >&4
2208 echo "Use a ! shell escape if you wish to check pathnames." >&4
2211 echo "Please give a full path name, starting with slash." >&4
2214 echo "Note that using ~name is ok provided it expands well." >&4
2227 if test -f "$ansexp"; then
2229 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2231 echo "($value is not a plain file, but that's ok.)"
2236 if test -d "$ansexp"; then
2241 if test -d "$ansexp"; then
2242 echo "(Looking for $loc_file in directory $value.)"
2243 value="$value/$loc_file"
2244 ansexp="$ansexp/$loc_file"
2246 if test -f "$ansexp"; then
2249 case "$nopath_ok" in
2250 true) case "$value" in
2252 *) echo "Assuming $value will be in people's path."
2268 if test "$fastread" = yes; then
2273 rp="$what $value doesn't exist. Use that name anyway?"
2294 : determine root of directory hierarchy where package will be installed.
2297 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
2305 By default, $package will be installed in $dflt/bin, manual
2306 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2307 all installation directories. Typically set to /usr/local, but you
2308 may choose /usr if you wish to install $package among your system
2309 binaries. If you wish to have binaries under /bin but manual pages
2310 under /usr/local/man, that's ok: you will be prompted separately
2311 for each of the installation directories, the prefix being only used
2312 to set the defaults.
2316 rp='Installation prefix to use?'
2324 *) oldprefix="$prefix";;
2331 : set the prefixit variable, to compute a suitable default value
2332 prefixit='case "$3" in
2334 case "$oldprefix" in
2335 "") eval "$1=\"\$$2\"";;
2342 ""|" ") eval "$1=\"\$$2\"";;
2348 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
2350 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
2351 /*-$oldprefix/*|\~*-$oldprefix/*)
2352 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
2353 *) eval "$1=\"\$$2\"";;
2357 : determine where private library files go
2358 : Usual default is /usr/local/lib/perl5. Also allow things like
2359 : /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
2361 *perl*) set dflt privlib lib ;;
2362 *) set dflt privlib lib/$package ;;
2367 There are some auxiliary files for $package that need to be put into a
2368 private library directory that is accessible by everyone.
2372 rp='Pathname where the private library files will reside?'
2374 if $test "X$privlibexp" != "X$ansexp"; then
2378 privlibexp="$ansexp"
2382 Since you are running AFS, I need to distinguish the directory in which
2383 private files reside from the directory in which they are installed (and from
2384 which they are presumably copied to the former directory by occult means).
2387 case "$installprivlib" in
2388 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
2389 *) dflt="$installprivlib";;
2392 rp='Where will private files be installed?'
2394 installprivlib="$ans"
2396 installprivlib="$privlibexp"
2399 : set the base revision
2402 : get the patchlevel
2404 echo "Getting the current patchlevel..." >&4
2405 if $test -r ../patchlevel.h;then
2406 patchlevel=`awk '/PATCHLEVEL/ {print $3}' ../patchlevel.h`
2407 subversion=`awk '/SUBVERSION/ {print $3}' ../patchlevel.h`
2412 echo "(You have $package $baserev patchlevel $patchlevel subversion $subversion.)"
2414 : set the prefixup variable, to restore leading tilda escape
2415 prefixup='case "$prefixexp" in
2417 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
2420 : determine where public architecture dependent libraries go
2426 '') dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
2430 *) version=`LC_ALL=C;export LC_ALL;\
2431 echo $baserev $patchlevel $subversion | \
2432 $awk '{print $1 + $2/1000.0 + $3/100000.0}'`
2433 dflt="$privlib/$archname/$version"
2437 *) dflt="$archlib";;
2441 $spackage contains architecture-dependent library files. If you are
2442 sharing libraries in a heterogeneous environment, you might store
2443 these files in a separate location. Otherwise, you can just include
2444 them with the rest of the public library files.
2448 rp='Where do you want to put the public architecture-dependent libraries?'
2451 archlibexp="$ansexp"
2456 Since you are running AFS, I need to distinguish the directory in which
2457 private files reside from the directory in which they are installed (and from
2458 which they are presumably copied to the former directory by occult means).
2461 case "$installarchlib" in
2462 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
2463 *) dflt="$installarchlib";;
2466 rp='Where will architecture-dependent library files be installed?'
2468 installarchlib="$ans"
2470 installarchlib="$archlibexp"
2472 if $test X"$archlib" = X"$privlib"; then
2478 : set up the script used to warn in case of inconsistency
2482 echo "*** WHOA THERE!!! ***" >&4
2483 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2484 rp=" Keep the $hint value?"
2487 y) td=$was; tu=$was;;
2491 : function used to set $1 to $val
2492 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2494 $define$undef) . ./whoa; eval "$var=\$td";;
2495 $undef$define) . ./whoa; eval "$var=\$tu";;
2496 *) eval "$var=$val";;
2499 : make some quick guesses about what we are up against
2501 $echo $n "Hmm... $c"
2511 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2512 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2514 echo "Looks kind of like an OSF/1 system, but we'll see..."
2516 elif test `echo abc | tr a-z A-Z` = Abc ; then
2517 xxx=`./loc addbib blurfl $pth`
2518 if $test -f $xxx; then
2519 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2523 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2524 echo "Looks kind of like an extended USG system, but we'll see..."
2526 echo "Looks kind of like a USG system, but we'll see..."
2530 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2531 echo "Looks kind of like a BSD system, but we'll see..."
2535 echo "Looks kind of like a Version 7 system, but we'll see..."
2538 case "$eunicefix" in
2541 There is, however, a strange, musty smell in the air that reminds me of
2542 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2546 : it so happens the Eunice I know will not run shell scripts in Unix format
2550 echo "Congratulations. You aren't running Eunice."
2554 : Detect OS2. The p_ variable is set above in the Head.U unit.
2559 I have the feeling something is not exactly right, however...don't tell me...
2560 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2565 if test -f /xenix; then
2566 echo "Actually, this looks more like a XENIX system..."
2571 echo "It's not Xenix..."
2576 if test -f /venix; then
2577 echo "Actually, this looks more like a VENIX system..."
2584 echo "Nor is it Venix..."
2587 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2588 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2591 : see if setuid scripts can be secure
2594 Some kernels have a bug that prevents setuid #! scripts from being
2595 secure. Some sites have disabled setuid #! scripts because of this.
2597 First let's decide if your kernel supports secure setuid #! scripts.
2598 (If setuid #! scripts would be secure but have been disabled anyway,
2599 don't say that they are secure if asked.)
2604 if $test -d /dev/fd; then
2605 echo "#!$ls" >reflect
2606 chmod +x,u+s reflect
2607 ./reflect >flect 2>&1
2608 if $contains "/dev/fd" flect >/dev/null; then
2609 echo "Congratulations, your kernel has secure setuid scripts!" >&4
2613 If you are not sure if they are secure, I can check but I'll need a
2614 username and password different from the one you are using right now.
2615 If you don't have such a username or don't want me to test, simply
2619 rp='Other username to test security of setuid scripts with?'
2624 case "$d_suidsafe" in
2625 '') echo "I'll assume setuid scripts are *not* secure." >&4
2628 echo "Well, the $hint value is *not* secure." >&4
2630 *) echo "Well, the $hint value *is* secure." >&4
2635 $rm -f reflect flect
2636 echo "#!$ls" >reflect
2637 chmod +x,u+s reflect
2640 echo '"su" will (probably) prompt you for '"$ans's password."
2641 su $ans -c './reflect >flect'
2642 if $contains "/dev/fd" flect >/dev/null; then
2643 echo "Okay, it looks like setuid scripts are secure." >&4
2646 echo "I don't think setuid scripts are secure." >&4
2651 rp='Does your kernel have *secure* setuid scripts?'
2654 [yY]*) val="$define";;
2659 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
2660 echo "(That's for file descriptors, not floppy disks.)"
2666 $rm -f reflect flect
2668 : now see if they want to do setuid emulation
2671 case "$d_suidsafe" in
2674 echo "No need to emulate SUID scripts since they are secure here." >& 4
2678 Some systems have disabled setuid scripts, especially systems where
2679 setuid scripts cannot be secure. On systems where setuid scripts have
2680 been disabled, the setuid/setgid bits on scripts are currently
2681 useless. It is possible for $package to detect those bits and emulate
2682 setuid/setgid in a secure fashion. This emulation will only work if
2683 setuid scripts have been disabled in your kernel.
2687 "$define") dflt=y ;;
2690 rp="Do you want to do setuid/setgid emulation?"
2693 [yY]*) val="$define";;
2701 : determine where site specific libraries go.
2705 '') dflt="$privlib/site_perl" ;;
2706 *) dflt="$sitelib" ;;
2710 The installation process will also create a directory for
2711 site-specific extensions and modules. Some users find it convenient
2712 to place all local files in this directory rather than in the main
2713 distribution directory.
2717 rp='Pathname for the site-specific library files?'
2719 if $test "X$sitelibexp" != "X$ansexp"; then
2723 sitelibexp="$ansexp"
2727 Since you are running AFS, I need to distinguish the directory in which
2728 private files reside from the directory in which they are installed (and from
2729 which they are presumably copied to the former directory by occult means).
2732 case "$installsitelib" in
2733 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
2734 *) dflt="$installsitelib";;
2737 rp='Where will private files be installed?'
2739 installsitelib="$ans"
2741 installsitelib="$sitelibexp"
2744 : determine where site specific architecture-dependent libraries go.
2745 xxx=`echo $sitelib/$archname | sed 's!^$prefix!!'`
2746 : xxx is usuually lib/site_perl/archname.
2747 set sitearch sitearch none
2750 '') dflt="$sitelib/$archname" ;;
2751 *) dflt="$sitearch" ;;
2755 The installation process will also create a directory for
2756 architecture-dependent site-specific extensions and modules.
2760 rp='Pathname for the site-specific architecture-dependent library files?'
2762 if $test "X$sitearchexp" != "X$ansexp"; then
2766 sitearchexp="$ansexp"
2770 Since you are running AFS, I need to distinguish the directory in which
2771 private files reside from the directory in which they are installed (and from
2772 which they are presumably copied to the former directory by occult means).
2775 case "$installsitearch" in
2776 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
2777 *) dflt="$installsitearch";;
2780 rp='Where will private files be installed?'
2782 installsitearch="$ans"
2784 installsitearch="$sitearchexp"
2787 : determine where old public architecture dependent libraries might be
2788 case "$oldarchlib" in
2789 '') case "$privlib" in
2791 *) dflt="$privlib/$archname"
2795 *) dflt="$oldarchlib"
2798 if $test ! -d "$dflt/auto"; then
2803 In 5.001, Perl stored architecture-dependent library files in a directory
2804 with a name such as $privlib/$archname,
2805 and this directory contained files from the standard extensions and
2806 files from any additional extensions you might have added. Starting
2807 with version 5.002, all the architecture-dependent standard extensions
2808 will go into a version-specific directory such as
2810 while locally-added extensions will go into
2813 If you wish Perl to continue to search the old architecture-dependent
2814 library for your local extensions, give the path to that directory.
2815 If you do not wish to use your old architecture-dependent library
2816 files, answer 'none'.
2820 rp='Directory for your old 5.001 architecture-dependent libraries?'
2823 oldarchlibexp="$ansexp"
2824 case "$oldarchlib" in
2825 ''|' ') val="$undef" ;;
2831 : determine where public executables go
2836 rp='Pathname where the public executables will reside?'
2838 if $test "X$ansexp" != "X$binexp"; then
2846 Since you are running AFS, I need to distinguish the directory in which
2847 executables reside from the directory in which they are installed (and from
2848 which they are presumably copied to the former directory by occult means).
2851 case "$installbin" in
2852 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
2853 *) dflt="$installbin";;
2856 rp='Where will public executables be installed?'
2860 installbin="$binexp"
2863 : determine where manual pages are on this system
2867 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2868 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2869 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2870 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2871 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2872 sysman=`./loc . /usr/man/man1 $syspath`
2875 if $test -d "$sysman"; then
2876 echo "System manual is in $sysman." >&4
2878 echo "Could not find manual pages in source form." >&4
2881 : determine where manual pages go
2882 set man1dir man1dir none
2886 $spackage has manual pages available in source form.
2890 echo "However, you don't have nroff, so they're probably useless to you."
2892 '') man1dir="none";;
2895 echo "If you don't want the manual sources installed, answer 'none'."
2900 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
2901 lookpath="$lookpath $prefixexp/man/p_man/man1"
2902 lookpath="$lookpath $prefixexp/man/u_man/man1"
2903 lookpath="$lookpath $prefixexp/man/man.1"
2904 : If prefix contains 'perl' then we want to keep the man pages
2905 : under the prefix directory. Otherwise, look in a variety of
2906 : other possible places. This is debatable, but probably a
2907 : good compromise. Well, apparently not.
2908 : Experience has shown people expect man1dir to be under prefix,
2909 : so we now always put it there. Users who want other behavior
2910 : can answer interactively or use a command line option.
2911 : Does user have System V-style man paths.
2913 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
2914 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
2924 rp="Where do the main $spackage manual pages (source) go?"
2926 if $test "X$man1direxp" != "X$ansexp"; then
2930 man1direxp="$ansexp"
2938 Since you are running AFS, I need to distinguish the directory in which
2939 manual pages reside from the directory in which they are installed (and from
2940 which they are presumably copied to the former directory by occult means).
2943 case "$installman1dir" in
2944 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
2945 *) dflt="$installman1dir";;
2948 rp='Where will man pages be installed?'
2950 installman1dir="$ans"
2952 installman1dir="$man1direxp"
2955 : What suffix to use on installed man pages
2962 rp="What suffix should be used for the main $spackage man pages?"
2964 '') case "$man1dir" in
2978 *) dflt="$man1ext";;
2985 : see if we can have long filenames
2987 rmlist="$rmlist /tmp/cf$$"
2988 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
2989 first=123456789abcdef
2990 second=/tmp/cf$$/$first
2991 $rm -f $first $second
2992 if (echo hi >$first) 2>/dev/null; then
2993 if $test -f 123456789abcde; then
2994 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
2997 if (echo hi >$second) 2>/dev/null; then
2998 if $test -f /tmp/cf$$/123456789abcde; then
3000 That's peculiar... You can have filenames longer than 14 characters, but only
3001 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
3002 I shall consider your system cannot support long filenames at all.
3006 echo 'You can have filenames longer than 14 characters.' >&4
3011 How confusing! Some of your filesystems are sane enough to allow filenames
3012 longer than 14 characters but some others like /tmp can't even think about them.
3013 So, for now on, I shall assume your kernel does not allow them at all.
3020 You can't have filenames longer than 14 chars. You can't even think about them!
3026 $rm -rf /tmp/cf$$ 123456789abcde*
3028 : determine where library module manual pages go
3029 set man3dir man3dir none
3033 $spackage has manual pages for many of the library modules.
3039 However, you don't have nroff, so they're probably useless to you.
3040 You can use the supplied perldoc script instead.
3043 '') man3dir="none";;
3047 case "$d_flexfnam" in
3050 However, your system can't handle the long file names like File::Basename.3.
3051 You can use the supplied perldoc script instead.
3054 '') man3dir="none";;
3058 echo "If you don't want the manual sources installed, answer 'none'."
3059 : We dont use /usr/local/man/man3 because some man programs will
3060 : only show the /usr/local/man/man3 contents, and not the system ones,
3061 : thus man less will show the perl module less.pm, but not the system
3062 : less command. We might also conflict with TCL man pages.
3063 : However, something like /opt/perl/man/man3 is fine.
3065 '') case "$prefix" in
3066 *perl*) dflt=`echo $man1dir |
3067 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
3068 *) dflt="$privlib/man/man3" ;;
3072 *) dflt="$man3dir" ;;
3077 rp="Where do the $spackage library man pages (source) go?"
3079 if test "X$man3direxp" != "X$ansexp"; then
3084 man3direxp="$ansexp"
3092 Since you are running AFS, I need to distinguish the directory in which
3093 manual pages reside from the directory in which they are installed (and from
3094 which they are presumably copied to the former directory by occult means).
3097 case "$installman3dir" in
3098 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
3099 *) dflt="$installman3dir";;
3102 rp='Where will man pages be installed?'
3104 installman3dir="$ans"
3106 installman3dir="$man3direxp"
3109 : What suffix to use on installed man pages
3116 rp="What suffix should be used for the $spackage library man pages?"
3118 '') case "$man3dir" in
3132 *) dflt="$man3ext";;
3139 : see what memory models we can support
3142 $cat >pdp11.c <<'EOP'
3151 cc -o pdp11 pdp11.c >/dev/null 2>&1
3152 if ./pdp11 2>/dev/null; then
3153 dflt='unsplit split'
3155 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3158 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3163 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3166 if $test -d /lib/large || $test -d /usr/lib/large; then
3169 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3178 Some systems have different model sizes. On most systems they are called
3179 small, medium, large, and huge. On the PDP11 they are called unsplit and
3180 split. If your system doesn't support different memory models, say "none".
3181 If you wish to force everything to one memory model, say "none" here and
3182 put the appropriate flags later when it asks you for other cc and ld flags.
3183 Venix systems may wish to put "none" and let the compiler figure things out.
3184 (In the following question multiple model names should be space separated.)
3187 rp="Which memory models are supported?"
3202 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3203 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3210 rp="What flag indicates separate I and D space?"
3218 *large*|*small*|*medium*|*huge*)
3225 rp="What flag indicates large model?"
3235 *huge*) case "$huge" in
3239 rp="What flag indicates huge model?"
3249 *medium*) case "$medium" in
3253 rp="What flag indicates medium model?"
3260 *) medium="$large";;
3263 *small*) case "$small" in
3267 rp="What flag indicates small model?"
3278 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3282 : see if we need a special compiler
3290 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3291 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3304 On some systems the default C compiler will not resolve multiple global
3305 references that happen to have the same name. On some such systems the "Mcc"
3306 command may be used to force these to be resolved. On other systems a "cc -M"
3307 command is required. (Note that the -M flag on other systems indicates a
3308 memory model to use!) If you have the Gnu C compiler, you might wish to use
3312 rp="What command will force resolution on this system?"
3320 rp="Use which C compiler?"
3325 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3326 $cat >gccvers.c <<EOM
3331 printf("%s\n", __VERSION__);
3333 printf("%s\n", "1");
3339 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3340 gccversion=`./gccvers`
3341 case "$gccversion" in
3342 '') echo "You are not using GNU cc." ;;
3343 *) echo "You are using GNU cc $gccversion." ;;
3347 echo "*** WHOA THERE!!! ***" >&4
3348 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3349 case "$knowitall" in
3351 echo " You'd better start hunting for one and let me know about it." >&4
3357 case "$gccversion" in
3358 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3361 : What should the include directory be ?
3363 $echo $n "Hmm... $c"
3367 if $test -f /bin/mips && /bin/mips; then
3368 echo "Looks like a MIPS system..."
3369 $cat >usr.c <<'EOCP'
3370 #ifdef SYSTYPE_BSD43
3374 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3375 dflt='/bsd43/usr/include'
3379 mips_type='System V'
3381 $rm -f usr.c usr.out
3382 echo "and you're compiling with the $mips_type compiler and libraries."
3386 echo "Doesn't look like a MIPS system."
3397 case "$xxx_prompt" in
3399 rp='Where are the include files you want to use?'
3407 : see if we have to deal with yellow pages, now NIS.
3408 if $test -d /usr/etc/yp || $test -d /etc/yp; then
3409 if $test -f /usr/etc/nibindd; then
3411 echo "I'm fairly confident you're on a NeXT."
3413 rp='Do you get the hosts file via NetInfo?'
3422 y*) hostcat='nidump hosts .';;
3423 *) case "$hostcat" in
3424 nidump*) hostcat='';;
3434 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
3442 rp='Are you getting the hosts file via yellow pages?'
3445 y*) hostcat='ypcat hosts';;
3446 *) hostcat='cat /etc/hosts';;
3452 : now get the host name
3454 echo "Figuring out host name..." >&4
3455 case "$myhostname" in
3457 echo 'Maybe "hostname" will work...'
3458 if tans=`sh -c hostname 2>&1` ; then
3466 if $test "$cont"; then
3468 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
3469 if tans=`cat /etc/systemid 2>&1` ; then
3471 phostname='cat /etc/systemid'
3472 echo "Whadyaknow. Xenix always was a bit strange..."
3475 elif $test -r /etc/systemid; then
3476 echo "(What is a non-Xenix system doing with /etc/systemid?)"
3479 if $test "$cont"; then
3480 echo 'No, maybe "uuname -l" will work...'
3481 if tans=`sh -c 'uuname -l' 2>&1` ; then
3483 phostname='uuname -l'
3485 echo 'Strange. Maybe "uname -n" will work...'
3486 if tans=`sh -c 'uname -n' 2>&1` ; then
3488 phostname='uname -n'
3490 echo 'Oh well, maybe I can mine it out of whoami.h...'
3491 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
3492 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
3493 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
3495 case "$myhostname" in
3496 '') echo "Does this machine have an identity crisis or something?"
3499 echo "Well, you said $myhostname before..."
3500 phostname='echo $myhostname';;
3506 : you do not want to know about this
3511 if $test "$myhostname" ; then
3513 rp='Your host name appears to be "'$myhostname'".'" Right?"
3521 : bad guess or no guess
3522 while $test "X$myhostname" = X ; do
3524 rp="Please type the (one word) name of your host:"
3529 : translate upper to lower if necessary
3530 case "$myhostname" in
3532 echo "(Normalizing case in your host name)"
3533 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
3537 case "$myhostname" in
3539 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
3540 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
3541 echo "(Trimming domain name from host name--host name is now $myhostname)"
3543 *) case "$mydomain" in
3546 : If we use NIS, try ypmatch.
3547 : Is there some reason why this was not done before?
3548 test "X$hostcat" = "Xypcat hosts" &&
3549 ypmatch "$myhostname" hosts 2>/dev/null |\
3550 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
3553 : Extract only the relevant hosts, reducing file size,
3554 : remove comments, insert trailing space for later use.
3555 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
3556 /[ ]$myhostname[ . ]/p" > hosts
3559 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
3560 END { print sum }" hosts` = x1 || tmp_re="[ ]"
3561 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
3562 hosts | $sort | $uniq | \
3563 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
3564 case `$echo X$dflt` in
3565 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
3568 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
3573 tans=`./loc resolv.conf X /etc /usr/etc`
3574 if $test -f "$tans"; then
3575 echo "(Attempting domain name extraction from $tans)"
3576 : Why was there an Egrep here, when Sed works?
3577 dflt=.`$sed -n -e 's/^domain[ ]*\(.*\)/\1/p' $tans \
3578 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
3583 .) echo "(No help from resolv.conf either -- attempting clever guess)"
3584 dflt=.`sh -c domainname 2>/dev/null`
3587 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
3592 .) echo "(Lost all hope -- silly guess then)"
3598 *) dflt="$mydomain";;
3602 rp="What is your domain name?"
3612 : translate upper to lower if necessary
3615 echo "(Normalizing case in your domain name)"
3616 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
3620 : a little sanity check here
3621 case "$phostname" in
3624 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
3625 $myhostname$mydomain|$myhostname) ;;
3627 case "$phostname" in
3629 echo "(That doesn't agree with your whoami.h file, by the way.)"
3632 echo "(That doesn't agree with your $phostname command, by the way.)"
3642 I need to get your e-mail address in Internet format if possible, i.e.
3643 something like user@host.domain. Please answer accurately since I have
3644 no easy means to double check it. The default value provided below
3645 is most probably close to the reality but may not be valid from outside
3646 your organization...
3650 while test "$cont"; do
3652 '') dflt="$cf_by@$myhostname$mydomain";;
3653 *) dflt="$cf_email";;
3655 rp='What is your e-mail address?'
3661 rp='Address does not look like an Internet one. Use it anyway?'
3677 If you or somebody else will be maintaining perl at your site, please
3678 fill in the correct e-mail address here so that they may be contacted
3679 if necessary. Currently, the "perlbug" program included with perl
3680 will send mail to this address in addition to perlbug@perl.com. You may
3681 enter "none" for no administrator.
3684 case "$perladmin" in
3685 '') dflt="$cf_email";;
3686 *) dflt="$perladmin";;
3688 rp='Perl administrator e-mail address'
3692 : determine where public executable scripts go
3693 set scriptdir scriptdir
3695 case "$scriptdir" in
3698 : guess some guesses
3699 $test -d /usr/share/scripts && dflt=/usr/share/scripts
3700 $test -d /usr/share/bin && dflt=/usr/share/bin
3701 $test -d /usr/local/script && dflt=/usr/local/script
3702 $test -d $prefixexp/script && dflt=$prefixexp/script
3706 *) dflt="$scriptdir"
3711 Some installations have a separate directory just for executable scripts so
3712 that they can mount it across multiple architectures but keep the scripts in
3713 one spot. You might, for example, have a subdirectory of /usr/share for this.
3714 Or you might just lump your scripts in with all your other executables.
3718 rp='Where do you keep publicly executable scripts?'
3720 if $test "X$ansexp" != "X$scriptdirexp"; then
3724 scriptdirexp="$ansexp"
3728 Since you are running AFS, I need to distinguish the directory in which
3729 scripts reside from the directory in which they are installed (and from
3730 which they are presumably copied to the former directory by occult means).
3733 case "$installscript" in
3734 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
3735 *) dflt="$installscript";;
3738 rp='Where will public scripts be installed?'
3740 installscript="$ans"
3742 installscript="$scriptdirexp"
3745 : determine perl absolute location
3747 '') perlpath=$binexp/perl ;;
3750 : figure out how to guarantee perl startup
3751 case "$startperl" in
3753 case "$sharpbang" in
3757 I can use the #! construct to start perl on your system. This will
3758 make startup of perl scripts faster, but may cause problems if you
3759 want to share those scripts and perl is not in a standard place
3760 ($perlpath) on all your platforms. The alternative is to force
3761 a shell by starting the script with a single ':' character.
3765 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
3768 none) startperl=": # use perl";;
3769 *) startperl="#!$ans";;
3772 *) startperl=": # use perl"
3777 echo "I'll use $startperl to start perl scripts."
3781 Previous version of $package used the standard IO mechanisms as defined in
3782 <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
3783 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
3784 the default and is the only supported mechanism. This abstraction
3785 layer can use AT&T's sfio (if you already have sfio installed) or
3786 fall back on standard IO. This PerlIO abstraction layer is
3787 experimental and may cause problems with some extension modules.
3789 If this doesn't make any sense to you, just accept the default 'n'.
3791 case "$useperlio" in
3792 $define|true|[yY]*) dflt='y';;
3795 rp='Use the experimental PerlIO abstraction layer?'
3802 echo "Ok, doing things the stdio way"
3809 : see how we invoke the C preprocessor
3811 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3812 cat <<'EOT' >testcpp.c
3818 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3820 wrapper=`pwd`/cppstdin
3824 if $test "X$cppstdin" != "X" && \
3825 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3826 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3828 echo "You used to use $cppstdin $cppminus so we'll use that again."
3830 '') echo "But let's see if we can live without a wrapper..." ;;
3832 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3833 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3835 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3838 echo "(However, $cpprun $cpplast does not work, let's see...)"
3846 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3853 elif echo '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"' -E -" will work...'; \
3860 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3861 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3862 echo "Yup, it does."
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 "Yipee, that works!"
3871 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3872 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3873 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3874 echo "At long last!"
3877 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3878 $cpp <testcpp.c >testcpp.out 2>&1; \
3879 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3883 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3884 $cpp - <testcpp.c >testcpp.out 2>&1; \
3885 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3886 echo "Hooray, it works! I was beginning to wonder."
3889 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3890 $wrapper <testcpp.c >testcpp.out 2>&1; \
3891 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3897 rp="No dice. I can't find a C preprocessor. Name one:"
3901 $x_cpp <testcpp.c >testcpp.out 2>&1
3902 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3903 echo "OK, that will do." >&4
3905 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3920 echo "Perhaps can we force $cc -E using a wrapper..."
3921 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3922 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3928 echo "Nope, we'll have to live without it..."
3943 *) $rm -f $wrapper;;
3945 $rm -f testcpp.c testcpp.out
3947 : Set private lib path
3950 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3955 '') dlist="$loclibpth $plibpth $glibpth";;
3956 *) dlist="$libpth";;
3959 : Now check and see which directories actually exist, avoiding duplicates
3963 if $test -d $xxx; then
3966 *) libpth="$libpth $xxx";;
3972 Some systems have incompatible or broken versions of libraries. Among
3973 the directories listed in the question below, please remove any you
3974 know not to be holding relevant libraries, and add any that are needed.
3975 Say "none" for none.
3986 rp="Directories to use for library searches?"
3993 : determine optimize, if desired, or use for debug flag also
3997 *) dflt="$optimize";;
4001 Some C compilers have problems with their optimizers. By default, $package
4002 compiles with the -O flag to use the optimizer. Alternately, you might want
4003 to use the symbolic debugger, which uses the -g flag (on traditional Unix
4004 systems). Either flag can be specified here. To use neither flag, specify
4008 rp="What optimizer/debugger flag should be used?"
4012 'none') optimize=" ";;
4016 : We will not override a previous value, but we might want to
4017 : augment a hint file
4020 case "$gccversion" in
4021 1*) dflt='-fpcc-struct-return' ;;
4024 *-g*) dflt="$dflt -DDEBUGGING";;
4026 case "$gccversion" in
4027 2*) if test -d /etc/conf/kconfig.d &&
4028 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4037 case "$mips_type" in
4038 *BSD*|'') inclwanted="$locincpth $usrinc";;
4039 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4041 for thisincl in $inclwanted; do
4042 if $test -d $thisincl; then
4043 if $test x$thisincl != x$usrinc; then
4046 *) dflt="$dflt -I$thisincl";;
4052 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4054 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4062 *) dflt="$dflt -D$2";;
4067 set signal.h __LANGUAGE_C__; eval $inctest
4069 set signal.h LANGUAGE_C; eval $inctest
4071 set signal.h NO_PROTOTYPE; eval $inctest
4072 set signal.h _NO_PROTO; eval $inctest
4075 none|recommended) dflt="$ccflags $dflt" ;;
4076 *) dflt="$ccflags";;
4084 Your C compiler may want other flags. For this question you should include
4085 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4086 but you should NOT include libraries or ld flags like -lwhatever. If you
4087 want $package to honor its debug switch, you should include -DDEBUGGING here.
4088 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE,
4089 -DHIDEMYMALLOC or -DCRIPPLED_CC.
4091 To use no flags, specify the word "none".
4097 rp="Any additional cc flags?"
4104 : the following weeds options from ccflags that are of no interest to cpp
4106 case "$gccversion" in
4107 1*) cppflags="$cppflags -D__GNUC__"
4109 case "$mips_type" in
4111 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4117 echo "Let me guess what the preprocessor flags are..." >&4
4131 *) ftry="$previous $flag";;
4133 if $cppstdin -DLFRULB=bar $ftry $cppminus <cpp.c \
4134 >cpp1.out 2>/dev/null && \
4135 $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \
4136 >cpp2.out 2>/dev/null && \
4137 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4138 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4140 cppflags="$cppflags $ftry"
4150 *-*) echo "They appear to be: $cppflags";;
4152 $rm -f cpp.c cpp?.out
4156 : flags used in final linking phase
4159 '') if ./venix; then
4165 *-posix*) dflt="$dflt -posix" ;;
4168 *) dflt="$ldflags";;
4171 : Try to guess additional flags to pick up local libraries.
4172 for thislibdir in $libpth; do
4173 case " $loclibpth " in
4176 *"-L$thislibdir "*) ;;
4177 *) dflt="$dflt -L$thislibdir" ;;
4189 Your C linker may need flags. For this question you should
4190 include -L/whatever and any other flags used by the C linker, but you
4191 should NOT include libraries like -lwhatever.
4193 Make sure you include the appropriate -L/path flags if your C linker
4194 does not normally search all of the directories you specified above,
4197 To use no flags, specify the word "none".
4201 rp="Any additional ld flags (NOT including libraries)?"
4207 rmlist="$rmlist pdp11"
4211 echo "Checking your choice of C compiler and flags for coherency..." >&4
4212 set X $cc $optimize $ccflags $ldflags try.c -o try
4215 I've tried to compile and run a simple program with:
4220 and I got the following output:
4223 $cat > try.c <<'EOF'
4228 if sh -c "$cc $optimize $ccflags try.c -o try $ldflags" >>try.msg 2>&1; then
4229 if sh -c './try' >>try.msg 2>&1; then
4232 echo "The program compiled OK, but exited with status $?." >>try.msg
4233 rp="You have a problem. Shall I abort Configure"
4237 echo "I can't compile the test program." >>try.msg
4238 rp="You have a BIG problem. Shall I abort Configure"
4244 case "$knowitall" in
4246 echo "(The supplied flags might be incorrect with this C compiler.)"
4254 *) echo "Ok. Stopping Configure." >&4
4259 n) echo "OK, that should do.";;
4261 $rm -f try try.* core
4263 : compute shared library extension
4266 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4276 On some systems, shared libraries may be available. Answer 'none' if
4277 you want to suppress searching of shared libraries for the remaining
4278 of this configuration.
4281 rp='What is the file extension used for shared libraries?'
4285 : Looking for optional libraries
4287 echo "Checking for optional libraries..." >&4
4292 case "$libswanted" in
4293 '') libswanted='c_s';;
4295 for thislib in $libswanted; do
4297 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
4298 echo "Found -l$thislib (shared)."
4301 *) dflt="$dflt -l$thislib";;
4303 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4304 echo "Found -l$thislib (shared)."
4307 *) dflt="$dflt -l$thislib";;
4309 elif xxx=`./loc lib$thislib.a X $libpth`; $test -f "$xxx"; then
4310 echo "Found -l$thislib."
4313 *) dflt="$dflt -l$thislib";;
4315 elif xxx=`./loc $thislib.a X $libpth`; $test -f "$xxx"; then
4316 echo "Found -l$thislib."
4319 *) dflt="$dflt -l$thislib";;
4321 elif xxx=`./loc lib${thislib}_s.a X $libpth`; $test -f "$xxx"; then
4322 echo "Found -l${thislib}_s."
4325 *) dflt="$dflt -l${thislib}_s";;
4327 elif xxx=`./loc Slib$thislib.a X $xlibpth`; $test -f "$xxx"; then
4328 echo "Found -l$thislib."
4331 *) dflt="$dflt -l$thislib";;
4334 echo "No -l$thislib."
4345 ' '|'') dflt='none';;
4350 Some versions of Unix support shared libraries, which make executables smaller
4351 but make load time slightly longer.
4353 On some systems, mostly System V Release 3's, the shared library is included
4354 by putting the option "-lc_s" as the last thing on the cc command line when
4355 linking. Other systems use shared libraries by default. There may be other
4356 libraries needed to compile $package on your machine as well. If your system
4357 needs the "-lc_s" option, include it here. Include any other special libraries
4358 here as well. Say "none" for none.
4362 rp="Any additional libraries?"
4369 : see if nm is to be used to determine whether a symbol is defined or not
4372 dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null`
4373 if $test $dflt -gt 20; then
4388 I can use 'nm' to extract the symbols from your C libraries. This is a time
4389 consuming task which may generate huge output on the disk (up to 3 megabytes)
4390 but that should make the symbols extraction faster. The alternative is to skip
4391 the 'nm' extraction part and to compile a small test program instead to
4392 determine whether each symbol is present. If you have a fast C compiler and/or
4393 if your 'nm' output cannot be parsed, this may be the best solution.
4396 rp='Shall I use nm to extract C symbols from the libraries?'
4408 : nm options which may be necessary
4410 '') if $test -f /mach_boot; then
4412 elif $test -d /usr/ccs/lib; then
4414 elif $test -f /dgux; then
4421 : nm options which may be necessary for shared libraries but illegal
4422 : for archive libraries. Thank you, Linux.
4423 case "$nm_so_opt" in
4424 '') case "$myuname" in
4426 if nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4427 nm_so_opt='--dynamic'
4436 : get list of predefined functions in a handy place
4441 *-lc_s*) libc=`./loc libc_s.a $libc $libpth`
4448 *) for thislib in $libs; do
4451 : Handle C library specially below.
4454 thislib=`echo $thislib | $sed -e 's/^-l//'`
4455 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4457 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4459 elif try=`./loc lib$thislib.a X $libpth`; $test -f "$try"; then
4461 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4463 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4465 elif try=`./loc Slib$thislib.a X $xlibpth`; $test -f "$try"; then
4470 libnames="$libnames $try"
4472 *) libnames="$libnames $thislib" ;;
4481 for xxx in $libpth; do
4482 $test -r $1 || set $xxx/libc.$so
4483 : The messy sed command sorts on library version numbers.
4485 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4486 tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e '
4488 s/[0-9][0-9]*/0000&/g
4489 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4492 sort | $sed -e 's/^.* //'`
4495 $test -r $1 || set /usr/ccs/lib/libc.$so
4496 $test -r $1 || set /lib/libsys_s.a
4502 if $test -r "$1"; then
4503 echo "Your (shared) C library seems to be in $1."
4505 elif $test -r /lib/libc && $test -r /lib/clib; then
4506 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4508 libc='/lib/clib /lib/libc'
4509 if $test -r /lib/syslib; then
4510 echo "(Your math library is in /lib/syslib.)"
4511 libc="$libc /lib/syslib"
4513 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4514 echo "Your C library seems to be in $libc, as you said before."
4515 elif $test -r $incpath/usr/lib/libc.a; then
4516 libc=$incpath/usr/lib/libc.a;
4517 echo "Your C library seems to be in $libc. That's fine."
4518 elif $test -r /lib/libc.a; then
4520 echo "Your C library seems to be in $libc. You're normal."
4522 if tans=`./loc libc.a blurfl/dyick $libpth`; $test -r "$tans"; then
4524 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4525 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4526 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4528 elif tans=`./loc Slibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4530 elif tans=`./loc Mlibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4533 tans=`./loc Llibc.a blurfl/dyick $xlibpth`
4535 if $test -r "$tans"; then
4536 echo "Your C library seems to be in $tans, of all places."
4542 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4546 If the guess above is wrong (which it might be if you're using a strange
4547 compiler, or your machine supports multiple models), you can override it here.
4552 echo $libpth | tr ' ' '\012' | sort | uniq > libpath
4554 I can't seem to find your C library. I've looked in the following places:
4557 $sed 's/^/ /' libpath
4560 None of these seems to contain your C library. I need to get its name...
4565 rp='Where is your C library?'
4570 echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames
4571 set X `cat libnames`
4574 case $# in 1) xxx=file; esac
4575 echo "Extracting names from the following $xxx for later perusal:" >&4
4577 $sed 's/^/ /' libnames >&4
4579 $echo $n "This may take a while...$c" >&4
4581 : Linux may need the special Dynamic option to nm for shared libraries.
4582 : In general, this is stored in the nm_so_opt variable.
4583 : Unfortunately, that option may be fatal on non-shared libraries.
4584 for nm_libs_ext in $*; do
4585 case $nm_libs_ext in
4586 *$so*) nm $nm_so_opt $nm_opt $nm_libs_ext 2>/dev/null ;;
4587 *) nm $nm_opt $nm_libs_ext 2>/dev/null ;;
4592 $grep fprintf libc.tmp > libc.ptf
4593 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4594 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4596 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx //p'";\
4598 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4600 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4602 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4604 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4606 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4608 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4610 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4612 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4614 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4616 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4618 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4620 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4621 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4623 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4625 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4627 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4629 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4631 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4633 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4635 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4637 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4639 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4642 nm -p $* 2>/dev/null >libc.tmp
4643 $grep fprintf libc.tmp > libc.ptf
4644 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4645 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4651 echo "nm didn't seem to work right. Trying ar instead..." >&4
4653 if ar t $libc > libc.tmp; then
4654 for thisname in $libnames; do
4655 ar t $thisname >>libc.tmp
4657 $sed -e 's/\.o$//' < libc.tmp > libc.list
4660 echo "ar didn't seem to work right." >&4
4661 echo "Maybe this is a Cray...trying bld instead..." >&4
4662 if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list
4664 for thisname in $libnames; do
4666 $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
4667 ar t $thisname >>libc.tmp
4671 echo "That didn't work either. Giving up." >&4
4678 if $test -f /lib/syscalls.exp; then
4680 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4681 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
4685 $rm -f libnames libpath
4687 : is a C symbol defined?
4690 -v) tf=libc.tmp; tc=""; tdc="";;
4691 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4692 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4695 case "$reuseval-$4" in
4697 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4703 if $contains $tlook $tf >/dev/null 2>&1;
4708 echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4709 if $cc $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
4717 $define) tval=true;;
4723 : define an is-in-libc? function
4724 inlibc='echo " "; td=$define; tu=$undef;
4725 sym=$1; var=$2; eval "was=\$$2";
4727 case "$reuseval$was" in
4737 echo "$sym() found." >&4;
4738 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
4740 echo "$sym() NOT found." >&4;
4741 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
4745 $define) echo "$sym() found." >&4;;
4746 *) echo "$sym() NOT found." >&4;;
4750 : Check how to convert floats to strings.
4752 echo "Checking for an efficient way to convert floats to strings."
4755 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
4756 char *myname = "gconvert";
4759 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
4760 char *myname = "gcvt";
4763 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
4764 char *myname = "sprintf";
4770 checkit(expect, got)
4774 if (strcmp(expect, got)) {
4775 printf("%s oddity: Expected %s, got %s\n",
4776 myname, expect, got);
4787 /* This must be 1st test on (which?) platform */
4788 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
4789 Gconvert(0.1, 8, 0, buf);
4790 checkit("0.1", buf);
4792 Gconvert(1.0, 8, 0, buf);
4795 Gconvert(0.0, 8, 0, buf);
4798 Gconvert(-1.0, 8, 0, buf);
4801 /* Some Linux gcvt's give 1.e+5 here. */
4802 Gconvert(100000.0, 8, 0, buf);
4803 checkit("100000", buf);
4805 /* Some Linux gcvt's give -1.e+5 here. */
4806 Gconvert(-100000.0, 8, 0, buf);
4807 checkit("-100000", buf);
4812 case "$d_Gconvert" in
4813 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
4814 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
4815 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
4816 *) xxx_list='gconvert gcvt sprintf' ;;
4819 for xxx_convert in $xxx_list; do
4820 echo "Trying $xxx_convert"
4822 if $cc $ccflags -DTRY_$xxx_convert $ldflags -o try \
4823 try.c $libs > /dev/null 2>&1 ; then
4824 echo "$xxx_convert" found. >&4
4826 echo "I'll use $xxx_convert to convert floats into a string." >&4
4829 echo "...But $xxx_convert didn't work as I expected."
4832 echo "$xxx_convert NOT found." >&4
4836 case "$xxx_convert" in
4837 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
4838 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
4839 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
4842 : Initialize h_fcntl
4845 : Initialize h_sysfile
4848 : determine filename position in cpp output
4850 echo "Computing filename position in cpp output for #include directives..." >&4
4851 echo '#include <stdio.h>' > foo.c
4854 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4855 $grep '^[ ]*#.*stdio\.h' | \
4856 while read cline; do
4859 while $test \$# -gt 0; do
4860 if $test -r \`echo \$1 | $tr -d '"'\`; then
4865 pos=\`expr \$pos + 1\`
4877 *) pos="${fieldn}th";;
4879 echo "Your cpp writes the filename in the $pos field of the line."
4881 : locate header file
4886 if test -f $usrinc/\$wanted; then
4887 echo "$usrinc/\$wanted"
4890 awkprg='{ print \$$fieldn }'
4891 echo "#include <\$wanted>" > foo\$\$.c
4892 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4893 $grep "^[ ]*#.*\$wanted" | \
4894 while read cline; do
4895 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4897 */\$wanted) echo "\$name"; exit 0;;
4908 : access call always available on UNIX
4912 : locate the flags for 'access()'
4916 $cat >access.c <<'EOCP'
4917 #include <sys/types.h>
4922 #include <sys/file.h>
4931 : check sys/file.h first, no particular reason here
4932 if $test `./findhdr sys/file.h` && \
4933 $cc $cppflags -DI_SYS_FILE access.c -o access >/dev/null 2>&1 ; then
4935 echo "<sys/file.h> defines the *_OK access constants." >&4
4936 elif $test `./findhdr fcntl.h` && \
4937 $cc $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then
4939 echo "<fcntl.h> defines the *_OK access constants." >&4
4940 elif $test `./findhdr unistd.h` && \
4941 $cc $cppflags -DI_UNISTD access.c -o access >/dev/null 2>&1 ; then
4942 echo "<unistd.h> defines the *_OK access constants." >&4
4944 echo "I can't find the four *_OK access constants--I'll use mine." >&4
4950 : see if alarm exists
4954 : Look for GNU-cc style attribute checking
4956 echo "Checking whether your compiler can handle __attribute__ ..." >&4
4957 $cat >attrib.c <<'EOCP'
4959 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
4961 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
4962 if $contains 'warning' attrib.out >/dev/null 2>&1; then
4963 echo "Your C compiler doesn't fully support __attribute__."
4966 echo "Your C compiler supports __attribute__."
4970 echo "Your C compiler doesn't seem to understand __attribute__ at all."
4977 : see if bcmp exists
4981 : see if bcopy exists
4985 : see if setpgrp exists
4986 set setpgrp d_setpgrp
4989 : see which flavor of setpgrp is in use
4990 case "$d_setpgrp" in
4996 if (getuid() == 0) {
4997 printf("(I see you are running Configure as super-user...)\n");
5000 if (-1 == setpgrp(1, 1))
5005 if $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1; then
5008 0) echo "You have to use setpgrp() instead of setpgrp(pid, pgrp)." >&4
5010 *) echo "You have to use setpgrp(pid, pgrp) instead of setpgrp()." >&4
5015 xxx="USG one, i.e. you use setpgrp()."
5018 xxx="BSD one, i.e. you use setpgrp(pid, pgrp)."
5021 echo "Assuming your setpgrp is a $xxx" >&4
5030 : see if bzero exists
5034 : check for length of integer
5038 echo "Checking to see how big your integers are..." >&4
5039 $cat >try.c <<'EOCP'
5043 printf("%d\n", sizeof(int));
5047 if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
5049 echo "Your integers are $intsize bytes long."
5052 echo "(I can't seem to compile the test program. Guessing...)"
5053 rp="What is the size of an integer (in bytes)?"
5061 : see if signal is declared as pointer to function returning int or void
5063 xxx=`./findhdr signal.h`
5064 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
5065 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
5066 echo "You have int (*signal())() instead of void." >&4
5068 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
5069 echo "You have void (*signal())() instead of int." >&4
5071 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
5072 echo "You have int (*signal())() instead of void." >&4
5075 case "$d_voidsig" in
5077 echo "I can't determine whether signal handler returns void or int..." >&4
5079 rp="What type does your signal handler return?"
5086 echo "As you already told me, signal handler returns void." >&4;;
5088 echo "As you already told me, signal handler returns int." >&4;;
5093 case "$d_voidsig" in
5094 "$define") signal_t="void";;
5099 : check for ability to cast large floats to 32-bit ints.
5101 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
5102 if $test "$intsize" -eq 4; then
5108 #include <sys/types.h>
5110 $signal_t blech() { exit(3); }
5116 signal(SIGFPE, blech);
5118 f = (double) 0x7fffffff;
5122 if (i32 != ($xxx) f)
5127 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
5131 echo "(I can't seem to compile the test program--assuming it can't)"
5139 echo "Nope, it can't."
5146 : check for ability to cast negative floats to unsigned
5148 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
5150 #include <sys/types.h>
5152 $signal_t blech() { exit(7); }
5153 $signal_t blech_in_list() { exit(4); }
5154 unsigned long dummy_long(p) unsigned long p; { return p; }
5155 unsigned int dummy_int(p) unsigned int p; { return p; }
5156 unsigned short dummy_short(p) unsigned short p; { return p; }
5160 unsigned long along;
5162 unsigned short ashort;
5165 signal(SIGFPE, blech);
5166 along = (unsigned long)f;
5167 aint = (unsigned int)f;
5168 ashort = (unsigned short)f;
5169 if (along != (unsigned long)-123)
5171 if (aint != (unsigned int)-123)
5173 if (ashort != (unsigned short)-123)
5175 f = (double)0x40000000;
5178 along = (unsigned long)f;
5179 if (along != 0x80000000)
5183 along = (unsigned long)f;
5184 if (along != 0x7fffffff)
5188 along = (unsigned long)f;
5189 if (along != 0x80000001)
5193 signal(SIGFPE, blech_in_list);
5195 along = dummy_long((unsigned long)f);
5196 aint = dummy_int((unsigned int)f);
5197 ashort = dummy_short((unsigned short)f);
5198 if (along != (unsigned long)123)
5200 if (aint != (unsigned int)123)
5202 if (ashort != (unsigned short)123)
5208 if $cc -o try $ccflags try.c >/dev/null 2>&1; then
5212 echo "(I can't seem to compile the test program--assuming it can't)"
5215 case "$castflags" in
5220 echo "Nope, it can't."
5227 : see if vprintf exists
5229 if set vprintf val -f d_vprintf; eval $csym; $val; then
5230 echo 'vprintf() found.' >&4
5232 $cat >vprintf.c <<'EOF'
5233 #include <varargs.h>
5235 main() { xxx("foo"); }
5244 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
5247 if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then
5248 echo "Your vsprintf() returns (int)." >&4
5251 echo "Your vsprintf() returns (char*)." >&4
5255 echo 'vprintf() NOT found.' >&4
5265 : see if chown exists
5269 : see if chroot exists
5273 : see if chsize exists
5277 : check for const keyword
5279 echo 'Checking to see if your C compiler knows about "const"...' >&4
5280 $cat >const.c <<'EOCP'
5281 typedef struct spug { int drokk; } spug;
5288 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
5290 echo "Yup, it does."
5293 echo "Nope, it doesn't."
5298 : see if crypt exists
5300 if set crypt val -f d_crypt; eval $csym; $val; then
5301 echo 'crypt() found.' >&4
5305 cryptlib=`./loc Slibcrypt.a "" $xlibpth`
5306 if $test -z "$cryptlib"; then
5307 cryptlib=`./loc Mlibcrypt.a "" $xlibpth`
5311 if $test -z "$cryptlib"; then
5312 cryptlib=`./loc Llibcrypt.a "" $xlibpth`
5316 if $test -z "$cryptlib"; then
5317 cryptlib=`./loc libcrypt.a "" $libpth`
5321 if $test -z "$cryptlib"; then
5322 echo 'crypt() NOT found.' >&4
5331 : get csh whereabouts
5333 'csh') val="$undef" ;;
5340 : see if cuserid exists
5341 set cuserid d_cuserid
5344 : define an alternate in-header-list? function
5345 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5346 cont=true; xxf="echo \"<\$1> found.\" >&4";
5347 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5348 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5350 case $# in 4) instead=instead;; *) instead="at last";; esac;
5351 while $test "$cont"; do
5353 var=$2; eval "was=\$$2";
5354 if $test "$xxx" && $test -r "$xxx";
5356 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5359 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5360 set $yyy; shift; shift; yyy=$@;
5361 case $# in 0) cont="";;
5362 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5363 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5364 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5365 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5369 do set $yyy; var=$2; eval "was=\$$2";
5370 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5371 set $yyy; shift; shift; yyy=$@;
5374 : see if this is a limits.h system
5375 set limits.h i_limits
5378 : see if this is a float.h system
5382 : See if number of significant digits in a double precision number is known
5384 $cat >dbl_dig.c <<EOM
5394 printf("Contains DBL_DIG");
5397 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
5398 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
5399 echo "DBL_DIG found." >&4
5402 echo "DBL_DIG NOT found." >&4
5409 : see if difftime exists
5410 set difftime d_difftime
5413 : see if this is a dirent system
5415 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
5417 echo "<dirent.h> found." >&4
5420 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
5421 echo "<sys/dir.h> found." >&4
5424 xinc=`./findhdr sys/ndir.h`
5426 echo "<dirent.h> NOT found." >&4
5431 : Look for type of directory structure.
5433 $cppstdin $cppflags $cppminus < "$xinc" > try.c
5435 case "$direntrytype" in
5438 $define) guess1='struct dirent' ;;
5439 *) guess1='struct direct' ;;
5442 *) guess1="$direntrytype"
5447 'struct dirent') guess2='struct direct' ;;
5448 *) guess2='struct dirent' ;;
5451 if $contains "$guess1" try.c >/dev/null 2>&1; then
5452 direntrytype="$guess1"
5453 echo "Your directory entries are $direntrytype." >&4
5454 elif $contains "$guess2" try.c >/dev/null 2>&1; then
5455 direntrytype="$guess2"
5456 echo "Your directory entries seem to be $direntrytype." >&4
5458 echo "I don't recognize your system's directory entries." >&4
5459 rp="What type is used for directory entries on this system?"
5467 : see if the directory entry stores field length
5469 $cppstdin $cppflags $cppminus < "$xinc" > try.c
5470 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
5471 echo "Good, your directory entry keeps length information in d_namlen." >&4
5474 echo "Your directory entry does not know about the d_namlen field." >&4
5481 : see if dlerror exists
5484 set dlerror d_dlerror
5488 : see if dld is available
5492 : see if dlopen exists
5499 : determine which dynamic loading, if any, to compile in
5501 dldir="ext/DynaLoader"
5514 $define) dflt='y' ;;
5517 $define) dflt='y' ;;
5519 : Does a dl_xxx.xs file exist for this operating system
5520 $test -f ../$dldir/dl_${osname}.xs && dflt='y'
5523 rp="Do you wish to use dynamic loading?"
5530 if $test -f ../$dldir/dl_${osname}.xs ; then
5531 dflt="$dldir/dl_${osname}.xs"
5532 elif $test "$d_dlopen" = "$define" ; then
5533 dflt="$dldir/dl_dlopen.xs"
5534 elif $test "$i_dld" = "$define" ; then
5535 dflt="$dldir/dl_dld.xs"
5540 *) dflt="$dldir/$dlsrc"
5543 echo "The following dynamic loading files are available:"
5544 : Can not go over to $dldir because getfile has path hard-coded in.
5545 cd ..; ls -C $dldir/dl*.xs; cd UU
5546 rp="Source file to use for dynamic loading"
5551 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5555 Some systems may require passing special flags to $cc -c to
5556 compile modules that will be used to create a shared library.
5557 To use no flags, say "none".
5560 case "$cccdlflags" in
5561 '') case "$gccversion" in
5562 '') case "$osname" in
5564 next) dflt='none' ;;
5565 solaris|svr4*|esix*) dflt='-Kpic' ;;
5566 irix*) dflt='-KPIC' ;;
5567 sunos) dflt='-pic' ;;
5572 *) dflt="$cccdlflags" ;;
5574 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5577 none) cccdlflags=' ' ;;
5578 *) cccdlflags="$ans" ;;
5583 Some systems use ld to create libraries that can be dynamically loaded,
5584 while other systems (such as those using ELF) use $cc.
5588 '') $cat >try.c <<'EOM'
5589 /* Test for whether ELF binaries are produced */
5594 int i = open("a.out",O_RDONLY);
5597 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5598 exit(0); /* succeed (yes, it's ELF) */
5603 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5605 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5609 echo "I'll use ld to build dynamic libraries."
5618 rp="What command should be used to create dynamic libraries?"
5624 Some systems may require passing special flags to $ld to create a
5625 library that can be dynamically loaded. If your ld flags include
5626 -L/other/path options to locate libraries outside your loader's normal
5627 search path, you may need to specify those -L options here as well. To
5628 use no flags, say "none".
5631 case "$lddlflags" in
5632 '') case "$osname" in
5634 linux|irix*) dflt='-shared' ;;
5635 next) dflt='none' ;;
5636 solaris) dflt='-G' ;;
5637 sunos) dflt='-assert nodefinitions' ;;
5638 svr4*|esix*) dflt="-G $ldflags" ;;
5642 *) dflt="$lddlflags" ;;
5645 : Try to guess additional flags to pick up local libraries.
5646 for thisflag in $ldflags; do
5651 *) dflt="$dflt $thisflag" ;;
5661 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5664 none) lddlflags=' ' ;;
5665 *) lddlflags="$ans" ;;
5670 Some systems may require passing special flags to $cc to indicate that
5671 the resulting executable will use dynamic linking. To use no flags,
5675 case "$ccdlflags" in
5676 '') case "$osname" in
5677 hpux) dflt='-Wl,-E' ;;
5678 linux) dflt='-rdynamic' ;;
5679 next) dflt='none' ;;
5680 sunos) dflt='none' ;;
5683 *) dflt="$ccdlflags" ;;
5685 rp="Any special flags to pass to $cc to use dynamic loading?"
5688 none) ccdlflags=' ' ;;
5689 *) ccdlflags="$ans" ;;
5700 : see if dlfcn is available
5708 On a few systems, the dynamically loaded modules that perl generates and uses
5709 will need a different extension then shared libs. The default will probably
5717 rp='What is the extension of dynamically loaded modules'
5726 : Define several unixisms. Hints files or command line options
5727 : can be used to override them.
5740 : Which makefile gets called first. This is used by make depend.
5741 case "$firstmakefile" in
5742 '') firstmakefile='makefile';;
5745 : Check if dlsym need a leading underscore
5751 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
5752 $cat >dyna.c <<'EOM'
5761 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
5763 #include <sys/types.h>
5777 int mode = RTLD_LAZY ;
5779 handle = dlopen("./dyna.$dlext", mode) ;
5780 if (handle == NULL) {
5784 symbol = dlsym(handle, "fred") ;
5785 if (symbol == NULL) {
5786 /* try putting a leading underscore */
5787 symbol = dlsym(handle, "_fred") ;
5788 if (symbol == NULL) {
5799 : Call the object file tmp-dyna.o in case dlext=o.
5800 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
5801 mv dyna${obj_ext} tmp-dyna${obj_ext} > /dev/null 2>&1 &&
5802 $ld $lddlflags -o dyna.$dlext tmp-dyna${obj_ext} > /dev/null 2>&1 &&
5803 $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
5806 1) echo "Test program failed using dlopen." >&4
5807 echo "Perhaps you should not use dynamic loading." >&4;;
5808 2) echo "Test program failed using dlsym." >&4
5809 echo "Perhaps you should not use dynamic loading." >&4;;
5810 3) echo "dlsym needs a leading underscore" >&4
5812 4) echo "dlsym doesn't need a leading underscore." >&4;;
5815 echo "I can't compile and run the test program." >&4
5820 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
5825 : see if dup2 exists
5829 : Locate the flags for 'open()'
5831 $cat >open3.c <<'EOCP'
5832 #include <sys/types.h>
5837 #include <sys/file.h>
5848 : check sys/file.h first to get FREAD on Sun
5849 if $test `./findhdr sys/file.h` && \
5850 $cc $cppflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then
5852 echo "<sys/file.h> defines the O_* constants..." >&4
5854 echo "and you have the 3 argument form of open()." >&4
5857 echo "but not the 3 argument form of open(). Oh, well." >&4
5860 elif $test `./findhdr fcntl.h` && \
5861 $cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then
5863 echo "<fcntl.h> defines the O_* constants..." >&4
5865 echo "and you have the 3 argument form of open()." >&4
5868 echo "but not the 3 argument form of open(). Oh, well." >&4
5873 echo "I can't find the O_* constant definitions! You got problems." >&4
5879 : check for non-blocking I/O stuff
5880 case "$h_sysfile" in
5881 true) echo "#include <sys/file.h>" > head.c;;
5884 true) echo "#include <fcntl.h>" > head.c;;
5885 *) echo "#include <sys/fcntl.h>" > head.c;;
5890 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
5891 case "$o_nonblock" in
5894 $cat >>try.c <<'EOCP'
5897 printf("O_NONBLOCK\n");
5901 printf("O_NDELAY\n");
5905 printf("FNDELAY\n");
5911 if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then
5913 case "$o_nonblock" in
5914 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
5915 *) echo "Seems like we can use $o_nonblock.";;
5918 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
5921 *) echo "Using $hint value $o_nonblock.";;
5923 $rm -f try try.* .out core
5926 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
5932 #include <sys/types.h>
5934 #define MY_O_NONBLOCK $o_nonblock
5936 $signal_t blech(x) int x; { exit(3); }
5938 $cat >> try.c <<'EOCP'
5946 pipe(pd); /* Down: child -> parent */
5947 pipe(pu); /* Up: parent -> child */
5950 close(pd[1]); /* Parent reads from pd[0] */
5951 close(pu[0]); /* Parent writes (blocking) to pu[1] */
5952 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
5954 signal(SIGALRM, blech);
5956 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
5958 sprintf(string, "%d\n", ret);
5959 write(2, string, strlen(string));
5962 if (errno == EAGAIN) {
5968 if (errno == EWOULDBLOCK)
5969 printf("EWOULDBLOCK\n");
5972 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
5973 sleep(2); /* Give it time to close our pipe */
5975 ret = read(pd[0], buf, 1); /* Should read EOF */
5977 sprintf(string, "%d\n", ret);
5978 write(3, string, strlen(string));
5982 close(pd[0]); /* We write to pd[1] */
5983 close(pu[1]); /* We read from pu[0] */
5984 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
5985 close(pd[1]); /* Pipe pd is now fully closed! */
5986 exit(0); /* Bye bye, thank you for playing! */
5989 if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then
5990 echo "$startsh" >mtry
5991 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
5993 ./mtry >/dev/null 2>&1
5995 0) eagain=`$cat try.out`;;
5996 1) echo "Could not perform non-blocking setting!";;
5997 2) echo "I did a successful read() for something that was not there!";;
5998 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
5999 *) echo "Something terribly wrong happened during testing.";;
6001 rd_nodata=`$cat try.ret`
6002 echo "A read() system call with no data present returns $rd_nodata."
6003 case "$rd_nodata" in
6006 echo "(That's peculiar, fixing that to be -1.)"
6012 echo "Forcing errno EAGAIN on read() with no data available."
6016 echo "Your read() sets errno to $eagain when no data is available."
6019 status=`$cat try.err`
6021 0) echo "And it correctly returns 0 to signal EOF.";;
6022 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
6023 *) echo "However, your read() returns '$status' on EOF??";;
6026 if test "$status" -eq "$rd_nodata"; then
6027 echo "WARNING: you can't distinguish between EOF and no data!"
6031 echo "I can't compile the test program--assuming errno EAGAIN will do."
6038 echo "Using $hint value $eagain."
6039 echo "Your read() returns $rd_nodata when no data is present."
6040 case "$d_eofnblk" in
6041 "$define") echo "And you can see EOF because read() returns 0.";;
6042 "$undef") echo "But you can't see EOF status from read() returned value.";;
6044 echo "(Assuming you can't see EOF status from read anyway.)"
6050 $rm -f try try.* .out core head.c mtry
6052 : see if fchmod exists
6056 : see if fchown exists
6060 : see if this is an fcntl system
6064 : see if fgetpos exists
6065 set fgetpos d_fgetpos
6068 : see if flock exists
6072 : see if fork exists
6076 : see if pathconf exists
6077 set pathconf d_pathconf
6080 : see if fpathconf exists
6081 set fpathconf d_fpathconf
6084 : see if fsetpos exists
6085 set fsetpos d_fsetpos
6088 : see if gethostent exists
6089 set gethostent d_gethent
6092 : see if getlogin exists
6093 set getlogin d_getlogin
6096 : see if getpgrp exists
6097 set getpgrp d_getpgrp
6100 : see if getpgrp2 exists
6101 set getpgrp2 d_getpgrp2
6104 : see if getppid exists
6105 set getppid d_getppid
6108 : see if getpriority exists
6109 set getpriority d_getprior
6112 : see if this is a netinet/in.h or sys/in.h system
6113 set netinet/in.h i_niin sys/in.h i_sysin
6116 : see if htonl --and friends-- exists
6121 : Maybe they are macros.
6126 #include <sys/types.h>
6127 #$i_niin I_NETINET_IN
6130 #include <netinet/in.h>
6136 printf("Defined as a macro.");
6139 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
6140 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
6142 echo "But it seems to be defined as a macro." >&4
6150 : see which of string.h or strings.h is needed
6152 strings=`./findhdr string.h`
6153 if $test "$strings" && $test -r "$strings"; then
6154 echo "Using <string.h> instead of <strings.h>." >&4
6158 strings=`./findhdr strings.h`
6159 if $test "$strings" && $test -r "$strings"; then
6160 echo "Using <strings.h> instead of <string.h>." >&4
6162 echo "No string header found -- You'll surely have problems." >&4
6168 "$undef") strings=`./findhdr strings.h`;;
6169 *) strings=`./findhdr string.h`;;
6174 if set index val -f; eval $csym; $val; then
6175 if set strchr val -f d_strchr; eval $csym; $val; then
6176 if $contains strchr "$strings" >/dev/null 2>&1 ; then
6179 echo "strchr() found." >&4
6183 echo "index() found." >&4
6188 echo "index() found." >&4
6191 if set strchr val -f d_strchr; eval $csym; $val; then
6194 echo "strchr() found." >&4
6196 echo "No index() or strchr() found!" >&4
6201 set d_strchr; eval $setvar
6203 set d_index; eval $setvar
6207 $cat >isascii.c <<'EOCP'
6218 if $cc $ccflags $ldflags -o isascii isascii.c $libs >/dev/null 2>&1 ; then
6219 echo "isascii() found." >&4
6222 echo "isascii() NOT found." >&4
6229 : see if killpg exists
6233 : see if link exists
6237 : see if localeconv exists
6238 set localeconv d_locconv
6241 : see if lockf exists
6245 : see if lstat exists
6249 : see if mblen exists
6253 : see if mbstowcs exists
6254 set mbstowcs d_mbstowcs
6257 : see if mbtowc exists
6261 : see if memcmp exists
6265 : see if memcpy exists
6269 : see if memmove exists
6270 set memmove d_memmove
6273 : see if memset exists
6277 : see if mkdir exists
6281 : see if mkfifo exists
6285 : see if mktime exists
6289 : see if msgctl exists
6293 : see if msgget exists
6297 : see if msgsnd exists
6301 : see if msgrcv exists
6305 : see how much of the 'msg*(2)' library is present.
6308 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
6309 *"$undef"*) h_msg=false;;
6311 : we could also check for sys/ipc.h ...
6312 if $h_msg && $test `./findhdr sys/msg.h`; then
6313 echo "You have the full msg*(2) library." >&4
6316 echo "You don't have the full msg*(2) library." >&4
6322 : see if this is a malloc.h system
6323 set malloc.h i_malloc
6326 : see if stdlib is available
6327 set stdlib.h i_stdlib
6330 : determine which malloc to compile in
6332 case "$usemymalloc" in
6333 ''|y*|true) dflt='y' ;;
6334 n*|false) dflt='n' ;;
6335 *) dflt="$usemymalloc" ;;
6337 rp="Do you wish to attempt to use the malloc that comes with $package?"
6343 mallocsrc='malloc.c'
6344 mallocobj='malloc.o'
6345 d_mymalloc="$define"
6348 : Remove malloc from list of libraries to use
6349 echo "Removing unneeded -lmalloc from library list" >&4
6350 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6353 echo "libs = $libs" >&4
6365 : compute the return types of malloc and free
6367 $cat >malloc.c <<END
6371 #include <sys/types.h>
6385 case "$malloctype" in
6387 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6394 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6398 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6405 echo "Your system uses $freetype free(), it would seem." >&4
6407 : see if nice exists
6411 : see if pause exists
6415 : see if pipe exists
6419 : see if poll exists
6423 : see if this is a pwd.h system
6429 xxx=`./findhdr pwd.h`
6430 $cppstdin $cppflags $cppminus < $xxx >$$.h
6432 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
6440 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
6448 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
6456 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
6464 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
6472 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
6484 set d_pwquota; eval $setvar
6485 set d_pwage; eval $setvar
6486 set d_pwchange; eval $setvar
6487 set d_pwclass; eval $setvar
6488 set d_pwexpire; eval $setvar
6489 set d_pwcomment; eval $setvar
6493 : see if readdir and friends exist
6494 set readdir d_readdir
6496 set seekdir d_seekdir
6498 set telldir d_telldir
6500 set rewinddir d_rewinddir
6503 : see if readlink exists
6504 set readlink d_readlink
6507 : see if rename exists
6511 : see if rmdir exists
6515 : see if memory.h is available.
6520 : See if it conflicts with string.h
6526 $cppstdin $cppflags $cppminus < $strings > mem.h
6527 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
6529 echo "We won't be including <memory.h>."
6539 : see if this is a unistd.h system
6540 set unistd.h i_unistd
6543 : can bcopy handle overlapping blocks?
6548 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
6555 $cat >>foo.c <<'EOCP'
6559 # include <memory.h>
6562 # include <stdlib.h>
6565 # include <string.h>
6567 # include <strings.h>
6570 # include <unistd.h> /* Needed for NetBSD */
6574 char buf[128], abc[128];
6580 /* Copy "abcde..." string to char abc[] so that gcc doesn't
6581 try to store the string in read-only memory. */
6582 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
6584 for (align = 7; align >= 0; align--) {
6585 for (len = 36; len; len--) {
6588 for (off = 1; off <= len; off++) {
6589 bcopy(b, b+off, len);
6590 bcopy(b+off, b, len);
6591 if (bcmp(b, abc, len))
6599 if $cc $ccflags $ldflags foo.c -o safebcpy $libs >/dev/null 2>&1; then
6600 if ./safebcpy 2>/dev/null; then
6604 echo "It can't, sorry."
6605 case "$d_memmove" in
6606 "$define") echo "But that's Ok since you have memmove()." ;;
6610 echo "(I can't compile the test program, so we'll assume not...)"
6611 case "$d_memmove" in
6612 "$define") echo "But that's Ok since you have memmove()." ;;
6617 $rm -f foo.* safebcpy core
6621 : can memcpy handle overlapping blocks?
6626 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
6633 $cat >>foo.c <<'EOCP'
6637 # include <memory.h>
6640 # include <stdlib.h>
6643 # include <string.h>
6645 # include <strings.h>
6648 # include <unistd.h> /* Needed for NetBSD */
6652 char buf[128], abc[128];
6658 /* Copy "abcde..." string to char abc[] so that gcc doesn't
6659 try to store the string in read-only memory. */
6660 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
6662 for (align = 7; align >= 0; align--) {
6663 for (len = 36; len; len--) {
6665 memcpy(b, abc, len);
6666 for (off = 1; off <= len; off++) {
6667 memcpy(b+off, b, len);
6668 memcpy(b, b+off, len);
6669 if (memcmp(b, abc, len))
6677 if $cc $ccflags $ldflags foo.c -o safemcpy $libs >/dev/null 2>&1; then
6678 if ./safemcpy 2>/dev/null; then
6682 echo "It can't, sorry."
6683 case "$d_memmove" in
6684 "$define") echo "But that's Ok since you have memmove()." ;;
6688 echo "(I can't compile the test program, so we'll assume not...)"
6689 case "$d_memmove" in
6690 "$define") echo "But that's Ok since you have memmove()." ;;
6695 $rm -f foo.* safemcpy core
6699 : see if select exists
6703 : see if semctl exists
6707 : see if semget exists
6711 : see if semop exists
6715 : see how much of the 'sem*(2)' library is present.
6718 case "$d_semctl$d_semget$d_semop" in
6719 *"$undef"*) h_sem=false;;
6721 : we could also check for sys/ipc.h ...
6722 if $h_sem && $test `./findhdr sys/sem.h`; then
6723 echo "You have the full sem*(2) library." >&4
6726 echo "You don't have the full sem*(2) library." >&4
6732 : see if setegid exists
6733 set setegid d_setegid
6736 : see if seteuid exists
6737 set seteuid d_seteuid
6740 : see if setlinebuf exists
6741 set setlinebuf d_setlinebuf
6744 : see if setlocale exists
6745 set setlocale d_setlocale
6748 : see if setpgid exists
6749 set setpgid d_setpgid
6752 : see if setpgrp2 exists
6753 set setpgrp2 d_setpgrp2
6756 : see if setpriority exists
6757 set setpriority d_setprior
6760 : see if setregid exists
6761 set setregid d_setregid
6763 set setresgid d_setresgid
6766 : see if setreuid exists
6767 set setreuid d_setreuid
6769 set setresuid d_setresuid
6772 : see if setrgid exists
6773 set setrgid d_setrgid
6776 : see if setruid exists
6777 set setruid d_setruid
6780 : see if setsid exists
6784 : see if sfio.h is available
6789 : see if sfio library is available
6800 : Ok, but do we want to use it.
6804 true|$define|[yY]*) dflt='y';;
6807 echo "$package can use the sfio library, but it is experimental."
6808 rp="You seem to have sfio available, do you want to try using it?"
6812 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
6817 *) case "$usesfio" in
6819 echo "Sorry, cannot find sfio on this machine" >&4
6820 echo "Ignoring your setting of usesfio=$usesfio" >&4
6828 $define) usesfio='true';;
6829 *) usesfio='false';;
6832 : see if shmctl exists
6836 : see if shmget exists
6840 : see if shmat exists
6843 : see what shmat returns
6846 $cat >shmat.c <<'END'
6847 #include <sys/shm.h>
6850 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
6855 echo "and it returns ($shmattype)." >&4
6856 : see if a prototype for shmat is available
6857 xxx=`./findhdr sys/shm.h`
6858 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
6859 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
6870 set d_shmatprototype
6873 : see if shmdt exists
6877 : see how much of the 'shm*(2)' library is present.
6880 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
6881 *"$undef"*) h_shm=false;;
6883 : we could also check for sys/ipc.h ...
6884 if $h_shm && $test `./findhdr sys/shm.h`; then
6885 echo "You have the full shm*(2) library." >&4
6888 echo "You don't have the full shm*(2) library." >&4
6895 : see if we have sigaction
6896 if set sigaction val -f d_sigaction; eval $csym; $val; then
6897 echo 'sigaction() found.' >&4
6900 echo 'sigaction NOT found.' >&4
6904 $cat > set.c <<'EOP'
6905 /* Solaris 2.5_x86 with SunWorks Pro C 3.0.1 doesn't have a complete
6906 sigaction structure if compiled with cc -Xc. This compile test
6907 will fail then. <doughera@lafcol.lafayette.edu>
6910 #include <sys/types.h>
6914 struct sigaction act, oact;
6918 if $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1; then
6921 echo "But you don't seem to have a useable struct sigaction." >&4
6924 set d_sigaction; eval $setvar
6925 $rm -f set set.o set.c
6927 : see if sigsetjmp exists
6929 case "$d_sigsetjmp" in
6937 if (sigsetjmp(env,1))
6944 if $cc $ccflags $ldflags -o set set.c $libs > /dev/null 2>&1 ; then
6945 if ./set >/dev/null 2>&1; then
6946 echo "POSIX sigsetjmp found." >&4
6950 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
6956 echo "sigsetjmp not found." >&4
6960 *) val="$d_sigsetjmp"
6961 case "$d_sigsetjmp" in
6962 $define) echo "POSIX sigsetjmp found." >&4;;
6963 $undef) echo "sigsetjmp not found." >&4;;
6973 : see whether socket exists
6975 $echo $n "Hmm... $c" >&4
6976 if set socket val -f d_socket; eval $csym; $val; then
6977 echo "Looks like you have Berkeley networking support." >&4
6979 if set setsockopt val -f; eval $csym; $val; then
6982 echo "...but it uses the old 4.1c interface, rather than 4.2" >&4
6986 if $contains socklib libc.list >/dev/null 2>&1; then
6987 echo "Looks like you have Berkeley networking support." >&4
6989 : we will have to assume that it supports the 4.2 BSD interface
6992 echo "You don't have Berkeley networking in libc.a..." >&4
6993 if test -f /usr/lib/libnet.a; then
6994 ( (nm $nm_opt /usr/lib/libnet.a | eval $nm_extract) || \
6995 ar t /usr/lib/libnet.a) 2>/dev/null >> libc.list
6996 if $contains socket libc.list >/dev/null 2>&1; then
6997 echo "...but the Wollongong group seems to have hacked it in." >&4
6999 sockethdr="-I/usr/netinclude"
7001 if $contains setsockopt libc.list >/dev/null 2>&1; then
7004 echo "...using the old 4.1c interface, rather than 4.2" >&4
7008 echo "or even in libnet.a, which is peculiar." >&4
7013 echo "or anywhere else I see." >&4
7020 : see if socketpair exists
7021 set socketpair d_sockpair
7024 : see if stat knows about block sizes
7026 xxx=`./findhdr sys/stat.h`
7027 if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then
7028 if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then
7029 echo "Your stat() knows about block sizes." >&4
7032 echo "Your stat() doesn't know about block sizes." >&4
7036 echo "Your stat() doesn't know about block sizes." >&4
7042 : see if _ptr and _cnt from stdio act std
7044 if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
7045 echo "(Looks like you have stdio.h from Linux.)"
7046 case "$stdio_ptr" in
7047 '') stdio_ptr='((fp)->_IO_read_ptr)'
7050 *) ptr_lval=$d_stdio_ptr_lval;;
7052 case "$stdio_cnt" in
7053 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
7056 *) cnt_lval=$d_stdio_cnt_lval;;
7058 case "$stdio_base" in
7059 '') stdio_base='((fp)->_IO_read_base)';;
7061 case "$stdio_bufsiz" in
7062 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
7065 case "$stdio_ptr" in
7066 '') stdio_ptr='((fp)->_ptr)'
7069 *) ptr_lval=$d_stdio_ptr_lval;;
7071 case "$stdio_cnt" in
7072 '') stdio_cnt='((fp)->_cnt)'
7075 *) cnt_lval=$d_stdio_cnt_lval;;
7077 case "$stdio_base" in
7078 '') stdio_base='((fp)->_base)';;
7080 case "$stdio_bufsiz" in
7081 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
7084 : test whether _ptr and _cnt really work
7085 echo "Checking how std your stdio is..." >&4
7088 #define FILE_ptr(fp) $stdio_ptr
7089 #define FILE_cnt(fp) $stdio_cnt
7091 FILE *fp = fopen("try.c", "r");
7094 18 <= FILE_cnt(fp) &&
7095 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
7102 if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1; then
7104 echo "Your stdio acts pretty std."
7107 echo "Your stdio isn't very std."
7110 echo "Your stdio doesn't appear very std."
7116 : Can _ptr be used as an lvalue?
7117 case "$d_stdstdio$ptr_lval" in
7118 $define$define) val=$define ;;
7121 set d_stdio_ptr_lval
7124 : Can _cnt be used as an lvalue?
7125 case "$d_stdstdio$cnt_lval" in
7126 $define$define) val=$define ;;
7129 set d_stdio_cnt_lval
7132 : How to access the stdio _filbuf or __filbuf function.
7133 : If this fails, check how the getc macro in stdio.h works.
7134 case "${d_stdio_ptr_lval}${d_stdio_cnt_lval}" in
7136 : Try $hint value, if any, then _filbuf, __filbuf, _fill, then punt.
7137 : _fill is for os/2.
7139 for filbuf in $stdio_filbuf '_filbuf(fp)' '__filbuf(fp) ' '_fill(fp)' ; do
7142 #define FILE_ptr(fp) $stdio_ptr
7143 #define FILE_cnt(fp) $stdio_cnt
7144 #define FILE_filbuf(fp) $filbuf
7146 FILE *fp = fopen("try.c", "r");
7149 c = FILE_filbuf(fp); /* Just looking for linker errors.*/
7153 if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1 && ./try; then
7154 echo "Your stdio appears to use $filbuf"
7155 stdio_filbuf="$filbuf"
7159 echo "Hmm. $filbuf doesn't seem to work."
7164 notok) echo "I can't figure out how to access _filbuf"
7165 echo "I'll just have to work around it."
7166 d_stdio_ptr_lval="$undef"
7167 d_stdio_cnt_lval="$undef"
7174 : see if _base is also standard
7176 case "$d_stdstdio" in
7180 #define FILE_base(fp) $stdio_base
7181 #define FILE_bufsiz(fp) $stdio_bufsiz
7183 FILE *fp = fopen("try.c", "r");
7186 19 <= FILE_bufsiz(fp) &&
7187 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
7193 if $cc $ccflags $ldflags -o try try.c $libs > /dev/null 2>&1; then
7195 echo "And its _base field acts std."
7198 echo "But its _base field isn't std."
7201 echo "However, it seems to be lacking the _base field."
7209 : see if strcoll exists
7210 set strcoll d_strcoll
7213 : check for structure copying
7215 echo "Checking to see if your C compiler can copy structs..." >&4
7216 $cat >try.c <<'EOCP'
7226 if $cc -c try.c >/dev/null 2>&1 ; then
7231 echo "Nope, it can't."
7237 : see if strerror and/or sys_errlist[] exist
7239 if set strerror val -f d_strerror; eval $csym; $val; then
7240 echo 'strerror() found.' >&4
7241 d_strerror="$define"
7242 d_strerrm='strerror(e)'
7243 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
7244 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
7245 d_syserrlst="$define"
7247 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
7248 d_syserrlst="$undef"
7250 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
7251 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
7252 echo 'strerror() found in string header.' >&4
7253 d_strerror="$define"
7254 d_strerrm='strerror(e)'
7255 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
7256 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
7257 d_syserrlst="$define"
7259 echo "(You don't appear to have any sys_errlist[], how can this be?)"
7260 d_syserrlst="$undef"
7262 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
7263 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
7265 d_syserrlst="$define"
7266 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
7268 echo 'strerror() and sys_errlist[] NOT found.' >&4
7270 d_syserrlst="$undef"
7271 d_strerrm='"unknown"'
7274 : see if strxfrm exists
7275 set strxfrm d_strxfrm
7278 : see if symlink exists
7279 set symlink d_symlink
7282 : see if syscall exists
7283 set syscall d_syscall
7286 : see if sysconf exists
7287 set sysconf d_sysconf
7290 : see if system exists
7294 : see if tcgetpgrp exists
7295 set tcgetpgrp d_tcgetpgrp
7298 : see if tcsetpgrp exists
7299 set tcsetpgrp d_tcsetpgrp
7302 : define an is-a-typedef? function
7303 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
7305 "") inclist="sys/types.h";;
7307 eval "varval=\$$var";
7311 for inc in $inclist; do
7312 echo "#include <$inc>" >>temp.c;
7314 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
7315 if $contains $type temp.E >/dev/null 2>&1; then
7321 *) eval "$var=\$varval";;
7324 : see if this is a sys/times.h system
7325 set sys/times.h i_systimes
7328 : see if times exists
7330 if set times val -f d_times; eval $csym; $val; then
7331 echo 'times() found.' >&4
7334 case "$i_systimes" in
7335 "$define") inc='sys/times.h';;
7337 set clock_t clocktype long stdio.h sys/types.h $inc
7341 rp="What type is returned by times() on this system?"
7345 echo 'times() NOT found, hope that will do.' >&4
7350 : see if truncate exists
7351 set truncate d_truncate
7354 : see if tzname[] exists
7356 if set tzname val -a d_tzname; eval $csym; $val; then
7358 echo 'tzname[] found.' >&4
7361 echo 'tzname[] NOT found.' >&4
7366 : see if umask exists
7370 : see how we will look up host name
7373 : dummy stub to allow use of elif
7374 elif set uname val -f d_uname; eval $csym; $val; then
7377 uname() was found, but you're running xenix, and older versions of xenix
7378 have a broken uname(). If you don't really know whether your xenix is old
7379 enough to have a broken system call, use the default answer.
7386 rp='Is your uname() broken?'
7389 n*) d_uname="$define"; call=uname;;
7392 echo 'uname() found.' >&4
7397 case "$d_gethname" in
7398 '') d_gethname="$undef";;
7401 '') d_uname="$undef";;
7403 case "$d_phostname" in
7404 '') d_phostname="$undef";;
7407 : backward compatibility for d_hvfork
7408 if test X$d_hvfork != X; then
7412 : see if there is a vfork
7417 : Ok, but do we want to use it. vfork is reportedly unreliable in
7418 : perl on Solaris 2.x, and probably elsewhere.
7426 rp="Some systems have problems with vfork(). Do you want to use it?"
7431 echo "Ok, we won't use vfork()."
7440 $define) usevfork='true';;
7441 *) usevfork='false';;
7444 : see if this is an sysdir system
7445 set sys/dir.h i_sysdir
7448 : see if this is an sysndir system
7449 set sys/ndir.h i_sysndir
7452 : see if closedir exists
7453 set closedir d_closedir
7456 case "$d_closedir" in
7459 echo "Checking whether closedir() returns a status..." >&4
7460 cat > closedir.c <<EOM
7461 #$i_dirent I_DIRENT /**/
7462 #$i_sysdir I_SYS_DIR /**/
7463 #$i_sysndir I_SYS_NDIR /**/
7465 #if defined(I_DIRENT)
7467 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
7468 #include <sys/dir.h>
7472 #include <sys/ndir.h>
7476 #include <ndir.h> /* may be wrong in the future */
7478 #include <sys/dir.h>
7483 int main() { return closedir(opendir(".")); }
7485 if $cc $ccflags $ldflags -o closedir closedir.c $libs > /dev/null 2>&1; then
7486 if ./closedir > /dev/null 2>&1 ; then
7487 echo "Yes, it does."
7490 echo "No, it doesn't."
7494 echo "(I can't seem to compile the test program--assuming it doesn't)"
7505 : check for volatile keyword
7507 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
7508 $cat >try.c <<'EOCP'
7511 typedef struct _goo_struct goo_struct;
7512 goo_struct * volatile goo = ((goo_struct *)0);
7513 struct _goo_struct {
7518 typedef unsigned short foo_t;
7521 volatile foo_t blech;
7525 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
7527 echo "Yup, it does."
7530 echo "Nope, it doesn't."
7536 : see if there is a wait4
7540 : see if waitpid exists
7541 set waitpid d_waitpid
7544 : see if wcstombs exists
7545 set wcstombs d_wcstombs
7548 : see if wctomb exists
7552 : preserve RCS keywords in files with variable substitution, grrr
7557 Revision='$Revision'
7559 : check for alignment requirements
7561 case "$alignbytes" in
7562 '') echo "Checking alignment constraints..." >&4
7563 $cat >try.c <<'EOCP'
7570 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
7573 if $cc $ccflags try.c -o try >/dev/null 2>&1; then
7577 echo"(I can't seem to compile the test program...)"
7580 *) dflt="$alignbytes"
7583 rp="Doubles must be aligned on a how-many-byte boundary?"
7588 : check for ordering of bytes in a long
7589 case "$byteorder" in
7593 In the following, larger digits indicate more significance. A big-endian
7594 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
7595 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
7596 machines may have weird orders like 3412. A Cray will report 87654321. If
7597 the test program works the default is probably right.
7598 I'm now running the test program...
7600 $cat >try.c <<'EOCP'
7607 char c[sizeof(long)];
7610 if (sizeof(long) > 4)
7611 u.l = (0x08070605L << 32) | 0x04030201L;
7614 for (i = 0; i < sizeof(long); i++)
7615 printf("%c", u.c[i]+'0');
7621 if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
7624 [1-4][1-4][1-4][1-4]|12345678|87654321)
7625 echo "(The test program ran ok.)"
7626 echo "byteorder=$dflt"
7629 ????|????????) echo "(The test program ran ok.)" ;;
7630 *) echo "(The test program didn't run right for some reason.)" ;;
7635 (I can't seem to compile the test program. Guessing big-endian...)
7638 case "$xxx_prompt" in
7640 rp="What is the order of bytes in a long?"
7651 : how do we catenate cpp tokens here?
7653 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
7654 $cat >cpp_stuff.c <<'EOCP'
7655 #define RCAT(a,b)a/**/b
7656 #define ACAT(a,b)a ## b
7660 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
7661 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
7662 echo "Oh! Smells like ANSI's been here."
7663 echo "We can catify or stringify, separately or together!"
7665 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
7666 echo "Ah, yes! The good old days!"
7667 echo "However, in the good old days we don't know how to stringify and"
7668 echo "catify at the same time."
7672 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
7673 to have to edit the values of CAT[2-5] in config.h...
7675 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
7679 : see if this is a db.h system
7685 : Check the return type needed for hash
7687 echo "Checking return type needed for hash for Berkeley DB ..." >&4
7693 #include <sys/types.h>
7695 u_int32_t hash_cb (ptr, size)
7703 info.hash = hash_cb;
7706 if $cc $ccflags -c try.c >try.out 2>&1 ; then
7707 if $contains warning try.out >>/dev/null 2>&1 ; then
7710 db_hashtype='u_int32_t'
7713 echo "I can't seem to compile the test program." >&4
7717 echo "Your version of Berkeley DB uses $db_hashtype for hash."
7725 : Check the return type needed for prefix
7727 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
7733 #include <sys/types.h>
7735 size_t prefix_cb (key1, key2)
7743 info.prefix = prefix_cb;
7746 if $cc $ccflags -c try.c >try.out 2>&1 ; then
7747 if $contains warning try.out >>/dev/null 2>&1 ; then
7750 db_prefixtype='size_t'
7753 echo "I can't seem to compile the test program." >&4
7757 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
7759 *) db_prefixtype='int'
7763 : check for void type
7765 echo "Checking to see how well your C compiler groks the void type..." >&4
7768 Support flag bits are:
7769 1: basic void declarations.
7770 2: arrays of pointers to functions returning void.
7771 4: operations between pointers to and addresses of void functions.
7772 8: generic void pointers.
7775 case "$voidflags" in
7777 $cat >try.c <<'EOCP'
7783 extern void moo(); /* function returning void */
7784 void (*goo)(); /* ptr to func returning void */
7786 void *hue; /* generic ptr */
7801 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
7802 voidflags=$defvoidused
7803 echo "It appears to support void to the level $package wants ($defvoidused)."
7804 if $contains warning .out >/dev/null 2>&1; then
7805 echo "However, you might get some warnings that look like this:"
7809 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
7810 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
7811 echo "It supports 1..."
7812 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
7813 echo "It also supports 2..."
7814 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
7816 echo "And it supports 4 but not 8 definitely."
7818 echo "It doesn't support 4..."
7819 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
7821 echo "But it supports 8."
7824 echo "Neither does it support 8."
7828 echo "It does not support 2..."
7829 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
7831 echo "But it supports 4 and 8."
7833 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
7835 echo "And it supports 4 but has not heard about 8."
7837 echo "However it supports 8 but not 4."
7842 echo "There is no support at all for void."
7847 : Only prompt user if support does not match the level we want
7848 case "$voidflags" in
7852 rp="Your void support flags add up to what?"
7859 : see what type file positions are declared as in the library
7860 set fpos_t fpostype long stdio.h sys/types.h
7864 rp="What is the type for file position used by fsetpos()?"
7868 : Store the full pathname to the sed program for use in the C program
7871 : see what type gids are declared as in the kernel
7872 set gid_t gidtype xxx stdio.h sys/types.h
7876 xxx=`./findhdr sys/user.h`
7877 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
7879 unsigned) dflt="$1 $2" ;;
7883 *) dflt="$gidtype";;
7886 rp="What is the type for group ids returned by getgid()?"
7890 : see if getgroups exists
7891 set getgroups d_getgrps
7894 : Find type of 2nd arg to getgroups
7896 case "$d_getgrps" in
7898 case "$groupstype" in
7899 '') dflt="$gidtype" ;;
7900 *) dflt="$groupstype" ;;
7903 What is the type of the second argument to getgroups()? Usually this
7904 is the same as group ids, $gidtype, but not always.
7907 rp='What type is the second argument to getgroups()?'
7911 *) groupstype="$gidtype";;
7917 # No dynamic loading being used, so don't bother even to prompt.
7920 *) case "$useshrplib" in
7921 '') case "$osname" in
7922 svr4|dgux|dynixptx|esix|powerux)
7924 also='Building a shared libperl is required for dynamic loading to work on your system.'
7929 also='Building a shared libperl is needed for MAB support.'
7947 The perl executable is normally obtained by linking perlmain.c with
7948 libperl${lib_ext}, any static extensions (usually just DynaLoader), and
7949 any other libraries needed on this system (such as -lm, etc.). Since
7950 your system supports dynamic loading, it is probably possible to build
7951 a shared libperl.$so. If you will have more than one executable linked
7952 to libperl.$so, this will significantly reduce the size of each
7953 executable, but it may have a noticeable affect on performance. The
7954 default is probably sensible for your system.
7957 rp="Build a shared libperl.$so (y/n)"
7962 # Why does next4 have to be so different?
7963 case "${osname}${osvers}" in
7964 next4*) xxx='DYLD_LIBRARY_PATH' ;;
7965 *) xxx='LD_LIBRARY_PATH' ;;
7969 To build perl, you must add the current working directory to your
7970 $xxx environtment variable before running make. You can do
7972 $xxx=\`pwd\`; export $xxx
7973 for Bourne-style shells, or
7975 for Csh-style shells. You *MUST* do this before running make.
7979 *) useshrplib='false' ;;
7984 case "$useshrplib" in
7988 # Figure out a good name for libperl.so. Since it gets stored in
7989 # a version-specific architecture-dependent library, the version
7990 # number isn't really that important, except for making cc/ld happy.
7992 # A name such as libperl.so.3.1
7993 majmin="libperl.$so.$patchlevel.$subversion"
7994 # A name such as libperl.so.301
7995 majonly=`echo $patchlevel $subversion |
7996 $awk '{printf "%d%02d", $1, $2}'`
7997 majonly=libperl.$so.$majonly
7998 # I'd prefer to keep the os-specific stuff here to a minimum, and
7999 # rely on figuring it out from the naming of libc.
8000 case "${osname}${osvers}" in
8003 # XXX How handle the --version stuff for MAB?
8005 *) # Try to guess based on whether libc has major.minor.
8007 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8008 *libc.$so.[0-9]*) dflt=$majonly ;;
8009 *) dflt=libperl.$so ;;
8019 I need to select a good name for the shared libperl. If your system uses
8020 library names with major and minor numbers, then you might want something
8021 like $majmin. Alternatively, if your system uses a single version
8022 number for shared libraries, then you might want to use $majonly.
8023 Or, your system might be quite happy with a simple libperl.$so.
8025 Since the shared libperl will get installed into a version-specific
8026 architecture-dependent directory, the version number of the shared perl
8027 library probably isn't important, so the default should be o.k.
8030 rp='What name do you want to give to the shared libperl?'
8033 echo "Ok, I'll use $libperl"
8036 libperl="libperl${lib_ext}"
8040 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8044 WARNING: Use of the shrpdir variable for the installation location of
8045 the shared $libperl is not supported. It was never documented and
8046 will not work in this version. Let me (doughera@lafcol.lafayette.edu)
8047 know of any problems this may cause.
8053 But your current setting of $shrpdir is
8054 the default anyway, so it's harmless.
8059 Further, your current attempted setting of $shrpdir
8060 conflicts with the value of $archlibexp/CORE
8061 that installperl will use.
8068 : see what type lseek is declared as in the kernel
8069 set off_t lseektype long stdio.h sys/types.h
8073 rp="What type is lseek's offset on this system declared as?"
8080 make=`./loc make make $pth`
8082 /*) echo make is in $make. ;;
8083 ?:[\\/]*) echo make is in $make. ;;
8084 *) echo "I don't know where 'make' is, and my life depends on it." >&4
8085 echo "Go find a make program or fix your PATH setting!" >&4
8090 *) echo make is in $make. ;;
8093 $echo $n "Checking if your $make program sets \$(MAKE)... $c" >&4
8094 case "$make_set_make" in
8096 $sed 's/^X //' > testmake.mak << 'EOF'
8098 X @echo 'ac_maketemp="$(MAKE)"'
8100 : GNU make sometimes prints "make[1]: Entering...", which would confuse us.
8101 case "`$make -f testmake.mak 2>/dev/null`" in
8102 *ac_maketemp=*) make_set_make='#' ;;
8103 *) make_set_make="MAKE=$make" ;;
8108 case "$make_set_make" in
8109 '#') echo "Yup, it does." >&4 ;;
8110 *) echo "Nope, it doesn't." >&4 ;;
8113 : see what type is used for mode_t
8114 set mode_t modetype int stdio.h sys/types.h
8118 rp="What type is used for file modes?"
8122 : locate the preferred pager for this system
8136 '') dflt=/usr/ucb/more;;
8143 rp='What pager is used on your system?'
8147 : Cruising for prototypes
8149 echo "Checking out function prototypes..." >&4
8150 $cat >prototype.c <<'EOCP'
8151 main(int argc, char *argv[]) {
8154 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8155 echo "Your C compiler appears to support function prototypes."
8158 echo "Your C compiler doesn't seem to understand function prototypes."
8165 : check for size of random number generator
8169 echo "Checking to see how many bits your rand function produces..." >&4
8175 # include <unistd.h>
8178 # include <stdlib.h>
8181 $cat >>try.c <<'EOCP'
8185 register unsigned long tmp;
8186 register unsigned long max = 0L;
8188 for (i = 1000; i; i--) {
8189 tmp = (unsigned long)rand();
8190 if (tmp > max) max = tmp;
8192 for (i = 0; max; i++)
8197 if $cc try.c -o try >/dev/null 2>&1 ; then
8201 echo "(I can't seem to compile the test program...)"
8208 rp='How many bits does your rand() function produce?'
8213 : see if ar generates random libraries by itself
8215 echo "Checking how to generate random libraries on your machine..." >&4
8216 echo 'int bar1() { return bar2(); }' > bar1.c
8217 echo 'int bar2() { return 2; }' > bar2.c
8218 $cat > foo.c <<'EOP'
8219 main() { printf("%d\n", bar1()); exit(0); }
8221 $cc $ccflags -c bar1.c >/dev/null 2>&1
8222 $cc $ccflags -c bar2.c >/dev/null 2>&1
8223 $cc $ccflags -c foo.c >/dev/null 2>&1
8224 ar rc bar.a bar2.o bar1.o >/dev/null 2>&1
8225 if $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
8226 ./foobar >/dev/null 2>&1; then
8227 echo "ar appears to generate random libraries itself."
8230 elif ar ts bar.a >/dev/null 2>&1 &&
8231 $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
8232 ./foobar >/dev/null 2>&1; then
8233 echo "a table of contents needs to be added with 'ar ts'."
8240 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
8241 $test -f $ranlib || ranlib=''
8244 if $test -n "$ranlib"; then
8245 echo "your system has '$ranlib'; we'll use that."
8248 echo "your system doesn't seem to support random libraries"
8249 echo "so we'll use lorder and tsort to order the libraries."
8256 : see if sys/select.h has to be included
8257 set sys/select.h i_sysselct
8260 : see if we should include time.h, sys/time.h, or both
8262 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8263 $echo $n "I'm now running the test program...$c"
8264 $cat >try.c <<'EOCP'
8265 #include <sys/types.h>
8270 #ifdef SYSTIMEKERNEL
8273 #include <sys/time.h>
8276 #include <sys/select.h>
8285 struct timezone tzp;
8287 if (foo.tm_sec == foo.tm_sec)
8290 if (bar.tv_sec == bar.tv_sec)
8297 for s_timezone in '-DS_TIMEZONE' ''; do
8299 for s_timeval in '-DS_TIMEVAL' ''; do
8300 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8301 for i_time in '' '-DI_TIME'; do
8302 for i_systime in '-DI_SYSTIME' ''; do
8306 $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \
8307 try.c -o try >/dev/null 2>&1 ; then
8308 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8312 $echo $n "Succeeded with $flags$c"
8324 *SYSTIMEKERNEL*) i_systimek="$define"
8325 timeincl=`./findhdr sys/time.h`
8326 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8327 *) i_systimek="$undef";;
8330 *I_TIME*) i_time="$define"
8331 timeincl=`./findhdr time.h`" $timeincl"
8332 echo "We'll include <time.h>." >&4;;
8333 *) i_time="$undef";;
8336 *I_SYSTIME*) i_systime="$define"
8337 timeincl=`./findhdr sys/time.h`" $timeincl"
8338 echo "We'll include <sys/time.h>." >&4;;
8339 *) i_systime="$undef";;
8343 : check for fd_set items
8346 Checking to see how well your C compiler handles fd_set and friends ...
8348 $cat >fd_set.c <<EOCP
8349 #$i_systime I_SYS_TIME
8350 #$i_sysselct I_SYS_SELECT
8351 #$d_socket HAS_SOCKET
8352 #include <sys/types.h>
8354 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8357 #include <sys/time.h>
8360 #include <sys/select.h>
8370 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8377 if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
8378 d_fds_bits="$define"
8380 echo "Well, your system knows about the normal fd_set typedef..." >&4
8382 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8383 d_fd_macros="$define"
8386 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8388 d_fd_macros="$undef"
8392 Hmm, your compiler has some difficulty with fd_set. Checking further...
8394 if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
8397 echo "Well, your system has some sort of fd_set available..." >&4
8399 echo "and you have the normal fd_set macros." >&4
8400 d_fd_macros="$define"
8403 but not the normal fd_set macros! Gross! More work for me...
8405 d_fd_macros="$undef"
8408 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8411 d_fd_macros="$undef"
8417 : check for type of arguments to select. This will only really
8418 : work if the system supports prototypes and provides one for
8422 : Make initial guess
8423 case "$selecttype" in
8426 $define) xxx='fd_set *' ;;
8430 *) xxx="$selecttype"
8435 'fd_set *') yyy='int *' ;;
8436 'int *') yyy='fd_set *' ;;
8441 Checking to see what type of arguments are expected by select().
8444 #$i_systime I_SYS_TIME
8445 #$i_sysselct I_SYS_SELECT
8446 #$d_socket HAS_SOCKET
8447 #include <sys/types.h>
8449 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8452 #include <sys/time.h>
8455 #include <sys/select.h>
8460 Select_fd_set_t readfds;
8461 Select_fd_set_t writefds;
8462 Select_fd_set_t exceptfds;
8463 struct timeval timeout;
8464 select(width, readfds, writefds, exceptfds, &timeout);
8468 if $cc $ccflags -c -DSelect_fd_set_t="$xxx" try.c >/dev/null 2>&1 ; then
8470 echo "Your system uses $xxx for the arguments to select." >&4
8471 elif $cc $ccflags -c -DSelect_fd_set_t="$yyy" try.c >/dev/null 2>&1 ; then
8473 echo "Your system uses $yyy for the arguments to select." >&4
8475 rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
8482 *) selecttype='int *'
8486 : Trace out the files included by signal.h, then look for SIGxxx names.
8487 : Remove SIGARRAYSIZE used by HPUX.
8488 : Remove SIGTYP void lines used by OS2.
8489 xxx=`echo '#include <signal.h>' |
8490 $cppstdin $cppminus $cppflags 2>/dev/null |
8491 $grep '^[ ]*#.*include' |
8492 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
8493 : Check this list of files to be sure we have parsed the cpp output ok.
8494 : This will also avoid potentially non-existent files, such
8497 for xx in $xxx /dev/null ; do
8498 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
8500 : If we have found no files, at least try signal.h
8502 '') xxxfiles=`./findhdr signal.h` ;;
8505 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ {
8506 print substr($2, 4, 20)
8508 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
8509 print substr($3, 4, 20)
8511 : Append some common names just in case the awk scan failed.
8512 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
8513 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
8514 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
8515 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
8516 : generate a few handy files for later
8517 $cat > signal.c <<'EOP'
8518 #include <sys/types.h>
8522 /* Strange style to avoid deeply-nested #if/#else/#endif */
8525 # define NSIG (_NSIG)
8531 # define NSIG (SIGMAX+1)
8537 # define NSIG (SIG_MAX+1)
8543 # define NSIG (MAXSIG+1)
8549 # define NSIG (MAX_SIG+1)
8554 # ifdef SIGARRAYSIZE
8555 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
8561 # define NSIG (_sys_nsig) /* Solaris 2.5 */
8565 /* Default to some arbitrary number that's big enough to get most
8566 of the common signals.
8572 printf("NSIG %d\n", NSIG);
8575 echo $xxx | $tr ' ' '\012' | $sort | $uniq | $awk '
8577 printf "#ifdef SIG"; printf $1; printf "\n"
8578 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
8579 printf $1; printf ");\n"
8586 $cat >signal.awk <<'EOP'
8588 $1 ~ /^NSIG$/ { nsig = $2 }
8589 ($1 !~ /^NSIG$/) && (NF == 2) {
8590 if ($2 > maxsig) { maxsig = $2 }
8592 dup_name[ndups] = $1
8603 if (nsig == 0) { nsig = maxsig + 1 }
8604 for (n = 1; n < nsig; n++) {
8606 printf("%s %d\n", sig_name[n], sig_num[n])
8609 printf("NUM%d %d\n", n, n)
8612 for (n = 0; n < ndups; n++) {
8613 printf("%s %d\n", dup_name[n], dup_num[n])
8617 $cat >signal_cmd <<EOS
8619 $test -s signal.lst && exit 0
8620 if $cc $ccflags signal.c -o signal $ldflags >/dev/null 2>&1; then
8621 ./signal | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
8623 echo "(I can't seem be able to compile the test program -- Guessing)"
8624 echo 'kill -l' >signal
8625 set X \`csh -f <signal\`
8629 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
8631 echo \$@ | $tr ' ' '\012' | \
8632 $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
8634 $rm -f signal.c signal signal.o
8636 chmod a+x signal_cmd
8637 $eunicefix signal_cmd
8639 : generate list of signal names
8649 echo "Generating a list of signal names and numbers..." >&4
8651 sig_name=`$awk '{printf "%s ", $1}' signal.lst`
8652 sig_name="ZERO $sig_name"
8653 sig_num=`$awk '{printf "%d ", $2}' signal.lst`
8654 sig_num="0 $sig_num"
8657 echo "The following signals are available:"
8659 echo $sig_name | $awk \
8660 'BEGIN { linelen = 0 }
8662 for (i = 1; i <= NF; i++) {
8664 linelen = linelen + length(name)
8667 linelen = length(name)
8673 $rm -f signal signal.c signal.awk signal.lst signal_cmd
8675 : see what type is used for size_t
8676 set size_t sizetype 'unsigned int' stdio.h sys/types.h
8680 rp="What type is used for the length parameter for string functions?"
8684 : see what type is used for signed size_t
8685 set ssize_t ssizetype int stdio.h sys/types.h
8688 $cat > ssize.c <<EOM
8690 #include <sys/types.h>
8691 #define Size_t $sizetype
8692 #define SSize_t $dflt
8695 if (sizeof(Size_t) == sizeof(SSize_t))
8697 else if (sizeof(Size_t) == sizeof(int))
8705 if $cc $ccflags $ldflags -o ssize ssize.c $libs > /dev/null 2>&1 &&
8706 ./ssize > /dev/null 2>&1 ; then
8708 echo "I'll be using $ssizetype for functions returning a byte count." >&4
8710 echo "(I can't compile and run the test program--please enlighten me!)"
8713 I need a type that is the same size as $sizetype, but is guaranteed to
8714 be signed. Common values are int and long.
8717 rp="What signed type is the same size as $sizetype?"
8721 $rm -f ssize ssize.[co]
8723 : see what type of char stdio uses.
8725 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
8726 echo "Your stdio uses unsigned chars." >&4
8727 stdchar="unsigned char"
8729 echo "Your stdio uses signed chars." >&4
8733 : see if time exists
8735 if set time val -f d_time; eval $csym; $val; then
8736 echo 'time() found.' >&4
8738 set time_t timetype long stdio.h sys/types.h
8742 rp="What type is returned by time() on this system?"
8746 echo 'time() not found, hope that will do.' >&4
8753 : see what type uids are declared as in the kernel
8754 set uid_t uidtype xxx stdio.h sys/types.h
8758 xxx=`./findhdr sys/user.h`
8759 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
8761 unsigned) dflt="$1 $2" ;;
8765 *) dflt="$uidtype";;
8768 rp="What is the type for user ids returned by getuid()?"
8772 : see if dbm.h is available
8773 : see if dbmclose exists
8774 set dbmclose d_dbmclose
8777 case "$d_dbmclose" in
8787 *) set rpcsvc/dbm.h i_rpcsvcdbm
8792 *) echo "We won't be including <dbm.h>"
8802 : see if this is a sys/file.h system
8807 : do we need to include sys/file.h ?
8813 echo "We'll be including <sys/file.h>." >&4
8816 echo "We won't be including <sys/file.h>." >&4
8826 : see if fcntl.h is there
8831 : see if we can include fcntl.h
8837 echo "We'll be including <fcntl.h>." >&4
8841 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
8843 echo "We won't be including <fcntl.h>." >&4
8855 : see if this is an grp system
8859 : see if locale.h is available
8860 set locale.h i_locale
8863 : see if this is a math.h system
8867 : see if ndbm.h is available
8872 : see if dbm_open exists
8873 set dbm_open d_dbm_open
8875 case "$d_dbm_open" in
8878 echo "We won't be including <ndbm.h>"
8887 : see if net/errno.h is available
8892 : Unfortunately, it causes problems on some systems. Arrgh.
8898 #include <net/errno.h>
8904 if $cc $ccflags -c try.c >/dev/null 2>&1; then
8905 echo "We'll be including <net/errno.h>." >&4
8907 echo "We won't be including <net/errno.h>." >&4
8916 : get C preprocessor symbols handy
8918 $echo $n "Hmm... $c"
8919 echo $al | $tr ' ' '\012' >Cppsym.know
8931 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
8933 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
8936 unknown="\$unknown \$sym"
8946 echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
8948 exit 0; _ _ _ _\1\\ \1\\
8951 echo "exit 1; _ _ _" >>Cppsym\$\$
8952 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
8954 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
8960 $rm -f Cppsym\$\$ Cppsym2\$\$
8965 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
8967 : now check the C compiler for additional symbols
8973 for i in \`$cc -v -c tmp.c 2>&1\`
8976 -D*) echo "\$i" | $sed 's/^-D//';;
8977 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
8984 ./ccsym | $sort | $uniq >ccsym.raw
8985 $awk '/\=/ { print $0; next }
8986 { print $0"=1" }' ccsym.raw >ccsym.list
8987 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
8988 $comm -13 ccsym.true ccsym.list >ccsym.own
8989 $comm -12 ccsym.true ccsym.list >ccsym.com
8990 $comm -23 ccsym.true ccsym.list >ccsym.cpp
8993 if $test -z ccsym.raw; then
8994 echo "Your C compiler doesn't seem to define any symbol!" >&4
8996 echo "However, your C preprocessor defines the following ones:"
8999 if $test -s ccsym.com; then
9000 echo "Your C compiler and pre-processor define these symbols:"
9001 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
9004 $test "$silent" || sleep 1
9006 if $test -s ccsym.cpp; then
9007 $test "$also" && echo " "
9008 echo "Your C pre-processor ${also}defines the following $symbols:"
9009 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
9011 $test "$silent" || sleep 1
9013 if $test -s ccsym.own; then
9014 $test "$also" && echo " "
9015 echo "Your C compiler ${also}defines the following cpp variables:"
9016 $sed -e 's/\(.*\)=1/\1/' ccsym.own
9017 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
9018 $test "$silent" || sleep 1
9023 : see if this is a termio system
9027 if $test `./findhdr termios.h`; then
9028 set tcsetattr i_termios
9034 "$define") echo "You have POSIX termios.h... good!" >&4;;
9035 *) if ./Cppsym pyr; then
9036 case "`/bin/universe`" in
9037 ucb) if $test `./findhdr sgtty.h`; then
9039 echo "<sgtty.h> found." >&4
9041 echo "System is pyramid with BSD universe."
9042 echo "<sgtty.h> not found--you could have problems." >&4
9044 *) if $test `./findhdr termio.h`; then
9046 echo "<termio.h> found." >&4
9048 echo "System is pyramid with USG universe."
9049 echo "<termio.h> not found--you could have problems." >&4
9053 if $test `./findhdr termio.h`; then
9054 echo "<termio.h> found." >&4
9056 elif $test `./findhdr sgtty.h`; then
9057 echo "<sgtty.h> found." >&4
9060 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
9063 if $test `./findhdr sgtty.h`; then
9064 echo "<sgtty.h> found." >&4
9066 elif $test `./findhdr termio.h`; then
9067 echo "<termio.h> found." >&4
9070 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
9074 set i_termio; eval $setvar
9075 val=$val2; set i_sgtty; eval $setvar
9076 val=$val3; set i_termios; eval $setvar
9078 : see if stdarg is available
9080 if $test `./findhdr stdarg.h`; then
9081 echo "<stdarg.h> found." >&4
9084 echo "<stdarg.h> NOT found." >&4
9088 : see if varags is available
9090 if $test `./findhdr varargs.h`; then
9091 echo "<varargs.h> found." >&4
9093 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
9096 : set up the varargs testing programs
9097 $cat > varargs.c <<EOP
9102 #include <varargs.h>
9120 p = va_arg(ap, char *);
9125 $cat > varargs <<EOP
9127 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
9136 : now check which varargs header should be included
9141 if `./varargs I_STDARG`; then
9143 elif `./varargs I_VARARGS`; then
9148 if `./varargs I_VARARGS`; then
9155 echo "I could not find the definition for va_dcl... You have problems..." >&4
9156 val="$undef"; set i_stdarg; eval $setvar
9157 val="$undef"; set i_varargs; eval $setvar
9164 val="$define"; set i_stdarg; eval $setvar
9165 val="$undef"; set i_varargs; eval $setvar
9168 val="$undef"; set i_stdarg; eval $setvar
9169 val="$define"; set i_varargs; eval $setvar
9172 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
9176 : see if stddef is available
9177 set stddef.h i_stddef
9180 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
9181 set sys/filio.h i_sysfilio
9184 if $test `./findhdr sys/ioctl.h`; then
9186 echo '<sys/ioctl.h> found.' >&4
9189 if $test $i_sysfilio = "$define"; then
9190 echo '<sys/ioctl.h> NOT found.' >&4
9192 $test $i_sgtty = "$define" && xxx="sgtty.h"
9193 $test $i_termio = "$define" && xxx="termio.h"
9194 $test $i_termios = "$define" && xxx="termios.h"
9195 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
9201 : see if this is a sys/param system
9202 set sys/param.h i_sysparam
9205 : see if sys/resource.h has to be included
9206 set sys/resource.h i_sysresrc
9209 : see if sys/stat.h is available
9210 set sys/stat.h i_sysstat
9213 : see if sys/types.h has to be included
9214 set sys/types.h i_systypes
9217 : see if this is a sys/un.h system
9218 set sys/un.h i_sysun
9221 : see if this is a syswait system
9222 set sys/wait.h i_syswait
9225 : see if this is an utime system
9229 : see if this is a values.h system
9230 set values.h i_values
9233 : see if this is a vfork system
9244 : see if gdbm.h is available
9249 : see if gdbm_open exists
9250 set gdbm_open d_gdbm_open
9252 case "$d_gdbm_open" in
9255 echo "We won't be including <gdbm.h>"
9265 echo "Looking for extensions..." >&4
9267 : If we are using the old config.sh, known_extensions may contain
9268 : old or inaccurate or duplicate values.
9270 : We do not use find because it might not be available.
9271 : We do not just use MANIFEST because the user may have dropped
9272 : some additional extensions into the source tree and expect them
9275 if $test -f $xxx/$xxx.xs; then
9276 known_extensions="$known_extensions $xxx"
9278 if $test -d $xxx; then
9281 if $test -f $yyy/$yyy.xs; then
9282 known_extensions="$known_extensions $xxx/$yyy"
9289 set X $known_extensions
9291 known_extensions="$*"
9294 : Now see which are supported on this system.
9296 for xxx in $known_extensions ; do
9298 DB_File) case "$i_db" in
9299 $define) avail_ext="$avail_ext $xxx" ;;
9302 GDBM_File) case "$i_gdbm" in
9303 $define) avail_ext="$avail_ext $xxx" ;;
9306 NDBM_File) case "$i_ndbm" in
9307 $define) avail_ext="$avail_ext $xxx" ;;
9310 ODBM_File) case "${i_dbm}${i_rpcsvcdbm}" in
9311 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
9314 POSIX) case "$useposix" in
9315 true|define|y) avail_ext="$avail_ext $xxx" ;;
9318 Opcode) case "$useopcode" in
9319 true|define|y) avail_ext="$avail_ext $xxx" ;;
9322 Socket) case "$d_socket" in
9323 $define) avail_ext="$avail_ext $xxx" ;;
9326 *) avail_ext="$avail_ext $xxx"
9338 A number of extensions are supplied with $package. You may choose to
9339 compile these extensions for dynamic loading (the default), compile
9340 them into the $package executable (static loading), or not include
9341 them at all. Answer "none" to include no extensions.
9344 case "$dynamic_ext" in
9345 '') dflt="$avail_ext" ;;
9346 *) dflt="$dynamic_ext" ;;
9351 rp="What extensions do you wish to load dynamically?"
9354 none) dynamic_ext=' ' ;;
9355 *) dynamic_ext="$ans" ;;
9358 case "$static_ext" in
9360 : Exclude those already listed in dynamic linking
9362 for xxx in $avail_ext; do
9363 case " $dynamic_ext " in
9365 *) dflt="$dflt $xxx" ;;
9372 *) dflt="$static_ext"
9379 rp="What extensions do you wish to load statically?"
9382 none) static_ext=' ' ;;
9383 *) static_ext="$ans" ;;
9388 A number of extensions are supplied with $package. Answer "none"
9389 to include no extensions.
9392 case "$static_ext" in
9393 '') dflt="$avail_ext" ;;
9394 *) dflt="$static_ext" ;;
9400 rp="What extensions do you wish to include?"
9403 none) static_ext=' ' ;;
9404 *) static_ext="$ans" ;;
9409 set X $dynamic_ext $static_ext
9413 : Remove build directory name from cppstdin so it can be used from
9414 : either the present location or the final installed location.
9416 : Get out of the UU directory to get correct path name.
9420 echo "Stripping down cppstdin path name"
9426 : end of configuration questions
9428 echo "End of configuration questions."
9431 : back to where it started
9432 if test -d ../UU; then
9436 : configuration may be patched via a 'config.over' file
9437 if $test -f config.over; then
9440 rp='I see a config.over file. Do you wish to load it?'
9443 n*) echo "OK, I'll ignore it.";;
9445 echo "Configuration override changes have been loaded."
9450 : in case they want portability, strip down executable paths
9451 case "$d_portable" in
9454 echo "Stripping down executable paths..." >&4
9455 for file in $loclist $trylist; do
9461 : create config.sh file
9463 echo "Creating config.sh..." >&4
9464 $spitshell <<EOT >config.sh
9467 # This file was produced by running the Configure script. It holds all the
9468 # definitions figured out by Configure. Should you modify one of these values,
9469 # do not forget to propagate your changes by running "Configure -der". You may
9470 # instead choose to run each of the .SH files by yourself, or "Configure -S".
9473 # Configuration time: $cf_time
9474 # Configured by: $cf_by
9475 # Target system: $myuname
9485 Revision='$Revision'
9489 alignbytes='$alignbytes'
9490 aphostname='$aphostname'
9493 archlibexp='$archlibexp'
9494 archname='$archname'
9495 archobjs='$archobjs'
9503 byteorder='$byteorder'
9505 castflags='$castflags'
9508 cccdlflags='$cccdlflags'
9509 ccdlflags='$ccdlflags'
9512 cf_email='$cf_email'
9517 clocktype='$clocktype'
9519 compress='$compress'
9520 contains='$contains'
9524 cpp_stuff='$cpp_stuff'
9525 cppflags='$cppflags'
9527 cppminus='$cppminus'
9529 cppstdin='$cppstdin'
9530 cryptlib='$cryptlib'
9532 d_Gconvert='$d_Gconvert'
9533 d_access='$d_access'
9535 d_archlib='$d_archlib'
9536 d_attribut='$d_attribut'
9540 d_bsdpgrp='$d_bsdpgrp'
9542 d_casti32='$d_casti32'
9543 d_castneg='$d_castneg'
9544 d_charvspr='$d_charvspr'
9546 d_chroot='$d_chroot'
9547 d_chsize='$d_chsize'
9548 d_closedir='$d_closedir'
9552 d_cuserid='$d_cuserid'
9553 d_dbl_dig='$d_dbl_dig'
9554 d_difftime='$d_difftime'
9555 d_dirnamlen='$d_dirnamlen'
9556 d_dlerror='$d_dlerror'
9557 d_dlopen='$d_dlopen'
9558 d_dlsymun='$d_dlsymun'
9559 d_dosuid='$d_dosuid'
9561 d_eofnblk='$d_eofnblk'
9562 d_eunice='$d_eunice'
9563 d_fchmod='$d_fchmod'
9564 d_fchown='$d_fchown'
9566 d_fd_macros='$d_fd_macros'
9567 d_fd_set='$d_fd_set'
9568 d_fds_bits='$d_fds_bits'
9569 d_fgetpos='$d_fgetpos'
9570 d_flexfnam='$d_flexfnam'
9573 d_fpathconf='$d_fpathconf'
9574 d_fsetpos='$d_fsetpos'
9575 d_getgrps='$d_getgrps'
9576 d_gethent='$d_gethent'
9577 d_gethname='$d_gethname'
9578 d_getlogin='$d_getlogin'
9579 d_getpgrp2='$d_getpgrp2'
9580 d_getpgrp='$d_getpgrp'
9581 d_getppid='$d_getppid'
9582 d_getprior='$d_getprior'
9585 d_isascii='$d_isascii'
9586 d_killpg='$d_killpg'
9588 d_locconv='$d_locconv'
9592 d_mbstowcs='$d_mbstowcs'
9593 d_mbtowc='$d_mbtowc'
9594 d_memcmp='$d_memcmp'
9595 d_memcpy='$d_memcpy'
9596 d_memmove='$d_memmove'
9597 d_memset='$d_memset'
9599 d_mkfifo='$d_mkfifo'
9600 d_mktime='$d_mktime'
9602 d_msgctl='$d_msgctl'
9603 d_msgget='$d_msgget'
9604 d_msgrcv='$d_msgrcv'
9605 d_msgsnd='$d_msgsnd'
9606 d_mymalloc='$d_mymalloc'
9608 d_oldarchlib='$d_oldarchlib'
9609 d_oldsock='$d_oldsock'
9611 d_pathconf='$d_pathconf'
9613 d_phostname='$d_phostname'
9616 d_portable='$d_portable'
9618 d_pwchange='$d_pwchange'
9619 d_pwclass='$d_pwclass'
9620 d_pwcomment='$d_pwcomment'
9621 d_pwexpire='$d_pwexpire'
9622 d_pwquota='$d_pwquota'
9623 d_readdir='$d_readdir'
9624 d_readlink='$d_readlink'
9625 d_rename='$d_rename'
9626 d_rewinddir='$d_rewinddir'
9628 d_safebcpy='$d_safebcpy'
9629 d_safemcpy='$d_safemcpy'
9630 d_seekdir='$d_seekdir'
9631 d_select='$d_select'
9633 d_semctl='$d_semctl'
9634 d_semget='$d_semget'
9636 d_setegid='$d_setegid'
9637 d_seteuid='$d_seteuid'
9638 d_setlinebuf='$d_setlinebuf'
9639 d_setlocale='$d_setlocale'
9640 d_setpgid='$d_setpgid'
9641 d_setpgrp2='$d_setpgrp2'
9642 d_setpgrp='$d_setpgrp'
9643 d_setprior='$d_setprior'
9644 d_setregid='$d_setregid'
9645 d_setresgid='$d_setresgid'
9646 d_setresuid='$d_setresuid'
9647 d_setreuid='$d_setreuid'
9648 d_setrgid='$d_setrgid'
9649 d_setruid='$d_setruid'
9650 d_setsid='$d_setsid'
9654 d_shmatprototype='$d_shmatprototype'
9655 d_shmctl='$d_shmctl'
9657 d_shmget='$d_shmget'
9658 d_sigaction='$d_sigaction'
9659 d_sigsetjmp='$d_sigsetjmp'
9660 d_socket='$d_socket'
9661 d_sockpair='$d_sockpair'
9662 d_statblks='$d_statblks'
9663 d_stdio_cnt_lval='$d_stdio_cnt_lval'
9664 d_stdio_ptr_lval='$d_stdio_ptr_lval'
9665 d_stdiobase='$d_stdiobase'
9666 d_stdstdio='$d_stdstdio'
9667 d_strchr='$d_strchr'
9668 d_strcoll='$d_strcoll'
9669 d_strctcpy='$d_strctcpy'
9670 d_strerrm='$d_strerrm'
9671 d_strerror='$d_strerror'
9672 d_strxfrm='$d_strxfrm'
9673 d_suidsafe='$d_suidsafe'
9674 d_symlink='$d_symlink'
9675 d_syscall='$d_syscall'
9676 d_sysconf='$d_sysconf'
9677 d_sysernlst='$d_sysernlst'
9678 d_syserrlst='$d_syserrlst'
9679 d_system='$d_system'
9680 d_tcgetpgrp='$d_tcgetpgrp'
9681 d_tcsetpgrp='$d_tcsetpgrp'
9682 d_telldir='$d_telldir'
9685 d_truncate='$d_truncate'
9686 d_tzname='$d_tzname'
9690 d_void_closedir='$d_void_closedir'
9691 d_voidsig='$d_voidsig'
9692 d_voidtty='$d_voidtty'
9693 d_volatile='$d_volatile'
9694 d_vprintf='$d_vprintf'
9696 d_waitpid='$d_waitpid'
9697 d_wcstombs='$d_wcstombs'
9698 d_wctomb='$d_wctomb'
9701 db_hashtype='$db_hashtype'
9702 db_prefixtype='$db_prefixtype'
9703 defvoidused='$defvoidused'
9704 direntrytype='$direntrytype'
9707 dynamic_ext='$dynamic_ext'
9712 eunicefix='$eunicefix'
9715 extensions='$extensions'
9717 firstmakefile='$firstmakefile'
9719 fpostype='$fpostype'
9720 freetype='$freetype'
9721 full_csh='$full_csh'
9722 full_sed='$full_sed'
9724 gccversion='$gccversion'
9728 groupcat='$groupcat'
9729 groupstype='$groupstype'
9732 h_sysfile='$h_sysfile'
9736 i_bsdioctl='$i_bsdioctl'
9739 i_dirent='$i_dirent'
9746 i_limits='$i_limits'
9747 i_locale='$i_locale'
9748 i_malloc='$i_malloc'
9750 i_memory='$i_memory'
9752 i_neterrno='$i_neterrno'
9755 i_rpcsvcdbm='$i_rpcsvcdbm'
9758 i_stdarg='$i_stdarg'
9759 i_stddef='$i_stddef'
9760 i_stdlib='$i_stdlib'
9761 i_string='$i_string'
9762 i_sysdir='$i_sysdir'
9763 i_sysfile='$i_sysfile'
9764 i_sysfilio='$i_sysfilio'
9766 i_sysioctl='$i_sysioctl'
9767 i_sysndir='$i_sysndir'
9768 i_sysparam='$i_sysparam'
9769 i_sysresrc='$i_sysresrc'
9770 i_sysselct='$i_sysselct'
9771 i_syssockio='$i_syssockio'
9772 i_sysstat='$i_sysstat'
9773 i_systime='$i_systime'
9774 i_systimek='$i_systimek'
9775 i_systimes='$i_systimes'
9776 i_systypes='$i_systypes'
9778 i_syswait='$i_syswait'
9779 i_termio='$i_termio'
9780 i_termios='$i_termios'
9782 i_unistd='$i_unistd'
9784 i_values='$i_values'
9785 i_varargs='$i_varargs'
9786 i_varhdr='$i_varhdr'
9790 installarchlib='$installarchlib'
9791 installbin='$installbin'
9792 installman1dir='$installman1dir'
9793 installman3dir='$installman3dir'
9794 installprivlib='$installprivlib'
9795 installscript='$installscript'
9796 installsitearch='$installsitearch'
9797 installsitelib='$installsitelib'
9799 known_extensions='$known_extensions'
9803 lddlflags='$lddlflags'
9811 libswanted='$libswanted'
9817 locincpth='$locincpth'
9818 loclibpth='$loclibpth'
9822 lseektype='$lseektype'
9826 make_set_make='$make_set_make'
9827 mallocobj='$mallocobj'
9828 mallocsrc='$mallocsrc'
9829 malloctype='$malloctype'
9831 man1direxp='$man1direxp'
9834 man3direxp='$man3direxp'
9838 mips_type='$mips_type'
9841 modetype='$modetype'
9844 myarchname='$myarchname'
9845 mydomain='$mydomain'
9846 myhostname='$myhostname'
9850 nm_so_opt='$nm_so_opt'
9852 o_nonblock='$o_nonblock'
9854 oldarchlib='$oldarchlib'
9855 oldarchlibexp='$oldarchlibexp'
9856 optimize='$optimize'
9857 orderlib='$orderlib'
9863 patchlevel='$patchlevel'
9864 path_sep='$path_sep'
9866 perladmin='$perladmin'
9867 perlpath='$perlpath'
9869 phostname='$phostname'
9874 prefixexp='$prefixexp'
9876 privlibexp='$privlibexp'
9877 prototype='$prototype'
9878 randbits='$randbits'
9880 rd_nodata='$rd_nodata'
9884 scriptdir='$scriptdir'
9885 scriptdirexp='$scriptdirexp'
9887 selecttype='$selecttype'
9888 sendmail='$sendmail'
9891 sharpbang='$sharpbang'
9892 shmattype='$shmattype'
9894 sig_name='$sig_name'
9896 signal_t='$signal_t'
9897 sitearch='$sitearch'
9898 sitearchexp='$sitearchexp'
9900 sitelibexp='$sitelibexp'
9901 sizetype='$sizetype'
9906 sockethdr='$sockethdr'
9907 socketlib='$socketlib'
9909 spackage='$spackage'
9910 spitshell='$spitshell'
9912 ssizetype='$ssizetype'
9913 startperl='$startperl'
9915 static_ext='$static_ext'
9917 stdio_base='$stdio_base'
9918 stdio_bufsiz='$stdio_bufsiz'
9919 stdio_cnt='$stdio_cnt'
9920 stdio_filbuf='$stdio_filbuf'
9921 stdio_ptr='$stdio_ptr'
9924 subversion='$subversion'
9930 timeincl='$timeincl'
9931 timetype='$timetype'
9939 usemymalloc='$usemymalloc'
9941 useopcode='$useopcode'
9942 useperlio='$useperlio'
9943 useposix='$useposix'
9945 useshrplib='$useshrplib'
9946 usevfork='$usevfork'
9950 voidflags='$voidflags'
9956 : add special variables
9957 $test -f patchlevel.h && \
9958 awk '/^#define/ {printf "%s=%s\n",$2,$3}' patchlevel.h >>config.sh
9959 echo "CONFIG=true" >>config.sh
9961 : propagate old symbols
9962 if $test -f UU/config.sh; then
9963 <UU/config.sh sort | uniq >UU/oldconfig.sh
9964 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
9965 sort | uniq -u >UU/oldsyms
9966 set X `cat UU/oldsyms`
9972 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
9974 echo "# Variables propagated from previous config.sh file." >>config.sh
9975 for sym in `cat UU/oldsyms`; do
9976 echo " Propagating $hint variable "'$'"$sym..."
9977 eval 'tmp="$'"${sym}"'"'
9979 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
9985 : Finish up by extracting the .SH files
9999 If you'd like to make any changes to the config.sh file before I begin
10000 to configure things, do it as a shell escape now (e.g. !vi config.sh).
10003 rp="Press return or use a shell escape to edit config.sh:"
10008 *) : in case they cannot read
10009 sh 1>&4 -c "$ans";;
10014 : if this fails, just run all the .SH files by hand
10021 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
10028 Now you need to generate make dependencies by running "make depend".
10029 You might prefer to run it in background: "make depend > makedepend.out &"
10030 It can take a while, so you might not want to run it right now.
10035 rp="Run make depend now?"
10039 make depend && echo "Now you must run a make."
10042 echo "You must run 'make depend' then 'make'."
10045 elif test -f [Mm]akefile; then
10047 echo "Now you must run a make."
10052 $rm -f kit*isdone ark*isdone