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 and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Tue Jul 7 10:10:21 EDT 1998 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by doughera@lafayette.edu)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
60 if test X"$trnl" = X; then
61 case "`echo foo|tr '\n' x 2>/dev/null`" in
67 if test X"$trnl" = X; then
68 case "`echo foo|tr '\012' x 2>/dev/null`" in
74 if test -n "$DJGPP"; then
77 if test X"$trnl" = X; then
80 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
86 : Proper separator for the PATH environment variable
88 : On OS/2 this directory should exist if this is not floppy only system :-]
89 if test -d c:/. ; then
90 if test -n "$OS2_SHELL"; then
92 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
93 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
94 elif test -n "$DJGPP"; then
100 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
101 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
102 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
103 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
104 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
105 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
106 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
107 paths="$paths /sbin /usr/sbin /usr/libexec"
111 case "$p_$PATH$p_" in
113 *) test -d $p && PATH=$PATH$p_$p ;;
120 : shall we be using ksh?
126 if (PATH=.; alias -x) >/dev/null 2>&1; then
129 if test -f /hp-ux -a -f /bin/ksh; then
130 needksh='to avoid sh bug in "here document" expansion'
132 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
133 if test X`/usr/bin/uname -v` = X4; then
134 avoidksh="to avoid AIX 4's /bin/sh"
138 case "$inksh/$needksh" in
145 case "$inksh/$avoidksh" in
151 case "$inksh/$needksh-$avoidksh-" in
154 (I see you are using the Korn shell. Some ksh's blow up on $me,
155 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
161 echo "(Feeding myself to $newsh $reason.)"
163 Configure|*/Configure) exec $newsh $0 "$@";;
164 *) exec $newsh Configure "$@";;
169 : if needed set CDPATH to a harmless value that is not chatty
170 : avoid bash 2.02 problems with empty CDPATH.
174 *bash*) CDPATH='.' ;;
179 : Configure runs within the UU subdirectory
180 test -d UU || mkdir UU
433 d_pthreads_created_joinable=''
741 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
744 : We must find out about Eunice early
746 if test -f /etc/unixtovms; then
747 eunicefix=/etc/unixtovms
749 if test -f /etc/unixtovms.exe; then
750 eunicefix=/etc/unixtovms.exe
753 : list of known cpp symbols, sorted alphabetically
754 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
755 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
756 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
757 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
758 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
759 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
760 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
761 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
762 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
763 al="$al VMS Xenix286"
764 al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI"
765 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
766 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
767 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
768 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
769 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
770 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
771 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
772 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
773 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
774 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
775 al="$al __SVR4_2__ __UMAXV__"
776 al="$al ____386BSD____ __alpha __alpha__ __amiga"
777 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
778 al="$al __host_mips__"
779 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
780 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
781 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
782 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
783 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
784 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
785 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
786 al="$al __mc88100 __mc88100__ __mips __mips__"
787 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
788 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
789 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
790 al="$al _host_mips _mips _unix"
791 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
792 al="$al apollo ardent att386 att3b"
793 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
794 al="$al cadmus clipper concurrent convex cray ctix"
795 al="$al dmert encore gcos gcx gimpel gould"
796 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
797 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
798 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
799 al="$al i186 i286 i386 i486 i8086"
800 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
801 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
802 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
803 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
804 al="$al mc88000 mc88100 merlin mert mips mvs n16"
805 al="$al ncl_el ncl_mr"
806 al="$al news1500 news1700 news1800 news1900 news3700"
807 al="$al news700 news800 news900 ns16000 ns32000"
808 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
809 al="$al parisc pc532 pdp11 plexus posix pyr"
810 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
811 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
812 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
813 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
814 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
815 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
819 : change the next line if compiling for Xenix/286 on Xenix/386
820 xlibpth='/usr/lib/386 /lib/386'
822 : Possible local library directories to search.
823 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
824 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
826 : general looking path for locating libraries
827 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
828 glibpth="$glibpth /lib /usr/lib $xlibpth"
829 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
830 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
832 : Private path used by Configure to find libraries. Its value
833 : is prepended to libpth. This variable takes care of special
834 : machines, like the mips. Usually, it should be empty.
837 : default library list
839 : Possible local include directories to search.
840 : Set locincpth to "" in a hint file to defeat local include searches.
841 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
842 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
844 : no include file wanted by default
847 : Trailing extension. Override this in a hint file, if needed.
849 : Extra object files, if any, needed on this platform.
852 : full support for void wanted by default
855 : set useposix=false in your hint file to disable the POSIX extension.
857 : set useopcode=false in your hint file to disable the Opcode extension.
859 : set usethreads on the Configure command line to enable threads.
860 : List of libraries we want.
861 : If anyone needs -lnet, put it in a hint file.
862 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
863 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
864 libswanted="$libswanted ucb bsd BSD PW x"
865 : We probably want to search /usr/shlib before most other libraries.
866 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
867 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
868 glibpth="/usr/shlib $glibpth"
869 : Do not use vfork unless overridden by a hint file.
872 : Find the basic shell for Bourne shell scripts
876 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
879 if test -f "$xxx"; then
882 : Build up a list and do a single loop so we can 'break' out.
883 pth=`echo $PATH | sed -e "s/$p_/ /g"`
884 for xxx in sh bash ksh pdksh ash; do
886 try="$try ${p}/${xxx}"
890 if test -f "$xxx"; then
893 elif test -f "$xxx.exe"; then
904 $me: Fatal Error: I can't find a Bourne Shell anywhere.
906 Usually it's in /bin/sh. How did you even get this far?
907 Please contact me (Andy Dougherty) at doughera@lafayette.edu and
908 we'll try to straighten this all out.
914 : see if sh knows # comments
915 if `$sh -c '#' >/dev/null 2>&1`; then
919 test -f $xcat || xcat=/usr/bin/cat
924 if test -s today; then
927 echo "#! $xcat" > try
931 if test -s today; then
939 echo "Your $sh doesn't grok # comments--I will strip them later on."
942 echo "exec grep -v '^[ ]*#'" >spitshell
945 spitshell=`pwd`/spitshell
947 echo "I presume that if # doesn't work, #! won't work either!"
952 : figure out how to guarantee sh startup
954 '') startsh=${sharpbang}${sh} ;;
966 : echo "Yup, it does."
968 echo "Hmm... '$startsh' does not guarantee sh startup..."
969 echo "You may have to fix up the shell scripts to make sure $sh runs them."
974 : Save command line options in file UU/cmdline.opt for later use in
975 : generating config.sh.
976 cat > cmdline.opt <<EOSH
977 # Configure command line arguments.
984 cat >>cmdline.opt <<EOSH
985 config_arg$argn='$arg'
987 argn=`expr $argn + 1`
990 : produce awk script to parse command line options
991 cat >options.awk <<'EOF'
993 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
995 len = length(optstr);
996 for (i = 1; i <= len; i++) {
997 c = substr(optstr, i, 1);
998 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1009 if (substr(str, 1, 1) != "-") {
1010 printf("'%s'\n", str);
1014 for (i = 2; i <= len; i++) {
1015 c = substr(str, i, 1);
1017 printf("-%s\n", substr(str, i));
1023 printf("'%s'\n", substr(str, i + 1));
1036 : process the command line options
1037 set X `for arg in "$@"; do echo "X$arg"; done |
1038 sed -e s/X// | awk -f options.awk`
1043 : set up default values
1054 cat >optdef.sh <<EOS
1060 while test $# -gt 0; do
1062 -d) shift; fastread=yes;;
1063 -e) shift; alldone=cont;;
1067 if test -r "$1"; then
1070 echo "$me: cannot read config file $1." >&2
1075 -h) shift; error=true;;
1076 -r) shift; reuseval=true;;
1077 -s) shift; silent=true; realsilent=true;;
1078 -E) shift; alldone=exit;;
1079 -K) shift; knowitall=true;;
1080 -O) shift; override=true;;
1081 -S) shift; silent=true; extractsh=true;;
1086 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1087 echo "$me: ignoring -D $1" >&2
1090 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1091 *) echo "$1='define'" >> optdef.sh;;
1098 *=) echo "$1" >> optdef.sh;;
1100 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1101 echo "$me: ignoring -U $1" >&2
1103 *) echo "$1='undef'" >> optdef.sh;;
1107 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1110 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1118 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1119 [-U symbol] [-U symbol=]
1120 -d : use defaults for all answers.
1121 -e : go on without questioning past the production of config.sh.
1122 -f : specify an alternate default configuration file.
1123 -h : print this help message and exit (with an error status).
1124 -r : reuse C symbols value if possible (skips costly nm extraction).
1125 -s : silent mode, only echoes questions and essential information.
1126 -D : define symbol to have some value:
1127 -D symbol symbol gets the value 'define'
1128 -D symbol=value symbol gets the value 'value'
1129 -E : stop at the end of questions, after having produced config.sh.
1130 -K : do not use unless you know what you are doing.
1131 -O : let -D and -U override definitions from loaded configuration file.
1132 -S : perform variable substitutions on all .SH files (can mix with -f)
1133 -U : undefine symbol:
1134 -U symbol symbol gets the value 'undef'
1135 -U symbol= symbol gets completely empty
1136 -V : print version number and exit (with a zero status).
1143 case "$fastread$alldone" in
1146 if test ! -t 0; then
1147 echo "Say 'sh Configure', not 'sh <Configure'"
1155 true) exec 1>/dev/null;;
1158 : run the defines and the undefines, if any, but leave the file out there...
1164 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1165 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1166 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1167 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1168 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1171 : Some greps do not return status, grrr.
1172 echo "grimblepritz" >grimble
1173 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1175 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1181 : the following should work in any shell
1185 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1186 cat >contains <<'EOSS'
1187 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1192 : Find the path to the source tree
1195 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
1206 if test -f $rsrc/Configure && \
1207 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1209 : found it, so we are ok.
1212 for src in . .. ../.. ../../.. ../../../..; do
1213 if test -f ../$src/Configure && \
1214 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1225 Sorry, I can't seem to locate the source dir for $package. Please start
1226 Configure with an explicit path -- i.e. /some/path/Configure.
1234 echo "Sources for $package found in \"$src\"." >&4
1238 : script used to extract .SH files with variable substitutions
1239 cat >extract <<'EOS'
1241 echo "Doing variable substitutions on .SH files..."
1242 if test -f $src/MANIFEST; then
1243 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH'`
1245 echo "(Looking for .SH files under the source directory.)"
1246 set x `(cd $src; find . -name "*.SH" -print)`
1250 0) set x `(cd $src; echo *.SH)`; shift;;
1252 if test ! -f $src/$1; then
1258 while test $name; do
1259 if test ! -d "$name"; then
1260 create="$name $create";
1261 name=`echo $name | sed -e "s|^[^/]*$||"`;
1262 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1267 for file in $create; do
1276 dir=`expr X$file : 'X\(.*\)/'`
1277 file=`expr X$file : 'X.*/\(.*\)'`
1278 (cd $dir && . ./$file)
1288 dir=`expr X$file : 'X\(.*\)/'`
1289 file=`expr X$file : 'X.*/\(.*\)'`
1290 (set x $dir; shift; eval $mkdir_p)
1300 if test -f $src/config_h.SH; then
1301 if test ! -f config.h; then
1302 : oops, they left it out of MANIFEST, probably, so do it anyway.
1308 : extract files and exit if asked to do so
1309 case "$extractsh" in
1311 case "$realsilent" in
1315 case "$config_sh" in
1316 '') config_sh='config.sh';;
1319 echo "Fetching answers from $config_sh..."
1322 test "$override" && . ./optdef.sh
1331 : Eunice requires " " instead of "", can you believe it
1334 echo "Beginning of configuration questions for $package."
1336 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1338 : first determine how to suppress newline on echo command
1340 echo "Checking echo to see how to suppress newlines..."
1341 (echo "hi there\c" ; echo " ") >.echotmp
1342 if $contains c .echotmp >/dev/null 2>&1 ; then
1353 echo $n "The star should be here-->$c"
1357 : Now test for existence of everything in MANIFEST
1359 if test -f $rsrc/MANIFEST; then
1360 echo "First let's make sure your kit is complete. Checking..." >&4
1361 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1364 for filelist in x??; do
1365 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1367 if test -s missing; then
1371 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1373 You have the option of continuing the configuration process, despite the
1374 distinct possibility that your kit is damaged, by typing 'y'es. If you
1375 do, don't blame me if something goes wrong. I advise you to type 'n'o
1376 and contact the author (doughera@lafayette.edu).
1379 echo $n "Continue? [n] $c" >&4
1383 echo "Continuing..." >&4
1387 echo "ABORTING..." >&4
1392 echo "Looks good..."
1395 echo "There is no MANIFEST file. I hope your kit is complete !"
1399 : compute the number of columns on the terminal for proper question formatting
1404 : set up the echo used in my read
1405 myecho="case \"\$xxxm\" in
1406 '') echo $n \"\$rp $c\" >&4;;
1408 '') echo $n \"[\$xxxm] $c\";;
1410 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1412 echo $n \"[\$xxxm] $c\" >&4
1414 echo $n \"\$rp [\$xxxm] $c\" >&4
1420 : now set up to do reads with possible shell escape and default assignment
1426 case "\$fastread" in
1427 yes) case "\$dflt" in
1430 case "\$silent-\$rp" in
1435 *) case "\$silent" in
1436 true) case "\$rp" in
1441 while expr "X\$ans" : "X!" >/dev/null; do
1445 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1453 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1462 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1467 echo "(OK, I'll run with -d after this question.)" >&4
1470 echo "*** Sorry, \$1 not supported yet." >&4
1480 echo "*** Substitution done -- please confirm."
1482 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1487 echo "*** Error -- try again."
1494 case "\$ans\$xxxm\$nostick" in
1506 : create .config dir to save info across Configure sessions
1507 test -d ../.config || mkdir ../.config
1508 cat >../.config/README <<EOF
1509 This directory created by Configure to save information that should
1510 persist across sessions for $package.
1512 You may safely delete it if you wish.
1515 : general instructions
1518 user=`(logname) 2>/dev/null`
1520 '') user=`whoami 2>&1`;;
1522 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1525 rp='Would you like to see the instructions?'
1536 This installation shell script will examine your system and ask you questions
1537 to determine how the perl5 package should be installed. If you get
1538 stuck on a question, you may use a ! shell escape to start a subshell or
1539 execute a command. Many of the questions will have default answers in square
1540 brackets; typing carriage return will give you the default.
1542 On some of the questions which ask for file or directory names you are allowed
1543 to use the ~name construct to specify the login directory belonging to "name",
1544 even if you don't have a shell which knows about that. Questions where this is
1545 allowed will be marked "(~name ok)".
1549 dflt='Type carriage return to continue'
1553 The prompter used in this script allows you to use shell variables and
1554 backticks in your answers. You may use $1, $2, etc... to refer to the words
1555 in the default answer, as if the default line was a set of arguments given to a
1556 script shell. This means you may also use $* to repeat the whole default line,
1557 so you do not have to re-type everything to add something to the default.
1559 Everytime there is a substitution, you will have to confirm. If there is an
1560 error (e.g. an unmatched backtick), the default answer will remain unchanged
1561 and you will be prompted again.
1563 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1564 the questions and use the computed defaults (or the previous answers if there
1565 was already a config.sh file). Type 'Configure -h' for a list of options.
1566 You may also start interactively and then answer '& -d' at any prompt to turn
1567 on the non-interactive behaviour for the remainder of the execution.
1573 Much effort has been expended to ensure that this shell script will run on any
1574 Unix system. If despite that it blows up on yours, your best bet is to edit
1575 Configure and run it again. If you can't run Configure for some reason,
1576 you'll have to generate a config.sh file by hand. Whatever problems you
1577 have, let me (doughera@lafayette.edu) know how I blew it.
1579 This installation script affects things in two ways:
1581 1) it may do direct variable substitutions on some of the files included
1583 2) it builds a config.h file for inclusion in C programs. You may edit
1584 any of these files as the need arises after running this script.
1586 If you make a mistake on a question, there is no easy way to back up to it
1587 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1588 files. Configure will offer to let you do this before it runs the SH files.
1591 dflt='Type carriage return to continue'
1593 case "$firsttime" in
1594 true) echo $user >>../.config/instruct;;
1598 : find out where common programs are
1600 echo "Locating common programs..." >&4
1613 if test -d \$dir/\$thing; then
1619 for thisthing in \$dir/\$thing; do
1620 : just loop through to pick last item
1622 if test -f \$thisthing; then
1625 elif test -f \$dir/\$thing.exe; then
1626 if test -n "$DJGPP"; then
1627 echo \$dir/\$thing.exe
1629 : on Eunice apparently
1684 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1685 pth="$pth /lib /usr/lib"
1686 for file in $loclist; do
1690 if test -f "$xxx"; then
1693 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1694 xxx=`./loc $file $file $pth`
1697 '') xxx=`./loc $file $file $pth`;;
1698 *) xxx=`./loc $xxx $xxx $pth`;;
1704 echo $file is in $xxx.
1707 echo $file is in $xxx.
1710 echo "I don't know where '$file' is, and my life depends on it." >&4
1711 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1717 echo "Don't worry if any of the following aren't found..."
1719 for file in $trylist; do
1723 if test -f "$xxx"; then
1726 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1727 xxx=`./loc $file $file $pth`
1730 '') xxx=`./loc $file $file $pth`;;
1731 *) xxx=`./loc $xxx $xxx $pth`;;
1737 echo $file is in $xxx.
1740 echo $file is in $xxx.
1743 echo "I don't see $file out there, $say."
1750 echo "Substituting grep for egrep."
1756 echo "Substituting cp for ln."
1762 echo "Hopefully test is built into your sh."
1765 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1766 echo "Using the test built into your sh."
1774 echo "Hopefully echo is built into your sh."
1779 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1780 $echo $n "hi there$c" >foo1
1781 echo $n "hi there$c" >foo2
1782 if cmp foo1 foo2 >/dev/null 2>&1; then
1783 echo "They are compatible. In fact, they may be identical."
1790 They are not compatible! You are probably running ksh on a non-USG system.
1791 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1792 have echo built in and we may have to run some Bourne shell scripts. That
1793 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1796 $echo $n "The star should be here-->$c"
1803 : determine whether symbolic links are supported
1806 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1807 echo "Symbolic links are supported." >&4
1810 echo "Symbolic links are NOT supported." >&4
1815 : see whether [:lower:] and [:upper:] are supported character classes
1817 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1819 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1823 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
1824 # (0xc9 and 0xd1), therefore that is a nice testing point.
1825 if test "X$up" = X -o "X$low" = X; then
1826 case "`echo IJ | tr '[I-J]' '[i-j]' 2>/dev/null`" in
1832 if test "X$up" = X -o "X$low" = X; then
1833 case "`echo IJ | tr I-J i-j 2>/dev/null`" in
1839 if test "X$up" = X -o "X$low" = X; then
1840 case "`echo IJ | od -x 2>/dev/null`" in
1842 echo "Hey, this might be EBCDIC." >&4
1843 if test "X$up" = X -o "X$low" = X; then
1844 case "`echo IJ | tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
1845 ij) up='[A-IJ-RS-Z]'
1850 if test "X$up" = X -o "X$low" = X; then
1851 case "`echo IJ | tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
1861 case "`echo IJ | tr \"$up\" \"$low\" 2>/dev/null`" in
1863 echo "Using $up and $low to convert case." >&4
1866 echo "I don't know how to translate letters from upper to lower case." >&4
1867 echo "Your tr is not acting any way I know of." >&4
1871 : set up the translation script tr, must be called with ./tr of course
1875 '[A-Z][a-z]') exec $tr '$up' '$low';;
1876 '[a-z][A-Z]') exec $tr '$low' '$up';;
1883 : Try to determine whether config.sh was made on this system
1884 case "$config_sh" in
1886 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1887 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
1888 # because the A-Z/a-z are not consecutive.
1889 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1890 ./tr '[A-Z]' '[a-z]' | tr $trnl ' '`
1891 newmyuname="$myuname"
1893 case "$knowitall" in
1895 if test -f ../config.sh; then
1896 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1897 eval "`grep myuname= ../config.sh`"
1899 if test "X$myuname" = "X$newmyuname"; then
1907 : Get old answers from old config file if Configure was run on the
1908 : same system, otherwise use the hints.
1911 if test -f config.sh; then
1913 rp="I see a config.sh file. Shall I use it to set the defaults?"
1916 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1917 *) echo "Fetching default answers from your old config.sh file..." >&4
1925 : Older versions did not always set $sh. Catch re-use of such
1934 if test ! -f config.sh; then
1937 First time through, eh? I have some defaults handy for some systems
1938 that need some extra help getting the Configure answers right:
1941 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
1943 : Half the following guesses are probably wrong... If you have better
1944 : tests or hints, please send them to doughera@lafayette.edu
1945 : The metaconfig authors would also appreciate a copy...
1946 $test -f /irix && osname=irix
1947 $test -f /xenix && osname=sco_xenix
1948 $test -f /dynix && osname=dynix
1949 $test -f /dnix && osname=dnix
1950 $test -f /lynx.os && osname=lynxos
1951 $test -f /unicos && osname=unicos && osvers=`$uname -r`
1952 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
1953 $test -f /bin/mips && /bin/mips && osname=mips
1954 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1955 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1956 $test -d /usr/apollo/bin && osname=apollo
1957 $test -f /etc/saf/_sactab && osname=svr4
1958 $test -d /usr/include/minix && osname=minix
1959 if $test -d /MachTen; then
1961 if $test -x /sbin/version; then
1962 osvers=`/sbin/version | $awk '{print $2}' |
1963 $sed -e 's/[A-Za-z]$//'`
1964 elif $test -x /usr/etc/version; then
1965 osvers=`/usr/etc/version | $awk '{print $2}' |
1966 $sed -e 's/[A-Za-z]$//'`
1971 if $test -f $uname; then
1979 umips) osname=umips ;;
1982 [23]100) osname=mips ;;
1983 next*) osname=next ;;
1985 if $test -f /etc/kconfig; then
1987 if test "$lns" = "ln -s"; then
1989 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1991 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
1997 if test -n "$DJGPP"; then
2006 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2008 'not found') osvers="$4"."$3" ;;
2009 '<3240'|'<>3240') osvers=3.2.0 ;;
2010 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2011 '=3250'|'>3250') osvers=3.2.5 ;;
2015 *dc.osx) osname=dcosx
2021 domainos) osname=apollo
2027 dynixptx*) osname=dynixptx
2030 freebsd) osname=freebsd
2032 genix) osname=genix ;;
2034 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2050 netbsd*) osname=netbsd
2053 news-os) osvers="$3"
2055 4*) osname=newsos4 ;;
2059 bsd386) osname=bsd386
2062 powerux | power_ux | powermax_os | powermaxos | \
2063 powerunix | power_unix) osname=powerux
2066 next*) osname=next ;;
2067 solaris) osname=solaris
2069 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2076 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2080 titanos) osname=titanos
2089 ultrix) osname=ultrix
2092 osf1|mls+) case "$5" in
2095 osvers=`echo "$3" | sed 's/^[xvt]//'`
2097 hp*) osname=hp_osf1 ;;
2098 mips) osname=mips_osf1 ;;
2107 $2) case "$osname" in
2111 : svr4.x or possibly later
2121 if test -f /stand/boot ; then
2122 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2123 if test -n "$INITPROG" -a -f "$INITPROG"; then
2124 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2125 if test -n "$isesix"; then
2133 *) if test -f /etc/systemid; then
2135 set `echo $3 | $sed 's/\./ /g'` $4
2136 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2138 elif $test -f $src/hints/sco_$1_$2.sh; then
2140 elif $test -f $src/hints/sco_$1.sh; then
2145 '') : Still unknown. Probably a generic Sys V.
2154 *) case "$osname" in
2155 '') : Still unknown. Probably a generic BSD.
2163 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2164 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2165 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2168 $rm -f UU/kernel.what
2169 elif test -d c:/.; then
2176 : Now look for a hint file osname_osvers, unless one has been
2177 : specified already.
2180 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2181 : Also try without trailing minor version numbers.
2182 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2183 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2184 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2185 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2188 *) case "$osvers" in
2191 *) if $test -f $src/hints/$file.sh ; then
2193 elif $test -f $src/hints/$xfile.sh ; then
2195 elif $test -f $src/hints/$xxfile.sh ; then
2197 elif $test -f $src/hints/$xxxfile.sh ; then
2199 elif $test -f $src/hints/$xxxxfile.sh ; then
2201 elif $test -f "$src/hints/${osname}.sh" ; then
2210 if $test -f Policy.sh ; then
2213 none) dflt="Policy" ;;
2214 *) dflt="Policy $dflt" ;;
2219 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2223 if $test -f Policy.sh ; then
2226 There's also a Policy hint file available, which should make the
2227 site-specific (policy) questions easier to answer.
2234 You may give one or more space-separated answers, or "none" if appropriate.
2235 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2236 is a good thing. DO NOT give a wrong version.
2240 rp="Which of these apply, if any?"
2243 for file in $tans; do
2244 if $test X$file = XPolicy -a -f Policy.sh; then
2246 $cat Policy.sh >> UU/config.sh
2247 elif $test -f $src/hints/$file.sh; then
2248 . $src/hints/$file.sh
2249 $cat $src/hints/$file.sh >> UU/config.sh
2250 elif $test X$tans = X -o X$tans = Xnone ; then
2253 : Give one chance to correct a possible typo.
2254 echo "$file.sh does not exist"
2256 rp="hint to use instead?"
2258 for file in $ans; do
2259 if $test -f "$src/hints/$file.sh"; then
2260 . $src/hints/$file.sh
2261 $cat $src/hints/$file.sh >> UU/config.sh
2262 elif $test X$ans = X -o X$ans = Xnone ; then
2265 echo "$file.sh does not exist -- ignored."
2272 : Remember our hint file for later.
2273 if $test -f "$src/hints/$file.sh" ; then
2283 echo "Fetching default answers from $config_sh..." >&4
2287 cp $config_sh config.sh 2>/dev/null
2297 test "$override" && . ./optdef.sh
2298 myuname="$newmyuname"
2300 : Restore computed paths
2301 for file in $loclist $trylist; do
2302 eval $file="\$_$file"
2307 Configure uses the operating system name and version to set some defaults.
2308 The default value is probably right if the name rings a bell. Otherwise,
2309 since spelling matters for me, either accept the default or answer "none"
2316 ''|' '|none) dflt=none ;;
2317 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2320 *) dflt="$osname" ;;
2322 rp="Operating system name?"
2326 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2332 ''|' '|none) dflt=none ;;
2333 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2334 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2336 ''|' ') dflt=none ;;
2341 *) dflt="$osvers" ;;
2343 rp="Operating system version?"
2350 : who configured the system
2351 cf_time=`LC_ALL=C; export LC_ALL; $date 2>&1`
2352 cf_by=`(logname) 2>/dev/null`
2355 cf_by=`(whoami) 2>/dev/null`
2357 "") cf_by=unknown ;;
2361 : set up the script used to warn in case of inconsistency
2368 echo "*** WHOA THERE!!! ***" >&4
2369 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2370 rp=" Keep the $hint value?"
2373 y) td=$was; tu=$was;;
2377 : function used to set $1 to $val
2378 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2380 $define$undef) . ./whoa; eval "$var=\$td";;
2381 $undef$define) . ./whoa; eval "$var=\$tu";;
2382 *) eval "$var=$val";;
2387 Perl can be built to take advantage of threads, on some systems.
2388 To do so, Configure must be run with -Dusethreads.
2389 (See README.threads for details.)
2391 case "$usethreads" in
2392 $define|true|[yY]*) dflt='y';;
2395 rp='Build a threading Perl?'
2398 y|Y) val="$define" ;;
2403 : Look for a hint-file generated 'call-back-unit'. Now that the
2404 : user has specified if a threading perl is to be built, we may need
2405 : to set or change some other defaults.
2406 if $test -f usethreads.cbu; then
2409 case "$d_oldpthreads" in
2410 '') : Configure tests would be welcome here. For now, assume undef.
2412 *) val="$d_oldpthreads" ;;
2417 : determine the architecture name
2419 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
2420 tarch=`arch`"-$osname"
2421 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
2422 if uname -m > tmparch 2>&1 ; then
2423 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
2424 -e 's/$/'"-$osname/" tmparch`
2432 case "$myarchname" in
2435 echo "(Your architecture name used to be $myarchname.)"
2441 *) dflt="$archname";;
2443 rp='What is your architecture name'
2445 case "$usethreads" in
2446 $define) echo "Threads selected." >&4
2448 *-thread) echo "...and architecture name already ends in -thread." >&4
2451 *) archname="$ans-thread"
2452 echo "...setting architecture name to $archname." >&4
2456 *) archname="$ans" ;;
2462 $define|true) afs=true ;;
2463 $undef|false) afs=false ;;
2464 *) if test -d /afs; then
2472 echo "AFS may be running... I'll be extra cautious then..." >&4
2474 echo "AFS does not seem to be running..." >&4
2477 : decide how portable to be. Allow command line overrides.
2478 case "$d_portable" in
2480 *) d_portable="$define" ;;
2483 : set up shell script to do ~ expansion
2489 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2492 if $test -f /bin/csh; then
2493 /bin/csh -f -c "glob \$1"
2498 name=\`$expr x\$1 : '..\([^/]*\)'\`
2499 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2500 if $test ! -d "\$dir"; then
2502 echo "\$me: can't locate home directory for: \$name" >&2
2507 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2523 : now set up to get a file name
2527 cat <<'EOSC' >>getfile
2540 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
2541 fn=`echo $fn | sed 's/(.*)//'`
2547 loc_file=`expr $fn : '.*:\(.*\)'`
2548 fn=`expr $fn : '\(.*\):.*'`
2556 */*) fullpath=true;;
2565 *e*) exp_file=true;;
2568 *p*) nopath_ok=true;;
2573 *d*) type='Directory';;
2574 *l*) type='Locate';;
2579 Locate) what='File';;
2584 case "$d_portable" in
2592 while test "$type"; do
2597 true) rp="$rp (~name ok)";;
2600 if test -f UU/getfile.ok && \
2601 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2620 value=`UU/filexp $ans`
2623 if test "$ans" != "$value"; then
2624 echo "(That expands to $value on this system.)"
2638 /*) value="$ansexp" ;;
2643 echo "I shall only accept a full path name, as in /bin/ls." >&4
2644 echo "Use a ! shell escape if you wish to check pathnames." >&4
2647 echo "Please give a full path name, starting with slash." >&4
2650 echo "Note that using ~name is ok provided it expands well." >&4
2663 if test -f "$ansexp"; then
2665 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2667 echo "($value is not a plain file, but that's ok.)"
2672 if test -d "$ansexp"; then
2677 if test -d "$ansexp"; then
2678 echo "(Looking for $loc_file in directory $value.)"
2679 value="$value/$loc_file"
2680 ansexp="$ansexp/$loc_file"
2682 if test -f "$ansexp"; then
2685 case "$nopath_ok" in
2686 true) case "$value" in
2688 *) echo "Assuming $value will be in people's path."
2704 if test "$fastread" = yes; then
2709 rp="$what $value doesn't exist. Use that name anyway?"
2730 : determine root of directory hierarchy where package will be installed.
2733 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
2741 By default, $package will be installed in $dflt/bin, manual
2742 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2743 all installation directories. Typically set to /usr/local, but you
2744 may choose /usr if you wish to install $package among your system
2745 binaries. If you wish to have binaries under /bin but manual pages
2746 under /usr/local/man, that's ok: you will be prompted separately
2747 for each of the installation directories, the prefix being only used
2748 to set the defaults.
2752 rp='Installation prefix to use?'
2760 *) oldprefix="$prefix";;
2767 : set the prefixit variable, to compute a suitable default value
2768 prefixit='case "$3" in
2770 case "$oldprefix" in
2771 "") eval "$1=\"\$$2\"";;
2778 ""|" ") eval "$1=\"\$$2\"";;
2784 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
2786 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
2787 /*-$oldprefix/*|\~*-$oldprefix/*)
2788 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
2789 *) eval "$1=\"\$$2\"";;
2793 : set the base revision
2796 : get the patchlevel
2798 echo "Getting the current patchlevel..." >&4
2799 if $test -r $rsrc/patchlevel.h;then
2800 patchlevel=`awk '/define[ ]+PATCHLEVEL/ {print $3}' $rsrc/patchlevel.h`
2801 subversion=`awk '/define[ ]+SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
2806 $echo $n "(You have $package" $c
2809 *) $echo $n " $baserev" $c ;;
2811 $echo $n " patchlevel $patchlevel" $c
2812 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
2815 if test 0 -eq "$subversion"; then
2816 version=`LC_ALL=C; export LC_ALL; \
2817 echo $baserev $patchlevel | \
2818 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
2820 version=`LC_ALL=C; export LC_ALL; \
2821 echo $baserev $patchlevel $subversion | \
2822 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
2824 : Figure out perl API version. Perhaps this should be in patchlevel.h
2825 if test "$subversion" -lt 50; then
2826 apiversion=`LC_ALL=C; export LC_ALL; \
2827 echo $baserev $patchlevel | \
2828 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
2830 apiversion="$version"
2833 : determine where private library files go
2834 : Usual default is /usr/local/lib/perl5/$version.
2835 : Also allow things like /opt/perl/lib/$version, since
2836 : /opt/perl/lib/perl5... would be redundant.
2838 *perl*) set dflt privlib lib/$version ;;
2839 *) set dflt privlib lib/$package/$version ;;
2844 There are some auxiliary files for $package that need to be put into a
2845 private library directory that is accessible by everyone.
2849 rp='Pathname where the private library files will reside?'
2851 if $test "X$privlibexp" != "X$ansexp"; then
2855 privlibexp="$ansexp"
2859 Since you are running AFS, I need to distinguish the directory in which
2860 private files reside from the directory in which they are installed (and from
2861 which they are presumably copied to the former directory by occult means).
2864 case "$installprivlib" in
2865 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
2866 *) dflt="$installprivlib";;
2869 rp='Where will private files be installed?'
2871 installprivlib="$ans"
2873 installprivlib="$privlibexp"
2876 : set the prefixup variable, to restore leading tilda escape
2877 prefixup='case "$prefixexp" in
2879 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
2882 : determine where public architecture dependent libraries go
2885 : privlib default is /usr/local/lib/$package/$version
2886 : archlib default is /usr/local/lib/$package/$version/$archname
2887 : privlib may have an optional trailing /share.
2888 tdflt=`echo $privlib | $sed 's,/share$,,'`
2889 tdflt=$tdflt/$archname
2898 $spackage contains architecture-dependent library files. If you are
2899 sharing libraries in a heterogeneous environment, you might store
2900 these files in a separate location. Otherwise, you can just include
2901 them with the rest of the public library files.
2905 rp='Where do you want to put the public architecture-dependent libraries?'
2908 archlibexp="$ansexp"
2913 Since you are running AFS, I need to distinguish the directory in
2914 which architecture-dependent library files reside from the directory
2915 in which they are installed (and from which they are presumably copied
2916 to the former directory by occult means).
2919 case "$installarchlib" in
2920 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
2921 *) dflt="$installarchlib";;
2924 rp='Where will architecture-dependent library files be installed?'
2926 installarchlib="$ans"
2928 installarchlib="$archlibexp"
2930 if $test X"$archlib" = X"$privlib"; then
2936 : make some quick guesses about what we are up against
2938 $echo $n "Hmm... $c"
2948 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2949 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2951 echo "Looks kind of like an OSF/1 system, but we'll see..."
2953 elif test `echo abc | tr a-z A-Z` = Abc ; then
2954 xxx=`./loc addbib blurfl $pth`
2955 if $test -f $xxx; then
2956 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2960 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2961 echo "Looks kind of like an extended USG system, but we'll see..."
2963 echo "Looks kind of like a USG system, but we'll see..."
2967 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2968 echo "Looks kind of like a BSD system, but we'll see..."
2972 echo "Looks kind of like a Version 7 system, but we'll see..."
2975 case "$eunicefix" in
2978 There is, however, a strange, musty smell in the air that reminds me of
2979 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2983 : it so happens the Eunice I know will not run shell scripts in Unix format
2987 echo "Congratulations. You aren't running Eunice."
2991 : Detect OS2. The p_ variable is set above in the Head.U unit.
2996 I have the feeling something is not exactly right, however...don't tell me...
2997 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3002 if test -f /xenix; then
3003 echo "Actually, this looks more like a XENIX system..."
3008 echo "It's not Xenix..."
3013 if test -f /venix; then
3014 echo "Actually, this looks more like a VENIX system..."
3021 echo "Nor is it Venix..."
3024 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3025 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3028 : see if setuid scripts can be secure
3031 Some kernels have a bug that prevents setuid #! scripts from being
3032 secure. Some sites have disabled setuid #! scripts because of this.
3034 First let's decide if your kernel supports secure setuid #! scripts.
3035 (If setuid #! scripts would be secure but have been disabled anyway,
3036 don't say that they are secure if asked.)
3041 if $test -d /dev/fd; then
3042 echo "#!$ls" >reflect
3043 chmod +x,u+s reflect
3044 ./reflect >flect 2>&1
3045 if $contains "/dev/fd" flect >/dev/null; then
3046 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3050 If you are not sure if they are secure, I can check but I'll need a
3051 username and password different from the one you are using right now.
3052 If you don't have such a username or don't want me to test, simply
3056 rp='Other username to test security of setuid scripts with?'
3061 case "$d_suidsafe" in
3062 '') echo "I'll assume setuid scripts are *not* secure." >&4
3065 echo "Well, the $hint value is *not* secure." >&4
3067 *) echo "Well, the $hint value *is* secure." >&4
3072 $rm -f reflect flect
3073 echo "#!$ls" >reflect
3074 chmod +x,u+s reflect
3077 echo '"su" will (probably) prompt you for '"$ans's password."
3078 su $ans -c './reflect >flect'
3079 if $contains "/dev/fd" flect >/dev/null; then
3080 echo "Okay, it looks like setuid scripts are secure." >&4
3083 echo "I don't think setuid scripts are secure." >&4
3088 rp='Does your kernel have *secure* setuid scripts?'
3091 [yY]*) val="$define";;
3096 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3097 echo "(That's for file descriptors, not floppy disks.)"
3103 $rm -f reflect flect
3105 : now see if they want to do setuid emulation
3108 case "$d_suidsafe" in
3111 echo "No need to emulate SUID scripts since they are secure here." >& 4
3115 Some systems have disabled setuid scripts, especially systems where
3116 setuid scripts cannot be secure. On systems where setuid scripts have
3117 been disabled, the setuid/setgid bits on scripts are currently
3118 useless. It is possible for $package to detect those bits and emulate
3119 setuid/setgid in a secure fashion. This emulation will only work if
3120 setuid scripts have been disabled in your kernel.
3124 "$define") dflt=y ;;
3127 rp="Do you want to do setuid/setgid emulation?"
3130 [yY]*) val="$define";;
3138 : determine where manual pages are on this system
3142 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
3143 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
3144 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
3145 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
3146 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
3147 sysman=`./loc . /usr/man/man1 $syspath`
3150 if $test -d "$sysman"; then
3151 echo "System manual is in $sysman." >&4
3153 echo "Could not find manual pages in source form." >&4
3156 : see what memory models we can support
3159 $cat >pdp11.c <<'EOP'
3168 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
3169 if $test -f pdp11 && ./pdp11 2>/dev/null; then
3170 dflt='unsplit split'
3172 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3175 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3180 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3183 if $test -d /lib/large || $test -d /usr/lib/large; then
3186 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3195 Some systems have different model sizes. On most systems they are called
3196 small, medium, large, and huge. On the PDP11 they are called unsplit and
3197 split. If your system doesn't support different memory models, say "none".
3198 If you wish to force everything to one memory model, say "none" here and
3199 put the appropriate flags later when it asks you for other cc and ld flags.
3200 Venix systems may wish to put "none" and let the compiler figure things out.
3201 (In the following question multiple model names should be space separated.)
3203 The default for most systems is "none".
3206 rp="Which memory models are supported?"
3221 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3222 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3229 rp="What flag indicates separate I and D space?"
3237 *large*|*small*|*medium*|*huge*)
3244 rp="What flag indicates large model?"
3254 *huge*) case "$huge" in
3258 rp="What flag indicates huge model?"
3268 *medium*) case "$medium" in
3272 rp="What flag indicates medium model?"
3279 *) medium="$large";;
3282 *small*) case "$small" in
3286 rp="What flag indicates small model?"
3297 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3300 $rm -f pdp11.* pdp11
3302 : see if we need a special compiler
3310 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3311 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3325 On some older systems the default C compiler will not resolve multiple global
3326 references that happen to have the same name. On some such systems the "Mcc"
3327 command may be used to force these to be resolved. On other systems a "cc -M"
3328 command is required. (Note that the -M flag on other systems indicates a
3329 memory model to use!) If you have the Gnu C compiler, you might wish to use
3335 rp="Use which C compiler?"
3343 rp="Use which C compiler?"
3347 : Look for a hint-file generated 'call-back-unit'. Now that the
3348 : user has specified the compiler, we may need to set or change some
3350 if $test -f cc.cbu; then
3354 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3355 $cat >gccvers.c <<EOM
3360 printf("%s\n", __VERSION__);
3362 printf("%s\n", "1");
3368 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3369 gccversion=`./gccvers`
3370 case "$gccversion" in
3371 '') echo "You are not using GNU cc." ;;
3372 *) echo "You are using GNU cc $gccversion." ;;
3376 echo "*** WHOA THERE!!! ***" >&4
3377 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3378 case "$knowitall" in
3380 echo " You'd better start hunting for one and let me know about it." >&4
3386 case "$gccversion" in
3387 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3390 : What should the include directory be ?
3392 $echo $n "Hmm... $c"
3396 if $test -f /bin/mips && /bin/mips; then
3397 echo "Looks like a MIPS system..."
3398 $cat >usr.c <<'EOCP'
3399 #ifdef SYSTYPE_BSD43
3403 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3404 dflt='/bsd43/usr/include'
3408 mips_type='System V'
3410 $rm -f usr.c usr.out
3411 echo "and you're compiling with the $mips_type compiler and libraries."
3415 echo "Doesn't look like a MIPS system."
3425 case "$xxx_prompt" in
3428 rp='Where are the include files you want to use?'
3436 : see how we invoke the C preprocessor
3438 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3439 cat <<'EOT' >testcpp.c
3445 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3447 wrapper=`pwd`/cppstdin
3451 if $test "X$cppstdin" != "X" && \
3452 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3453 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3455 echo "You used to use $cppstdin $cppminus so we'll use that again."
3457 '') echo "But let's see if we can live without a wrapper..." ;;
3459 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3460 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3462 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3465 echo "(However, $cpprun $cpplast does not work, let's see...)"
3473 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3480 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3481 $cc -E <testcpp.c >testcpp.out 2>&1; \
3482 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3483 echo "Yup, it does."
3486 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3487 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3488 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3489 echo "Yup, it does."
3492 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3493 $cc -P <testcpp.c >testcpp.out 2>&1; \
3494 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3495 echo "Yipee, that works!"
3498 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3499 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3500 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3501 echo "At long last!"
3504 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3505 $cpp <testcpp.c >testcpp.out 2>&1; \
3506 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3510 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3511 $cpp - <testcpp.c >testcpp.out 2>&1; \
3512 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3513 echo "Hooray, it works! I was beginning to wonder."
3516 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3517 $wrapper <testcpp.c >testcpp.out 2>&1; \
3518 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3524 rp="No dice. I can't find a C preprocessor. Name one:"
3528 $x_cpp <testcpp.c >testcpp.out 2>&1
3529 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3530 echo "OK, that will do." >&4
3532 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3547 echo "Perhaps can we force $cc -E using a wrapper..."
3548 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3549 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3555 echo "Nope, we'll have to live without it..."
3570 *) $rm -f $wrapper;;
3572 $rm -f testcpp.c testcpp.out
3574 : Set private lib path
3577 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3582 '') dlist="$loclibpth $plibpth $glibpth";;
3583 *) dlist="$libpth";;
3586 : Now check and see which directories actually exist, avoiding duplicates
3590 if $test -d $xxx; then
3593 *) libpth="$libpth $xxx";;
3599 Some systems have incompatible or broken versions of libraries. Among
3600 the directories listed in the question below, please remove any you
3601 know not to be holding relevant libraries, and add any that are needed.
3602 Say "none" for none.
3613 rp="Directories to use for library searches?"
3620 : compute shared library extension
3623 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3633 On some systems, shared libraries may be available. Answer 'none' if
3634 you want to suppress searching of shared libraries for the remaining
3635 of this configuration.
3638 rp='What is the file extension used for shared libraries?'
3642 : Define several unixisms.
3643 : Hints files or command line option can be used to override them.
3644 : The convoluted testing is in case hints files set either the old
3647 '') case "$exe_ext" in
3649 *) _exe="$exe_ext" ;;
3654 '') case "$lib_ext" in
3661 '') case "$obj_ext" in
3668 '') case "$path_sep" in
3679 : Which makefile gets called first. This is used by make depend.
3680 case "$firstmakefile" in
3681 '') firstmakefile='makefile';;
3684 : Looking for optional libraries
3686 echo "Checking for optional libraries..." >&4
3691 case "$libswanted" in
3692 '') libswanted='c_s';;
3694 for thislib in $libswanted; do
3696 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
3697 echo "Found -l$thislib (shared)."
3700 *) dflt="$dflt -l$thislib";;
3702 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3703 echo "Found -l$thislib (shared)."
3706 *) dflt="$dflt -l$thislib";;
3708 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3709 echo "Found -l$thislib."
3712 *) dflt="$dflt -l$thislib";;
3714 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3715 echo "Found -l$thislib."
3718 *) dflt="$dflt -l$thislib";;
3720 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3721 echo "Found -l${thislib}_s."
3724 *) dflt="$dflt -l${thislib}_s";;
3726 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3727 echo "Found -l$thislib."
3730 *) dflt="$dflt -l$thislib";;
3733 echo "No -l$thislib."
3744 ' '|'') dflt='none';;
3749 Some versions of Unix support shared libraries, which make executables smaller
3750 but make load time slightly longer.
3752 On some systems, mostly System V Release 3's, the shared library is included
3753 by putting the option "-lc_s" as the last thing on the cc command line when
3754 linking. Other systems use shared libraries by default. There may be other
3755 libraries needed to compile $package on your machine as well. If your system
3756 needs the "-lc_s" option, include it here. Include any other special libraries
3757 here as well. Say "none" for none.
3761 rp="Any additional libraries?"
3768 : determine optimize, if desired, or use for debug flag also
3770 ' '|$undef) dflt='none';;
3772 *) dflt="$optimize";;
3776 Some C compilers have problems with their optimizers. By default, $package
3777 compiles with the -O flag to use the optimizer. Alternately, you might want
3778 to use the symbolic debugger, which uses the -g flag (on traditional Unix
3779 systems). Either flag can be specified here. To use neither flag, specify
3783 rp="What optimizer/debugger flag should be used?"
3787 'none') optimize=" ";;
3791 : We will not override a previous value, but we might want to
3792 : augment a hint file
3795 case "$gccversion" in
3796 1*) dflt='-fpcc-struct-return' ;;
3799 *-g*) dflt="$dflt -DDEBUGGING";;
3801 case "$gccversion" in
3802 2*) if test -d /etc/conf/kconfig.d &&
3803 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3812 case "$mips_type" in
3813 *BSD*|'') inclwanted="$locincpth $usrinc";;
3814 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3816 for thisincl in $inclwanted; do
3817 if $test -d $thisincl; then
3818 if $test x$thisincl != x$usrinc; then
3821 *) dflt="$dflt -I$thisincl";;
3827 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3829 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3837 *) dflt="$dflt -D$2";;
3842 set signal.h __LANGUAGE_C__; eval $inctest
3844 set signal.h LANGUAGE_C; eval $inctest
3848 none|recommended) dflt="$ccflags $dflt" ;;
3849 *) dflt="$ccflags";;
3857 Your C compiler may want other flags. For this question you should include
3858 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3859 but you should NOT include libraries or ld flags like -lwhatever. If you
3860 want $package to honor its debug switch, you should include -DDEBUGGING here.
3861 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3863 To use no flags, specify the word "none".
3869 rp="Any additional cc flags?"
3876 : the following weeds options from ccflags that are of no interest to cpp
3878 case "$gccversion" in
3879 1*) cppflags="$cppflags -D__GNUC__"
3881 case "$mips_type" in
3883 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3889 echo "Let me guess what the preprocessor flags are..." >&4
3903 *) ftry="$previous $flag";;
3905 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3906 >cpp1.out 2>/dev/null && \
3907 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3908 >cpp2.out 2>/dev/null && \
3909 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3910 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3912 cppflags="$cppflags $ftry"
3922 *-*) echo "They appear to be: $cppflags";;
3924 $rm -f cpp.c cpp?.out
3928 : flags used in final linking phase
3930 '') if ./venix; then
3936 *-posix*) dflt="$dflt -posix" ;;
3939 *) dflt="$ldflags";;
3942 : Try to guess additional flags to pick up local libraries.
3943 for thislibdir in $libpth; do
3944 case " $loclibpth " in
3947 *"-L$thislibdir "*) ;;
3948 *) dflt="$dflt -L$thislibdir" ;;
3960 Your C linker may need flags. For this question you should
3961 include -L/whatever and any other flags used by the C linker, but you
3962 should NOT include libraries like -lwhatever.
3964 Make sure you include the appropriate -L/path flags if your C linker
3965 does not normally search all of the directories you specified above,
3968 To use no flags, specify the word "none".
3972 rp="Any additional ld flags (NOT including libraries)?"
3978 rmlist="$rmlist pdp11"
3982 echo "Checking your choice of C compiler and flags for coherency..." >&4
3983 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
3986 I've tried to compile and run a simple program with:
3991 and I got the following output:
3994 $cat > try.c <<'EOF'
3996 main() { printf("Ok\n"); exit(0); }
3999 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4000 if sh -c './try' >>try.msg 2>&1; then
4004 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4007 cat >> try.msg <<'EOQS'
4008 If $libs contains -lsfio, and sfio is mis-configured, then it
4009 sometimes (apparently) runs and exits with a 0 status, but with no
4010 output! It may have to do with sfio's use of _exit vs. exit.
4013 rp="You have a big problem. Shall I abort Configure"
4020 echo "The program compiled OK, but exited with status $?." >>try.msg
4021 rp="You have a problem. Shall I abort Configure"
4025 echo "I can't compile the test program." >>try.msg
4026 rp="You have a BIG problem. Shall I abort Configure"
4032 case "$knowitall" in
4034 echo "(The supplied flags might be incorrect with this C compiler.)"
4042 *) echo "Ok. Stopping Configure." >&4
4047 n) echo "OK, that should do.";;
4049 $rm -f try try.* core
4051 : determine filename position in cpp output
4053 echo "Computing filename position in cpp output for #include directives..." >&4
4054 echo '#include <stdio.h>' > foo.c
4057 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4058 $grep '^[ ]*#.*stdio\.h' | \
4059 while read cline; do
4062 while $test \$# -gt 0; do
4063 if $test -r \`echo \$1 | $tr -d '"'\`; then
4068 pos=\`expr \$pos + 1\`
4080 *) pos="${fieldn}th";;
4082 echo "Your cpp writes the filename in the $pos field of the line."
4084 : locate header file
4089 if test -f $usrinc/\$wanted; then
4090 echo "$usrinc/\$wanted"
4093 awkprg='{ print \$$fieldn }'
4094 echo "#include <\$wanted>" > foo\$\$.c
4095 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4096 $grep "^[ ]*#.*\$wanted" | \
4097 while read cline; do
4098 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4100 */\$wanted) echo "\$name"; exit 0;;
4111 : define an alternate in-header-list? function
4112 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4113 cont=true; xxf="echo \"<\$1> found.\" >&4";
4114 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4115 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4117 case $# in 4) instead=instead;; *) instead="at last";; esac;
4118 while $test "$cont"; do
4120 var=$2; eval "was=\$$2";
4121 if $test "$xxx" && $test -r "$xxx";
4123 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4126 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4127 set $yyy; shift; shift; yyy=$@;
4128 case $# in 0) cont="";;
4129 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4130 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4131 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4132 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4136 do set $yyy; var=$2; eval "was=\$$2";
4137 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4138 set $yyy; shift; shift; yyy=$@;
4141 : see if this is a malloc.h system
4142 set malloc.h i_malloc
4145 : see if stdlib is available
4146 set stdlib.h i_stdlib
4149 : determine which malloc to compile in
4151 case "$usemymalloc" in
4152 ''|y*|true) dflt='y' ;;
4153 n*|false) dflt='n' ;;
4154 *) dflt="$usemymalloc" ;;
4156 rp="Do you wish to attempt to use the malloc that comes with $package?"
4162 mallocsrc='malloc.c'
4163 mallocobj="malloc$_o"
4164 d_mymalloc="$define"
4167 : Remove malloc from list of libraries to use
4168 echo "Removing unneeded -lmalloc from library list" >&4
4169 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4172 echo "libs = $libs" >&4
4184 : compute the return types of malloc and free
4186 $cat >malloc.c <<END
4190 #include <sys/types.h>
4204 case "$malloctype" in
4206 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4213 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4217 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4224 echo "Your system uses $freetype free(), it would seem." >&4
4226 : Cruising for prototypes
4228 echo "Checking out function prototypes..." >&4
4229 $cat >prototype.c <<'EOCP'
4230 main(int argc, char *argv[]) {
4233 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4234 echo "Your C compiler appears to support function prototypes."
4237 echo "Your C compiler doesn't seem to understand function prototypes."
4244 case "$prototype" in
4246 *) ansi2knr='ansi2knr'
4251 This version of $package can only be compiled by a compiler that
4252 understands function prototypes. Unfortunately, your C compiler
4254 doesn't seem to understand them. Sorry about that.
4256 If GNU cc is avaiable for your system, perhaps you could try that instead.
4258 Eventually, we hope to support building Perl with pre-ANSI compilers.
4259 If you would like to help in that effort, please contact <perlbug@perl.org>.
4261 Aborting Configure now.
4267 : determine where public executables go
4272 rp='Pathname where the public executables will reside?'
4274 if $test "X$ansexp" != "X$binexp"; then
4282 Since you are running AFS, I need to distinguish the directory in which
4283 executables reside from the directory in which they are installed (and from
4284 which they are presumably copied to the former directory by occult means).
4287 case "$installbin" in
4288 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
4289 *) dflt="$installbin";;
4292 rp='Where will public executables be installed?'
4296 installbin="$binexp"
4299 : define a shorthand compile call
4303 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4304 : define a shorthand compile call for compilations that should be ok.
4308 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4311 echo "Determining whether or not we are on an EBCDIC system..." >&4
4312 cat >tebcdic.c <<EOM
4315 if ('M'==0xd4) return 0;
4319 $cc $ccflags $ldflags -o tebcdic tebcdic.c $libs >/dev/null 2>&1
4321 echo "You have EBCDIC. Adding -DEBCDIC to ccflags." >&4
4322 ccflags="$ccflags -DEBCDIC"
4325 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin. Or UTF-8." >&4
4328 rm -f tebcdic.c tebcdic
4333 echo "Checking for GNU C Library..." >&4
4334 cat >gnulibc.c <<EOM
4347 if eval $compile_ok && ./gnulibc; then
4349 echo "You are using the GNU C Library"
4352 echo "You are not using the GNU C Library"
4358 : see if nm is to be used to determine whether a symbol is defined or not
4362 case "$d_gnulibc" in
4365 echo "nm probably won't work on the GNU C Library." >&4
4371 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4373 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4374 echo "'nm' won't be sufficient on this sytem." >&4
4380 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4381 if $test $dflt -gt 20; then
4391 true|$define) dflt=y;;
4398 I can use $nm to extract the symbols from your C libraries. This
4399 is a time consuming task which may generate huge output on the disk (up
4400 to 3 megabytes) but that should make the symbols extraction faster. The
4401 alternative is to skip the 'nm' extraction part and to compile a small
4402 test program instead to determine whether each symbol is present. If
4403 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4404 this may be the best solution.
4406 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4409 rp="Shall I use $nm to extract C symbols from the libraries?"
4412 [Nn]*) usenm=false;;
4421 : nm options which may be necessary
4423 '') if $test -f /mach_boot; then
4425 elif $test -d /usr/ccs/lib; then
4426 nm_opt='-p' # Solaris (and SunOS?)
4427 elif $test -f /dgux; then
4429 elif $test -f /lib64/rld; then
4430 nm_opt='-p' # 64-bit Irix
4436 : nm options which may be necessary for shared libraries but illegal
4437 : for archive libraries. Thank you, Linux.
4438 case "$nm_so_opt" in
4439 '') case "$myuname" in
4441 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4442 nm_so_opt='--dynamic'
4451 : get list of predefined functions in a handy place
4456 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4463 *) for thislib in $libs; do
4466 : Handle C library specially below.
4469 thislib=`echo $thislib | $sed -e 's/^-l//'`
4470 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4472 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4474 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4476 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4478 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4480 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4482 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4487 libnames="$libnames $try"
4489 *) libnames="$libnames $thislib" ;;
4498 for xxx in $libpth; do
4499 $test -r $1 || set $xxx/libc.$so
4500 : The messy sed command sorts on library version numbers.
4502 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4503 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4505 s/[0-9][0-9]*/0000&/g
4506 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4509 sort | $sed -e 's/^.* //'`
4512 $test -r $1 || set /usr/ccs/lib/libc.$so
4513 $test -r $1 || set /lib/libsys_s$_a
4519 if $test -r "$1"; then
4520 echo "Your (shared) C library seems to be in $1."
4522 elif $test -r /lib/libc && $test -r /lib/clib; then
4523 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4525 libc='/lib/clib /lib/libc'
4526 if $test -r /lib/syslib; then
4527 echo "(Your math library is in /lib/syslib.)"
4528 libc="$libc /lib/syslib"
4530 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4531 echo "Your C library seems to be in $libc, as you said before."
4532 elif $test -r $incpath/usr/lib/libc$_a; then
4533 libc=$incpath/usr/lib/libc$_a;
4534 echo "Your C library seems to be in $libc. That's fine."
4535 elif $test -r /lib/libc$_a; then
4537 echo "Your C library seems to be in $libc. You're normal."
4539 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4541 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4542 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4543 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4545 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4547 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4550 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4552 if $test -r "$tans"; then
4553 echo "Your C library seems to be in $tans, of all places."
4559 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4563 If the guess above is wrong (which it might be if you're using a strange
4564 compiler, or your machine supports multiple models), you can override it here.
4569 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
4571 I can't seem to find your C library. I've looked in the following places:
4574 $sed 's/^/ /' libpath
4577 None of these seems to contain your C library. I need to get its name...
4582 rp='Where is your C library?'
4587 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
4588 set X `cat libnames`
4591 case $# in 1) xxx=file; esac
4592 echo "Extracting names from the following $xxx for later perusal:" >&4
4594 $sed 's/^/ /' libnames >&4
4596 $echo $n "This may take a while...$c" >&4
4600 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4601 *) $nm $nm_opt $file 2>/dev/null;;
4606 $grep fprintf libc.tmp > libc.ptf
4607 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4608 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4610 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4612 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4614 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4616 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4618 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4620 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4622 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4624 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4626 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4628 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4630 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4632 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4634 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4635 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4637 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4639 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4641 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4643 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4645 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4647 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4649 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4651 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4653 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4655 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4657 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4659 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4661 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4664 $nm -p $* 2>/dev/null >libc.tmp
4665 $grep fprintf libc.tmp > libc.ptf
4666 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4667 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4673 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4675 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4676 for thisname in $libnames $libc; do
4677 $ar t $thisname >>libc.tmp
4679 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4681 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4682 # Repeat libc to extract forwarders to DLL entries too
4683 for thisname in $libnames $libc; do
4684 $ar tv $thisname >>libc.tmp
4685 # Revision 50 of EMX has bug in $ar.
4686 # it will not extract forwarders to DLL entries
4687 # Use emximp which will extract exactly them.
4688 emximp -o tmp.imp $thisname \
4690 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
4691 < tmp.imp >>libc.tmp
4694 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
4697 echo "$ar didn't seem to work right." >&4
4698 echo "Maybe this is a Cray...trying bld instead..." >&4
4699 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
4701 for thisname in $libnames; do
4703 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
4704 $ar t $thisname >>libc.tmp
4708 echo "That didn't work either. Giving up." >&4
4715 if $test -f /lib/syscalls.exp; then
4717 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4718 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
4722 $rm -f libnames libpath
4724 : see if dld is available
4728 : is a C symbol defined?
4731 -v) tf=libc.tmp; tc=""; tdc="";;
4732 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4733 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4736 case "$reuseval-$4" in
4738 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4744 if $contains $tlook $tf >/dev/null 2>&1;
4749 echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4750 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
4758 $define) tval=true;;
4764 : define an is-in-libc? function
4765 inlibc='echo " "; td=$define; tu=$undef;
4766 sym=$1; var=$2; eval "was=\$$2";
4768 case "$reuseval$was" in
4778 echo "$sym() found." >&4;
4779 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
4781 echo "$sym() NOT found." >&4;
4782 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
4786 $define) echo "$sym() found." >&4;;
4787 *) echo "$sym() NOT found." >&4;;
4791 : see if dlopen exists
4798 : determine which dynamic loading, if any, to compile in
4800 dldir="ext/DynaLoader"
4813 $define) dflt='y' ;;
4816 $define) dflt='y' ;;
4818 : Does a dl_xxx.xs file exist for this operating system
4819 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
4822 rp="Do you wish to use dynamic loading?"
4829 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
4830 dflt="$dldir/dl_${osname}.xs"
4831 elif $test "$d_dlopen" = "$define" ; then
4832 dflt="$dldir/dl_dlopen.xs"
4833 elif $test "$i_dld" = "$define" ; then
4834 dflt="$dldir/dl_dld.xs"
4839 *) dflt="$dldir/$dlsrc"
4842 echo "The following dynamic loading files are available:"
4843 : Can not go over to $dldir because getfile has path hard-coded in.
4844 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
4845 rp="Source file to use for dynamic loading"
4847 # XXX This getfile call will fail the existence check if you try
4848 # building away from $src (this is not supported yet).
4852 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
4856 Some systems may require passing special flags to $cc -c to
4857 compile modules that will be used to create a shared library.
4858 To use no flags, say "none".
4861 case "$cccdlflags" in
4862 '') case "$gccversion" in
4863 '') case "$osname" in
4865 next) dflt='none' ;;
4866 irix*) dflt='-KPIC' ;;
4867 svr4*|esix*|solaris) dflt='-KPIC' ;;
4868 sunos) dflt='-pic' ;;
4872 *) case "$osname" in
4873 svr4*|esix*|solaris) dflt='-fPIC' ;;
4878 *) dflt="$cccdlflags" ;;
4880 rp="Any special flags to pass to $cc -c to compile shared library modules?"
4883 none) cccdlflags=' ' ;;
4884 *) cccdlflags="$ans" ;;
4889 Some systems use ld to create libraries that can be dynamically loaded,
4890 while other systems (such as those using ELF) use $cc.
4894 '') $cat >try.c <<'EOM'
4895 /* Test for whether ELF binaries are produced */
4900 int i = open("a.out",O_RDONLY);
4903 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
4904 exit(0); /* succeed (yes, it's ELF) */
4909 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
4911 You appear to have ELF support. I'll use $cc to build dynamic libraries.
4915 echo "I'll use ld to build dynamic libraries."
4924 rp="What command should be used to create dynamic libraries?"
4930 Some systems may require passing special flags to $ld to create a
4931 library that can be dynamically loaded. If your ld flags include
4932 -L/other/path options to locate libraries outside your loader's normal
4933 search path, you may need to specify those -L options here as well. To
4934 use no flags, say "none".
4937 case "$lddlflags" in
4938 '') case "$osname" in
4940 linux|irix*) dflt='-shared' ;;
4941 next) dflt='none' ;;
4942 solaris) dflt='-G' ;;
4943 sunos) dflt='-assert nodefinitions' ;;
4944 svr4*|esix*) dflt="-G $ldflags" ;;
4948 *) dflt="$lddlflags" ;;
4951 : Try to guess additional flags to pick up local libraries.
4952 for thisflag in $ldflags; do
4957 *) dflt="$dflt $thisflag" ;;
4964 ''|' ') dflt='none' ;;
4967 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
4970 none) lddlflags=' ' ;;
4971 *) lddlflags="$ans" ;;
4976 Some systems may require passing special flags to $cc to indicate that
4977 the resulting executable will use dynamic linking. To use no flags,
4981 case "$ccdlflags" in
4982 '') case "$osname" in
4983 hpux) dflt='-Wl,-E' ;;
4984 linux) dflt='-rdynamic' ;;
4985 next) dflt='none' ;;
4986 sunos) dflt='none' ;;
4990 *) dflt="$ccdlflags" ;;
4992 rp="Any special flags to pass to $cc to use dynamic loading?"
4995 none) ccdlflags=' ' ;;
4996 *) ccdlflags="$ans" ;;
5010 # No dynamic loading being used, so don't bother even to prompt.
5013 *) case "$useshrplib" in
5014 '') case "$osname" in
5015 svr4*|dgux|dynixptx|esix|powerux)
5017 also='Building a shared libperl is required for dynamic loading to work on your system.'
5022 also='Building a shared libperl is needed for MAB support.'
5040 The perl executable is normally obtained by linking perlmain.c with
5041 libperl${_a}, any static extensions (usually just DynaLoader), and
5042 any other libraries needed on this system (such as -lm, etc.). Since
5043 your system supports dynamic loading, it is probably possible to build
5044 a shared libperl.$so. If you will have more than one executable linked
5045 to libperl.$so, this will significantly reduce the size of each
5046 executable, but it may have a noticeable affect on performance. The
5047 default is probably sensible for your system.
5051 rp="Build a shared libperl.$so (y/n)"
5056 # Why does next4 have to be so different?
5057 case "${osname}${osvers}" in
5058 next4*) xxx='DYLD_LIBRARY_PATH' ;;
5059 os2*) xxx='' ;; # Nothing special needed.
5060 *) xxx='LD_LIBRARY_PATH' ;;
5062 if test X"$xxx" != "X"; then
5063 $cat <<EOM | $tee -a ../config.msg >&4
5065 To build perl, you must add the current working directory to your
5066 $xxx environment variable before running make. You can do
5068 $xxx=\`pwd\`; export $xxx
5069 for Bourne-style shells, or
5071 for Csh-style shells. You *MUST* do this before running make.
5076 *) useshrplib='false' ;;
5081 case "$useshrplib" in
5085 # Figure out a good name for libperl.so. Since it gets stored in
5086 # a version-specific architecture-dependent library, the version
5087 # number isn't really that important, except for making cc/ld happy.
5089 # A name such as libperl.so.3.1
5090 majmin="libperl.$so.$patchlevel.$subversion"
5091 # A name such as libperl.so.301
5092 majonly=`echo $patchlevel $subversion |
5093 $awk '{printf "%d%02d", $1, $2}'`
5094 majonly=libperl.$so.$majonly
5095 # I'd prefer to keep the os-specific stuff here to a minimum, and
5096 # rely on figuring it out from the naming of libc.
5097 case "${osname}${osvers}" in
5100 # XXX How handle the --version stuff for MAB?
5102 linux*) # ld won't link with a bare -lperl otherwise.
5105 *) # Try to guess based on whether libc has major.minor.
5107 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5108 *libc.$so.[0-9]*) dflt=$majonly ;;
5109 *) dflt=libperl.$so ;;
5119 I need to select a good name for the shared libperl. If your system uses
5120 library names with major and minor numbers, then you might want something
5121 like $majmin. Alternatively, if your system uses a single version
5122 number for shared libraries, then you might want to use $majonly.
5123 Or, your system might be quite happy with a simple libperl.$so.
5125 Since the shared libperl will get installed into a version-specific
5126 architecture-dependent directory, the version number of the shared perl
5127 library probably isn't important, so the default should be o.k.
5130 rp='What name do you want to give to the shared libperl?'
5133 echo "Ok, I'll use $libperl"
5136 libperl="libperl${_a}"
5140 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5144 WARNING: Use of the shrpdir variable for the installation location of
5145 the shared $libperl is not supported. It was never documented and
5146 will not work in this version. Let me (doughera@lafayette.edu)
5147 know of any problems this may cause.
5153 But your current setting of $shrpdir is
5154 the default anyway, so it's harmless.
5159 Further, your current attempted setting of $shrpdir
5160 conflicts with the value of $archlibexp/CORE
5161 that installperl will use.
5168 # How will the perl executable find the installed shared $libperl?
5169 # Add $xxx to ccdlflags.
5170 # If we can't figure out a command-line option, use $shrpenv to
5171 # set env LD_RUN_PATH. The main perl makefile uses this.
5172 shrpdir=$archlibexp/CORE
5175 if "$useshrplib"; then
5178 # We'll set it in Makefile.SH...
5184 xxx="-Wl,-R$shrpdir"
5186 linux|irix*|dec_osf)
5187 xxx="-Wl,-rpath,$shrpdir"
5190 # next doesn't like the default...
5193 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5199 # Only add $xxx if it isn't already in ccdlflags.
5200 case " $ccdlflags " in
5202 *) ccdlflags="$ccdlflags $xxx"
5205 Adding $xxx to the flags
5206 passed to $ld so that the perl executable will find the
5207 installed shared $libperl.
5215 # Respect a hint or command-line value.
5217 '') shrpenv="$tmp_shrpenv" ;;
5220 : determine where manual pages go
5221 set man1dir man1dir none
5225 $spackage has manual pages available in source form.
5229 echo "However, you don't have nroff, so they're probably useless to you."
5231 '') man1dir="none";;
5234 echo "If you don't want the manual sources installed, answer 'none'."
5239 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5240 lookpath="$lookpath $prefixexp/man/p_man/man1"
5241 lookpath="$lookpath $prefixexp/man/u_man/man1"
5242 lookpath="$lookpath $prefixexp/man/man.1"
5244 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5245 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5255 rp="Where do the main $spackage manual pages (source) go?"
5257 if $test "X$man1direxp" != "X$ansexp"; then
5261 man1direxp="$ansexp"
5269 Since you are running AFS, I need to distinguish the directory in which
5270 manual pages reside from the directory in which they are installed (and from
5271 which they are presumably copied to the former directory by occult means).
5274 case "$installman1dir" in
5275 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
5276 *) dflt="$installman1dir";;
5279 rp='Where will man pages be installed?'
5281 installman1dir="$ans"
5283 installman1dir="$man1direxp"
5286 : What suffix to use on installed man pages
5293 rp="What suffix should be used for the main $spackage man pages?"
5295 '') case "$man1dir" in
5309 *) dflt="$man1ext";;
5316 : see if we can have long filenames
5318 rmlist="$rmlist /tmp/cf$$"
5319 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5320 first=123456789abcdef
5321 second=/tmp/cf$$/$first
5322 $rm -f $first $second
5323 if (echo hi >$first) 2>/dev/null; then
5324 if $test -f 123456789abcde; then
5325 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5328 if (echo hi >$second) 2>/dev/null; then
5329 if $test -f /tmp/cf$$/123456789abcde; then
5331 That's peculiar... You can have filenames longer than 14 characters, but only
5332 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5333 I shall consider your system cannot support long filenames at all.
5337 echo 'You can have filenames longer than 14 characters.' >&4
5342 How confusing! Some of your filesystems are sane enough to allow filenames
5343 longer than 14 characters but some others like /tmp can't even think about them.
5344 So, for now on, I shall assume your kernel does not allow them at all.
5351 You can't have filenames longer than 14 chars. You can't even think about them!
5357 $rm -rf /tmp/cf$$ 123456789abcde*
5359 : determine where library module manual pages go
5360 set man3dir man3dir none
5364 $spackage has manual pages for many of the library modules.
5370 However, you don't have nroff, so they're probably useless to you.
5373 '') man3dir="none";;
5377 case "$d_flexfnam" in
5380 However, your system can't handle the long file names like File::Basename.3.
5383 '') man3dir="none";;
5387 echo "If you don't want the manual sources installed, answer 'none'."
5388 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5390 '') case "$prefix" in
5391 *$prog*) dflt=`echo $man1dir |
5392 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
5393 *) dflt="$privlib/man/man3" ;;
5397 *) dflt="$man3dir" ;;
5402 rp="Where do the $package library man pages (source) go?"
5404 if test "X$man3direxp" != "X$ansexp"; then
5409 man3direxp="$ansexp"
5417 Since you are running AFS, I need to distinguish the directory in which
5418 manual pages reside from the directory in which they are installed (and from
5419 which they are presumably copied to the former directory by occult means).
5422 case "$installman3dir" in
5423 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
5424 *) dflt="$installman3dir";;
5427 rp='Where will man pages be installed?'
5429 installman3dir="$ans"
5431 installman3dir="$man3direxp"
5434 : What suffix to use on installed man pages
5441 rp="What suffix should be used for the $package library man pages?"
5443 '') case "$man3dir" in
5457 *) dflt="$man3ext";;
5464 : see if we have to deal with yellow pages, now NIS.
5465 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5466 if $test -f /usr/etc/nibindd; then
5468 echo "I'm fairly confident you're on a NeXT."
5470 rp='Do you get the hosts file via NetInfo?'
5479 y*) hostcat='nidump hosts .';;
5480 *) case "$hostcat" in
5481 nidump*) hostcat='';;
5491 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5499 rp='Are you getting the hosts file via yellow pages?'
5502 y*) hostcat='ypcat hosts';;
5503 *) hostcat='cat /etc/hosts';;
5509 '') hostcat='cat /etc/hosts';;
5512 '') groupcat='cat /etc/group';;
5515 '') passcat='cat /etc/passwd';;
5518 : now get the host name
5520 echo "Figuring out host name..." >&4
5521 case "$myhostname" in
5523 echo 'Maybe "hostname" will work...'
5524 if tans=`sh -c hostname 2>&1` ; then
5532 if $test "$cont"; then
5534 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5535 if tans=`cat /etc/systemid 2>&1` ; then
5537 phostname='cat /etc/systemid'
5538 echo "Whadyaknow. Xenix always was a bit strange..."
5541 elif $test -r /etc/systemid; then
5542 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5545 if $test "$cont"; then
5546 echo 'No, maybe "uuname -l" will work...'
5547 if tans=`sh -c 'uuname -l' 2>&1` ; then
5549 phostname='uuname -l'
5551 echo 'Strange. Maybe "uname -n" will work...'
5552 if tans=`sh -c 'uname -n' 2>&1` ; then
5554 phostname='uname -n'
5556 echo 'Oh well, maybe I can mine it out of whoami.h...'
5557 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
5558 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
5559 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
5561 case "$myhostname" in
5562 '') echo "Does this machine have an identity crisis or something?"
5565 echo "Well, you said $myhostname before..."
5566 phostname='echo $myhostname';;
5572 : you do not want to know about this
5577 if $test "$myhostname" ; then
5579 rp='Your host name appears to be "'$myhostname'".'" Right?"
5587 : bad guess or no guess
5588 while $test "X$myhostname" = X ; do
5590 rp="Please type the (one word) name of your host:"
5595 : translate upper to lower if necessary
5596 case "$myhostname" in
5598 echo "(Normalizing case in your host name)"
5599 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
5603 case "$myhostname" in
5605 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
5606 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
5607 echo "(Trimming domain name from host name--host name is now $myhostname)"
5609 *) case "$mydomain" in
5612 test "X$hostcat" = "Xypcat hosts" &&
5613 ypmatch "$myhostname" hosts 2>/dev/null |\
5614 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
5617 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
5618 /[ ]$myhostname[ . ]/p" > hosts
5621 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
5622 END { print sum }" hosts` = x1 || tmp_re="[ ]"
5623 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
5624 hosts | $sort | $uniq | \
5625 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
5626 case `$echo X$dflt` in
5627 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
5630 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
5635 tans=`./loc resolv.conf X /etc /usr/etc`
5636 if $test -f "$tans"; then
5637 echo "(Attempting domain name extraction from $tans)"
5638 dflt=.`$sed -n -e 's/ / /g' \
5639 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
5640 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5642 .) dflt=.`$sed -n -e 's/ / /g' \
5643 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
5644 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5651 .) echo "(No help from resolv.conf either -- attempting clever guess)"
5652 dflt=.`sh -c domainname 2>/dev/null`
5655 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
5660 .) echo "(Lost all hope -- silly guess then)"
5666 *) dflt="$mydomain";;
5670 rp="What is your domain name?"
5680 : translate upper to lower if necessary
5683 echo "(Normalizing case in your domain name)"
5684 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
5688 : a little sanity check here
5689 case "$phostname" in
5692 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
5693 $myhostname$mydomain|$myhostname) ;;
5695 case "$phostname" in
5697 echo "(That doesn't agree with your whoami.h file, by the way.)"
5700 echo "(That doesn't agree with your $phostname command, by the way.)"
5710 I need to get your e-mail address in Internet format if possible, i.e.
5711 something like user@host.domain. Please answer accurately since I have
5712 no easy means to double check it. The default value provided below
5713 is most probably close to the reality but may not be valid from outside
5714 your organization...
5718 while test "$cont"; do
5720 '') dflt="$cf_by@$myhostname$mydomain";;
5721 *) dflt="$cf_email";;
5723 rp='What is your e-mail address?'
5729 rp='Address does not look like an Internet one. Use it anyway?'
5745 If you or somebody else will be maintaining perl at your site, please
5746 fill in the correct e-mail address here so that they may be contacted
5747 if necessary. Currently, the "perlbug" program included with perl
5748 will send mail to this address in addition to perlbug@perl.com. You may
5749 enter "none" for no administrator.
5752 case "$perladmin" in
5753 '') dflt="$cf_email";;
5754 *) dflt="$perladmin";;
5756 rp='Perl administrator e-mail address'
5760 : figure out how to guarantee perl startup
5761 case "$startperl" in
5763 case "$sharpbang" in
5767 I can use the #! construct to start perl on your system. This will
5768 make startup of perl scripts faster, but may cause problems if you
5769 want to share those scripts and perl is not in a standard place
5770 ($binexp/perl) on all your platforms. The alternative is to force
5771 a shell by starting the script with a single ':' character.
5775 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
5778 none) startperl=": # use perl";;
5779 *) startperl="#!$ans"
5780 if $test 30 -lt `echo "$ans" | wc -c`; then
5783 WARNING: Some systems limit the #! command to 32 characters.
5784 If you experience difficulty running Perl scripts with #!, try
5785 installing Perl in a directory with a shorter pathname.
5791 *) startperl=": # use perl"
5796 echo "I'll use $startperl to start perl scripts."
5798 : figure best path for perl in scripts
5801 perlpath="$binexp/perl"
5802 case "$startperl" in
5807 I will use the "eval 'exec'" idiom to start Perl on your system.
5808 I can use the full path of your Perl binary for this purpose, but
5809 doing so may cause problems if you want to share those scripts and
5810 Perl is not always in a standard place ($binexp/perl).
5814 rp="What path shall I use in \"eval 'exec'\"?"
5821 case "$startperl" in
5823 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
5826 : determine where public executable scripts go
5827 set scriptdir scriptdir
5829 case "$scriptdir" in
5832 : guess some guesses
5833 $test -d /usr/share/scripts && dflt=/usr/share/scripts
5834 $test -d /usr/share/bin && dflt=/usr/share/bin
5835 $test -d /usr/local/script && dflt=/usr/local/script
5836 $test -d $prefixexp/script && dflt=$prefixexp/script
5840 *) dflt="$scriptdir"
5845 Some installations have a separate directory just for executable scripts so
5846 that they can mount it across multiple architectures but keep the scripts in
5847 one spot. You might, for example, have a subdirectory of /usr/share for this.
5848 Or you might just lump your scripts in with all your other executables.
5852 rp='Where do you keep publicly executable scripts?'
5854 if $test "X$ansexp" != "X$scriptdirexp"; then
5858 scriptdirexp="$ansexp"
5862 Since you are running AFS, I need to distinguish the directory in which
5863 scripts reside from the directory in which they are installed (and from
5864 which they are presumably copied to the former directory by occult means).
5867 case "$installscript" in
5868 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
5869 *) dflt="$installscript";;
5872 rp='Where will public scripts be installed?'
5874 installscript="$ans"
5876 installscript="$scriptdirexp"
5879 : determine where site specific libraries go.
5880 : Usual default is /usr/local/lib/perl5/site_perl/$apiversion
5881 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5883 *perl*) set dflt sitelib lib/site_$prog/$apiversion ;;
5884 *) set dflt sitelib lib/$package/site_$prog/$apiversion ;;
5889 The installation process will also create a directory for
5890 site-specific extensions and modules. Some users find it convenient
5891 to place all local files in this directory rather than in the main
5892 distribution directory.
5896 rp='Pathname for the site-specific library files?'
5898 if $test "X$sitelibexp" != "X$ansexp"; then
5902 sitelibexp="$ansexp"
5906 Since you are running AFS, I need to distinguish the directory in
5907 which site-specific files reside from the directory in which they are
5908 installed (and from which they are presumably copied to the former
5909 directory by occult means).
5912 case "$installsitelib" in
5913 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
5914 *) dflt="$installsitelib";;
5917 rp='Where will site-specific files be installed?'
5919 installsitelib="$ans"
5921 installsitelib="$sitelibexp"
5924 : determine where site specific architecture-dependent libraries go.
5925 : sitelib default is /usr/local/lib/perl5/site_perl/$apiversion
5926 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
5927 : sitelib may have an optional trailing /share.
5928 tdflt=`echo $sitelib | $sed 's,/share$,,'`
5929 tdflt="$tdflt/$archname"
5930 set sitearch sitearch none
5933 '') dflt="$tdflt" ;;
5934 *) dflt="$sitearch" ;;
5938 The installation process will also create a directory for
5939 architecture-dependent site-specific extensions and modules.
5943 rp='Pathname for the site-specific architecture-dependent library files?'
5945 if $test "X$sitearchexp" != "X$ansexp"; then
5949 sitearchexp="$ansexp"
5953 Since you are running AFS, I need to distinguish the directory in
5954 which site-specific architecture-dependent library files reside from
5955 the directory in which they are installed (and from which they are
5956 presumably copied to the former directory by occult means).
5959 case "$installsitearch" in
5960 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
5961 *) dflt="$installsitearch";;
5964 rp='Where will site-specific architecture-dependent files be installed?'
5966 installsitearch="$ans"
5968 installsitearch="$sitearchexp"
5973 Previous version of $package used the standard IO mechanisms as defined
5974 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
5975 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
5976 the default. This abstraction layer can use AT&T's sfio (if you already
5977 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
5978 problems with some extension modules. Using PerlIO with stdio is safe,
5979 but it is slower than plain stdio and therefore is not the default.
5981 If this doesn't make any sense to you, just accept the default 'n'.
5983 case "$useperlio" in
5984 $define|true|[yY]*) dflt='y';;
5987 rp='Use the experimental PerlIO abstraction layer?'
5994 echo "Ok, doing things the stdio way"
6001 : Check how to convert floats to strings.
6002 if test "X$d_Gconvert" = X; then
6004 echo "Checking for an efficient way to convert floats to strings."
6007 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6008 char *myname = "gconvert";
6011 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6012 char *myname = "gcvt";
6015 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6016 char *myname = "sprintf";
6022 checkit(expect, got)
6026 if (strcmp(expect, got)) {
6027 printf("%s oddity: Expected %s, got %s\n",
6028 myname, expect, got);
6039 /* This must be 1st test on (which?) platform */
6040 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6041 Gconvert(0.1, 8, 0, buf);
6042 checkit("0.1", buf);
6044 Gconvert(1.0, 8, 0, buf);
6047 Gconvert(0.0, 8, 0, buf);
6050 Gconvert(-1.0, 8, 0, buf);
6053 /* Some Linux gcvt's give 1.e+5 here. */
6054 Gconvert(100000.0, 8, 0, buf);
6055 checkit("100000", buf);
6057 /* Some Linux gcvt's give -1.e+5 here. */
6058 Gconvert(-100000.0, 8, 0, buf);
6059 checkit("-100000", buf);
6064 case "$d_Gconvert" in
6065 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6066 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6067 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6068 *) xxx_list='gconvert gcvt sprintf' ;;
6071 for xxx_convert in $xxx_list; do
6072 echo "Trying $xxx_convert"
6074 set try -DTRY_$xxx_convert
6075 if eval $compile; then
6076 echo "$xxx_convert" found. >&4
6078 echo "I'll use $xxx_convert to convert floats into a string." >&4
6081 echo "...But $xxx_convert didn't work as I expected."
6084 echo "$xxx_convert NOT found." >&4
6088 case "$xxx_convert" in
6089 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6090 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6091 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6095 : Initialize h_fcntl
6098 : Initialize h_sysfile
6101 : access call always available on UNIX
6105 : locate the flags for 'access()'
6109 $cat >access.c <<'EOCP'
6110 #include <sys/types.h>
6115 #include <sys/file.h>
6124 : check sys/file.h first, no particular reason here
6125 if $test `./findhdr sys/file.h` && \
6126 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
6128 echo "<sys/file.h> defines the *_OK access constants." >&4
6129 elif $test `./findhdr fcntl.h` && \
6130 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
6132 echo "<fcntl.h> defines the *_OK access constants." >&4
6133 elif $test `./findhdr unistd.h` && \
6134 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
6135 echo "<unistd.h> defines the *_OK access constants." >&4
6137 echo "I can't find the four *_OK access constants--I'll use mine." >&4
6143 : see if alarm exists
6147 : Look for GNU-cc style attribute checking
6149 echo "Checking whether your compiler can handle __attribute__ ..." >&4
6150 $cat >attrib.c <<'EOCP'
6152 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
6154 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
6155 if $contains 'warning' attrib.out >/dev/null 2>&1; then
6156 echo "Your C compiler doesn't fully support __attribute__."
6159 echo "Your C compiler supports __attribute__."
6163 echo "Your C compiler doesn't seem to understand __attribute__ at all."
6170 : see if bcmp exists
6174 : see if bcopy exists
6178 : see if this is a unistd.h system
6179 set unistd.h i_unistd
6182 : see if getpgrp exists
6183 set getpgrp d_getpgrp
6186 case "$d_getpgrp" in
6189 echo "Checking to see which flavor of getpgrp is in use..."
6192 #include <sys/types.h>
6194 # include <unistd.h>
6198 if (getuid() == 0) {
6199 printf("(I see you are running Configure as super-user...)\n");
6203 if (getpgrp(1) == 0)
6212 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6213 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
6215 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6216 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
6219 echo "I can't seem to compile and run the test program."
6221 xxx="a USG one, i.e. you use getpgrp()."
6223 # SVR4 systems can appear rather BSD-ish.
6226 xxx="a BSD one, i.e. you use getpgrp(pid)."
6230 xxx="probably a USG one, i.e. you use getpgrp()."
6235 echo "Assuming your getpgrp is $xxx" >&4
6244 : see if setpgrp exists
6245 set setpgrp d_setpgrp
6248 case "$d_setpgrp" in
6251 echo "Checking to see which flavor of setpgrp is in use..."
6254 #include <sys/types.h>
6256 # include <unistd.h>
6260 if (getuid() == 0) {
6261 printf("(I see you are running Configure as super-user...)\n");
6265 if (-1 == setpgrp(1, 1))
6268 if (setpgrp() != -1)
6274 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6275 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
6277 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6278 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
6281 echo "(I can't seem to compile and run the test program.)"
6283 xxx="a USG one, i.e. you use setpgrp()."
6285 # SVR4 systems can appear rather BSD-ish.
6288 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
6292 xxx="probably a USG one, i.e. you use setpgrp()."
6297 echo "Assuming your setpgrp is $xxx" >&4
6305 : see if bzero exists
6309 : check for lengths of integral types
6313 echo "Checking to see how big your integers are..." >&4
6314 $cat >intsize.c <<'EOCP'
6318 printf("intsize=%d;\n", sizeof(int));
6319 printf("longsize=%d;\n", sizeof(long));
6320 printf("shortsize=%d;\n", sizeof(short));
6325 if eval $compile_ok && ./intsize > /dev/null; then
6327 echo "Your integers are $intsize bytes long."
6328 echo "Your long integers are $longsize bytes long."
6329 echo "Your short integers are $shortsize bytes long."
6333 Help! I can't compile and run the intsize test program: please enlighten me!
6334 (This is probably a misconfiguration in your system or libraries, and
6335 you really ought to fix it. Still, I'll try anyway.)
6339 rp="What is the size of an integer (in bytes)?"
6343 rp="What is the size of a long integer (in bytes)?"
6347 rp="What is the size of a short integer (in bytes)?"
6353 $rm -f intsize intsize.*
6355 : see if signal is declared as pointer to function returning int or void
6357 xxx=`./findhdr signal.h`
6358 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
6359 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6360 echo "You have int (*signal())() instead of void." >&4
6362 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6363 echo "You have void (*signal())()." >&4
6365 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
6366 echo "You have int (*signal())() instead of void." >&4
6368 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
6369 echo "You have void (*signal())()." >&4
6372 case "$d_voidsig" in
6374 echo "I can't determine whether signal handler returns void or int..." >&4
6376 rp="What type does your signal handler return?"
6383 echo "As you already told me, signal handler returns void." >&4
6386 *) echo "As you already told me, signal handler returns int." >&4
6393 case "$d_voidsig" in
6394 "$define") signal_t="void";;
6399 : check for ability to cast large floats to 32-bit ints.
6401 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
6402 if $test "$intsize" -ge 4; then
6409 #include <sys/types.h>
6411 $signal_t blech(s) int s; { exit(3); }
6418 signal(SIGFPE, blech);
6420 /* Don't let compiler optimize the test away. Store the number
6421 in a writable string for gcc to pass to sscanf under HP/UX.
6423 sprintf(str, "2147483647");
6424 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
6428 /* x86 processors will probably give 0x8000 0000, which is a
6429 sign change. We don't want that. We want to mimic SPARC
6430 behavior here, which is to preserve the sign and give
6433 if (i32 != ($xxx) f)
6439 if eval $compile_ok; then
6443 echo "(I can't seem to compile the test program--assuming it can't)"
6451 echo "Nope, it can't."
6458 : check for ability to cast negative floats to unsigned
6460 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
6463 #include <sys/types.h>
6465 $signal_t blech(s) int s; { exit(7); }
6466 $signal_t blech_in_list(s) int s; { exit(4); }
6467 unsigned long dummy_long(p) unsigned long p; { return p; }
6468 unsigned int dummy_int(p) unsigned int p; { return p; }
6469 unsigned short dummy_short(p) unsigned short p; { return p; }
6473 unsigned long along;
6475 unsigned short ashort;
6479 /* Frustrate gcc-2.7.2's optimizer which failed this test with
6480 a direct f = -123. assignment. gcc-2.8.0 reportedly
6481 optimized the whole file away
6483 /* Store the number in a writable string for gcc to pass to
6486 sprintf(str, "-123");
6487 sscanf(str, "%lf", &f); /* f = -123.; */
6489 signal(SIGFPE, blech);
6490 along = (unsigned long)f;
6491 aint = (unsigned int)f;
6492 ashort = (unsigned short)f;
6493 if (along != (unsigned long)-123)
6495 if (aint != (unsigned int)-123)
6497 if (ashort != (unsigned short)-123)
6499 sprintf(str, "1073741824.");
6500 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
6503 along = (unsigned long)f;
6504 if (along != 0x80000000)
6508 along = (unsigned long)f;
6509 if (along != 0x7fffffff)
6513 along = (unsigned long)f;
6514 if (along != 0x80000001)
6518 signal(SIGFPE, blech_in_list);
6519 sprintf(str, "123.");
6520 sscanf(str, "%lf", &f); /* f = 123.; */
6521 along = dummy_long((unsigned long)f);
6522 aint = dummy_int((unsigned int)f);
6523 ashort = dummy_short((unsigned short)f);
6524 if (along != (unsigned long)123)
6526 if (aint != (unsigned int)123)
6528 if (ashort != (unsigned short)123)
6535 if eval $compile_ok; then
6539 echo "(I can't seem to compile the test program--assuming it can't)"
6542 case "$castflags" in
6547 echo "Nope, it can't."
6554 : see if vprintf exists
6556 if set vprintf val -f d_vprintf; eval $csym; $val; then
6557 echo 'vprintf() found.' >&4
6559 $cat >vprintf.c <<'EOF'
6560 #include <varargs.h>
6562 main() { xxx("foo"); }
6571 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
6575 if eval $compile && ./vprintf; then
6576 echo "Your vsprintf() returns (int)." >&4
6579 echo "Your vsprintf() returns (char*)." >&4
6583 echo 'vprintf() NOT found.' >&4
6593 : see if chown exists
6597 : see if chroot exists
6601 : see if chsize exists
6605 : check for const keyword
6607 echo 'Checking to see if your C compiler knows about "const"...' >&4
6608 $cat >const.c <<'EOCP'
6609 typedef struct spug { int drokk; } spug;
6616 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
6618 echo "Yup, it does."
6621 echo "Nope, it doesn't."
6626 : see if crypt exists
6628 if set crypt val -f d_crypt; eval $csym; $val; then
6629 echo 'crypt() found.' >&4
6633 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
6634 if $test -z "$cryptlib"; then
6635 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
6639 if $test -z "$cryptlib"; then
6640 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
6644 if $test -z "$cryptlib"; then
6645 cryptlib=`./loc libcrypt$_a "" $libpth`
6649 if $test -z "$cryptlib"; then
6650 echo 'crypt() NOT found.' >&4
6659 : see if cuserid exists
6660 set cuserid d_cuserid
6663 : see if this is a limits.h system
6664 set limits.h i_limits
6667 : see if this is a float.h system
6671 : See if number of significant digits in a double precision number is known
6673 $cat >dbl_dig.c <<EOM
6683 printf("Contains DBL_DIG");
6686 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
6687 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
6688 echo "DBL_DIG found." >&4
6691 echo "DBL_DIG NOT found." >&4
6698 : see if difftime exists
6699 set difftime d_difftime
6702 : see if this is a dirent system
6704 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
6706 echo "<dirent.h> found." >&4
6709 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
6710 echo "<sys/dir.h> found." >&4
6713 xinc=`./findhdr sys/ndir.h`
6715 echo "<dirent.h> NOT found." >&4
6720 : Look for type of directory structure.
6722 $cppstdin $cppflags $cppminus < "$xinc" > try.c
6724 case "$direntrytype" in
6727 $define) guess1='struct dirent' ;;
6728 *) guess1='struct direct' ;;
6731 *) guess1="$direntrytype"
6736 'struct dirent') guess2='struct direct' ;;
6737 *) guess2='struct dirent' ;;
6740 if $contains "$guess1" try.c >/dev/null 2>&1; then
6741 direntrytype="$guess1"
6742 echo "Your directory entries are $direntrytype." >&4
6743 elif $contains "$guess2" try.c >/dev/null 2>&1; then
6744 direntrytype="$guess2"
6745 echo "Your directory entries seem to be $direntrytype." >&4
6747 echo "I don't recognize your system's directory entries." >&4
6748 rp="What type is used for directory entries on this system?"
6756 : see if the directory entry stores field length
6758 $cppstdin $cppflags $cppminus < "$xinc" > try.c
6759 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
6760 echo "Good, your directory entry keeps length information in d_namlen." >&4
6763 echo "Your directory entry does not know about the d_namlen field." >&4
6770 : see if dlerror exists
6773 set dlerror d_dlerror
6777 : see if dlfcn is available
6785 On a few systems, the dynamically loaded modules that perl generates and uses
6786 will need a different extension than shared libs. The default will probably
6794 rp='What is the extension of dynamically loaded modules'
6803 : Check if dlsym need a leading underscore
6809 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
6810 $cat >dyna.c <<'EOM'
6819 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
6821 #include <sys/types.h>
6835 int mode = RTLD_LAZY ;
6837 handle = dlopen("./dyna.$dlext", mode) ;
6838 if (handle == NULL) {
6843 symbol = dlsym(handle, "fred") ;
6844 if (symbol == NULL) {
6845 /* try putting a leading underscore */
6846 symbol = dlsym(handle, "_fred") ;
6847 if (symbol == NULL) {
6860 : Call the object file tmp-dyna.o in case dlext=o.
6861 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
6862 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
6863 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
6864 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
6867 1) echo "Test program failed using dlopen." >&4
6868 echo "Perhaps you should not use dynamic loading." >&4;;
6869 2) echo "Test program failed using dlsym." >&4
6870 echo "Perhaps you should not use dynamic loading." >&4;;
6871 3) echo "dlsym needs a leading underscore" >&4
6873 4) echo "dlsym doesn't need a leading underscore." >&4;;
6876 echo "I can't compile and run the test program." >&4
6881 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
6886 : see if dup2 exists
6890 : see if endhostent exists
6891 set endhostent d_endhent
6894 : see if endnetent exists
6895 set endnetent d_endnent
6898 : see if endprotoent exists
6899 set endprotoent d_endpent
6902 : see if endservent exists
6903 set endservent d_endsent
6906 : Locate the flags for 'open()'
6908 $cat >open3.c <<'EOCP'
6909 #include <sys/types.h>
6914 #include <sys/file.h>
6925 : check sys/file.h first to get FREAD on Sun
6926 if $test `./findhdr sys/file.h` && \
6927 set open3 -DI_SYS_FILE && eval $compile; then
6929 echo "<sys/file.h> defines the O_* constants..." >&4
6931 echo "and you have the 3 argument form of open()." >&4
6934 echo "but not the 3 argument form of open(). Oh, well." >&4
6937 elif $test `./findhdr fcntl.h` && \
6938 set open3 -DI_FCNTL && eval $compile; then
6940 echo "<fcntl.h> defines the O_* constants..." >&4
6942 echo "and you have the 3 argument form of open()." >&4
6945 echo "but not the 3 argument form of open(). Oh, well." >&4
6950 echo "I can't find the O_* constant definitions! You got problems." >&4
6956 : check for non-blocking I/O stuff
6957 case "$h_sysfile" in
6958 true) echo "#include <sys/file.h>" > head.c;;
6961 true) echo "#include <fcntl.h>" > head.c;;
6962 *) echo "#include <sys/fcntl.h>" > head.c;;
6967 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
6968 case "$o_nonblock" in
6971 $cat >>try.c <<'EOCP'
6974 printf("O_NONBLOCK\n");
6978 printf("O_NDELAY\n");
6982 printf("FNDELAY\n");
6989 if eval $compile_ok; then
6991 case "$o_nonblock" in
6992 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
6993 *) echo "Seems like we can use $o_nonblock.";;
6996 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
6999 *) echo "Using $hint value $o_nonblock.";;
7001 $rm -f try try.* .out core
7004 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
7010 #include <sys/types.h>
7012 #define MY_O_NONBLOCK $o_nonblock
7013 #ifndef errno /* XXX need better Configure test */
7016 $signal_t blech(x) int x; { exit(3); }
7018 $cat >> try.c <<'EOCP'
7026 pipe(pd); /* Down: child -> parent */
7027 pipe(pu); /* Up: parent -> child */
7030 close(pd[1]); /* Parent reads from pd[0] */
7031 close(pu[0]); /* Parent writes (blocking) to pu[1] */
7032 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
7034 signal(SIGALRM, blech);
7036 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
7038 sprintf(string, "%d\n", ret);
7039 write(2, string, strlen(string));
7042 if (errno == EAGAIN) {
7048 if (errno == EWOULDBLOCK)
7049 printf("EWOULDBLOCK\n");
7052 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
7053 sleep(2); /* Give it time to close our pipe */
7055 ret = read(pd[0], buf, 1); /* Should read EOF */
7057 sprintf(string, "%d\n", ret);
7058 write(3, string, strlen(string));
7062 close(pd[0]); /* We write to pd[1] */
7063 close(pu[1]); /* We read from pu[0] */
7064 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
7065 close(pd[1]); /* Pipe pd is now fully closed! */
7066 exit(0); /* Bye bye, thank you for playing! */
7070 if eval $compile_ok; then
7071 echo "$startsh" >mtry
7072 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
7074 ./mtry >/dev/null 2>&1
7076 0) eagain=`$cat try.out`;;
7077 1) echo "Could not perform non-blocking setting!";;
7078 2) echo "I did a successful read() for something that was not there!";;
7079 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
7080 *) echo "Something terribly wrong happened during testing.";;
7082 rd_nodata=`$cat try.ret`
7083 echo "A read() system call with no data present returns $rd_nodata."
7084 case "$rd_nodata" in
7087 echo "(That's peculiar, fixing that to be -1.)"
7093 echo "Forcing errno EAGAIN on read() with no data available."
7097 echo "Your read() sets errno to $eagain when no data is available."
7100 status=`$cat try.err`
7102 0) echo "And it correctly returns 0 to signal EOF.";;
7103 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
7104 *) echo "However, your read() returns '$status' on EOF??";;
7107 if test "$status" = "$rd_nodata"; then
7108 echo "WARNING: you can't distinguish between EOF and no data!"
7112 echo "I can't compile the test program--assuming errno EAGAIN will do."
7119 echo "Using $hint value $eagain."
7120 echo "Your read() returns $rd_nodata when no data is present."
7121 case "$d_eofnblk" in
7122 "$define") echo "And you can see EOF because read() returns 0.";;
7123 "$undef") echo "But you can't see EOF status from read() returned value.";;
7125 echo "(Assuming you can't see EOF status from read anyway.)"
7131 $rm -f try try.* .out core head.c mtry
7133 : see if fchmod exists
7137 : see if fchown exists
7141 : see if this is an fcntl system
7145 : see if fgetpos exists
7146 set fgetpos d_fgetpos
7149 : see if flock exists
7153 : see if fork exists
7157 : see if pathconf exists
7158 set pathconf d_pathconf
7161 : see if fpathconf exists
7162 set fpathconf d_fpathconf
7165 : see if fsetpos exists
7166 set fsetpos d_fsetpos
7169 : see if gethostbyaddr exists
7170 set gethostbyaddr d_gethbyaddr
7173 : see if gethostbyname exists
7174 set gethostbyname d_gethbyname
7177 : see if gethostent exists
7178 set gethostent d_gethent
7181 hasproto='varname=$1; func=$2; shift; shift;
7182 while $test $# -ge 2; do
7184 $define) echo "#include <$2>";;
7188 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
7189 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
7190 echo "$func() prototype found.";
7193 echo "$func() prototype NOT found.";
7198 $rm -f try.c tryout.c'
7200 : see if this is a netdb.h system
7204 : see if prototypes for various gethostxxx netdb.h functions are available
7206 set d_gethostprotos gethostent $i_netdb netdb.h
7209 : see if getlogin exists
7210 set getlogin d_getlogin
7213 : see if getnetbyaddr exists
7214 set getnetbyaddr d_getnbyaddr
7217 : see if getnetbyname exists
7218 set getnetbyname d_getnbyname
7221 : see if getnetent exists
7222 set getnetent d_getnent
7225 : see if prototypes for various getnetxxx netdb.h functions are available
7227 set d_getnetprotos getnetent $i_netdb netdb.h
7231 : see if getprotobyname exists
7232 set getprotobyname d_getpbyname
7235 : see if getprotobynumber exists
7236 set getprotobynumber d_getpbynumber
7239 : see if getprotoent exists
7240 set getprotoent d_getpent
7243 : see if getpgid exists
7244 set getpgid d_getpgid
7247 : see if getpgrp2 exists
7248 set getpgrp2 d_getpgrp2
7251 : see if getppid exists
7252 set getppid d_getppid
7255 : see if getpriority exists
7256 set getpriority d_getprior
7259 : see if prototypes for various getprotoxxx netdb.h functions are available
7261 set d_getprotoprotos getprotoent $i_netdb netdb.h
7264 : see if getservbyname exists
7265 set getservbyname d_getsbyname
7268 : see if getservbyport exists
7269 set getservbyport d_getsbyport
7272 : see if getservent exists
7273 set getservent d_getsent
7276 : see if prototypes for various getservxxx netdb.h functions are available
7278 set d_getservprotos getservent $i_netdb netdb.h
7281 : see if gettimeofday or ftime exists
7282 set gettimeofday d_gettimeod
7284 case "$d_gettimeod" in
7290 val="$undef"; set d_ftime; eval $setvar
7293 case "$d_gettimeod$d_ftime" in
7296 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
7300 : see if this is a netinet/in.h or sys/in.h system
7301 set netinet/in.h i_niin sys/in.h i_sysin
7304 : see if this is an arpa/inet.h
7305 set arpa/inet.h i_arpa_inet
7308 : see if htonl --and friends-- exists
7313 : Maybe they are macros.
7318 #include <sys/types.h>
7319 #$i_niin I_NETINET_IN
7321 #$i_arpa_inet I_ARPA_INET
7323 #include <netinet/in.h>
7329 #include <arpa/inet.h>
7332 printf("Defined as a macro.");
7335 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
7336 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
7338 echo "But it seems to be defined as a macro." >&4
7346 : see which of string.h or strings.h is needed
7348 strings=`./findhdr string.h`
7349 if $test "$strings" && $test -r "$strings"; then
7350 echo "Using <string.h> instead of <strings.h>." >&4
7354 strings=`./findhdr strings.h`
7355 if $test "$strings" && $test -r "$strings"; then
7356 echo "Using <strings.h> instead of <string.h>." >&4
7358 echo "No string header found -- You'll surely have problems." >&4
7364 "$undef") strings=`./findhdr strings.h`;;
7365 *) strings=`./findhdr string.h`;;
7370 if set index val -f; eval $csym; $val; then
7371 if set strchr val -f d_strchr; eval $csym; $val; then
7372 if $contains strchr "$strings" >/dev/null 2>&1 ; then
7375 echo "strchr() found." >&4
7379 echo "index() found." >&4
7384 echo "index() found." >&4
7387 if set strchr val -f d_strchr; eval $csym; $val; then
7390 echo "strchr() found." >&4
7392 echo "No index() or strchr() found!" >&4
7397 set d_strchr; eval $setvar
7399 set d_index; eval $setvar
7401 : check whether inet_aton exists
7402 set inet_aton d_inetaton
7407 $cat >isascii.c <<'EOCP'
7419 if eval $compile; then
7420 echo "isascii() found." >&4
7423 echo "isascii() NOT found." >&4
7430 : see if killpg exists
7434 : see if lchown exists
7436 $cat > try.c <<'EOCP'
7437 /* System header to define __stub macros and hopefully few prototypes,
7438 which can conflict with char lchown(); below. */
7440 /* Override any gcc2 internal prototype to avoid an error. */
7441 /* We use char because int might match the return type of a gcc2
7442 builtin and then its argument prototype would still apply. */
7445 /* The GNU C library defines this for functions which it implements
7446 to always fail with ENOSYS. Some functions are actually named
7447 something starting with __ and the normal name is an alias. */
7448 #if defined (__stub_lchown) || defined (__stub___lchown)
7456 if eval $compile; then
7457 $echo "lchown() found." >&4
7460 $echo "lchown() NOT found." >&4
7466 : see if link exists
7470 : see if localeconv exists
7471 set localeconv d_locconv
7474 : see if lockf exists
7478 : check for long doubles
7480 echo $n "Checking to see if your system supports long doubles...$c" >&4
7481 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7482 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7484 echo " Yup, it does." >&4
7487 echo " Nope, it doesn't." >&4
7493 : check for length of long double
7494 case "${d_longdbl}${longdblsize}" in
7497 $echo $n "Checking to see how big your long doubles are...$c" >&4
7498 $cat >try.c <<'EOCP'
7502 printf("%d\n", sizeof(long double));
7506 if eval $compile; then
7508 $echo " $longdblsize bytes." >&4
7512 echo "(I can't seem to compile the test program. Guessing...)" >&4
7513 rp="What is the size of a long double (in bytes)?"
7521 : check for long long
7523 echo $n "Checking to see if your system supports long long...$c" >&4
7524 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
7525 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7527 echo " Yup, it does." >&4
7530 echo " Nope, it doesn't." >&4
7536 : check for length of long long
7537 case "${d_longlong}${longlongsize}" in
7540 $echo $n "Checking to see how big your long longs are...$c" >&4
7541 $cat >try.c <<'EOCP'
7545 printf("%d\n", sizeof(long long));
7549 if eval $compile_ok; then
7550 longlongsize=`./try`
7551 $echo " $longlongsize bytes." >&4
7555 echo "(I can't seem to compile the test program. Guessing...)"
7556 rp="What is the size of a long long (in bytes)?"
7564 : see if lstat exists
7568 : see if mblen exists
7572 : see if mbstowcs exists
7573 set mbstowcs d_mbstowcs
7576 : see if mbtowc exists
7580 : see if memcmp exists
7584 : see if memcpy exists
7588 : see if memmove exists
7589 set memmove d_memmove
7592 : see if memset exists
7596 : see if mkdir exists
7600 : see if mkfifo exists
7604 : see if mktime exists
7608 : see if msgctl exists
7612 : see if msgget exists
7616 : see if msgsnd exists
7620 : see if msgrcv exists
7624 : see how much of the 'msg*(2)' library is present.
7627 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
7628 *"$undef"*) h_msg=false;;
7630 : we could also check for sys/ipc.h ...
7631 if $h_msg && $test `./findhdr sys/msg.h`; then
7632 echo "You have the full msg*(2) library." >&4
7635 echo "You don't have the full msg*(2) library." >&4
7641 : see if nice exists
7645 : see if pause exists
7649 : see if pipe exists
7653 : see if poll exists
7658 : see whether the various POSIXish _yields exist within given cccmd
7660 #include <pthread.h>
7666 : see if pthread_yield exists within given cccmd,
7667 : if we do not usethreads this may well end up undef.
7668 set try -DYIELD=pthread_yield
7669 if eval $compile; then
7671 echo 'pthread_yield() found.' >&4
7674 echo 'pthread_yield() NOT found.' >&4
7679 : see if sched_yield exists within given cccmd,
7680 : if we do not usethreads this may well end up undef.
7681 set try -DYIELD=sched_yield
7682 if eval $compile; then
7684 echo 'sched_yield() found.' >&4
7687 echo 'sched_yield() NOT found.' >&4
7693 : test whether pthreads are created in joinable -- aka undetached -- state
7694 if test "X$usethreads" = "X$define"; then
7695 echo $n "Checking whether pthreads are created joinable. $c" >&4
7696 $cat >try.c <<'EOCP'
7697 #include <pthread.h>
7700 pthread_attr_t attr;
7703 pthread_attr_init(&attr) == 0 &&
7704 pthread_attr_getdetachstate(&attr, &detachstate) == 0 &&
7705 detachstate == PTHREAD_CREATE_DETACHED ?
7706 "detached" : "joinable");
7711 if eval $compile; then
7714 detached) echo "Nope, they aren't." >&4 ;;
7715 *) echo "Yup, they are." >&4 ;;
7719 echo "(I can't execute the test program--assuming they are.)" >&4
7724 detached) val="$undef" ;;
7727 set d_pthreads_created_joinable
7730 d_pthreads_created_joinable="$undef"
7733 : see if this is a pwd.h system
7739 : see if setpwent exists
7740 set setpwent d_setpwent
7743 : see if getpwent exists
7744 set getpwent d_getpwent
7747 : see if endpwent exists
7748 set endpwent d_endpwent
7751 xxx=`./findhdr pwd.h`
7752 $cppstdin $cppflags $cppminus < $xxx >$$.h
7754 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
7762 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
7770 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
7778 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
7786 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
7794 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
7802 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
7810 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
7820 *) # Assume all is lost as far as the d_*pw* go.
7822 set d_setpwent; eval $setvar
7823 set d_getpwent; eval $setvar
7824 set d_endpwent; eval $setvar
7825 set d_pwquota; eval $setvar
7826 set d_pwage; eval $setvar
7827 set d_pwchange; eval $setvar
7828 set d_pwclass; eval $setvar
7829 set d_pwexpire; eval $setvar
7830 set d_pwcomment; eval $setvar
7831 set d_pwgecos; eval $setvar
7832 set d_pwpasswd; eval $setvar
7836 : see if readdir and friends exist
7837 set readdir d_readdir
7839 set seekdir d_seekdir
7841 set telldir d_telldir
7843 set rewinddir d_rewinddir
7846 : see if readlink exists
7847 set readlink d_readlink
7850 : see if rename exists
7854 : see if rmdir exists
7858 : see if memory.h is available.
7863 : See if it conflicts with string.h
7869 $cppstdin $cppflags $cppminus < $strings > mem.h
7870 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
7872 echo "We won't be including <memory.h>."
7882 : can bcopy handle overlapping blocks?
7887 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
7894 $cat >>try.c <<'EOCP'
7897 # include <memory.h>
7900 # include <stdlib.h>
7903 # include <string.h>
7905 # include <strings.h>
7908 # include <unistd.h> /* Needed for NetBSD */
7912 char buf[128], abc[128];
7918 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
7920 for (align = 7; align >= 0; align--) {
7921 for (len = 36; len; len--) {
7924 for (off = 1; off <= len; off++) {
7925 bcopy(b, b+off, len);
7926 bcopy(b+off, b, len);
7927 if (bcmp(b, abc, len))
7936 if eval $compile_ok; then
7937 if ./try 2>/dev/null; then
7941 echo "It can't, sorry."
7942 case "$d_memmove" in
7943 "$define") echo "But that's Ok since you have memmove()." ;;
7947 echo "(I can't compile the test program, so we'll assume not...)"
7948 case "$d_memmove" in
7949 "$define") echo "But that's Ok since you have memmove()." ;;
7954 $rm -f try.* try core
7958 : can memcpy handle overlapping blocks?
7963 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
7970 $cat >>try.c <<'EOCP'
7973 # include <memory.h>
7976 # include <stdlib.h>
7979 # include <string.h>
7981 # include <strings.h>
7984 # include <unistd.h> /* Needed for NetBSD */
7988 char buf[128], abc[128];
7994 /* Copy "abcde..." string to char abc[] so that gcc doesn't
7995 try to store the string in read-only memory. */
7996 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
7998 for (align = 7; align >= 0; align--) {
7999 for (len = 36; len; len--) {
8001 memcpy(b, abc, len);
8002 for (off = 1; off <= len; off++) {
8003 memcpy(b+off, b, len);
8004 memcpy(b, b+off, len);
8005 if (memcmp(b, abc, len))
8014 if eval $compile_ok; then
8015 if ./try 2>/dev/null; then
8019 echo "It can't, sorry."
8020 case "$d_memmove" in
8021 "$define") echo "But that's Ok since you have memmove()." ;;
8025 echo "(I can't compile the test program, so we'll assume not...)"
8026 case "$d_memmove" in
8027 "$define") echo "But that's Ok since you have memmove()." ;;
8032 $rm -f try.* try core
8036 : can memcmp be trusted to compare relative magnitude?
8041 echo "Checking if your memcmp() can compare relative magnitude..." >&4
8048 $cat >>try.c <<'EOCP'
8051 # include <memory.h>
8054 # include <stdlib.h>
8057 # include <string.h>
8059 # include <strings.h>
8062 # include <unistd.h> /* Needed for NetBSD */
8068 if ((a < b) && memcmp(&a, &b, 1) < 0)
8074 if eval $compile_ok; then
8075 if ./try 2>/dev/null; then
8079 echo "No, it can't (it uses signed chars)."
8082 echo "(I can't compile the test program, so we'll assume not...)"
8086 $rm -f try.* try core
8090 : see if select exists
8094 : see if semctl exists
8098 : see if semget exists
8102 : see if semop exists
8106 : see how much of the 'sem*(2)' library is present.
8109 case "$d_semctl$d_semget$d_semop" in
8110 *"$undef"*) h_sem=false;;
8112 : we could also check for sys/ipc.h ...
8113 if $h_sem && $test `./findhdr sys/sem.h`; then
8114 echo "You have the full sem*(2) library." >&4
8117 echo "You don't have the full sem*(2) library." >&4
8123 : see whether sys/sem.h defines union semun
8125 $cat > try.c <<'END'
8126 #include <sys/types.h>
8127 #include <sys/ipc.h>
8128 #include <sys/sem.h>
8129 int main () { union semun semun; semun.buf = 0; }
8132 if eval $compile; then
8133 echo "You have union semun in <sys/sem.h>." >&4
8136 echo "You do not have union semun in <sys/sem.h>." >&4
8143 : see how to do semctl IPC_STAT
8146 : see whether semctl IPC_STAT can use union semun
8149 #include <sys/types.h>
8150 #include <sys/ipc.h>
8151 #include <sys/sem.h>
8152 #include <sys/stat.h>
8158 #$d_union_semun HAS_UNION_SEMUN
8161 #ifndef HAS_UNION_SEMUN
8164 struct semid_ds *buf;
8165 unsigned short *array;
8171 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
8172 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
8174 struct semid_ds argbuf;
8177 st = semctl(sem, 0, IPC_STAT, arg);
8181 # endif /* IPC_STAT */
8182 printf("semctl IPC_STAT failed: errno = %d\n", errno);
8184 if (semctl(sem, 0, IPC_RMID, arg) != 0)
8185 # endif /* IPC_RMID */
8186 printf("semctl IPC_RMID failed: errno = %d\n", errno);
8188 #endif /* IPC_PRIVATE && ... */
8189 printf("semget failed: errno = %d\n", errno);
8195 if eval $compile; then
8198 semun) val="$define" ;;
8204 case "$d_semctl_semun" in
8206 echo "You can use union semun for semctl IPC_STAT." >&4
8209 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
8214 : see whether semctl IPC_STAT can use struct semid_ds pointer
8215 $cat > try.c <<'END'
8216 #include <sys/types.h>
8217 #include <sys/ipc.h>
8218 #include <sys/sem.h>
8219 #include <sys/stat.h>
8226 struct semid_ds arg;
8229 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
8230 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
8233 st = semctl(sem, 0, IPC_STAT, &arg);
8235 printf("semid_ds\n");
8237 # endif /* IPC_STAT */
8238 printf("semctl IPC_STAT failed: errno = %d\n", errno);
8240 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
8241 # endif /* IPC_RMID */
8242 printf("semctl IPC_RMID failed: errno = %d\n", errno);
8244 #endif /* IPC_PRIVATE && ... */
8245 printf("semget failed: errno = %d\n", errno);
8252 if eval $compile; then
8255 semid_ds) val="$define" ;;
8259 set d_semctl_semid_ds
8261 case "$d_semctl_semid_ds" in
8263 echo "You can $also use struct semid_ds * for semctl IPC_STAT." >&4
8265 *) echo "You cannot use struct semid_ds * for semctl IPC_STAT." >&4
8271 # We do not have the full sem*(2) library, so assume we can not
8277 set d_semctl_semid_ds
8282 : see if setegid exists
8283 set setegid d_setegid
8286 : see if seteuid exists
8287 set seteuid d_seteuid
8290 : see if sethostent exists
8291 set sethostent d_sethent
8294 : see if setlinebuf exists
8295 set setlinebuf d_setlinebuf
8298 : see if setlocale exists
8299 set setlocale d_setlocale
8302 : see if setnetent exists
8303 set setnetent d_setnent
8306 : see if setprotoent exists
8307 set setprotoent d_setpent
8310 : see if setpgid exists
8311 set setpgid d_setpgid
8314 : see if setpgrp2 exists
8315 set setpgrp2 d_setpgrp2
8318 : see if setpriority exists
8319 set setpriority d_setprior
8322 : see if setregid exists
8323 set setregid d_setregid
8325 set setresgid d_setresgid
8328 : see if setreuid exists
8329 set setreuid d_setreuid
8331 set setresuid d_setresuid
8334 : see if setrgid exists
8335 set setrgid d_setrgid
8338 : see if setruid exists
8339 set setruid d_setruid
8342 : see if setservent exists
8343 set setservent d_setsent
8346 : see if setsid exists
8350 : see if setvbuf exists
8351 set setvbuf d_setvbuf
8354 : see if sfio.h is available
8359 : see if sfio library is available
8370 : Ok, but do we want to use it.
8374 true|$define|[yY]*) dflt='y';;
8377 echo "$package can use the sfio library, but it is experimental."
8378 rp="You seem to have sfio available, do you want to try using it?"
8382 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
8384 : Remove sfio from list of libraries to use
8385 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
8388 echo "libs = $libs" >&4
8392 *) case "$usesfio" in
8394 echo "Sorry, cannot find sfio on this machine" >&4
8395 echo "Ignoring your setting of usesfio=$usesfio" >&4
8403 $define) usesfio='true';;
8404 *) usesfio='false';;
8407 : see if shmctl exists
8411 : see if shmget exists
8415 : see if shmat exists
8418 : see what shmat returns
8421 $cat >shmat.c <<'END'
8422 #include <sys/shm.h>
8425 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
8430 echo "and it returns ($shmattype)." >&4
8431 : see if a prototype for shmat is available
8432 xxx=`./findhdr sys/shm.h`
8433 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
8434 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
8445 set d_shmatprototype
8448 : see if shmdt exists
8452 : see how much of the 'shm*(2)' library is present.
8455 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
8456 *"$undef"*) h_shm=false;;
8458 : we could also check for sys/ipc.h ...
8459 if $h_shm && $test `./findhdr sys/shm.h`; then
8460 echo "You have the full shm*(2) library." >&4
8463 echo "You don't have the full shm*(2) library." >&4
8470 : see if we have sigaction
8471 if set sigaction val -f d_sigaction; eval $csym; $val; then
8472 echo 'sigaction() found.' >&4
8473 $cat > try.c <<'EOP'
8475 #include <sys/types.h>
8479 struct sigaction act, oact;
8483 if eval $compile_ok; then
8486 echo "But you don't seem to have a useable struct sigaction." >&4
8490 echo 'sigaction NOT found.' >&4
8493 set d_sigaction; eval $setvar
8494 $rm -f try try$_o try.c
8496 : see if sigsetjmp exists
8498 case "$d_sigsetjmp" in
8506 if (sigsetjmp(env,1))
8514 if eval $compile; then
8515 if ./try >/dev/null 2>&1; then
8516 echo "POSIX sigsetjmp found." >&4
8520 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
8526 echo "sigsetjmp not found." >&4
8530 *) val="$d_sigsetjmp"
8531 case "$d_sigsetjmp" in
8532 $define) echo "POSIX sigsetjmp found." >&4;;
8533 $undef) echo "sigsetjmp not found." >&4;;
8543 : see whether socket exists
8545 $echo $n "Hmm... $c" >&4
8546 if set socket val -f d_socket; eval $csym; $val; then
8547 echo "Looks like you have Berkeley networking support." >&4
8549 if set setsockopt val -f; eval $csym; $val; then
8552 echo "...but it uses the old 4.1c interface, rather than 4.2" >&4
8556 if $contains socklib libc.list >/dev/null 2>&1; then
8557 echo "Looks like you have Berkeley networking support." >&4
8559 : we will have to assume that it supports the 4.2 BSD interface
8562 echo "You don't have Berkeley networking in libc$_a..." >&4
8563 if test -f /usr/lib/libnet$_a; then
8564 ( ($nm $nm_opt /usr/lib/libnet$_a | eval $nm_extract) || \
8565 $ar t /usr/lib/libnet$_a) 2>/dev/null >> libc.list
8566 if $contains socket libc.list >/dev/null 2>&1; then
8567 echo "...but the Wollongong group seems to have hacked it in." >&4
8569 sockethdr="-I/usr/netinclude"
8571 if $contains setsockopt libc.list >/dev/null 2>&1; then
8574 echo "...using the old 4.1c interface, rather than 4.2" >&4
8578 echo "or even in libnet$_a, which is peculiar." >&4
8583 echo "or anywhere else I see." >&4
8590 : see if socketpair exists
8591 set socketpair d_sockpair
8594 : see if stat knows about block sizes
8596 xxx=`./findhdr sys/stat.h`
8597 if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then
8598 if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then
8599 echo "Your stat() knows about block sizes." >&4
8602 echo "Your stat() doesn't know about block sizes." >&4
8606 echo "Your stat() doesn't know about block sizes." >&4
8612 : see if _ptr and _cnt from stdio act std
8614 if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
8615 echo "(Looks like you have stdio.h from Linux.)"
8616 case "$stdio_ptr" in
8617 '') stdio_ptr='((fp)->_IO_read_ptr)'
8620 *) ptr_lval=$d_stdio_ptr_lval;;
8622 case "$stdio_cnt" in
8623 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
8626 *) cnt_lval=$d_stdio_cnt_lval;;
8628 case "$stdio_base" in
8629 '') stdio_base='((fp)->_IO_read_base)';;
8631 case "$stdio_bufsiz" in
8632 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
8635 case "$stdio_ptr" in
8636 '') stdio_ptr='((fp)->_ptr)'
8639 *) ptr_lval=$d_stdio_ptr_lval;;
8641 case "$stdio_cnt" in
8642 '') stdio_cnt='((fp)->_cnt)'
8645 *) cnt_lval=$d_stdio_cnt_lval;;
8647 case "$stdio_base" in
8648 '') stdio_base='((fp)->_base)';;
8650 case "$stdio_bufsiz" in
8651 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
8654 : test whether _ptr and _cnt really work
8655 echo "Checking how std your stdio is..." >&4
8658 #define FILE_ptr(fp) $stdio_ptr
8659 #define FILE_cnt(fp) $stdio_cnt
8661 FILE *fp = fopen("try.c", "r");
8664 18 <= FILE_cnt(fp) &&
8665 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
8673 if eval $compile; then
8675 echo "Your stdio acts pretty std."
8678 echo "Your stdio isn't very std."
8681 echo "Your stdio doesn't appear very std."
8687 : Can _ptr be used as an lvalue?
8688 case "$d_stdstdio$ptr_lval" in
8689 $define$define) val=$define ;;
8692 set d_stdio_ptr_lval
8695 : Can _cnt be used as an lvalue?
8696 case "$d_stdstdio$cnt_lval" in
8697 $define$define) val=$define ;;
8700 set d_stdio_cnt_lval
8703 : see if _base is also standard
8705 case "$d_stdstdio" in
8709 #define FILE_base(fp) $stdio_base
8710 #define FILE_bufsiz(fp) $stdio_bufsiz
8712 FILE *fp = fopen("try.c", "r");
8715 19 <= FILE_bufsiz(fp) &&
8716 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
8723 if eval $compile; then
8725 echo "And its _base field acts std."
8728 echo "But its _base field isn't std."
8731 echo "However, it seems to be lacking the _base field."
8739 : see if strcoll exists
8740 set strcoll d_strcoll
8743 : check for structure copying
8745 echo "Checking to see if your C compiler can copy structs..." >&4
8746 $cat >try.c <<'EOCP'
8756 if $cc -c try.c >/dev/null 2>&1 ; then
8761 echo "Nope, it can't."
8767 : see if strerror and/or sys_errlist[] exist
8769 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
8770 if set strerror val -f d_strerror; eval $csym; $val; then
8771 echo 'strerror() found.' >&4
8772 d_strerror="$define"
8773 d_strerrm='strerror(e)'
8774 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
8775 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
8776 d_syserrlst="$define"
8778 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
8779 d_syserrlst="$undef"
8781 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
8782 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
8783 echo 'strerror() found in string header.' >&4
8784 d_strerror="$define"
8785 d_strerrm='strerror(e)'
8786 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
8787 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
8788 d_syserrlst="$define"
8790 echo "(You don't appear to have any sys_errlist[], how can this be?)"
8791 d_syserrlst="$undef"
8793 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
8794 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
8796 d_syserrlst="$define"
8797 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
8799 echo 'strerror() and sys_errlist[] NOT found.' >&4
8801 d_syserrlst="$undef"
8802 d_strerrm='"unknown"'
8806 : see if strtod exists
8810 : see if strtol exists
8814 : see if strtoul exists
8815 set strtoul d_strtoul
8818 : see if strxfrm exists
8819 set strxfrm d_strxfrm
8822 : see if symlink exists
8823 set symlink d_symlink
8826 : see if syscall exists
8827 set syscall d_syscall
8830 : see if sysconf exists
8831 set sysconf d_sysconf
8834 : see if system exists
8838 : see if tcgetpgrp exists
8839 set tcgetpgrp d_tcgetpgrp
8842 : see if tcsetpgrp exists
8843 set tcsetpgrp d_tcsetpgrp
8846 : define an is-a-typedef? function
8847 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8849 "") inclist="sys/types.h";;
8851 eval "varval=\$$var";
8855 for inc in $inclist; do
8856 echo "#include <$inc>" >>temp.c;
8858 echo "#ifdef $type" >> temp.c;
8859 echo "printf(\"We have $type\");" >> temp.c;
8860 echo "#endif" >> temp.c;
8861 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8862 if $contains $type temp.E >/dev/null 2>&1; then
8868 *) eval "$var=\$varval";;
8871 : define an is-a-typedef? function that prompts if the type is not available.
8872 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8874 "") inclist="sys/types.h";;
8876 eval "varval=\$$var";
8880 for inc in $inclist; do
8881 echo "#include <$inc>" >>temp.c;
8883 echo "#ifdef $type" >> temp.c;
8884 echo "printf(\"We have $type\");" >> temp.c;
8885 echo "#endif" >> temp.c;
8886 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8888 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8889 if $contains $type temp.E >/dev/null 2>&1; then
8890 echo "$type found." >&4;
8893 echo "$type NOT found." >&4;
8899 *) eval "$var=\$varval";;
8902 : see if this is a sys/times.h system
8903 set sys/times.h i_systimes
8906 : see if times exists
8908 if set times val -f d_times; eval $csym; $val; then
8909 echo 'times() found.' >&4
8912 case "$i_systimes" in
8913 "$define") inc='sys/times.h';;
8915 rp="What is the type returned by times() on this system?"
8916 set clock_t clocktype long stdio.h sys/types.h $inc
8919 echo 'times() NOT found, hope that will do.' >&4
8924 : see if truncate exists
8925 set truncate d_truncate
8928 : see if tzname[] exists
8930 if set tzname val -a d_tzname; eval $csym; $val; then
8932 echo 'tzname[] found.' >&4
8935 echo 'tzname[] NOT found.' >&4
8940 : see if umask exists
8944 : see how we will look up host name
8947 : dummy stub to allow use of elif
8948 elif set uname val -f d_uname; eval $csym; $val; then
8951 uname() was found, but you're running xenix, and older versions of xenix
8952 have a broken uname(). If you don't really know whether your xenix is old
8953 enough to have a broken system call, use the default answer.
8960 rp='Is your uname() broken?'
8963 n*) d_uname="$define"; call=uname;;
8966 echo 'uname() found.' >&4
8971 case "$d_gethname" in
8972 '') d_gethname="$undef";;
8975 '') d_uname="$undef";;
8977 case "$d_phostname" in
8978 '') d_phostname="$undef";;
8981 : backward compatibility for d_hvfork
8982 if test X$d_hvfork != X; then
8986 : see if there is a vfork
8991 : Ok, but do we want to use it. vfork is reportedly unreliable in
8992 : perl on Solaris 2.x, and probably elsewhere.
9000 rp="Some systems have problems with vfork(). Do you want to use it?"
9005 echo "Ok, we won't use vfork()."
9014 $define) usevfork='true';;
9015 *) usevfork='false';;
9018 : see if this is an sysdir system
9019 set sys/dir.h i_sysdir
9022 : see if this is an sysndir system
9023 set sys/ndir.h i_sysndir
9026 : see if sys/types.h has to be included
9027 set sys/types.h i_systypes
9030 : see if closedir exists
9031 set closedir d_closedir
9034 case "$d_closedir" in
9037 echo "Checking whether closedir() returns a status..." >&4
9038 cat > closedir.c <<EOM
9039 #$i_dirent I_DIRENT /**/
9040 #$i_sysdir I_SYS_DIR /**/
9041 #$i_sysndir I_SYS_NDIR /**/
9042 #$i_systypes I_SYS_TYPES /**/
9044 #if defined(I_SYS_TYPES)
9045 #include <sys/types.h>
9047 #if defined(I_DIRENT)
9049 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
9050 #include <sys/dir.h>
9054 #include <sys/ndir.h>
9058 #include <ndir.h> /* may be wrong in the future */
9060 #include <sys/dir.h>
9065 int main() { return closedir(opendir(".")); }
9068 if eval $compile_ok; then
9069 if ./closedir > /dev/null 2>&1 ; then
9070 echo "Yes, it does."
9073 echo "No, it doesn't."
9077 echo "(I can't seem to compile the test program--assuming it doesn't)"
9088 : check for volatile keyword
9090 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
9091 $cat >try.c <<'EOCP'
9094 typedef struct _goo_struct goo_struct;
9095 goo_struct * volatile goo = ((goo_struct *)0);
9096 struct _goo_struct {
9101 typedef unsigned short foo_t;
9104 volatile foo_t blech;
9108 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
9110 echo "Yup, it does."
9113 echo "Nope, it doesn't."
9119 : see if there is a wait4
9123 : see if waitpid exists
9124 set waitpid d_waitpid
9127 : see if wcstombs exists
9128 set wcstombs d_wcstombs
9131 : see if wctomb exists
9135 : preserve RCS keywords in files with variable substitution, grrr
9140 Revision='$Revision'
9142 : check for alignment requirements
9144 case "$alignbytes" in
9145 '') echo "Checking alignment constraints..." >&4
9146 $cat >try.c <<'EOCP'
9153 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
9157 if eval $compile_ok; then
9161 echo "(I can't seem to compile the test program...)"
9164 *) dflt="$alignbytes"
9167 rp="Doubles must be aligned on a how-many-byte boundary?"
9172 : check for ordering of bytes in a long
9173 case "$byteorder" in
9177 In the following, larger digits indicate more significance. A big-endian
9178 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
9179 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
9180 machines may have weird orders like 3412. A Cray will report 87654321. If
9181 the test program works the default is probably right.
9182 I'm now running the test program...
9184 $cat >try.c <<'EOCP'
9191 char c[sizeof(long)];
9194 if (sizeof(long) > 4)
9195 u.l = (0x08070605L << 32) | 0x04030201L;
9198 for (i = 0; i < sizeof(long); i++)
9199 printf("%c", u.c[i]+'0');
9206 if eval $compile && ./try > /dev/null; then
9209 [1-4][1-4][1-4][1-4]|12345678|87654321)
9210 echo "(The test program ran ok.)"
9211 echo "byteorder=$dflt"
9214 ????|????????) echo "(The test program ran ok.)" ;;
9215 *) echo "(The test program didn't run right for some reason.)" ;;
9220 (I can't seem to compile the test program. Guessing big-endian...)
9223 case "$xxx_prompt" in
9225 rp="What is the order of bytes in a long?"
9236 : how do we catenate cpp tokens here?
9238 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
9239 $cat >cpp_stuff.c <<'EOCP'
9240 #define RCAT(a,b)a/**/b
9241 #define ACAT(a,b)a ## b
9245 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
9246 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
9247 echo "Oh! Smells like ANSI's been here." >&4
9248 echo "We can catify or stringify, separately or together!"
9250 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
9251 echo "Ah, yes! The good old days!" >&4
9252 echo "However, in the good old days we don't know how to stringify and"
9253 echo "catify at the same time."
9257 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
9258 to have to edit the values of CAT[2-5] in config.h...
9260 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
9264 : see if this is a db.h system
9272 echo "Checking Berkeley DB version ..." >&4
9278 #include <sys/types.h>
9283 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
9284 int Major, Minor, Patch ;
9285 unsigned long Version ;
9286 (void)db_version(&Major, &Minor, &Patch) ;
9287 printf("You have Berkeley DB Version 2 or greater\n");
9289 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
9290 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
9291 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
9292 Major, Minor, Patch) ;
9294 /* check that db.h & libdb are compatible */
9295 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
9296 printf("db.h and libdb are incompatible\n") ;
9300 printf("db.h and libdb are compatible\n") ;
9302 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
9303 + DB_VERSION_PATCH ;
9305 /* needs to be >= 2.3.4 */
9306 if (Version < 2003004) {
9307 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
9308 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
9314 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
9315 printf("You have Berkeley DB Version 1\n");
9316 exit(0); /* DB version < 2: the coast is clear. */
9318 exit(1); /* <db.h> not Berkeley DB? */
9324 if eval $compile && ./try; then
9325 echo 'Looks OK.' >&4
9327 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
9331 : Remove db from list of libraries to use
9332 echo "Removing unusable -ldb from library list" >&4
9333 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
9336 echo "libs = $libs" >&4
9346 : Check the return type needed for hash
9348 echo "Checking return type needed for hash for Berkeley DB ..." >&4
9354 #include <sys/types.h>
9357 #ifndef DB_VERSION_MAJOR
9358 u_int32_t hash_cb (ptr, size)
9366 info.hash = hash_cb;
9370 if $cc $ccflags -c try.c >try.out 2>&1 ; then
9371 if $contains warning try.out >>/dev/null 2>&1 ; then
9374 db_hashtype='u_int32_t'
9377 : XXX Maybe we should just give up here.
9378 db_hashtype=u_int32_t
9380 echo "Help: I can't seem to compile the db test program." >&4
9381 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
9384 echo "Your version of Berkeley DB uses $db_hashtype for hash."
9386 *) db_hashtype=u_int32_t
9391 : Check the return type needed for prefix
9393 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
9399 #include <sys/types.h>
9402 #ifndef DB_VERSION_MAJOR
9403 size_t prefix_cb (key1, key2)
9411 info.prefix = prefix_cb;
9415 if $cc $ccflags -c try.c >try.out 2>&1 ; then
9416 if $contains warning try.out >>/dev/null 2>&1 ; then
9419 db_prefixtype='size_t'
9422 db_prefixtype='size_t'
9423 : XXX Maybe we should just give up here.
9425 echo "Help: I can't seem to compile the db test program." >&4
9426 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
9429 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
9431 *) db_prefixtype='size_t'
9435 : check for void type
9437 echo "Checking to see how well your C compiler groks the void type..." >&4
9438 case "$voidflags" in
9440 $cat >try.c <<'EOCP'
9446 extern void moo(); /* function returning void */
9447 void (*goo)(); /* ptr to func returning void */
9449 void *hue; /* generic ptr */
9464 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
9465 voidflags=$defvoidused
9466 echo "Good. It appears to support void to the level $package wants.">&4
9467 if $contains warning .out >/dev/null 2>&1; then
9468 echo "However, you might get some warnings that look like this:"
9472 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
9473 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
9474 echo "It supports 1..."
9475 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
9476 echo "It also supports 2..."
9477 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
9479 echo "And it supports 4 but not 8 definitely."
9481 echo "It doesn't support 4..."
9482 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
9484 echo "But it supports 8."
9487 echo "Neither does it support 8."
9491 echo "It does not support 2..."
9492 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
9494 echo "But it supports 4 and 8."
9496 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
9498 echo "And it supports 4 but has not heard about 8."
9500 echo "However it supports 8 but not 4."
9505 echo "There is no support at all for void."
9510 case "$voidflags" in
9513 Support flag bits are:
9514 1: basic void declarations.
9515 2: arrays of pointers to functions returning void.
9516 4: operations between pointers to and addresses of void functions.
9517 8: generic void pointers.
9520 rp="Your void support flags add up to what?"
9527 : check for length of double
9529 case "$doublesize" in
9531 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
9532 $cat >try.c <<'EOCP'
9536 printf("%d\n", sizeof(double));
9540 if eval $compile_ok; then
9542 $echo " $doublesize bytes." >&4
9545 echo "(I can't seem to compile the test program. Guessing...)"
9546 rp="What is the size of a double precision number (in bytes)?"
9554 : see what type file positions are declared as in the library
9555 rp="What is the type for file position used by fsetpos()?"
9556 set fpos_t fpostype long stdio.h sys/types.h
9559 : get csh whereabouts
9561 'csh') val="$undef" ;;
9566 : Respect a hint or command line value for full_csh.
9568 '') full_csh=$csh ;;
9571 : Store the full pathname to the sed program for use in the C program
9574 : see what type gids are declared as in the kernel
9576 echo "Looking for the type for group ids returned by getgid()."
9577 set gid_t gidtype xxx stdio.h sys/types.h
9581 xxx=`./findhdr sys/user.h`
9582 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
9584 unsigned) dflt="$1 $2" ;;
9588 *) dflt="$gidtype";;
9591 gid_t) echo "gid_t found." ;;
9592 *) rp="What is the type for group ids returned by getgid()?"
9598 : see if getgroups exists
9599 set getgroups d_getgrps
9602 : see if setgroups exists
9603 set setgroups d_setgrps
9607 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
9609 case "$d_getgrps$d_setgrps" in
9611 case "$groupstype" in
9612 '') dflt="$gidtype" ;;
9613 *) dflt="$groupstype" ;;
9616 What type of pointer is the second argument to getgroups() and setgroups()?
9617 Usually this is the same as group ids, $gidtype, but not always.
9620 rp='What type pointer is the second argument to getgroups() and setgroups()?'
9624 *) groupstype="$gidtype";;
9627 : see what type lseek is declared as in the kernel
9628 rp="What is the type used for lseek's offset on this system?"
9629 set off_t lseektype long stdio.h sys/types.h
9633 echo "Checking if your $make program sets \$(MAKE)..." >&4
9634 case "$make_set_make" in
9636 $sed 's/^X //' > testmake.mak << 'EOF'
9638 X @echo 'maketemp="$(MAKE)"'
9640 case "`$make -f testmake.mak 2>/dev/null`" in
9641 *maketemp=*) make_set_make='#' ;;
9642 *) make_set_make="MAKE=$make" ;;
9647 case "$make_set_make" in
9648 '#') echo "Yup, it does.";;
9649 *) echo "Nope, it doesn't.";;
9652 : see what type is used for mode_t
9653 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
9654 set mode_t modetype int stdio.h sys/types.h
9657 : define a fucntion to check prototypes
9658 $cat > protochk <<EOSH
9661 optimize="$optimize"
9663 prototype="$prototype"
9668 $cat >> protochk <<'EOSH'
9673 while test $# -ge 2; do
9675 $define) echo "#include <$2>" >> try.c ;;
9676 literal) echo "$2" >> try.c ;;
9680 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9681 cat >> try.c <<'EOCP'
9682 #ifdef CAN_PROTOTYPE
9683 #define _(args) args
9688 echo "$foo" >> try.c
9689 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9690 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9698 : see what type is used for size_t
9699 rp="What is the type used for the length parameter for string functions?"
9700 set size_t sizetype 'unsigned int' stdio.h sys/types.h
9703 : check for type of arguments to gethostbyaddr.
9704 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
9705 case "$d_gethbyaddr" in
9709 Checking to see what type of arguments are accepted by gethostbyaddr().
9711 hdrs="$define sys/types.h
9712 $d_socket sys/socket.h
9713 $i_niin netinet/in.h
9716 : The first arg can 'char *' or 'void *'
9717 : The second arg is some of integral type
9718 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
9719 for yyy in size_t long int; do
9720 case "$netdb_host_type" in
9721 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
9722 if ./protochk "$try" $hdrs; then
9723 echo "Your system accepts $xxx for the first arg."
9724 echo "...and $yyy for the second arg."
9725 netdb_host_type="$xxx"
9726 netdb_hlen_type="$yyy"
9732 : In case none of those worked, prompt the user.
9733 case "$netdb_host_type" in
9734 '') rp='What is the type for the 1st argument to gethostbyaddr?'
9737 netdb_host_type=$ans
9738 rp='What is the type for the 2nd argument to gethostbyaddr?'
9741 netdb_hlen_type=$ans
9745 *) : no gethostbyaddr, so pick harmless defaults
9746 netdb_host_type='char *'
9747 netdb_hlen_type="$sizetype"
9750 # Remove the "const" if needed. -- but then we'll have a
9752 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
9755 : check for type of argument to gethostbyname.
9756 if test "X$netdb_name_type" = X ; then
9757 case "$d_gethbyname" in
9761 Checking to see what type of argument is accepted by gethostbyname().
9763 hdrs="$define sys/types.h
9764 $d_socket sys/socket.h
9765 $i_niin netinet/in.h
9768 for xxx in "const char *" "char *"; do
9769 case "$netdb_name_type" in
9770 '') try="extern struct hostent *gethostbyname($xxx);"
9771 if ./protochk "$try" $hdrs; then
9772 echo "Your system accepts $xxx."
9773 netdb_name_type="$xxx"
9778 : In case none of those worked, prompt the user.
9779 case "$netdb_name_type" in
9780 '') rp='What is the type for the 1st argument to gethostbyname?'
9783 netdb_name_type=$ans
9787 *) : no gethostbyname, so pick harmless default
9788 netdb_name_type='char *'
9793 : check for type of 1st argument to getnetbyaddr.
9794 if test "X$netdb_net_type" = X ; then
9795 case "$d_getnbyaddr" in
9799 Checking to see what type of 1st argument is accepted by getnetbyaddr().
9801 hdrs="$define sys/types.h
9802 $d_socket sys/socket.h
9803 $i_niin netinet/in.h
9806 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
9807 case "$netdb_net_type" in
9808 '') try="extern struct netent *getnetbyaddr($xxx, int);"
9809 if ./protochk "$try" $hdrs; then
9810 echo "Your system accepts $xxx."
9811 netdb_net_type="$xxx"
9816 : In case none of those worked, prompt the user.
9817 case "$netdb_net_type" in
9818 '') rp='What is the type for the 1st argument to getnetbyaddr?'
9825 *) : no getnetbyaddr, so pick harmless default
9826 netdb_net_type='long'
9830 : locate the preferred pager for this system
9844 '') dflt=/usr/ucb/more;;
9851 rp='What pager is used on your system?'
9855 : see what type pids are declared as in the kernel
9856 rp="What is the type of process ids on this system?"
9857 set pid_t pidtype int stdio.h sys/types.h
9860 : check for length of pointer
9864 $echo $n "Checking to see how big your pointers are...$c" >&4
9865 if test "$voidflags" -gt 7; then
9866 echo '#define VOID_PTR char *' > try.c
9868 echo '#define VOID_PTR void *' > try.c
9870 $cat >>try.c <<'EOCP'
9874 printf("%d\n", sizeof(VOID_PTR));
9879 if eval $compile_ok; then
9881 $echo " $ptrsize bytes." >&4
9884 echo "(I can't seem to compile the test program. Guessing...)" >&4
9885 rp="What is the size of a pointer (in bytes)?"
9893 : check for size of random number generator
9897 echo "Checking to see how many bits your rand function produces..." >&4
9903 # include <unistd.h>
9906 # include <stdlib.h>
9909 $cat >>try.c <<'EOCP'
9913 register unsigned long tmp;
9914 register unsigned long max = 0L;
9916 for (i = 1000; i; i--) {
9917 tmp = (unsigned long)rand();
9918 if (tmp > max) max = tmp;
9920 for (i = 0; max; i++)
9926 if eval $compile_ok; then
9930 echo "(I can't seem to compile the test program...)"
9937 rp='How many bits does your rand() function produce?'
9942 : see if ar generates random libraries by itself
9944 echo "Checking how to generate random libraries on your machine..." >&4
9945 echo 'int bar1() { return bar2(); }' > bar1.c
9946 echo 'int bar2() { return 2; }' > bar2.c
9947 $cat > foo.c <<'EOP'
9948 main() { printf("%d\n", bar1()); exit(0); }
9950 $cc $ccflags -c bar1.c >/dev/null 2>&1
9951 $cc $ccflags -c bar2.c >/dev/null 2>&1
9952 $cc $ccflags -c foo.c >/dev/null 2>&1
9953 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
9954 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
9955 ./foobar >/dev/null 2>&1; then
9956 echo "$ar appears to generate random libraries itself."
9959 elif $ar ts bar$_a >/dev/null 2>&1 &&
9960 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
9961 ./foobar >/dev/null 2>&1; then
9962 echo "a table of contents needs to be added with '$ar ts'."
9969 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
9970 $test -f $ranlib || ranlib=''
9973 if $test -n "$ranlib"; then
9974 echo "your system has '$ranlib'; we'll use that."
9977 echo "your system doesn't seem to support random libraries"
9978 echo "so we'll use lorder and tsort to order the libraries."
9985 : see if sys/select.h has to be included
9986 set sys/select.h i_sysselct
9989 : see if we should include time.h, sys/time.h, or both
9991 if test "X$timeincl" = X; then
9992 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9993 $echo $n "I'm now running the test program...$c"
9994 $cat >try.c <<'EOCP'
9995 #include <sys/types.h>
10000 #ifdef SYSTIMEKERNEL
10003 #include <sys/time.h>
10006 #include <sys/select.h>
10012 struct timeval bar;
10015 struct timezone tzp;
10017 if (foo.tm_sec == foo.tm_sec)
10020 if (bar.tv_sec == bar.tv_sec)
10027 for s_timezone in '-DS_TIMEZONE' ''; do
10029 for s_timeval in '-DS_TIMEVAL' ''; do
10030 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10031 for i_time in '' '-DI_TIME'; do
10032 for i_systime in '-DI_SYSTIME' ''; do
10035 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10036 if eval $compile; then
10037 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10041 $echo $n "Succeeded with $flags$c"
10053 *SYSTIMEKERNEL*) i_systimek="$define"
10054 timeincl=`./findhdr sys/time.h`
10055 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10056 *) i_systimek="$undef";;
10059 *I_TIME*) i_time="$define"
10060 timeincl=`./findhdr time.h`" $timeincl"
10061 echo "We'll include <time.h>." >&4;;
10062 *) i_time="$undef";;
10065 *I_SYSTIME*) i_systime="$define"
10066 timeincl=`./findhdr sys/time.h`" $timeincl"
10067 echo "We'll include <sys/time.h>." >&4;;
10068 *) i_systime="$undef";;
10073 : check for fd_set items
10076 Checking to see how well your C compiler handles fd_set and friends ...
10078 $cat >fd_set.c <<EOCP
10079 #$i_systime I_SYS_TIME
10080 #$i_sysselct I_SYS_SELECT
10081 #$d_socket HAS_SOCKET
10082 #include <sys/types.h>
10084 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
10087 #include <sys/time.h>
10089 #ifdef I_SYS_SELECT
10090 #include <sys/select.h>
10099 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
10106 set fd_set -DTRYBITS
10107 if eval $compile; then
10108 d_fds_bits="$define"
10110 echo "Well, your system knows about the normal fd_set typedef..." >&4
10112 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
10113 d_fd_macros="$define"
10116 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
10118 d_fd_macros="$undef"
10122 Hmm, your compiler has some difficulty with fd_set. Checking further...
10125 if eval $compile; then
10126 d_fds_bits="$undef"
10128 echo "Well, your system has some sort of fd_set available..." >&4
10130 echo "and you have the normal fd_set macros." >&4
10131 d_fd_macros="$define"
10134 but not the normal fd_set macros! Gross! More work for me...
10136 d_fd_macros="$undef"
10139 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
10141 d_fds_bits="$undef"
10142 d_fd_macros="$undef"
10147 : check for type of arguments to select.
10148 case "$selecttype" in
10149 '') case "$d_select" in
10152 Checking to see what type of arguments are accepted by select().
10154 hdrs="$define sys/types.h
10155 $i_systime sys/time.h
10156 $i_sysselct sys/select.h
10157 $d_socket sys/socket.h"
10158 : The first arg can be int, unsigned, or size_t
10159 : The last arg may or may not be 'const'
10161 for xxx in 'fd_set *' 'int *'; do
10162 for nfd in 'int' 'size_t' 'unsigned' ; do
10163 for tmo in 'struct timeval *' 'const struct timeval *'; do
10165 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
10166 if ./protochk "$try" $hdrs; then
10167 echo "Your system accepts $xxx."
10176 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
10177 case "$d_fd_set" in
10178 $define) dflt="fd_set *" ;;
10187 *) : no select, so pick a harmless default
10194 : Trace out the files included by signal.h, then look for SIGxxx names.
10195 : Remove SIGARRAYSIZE used by HPUX.
10196 : Remove SIGTYP void lines used by OS2.
10197 xxx=`echo '#include <signal.h>' |
10198 $cppstdin $cppminus $cppflags 2>/dev/null |
10199 $grep '^[ ]*#.*include' |
10200 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
10201 : Check this list of files to be sure we have parsed the cpp output ok.
10202 : This will also avoid potentially non-existent files, such
10205 for xx in $xxx /dev/null ; do
10206 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
10208 : If we have found no files, at least try signal.h
10209 case "$xxxfiles" in
10210 '') xxxfiles=`./findhdr signal.h` ;;
10213 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ {
10214 print substr($2, 4, 20)
10216 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
10217 print substr($3, 4, 20)
10219 : Append some common names just in case the awk scan failed.
10220 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
10221 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
10222 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
10223 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
10224 : generate a few handy files for later
10225 $cat > signal.c <<'EOCP'
10226 #include <sys/types.h>
10227 #include <signal.h>
10231 /* Strange style to avoid deeply-nested #if/#else/#endif */
10234 # define NSIG (_NSIG)
10240 # define NSIG (SIGMAX+1)
10246 # define NSIG (SIG_MAX+1)
10252 # define NSIG (MAXSIG+1)
10258 # define NSIG (MAX_SIG+1)
10263 # ifdef SIGARRAYSIZE
10264 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
10270 # define NSIG (_sys_nsig) /* Solaris 2.5 */
10274 /* Default to some arbitrary number that's big enough to get most
10275 of the common signals.
10281 printf("NSIG %d\n", NSIG);
10287 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
10289 printf "#ifdef SIG"; printf $1; printf "\n"
10290 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
10291 printf $1; printf ");\n"
10295 printf "#endif /* JUST_NSIG */\n";
10299 $cat >signal.awk <<'EOP'
10300 BEGIN { ndups = 0 }
10301 $1 ~ /^NSIG$/ { nsig = $2 }
10302 ($1 !~ /^NSIG$/) && (NF == 2) {
10303 if ($2 > maxsig) { maxsig = $2 }
10304 if (sig_name[$2]) {
10305 dup_name[ndups] = $1
10306 dup_num[ndups] = $2
10316 if (nsig == 0) { nsig = maxsig + 1 }
10317 for (n = 1; n < nsig; n++) {
10319 printf("%s %d\n", sig_name[n], sig_num[n])
10322 printf("NUM%d %d\n", n, n)
10325 for (n = 0; n < ndups; n++) {
10326 printf("%s %d\n", dup_name[n], dup_num[n])
10330 $cat >signal_cmd <<EOS
10332 if $test -s signal.lst; then
10333 echo "Using your existing signal.lst file"
10338 $cat >>signal_cmd <<'EOS'
10341 if eval $compile_ok; then
10342 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
10344 echo "(I can't seem be able to compile the whole test program)" >&4
10345 echo "(I'll try it in little pieces.)" >&4
10346 set signal -DJUST_NSIG
10347 if eval $compile_ok; then
10348 ./signal$_exe > signal.nsg
10351 echo "I can't seem to figure out how many signals you have." >&4
10352 echo "Guessing 50." >&4
10353 echo 'NSIG 50' > signal.nsg
10355 : Now look at all the signal names, one at a time.
10356 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
10357 $cat > signal.c <<EOCP
10358 #include <sys/types.h>
10359 #include <signal.h>
10362 printf("$xx %d\n", SIG${xx});
10367 if eval $compile; then
10368 echo "SIG${xx} found."
10369 ./signal$_exe >> signal.ls1
10371 echo "SIG${xx} NOT found."
10374 if $test -s signal.ls1; then
10375 $cat signal.nsg signal.ls1 |
10376 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
10380 if $test -s signal.lst; then
10383 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
10384 echo 'kill -l' >signal
10385 set X `csh -f <signal`
10389 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
10391 echo $@ | $tr ' ' $trnl | \
10392 $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
10394 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
10396 chmod a+x signal_cmd
10397 $eunicefix signal_cmd
10399 : generate list of signal names
10401 case "$sig_name_init" in
10403 echo "Generating a list of signal names and numbers..." >&4
10405 sig_name=`$awk '{printf "%s ", $1}' signal.lst`
10406 sig_name="ZERO $sig_name"
10407 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
10408 { printf "\"%s\", ", $1 }
10409 END { printf "0\n" }' signal.lst`
10410 sig_num=`$awk 'BEGIN { printf "0, " }
10411 { printf "%d, ", $2}
10412 END { printf "0\n"}' signal.lst`
10415 echo "The following signals are available:"
10417 echo $sig_name | $awk \
10418 'BEGIN { linelen = 0 }
10420 for (i = 1; i <= NF; i++) {
10421 name = "SIG" $i " "
10422 linelen = linelen + length(name)
10423 if (linelen > 70) {
10425 linelen = length(name)
10431 $rm -f signal signal.c signal.awk signal.lst signal_cmd
10433 : see what type is used for signed size_t
10434 set ssize_t ssizetype int stdio.h sys/types.h
10437 $cat > ssize.c <<EOM
10439 #include <sys/types.h>
10440 #define Size_t $sizetype
10441 #define SSize_t $dflt
10444 if (sizeof(Size_t) == sizeof(SSize_t))
10446 else if (sizeof(Size_t) == sizeof(int))
10455 if eval $compile_ok && ./ssize > /dev/null; then
10456 ssizetype=`./ssize`
10457 echo "I'll be using $ssizetype for functions returning a byte count." >&4
10460 Help! I can't compile and run the ssize_t test program: please enlighten me!
10461 (This is probably a misconfiguration in your system or libraries, and
10462 you really ought to fix it. Still, I'll try anyway.)
10464 I need a type that is the same size as $sizetype, but is guaranteed to
10465 be signed. Common values are ssize_t, int and long.
10468 rp="What signed type is the same size as $sizetype?"
10472 $rm -f ssize ssize.*
10474 : see what type of char stdio uses.
10476 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
10477 echo "Your stdio uses unsigned chars." >&4
10478 stdchar="unsigned char"
10480 echo "Your stdio uses signed chars." >&4
10484 : see if time exists
10486 if test "X$d_time" = X -o X"$timetype" = X; then
10487 if set time val -f d_time; eval $csym; $val; then
10488 echo 'time() found.' >&4
10490 rp="What is the type returned by time() on this system?"
10491 set time_t timetype long stdio.h sys/types.h
10494 echo 'time() not found, hope that will do.' >&4
10502 : see what type uids are declared as in the kernel
10504 echo "Looking for the type for user ids returned by getuid()."
10505 set uid_t uidtype xxx stdio.h sys/types.h
10509 xxx=`./findhdr sys/user.h`
10510 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
10512 unsigned) dflt="$1 $2" ;;
10516 *) dflt="$uidtype";;
10519 uid_t) echo "uid_t found." ;;
10520 *) rp="What is the type for user ids returned by getuid()?"
10526 : see if dbm.h is available
10527 : see if dbmclose exists
10528 set dbmclose d_dbmclose
10531 case "$d_dbmclose" in
10541 *) set rpcsvc/dbm.h i_rpcsvcdbm
10546 *) echo "We won't be including <dbm.h>"
10556 : see if this is a sys/file.h system
10561 : do we need to include sys/file.h ?
10565 if $h_sysfile; then
10567 echo "We'll be including <sys/file.h>." >&4
10570 echo "We won't be including <sys/file.h>." >&4
10580 : see if fcntl.h is there
10585 : see if we can include fcntl.h
10591 echo "We'll be including <fcntl.h>." >&4
10594 if $h_sysfile; then
10595 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
10597 echo "We won't be including <fcntl.h>." >&4
10609 : see if this is an grp system
10615 : see if setgrent exists
10616 set setgrent d_setgrent
10619 : see if getgrent exists
10620 set getgrent d_getgrent
10623 : see if endgrent exists
10624 set endgrent d_endgrent
10627 xxx=`./findhdr grp.h`
10628 $cppstdin $cppflags $cppminus < $xxx >$$.h
10630 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10640 *) # Assume all is lost as far as the d_*gr* go.
10642 set d_setgrent; eval $setvar
10643 set d_getgrent; eval $setvar
10644 set d_endgrent; eval $setvar
10645 set d_grpasswd; eval $setvar
10649 : see if locale.h is available
10650 set locale.h i_locale
10653 : see if this is a math.h system
10657 : see if ndbm.h is available
10662 : see if dbm_open exists
10663 set dbm_open d_dbm_open
10665 case "$d_dbm_open" in
10668 echo "We won't be including <ndbm.h>"
10677 : see if net/errno.h is available
10679 set net/errno.h val
10682 : Unfortunately, it causes problems on some systems. Arrgh.
10685 cat > try.c <<'EOM'
10688 #include <net/errno.h>
10694 if $cc $ccflags -c try.c >/dev/null 2>&1; then
10695 echo "We'll be including <net/errno.h>." >&4
10697 echo "We won't be including <net/errno.h>." >&4
10706 : get C preprocessor symbols handy
10708 $echo $n "Hmm... $c"
10709 echo $al | $tr ' ' $trnl >Cppsym.know
10710 $cat <<EOSS >Cppsym
10718 case "\$list\$#" in
10721 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
10723 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
10726 unknown="\$unknown \$sym"
10736 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
10738 exit 0; _ _ _ _\1\\ \1\\
10741 echo "exit 1; _ _ _" >>Cppsym\$\$
10742 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
10744 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
10750 $rm -f Cppsym\$\$ Cppsym2\$\$
10755 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
10757 : now check the C compiler for additional symbols
10763 for i in \`$cc -v -c tmp.c 2>&1\`
10766 -D*) echo "\$i" | $sed 's/^-D//';;
10767 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
10774 ./ccsym | $sort | $uniq >ccsym.raw
10775 $awk '/\=/ { print $0; next }
10776 { print $0"=1" }' ccsym.raw >ccsym.list
10777 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
10778 $comm -13 ccsym.true ccsym.list >ccsym.own
10779 $comm -12 ccsym.true ccsym.list >ccsym.com
10780 $comm -23 ccsym.true ccsym.list >ccsym.cpp
10783 if $test -z ccsym.raw; then
10784 echo "Your C compiler doesn't seem to define any symbol!" >&4
10786 echo "However, your C preprocessor defines the following ones:"
10789 if $test -s ccsym.com; then
10790 echo "Your C compiler and pre-processor define these symbols:"
10791 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
10794 $test "$silent" || sleep 1
10796 if $test -s ccsym.cpp; then
10797 $test "$also" && echo " "
10798 echo "Your C pre-processor ${also}defines the following $symbols:"
10799 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
10801 $test "$silent" || sleep 1
10803 if $test -s ccsym.own; then
10804 $test "$also" && echo " "
10805 echo "Your C compiler ${also}defines the following cpp variables:"
10806 $sed -e 's/\(.*\)=1/\1/' ccsym.own
10807 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
10808 $test "$silent" || sleep 1
10813 : see if this is a termio system
10817 if $test `./findhdr termios.h`; then
10818 set tcsetattr i_termios
10824 "$define") echo "You have POSIX termios.h... good!" >&4;;
10825 *) if ./Cppsym pyr; then
10826 case "`/bin/universe`" in
10827 ucb) if $test `./findhdr sgtty.h`; then
10829 echo "<sgtty.h> found." >&4
10831 echo "System is pyramid with BSD universe."
10832 echo "<sgtty.h> not found--you could have problems." >&4
10834 *) if $test `./findhdr termio.h`; then
10836 echo "<termio.h> found." >&4
10838 echo "System is pyramid with USG universe."
10839 echo "<termio.h> not found--you could have problems." >&4
10843 if $test `./findhdr termio.h`; then
10844 echo "<termio.h> found." >&4
10846 elif $test `./findhdr sgtty.h`; then
10847 echo "<sgtty.h> found." >&4
10850 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
10853 if $test `./findhdr sgtty.h`; then
10854 echo "<sgtty.h> found." >&4
10856 elif $test `./findhdr termio.h`; then
10857 echo "<termio.h> found." >&4
10860 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
10864 set i_termio; eval $setvar
10865 val=$val2; set i_sgtty; eval $setvar
10866 val=$val3; set i_termios; eval $setvar
10868 : see if stdarg is available
10870 if $test `./findhdr stdarg.h`; then
10871 echo "<stdarg.h> found." >&4
10874 echo "<stdarg.h> NOT found." >&4
10878 : see if varags is available
10880 if $test `./findhdr varargs.h`; then
10881 echo "<varargs.h> found." >&4
10883 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10886 : set up the varargs testing programs
10887 $cat > varargs.c <<EOP
10889 #include <stdarg.h>
10892 #include <varargs.h>
10896 int f(char *p, ...)
10910 p = va_arg(ap, char *);
10915 $cat > varargs <<EOP
10917 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10926 : now check which varargs header should be included
10931 if `./varargs I_STDARG`; then
10933 elif `./varargs I_VARARGS`; then
10938 if `./varargs I_VARARGS`; then
10945 echo "I could not find the definition for va_dcl... You have problems..." >&4
10946 val="$undef"; set i_stdarg; eval $setvar
10947 val="$undef"; set i_varargs; eval $setvar
10952 case "$i_varhdr" in
10954 val="$define"; set i_stdarg; eval $setvar
10955 val="$undef"; set i_varargs; eval $setvar
10958 val="$undef"; set i_stdarg; eval $setvar
10959 val="$define"; set i_varargs; eval $setvar
10962 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10966 : see if stddef is available
10967 set stddef.h i_stddef
10970 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
10971 set sys/filio.h i_sysfilio
10974 if $test `./findhdr sys/ioctl.h`; then
10976 echo '<sys/ioctl.h> found.' >&4
10979 if $test $i_sysfilio = "$define"; then
10980 echo '<sys/ioctl.h> NOT found.' >&4
10982 $test $i_sgtty = "$define" && xxx="sgtty.h"
10983 $test $i_termio = "$define" && xxx="termio.h"
10984 $test $i_termios = "$define" && xxx="termios.h"
10985 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
10991 : see if this is a sys/param system
10992 set sys/param.h i_sysparam
10995 : see if sys/resource.h has to be included
10996 set sys/resource.h i_sysresrc
10999 : see if sys/stat.h is available
11000 set sys/stat.h i_sysstat
11003 : see if this is a sys/un.h system
11004 set sys/un.h i_sysun
11007 : see if this is a syswait system
11008 set sys/wait.h i_syswait
11011 : see if this is an utime system
11012 set utime.h i_utime
11015 : see if this is a values.h system
11016 set values.h i_values
11019 : see if this is a vfork system
11022 set vfork.h i_vfork
11030 : see if gdbm.h is available
11035 : see if gdbm_open exists
11036 set gdbm_open d_gdbm_open
11038 case "$d_gdbm_open" in
11041 echo "We won't be including <gdbm.h>"
11051 echo "Looking for extensions..." >&4
11054 : If we are using the old config.sh, known_extensions may contain
11055 : old or inaccurate or duplicate values.
11056 known_extensions=''
11057 nonxs_extensions=''
11058 : We do not use find because it might not be available.
11059 : We do not just use MANIFEST because the user may have dropped
11060 : some additional extensions into the source tree and expect them
11064 DynaLoader|dynaload) ;;
11065 *) if $test -f $xxx/$xxx.xs; then
11066 known_extensions="$known_extensions $xxx"
11067 elif $test -f $xxx/Makefile.PL; then
11068 nonxs_extensions="$nonxs_extensions $xxx"
11070 if $test -d $xxx; then
11071 # Look for nested extensions, eg. Devel/Dprof.
11074 if $test -f $yyy/$yyy.xs; then
11075 known_extensions="$known_extensions $xxx/$yyy"
11076 elif $test -f $yyy/Makefile.PL; then
11077 nonxs_extensions="$nonxs_extensions $xxx/$yyy"
11086 set X $nonxs_extensions
11088 nonxs_extensions="$*"
11089 set X $known_extensions
11091 known_extensions="$*"
11094 : Now see which are supported on this system.
11096 for xxx in $known_extensions ; do
11100 $define) avail_ext="$avail_ext $xxx" ;;
11103 GDBM_File|gdbm_fil)
11105 $define) avail_ext="$avail_ext $xxx" ;;
11108 NDBM_File|ndbm_fil)
11110 $define) avail_ext="$avail_ext $xxx" ;;
11113 ODBM_File|odbm_fil)
11114 case "${i_dbm}${i_rpcsvcdbm}" in
11115 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
11119 case "$useposix" in
11120 true|define|y) avail_ext="$avail_ext $xxx" ;;
11124 case "$useopcode" in
11125 true|define|y) avail_ext="$avail_ext $xxx" ;;
11129 case "$d_socket" in
11130 true|$define|y) avail_ext="$avail_ext $xxx" ;;
11134 case "$usethreads" in
11135 true|$define|y) avail_ext="$avail_ext $xxx" ;;
11139 case "${d_msg}${d_sem}${d_shm}" in
11140 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
11143 *) avail_ext="$avail_ext $xxx"
11152 : Now see which nonxs extensions are supported on this system.
11153 : For now assume all are.
11155 for xxx in $nonxs_extensions ; do
11157 *) nonxs_ext="$nonxs_ext $xxx"
11169 A number of extensions are supplied with $package. You may choose to
11170 compile these extensions for dynamic loading (the default), compile
11171 them into the $package executable (static loading), or not include
11172 them at all. Answer "none" to include no extensions.
11173 Note that DynaLoader is always built and need not be mentioned here.
11176 case "$dynamic_ext" in
11177 '') dflt="$avail_ext" ;;
11178 *) dflt="$dynamic_ext"
11179 # Perhaps we are reusing an old out-of-date config.sh.
11182 if test X"$dynamic_ext" != X"$avail_ext"; then
11184 NOTICE: Your previous config.sh list may be incorrect.
11185 The extensions now available to you are
11187 but the default list from your previous config.sh is
11199 rp="What extensions do you wish to load dynamically?"
11202 none) dynamic_ext=' ' ;;
11203 *) dynamic_ext="$ans" ;;
11206 case "$static_ext" in
11208 : Exclude those already listed in dynamic linking
11210 for xxx in $avail_ext; do
11211 case " $dynamic_ext " in
11213 *) dflt="$dflt $xxx" ;;
11220 *) dflt="$static_ext"
11227 rp="What extensions do you wish to load statically?"
11230 none) static_ext=' ' ;;
11231 *) static_ext="$ans" ;;
11236 A number of extensions are supplied with $package. Answer "none"
11237 to include no extensions.
11238 Note that DynaLoader is always built and need not be mentioned here.
11241 case "$static_ext" in
11242 '') dflt="$avail_ext" ;;
11243 *) dflt="$static_ext"
11244 # Perhaps we are reusing an old out-of-date config.sh.
11247 if test X"$static_ext" != X"$avail_ext"; then
11249 NOTICE: Your previous config.sh list may be incorrect.
11250 The extensions now available to you are
11252 but the default list from your previous config.sh is
11261 : Exclude those that are not xs extensions
11265 rp="What extensions do you wish to include?"
11268 none) static_ext=' ' ;;
11269 *) static_ext="$ans" ;;
11274 set X $dynamic_ext $static_ext $nonxs_ext
11278 : Remove build directory name from cppstdin so it can be used from
11279 : either the present location or the final installed location.
11281 : Get out of the UU directory to get correct path name.
11283 case "$cppstdin" in
11285 echo "Stripping down cppstdin path name"
11291 : end of configuration questions
11293 echo "End of configuration questions."
11296 : back to where it started
11297 if test -d ../UU; then
11301 : configuration may be patched via a 'config.over' file
11302 if $test -f config.over; then
11305 rp='I see a config.over file. Do you wish to load it?'
11308 n*) echo "OK, I'll ignore it.";;
11310 echo "Configuration override changes have been loaded."
11315 : in case they want portability, strip down executable paths
11316 case "$d_portable" in
11319 echo "Stripping down executable paths..." >&4
11320 for file in $loclist $trylist; do
11321 if test X$file != Xln -a X$file != Xar -o X$osname != Xos2; then
11322 eval $file="\$file"
11328 : create config.sh file
11330 echo "Creating config.sh..." >&4
11331 $spitshell <<EOT >config.sh
11334 # This file was produced by running the Configure script. It holds all the
11335 # definitions figured out by Configure. Should you modify one of these values,
11336 # do not forget to propagate your changes by running "Configure -der". You may
11337 # instead choose to run each of the .SH files by yourself, or "Configure -S".
11340 # Package name : $package
11341 # Source directory : $src
11342 # Configuration time: $cf_time
11343 # Configured by : $cf_by
11344 # Target system : $myuname
11354 Revision='$Revision'
11361 alignbytes='$alignbytes'
11362 ansi2knr='$ansi2knr'
11363 aphostname='$aphostname'
11364 apiversion='$apiversion'
11367 archlibexp='$archlibexp'
11368 archname='$archname'
11369 archobjs='$archobjs'
11377 byteorder='$byteorder'
11379 castflags='$castflags'
11382 cccdlflags='$cccdlflags'
11383 ccdlflags='$ccdlflags'
11386 cf_email='$cf_email'
11391 clocktype='$clocktype'
11393 compress='$compress'
11394 contains='$contains'
11398 cpp_stuff='$cpp_stuff'
11399 cppflags='$cppflags'
11401 cppminus='$cppminus'
11403 cppstdin='$cppstdin'
11404 cryptlib='$cryptlib'
11406 d_Gconvert='$d_Gconvert'
11407 d_access='$d_access'
11409 d_archlib='$d_archlib'
11410 d_attribut='$d_attribut'
11414 d_bsdgetpgrp='$d_bsdgetpgrp'
11415 d_bsdsetpgrp='$d_bsdsetpgrp'
11417 d_casti32='$d_casti32'
11418 d_castneg='$d_castneg'
11419 d_charvspr='$d_charvspr'
11421 d_chroot='$d_chroot'
11422 d_chsize='$d_chsize'
11423 d_closedir='$d_closedir'
11427 d_cuserid='$d_cuserid'
11428 d_dbl_dig='$d_dbl_dig'
11429 d_difftime='$d_difftime'
11430 d_dirnamlen='$d_dirnamlen'
11431 d_dlerror='$d_dlerror'
11432 d_dlopen='$d_dlopen'
11433 d_dlsymun='$d_dlsymun'
11434 d_dosuid='$d_dosuid'
11436 d_endgrent='$d_endgrent'
11437 d_endhent='$d_endhent'
11438 d_endnent='$d_endnent'
11439 d_endpent='$d_endpent'
11440 d_endpwent='$d_endpwent'
11441 d_endsent='$d_endsent'
11442 d_eofnblk='$d_eofnblk'
11443 d_eunice='$d_eunice'
11444 d_fchmod='$d_fchmod'
11445 d_fchown='$d_fchown'
11447 d_fd_macros='$d_fd_macros'
11448 d_fd_set='$d_fd_set'
11449 d_fds_bits='$d_fds_bits'
11450 d_fgetpos='$d_fgetpos'
11451 d_flexfnam='$d_flexfnam'
11454 d_fpathconf='$d_fpathconf'
11455 d_fsetpos='$d_fsetpos'
11457 d_getgrent='$d_getgrent'
11458 d_getgrps='$d_getgrps'
11459 d_gethbyaddr='$d_gethbyaddr'
11460 d_gethbyname='$d_gethbyname'
11461 d_gethent='$d_gethent'
11462 d_gethname='$d_gethname'
11463 d_gethostprotos='$d_gethostprotos'
11464 d_getlogin='$d_getlogin'
11465 d_getnbyaddr='$d_getnbyaddr'
11466 d_getnbyname='$d_getnbyname'
11467 d_getnent='$d_getnent'
11468 d_getnetprotos='$d_getnetprotos'
11469 d_getpbyname='$d_getpbyname'
11470 d_getpbynumber='$d_getpbynumber'
11471 d_getpent='$d_getpent'
11472 d_getpgid='$d_getpgid'
11473 d_getpgrp2='$d_getpgrp2'
11474 d_getpgrp='$d_getpgrp'
11475 d_getppid='$d_getppid'
11476 d_getprior='$d_getprior'
11477 d_getprotoprotos='$d_getprotoprotos'
11478 d_getpwent='$d_getpwent'
11479 d_getsbyname='$d_getsbyname'
11480 d_getsbyport='$d_getsbyport'
11481 d_getsent='$d_getsent'
11482 d_getservprotos='$d_getservprotos'
11483 d_gettimeod='$d_gettimeod'
11484 d_gnulibc='$d_gnulibc'
11485 d_grpasswd='$d_grpasswd'
11488 d_inetaton='$d_inetaton'
11489 d_isascii='$d_isascii'
11490 d_killpg='$d_killpg'
11491 d_lchown='$d_lchown'
11493 d_locconv='$d_locconv'
11495 d_longdbl='$d_longdbl'
11496 d_longlong='$d_longlong'
11499 d_mbstowcs='$d_mbstowcs'
11500 d_mbtowc='$d_mbtowc'
11501 d_memcmp='$d_memcmp'
11502 d_memcpy='$d_memcpy'
11503 d_memmove='$d_memmove'
11504 d_memset='$d_memset'
11506 d_mkfifo='$d_mkfifo'
11507 d_mktime='$d_mktime'
11509 d_msgctl='$d_msgctl'
11510 d_msgget='$d_msgget'
11511 d_msgrcv='$d_msgrcv'
11512 d_msgsnd='$d_msgsnd'
11513 d_mymalloc='$d_mymalloc'
11515 d_oldpthreads='$d_oldpthreads'
11516 d_oldsock='$d_oldsock'
11518 d_pathconf='$d_pathconf'
11520 d_phostname='$d_phostname'
11523 d_portable='$d_portable'
11524 d_pthread_yield='$d_pthread_yield'
11525 d_pthreads_created_joinable='$d_pthreads_created_joinable'
11527 d_pwchange='$d_pwchange'
11528 d_pwclass='$d_pwclass'
11529 d_pwcomment='$d_pwcomment'
11530 d_pwexpire='$d_pwexpire'
11531 d_pwgecos='$d_pwgecos'
11532 d_pwquota='$d_pwquota'
11533 d_pwpasswd='$d_pwpasswd'
11534 d_readdir='$d_readdir'
11535 d_readlink='$d_readlink'
11536 d_rename='$d_rename'
11537 d_rewinddir='$d_rewinddir'
11539 d_safebcpy='$d_safebcpy'
11540 d_safemcpy='$d_safemcpy'
11541 d_sanemcmp='$d_sanemcmp'
11542 d_sched_yield='$d_sched_yield'
11543 d_seekdir='$d_seekdir'
11544 d_select='$d_select'
11546 d_semctl='$d_semctl'
11547 d_semctl_semid_ds='$d_semctl_semid_ds'
11548 d_semctl_semun='$d_semctl_semun'
11549 d_semget='$d_semget'
11551 d_setegid='$d_setegid'
11552 d_seteuid='$d_seteuid'
11553 d_setgrent='$d_setgrent'
11554 d_setgrps='$d_setgrps'
11555 d_sethent='$d_sethent'
11556 d_setlinebuf='$d_setlinebuf'
11557 d_setlocale='$d_setlocale'
11558 d_setnent='$d_setnent'
11559 d_setpent='$d_setpent'
11560 d_setpgid='$d_setpgid'
11561 d_setpgrp2='$d_setpgrp2'
11562 d_setpgrp='$d_setpgrp'
11563 d_setprior='$d_setprior'
11564 d_setpwent='$d_setpwent'
11565 d_setregid='$d_setregid'
11566 d_setresgid='$d_setresgid'
11567 d_setresuid='$d_setresuid'
11568 d_setreuid='$d_setreuid'
11569 d_setrgid='$d_setrgid'
11570 d_setruid='$d_setruid'
11571 d_setsent='$d_setsent'
11572 d_setsid='$d_setsid'
11573 d_setvbuf='$d_setvbuf'
11577 d_shmatprototype='$d_shmatprototype'
11578 d_shmctl='$d_shmctl'
11580 d_shmget='$d_shmget'
11581 d_sigaction='$d_sigaction'
11582 d_sigsetjmp='$d_sigsetjmp'
11583 d_socket='$d_socket'
11584 d_sockpair='$d_sockpair'
11585 d_statblks='$d_statblks'
11586 d_stdio_cnt_lval='$d_stdio_cnt_lval'
11587 d_stdio_ptr_lval='$d_stdio_ptr_lval'
11588 d_stdiobase='$d_stdiobase'
11589 d_stdstdio='$d_stdstdio'
11590 d_strchr='$d_strchr'
11591 d_strcoll='$d_strcoll'
11592 d_strctcpy='$d_strctcpy'
11593 d_strerrm='$d_strerrm'
11594 d_strerror='$d_strerror'
11595 d_strtod='$d_strtod'
11596 d_strtol='$d_strtol'
11597 d_strtoul='$d_strtoul'
11598 d_strxfrm='$d_strxfrm'
11599 d_suidsafe='$d_suidsafe'
11600 d_symlink='$d_symlink'
11601 d_syscall='$d_syscall'
11602 d_sysconf='$d_sysconf'
11603 d_sysernlst='$d_sysernlst'
11604 d_syserrlst='$d_syserrlst'
11605 d_system='$d_system'
11606 d_tcgetpgrp='$d_tcgetpgrp'
11607 d_tcsetpgrp='$d_tcsetpgrp'
11608 d_telldir='$d_telldir'
11611 d_truncate='$d_truncate'
11612 d_tzname='$d_tzname'
11615 d_union_semun='$d_union_semun'
11617 d_void_closedir='$d_void_closedir'
11618 d_voidsig='$d_voidsig'
11619 d_voidtty='$d_voidtty'
11620 d_volatile='$d_volatile'
11621 d_vprintf='$d_vprintf'
11623 d_waitpid='$d_waitpid'
11624 d_wcstombs='$d_wcstombs'
11625 d_wctomb='$d_wctomb'
11628 db_hashtype='$db_hashtype'
11629 db_prefixtype='$db_prefixtype'
11630 defvoidused='$defvoidused'
11631 direntrytype='$direntrytype'
11634 doublesize='$doublesize'
11635 dynamic_ext='$dynamic_ext'
11641 eunicefix='$eunicefix'
11644 extensions='$extensions'
11646 firstmakefile='$firstmakefile'
11648 fpostype='$fpostype'
11649 freetype='$freetype'
11650 full_csh='$full_csh'
11651 full_sed='$full_sed'
11652 gccversion='$gccversion'
11656 groupcat='$groupcat'
11657 groupstype='$groupstype'
11660 h_sysfile='$h_sysfile'
11664 i_arpa_inet='$i_arpa_inet'
11665 i_bsdioctl='$i_bsdioctl'
11668 i_dirent='$i_dirent'
11675 i_limits='$i_limits'
11676 i_locale='$i_locale'
11677 i_malloc='$i_malloc'
11679 i_memory='$i_memory'
11682 i_neterrno='$i_neterrno'
11685 i_rpcsvcdbm='$i_rpcsvcdbm'
11688 i_stdarg='$i_stdarg'
11689 i_stddef='$i_stddef'
11690 i_stdlib='$i_stdlib'
11691 i_string='$i_string'
11692 i_sysdir='$i_sysdir'
11693 i_sysfile='$i_sysfile'
11694 i_sysfilio='$i_sysfilio'
11696 i_sysioctl='$i_sysioctl'
11697 i_sysndir='$i_sysndir'
11698 i_sysparam='$i_sysparam'
11699 i_sysresrc='$i_sysresrc'
11700 i_sysselct='$i_sysselct'
11701 i_syssockio='$i_syssockio'
11702 i_sysstat='$i_sysstat'
11703 i_systime='$i_systime'
11704 i_systimek='$i_systimek'
11705 i_systimes='$i_systimes'
11706 i_systypes='$i_systypes'
11708 i_syswait='$i_syswait'
11709 i_termio='$i_termio'
11710 i_termios='$i_termios'
11712 i_unistd='$i_unistd'
11714 i_values='$i_values'
11715 i_varargs='$i_varargs'
11716 i_varhdr='$i_varhdr'
11720 installarchlib='$installarchlib'
11721 installbin='$installbin'
11722 installman1dir='$installman1dir'
11723 installman3dir='$installman3dir'
11724 installprivlib='$installprivlib'
11725 installscript='$installscript'
11726 installsitearch='$installsitearch'
11727 installsitelib='$installsitelib'
11729 known_extensions='$known_extensions'
11733 lddlflags='$lddlflags'
11741 libswanted='$libswanted'
11747 locincpth='$locincpth'
11748 loclibpth='$loclibpth'
11749 longdblsize='$longdblsize'
11750 longlongsize='$longlongsize'
11751 longsize='$longsize'
11755 lseektype='$lseektype'
11759 make_set_make='$make_set_make'
11760 mallocobj='$mallocobj'
11761 mallocsrc='$mallocsrc'
11762 malloctype='$malloctype'
11764 man1direxp='$man1direxp'
11767 man3direxp='$man3direxp'
11771 mips_type='$mips_type'
11774 modetype='$modetype'
11777 myarchname='$myarchname'
11778 mydomain='$mydomain'
11779 myhostname='$myhostname'
11782 netdb_hlen_type='$netdb_hlen_type'
11783 netdb_host_type='$netdb_host_type'
11784 netdb_name_type='$netdb_name_type'
11785 netdb_net_type='$netdb_net_type'
11788 nm_so_opt='$nm_so_opt'
11789 nonxs_ext='$nonxs_ext'
11791 o_nonblock='$o_nonblock'
11793 optimize='$optimize'
11794 orderlib='$orderlib'
11800 patchlevel='$patchlevel'
11801 path_sep='$path_sep'
11803 perladmin='$perladmin'
11804 perlpath='$perlpath'
11806 phostname='$phostname'
11812 prefixexp='$prefixexp'
11814 privlibexp='$privlibexp'
11815 prototype='$prototype'
11817 randbits='$randbits'
11819 rd_nodata='$rd_nodata'
11823 scriptdir='$scriptdir'
11824 scriptdirexp='$scriptdirexp'
11826 selecttype='$selecttype'
11827 sendmail='$sendmail'
11830 sharpbang='$sharpbang'
11831 shmattype='$shmattype'
11832 shortsize='$shortsize'
11835 sig_name='$sig_name'
11836 sig_name_init='$sig_name_init'
11838 signal_t='$signal_t'
11839 sitearch='$sitearch'
11840 sitearchexp='$sitearchexp'
11842 sitelibexp='$sitelibexp'
11843 sizetype='$sizetype'
11848 sockethdr='$sockethdr'
11849 socketlib='$socketlib'
11851 spackage='$spackage'
11852 spitshell='$spitshell'
11855 ssizetype='$ssizetype'
11856 startperl='$startperl'
11858 static_ext='$static_ext'
11860 stdio_base='$stdio_base'
11861 stdio_bufsiz='$stdio_bufsiz'
11862 stdio_cnt='$stdio_cnt'
11863 stdio_filbuf='$stdio_filbuf'
11864 stdio_ptr='$stdio_ptr'
11867 subversion='$subversion'
11874 timeincl='$timeincl'
11875 timetype='$timetype'
11884 usemymalloc='$usemymalloc'
11886 useopcode='$useopcode'
11887 useperlio='$useperlio'
11888 useposix='$useposix'
11890 useshrplib='$useshrplib'
11891 usethreads='$usethreads'
11892 usevfork='$usevfork'
11897 voidflags='$voidflags'
11903 : Add in command line options if available
11904 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
11906 : add special variables
11907 $test -f $src/patchlevel.h && \
11908 awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
11909 echo "CONFIG=true" >>config.sh
11911 : propagate old symbols
11912 if $test -f UU/config.sh; then
11913 <UU/config.sh sort | uniq >UU/oldconfig.sh
11914 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
11915 sort | uniq -u >UU/oldsyms
11916 set X `cat UU/oldsyms`
11922 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
11924 echo "# Variables propagated from previous config.sh file." >>config.sh
11925 for sym in `cat UU/oldsyms`; do
11926 echo " Propagating $hint variable "'$'"$sym..."
11927 eval 'tmp="$'"${sym}"'"'
11929 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
11935 : Finish up by extracting the .SH files
11949 If you'd like to make any changes to the config.sh file before I begin
11950 to configure things, do it as a shell escape now (e.g. !vi config.sh).
11953 rp="Press return or use a shell escape to edit config.sh:"
11958 *) : in case they cannot read
11959 sh 1>&4 -c "$ans";;
11964 : if this fails, just run all the .SH files by hand
11970 echo "This is an EBCDIC system, checking if any parser files may need regenerating." >&4
11971 rm -f y.tab.c y.tab.h
11972 yacc -d perly.y >/dev/null 2>&1
11973 if cmp -s y.tab.c perly.c; then
11976 echo "perly.y -> perly.c" >&4
11977 mv -f y.tab.c perly.c
11979 sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
11980 -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
11983 if cmp -s y.tab.h perly.h; then
11986 echo "perly.y -> perly.h" >&4
11987 mv -f y.tab.h perly.h
11990 echo "x2p/a2p.y" >&4
11992 rm -f y.tab.c y.tab.h
11993 yacc -d a2p.y >/dev/null 2>&1
11994 if cmp -s y.tab.c a2p.c
11998 echo "a2p.y -> a2p.c" >&4
11999 mv -f y.tab.c a2p.c
12001 sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
12002 -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c
12005 if cmp -s y.tab.h a2p.h
12009 echo "a2p.h -> a2p.h" >&4
12010 mv -f y.tab.h a2p.h
12015 '') echo "No parser files were regenerated. That's okay." >&4 ;;
12024 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
12031 Now you need to generate make dependencies by running "make depend".
12032 You might prefer to run it in background: "make depend > makedepend.out &"
12033 It can take a while, so you might not want to run it right now.
12038 rp="Run make depend now?"
12042 make depend && echo "Now you must run a make."
12045 echo "You must run 'make depend' then 'make'."
12048 elif test -f [Mm]akefile; then
12050 echo "Now you must run a make."
12055 if $test -f Policy.sh; then
12058 If you compile $package on a different machine or from a different object
12059 directory, copy the Policy.sh file from this object directory to the
12060 new one before you run Configure -- this will help you with most of
12061 the policy defaults.
12065 if $test -f config.msg; then
12066 echo "Hmm. I also noted the following information while running:"
12068 $cat config.msg >&4
12071 $rm -f kit*isdone ark*isdone