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 jhi@iki.fi)
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`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 case "$inksh/$needksh" in
118 case "$inksh/$avoidksh" in
124 case "$inksh/$needksh-$avoidksh-" in
127 (I see you are using the Korn shell. Some ksh's blow up on $me,
128 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
134 echo "(Feeding myself to $newsh $reason.)"
136 Configure|*/Configure) exec $newsh $0 "$@";;
137 *) exec $newsh Configure "$@";;
142 : if needed set CDPATH to a harmless value that is not chatty
143 : avoid bash 2.02 problems with empty CDPATH.
147 *bash*) CDPATH='.' ;;
152 : Configure runs within the UU subdirectory
153 test -d UU || mkdir UU
414 d_pthreads_created_joinable=''
621 ignore_versioned_solibs=''
729 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
738 : We must find out about Eunice early
740 if test -f /etc/unixtovms; then
741 eunicefix=/etc/unixtovms
743 if test -f /etc/unixtovms.exe; then
744 eunicefix=/etc/unixtovms.exe
747 : list of known cpp symbols, sorted alphabetically
748 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
749 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
750 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
751 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
752 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
753 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
754 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
755 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
756 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
757 al="$al VMS Xenix286"
758 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI _POWER"
759 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
760 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
761 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
762 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
763 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
764 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
765 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
766 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
767 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
768 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
769 al="$al __SVR4_2__ __UMAXV__"
770 al="$al ____386BSD____ __alpha __alpha__ __amiga"
771 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
772 al="$al __host_mips__"
773 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
774 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
775 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
776 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
777 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
778 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
779 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
780 al="$al __mc88100 __mc88100__ __mips __mips__"
781 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
782 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
783 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
784 al="$al _host_mips _mips _unix"
785 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
786 al="$al apollo ardent att386 att3b"
787 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
788 al="$al cadmus clipper concurrent convex cray ctix"
789 al="$al dmert encore gcos gcx gimpel gould"
790 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
791 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
792 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
793 al="$al i186 i286 i386 i486 i8086"
794 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
795 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
796 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
797 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
798 al="$al mc88000 mc88100 merlin mert mips mvs n16"
799 al="$al ncl_el ncl_mr"
800 al="$al news1500 news1700 news1800 news1900 news3700"
801 al="$al news700 news800 news900 ns16000 ns32000"
802 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
803 al="$al parisc pc532 pdp11 plexus posix pyr"
804 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
805 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
806 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
807 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
808 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
809 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
813 : change the next line if compiling for Xenix/286 on Xenix/386
814 xlibpth='/usr/lib/386 /lib/386'
816 : Possible local library directories to search.
817 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
818 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
820 : general looking path for locating libraries
821 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
822 glibpth="$glibpth /lib /usr/lib $xlibpth"
823 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
824 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
826 : Private path used by Configure to find libraries. Its value
827 : is prepended to libpth. This variable takes care of special
828 : machines, like the mips. Usually, it should be empty.
831 : default library list
833 : some systems want only to use the non-versioned libso:s
834 ignore_versioned_solibs=''
835 : Possible local include directories to search.
836 : Set locincpth to "" in a hint file to defeat local include searches.
837 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
838 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
840 : no include file wanted by default
843 : Trailing extension. Override this in a hint file, if needed.
845 : Extra object files, if any, needed on this platform.
848 : full support for void wanted by default
851 : set useposix=false in your hint file to disable the POSIX extension.
853 : set useopcode=false in your hint file to disable the Opcode extension.
855 : set usethreads on the Configure command line to enable threads.
856 : List of libraries we want.
857 : If anyone needs -lnet, put it in a hint file.
858 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
859 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
860 libswanted="$libswanted ucb bsd BSD PW x"
861 : We probably want to search /usr/shlib before most other libraries.
862 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
863 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
864 glibpth="/usr/shlib $glibpth"
865 : Do not use vfork unless overridden by a hint file.
868 : Find the basic shell for Bourne shell scripts
872 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
875 if test -f "$xxx"; then
878 : Build up a list and do a single loop so we can 'break' out.
879 pth=`echo $PATH | sed -e "s/$p_/ /g"`
880 for xxx in sh bash ksh pdksh ash; do
882 try="$try ${p}/${xxx}"
886 if test -f "$xxx"; then
889 elif test -f "$xxx.exe"; then
900 $me: Fatal Error: I can't find a Bourne Shell anywhere.
902 Usually it's in /bin/sh. How did you even get this far?
903 Please contact perlbug@perl.com and we'll try to straighten this all out.
909 : see if sh knows # comments
910 if `$sh -c '#' >/dev/null 2>&1`; then
914 test -f $xcat || xcat=/usr/bin/cat
919 if test -s today; then
922 echo "#! $xcat" > try
926 if test -s today; then
934 echo "Your $sh doesn't grok # comments--I will strip them later on."
937 echo "exec grep -v '^[ ]*#'" >spitshell
940 spitshell=`pwd`/spitshell
942 echo "I presume that if # doesn't work, #! won't work either!"
947 : figure out how to guarantee sh startup
949 '') startsh=${sharpbang}${sh} ;;
961 : echo "Yup, it does."
963 echo "Hmm... '$startsh' does not guarantee sh startup..."
964 echo "You may have to fix up the shell scripts to make sure $sh runs them."
969 : Save command line options in file UU/cmdline.opt for later use in
970 : generating config.sh.
971 cat > cmdline.opt <<EOSH
972 # Configure command line arguments.
979 cat >>cmdline.opt <<EOSH
980 config_arg$argn='$arg'
982 argn=`expr $argn + 1`
985 : produce awk script to parse command line options
986 cat >options.awk <<'EOF'
988 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
990 len = length(optstr);
991 for (i = 1; i <= len; i++) {
992 c = substr(optstr, i, 1);
993 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1004 if (substr(str, 1, 1) != "-") {
1005 printf("'%s'\n", str);
1009 for (i = 2; i <= len; i++) {
1010 c = substr(str, i, 1);
1012 printf("-%s\n", substr(str, i));
1018 printf("'%s'\n", substr(str, i + 1));
1031 : process the command line options
1032 set X `for arg in "$@"; do echo "X$arg"; done |
1033 sed -e s/X// | awk -f options.awk`
1038 : set up default values
1049 cat >optdef.sh <<EOS
1055 while test $# -gt 0; do
1057 -d) shift; fastread=yes;;
1058 -e) shift; alldone=cont;;
1062 if test -r "$1"; then
1065 echo "$me: cannot read config file $1." >&2
1070 -h) shift; error=true;;
1071 -r) shift; reuseval=true;;
1072 -s) shift; silent=true; realsilent=true;;
1073 -E) shift; alldone=exit;;
1074 -K) shift; knowitall=true;;
1075 -O) shift; override=true;;
1076 -S) shift; silent=true; extractsh=true;;
1081 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1082 echo "$me: ignoring -D $1" >&2
1085 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1086 *) echo "$1='define'" >> optdef.sh;;
1093 *=) echo "$1" >> optdef.sh;;
1095 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1096 echo "$me: ignoring -U $1" >&2
1098 *) echo "$1='undef'" >> optdef.sh;;
1102 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1105 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1113 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1114 [-U symbol] [-U symbol=]
1115 -d : use defaults for all answers.
1116 -e : go on without questioning past the production of config.sh.
1117 -f : specify an alternate default configuration file.
1118 -h : print this help message and exit (with an error status).
1119 -r : reuse C symbols value if possible (skips costly nm extraction).
1120 -s : silent mode, only echoes questions and essential information.
1121 -D : define symbol to have some value:
1122 -D symbol symbol gets the value 'define'
1123 -D symbol=value symbol gets the value 'value'
1124 -E : stop at the end of questions, after having produced config.sh.
1125 -K : do not use unless you know what you are doing.
1126 -O : let -D and -U override definitions from loaded configuration file.
1127 -S : perform variable substitutions on all .SH files (can mix with -f)
1128 -U : undefine symbol:
1129 -U symbol symbol gets the value 'undef'
1130 -U symbol= symbol gets completely empty
1131 -V : print version number and exit (with a zero status).
1138 case "$fastread$alldone" in
1141 if test ! -t 0; then
1142 echo "Say 'sh Configure', not 'sh <Configure'"
1150 true) exec 1>/dev/null;;
1153 : run the defines and the undefines, if any, but leave the file out there...
1159 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1160 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1161 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1162 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1163 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1166 : Some greps do not return status, grrr.
1167 echo "grimblepritz" >grimble
1168 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1170 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1176 : the following should work in any shell
1180 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1181 cat >contains <<'EOSS'
1182 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1187 : Find the path to the source tree
1190 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
1201 if test -f $rsrc/Configure && \
1202 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1204 : found it, so we are ok.
1207 for src in . .. ../.. ../../.. ../../../..; do
1208 if test -f ../$src/Configure && \
1209 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1220 Sorry, I can't seem to locate the source dir for $package. Please start
1221 Configure with an explicit path -- i.e. /some/path/Configure.
1229 echo "Sources for $package found in \"$src\"." >&4
1233 : script used to extract .SH files with variable substitutions
1234 cat >extract <<'EOS'
1236 echo "Doing variable substitutions on .SH files..."
1237 if test -f $src/MANIFEST; then
1238 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1240 echo "(Looking for .SH files under the source directory.)"
1241 set x `(cd $src; find . -name "*.SH" -print)`
1245 0) set x `(cd $src; echo *.SH)`; shift;;
1247 if test ! -f $src/$1; then
1253 while test $name; do
1254 if test ! -d "$name"; then
1255 create="$name $create";
1256 name=`echo $name | sed -e "s|^[^/]*$||"`;
1257 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1262 for file in $create; do
1271 dir=`expr X$file : 'X\(.*\)/'`
1272 file=`expr X$file : 'X.*/\(.*\)'`
1273 (cd $dir && . ./$file)
1283 dir=`expr X$file : 'X\(.*\)/'`
1284 file=`expr X$file : 'X.*/\(.*\)'`
1285 (set x $dir; shift; eval $mkdir_p)
1295 if test -f $src/config_h.SH; then
1296 if test ! -f config.h; then
1297 : oops, they left it out of MANIFEST, probably, so do it anyway.
1303 : extract files and exit if asked to do so
1304 case "$extractsh" in
1306 case "$realsilent" in
1310 case "$config_sh" in
1311 '') config_sh='config.sh';;
1314 echo "Fetching answers from $config_sh..."
1317 test "$override" && . ./optdef.sh
1326 : Eunice requires " " instead of "", can you believe it
1329 echo "Beginning of configuration questions for $package."
1331 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1333 : first determine how to suppress newline on echo command
1335 echo "Checking echo to see how to suppress newlines..."
1336 (echo "hi there\c" ; echo " ") >.echotmp
1337 if $contains c .echotmp >/dev/null 2>&1 ; then
1348 echo $n "The star should be here-->$c"
1352 : Now test for existence of everything in MANIFEST
1354 if test -f $rsrc/MANIFEST; then
1355 echo "First let's make sure your kit is complete. Checking..." >&4
1356 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1359 for filelist in x??; do
1360 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1362 if test -s missing; then
1366 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1368 You have the option of continuing the configuration process, despite the
1369 distinct possibility that your kit is damaged, by typing 'y'es. If you
1370 do, don't blame me if something goes wrong. I advise you to type 'n'o
1371 and then contact perlbug@perl.com.
1374 echo $n "Continue? [n] $c" >&4
1378 echo "Continuing..." >&4
1382 echo "ABORTING..." >&4
1387 echo "Looks good..."
1390 echo "There is no MANIFEST file. I hope your kit is complete !"
1395 : Find the appropriate value for a newline for tr
1396 if test -n "$DJGPP"; then
1399 if test X"$trnl" = X; then
1400 case "`echo foo|tr '\n' x 2>/dev/null`" in
1404 if test X"$trnl" = X; then
1405 case "`echo foo|tr '\012' x 2>/dev/null`" in
1406 foox) trnl='\012' ;;
1409 if test X"$trnl" = X; then
1412 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1418 : compute the number of columns on the terminal for proper question formatting
1423 : set up the echo used in my read
1424 myecho="case \"\$xxxm\" in
1425 '') echo $n \"\$rp $c\" >&4;;
1427 '') echo $n \"[\$xxxm] $c\";;
1429 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1431 echo $n \"[\$xxxm] $c\" >&4
1433 echo $n \"\$rp [\$xxxm] $c\" >&4
1439 : now set up to do reads with possible shell escape and default assignment
1445 case "\$fastread" in
1446 yes) case "\$dflt" in
1449 case "\$silent-\$rp" in
1454 *) case "\$silent" in
1455 true) case "\$rp" in
1460 while expr "X\$ans" : "X!" >/dev/null; do
1464 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1472 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1481 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1486 echo "(OK, I'll run with -d after this question.)" >&4
1489 echo "*** Sorry, \$1 not supported yet." >&4
1499 echo "*** Substitution done -- please confirm."
1501 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1506 echo "*** Error -- try again."
1513 case "\$ans\$xxxm\$nostick" in
1525 : create .config dir to save info across Configure sessions
1526 test -d ../.config || mkdir ../.config
1527 cat >../.config/README <<EOF
1528 This directory created by Configure to save information that should
1529 persist across sessions for $package.
1531 You may safely delete it if you wish.
1534 : general instructions
1537 user=`(logname) 2>/dev/null`
1539 '') user=`whoami 2>&1`;;
1541 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1544 rp='Would you like to see the instructions?'
1555 This installation shell script will examine your system and ask you questions
1556 to determine how the perl5 package should be installed. If you get
1557 stuck on a question, you may use a ! shell escape to start a subshell or
1558 execute a command. Many of the questions will have default answers in square
1559 brackets; typing carriage return will give you the default.
1561 On some of the questions which ask for file or directory names you are allowed
1562 to use the ~name construct to specify the login directory belonging to "name",
1563 even if you don't have a shell which knows about that. Questions where this is
1564 allowed will be marked "(~name ok)".
1568 dflt='Type carriage return to continue'
1572 The prompter used in this script allows you to use shell variables and
1573 backticks in your answers. You may use $1, $2, etc... to refer to the words
1574 in the default answer, as if the default line was a set of arguments given to a
1575 script shell. This means you may also use $* to repeat the whole default line,
1576 so you do not have to re-type everything to add something to the default.
1578 Everytime there is a substitution, you will have to confirm. If there is an
1579 error (e.g. an unmatched backtick), the default answer will remain unchanged
1580 and you will be prompted again.
1582 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1583 the questions and use the computed defaults (or the previous answers if there
1584 was already a config.sh file). Type 'Configure -h' for a list of options.
1585 You may also start interactively and then answer '& -d' at any prompt to turn
1586 on the non-interactive behaviour for the remainder of the execution.
1592 Much effort has been expended to ensure that this shell script will run on any
1593 Unix system. If despite that it blows up on yours, your best bet is to edit
1594 Configure and run it again. If you can't run Configure for some reason,
1595 you'll have to generate a config.sh file by hand. Whatever problems you
1596 have, let perlbug@perl.com know how I blew it.
1598 This installation script affects things in two ways:
1600 1) it may do direct variable substitutions on some of the files included
1602 2) it builds a config.h file for inclusion in C programs. You may edit
1603 any of these files as the need arises after running this script.
1605 If you make a mistake on a question, there is no easy way to back up to it
1606 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1607 files. Configure will offer to let you do this before it runs the SH files.
1610 dflt='Type carriage return to continue'
1612 case "$firsttime" in
1613 true) echo $user >>../.config/instruct;;
1617 : find out where common programs are
1619 echo "Locating common programs..." >&4
1632 if test -d \$dir/\$thing; then
1638 for thisthing in \$dir/\$thing; do
1639 : just loop through to pick last item
1641 if test -f \$thisthing; then
1644 elif test -f \$dir/\$thing.exe; then
1645 if test -n "$DJGPP"; then
1646 echo \$dir/\$thing.exe
1648 : on Eunice apparently
1703 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1704 pth="$pth /lib /usr/lib"
1705 for file in $loclist; do
1709 if test -f "$xxx"; then
1712 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1713 xxx=`./loc $file $file $pth`
1716 '') xxx=`./loc $file $file $pth`;;
1717 *) xxx=`./loc $xxx $xxx $pth`;;
1723 echo $file is in $xxx.
1726 echo $file is in $xxx.
1729 echo "I don't know where '$file' is, and my life depends on it." >&4
1730 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1736 echo "Don't worry if any of the following aren't found..."
1738 for file in $trylist; do
1742 if test -f "$xxx"; then
1745 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1746 xxx=`./loc $file $file $pth`
1749 '') xxx=`./loc $file $file $pth`;;
1750 *) xxx=`./loc $xxx $xxx $pth`;;
1756 echo $file is in $xxx.
1759 echo $file is in $xxx.
1762 echo "I don't see $file out there, $say."
1769 echo "Substituting grep for egrep."
1775 echo "Substituting cp for ln."
1781 echo "Hopefully test is built into your sh."
1784 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1785 echo "Using the test built into your sh."
1793 echo "Hopefully echo is built into your sh."
1798 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1799 $echo $n "hi there$c" >foo1
1800 echo $n "hi there$c" >foo2
1801 if cmp foo1 foo2 >/dev/null 2>&1; then
1802 echo "They are compatible. In fact, they may be identical."
1809 They are not compatible! You are probably running ksh on a non-USG system.
1810 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1811 have echo built in and we may have to run some Bourne shell scripts. That
1812 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1815 $echo $n "The star should be here-->$c"
1822 : determine whether symbolic links are supported
1825 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1826 echo "Symbolic links are supported." >&4
1829 echo "Symbolic links are NOT supported." >&4
1834 : see whether [:lower:] and [:upper:] are supported character classes
1836 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1838 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1842 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
1843 # (0xc9 and 0xd1), therefore that is a nice testing point.
1844 if test "X$up" = X -o "X$low" = X; then
1845 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
1851 if test "X$up" = X -o "X$low" = X; then
1852 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
1858 if test "X$up" = X -o "X$low" = X; then
1859 case "`echo IJ | od -x 2>/dev/null`" in
1861 echo "Hey, this might be EBCDIC." >&4
1862 if test "X$up" = X -o "X$low" = X; then
1863 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
1864 ij) up='[A-IJ-RS-Z]'
1869 if test "X$up" = X -o "X$low" = X; then
1870 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
1880 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
1882 echo "Using $up and $low to convert case." >&4
1885 echo "I don't know how to translate letters from upper to lower case." >&4
1886 echo "Your tr is not acting any way I know of." >&4
1890 : set up the translation script tr, must be called with ./tr of course
1894 '[A-Z][a-z]') exec $tr '$up' '$low';;
1895 '[a-z][A-Z]') exec $tr '$low' '$up';;
1902 : Try to determine whether config.sh was made on this system
1903 case "$config_sh" in
1905 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1906 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
1907 # because the A-Z/a-z are not consecutive.
1908 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1909 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
1910 newmyuname="$myuname"
1912 case "$knowitall" in
1914 if test -f ../config.sh; then
1915 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1916 eval "`grep myuname= ../config.sh`"
1918 if test "X$myuname" = "X$newmyuname"; then
1926 : Get old answers from old config file if Configure was run on the
1927 : same system, otherwise use the hints.
1930 if test -f config.sh; then
1932 rp="I see a config.sh file. Shall I use it to set the defaults?"
1935 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1936 *) echo "Fetching default answers from your old config.sh file..." >&4
1944 : Older versions did not always set $sh. Catch re-use of such
1953 if test ! -f config.sh; then
1956 First time through, eh? I have some defaults handy for some systems
1957 that need some extra help getting the Configure answers right:
1960 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
1962 : Half the following guesses are probably wrong... If you have better
1963 : tests or hints, please send them to perlbug@perl.com
1964 : The metaconfig authors would also appreciate a copy...
1965 $test -f /irix && osname=irix
1966 $test -f /xenix && osname=sco_xenix
1967 $test -f /dynix && osname=dynix
1968 $test -f /dnix && osname=dnix
1969 $test -f /lynx.os && osname=lynxos
1970 $test -f /unicos && osname=unicos && osvers=`$uname -r`
1971 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
1972 $test -f /bin/mips && /bin/mips && osname=mips
1973 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1974 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1975 $test -d /usr/apollo/bin && osname=apollo
1976 $test -f /etc/saf/_sactab && osname=svr4
1977 $test -d /usr/include/minix && osname=minix
1978 if $test -d /MachTen -o -d /MachTen_Folder; then
1980 if $test -x /sbin/version; then
1981 osvers=`/sbin/version | $awk '{print $2}' |
1982 $sed -e 's/[A-Za-z]$//'`
1983 elif $test -x /usr/etc/version; then
1984 osvers=`/usr/etc/version | $awk '{print $2}' |
1985 $sed -e 's/[A-Za-z]$//'`
1990 $test -f /sys/posix.dll &&
1991 $test -f /usr/bin/what &&
1992 set X `/usr/bin/what /sys/posix.dll` &&
1993 $test "$3" = UWIN &&
1996 if $test -f $uname; then
2004 umips) osname=umips ;;
2007 [23]100) osname=mips ;;
2008 next*) osname=next ;;
2010 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2011 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2014 elif $test -f /etc/kconfig; then
2016 if test "$lns" = "ln -s"; then
2018 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2020 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2027 if test -n "$DJGPP"; then
2036 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2038 'not found') osvers="$4"."$3" ;;
2039 '<3240'|'<>3240') osvers=3.2.0 ;;
2040 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2041 '=3250'|'>3250') osvers=3.2.5 ;;
2045 *dc.osx) osname=dcosx
2051 domainos) osname=apollo
2057 dynixptx*) osname=dynixptx
2058 osvers=`echo "$4" | $sed 's/^v//'`
2060 freebsd) osname=freebsd
2062 genix) osname=genix ;;
2064 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2080 netbsd*) osname=netbsd
2083 news-os) osvers="$3"
2085 4*) osname=newsos4 ;;
2089 bsd386) osname=bsd386
2092 powerux | power_ux | powermax_os | powermaxos | \
2093 powerunix | power_unix) osname=powerux
2096 next*) osname=next ;;
2097 solaris) osname=solaris
2099 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2106 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2110 titanos) osname=titanos
2119 ultrix) osname=ultrix
2122 osf1|mls+) case "$5" in
2125 osvers=`echo "$3" | sed 's/^[xvt]//'`
2127 hp*) osname=hp_osf1 ;;
2128 mips) osname=mips_osf1 ;;
2137 $2) case "$osname" in
2141 : svr4.x or possibly later
2151 if test -f /stand/boot ; then
2152 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2153 if test -n "$INITPROG" -a -f "$INITPROG"; then
2154 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2155 if test -n "$isesix"; then
2163 *) if test -f /etc/systemid; then
2165 set `echo $3 | $sed 's/\./ /g'` $4
2166 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2168 elif $test -f $src/hints/sco_$1_$2.sh; then
2170 elif $test -f $src/hints/sco_$1.sh; then
2175 '') : Still unknown. Probably a generic Sys V.
2184 *) case "$osname" in
2185 '') : Still unknown. Probably a generic BSD.
2193 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2194 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2195 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2198 $rm -f UU/kernel.what
2199 elif test -d c:/.; then
2206 : Now look for a hint file osname_osvers, unless one has been
2207 : specified already.
2210 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2211 : Also try without trailing minor version numbers.
2212 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2213 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2214 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2215 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2218 *) case "$osvers" in
2221 *) if $test -f $src/hints/$file.sh ; then
2223 elif $test -f $src/hints/$xfile.sh ; then
2225 elif $test -f $src/hints/$xxfile.sh ; then
2227 elif $test -f $src/hints/$xxxfile.sh ; then
2229 elif $test -f $src/hints/$xxxxfile.sh ; then
2231 elif $test -f "$src/hints/${osname}.sh" ; then
2240 if $test -f Policy.sh ; then
2243 none) dflt="Policy" ;;
2244 *) dflt="Policy $dflt" ;;
2249 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2253 if $test -f Policy.sh ; then
2256 There's also a Policy hint file available, which should make the
2257 site-specific (policy) questions easier to answer.
2264 You may give one or more space-separated answers, or "none" if appropriate.
2265 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2266 is a good thing. DO NOT give a wrong version.
2270 rp="Which of these apply, if any?"
2273 for file in $tans; do
2274 if $test X$file = XPolicy -a -f Policy.sh; then
2276 $cat Policy.sh >> UU/config.sh
2277 elif $test -f $src/hints/$file.sh; then
2278 . $src/hints/$file.sh
2279 $cat $src/hints/$file.sh >> UU/config.sh
2280 elif $test X$tans = X -o X$tans = Xnone ; then
2283 : Give one chance to correct a possible typo.
2284 echo "$file.sh does not exist"
2286 rp="hint to use instead?"
2288 for file in $ans; do
2289 if $test -f "$src/hints/$file.sh"; then
2290 . $src/hints/$file.sh
2291 $cat $src/hints/$file.sh >> UU/config.sh
2292 elif $test X$ans = X -o X$ans = Xnone ; then
2295 echo "$file.sh does not exist -- ignored."
2302 : Remember our hint file for later.
2303 if $test -f "$src/hints/$file.sh" ; then
2313 echo "Fetching default answers from $config_sh..." >&4
2317 cp $config_sh config.sh 2>/dev/null
2327 test "$override" && . ./optdef.sh
2328 myuname="$newmyuname"
2330 : Restore computed paths
2331 for file in $loclist $trylist; do
2332 eval $file="\$_$file"
2337 Configure uses the operating system name and version to set some defaults.
2338 The default value is probably right if the name rings a bell. Otherwise,
2339 since spelling matters for me, either accept the default or answer "none"
2346 ''|' '|none) dflt=none ;;
2347 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2350 *) dflt="$osname" ;;
2352 rp="Operating system name?"
2356 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2362 ''|' '|none) dflt=none ;;
2363 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2364 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2366 ''|' ') dflt=none ;;
2371 *) dflt="$osvers" ;;
2373 rp="Operating system version?"
2380 : who configured the system
2381 cf_time=`LC_ALL=C; export LC_ALL; $date 2>&1`
2382 cf_by=`(logname) 2>/dev/null`
2385 cf_by=`(whoami) 2>/dev/null`
2387 "") cf_by=unknown ;;
2391 : set up the script used to warn in case of inconsistency
2398 echo "*** WHOA THERE!!! ***" >&4
2399 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2400 rp=" Keep the $hint value?"
2403 y) td=$was; tu=$was;;
2407 : function used to set $1 to $val
2408 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2410 $define$undef) . ./whoa; eval "$var=\$td";;
2411 $undef$define) . ./whoa; eval "$var=\$tu";;
2412 *) eval "$var=$val";;
2417 Perl can be built to take advantage of threads, on some systems.
2418 To do so, Configure must be run with -Dusethreads.
2420 Note that threading is a highly experimental feature, and
2421 some known race conditions still remain. If you choose to try
2422 it, be very sure to not actually deploy it for production
2423 purposes. README.threads has more details, and is required
2424 reading if you enable threads.
2426 case "$usethreads" in
2427 $define|true|[yY]*) dflt='y';;
2430 rp='Build a threading Perl?'
2433 y|Y) val="$define" ;;
2439 case "$d_oldpthreads" in
2440 '') : Configure tests would be welcome here. For now, assume undef.
2442 *) val="$d_oldpthreads" ;;
2448 case "$usethreads" in
2449 "$define"|true|[yY]*)
2450 : Look for a hint-file generated 'call-back-unit'. If the
2451 : user has specified that a threading perl is to be built,
2452 : we may need to set or change some other defaults.
2453 if $test -f usethreads.cbu; then
2457 aix|dec_osf|dos_djgpp|freebsd|hpux|irix|linux|next|openbsd|os2|solaris|vmesa)
2458 # Known thread-capable platforms.
2462 $osname is not known to support threads.
2463 Please let perlbug@perl.com know how to do that.
2465 Cannot continue, aborting.
2473 : determine the architecture name
2475 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
2476 tarch=`arch`"-$osname"
2477 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
2478 if uname -m > tmparch 2>&1 ; then
2479 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
2480 -e 's/$/'"-$osname/" tmparch`
2488 case "$myarchname" in
2491 echo "(Your architecture name used to be $myarchname.)"
2497 *) dflt="$archname";;
2499 rp='What is your architecture name'
2501 case "$usethreads" in
2502 $define) echo "Threads selected." >&4
2504 *-thread) echo "...and architecture name already ends in -thread." >&4
2507 *) archname="$ans-thread"
2508 echo "...setting architecture name to $archname." >&4
2512 *) archname="$ans" ;;
2518 $define|true) afs=true ;;
2519 $undef|false) afs=false ;;
2520 *) if test -d /afs; then
2528 echo "AFS may be running... I'll be extra cautious then..." >&4
2530 echo "AFS does not seem to be running..." >&4
2533 : decide how portable to be. Allow command line overrides.
2534 case "$d_portable" in
2536 *) d_portable="$define" ;;
2539 : set up shell script to do ~ expansion
2545 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2548 if $test -f /bin/csh; then
2549 /bin/csh -f -c "glob \$1"
2554 name=\`$expr x\$1 : '..\([^/]*\)'\`
2555 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2556 if $test ! -d "\$dir"; then
2558 echo "\$me: can't locate home directory for: \$name" >&2
2563 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2579 : now set up to get a file name
2583 cat <<'EOSC' >>getfile
2596 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
2597 fn=`echo $fn | sed 's/(.*)//'`
2603 loc_file=`expr $fn : '.*:\(.*\)'`
2604 fn=`expr $fn : '\(.*\):.*'`
2612 */*) fullpath=true;;
2621 *e*) exp_file=true;;
2624 *p*) nopath_ok=true;;
2629 *d*) type='Directory';;
2630 *l*) type='Locate';;
2635 Locate) what='File';;
2640 case "$d_portable" in
2648 while test "$type"; do
2653 true) rp="$rp (~name ok)";;
2656 if test -f UU/getfile.ok && \
2657 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2676 value=`UU/filexp $ans`
2679 if test "$ans" != "$value"; then
2680 echo "(That expands to $value on this system.)"
2694 /*) value="$ansexp" ;;
2699 echo "I shall only accept a full path name, as in /bin/ls." >&4
2700 echo "Use a ! shell escape if you wish to check pathnames." >&4
2703 echo "Please give a full path name, starting with slash." >&4
2706 echo "Note that using ~name is ok provided it expands well." >&4
2719 if test -f "$ansexp"; then
2721 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2723 echo "($value is not a plain file, but that's ok.)"
2728 if test -d "$ansexp"; then
2733 if test -d "$ansexp"; then
2734 echo "(Looking for $loc_file in directory $value.)"
2735 value="$value/$loc_file"
2736 ansexp="$ansexp/$loc_file"
2738 if test -f "$ansexp"; then
2741 case "$nopath_ok" in
2742 true) case "$value" in
2744 *) echo "Assuming $value will be in people's path."
2760 if test "$fastread" = yes; then
2765 rp="$what $value doesn't exist. Use that name anyway?"
2786 : determine root of directory hierarchy where package will be installed.
2789 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
2797 By default, $package will be installed in $dflt/bin, manual
2798 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2799 all installation directories. Typically set to /usr/local, but you
2800 may choose /usr if you wish to install $package among your system
2801 binaries. If you wish to have binaries under /bin but manual pages
2802 under /usr/local/man, that's ok: you will be prompted separately
2803 for each of the installation directories, the prefix being only used
2804 to set the defaults.
2808 rp='Installation prefix to use?'
2816 *) oldprefix="$prefix";;
2823 : set the prefixit variable, to compute a suitable default value
2824 prefixit='case "$3" in
2826 case "$oldprefix" in
2827 "") eval "$1=\"\$$2\"";;
2834 ""|" ") eval "$1=\"\$$2\"";;
2840 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
2842 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
2843 /*-$oldprefix/*|\~*-$oldprefix/*)
2844 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
2845 *) eval "$1=\"\$$2\"";;
2849 : set the base revision
2852 : get the patchlevel
2854 echo "Getting the current patchlevel..." >&4
2855 if $test -r $rsrc/patchlevel.h;then
2856 patchlevel=`awk '/define[ ]+PATCHLEVEL/ {print $3}' $rsrc/patchlevel.h`
2857 subversion=`awk '/define[ ]+SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
2862 $echo $n "(You have $package" $c
2865 *) $echo $n " $baserev" $c ;;
2867 $echo $n " patchlevel $patchlevel" $c
2868 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
2871 if test 0 -eq "$subversion"; then
2872 version=`LC_ALL=C; export LC_ALL; \
2873 echo $baserev $patchlevel | \
2874 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
2876 version=`LC_ALL=C; export LC_ALL; \
2877 echo $baserev $patchlevel $subversion | \
2878 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
2880 : Figure out perl API version. Perhaps this should be in patchlevel.h
2881 if test "$subversion" -lt 50; then
2882 apiversion=`LC_ALL=C; export LC_ALL; \
2883 echo $baserev $patchlevel | \
2884 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
2886 apiversion="$version"
2889 : determine where private library files go
2890 : Usual default is /usr/local/lib/perl5/$version.
2891 : Also allow things like /opt/perl/lib/$version, since
2892 : /opt/perl/lib/perl5... would be redundant.
2894 *perl*) set dflt privlib lib/$version ;;
2895 *) set dflt privlib lib/$package/$version ;;
2900 There are some auxiliary files for $package that need to be put into a
2901 private library directory that is accessible by everyone.
2905 rp='Pathname where the private library files will reside?'
2907 if $test "X$privlibexp" != "X$ansexp"; then
2911 privlibexp="$ansexp"
2915 Since you are running AFS, I need to distinguish the directory in which
2916 private files reside from the directory in which they are installed (and from
2917 which they are presumably copied to the former directory by occult means).
2920 case "$installprivlib" in
2921 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
2922 *) dflt="$installprivlib";;
2925 rp='Where will private files be installed?'
2927 installprivlib="$ans"
2929 installprivlib="$privlibexp"
2932 : set the prefixup variable, to restore leading tilda escape
2933 prefixup='case "$prefixexp" in
2935 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
2938 : determine where public architecture dependent libraries go
2941 : privlib default is /usr/local/lib/$package/$version
2942 : archlib default is /usr/local/lib/$package/$version/$archname
2943 : privlib may have an optional trailing /share.
2944 tdflt=`echo $privlib | $sed 's,/share$,,'`
2945 tdflt=$tdflt/$archname
2954 $spackage contains architecture-dependent library files. If you are
2955 sharing libraries in a heterogeneous environment, you might store
2956 these files in a separate location. Otherwise, you can just include
2957 them with the rest of the public library files.
2961 rp='Where do you want to put the public architecture-dependent libraries?'
2964 archlibexp="$ansexp"
2969 Since you are running AFS, I need to distinguish the directory in
2970 which architecture-dependent library files reside from the directory
2971 in which they are installed (and from which they are presumably copied
2972 to the former directory by occult means).
2975 case "$installarchlib" in
2976 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
2977 *) dflt="$installarchlib";;
2980 rp='Where will architecture-dependent library files be installed?'
2982 installarchlib="$ans"
2984 installarchlib="$archlibexp"
2986 if $test X"$archlib" = X"$privlib"; then
2992 : make some quick guesses about what we are up against
2994 $echo $n "Hmm... $c"
3004 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3005 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3007 echo "Looks kind of like an OSF/1 system, but we'll see..."
3009 elif test `echo abc | tr a-z A-Z` = Abc ; then
3010 xxx=`./loc addbib blurfl $pth`
3011 if $test -f $xxx; then
3012 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3016 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3017 echo "Looks kind of like an extended USG system, but we'll see..."
3019 echo "Looks kind of like a USG system, but we'll see..."
3023 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3024 echo "Looks kind of like a BSD system, but we'll see..."
3028 echo "Looks kind of like a Version 7 system, but we'll see..."
3031 case "$eunicefix" in
3034 There is, however, a strange, musty smell in the air that reminds me of
3035 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3039 : it so happens the Eunice I know will not run shell scripts in Unix format
3043 echo "Congratulations. You aren't running Eunice."
3047 : Detect OS2. The p_ variable is set above in the Head.U unit.
3052 I have the feeling something is not exactly right, however...don't tell me...
3053 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3058 if test -f /xenix; then
3059 echo "Actually, this looks more like a XENIX system..."
3064 echo "It's not Xenix..."
3069 if test -f /venix; then
3070 echo "Actually, this looks more like a VENIX system..."
3077 echo "Nor is it Venix..."
3080 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3081 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3084 : see if setuid scripts can be secure
3087 Some kernels have a bug that prevents setuid #! scripts from being
3088 secure. Some sites have disabled setuid #! scripts because of this.
3090 First let's decide if your kernel supports secure setuid #! scripts.
3091 (If setuid #! scripts would be secure but have been disabled anyway,
3092 don't say that they are secure if asked.)
3097 if $test -d /dev/fd; then
3098 echo "#!$ls" >reflect
3099 chmod +x,u+s reflect
3100 ./reflect >flect 2>&1
3101 if $contains "/dev/fd" flect >/dev/null; then
3102 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3106 If you are not sure if they are secure, I can check but I'll need a
3107 username and password different from the one you are using right now.
3108 If you don't have such a username or don't want me to test, simply
3112 rp='Other username to test security of setuid scripts with?'
3117 case "$d_suidsafe" in
3118 '') echo "I'll assume setuid scripts are *not* secure." >&4
3121 echo "Well, the $hint value is *not* secure." >&4
3123 *) echo "Well, the $hint value *is* secure." >&4
3128 $rm -f reflect flect
3129 echo "#!$ls" >reflect
3130 chmod +x,u+s reflect
3133 echo '"su" will (probably) prompt you for '"$ans's password."
3134 su $ans -c './reflect >flect'
3135 if $contains "/dev/fd" flect >/dev/null; then
3136 echo "Okay, it looks like setuid scripts are secure." >&4
3139 echo "I don't think setuid scripts are secure." >&4
3144 rp='Does your kernel have *secure* setuid scripts?'
3147 [yY]*) val="$define";;
3152 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3153 echo "(That's for file descriptors, not floppy disks.)"
3159 $rm -f reflect flect
3161 : now see if they want to do setuid emulation
3164 case "$d_suidsafe" in
3167 echo "No need to emulate SUID scripts since they are secure here." >& 4
3171 Some systems have disabled setuid scripts, especially systems where
3172 setuid scripts cannot be secure. On systems where setuid scripts have
3173 been disabled, the setuid/setgid bits on scripts are currently
3174 useless. It is possible for $package to detect those bits and emulate
3175 setuid/setgid in a secure fashion. This emulation will only work if
3176 setuid scripts have been disabled in your kernel.
3180 "$define") dflt=y ;;
3183 rp="Do you want to do setuid/setgid emulation?"
3186 [yY]*) val="$define";;
3194 : determine where manual pages are on this system
3198 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
3199 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
3200 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
3201 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
3202 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
3203 sysman=`./loc . /usr/man/man1 $syspath`
3206 if $test -d "$sysman"; then
3207 echo "System manual is in $sysman." >&4
3209 echo "Could not find manual pages in source form." >&4
3212 : see what memory models we can support
3215 $cat >pdp11.c <<'EOP'
3224 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
3225 if $test -f pdp11 && ./pdp11 2>/dev/null; then
3226 dflt='unsplit split'
3228 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3231 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3236 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3239 if $test -d /lib/large || $test -d /usr/lib/large; then
3242 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3251 Some systems have different model sizes. On most systems they are called
3252 small, medium, large, and huge. On the PDP11 they are called unsplit and
3253 split. If your system doesn't support different memory models, say "none".
3254 If you wish to force everything to one memory model, say "none" here and
3255 put the appropriate flags later when it asks you for other cc and ld flags.
3256 Venix systems may wish to put "none" and let the compiler figure things out.
3257 (In the following question multiple model names should be space separated.)
3259 The default for most systems is "none".
3262 rp="Which memory models are supported?"
3277 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3278 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3285 rp="What flag indicates separate I and D space?"
3293 *large*|*small*|*medium*|*huge*)
3300 rp="What flag indicates large model?"
3310 *huge*) case "$huge" in
3314 rp="What flag indicates huge model?"
3324 *medium*) case "$medium" in
3328 rp="What flag indicates medium model?"
3335 *) medium="$large";;
3338 *small*) case "$small" in
3342 rp="What flag indicates small model?"
3353 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3356 $rm -f pdp11.* pdp11
3358 : see if we need a special compiler
3366 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3367 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3381 On some older systems the default C compiler will not resolve multiple global
3382 references that happen to have the same name. On some such systems the "Mcc"
3383 command may be used to force these to be resolved. On other systems a "cc -M"
3384 command is required. (Note that the -M flag on other systems indicates a
3385 memory model to use!) If you have the Gnu C compiler, you might wish to use
3391 rp="Use which C compiler?"
3399 rp="Use which C compiler?"
3403 : Look for a hint-file generated 'call-back-unit'. Now that the
3404 : user has specified the compiler, we may need to set or change some
3406 if $test -f cc.cbu; then
3410 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3411 $cat >gccvers.c <<EOM
3416 printf("%s\n", __VERSION__);
3418 printf("%s\n", "1");
3424 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3425 gccversion=`./gccvers`
3426 case "$gccversion" in
3427 '') echo "You are not using GNU cc." ;;
3428 *) echo "You are using GNU cc $gccversion." ;;
3432 echo "*** WHOA THERE!!! ***" >&4
3433 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3434 case "$knowitall" in
3436 echo " You'd better start hunting for one and let me know about it." >&4
3442 case "$gccversion" in
3443 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3446 : What should the include directory be ?
3448 $echo $n "Hmm... $c"
3452 if $test -f /bin/mips && /bin/mips; then
3453 echo "Looks like a MIPS system..."
3454 $cat >usr.c <<'EOCP'
3455 #ifdef SYSTYPE_BSD43
3459 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3460 dflt='/bsd43/usr/include'
3464 mips_type='System V'
3466 $rm -f usr.c usr.out
3467 echo "and you're compiling with the $mips_type compiler and libraries."
3471 echo "Doesn't look like a MIPS system."
3481 case "$xxx_prompt" in
3484 rp='Where are the include files you want to use?'
3492 : see how we invoke the C preprocessor
3494 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3495 cat <<'EOT' >testcpp.c
3501 if test ! -f cppstdin; then
3502 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3504 echo "Keeping your $hint cppstdin wrapper."
3507 wrapper=`pwd`/cppstdin
3511 if $test "X$cppstdin" != "X" && \
3512 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3513 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3515 echo "You used to use $cppstdin $cppminus so we'll use that again."
3517 '') echo "But let's see if we can live without a wrapper..." ;;
3519 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3520 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3522 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3525 echo "(However, $cpprun $cpplast does not work, let's see...)"
3533 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3540 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3541 $cc -E <testcpp.c >testcpp.out 2>&1; \
3542 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3543 echo "Yup, it does."
3546 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3547 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3548 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3549 echo "Yup, it does."
3552 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3553 $cc -P <testcpp.c >testcpp.out 2>&1; \
3554 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3555 echo "Yipee, that works!"
3558 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3559 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3560 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3561 echo "At long last!"
3564 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3565 $cpp <testcpp.c >testcpp.out 2>&1; \
3566 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3570 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3571 $cpp - <testcpp.c >testcpp.out 2>&1; \
3572 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3573 echo "Hooray, it works! I was beginning to wonder."
3576 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3577 $wrapper <testcpp.c >testcpp.out 2>&1; \
3578 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3584 rp="No dice. I can't find a C preprocessor. Name one:"
3588 $x_cpp <testcpp.c >testcpp.out 2>&1
3589 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3590 echo "OK, that will do." >&4
3592 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3607 echo "Perhaps can we force $cc -E using a wrapper..."
3608 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3609 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3615 echo "Nope, we'll have to live without it..."
3629 "$wrapper"|'cppstdin') ;;
3630 *) $rm -f $wrapper;;
3632 $rm -f testcpp.c testcpp.out
3634 : Set private lib path
3637 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3642 '') dlist="$loclibpth $plibpth $glibpth";;
3643 *) dlist="$libpth";;
3646 : Now check and see which directories actually exist, avoiding duplicates
3650 if $test -d $xxx; then
3653 *) libpth="$libpth $xxx";;
3659 Some systems have incompatible or broken versions of libraries. Among
3660 the directories listed in the question below, please remove any you
3661 know not to be holding relevant libraries, and add any that are needed.
3662 Say "none" for none.
3673 rp="Directories to use for library searches?"
3680 : compute shared library extension
3683 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3693 On some systems, shared libraries may be available. Answer 'none' if
3694 you want to suppress searching of shared libraries for the remaining
3695 of this configuration.
3698 rp='What is the file extension used for shared libraries?'
3702 : Define several unixisms.
3703 : Hints files or command line option can be used to override them.
3704 : The convoluted testing is in case hints files set either the old
3707 '') case "$exe_ext" in
3709 *) _exe="$exe_ext" ;;
3714 '') case "$lib_ext" in
3721 '') case "$obj_ext" in
3728 '') case "$path_sep" in
3739 : Which makefile gets called first. This is used by make depend.
3740 case "$firstmakefile" in
3741 '') firstmakefile='makefile';;
3744 : Looking for optional libraries
3746 echo "Checking for optional libraries..." >&4
3751 case "$libswanted" in
3752 '') libswanted='c_s';;
3754 for thislib in $libswanted; do
3756 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3757 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3758 echo "Found -l$thislib (shared)."
3761 *) dflt="$dflt -l$thislib";;
3763 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3764 echo "Found -l$thislib (shared)."
3767 *) dflt="$dflt -l$thislib";;
3769 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3770 echo "Found -l$thislib."
3773 *) dflt="$dflt -l$thislib";;
3775 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3776 echo "Found -l$thislib."
3779 *) dflt="$dflt -l$thislib";;
3781 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3782 echo "Found -l${thislib}_s."
3785 *) dflt="$dflt -l${thislib}_s";;
3787 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3788 echo "Found -l$thislib."
3791 *) dflt="$dflt -l$thislib";;
3794 echo "No -l$thislib."
3805 ' '|'') dflt='none';;
3810 Some versions of Unix support shared libraries, which make executables smaller
3811 but make load time slightly longer.
3813 On some systems, mostly System V Release 3's, the shared library is included
3814 by putting the option "-lc_s" as the last thing on the cc command line when
3815 linking. Other systems use shared libraries by default. There may be other
3816 libraries needed to compile $package on your machine as well. If your system
3817 needs the "-lc_s" option, include it here. Include any other special libraries
3818 here as well. Say "none" for none.
3822 rp="Any additional libraries?"
3829 : determine optimize, if desired, or use for debug flag also
3831 ' '|$undef) dflt='none';;
3833 *) dflt="$optimize";;
3837 Some C compilers have problems with their optimizers. By default, $package
3838 compiles with the -O flag to use the optimizer. Alternately, you might want
3839 to use the symbolic debugger, which uses the -g flag (on traditional Unix
3840 systems). Either flag can be specified here. To use neither flag, specify
3844 rp="What optimizer/debugger flag should be used?"
3848 'none') optimize=" ";;
3852 : We will not override a previous value, but we might want to
3853 : augment a hint file
3856 case "$gccversion" in
3857 1*) dflt='-fpcc-struct-return' ;;
3860 *-g*) dflt="$dflt -DDEBUGGING";;
3862 case "$gccversion" in
3863 2*) if test -d /etc/conf/kconfig.d &&
3864 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3873 case "$mips_type" in
3874 *BSD*|'') inclwanted="$locincpth $usrinc";;
3875 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3877 for thisincl in $inclwanted; do
3878 if $test -d $thisincl; then
3879 if $test x$thisincl != x$usrinc; then
3882 *) dflt="$dflt -I$thisincl";;
3888 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3890 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3898 *) dflt="$dflt -D$2";;
3902 set signal.h LANGUAGE_C; eval $inctest
3905 none|recommended) dflt="$ccflags $dflt" ;;
3906 *) dflt="$ccflags";;
3914 Your C compiler may want other flags. For this question you should include
3915 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3916 but you should NOT include libraries or ld flags like -lwhatever. If you
3917 want $package to honor its debug switch, you should include -DDEBUGGING here.
3918 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3920 To use no flags, specify the word "none".
3926 rp="Any additional cc flags?"
3933 : the following weeds options from ccflags that are of no interest to cpp
3935 case "$gccversion" in
3936 1*) cppflags="$cppflags -D__GNUC__"
3938 case "$mips_type" in
3940 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3946 echo "Let me guess what the preprocessor flags are..." >&4
3960 *) ftry="$previous $flag";;
3962 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3963 >cpp1.out 2>/dev/null && \
3964 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3965 >cpp2.out 2>/dev/null && \
3966 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3967 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3969 cppflags="$cppflags $ftry"
3979 *-*) echo "They appear to be: $cppflags";;
3981 $rm -f cpp.c cpp?.out
3985 : flags used in final linking phase
3987 '') if ./venix; then
3993 *-posix*) dflt="$dflt -posix" ;;
3996 *) dflt="$ldflags";;
3999 : Try to guess additional flags to pick up local libraries.
4000 for thislibdir in $libpth; do
4001 case " $loclibpth " in
4004 *"-L$thislibdir "*) ;;
4005 *) dflt="$dflt -L$thislibdir" ;;
4017 Your C linker may need flags. For this question you should
4018 include -L/whatever and any other flags used by the C linker, but you
4019 should NOT include libraries like -lwhatever.
4021 Make sure you include the appropriate -L/path flags if your C linker
4022 does not normally search all of the directories you specified above,
4025 To use no flags, specify the word "none".
4029 rp="Any additional ld flags (NOT including libraries)?"
4035 rmlist="$rmlist pdp11"
4039 echo "Checking your choice of C compiler and flags for coherency..." >&4
4040 $cat > try.c <<'EOF'
4042 int main() { printf("Ok\n"); exit(0); }
4044 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4046 $cat >try.msg <<'EOM'
4047 I've tried to compile and run the following simple program:
4050 $cat try.c >> try.msg
4052 $cat >> try.msg <<EOM
4059 and I got the following output:
4063 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4064 if sh -c './try' >>try.msg 2>&1; then
4068 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4071 cat >> try.msg <<'EOQS'
4072 If $libs contains -lsfio, and sfio is mis-configured, then it
4073 sometimes (apparently) runs and exits with a 0 status, but with no
4074 output! It may have to do with sfio's use of _exit vs. exit.
4077 rp="You have a big problem. Shall I abort Configure"
4084 echo "The program compiled OK, but exited with status $?." >>try.msg
4085 rp="You have a problem. Shall I abort Configure"
4089 echo "I can't compile the test program." >>try.msg
4090 rp="You have a BIG problem. Shall I abort Configure"
4096 case "$knowitall" in
4098 echo "(The supplied flags or libraries might be incorrect.)"
4106 *) echo "Ok. Stopping Configure." >&4
4111 n) echo "OK, that should do.";;
4113 $rm -f try try.* core
4115 : determine filename position in cpp output
4117 echo "Computing filename position in cpp output for #include directives..." >&4
4118 echo '#include <stdio.h>' > foo.c
4121 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4122 $grep '^[ ]*#.*stdio\.h' | \
4123 while read cline; do
4126 while $test \$# -gt 0; do
4127 if $test -r \`echo \$1 | $tr -d '"'\`; then
4132 pos=\`expr \$pos + 1\`
4144 *) pos="${fieldn}th";;
4146 echo "Your cpp writes the filename in the $pos field of the line."
4148 : locate header file
4153 if test -f $usrinc/\$wanted; then
4154 echo "$usrinc/\$wanted"
4157 awkprg='{ print \$$fieldn }'
4158 echo "#include <\$wanted>" > foo\$\$.c
4159 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4160 $grep "^[ ]*#.*\$wanted" | \
4161 while read cline; do
4162 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4164 */\$wanted) echo "\$name"; exit 0;;
4175 : define an alternate in-header-list? function
4176 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4177 cont=true; xxf="echo \"<\$1> found.\" >&4";
4178 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4179 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4181 case $# in 4) instead=instead;; *) instead="at last";; esac;
4182 while $test "$cont"; do
4184 var=$2; eval "was=\$$2";
4185 if $test "$xxx" && $test -r "$xxx";
4187 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4190 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4191 set $yyy; shift; shift; yyy=$@;
4192 case $# in 0) cont="";;
4193 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4194 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4195 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4196 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4200 do set $yyy; var=$2; eval "was=\$$2";
4201 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4202 set $yyy; shift; shift; yyy=$@;
4205 : see if this is a malloc.h system
4206 set malloc.h i_malloc
4209 : see if stdlib is available
4210 set stdlib.h i_stdlib
4213 : determine which malloc to compile in
4215 case "$usemymalloc" in
4216 ''|[yY]*|true|$define) dflt='y' ;;
4219 rp="Do you wish to attempt to use the malloc that comes with $package?"
4225 mallocsrc='malloc.c'
4226 mallocobj="malloc$_o"
4227 d_mymalloc="$define"
4230 : Remove malloc from list of libraries to use
4231 echo "Removing unneeded -lmalloc from library list" >&4
4232 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4235 echo "libs = $libs" >&4
4247 : compute the return types of malloc and free
4249 $cat >malloc.c <<END
4253 #include <sys/types.h>
4267 case "$malloctype" in
4269 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4276 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4280 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4287 echo "Your system uses $freetype free(), it would seem." >&4
4289 : Cruising for prototypes
4291 echo "Checking out function prototypes..." >&4
4292 $cat >prototype.c <<'EOCP'
4293 int main(int argc, char *argv[]) {
4296 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4297 echo "Your C compiler appears to support function prototypes."
4300 echo "Your C compiler doesn't seem to understand function prototypes."
4307 case "$prototype" in
4309 *) ansi2knr='ansi2knr'
4314 This version of $package can only be compiled by a compiler that
4315 understands function prototypes. Unfortunately, your C compiler
4317 doesn't seem to understand them. Sorry about that.
4319 If GNU cc is available for your system, perhaps you could try that instead.
4321 Eventually, we hope to support building Perl with pre-ANSI compilers.
4322 If you would like to help in that effort, please contact <perlbug@perl.org>.
4324 Aborting Configure now.
4330 : determine where public executables go
4335 rp='Pathname where the public executables will reside?'
4337 if $test "X$ansexp" != "X$binexp"; then
4345 Since you are running AFS, I need to distinguish the directory in which
4346 executables reside from the directory in which they are installed (and from
4347 which they are presumably copied to the former directory by occult means).
4350 case "$installbin" in
4351 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
4352 *) dflt="$installbin";;
4355 rp='Where will public executables be installed?'
4359 installbin="$binexp"
4363 if test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4365 Many scripts expect to perl to be installed as /usr/bin/perl.
4366 I can install the perl you are about to compile also as /usr/bin/perl
4367 (in addition to $installbin/perl).
4369 case "$installusrbinperl" in
4370 "$undef"|[nN]*) dflt='n';;
4373 rp="Do you want to install perl as /usr/bin/perl?"
4376 [yY]*) val="$define";;
4382 set installusrbinperl
4385 : define a shorthand compile call
4389 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4390 : define a shorthand compile call for compilations that should be ok.
4394 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4397 echo "Checking for GNU C Library..." >&4
4398 cat >gnulibc.c <<EOM
4410 if eval $compile_ok && ./gnulibc; then
4412 echo "You are using the GNU C Library"
4415 echo "You are not using the GNU C Library"
4421 : see if nm is to be used to determine whether a symbol is defined or not
4425 case "$d_gnulibc" in
4428 echo "nm probably won't work on the GNU C Library." >&4
4434 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4436 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4437 echo "'nm' won't be sufficient on this sytem." >&4
4443 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4444 if $test $dflt -gt 20; then
4454 true|$define) dflt=y;;
4461 I can use $nm to extract the symbols from your C libraries. This
4462 is a time consuming task which may generate huge output on the disk (up
4463 to 3 megabytes) but that should make the symbols extraction faster. The
4464 alternative is to skip the 'nm' extraction part and to compile a small
4465 test program instead to determine whether each symbol is present. If
4466 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4467 this may be the best solution.
4469 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4472 rp="Shall I use $nm to extract C symbols from the libraries?"
4475 [Nn]*) usenm=false;;
4484 : nm options which may be necessary
4486 '') if $test -f /mach_boot; then
4488 elif $test -d /usr/ccs/lib; then
4489 nm_opt='-p' # Solaris (and SunOS?)
4490 elif $test -f /dgux; then
4492 elif $test -f /lib64/rld; then
4493 nm_opt='-p' # 64-bit Irix
4499 : nm options which may be necessary for shared libraries but illegal
4500 : for archive libraries. Thank you, Linux.
4501 case "$nm_so_opt" in
4502 '') case "$myuname" in
4504 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4505 nm_so_opt='--dynamic'
4514 : get list of predefined functions in a handy place
4519 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4526 *) for thislib in $libs; do
4529 : Handle C library specially below.
4532 thislib=`echo $thislib | $sed -e 's/^-l//'`
4533 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4535 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4537 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4539 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4541 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4543 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4545 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4550 libnames="$libnames $try"
4552 *) libnames="$libnames $thislib" ;;
4561 for xxx in $libpth; do
4562 $test -r $1 || set $xxx/libc.$so
4563 : The messy sed command sorts on library version numbers.
4565 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4566 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4568 s/[0-9][0-9]*/0000&/g
4569 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4572 sort | $sed -e 's/^.* //'`
4575 $test -r $1 || set /usr/ccs/lib/libc.$so
4576 $test -r $1 || set /lib/libsys_s$_a
4582 if $test -r "$1"; then
4583 echo "Your (shared) C library seems to be in $1."
4585 elif $test -r /lib/libc && $test -r /lib/clib; then
4586 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4588 libc='/lib/clib /lib/libc'
4589 if $test -r /lib/syslib; then
4590 echo "(Your math library is in /lib/syslib.)"
4591 libc="$libc /lib/syslib"
4593 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4594 echo "Your C library seems to be in $libc, as you said before."
4595 elif $test -r $incpath/usr/lib/libc$_a; then
4596 libc=$incpath/usr/lib/libc$_a;
4597 echo "Your C library seems to be in $libc. That's fine."
4598 elif $test -r /lib/libc$_a; then
4600 echo "Your C library seems to be in $libc. You're normal."
4602 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4604 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4605 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4606 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4608 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4610 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4613 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4615 if $test -r "$tans"; then
4616 echo "Your C library seems to be in $tans, of all places."
4622 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4626 If the guess above is wrong (which it might be if you're using a strange
4627 compiler, or your machine supports multiple models), you can override it here.
4632 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
4634 I can't seem to find your C library. I've looked in the following places:
4637 $sed 's/^/ /' libpath
4640 None of these seems to contain your C library. I need to get its name...
4645 rp='Where is your C library?'
4650 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
4651 set X `cat libnames`
4654 case $# in 1) xxx=file; esac
4655 echo "Extracting names from the following $xxx for later perusal:" >&4
4657 $sed 's/^/ /' libnames >&4
4659 $echo $n "This may take a while...$c" >&4
4663 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4664 *) $nm $nm_opt $file 2>/dev/null;;
4669 $grep fprintf libc.tmp > libc.ptf
4670 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4671 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4673 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4677 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4679 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4681 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4683 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4685 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4687 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4689 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4691 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4693 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4695 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4697 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4698 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4700 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4702 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4704 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4706 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4708 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4710 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4712 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4714 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4716 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4718 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4720 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4722 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4724 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4726 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
4728 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4731 $nm -p $* 2>/dev/null >libc.tmp
4732 $grep fprintf libc.tmp > libc.ptf
4733 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4734 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4740 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4742 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4743 for thisname in $libnames $libc; do
4744 $ar t $thisname >>libc.tmp
4746 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4748 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4749 # Repeat libc to extract forwarders to DLL entries too
4750 for thisname in $libnames $libc; do
4751 $ar tv $thisname >>libc.tmp
4752 # Revision 50 of EMX has bug in $ar.
4753 # it will not extract forwarders to DLL entries
4754 # Use emximp which will extract exactly them.
4755 emximp -o tmp.imp $thisname \
4757 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
4758 < tmp.imp >>libc.tmp
4761 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
4764 echo "$ar didn't seem to work right." >&4
4765 echo "Maybe this is a Cray...trying bld instead..." >&4
4766 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
4768 for thisname in $libnames; do
4770 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
4771 $ar t $thisname >>libc.tmp
4775 echo "That didn't work either. Giving up." >&4
4782 if $test -f /lib/syscalls.exp; then
4784 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4785 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
4789 $rm -f libnames libpath
4791 : see if dld is available
4795 : is a C symbol defined?
4798 -v) tf=libc.tmp; tc=""; tdc="";;
4799 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4800 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4803 case "$reuseval-$4" in
4805 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4811 if $contains $tlook $tf >/dev/null 2>&1;
4816 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4817 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
4825 $define) tval=true;;
4831 : define an is-in-libc? function
4832 inlibc='echo " "; td=$define; tu=$undef;
4833 sym=$1; var=$2; eval "was=\$$2";
4835 case "$reuseval$was" in
4845 echo "$sym() found." >&4;
4846 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
4848 echo "$sym() NOT found." >&4;
4849 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
4853 $define) echo "$sym() found." >&4;;
4854 *) echo "$sym() NOT found." >&4;;
4858 : see if dlopen exists
4865 : determine which dynamic loading, if any, to compile in
4867 dldir="ext/DynaLoader"
4880 $define) dflt='y' ;;
4883 $define) dflt='y' ;;
4885 : Does a dl_xxx.xs file exist for this operating system
4886 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
4889 rp="Do you wish to use dynamic loading?"
4896 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
4897 dflt="$dldir/dl_${osname}.xs"
4898 elif $test "$d_dlopen" = "$define" ; then
4899 dflt="$dldir/dl_dlopen.xs"
4900 elif $test "$i_dld" = "$define" ; then
4901 dflt="$dldir/dl_dld.xs"
4906 *) dflt="$dldir/$dlsrc"
4909 echo "The following dynamic loading files are available:"
4910 : Can not go over to $dldir because getfile has path hard-coded in.
4911 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
4912 rp="Source file to use for dynamic loading"
4914 # XXX This getfile call will fail the existence check if you try
4915 # building away from $src (this is not supported yet).
4919 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
4923 Some systems may require passing special flags to $cc -c to
4924 compile modules that will be used to create a shared library.
4925 To use no flags, say "none".
4928 case "$cccdlflags" in
4929 '') case "$gccversion" in
4930 '') case "$osname" in
4932 next) dflt='none' ;;
4933 irix*) dflt='-KPIC' ;;
4934 svr4*|esix*|solaris) dflt='-KPIC' ;;
4935 sunos) dflt='-pic' ;;
4939 *) case "$osname" in
4940 svr4*|esix*|solaris) dflt='-fPIC' ;;
4945 *) dflt="$cccdlflags" ;;
4947 rp="Any special flags to pass to $cc -c to compile shared library modules?"
4950 none) cccdlflags=' ' ;;
4951 *) cccdlflags="$ans" ;;
4956 Some systems use ld to create libraries that can be dynamically loaded,
4957 while other systems (such as those using ELF) use $cc.
4961 '') $cat >try.c <<'EOM'
4962 /* Test for whether ELF binaries are produced */
4967 int i = open("a.out",O_RDONLY);
4970 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
4971 exit(0); /* succeed (yes, it's ELF) */
4976 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
4978 You appear to have ELF support. I'll use $cc to build dynamic libraries.
4982 echo "I'll use ld to build dynamic libraries."
4991 rp="What command should be used to create dynamic libraries?"
4997 Some systems may require passing special flags to $ld to create a
4998 library that can be dynamically loaded. If your ld flags include
4999 -L/other/path options to locate libraries outside your loader's normal
5000 search path, you may need to specify those -L options here as well. To
5001 use no flags, say "none".
5004 case "$lddlflags" in
5005 '') case "$osname" in
5007 linux|irix*) dflt='-shared' ;;
5008 next) dflt='none' ;;
5009 solaris) dflt='-G' ;;
5010 beos) dflt='-nostart' ;;
5011 sunos) dflt='-assert nodefinitions' ;;
5012 svr4*|esix*) dflt="-G $ldflags" ;;
5016 *) dflt="$lddlflags" ;;
5019 : Try to guess additional flags to pick up local libraries.
5020 : Be careful not to append to a plain 'none'
5024 for thisflag in $ldflags; do
5029 *) dflt="$dflt $thisflag" ;;
5036 ''|' ') dflt='none' ;;
5039 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5042 none) lddlflags=' ' ;;
5043 *) lddlflags="$ans" ;;
5048 Some systems may require passing special flags to $cc to indicate that
5049 the resulting executable will use dynamic linking. To use no flags,
5053 case "$ccdlflags" in
5054 '') case "$osname" in
5055 hpux) dflt='-Wl,-E' ;;
5056 linux) dflt='-rdynamic' ;;
5057 next) dflt='none' ;;
5058 sunos) dflt='none' ;;
5062 *) dflt="$ccdlflags" ;;
5064 rp="Any special flags to pass to $cc to use dynamic loading?"
5067 none) ccdlflags=' ' ;;
5068 *) ccdlflags="$ans" ;;
5082 # No dynamic loading being used, so don't bother even to prompt.
5085 *) case "$useshrplib" in
5086 '') case "$osname" in
5087 svr4*|dgux|dynixptx|esix|powerux|beos)
5089 also='Building a shared libperl is required for dynamic loading to work on your system.'
5094 also='Building a shared libperl is needed for MAB support.'
5112 The perl executable is normally obtained by linking perlmain.c with
5113 libperl${_a}, any static extensions (usually just DynaLoader), and
5114 any other libraries needed on this system (such as -lm, etc.). Since
5115 your system supports dynamic loading, it is probably possible to build
5116 a shared libperl.$so. If you will have more than one executable linked
5117 to libperl.$so, this will significantly reduce the size of each
5118 executable, but it may have a noticeable affect on performance. The
5119 default is probably sensible for your system.
5123 rp="Build a shared libperl.$so (y/n)"
5128 # Why does next4 have to be so different?
5129 case "${osname}${osvers}" in
5130 next4*) xxx='DYLD_LIBRARY_PATH' ;;
5131 os2*) xxx='' ;; # Nothing special needed.
5133 *) xxx='LD_LIBRARY_PATH' ;;
5135 if test X"$xxx" != "X"; then
5136 $cat <<EOM | $tee -a ../config.msg >&4
5138 To build perl, you must add the current working directory to your
5139 $xxx environment variable before running make. You can do
5141 $xxx=\`pwd\`; export $xxx
5142 for Bourne-style shells, or
5144 for Csh-style shells. You *MUST* do this before running make.
5149 *) useshrplib='false' ;;
5154 case "$useshrplib" in
5158 # Figure out a good name for libperl.so. Since it gets stored in
5159 # a version-specific architecture-dependent library, the version
5160 # number isn't really that important, except for making cc/ld happy.
5162 # A name such as libperl.so.3.1
5163 majmin="libperl.$so.$patchlevel.$subversion"
5164 # A name such as libperl.so.301
5165 majonly=`echo $patchlevel $subversion |
5166 $awk '{printf "%d%02d", $1, $2}'`
5167 majonly=libperl.$so.$majonly
5168 # I'd prefer to keep the os-specific stuff here to a minimum, and
5169 # rely on figuring it out from the naming of libc.
5170 case "${osname}${osvers}" in
5173 # XXX How handle the --version stuff for MAB?
5175 linux*) # ld won't link with a bare -lperl otherwise.
5178 *) # Try to guess based on whether libc has major.minor.
5180 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5181 *libc.$so.[0-9]*) dflt=$majonly ;;
5182 *) dflt=libperl.$so ;;
5192 I need to select a good name for the shared libperl. If your system uses
5193 library names with major and minor numbers, then you might want something
5194 like $majmin. Alternatively, if your system uses a single version
5195 number for shared libraries, then you might want to use $majonly.
5196 Or, your system might be quite happy with a simple libperl.$so.
5198 Since the shared libperl will get installed into a version-specific
5199 architecture-dependent directory, the version number of the shared perl
5200 library probably isn't important, so the default should be o.k.
5203 rp='What name do you want to give to the shared libperl?'
5206 echo "Ok, I'll use $libperl"
5209 libperl="libperl${_a}"
5213 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5217 WARNING: Use of the shrpdir variable for the installation location of
5218 the shared $libperl is not supported. It was never documented and
5219 will not work in this version. Let perlbug@perl.com
5220 know of any problems this may cause.
5226 But your current setting of $shrpdir is
5227 the default anyway, so it's harmless.
5232 Further, your current attempted setting of $shrpdir
5233 conflicts with the value of $archlibexp/CORE
5234 that installperl will use.
5241 # How will the perl executable find the installed shared $libperl?
5242 # Add $xxx to ccdlflags.
5243 # If we can't figure out a command-line option, use $shrpenv to
5244 # set env LD_RUN_PATH. The main perl makefile uses this.
5245 shrpdir=$archlibexp/CORE
5248 if "$useshrplib"; then
5251 # We'll set it in Makefile.SH...
5257 xxx="-Wl,-R$shrpdir"
5259 linux|irix*|dec_osf)
5260 xxx="-Wl,-rpath,$shrpdir"
5263 # next doesn't like the default...
5266 # beos doesn't like the default, either.
5269 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5275 # Only add $xxx if it isn't already in ccdlflags.
5276 case " $ccdlflags " in
5278 *) ccdlflags="$ccdlflags $xxx"
5281 Adding $xxx to the flags
5282 passed to $ld so that the perl executable will find the
5283 installed shared $libperl.
5291 # Respect a hint or command-line value.
5293 '') shrpenv="$tmp_shrpenv" ;;
5296 : determine where manual pages go
5297 set man1dir man1dir none
5301 $spackage has manual pages available in source form.
5305 echo "However, you don't have nroff, so they're probably useless to you."
5307 '') man1dir="none";;
5310 echo "If you don't want the manual sources installed, answer 'none'."
5315 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5316 lookpath="$lookpath $prefixexp/man/p_man/man1"
5317 lookpath="$lookpath $prefixexp/man/u_man/man1"
5318 lookpath="$lookpath $prefixexp/man/man.1"
5320 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5321 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5331 rp="Where do the main $spackage manual pages (source) go?"
5333 if $test "X$man1direxp" != "X$ansexp"; then
5337 man1direxp="$ansexp"
5345 Since you are running AFS, I need to distinguish the directory in which
5346 manual pages reside from the directory in which they are installed (and from
5347 which they are presumably copied to the former directory by occult means).
5350 case "$installman1dir" in
5351 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
5352 *) dflt="$installman1dir";;
5355 rp='Where will man pages be installed?'
5357 installman1dir="$ans"
5359 installman1dir="$man1direxp"
5362 : What suffix to use on installed man pages
5369 rp="What suffix should be used for the main $spackage man pages?"
5371 '') case "$man1dir" in
5385 *) dflt="$man1ext";;
5392 : see if we can have long filenames
5394 rmlist="$rmlist /tmp/cf$$"
5395 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5396 first=123456789abcdef
5397 second=/tmp/cf$$/$first
5398 $rm -f $first $second
5399 if (echo hi >$first) 2>/dev/null; then
5400 if $test -f 123456789abcde; then
5401 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5404 if (echo hi >$second) 2>/dev/null; then
5405 if $test -f /tmp/cf$$/123456789abcde; then
5407 That's peculiar... You can have filenames longer than 14 characters, but only
5408 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5409 I shall consider your system cannot support long filenames at all.
5413 echo 'You can have filenames longer than 14 characters.' >&4
5418 How confusing! Some of your filesystems are sane enough to allow filenames
5419 longer than 14 characters but some others like /tmp can't even think about them.
5420 So, for now on, I shall assume your kernel does not allow them at all.
5427 You can't have filenames longer than 14 chars. You can't even think about them!
5433 $rm -rf /tmp/cf$$ 123456789abcde*
5435 : determine where library module manual pages go
5436 set man3dir man3dir none
5440 $spackage has manual pages for many of the library modules.
5446 However, you don't have nroff, so they're probably useless to you.
5449 '') man3dir="none";;
5453 case "$d_flexfnam" in
5456 However, your system can't handle the long file names like File::Basename.3.
5459 '') man3dir="none";;
5463 echo "If you don't want the manual sources installed, answer 'none'."
5464 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5466 '') case "$prefix" in
5467 *$prog*) dflt=`echo $man1dir |
5468 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
5469 *) dflt="$privlib/man/man3" ;;
5473 *) dflt="$man3dir" ;;
5478 rp="Where do the $package library man pages (source) go?"
5480 if test "X$man3direxp" != "X$ansexp"; then
5485 man3direxp="$ansexp"
5493 Since you are running AFS, I need to distinguish the directory in which
5494 manual pages reside from the directory in which they are installed (and from
5495 which they are presumably copied to the former directory by occult means).
5498 case "$installman3dir" in
5499 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
5500 *) dflt="$installman3dir";;
5503 rp='Where will man pages be installed?'
5505 installman3dir="$ans"
5507 installman3dir="$man3direxp"
5510 : What suffix to use on installed man pages
5517 rp="What suffix should be used for the $package library man pages?"
5519 '') case "$man3dir" in
5533 *) dflt="$man3ext";;
5540 : see if we have to deal with yellow pages, now NIS.
5541 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5542 if $test -f /usr/etc/nibindd; then
5544 echo "I'm fairly confident you're on a NeXT."
5546 rp='Do you get the hosts file via NetInfo?'
5555 y*) hostcat='nidump hosts .';;
5556 *) case "$hostcat" in
5557 nidump*) hostcat='';;
5567 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5575 rp='Are you getting the hosts file via yellow pages?'
5578 y*) hostcat='ypcat hosts';;
5579 *) hostcat='cat /etc/hosts';;
5585 '') hostcat='cat /etc/hosts';;
5588 '') groupcat='cat /etc/group';;
5591 '') passcat='cat /etc/passwd';;
5594 : now get the host name
5596 echo "Figuring out host name..." >&4
5597 case "$myhostname" in
5599 echo 'Maybe "hostname" will work...'
5600 if tans=`sh -c hostname 2>&1` ; then
5608 if $test "$cont"; then
5610 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5611 if tans=`cat /etc/systemid 2>&1` ; then
5613 phostname='cat /etc/systemid'
5614 echo "Whadyaknow. Xenix always was a bit strange..."
5617 elif $test -r /etc/systemid; then
5618 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5621 if $test "$cont"; then
5622 echo 'No, maybe "uuname -l" will work...'
5623 if tans=`sh -c 'uuname -l' 2>&1` ; then
5625 phostname='uuname -l'
5627 echo 'Strange. Maybe "uname -n" will work...'
5628 if tans=`sh -c 'uname -n' 2>&1` ; then
5630 phostname='uname -n'
5632 echo 'Oh well, maybe I can mine it out of whoami.h...'
5633 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
5634 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
5635 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
5637 case "$myhostname" in
5638 '') echo "Does this machine have an identity crisis or something?"
5641 echo "Well, you said $myhostname before..."
5642 phostname='echo $myhostname';;
5648 : you do not want to know about this
5653 if $test "$myhostname" ; then
5655 rp='Your host name appears to be "'$myhostname'".'" Right?"
5663 : bad guess or no guess
5664 while $test "X$myhostname" = X ; do
5666 rp="Please type the (one word) name of your host:"
5671 : translate upper to lower if necessary
5672 case "$myhostname" in
5674 echo "(Normalizing case in your host name)"
5675 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
5679 case "$myhostname" in
5681 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
5682 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
5683 echo "(Trimming domain name from host name--host name is now $myhostname)"
5685 *) case "$mydomain" in
5688 test "X$hostcat" = "Xypcat hosts" &&
5689 ypmatch "$myhostname" hosts 2>/dev/null |\
5690 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
5693 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
5694 /[ ]$myhostname[ . ]/p" > hosts
5697 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
5698 END { print sum }" hosts` = x1 || tmp_re="[ ]"
5699 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
5700 hosts | $sort | $uniq | \
5701 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
5702 case `$echo X$dflt` in
5703 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
5706 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
5711 tans=`./loc resolv.conf X /etc /usr/etc`
5712 if $test -f "$tans"; then
5713 echo "(Attempting domain name extraction from $tans)"
5714 dflt=.`$sed -n -e 's/ / /g' \
5715 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
5716 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5718 .) dflt=.`$sed -n -e 's/ / /g' \
5719 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
5720 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5727 .) echo "(No help from resolv.conf either -- attempting clever guess)"
5728 dflt=.`sh -c domainname 2>/dev/null`
5731 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
5736 .) echo "(Lost all hope -- silly guess then)"
5742 *) dflt="$mydomain";;
5746 rp="What is your domain name?"
5756 : translate upper to lower if necessary
5759 echo "(Normalizing case in your domain name)"
5760 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
5764 : a little sanity check here
5765 case "$phostname" in
5768 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
5769 $myhostname$mydomain|$myhostname) ;;
5771 case "$phostname" in
5773 echo "(That doesn't agree with your whoami.h file, by the way.)"
5776 echo "(That doesn't agree with your $phostname command, by the way.)"
5786 I need to get your e-mail address in Internet format if possible, i.e.
5787 something like user@host.domain. Please answer accurately since I have
5788 no easy means to double check it. The default value provided below
5789 is most probably close to the reality but may not be valid from outside
5790 your organization...
5794 while test "$cont"; do
5796 '') dflt="$cf_by@$myhostname$mydomain";;
5797 *) dflt="$cf_email";;
5799 rp='What is your e-mail address?'
5805 rp='Address does not look like an Internet one. Use it anyway?'
5821 If you or somebody else will be maintaining perl at your site, please
5822 fill in the correct e-mail address here so that they may be contacted
5823 if necessary. Currently, the "perlbug" program included with perl
5824 will send mail to this address in addition to perlbug@perl.com. You may
5825 enter "none" for no administrator.
5828 case "$perladmin" in
5829 '') dflt="$cf_email";;
5830 *) dflt="$perladmin";;
5832 rp='Perl administrator e-mail address'
5836 : figure out how to guarantee perl startup
5837 case "$startperl" in
5839 case "$sharpbang" in
5843 I can use the #! construct to start perl on your system. This will
5844 make startup of perl scripts faster, but may cause problems if you
5845 want to share those scripts and perl is not in a standard place
5846 ($binexp/perl) on all your platforms. The alternative is to force
5847 a shell by starting the script with a single ':' character.
5851 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
5854 none) startperl=": # use perl";;
5855 *) startperl="#!$ans"
5856 if $test 30 -lt `echo "$ans" | wc -c`; then
5859 WARNING: Some systems limit the #! command to 32 characters.
5860 If you experience difficulty running Perl scripts with #!, try
5861 installing Perl in a directory with a shorter pathname.
5867 *) startperl=": # use perl"
5872 echo "I'll use $startperl to start perl scripts."
5874 : figure best path for perl in scripts
5877 perlpath="$binexp/perl"
5878 case "$startperl" in
5883 I will use the "eval 'exec'" idiom to start Perl on your system.
5884 I can use the full path of your Perl binary for this purpose, but
5885 doing so may cause problems if you want to share those scripts and
5886 Perl is not always in a standard place ($binexp/perl).
5890 rp="What path shall I use in \"eval 'exec'\"?"
5897 case "$startperl" in
5899 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
5902 : determine where public executable scripts go
5903 set scriptdir scriptdir
5905 case "$scriptdir" in
5908 : guess some guesses
5909 $test -d /usr/share/scripts && dflt=/usr/share/scripts
5910 $test -d /usr/share/bin && dflt=/usr/share/bin
5911 $test -d /usr/local/script && dflt=/usr/local/script
5912 $test -d $prefixexp/script && dflt=$prefixexp/script
5916 *) dflt="$scriptdir"
5921 Some installations have a separate directory just for executable scripts so
5922 that they can mount it across multiple architectures but keep the scripts in
5923 one spot. You might, for example, have a subdirectory of /usr/share for this.
5924 Or you might just lump your scripts in with all your other executables.
5928 rp='Where do you keep publicly executable scripts?'
5930 if $test "X$ansexp" != "X$scriptdirexp"; then
5934 scriptdirexp="$ansexp"
5938 Since you are running AFS, I need to distinguish the directory in which
5939 scripts reside from the directory in which they are installed (and from
5940 which they are presumably copied to the former directory by occult means).
5943 case "$installscript" in
5944 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
5945 *) dflt="$installscript";;
5948 rp='Where will public scripts be installed?'
5950 installscript="$ans"
5952 installscript="$scriptdirexp"
5955 : determine where site specific libraries go.
5956 : Usual default is /usr/local/lib/perl5/site_perl/$apiversion
5957 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5959 *perl*) set dflt sitelib lib/site_$prog/$apiversion ;;
5960 *) set dflt sitelib lib/$package/site_$prog/$apiversion ;;
5965 The installation process will also create a directory for
5966 site-specific extensions and modules. Some users find it convenient
5967 to place all local files in this directory rather than in the main
5968 distribution directory.
5972 rp='Pathname for the site-specific library files?'
5974 if $test "X$sitelibexp" != "X$ansexp"; then
5978 sitelibexp="$ansexp"
5982 Since you are running AFS, I need to distinguish the directory in
5983 which site-specific files reside from the directory in which they are
5984 installed (and from which they are presumably copied to the former
5985 directory by occult means).
5988 case "$installsitelib" in
5989 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
5990 *) dflt="$installsitelib";;
5993 rp='Where will site-specific files be installed?'
5995 installsitelib="$ans"
5997 installsitelib="$sitelibexp"
6000 : determine where site specific architecture-dependent libraries go.
6001 : sitelib default is /usr/local/lib/perl5/site_perl/$apiversion
6002 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6003 : sitelib may have an optional trailing /share.
6004 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6005 tdflt="$tdflt/$archname"
6006 set sitearch sitearch none
6009 '') dflt="$tdflt" ;;
6010 *) dflt="$sitearch" ;;
6014 The installation process will also create a directory for
6015 architecture-dependent site-specific extensions and modules.
6019 rp='Pathname for the site-specific architecture-dependent library files?'
6021 if $test "X$sitearchexp" != "X$ansexp"; then
6025 sitearchexp="$ansexp"
6029 Since you are running AFS, I need to distinguish the directory in
6030 which site-specific architecture-dependent library files reside from
6031 the directory in which they are installed (and from which they are
6032 presumably copied to the former directory by occult means).
6035 case "$installsitearch" in
6036 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
6037 *) dflt="$installsitearch";;
6040 rp='Where will site-specific architecture-dependent files be installed?'
6042 installsitearch="$ans"
6044 installsitearch="$sitearchexp"
6049 Previous version of $package used the standard IO mechanisms as defined
6050 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6051 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6052 the default. This abstraction layer can use AT&T's sfio (if you already
6053 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6054 problems with some extension modules. Using PerlIO with stdio is safe,
6055 but it is slower than plain stdio and therefore is not the default.
6057 If this doesn't make any sense to you, just accept the default 'n'.
6059 case "$useperlio" in
6060 $define|true|[yY]*) dflt='y';;
6063 rp='Use the experimental PerlIO abstraction layer?'
6070 echo "Ok, doing things the stdio way"
6077 : Check how to convert floats to strings.
6078 if test "X$d_Gconvert" = X; then
6080 echo "Checking for an efficient way to convert floats to strings."
6083 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6084 char *myname = "gconvert";
6087 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6088 char *myname = "gcvt";
6091 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6092 char *myname = "sprintf";
6098 checkit(expect, got)
6102 if (strcmp(expect, got)) {
6103 printf("%s oddity: Expected %s, got %s\n",
6104 myname, expect, got);
6114 /* This must be 1st test on (which?) platform */
6115 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6116 Gconvert(0.1, 8, 0, buf);
6117 checkit("0.1", buf);
6119 Gconvert(1.0, 8, 0, buf);
6122 Gconvert(0.0, 8, 0, buf);
6125 Gconvert(-1.0, 8, 0, buf);
6128 /* Some Linux gcvt's give 1.e+5 here. */
6129 Gconvert(100000.0, 8, 0, buf);
6130 checkit("100000", buf);
6132 /* Some Linux gcvt's give -1.e+5 here. */
6133 Gconvert(-100000.0, 8, 0, buf);
6134 checkit("-100000", buf);
6139 case "$d_Gconvert" in
6140 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6141 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6142 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6143 *) xxx_list='gconvert gcvt sprintf' ;;
6146 for xxx_convert in $xxx_list; do
6147 echo "Trying $xxx_convert"
6149 set try -DTRY_$xxx_convert
6150 if eval $compile; then
6151 echo "$xxx_convert" found. >&4
6153 echo "I'll use $xxx_convert to convert floats into a string." >&4
6156 echo "...But $xxx_convert didn't work as I expected."
6159 echo "$xxx_convert NOT found." >&4
6163 case "$xxx_convert" in
6164 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6165 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6166 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6170 : Initialize h_fcntl
6173 : Initialize h_sysfile
6176 : access call always available on UNIX
6180 : locate the flags for 'access()'
6184 $cat >access.c <<'EOCP'
6185 #include <sys/types.h>
6190 #include <sys/file.h>
6199 : check sys/file.h first, no particular reason here
6200 if $test `./findhdr sys/file.h` && \
6201 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
6203 echo "<sys/file.h> defines the *_OK access constants." >&4
6204 elif $test `./findhdr fcntl.h` && \
6205 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
6207 echo "<fcntl.h> defines the *_OK access constants." >&4
6208 elif $test `./findhdr unistd.h` && \
6209 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
6210 echo "<unistd.h> defines the *_OK access constants." >&4
6212 echo "I can't find the four *_OK access constants--I'll use mine." >&4
6218 : see if alarm exists
6222 : Look for GNU-cc style attribute checking
6224 echo "Checking whether your compiler can handle __attribute__ ..." >&4
6225 $cat >attrib.c <<'EOCP'
6227 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
6229 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
6230 if $contains 'warning' attrib.out >/dev/null 2>&1; then
6231 echo "Your C compiler doesn't fully support __attribute__."
6234 echo "Your C compiler supports __attribute__."
6238 echo "Your C compiler doesn't seem to understand __attribute__ at all."
6245 : see if bcmp exists
6249 : see if bcopy exists
6253 : see if this is a unistd.h system
6254 set unistd.h i_unistd
6257 : see if getpgrp exists
6258 set getpgrp d_getpgrp
6261 case "$d_getpgrp" in
6264 echo "Checking to see which flavor of getpgrp is in use..."
6267 #include <sys/types.h>
6269 # include <unistd.h>
6273 if (getuid() == 0) {
6274 printf("(I see you are running Configure as super-user...)\n");
6278 if (getpgrp(1) == 0)
6287 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6288 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
6290 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6291 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
6294 echo "I can't seem to compile and run the test program."
6296 xxx="a USG one, i.e. you use getpgrp()."
6298 # SVR4 systems can appear rather BSD-ish.
6301 xxx="a BSD one, i.e. you use getpgrp(pid)."
6305 xxx="probably a USG one, i.e. you use getpgrp()."
6310 echo "Assuming your getpgrp is $xxx" >&4
6319 : see if setpgrp exists
6320 set setpgrp d_setpgrp
6323 case "$d_setpgrp" in
6326 echo "Checking to see which flavor of setpgrp is in use..."
6329 #include <sys/types.h>
6331 # include <unistd.h>
6335 if (getuid() == 0) {
6336 printf("(I see you are running Configure as super-user...)\n");
6340 if (-1 == setpgrp(1, 1))
6343 if (setpgrp() != -1)
6349 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6350 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
6352 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6353 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
6356 echo "(I can't seem to compile and run the test program.)"
6358 xxx="a USG one, i.e. you use setpgrp()."
6360 # SVR4 systems can appear rather BSD-ish.
6363 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
6367 xxx="probably a USG one, i.e. you use setpgrp()."
6372 echo "Assuming your setpgrp is $xxx" >&4
6380 : see if bzero exists
6384 : check for lengths of integral types
6388 echo "Checking to see how big your integers are..." >&4
6389 $cat >intsize.c <<'EOCP'
6393 printf("intsize=%d;\n", sizeof(int));
6394 printf("longsize=%d;\n", sizeof(long));
6395 printf("shortsize=%d;\n", sizeof(short));
6400 if eval $compile_ok && ./intsize > /dev/null; then
6402 echo "Your integers are $intsize bytes long."
6403 echo "Your long integers are $longsize bytes long."
6404 echo "Your short integers are $shortsize bytes long."
6408 Help! I can't compile and run the intsize test program: please enlighten me!
6409 (This is probably a misconfiguration in your system or libraries, and
6410 you really ought to fix it. Still, I'll try anyway.)
6414 rp="What is the size of an integer (in bytes)?"
6418 rp="What is the size of a long integer (in bytes)?"
6422 rp="What is the size of a short integer (in bytes)?"
6428 $rm -f intsize intsize.*
6430 : see if signal is declared as pointer to function returning int or void
6432 xxx=`./findhdr signal.h`
6433 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
6434 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6435 echo "You have int (*signal())() instead of void." >&4
6437 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6438 echo "You have void (*signal())()." >&4
6440 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
6441 echo "You have int (*signal())() instead of void." >&4
6443 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
6444 echo "You have void (*signal())()." >&4
6447 case "$d_voidsig" in
6449 echo "I can't determine whether signal handler returns void or int..." >&4
6451 rp="What type does your signal handler return?"
6458 echo "As you already told me, signal handler returns void." >&4
6461 *) echo "As you already told me, signal handler returns int." >&4
6468 case "$d_voidsig" in
6469 "$define") signal_t="void";;
6474 : check for ability to cast large floats to 32-bit ints.
6476 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
6477 if $test "$intsize" -ge 4; then
6484 #include <sys/types.h>
6486 $signal_t blech(s) int s; { exit(3); }
6493 signal(SIGFPE, blech);
6495 /* Don't let compiler optimize the test away. Store the number
6496 in a writable string for gcc to pass to sscanf under HP/UX.
6498 sprintf(str, "2147483647");
6499 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
6503 /* x86 processors will probably give 0x8000 0000, which is a
6504 sign change. We don't want that. We want to mimic SPARC
6505 behavior here, which is to preserve the sign and give
6508 if (i32 != ($xxx) f)
6514 if eval $compile_ok; then
6518 echo "(I can't seem to compile the test program--assuming it can't)"
6526 echo "Nope, it can't."
6533 : check for ability to cast negative floats to unsigned
6535 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
6538 #include <sys/types.h>
6540 $signal_t blech(s) int s; { exit(7); }
6541 $signal_t blech_in_list(s) int s; { exit(4); }
6542 unsigned long dummy_long(p) unsigned long p; { return p; }
6543 unsigned int dummy_int(p) unsigned int p; { return p; }
6544 unsigned short dummy_short(p) unsigned short p; { return p; }
6548 unsigned long along;
6550 unsigned short ashort;
6554 /* Frustrate gcc-2.7.2's optimizer which failed this test with
6555 a direct f = -123. assignment. gcc-2.8.0 reportedly
6556 optimized the whole file away
6558 /* Store the number in a writable string for gcc to pass to
6561 sprintf(str, "-123");
6562 sscanf(str, "%lf", &f); /* f = -123.; */
6564 signal(SIGFPE, blech);
6565 along = (unsigned long)f;
6566 aint = (unsigned int)f;
6567 ashort = (unsigned short)f;
6568 if (along != (unsigned long)-123)
6570 if (aint != (unsigned int)-123)
6572 if (ashort != (unsigned short)-123)
6574 sprintf(str, "1073741824.");
6575 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
6578 along = (unsigned long)f;
6579 if (along != 0x80000000)
6583 along = (unsigned long)f;
6584 if (along != 0x7fffffff)
6588 along = (unsigned long)f;
6589 if (along != 0x80000001)
6593 signal(SIGFPE, blech_in_list);
6594 sprintf(str, "123.");
6595 sscanf(str, "%lf", &f); /* f = 123.; */
6596 along = dummy_long((unsigned long)f);
6597 aint = dummy_int((unsigned int)f);
6598 ashort = dummy_short((unsigned short)f);
6599 if (along != (unsigned long)123)
6601 if (aint != (unsigned int)123)
6603 if (ashort != (unsigned short)123)
6610 if eval $compile_ok; then
6614 echo "(I can't seem to compile the test program--assuming it can't)"
6617 case "$castflags" in
6622 echo "Nope, it can't."
6629 : see if vprintf exists
6631 if set vprintf val -f d_vprintf; eval $csym; $val; then
6632 echo 'vprintf() found.' >&4
6634 $cat >vprintf.c <<'EOF'
6635 #include <varargs.h>
6637 int main() { xxx("foo"); }
6646 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
6650 if eval $compile && ./vprintf; then
6651 echo "Your vsprintf() returns (int)." >&4
6654 echo "Your vsprintf() returns (char*)." >&4
6658 echo 'vprintf() NOT found.' >&4
6668 : see if chown exists
6672 : see if chroot exists
6676 : see if chsize exists
6680 : check for const keyword
6682 echo 'Checking to see if your C compiler knows about "const"...' >&4
6683 $cat >const.c <<'EOCP'
6684 typedef struct spug { int drokk; } spug;
6691 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
6693 echo "Yup, it does."
6696 echo "Nope, it doesn't."
6701 : see if crypt exists
6703 if set crypt val -f d_crypt; eval $csym; $val; then
6704 echo 'crypt() found.' >&4
6708 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
6709 if $test -z "$cryptlib"; then
6710 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
6714 if $test -z "$cryptlib"; then
6715 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
6719 if $test -z "$cryptlib"; then
6720 cryptlib=`./loc libcrypt$_a "" $libpth`
6724 if $test -z "$cryptlib"; then
6725 echo 'crypt() NOT found.' >&4
6734 : see if cuserid exists
6735 set cuserid d_cuserid
6738 : see if this is a limits.h system
6739 set limits.h i_limits
6742 : see if this is a float.h system
6746 : See if number of significant digits in a double precision number is known
6748 $cat >dbl_dig.c <<EOM
6758 printf("Contains DBL_DIG");
6761 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
6762 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
6763 echo "DBL_DIG found." >&4
6766 echo "DBL_DIG NOT found." >&4
6773 : see if difftime exists
6774 set difftime d_difftime
6777 : see if sys/stat.h is available
6778 set sys/stat.h i_sysstat
6781 : see if this is a dirent system
6783 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
6785 echo "<dirent.h> found." >&4
6788 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
6789 echo "<sys/dir.h> found." >&4
6792 xinc=`./findhdr sys/ndir.h`
6794 echo "<dirent.h> NOT found." >&4
6799 : Look for type of directory structure.
6801 $cppstdin $cppflags $cppminus < "$xinc" > try.c
6803 case "$direntrytype" in
6806 $define) guess1='struct dirent' ;;
6807 *) guess1='struct direct' ;;
6810 *) guess1="$direntrytype"
6815 'struct dirent') guess2='struct direct' ;;
6816 *) guess2='struct dirent' ;;
6819 if $contains "$guess1" try.c >/dev/null 2>&1; then
6820 direntrytype="$guess1"
6821 echo "Your directory entries are $direntrytype." >&4
6822 elif $contains "$guess2" try.c >/dev/null 2>&1; then
6823 direntrytype="$guess2"
6824 echo "Your directory entries seem to be $direntrytype." >&4
6826 echo "I don't recognize your system's directory entries." >&4
6827 rp="What type is used for directory entries on this system?"
6835 : see if the directory entry stores field length
6837 $cppstdin $cppflags $cppminus < "$xinc" > try.c
6838 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
6839 echo "Good, your directory entry keeps length information in d_namlen." >&4
6842 echo "Your directory entry does not know about the d_namlen field." >&4
6849 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
6850 while $test $# -ge 2; do
6852 $define) echo "#include <$2>";;
6856 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
6857 if eval $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6866 : see if dlerror exists
6869 set dlerror d_dlerror
6873 : see if dlfcn is available
6881 On a few systems, the dynamically loaded modules that perl generates and uses
6882 will need a different extension than shared libs. The default will probably
6890 rp='What is the extension of dynamically loaded modules'
6899 : Check if dlsym need a leading underscore
6905 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
6906 $cat >dyna.c <<'EOM'
6915 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
6917 #include <sys/types.h>
6931 int mode = RTLD_LAZY ;
6933 handle = dlopen("./dyna.$dlext", mode) ;
6934 if (handle == NULL) {
6939 symbol = dlsym(handle, "fred") ;
6940 if (symbol == NULL) {
6941 /* try putting a leading underscore */
6942 symbol = dlsym(handle, "_fred") ;
6943 if (symbol == NULL) {
6956 : Call the object file tmp-dyna.o in case dlext=o.
6957 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
6958 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
6959 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
6960 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
6963 1) echo "Test program failed using dlopen." >&4
6964 echo "Perhaps you should not use dynamic loading." >&4;;
6965 2) echo "Test program failed using dlsym." >&4
6966 echo "Perhaps you should not use dynamic loading." >&4;;
6967 3) echo "dlsym needs a leading underscore" >&4
6969 4) echo "dlsym doesn't need a leading underscore." >&4;;
6972 echo "I can't compile and run the test program." >&4
6977 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
6982 : see if dup2 exists
6986 : see if endhostent exists
6987 set endhostent d_endhent
6990 : see if endnetent exists
6991 set endnetent d_endnent
6994 : see if endprotoent exists
6995 set endprotoent d_endpent
6998 : see if endservent exists
6999 set endservent d_endsent
7002 : Locate the flags for 'open()'
7004 $cat >open3.c <<'EOCP'
7005 #include <sys/types.h>
7010 #include <sys/file.h>
7021 : check sys/file.h first to get FREAD on Sun
7022 if $test `./findhdr sys/file.h` && \
7023 set open3 -DI_SYS_FILE && eval $compile; then
7025 echo "<sys/file.h> defines the O_* constants..." >&4
7027 echo "and you have the 3 argument form of open()." >&4
7030 echo "but not the 3 argument form of open(). Oh, well." >&4
7033 elif $test `./findhdr fcntl.h` && \
7034 set open3 -DI_FCNTL && eval $compile; then
7036 echo "<fcntl.h> defines the O_* constants..." >&4
7038 echo "and you have the 3 argument form of open()." >&4
7041 echo "but not the 3 argument form of open(). Oh, well." >&4
7046 echo "I can't find the O_* constant definitions! You got problems." >&4
7052 : check for non-blocking I/O stuff
7053 case "$h_sysfile" in
7054 true) echo "#include <sys/file.h>" > head.c;;
7057 true) echo "#include <fcntl.h>" > head.c;;
7058 *) echo "#include <sys/fcntl.h>" > head.c;;
7063 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
7064 case "$o_nonblock" in
7067 $cat >>try.c <<'EOCP'
7070 printf("O_NONBLOCK\n");
7074 printf("O_NDELAY\n");
7078 printf("FNDELAY\n");
7085 if eval $compile_ok; then
7087 case "$o_nonblock" in
7088 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
7089 *) echo "Seems like we can use $o_nonblock.";;
7092 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
7095 *) echo "Using $hint value $o_nonblock.";;
7097 $rm -f try try.* .out core
7100 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
7106 #include <sys/types.h>
7108 #define MY_O_NONBLOCK $o_nonblock
7109 #ifndef errno /* XXX need better Configure test */
7112 $signal_t blech(x) int x; { exit(3); }
7114 $cat >> try.c <<'EOCP'
7122 pipe(pd); /* Down: child -> parent */
7123 pipe(pu); /* Up: parent -> child */
7126 close(pd[1]); /* Parent reads from pd[0] */
7127 close(pu[0]); /* Parent writes (blocking) to pu[1] */
7128 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
7130 signal(SIGALRM, blech);
7132 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
7134 sprintf(string, "%d\n", ret);
7135 write(2, string, strlen(string));
7138 if (errno == EAGAIN) {
7144 if (errno == EWOULDBLOCK)
7145 printf("EWOULDBLOCK\n");
7148 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
7149 sleep(2); /* Give it time to close our pipe */
7151 ret = read(pd[0], buf, 1); /* Should read EOF */
7153 sprintf(string, "%d\n", ret);
7154 write(3, string, strlen(string));
7158 close(pd[0]); /* We write to pd[1] */
7159 close(pu[1]); /* We read from pu[0] */
7160 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
7161 close(pd[1]); /* Pipe pd is now fully closed! */
7162 exit(0); /* Bye bye, thank you for playing! */
7166 if eval $compile_ok; then
7167 echo "$startsh" >mtry
7168 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
7170 ./mtry >/dev/null 2>&1
7172 0) eagain=`$cat try.out`;;
7173 1) echo "Could not perform non-blocking setting!";;
7174 2) echo "I did a successful read() for something that was not there!";;
7175 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
7176 *) echo "Something terribly wrong happened during testing.";;
7178 rd_nodata=`$cat try.ret`
7179 echo "A read() system call with no data present returns $rd_nodata."
7180 case "$rd_nodata" in
7183 echo "(That's peculiar, fixing that to be -1.)"
7189 echo "Forcing errno EAGAIN on read() with no data available."
7193 echo "Your read() sets errno to $eagain when no data is available."
7196 status=`$cat try.err`
7198 0) echo "And it correctly returns 0 to signal EOF.";;
7199 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
7200 *) echo "However, your read() returns '$status' on EOF??";;
7203 if test "$status" = "$rd_nodata"; then
7204 echo "WARNING: you can't distinguish between EOF and no data!"
7208 echo "I can't compile the test program--assuming errno EAGAIN will do."
7215 echo "Using $hint value $eagain."
7216 echo "Your read() returns $rd_nodata when no data is present."
7217 case "$d_eofnblk" in
7218 "$define") echo "And you can see EOF because read() returns 0.";;
7219 "$undef") echo "But you can't see EOF status from read() returned value.";;
7221 echo "(Assuming you can't see EOF status from read anyway.)"
7227 $rm -f try try.* .out core head.c mtry
7229 : see if fchmod exists
7233 : see if fchown exists
7237 : see if this is an fcntl system
7241 : see if fgetpos exists
7242 set fgetpos d_fgetpos
7245 : see if flock exists
7249 : see if fork exists
7253 : see if pathconf exists
7254 set pathconf d_pathconf
7257 : see if fpathconf exists
7258 set fpathconf d_fpathconf
7261 : see if fsetpos exists
7262 set fsetpos d_fsetpos
7265 : see if gethostbyaddr exists
7266 set gethostbyaddr d_gethbyaddr
7269 : see if gethostbyname exists
7270 set gethostbyname d_gethbyname
7273 : see if this is a sys/param system
7274 set sys/param.h i_sysparam
7277 : see if this is a sys/mount.h system
7278 set sys/mount.h i_sysmount
7281 : see if fstatfs exists
7282 set fstatfs d_fstatfs
7285 : see if statfs knows about mount flags
7287 set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
7290 : see if this is a sysstatvfs.h system
7291 set sys/statvfs.h i_sysstatvfs
7294 : see if fstatvfs exists
7295 set fstatvfs d_fstatvfs
7298 : see if gethostent exists
7299 set gethostent d_gethent
7302 hasproto='varname=$1; func=$2; shift; shift;
7303 while $test $# -ge 2; do
7305 $define) echo "#include <$2>";;
7309 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
7310 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
7311 echo "$func() prototype found.";
7314 echo "$func() prototype NOT found.";
7319 $rm -f try.c tryout.c'
7321 : see if this is a netdb.h system
7325 : see if prototypes for various gethostxxx netdb.h functions are available
7327 set d_gethostprotos gethostent $i_netdb netdb.h
7330 : see if getlogin exists
7331 set getlogin d_getlogin
7334 : see if getnetbyaddr exists
7335 set getnetbyaddr d_getnbyaddr
7338 : see if getnetbyname exists
7339 set getnetbyname d_getnbyname
7342 : see if getnetent exists
7343 set getnetent d_getnent
7346 : see if prototypes for various getnetxxx netdb.h functions are available
7348 set d_getnetprotos getnetent $i_netdb netdb.h
7352 : see if getprotobyname exists
7353 set getprotobyname d_getpbyname
7356 : see if getprotobynumber exists
7357 set getprotobynumber d_getpbynumber
7360 : see if getprotoent exists
7361 set getprotoent d_getpent
7364 : see if this is a mntent.h system
7365 set mntent.h i_mntent
7368 : see if getmntent exists
7369 set getmntent d_getmntent
7372 : see if hasmntopt exists
7373 set hasmntopt d_hasmntopt
7376 : see if getpgid exists
7377 set getpgid d_getpgid
7380 : see if getpgrp2 exists
7381 set getpgrp2 d_getpgrp2
7384 : see if getppid exists
7385 set getppid d_getppid
7388 : see if getpriority exists
7389 set getpriority d_getprior
7392 : see if prototypes for various getprotoxxx netdb.h functions are available
7394 set d_getprotoprotos getprotoent $i_netdb netdb.h
7397 : see if getservbyname exists
7398 set getservbyname d_getsbyname
7401 : see if getservbyport exists
7402 set getservbyport d_getsbyport
7405 : see if getservent exists
7406 set getservent d_getsent
7409 : see if prototypes for various getservxxx netdb.h functions are available
7411 set d_getservprotos getservent $i_netdb netdb.h
7414 : see if gettimeofday or ftime exists
7415 set gettimeofday d_gettimeod
7417 case "$d_gettimeod" in
7423 val="$undef"; set d_ftime; eval $setvar
7426 case "$d_gettimeod$d_ftime" in
7429 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
7433 : see if this is a netinet/in.h or sys/in.h system
7434 set netinet/in.h i_niin sys/in.h i_sysin
7437 : see if arpa/inet.h has to be included
7438 set arpa/inet.h i_arpainet
7441 : see if htonl --and friends-- exists
7446 : Maybe they are macros.
7451 #include <sys/types.h>
7452 #$i_niin I_NETINET_IN
7454 #$i_arpainet I_ARPA_INET
7456 #include <netinet/in.h>
7462 #include <arpa/inet.h>
7465 printf("Defined as a macro.");
7468 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
7469 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
7471 echo "But it seems to be defined as a macro." >&4
7479 : see which of string.h or strings.h is needed
7481 strings=`./findhdr string.h`
7482 if $test "$strings" && $test -r "$strings"; then
7483 echo "Using <string.h> instead of <strings.h>." >&4
7487 strings=`./findhdr strings.h`
7488 if $test "$strings" && $test -r "$strings"; then
7489 echo "Using <strings.h> instead of <string.h>." >&4
7491 echo "No string header found -- You'll surely have problems." >&4
7497 "$undef") strings=`./findhdr strings.h`;;
7498 *) strings=`./findhdr string.h`;;
7503 if set index val -f; eval $csym; $val; then
7504 if set strchr val -f d_strchr; eval $csym; $val; then
7505 if $contains strchr "$strings" >/dev/null 2>&1 ; then
7508 echo "strchr() found." >&4
7512 echo "index() found." >&4
7517 echo "index() found." >&4
7520 if set strchr val -f d_strchr; eval $csym; $val; then
7523 echo "strchr() found." >&4
7525 echo "No index() or strchr() found!" >&4
7530 set d_strchr; eval $setvar
7532 set d_index; eval $setvar
7534 : check whether inet_aton exists
7535 set inet_aton d_inetaton
7540 $cat >isascii.c <<'EOCP'
7552 if eval $compile; then
7553 echo "isascii() found." >&4
7556 echo "isascii() NOT found." >&4
7563 : see if killpg exists
7567 : see if lchown exists
7569 $cat > try.c <<'EOCP'
7570 /* System header to define __stub macros and hopefully few prototypes,
7571 which can conflict with char lchown(); below. */
7573 /* Override any gcc2 internal prototype to avoid an error. */
7574 /* We use char because int might match the return type of a gcc2
7575 builtin and then its argument prototype would still apply. */
7578 /* The GNU C library defines this for functions which it implements
7579 to always fail with ENOSYS. Some functions are actually named
7580 something starting with __ and the normal name is an alias. */
7581 #if defined (__stub_lchown) || defined (__stub___lchown)
7589 if eval $compile; then
7590 $echo "lchown() found." >&4
7593 $echo "lchown() NOT found." >&4
7599 : see if link exists
7603 : see if localeconv exists
7604 set localeconv d_locconv
7607 : see if lockf exists
7611 : check for long doubles
7613 echo $n "Checking to see if your system supports long doubles...$c" >&4
7614 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7615 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7617 echo " Yup, it does." >&4
7620 echo " Nope, it doesn't." >&4
7626 : check for length of long double
7627 case "${d_longdbl}${longdblsize}" in
7630 $echo $n "Checking to see how big your long doubles are...$c" >&4
7631 $cat >try.c <<'EOCP'
7635 printf("%d\n", sizeof(long double));
7639 if eval $compile; then
7641 $echo " $longdblsize bytes." >&4
7645 echo "(I can't seem to compile the test program. Guessing...)" >&4
7646 rp="What is the size of a long double (in bytes)?"
7650 if $test "X$doublesize" = "X$longdblsize"; then
7651 echo "(That isn't any different from an ordinary double.)"
7657 : check for long long
7659 echo $n "Checking to see if your system supports long long...$c" >&4
7660 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
7661 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7663 echo " Yup, it does." >&4
7666 echo " Nope, it doesn't." >&4
7672 : check for length of long long
7673 case "${d_longlong}${longlongsize}" in
7676 $echo $n "Checking to see how big your long longs are...$c" >&4
7677 $cat >try.c <<'EOCP'
7681 printf("%d\n", sizeof(long long));
7685 if eval $compile_ok; then
7686 longlongsize=`./try`
7687 $echo " $longlongsize bytes." >&4
7691 echo "(I can't seem to compile the test program. Guessing...)"
7692 rp="What is the size of a long long (in bytes)?"
7696 if $test "X$longsize" = "X$longlongsize"; then
7697 echo "(That isn't any different from an ordinary long.)"
7703 : see if lstat exists
7707 : see if mblen exists
7711 : see if mbstowcs exists
7712 set mbstowcs d_mbstowcs
7715 : see if mbtowc exists
7719 : see if memcmp exists
7723 : see if memcpy exists
7727 : see if memmove exists
7728 set memmove d_memmove
7731 : see if memset exists
7735 : see if mkdir exists
7739 : see if mkfifo exists
7743 : see if mktime exists
7747 : see if msgctl exists
7751 : see if msgget exists
7755 : see if msgsnd exists
7759 : see if msgrcv exists
7763 : see how much of the 'msg*(2)' library is present.
7766 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
7767 *"$undef"*) h_msg=false;;
7771 case "`ipcs 2>&1`" in
7772 "SVID messages"*"not configured"*)
7773 echo "Your $osname does not have the msg*(2) configured." >&4
7788 : we could also check for sys/ipc.h ...
7789 if $h_msg && $test `./findhdr sys/msg.h`; then
7790 echo "You have the full msg*(2) library." >&4
7793 echo "You don't have the full msg*(2) library." >&4
7799 : see if nice exists
7803 : see if pause exists
7807 : see if pipe exists
7811 : see if poll exists
7816 : see whether the various POSIXish _yields exist
7818 #include <pthread.h>
7824 : see if pthread_yield exists within given cccmd,
7825 : if we do not usethreads this may well end up undef.
7826 set try -DYIELD=pthread_yield
7827 if eval $compile; then
7829 echo 'pthread_yield() found.' >&4
7832 echo 'pthread_yield() NOT found.' >&4
7837 : see if sched_yield exists within given cccmd,
7838 : if we do not usethreads this may well end up undef.
7839 set try -DYIELD=sched_yield
7840 if eval $compile; then
7842 echo 'sched_yield() found.' >&4
7845 echo 'sched_yield() NOT found.' >&4
7851 : see if this is a pthread.h system
7852 set pthread.h i_pthread
7855 : see if this is a mach/cthreads.h system
7856 set mach/cthreads.h i_machcthreads
7859 : test whether pthreads are created in joinable -- aka undetached -- state
7860 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
7861 echo $n "Checking whether pthreads are created joinable. $c" >&4
7863 #include <pthread.h>
7866 pthread_attr_t attr;
7869 pthread_attr_init(&attr) == 0 &&
7870 pthread_attr_getdetachstate(&attr, &detachstate) == 0 &&
7871 detachstate == PTHREAD_CREATE_DETACHED ?
7872 "detached" : "joinable");
7877 if eval $compile; then
7880 detached) echo "Nope, they aren't." >&4 ;;
7881 *) echo "Yup, they are." >&4 ;;
7885 echo "(I can't execute the test program--assuming they are.)" >&4
7890 detached) val="$undef" ;;
7893 set d_pthreads_created_joinable
7896 d_pthreads_created_joinable="$undef"
7899 : see if this is a pwd.h system
7905 : see if setpwent exists
7906 set setpwent d_setpwent
7909 : see if getpwent exists
7910 set getpwent d_getpwent
7913 : see if endpwent exists
7914 set endpwent d_endpwent
7917 xxx=`./findhdr pwd.h`
7918 $cppstdin $cppflags $cppminus < $xxx >$$.h
7920 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
7928 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
7936 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
7944 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
7952 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
7960 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
7968 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
7976 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
7986 *) # Assume all is lost as far as the d_*pw* go.
7988 set d_setpwent; eval $setvar
7989 set d_getpwent; eval $setvar
7990 set d_endpwent; eval $setvar
7991 set d_pwquota; eval $setvar
7992 set d_pwage; eval $setvar
7993 set d_pwchange; eval $setvar
7994 set d_pwclass; eval $setvar
7995 set d_pwexpire; eval $setvar
7996 set d_pwcomment; eval $setvar
7997 set d_pwgecos; eval $setvar
7998 set d_pwpasswd; eval $setvar
8002 : see if readdir and friends exist
8003 set readdir d_readdir
8005 set seekdir d_seekdir
8007 set telldir d_telldir
8009 set rewinddir d_rewinddir
8012 : see if readlink exists
8013 set readlink d_readlink
8016 : see if rename exists
8020 : see if rmdir exists
8024 : see if memory.h is available.
8029 : See if it conflicts with string.h
8035 $cppstdin $cppflags $cppminus < $strings > mem.h
8036 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
8038 echo "We won't be including <memory.h>."
8048 : can bcopy handle overlapping blocks?
8053 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
8060 $cat >>try.c <<'EOCP'
8063 # include <memory.h>
8066 # include <stdlib.h>
8069 # include <string.h>
8071 # include <strings.h>
8074 # include <unistd.h> /* Needed for NetBSD */
8078 char buf[128], abc[128];
8084 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
8086 for (align = 7; align >= 0; align--) {
8087 for (len = 36; len; len--) {
8090 for (off = 1; off <= len; off++) {
8091 bcopy(b, b+off, len);
8092 bcopy(b+off, b, len);
8093 if (bcmp(b, abc, len))
8102 if eval $compile_ok; then
8103 if ./try 2>/dev/null; then
8107 echo "It can't, sorry."
8108 case "$d_memmove" in
8109 "$define") echo "But that's Ok since you have memmove()." ;;
8113 echo "(I can't compile the test program, so we'll assume not...)"
8114 case "$d_memmove" in
8115 "$define") echo "But that's Ok since you have memmove()." ;;
8120 $rm -f try.* try core
8124 : can memcpy handle overlapping blocks?
8129 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
8136 $cat >>try.c <<'EOCP'
8139 # include <memory.h>
8142 # include <stdlib.h>
8145 # include <string.h>
8147 # include <strings.h>
8150 # include <unistd.h> /* Needed for NetBSD */
8154 char buf[128], abc[128];
8160 /* Copy "abcde..." string to char abc[] so that gcc doesn't
8161 try to store the string in read-only memory. */
8162 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
8164 for (align = 7; align >= 0; align--) {
8165 for (len = 36; len; len--) {
8167 memcpy(b, abc, len);
8168 for (off = 1; off <= len; off++) {
8169 memcpy(b+off, b, len);
8170 memcpy(b, b+off, len);
8171 if (memcmp(b, abc, len))
8180 if eval $compile_ok; then
8181 if ./try 2>/dev/null; then
8185 echo "It can't, sorry."
8186 case "$d_memmove" in
8187 "$define") echo "But that's Ok since you have memmove()." ;;
8191 echo "(I can't compile the test program, so we'll assume not...)"
8192 case "$d_memmove" in
8193 "$define") echo "But that's Ok since you have memmove()." ;;
8198 $rm -f try.* try core
8202 : can memcmp be trusted to compare relative magnitude?
8207 echo "Checking if your memcmp() can compare relative magnitude..." >&4
8214 $cat >>try.c <<'EOCP'
8217 # include <memory.h>
8220 # include <stdlib.h>
8223 # include <string.h>
8225 # include <strings.h>
8228 # include <unistd.h> /* Needed for NetBSD */
8234 if ((a < b) && memcmp(&a, &b, 1) < 0)
8240 if eval $compile_ok; then
8241 if ./try 2>/dev/null; then
8245 echo "No, it can't (it uses signed chars)."
8248 echo "(I can't compile the test program, so we'll assume not...)"
8252 $rm -f try.* try core
8256 : see if select exists
8260 : see if semctl exists
8264 : see if semget exists
8268 : see if semop exists
8272 : see how much of the 'sem*(2)' library is present.
8275 case "$d_semctl$d_semget$d_semop" in
8276 *"$undef"*) h_sem=false;;
8280 case "`ipcs 2>&1`" in
8281 "SVID messages"*"not configured"*)
8282 echo "Your $osname does not have the sem*(2) configured." >&4
8295 : we could also check for sys/ipc.h ...
8296 if $h_sem && $test `./findhdr sys/sem.h`; then
8297 echo "You have the full sem*(2) library." >&4
8300 echo "You don't have the full sem*(2) library." >&4
8306 : see whether sys/sem.h defines union semun
8308 $cat > try.c <<'END'
8309 #include <sys/types.h>
8310 #include <sys/ipc.h>
8311 #include <sys/sem.h>
8312 int main () { union semun semun; semun.buf = 0; }
8315 if eval $compile; then
8316 echo "You have union semun in <sys/sem.h>." >&4
8319 echo "You do not have union semun in <sys/sem.h>." >&4
8326 : see how to do semctl IPC_STAT
8329 : see whether semctl IPC_STAT can use union semun
8334 # define S_IRUSR S_IREAD
8335 # define S_IWUSR S_IWRITE
8336 # define S_IXUSR S_IEXEC
8338 # define S_IRUSR 0400
8339 # define S_IWUSR 0200
8340 # define S_IXUSR 0100
8342 # define S_IRGRP (S_IRUSR>>3)
8343 # define S_IWGRP (S_IWUSR>>3)
8344 # define S_IXGRP (S_IXUSR>>3)
8345 # define S_IROTH (S_IRUSR>>6)
8346 # define S_IWOTH (S_IWUSR>>6)
8347 # define S_IXOTH (S_IXUSR>>6)
8350 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
8351 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
8352 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
8357 #include <sys/types.h>
8358 #include <sys/ipc.h>
8359 #include <sys/sem.h>
8360 #include <sys/stat.h>
8366 #$d_union_semun HAS_UNION_SEMUN
8369 #ifndef HAS_UNION_SEMUN
8372 struct semid_ds *buf;
8373 unsigned short *array;
8379 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
8380 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
8382 struct semid_ds argbuf;
8385 st = semctl(sem, 0, IPC_STAT, arg);
8389 # endif /* IPC_STAT */
8390 printf("semctl IPC_STAT failed: errno = %d\n", errno);
8392 if (semctl(sem, 0, IPC_RMID, arg) != 0)
8393 # endif /* IPC_RMID */
8394 printf("semctl IPC_RMID failed: errno = %d\n", errno);
8396 #endif /* IPC_PRIVATE && ... */
8397 printf("semget failed: errno = %d\n", errno);
8403 if eval $compile; then
8406 semun) val="$define" ;;
8412 case "$d_semctl_semun" in
8414 echo "You can use union semun for semctl IPC_STAT." >&4
8417 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
8422 : see whether semctl IPC_STAT can use struct semid_ds pointer
8423 $cat > try.c <<'END'
8424 #include <sys/types.h>
8425 #include <sys/ipc.h>
8426 #include <sys/sem.h>
8427 #include <sys/stat.h>
8435 struct semid_ds arg;
8438 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
8439 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
8442 st = semctl(sem, 0, IPC_STAT, &arg);
8444 printf("semid_ds\n");
8446 # endif /* IPC_STAT */
8447 printf("semctl IPC_STAT failed: errno = %d\n", errno);
8449 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
8450 # endif /* IPC_RMID */
8451 printf("semctl IPC_RMID failed: errno = %d\n", errno);
8453 #endif /* IPC_PRIVATE && ... */
8454 printf("semget failed: errno = %d\n", errno);
8461 if eval $compile; then
8464 semid_ds) val="$define" ;;
8468 set d_semctl_semid_ds
8470 case "$d_semctl_semid_ds" in
8472 echo "You can ${also}use struct semid_ds* for semctl IPC_STAT." >&4
8474 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
8481 # We do not have the full sem*(2) library, so assume we can not
8487 set d_semctl_semid_ds
8492 : see if setegid exists
8493 set setegid d_setegid
8496 : see if seteuid exists
8497 set seteuid d_seteuid
8500 : see if sethostent exists
8501 set sethostent d_sethent
8504 : see if setlinebuf exists
8505 set setlinebuf d_setlinebuf
8508 : see if setlocale exists
8509 set setlocale d_setlocale
8512 : see if setnetent exists
8513 set setnetent d_setnent
8516 : see if setprotoent exists
8517 set setprotoent d_setpent
8520 : see if setpgid exists
8521 set setpgid d_setpgid
8524 : see if setpgrp2 exists
8525 set setpgrp2 d_setpgrp2
8528 : see if setpriority exists
8529 set setpriority d_setprior
8532 : see if setregid exists
8533 set setregid d_setregid
8535 set setresgid d_setresgid
8538 : see if setreuid exists
8539 set setreuid d_setreuid
8541 set setresuid d_setresuid
8544 : see if setrgid exists
8545 set setrgid d_setrgid
8548 : see if setruid exists
8549 set setruid d_setruid
8552 : see if setservent exists
8553 set setservent d_setsent
8556 : see if setsid exists
8560 : see if setvbuf exists
8561 set setvbuf d_setvbuf
8564 : see if sfio.h is available
8569 : see if sfio library is available
8580 : Ok, but do we want to use it.
8584 true|$define|[yY]*) dflt='y';;
8587 echo "$package can use the sfio library, but it is experimental."
8588 rp="You seem to have sfio available, do you want to try using it?"
8592 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
8594 : Remove sfio from list of libraries to use
8595 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
8598 echo "libs = $libs" >&4
8602 *) case "$usesfio" in
8604 echo "Sorry, cannot find sfio on this machine" >&4
8605 echo "Ignoring your setting of usesfio=$usesfio" >&4
8613 $define) usesfio='true';;
8614 *) usesfio='false';;
8617 : see if shmctl exists
8621 : see if shmget exists
8625 : see if shmat exists
8628 : see what shmat returns
8631 $cat >shmat.c <<'END'
8632 #include <sys/shm.h>
8635 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
8640 echo "and it returns ($shmattype)." >&4
8641 : see if a prototype for shmat is available
8642 xxx=`./findhdr sys/shm.h`
8643 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
8644 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
8655 set d_shmatprototype
8658 : see if shmdt exists
8662 : see how much of the 'shm*(2)' library is present.
8665 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
8666 *"$undef"*) h_shm=false;;
8670 case "`ipcs 2>&1`" in
8671 "SVID shared memory"*"not configured"*)
8672 echo "But your $osname does not have the shm*(2) configured." >&4
8687 : we could also check for sys/ipc.h ...
8688 if $h_shm && $test `./findhdr sys/shm.h`; then
8689 echo "You have the full shm*(2) library." >&4
8692 echo "You don't have the full shm*(2) library." >&4
8699 : see if we have sigaction
8700 if set sigaction val -f d_sigaction; eval $csym; $val; then
8701 echo 'sigaction() found.' >&4
8702 $cat > try.c <<'EOP'
8704 #include <sys/types.h>
8708 struct sigaction act, oact;
8712 if eval $compile_ok; then
8715 echo "But you don't seem to have a useable struct sigaction." >&4
8719 echo 'sigaction NOT found.' >&4
8722 set d_sigaction; eval $setvar
8723 $rm -f try try$_o try.c
8725 : see if sigsetjmp exists
8727 case "$d_sigsetjmp" in
8735 if (sigsetjmp(env,1))
8743 if eval $compile; then
8744 if ./try >/dev/null 2>&1; then
8745 echo "POSIX sigsetjmp found." >&4
8749 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
8755 echo "sigsetjmp not found." >&4
8759 *) val="$d_sigsetjmp"
8760 case "$d_sigsetjmp" in
8761 $define) echo "POSIX sigsetjmp found." >&4;;
8762 $undef) echo "sigsetjmp not found." >&4;;
8772 : see whether socket exists
8774 $echo $n "Hmm... $c" >&4
8775 if set socket val -f d_socket; eval $csym; $val; then
8776 echo "Looks like you have Berkeley networking support." >&4
8778 if set setsockopt val -f; eval $csym; $val; then
8781 echo "...but it uses the old 4.1c interface, rather than 4.2" >&4
8785 if $contains socklib libc.list >/dev/null 2>&1; then
8786 echo "Looks like you have Berkeley networking support." >&4
8788 : we will have to assume that it supports the 4.2 BSD interface
8791 echo "You don't have Berkeley networking in libc$_a..." >&4
8792 for net in net socket
8794 if test -f /usr/lib/lib$net$_a; then
8795 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8796 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8797 if $contains socket libc.list >/dev/null 2>&1; then
8801 echo "...but the Wollongong group seems to have hacked it in." >&4
8803 sockethdr="-I/usr/netinclude"
8806 echo "Found Berkeley sockets interface in lib$net." >& 4
8807 if $contains setsockopt libc.list >/dev/null 2>&1; then
8810 echo "...using the old 4.1c interface, rather than 4.2" >&4
8817 if test "X$d_socket" != "X$define"; then
8818 echo "or anywhere else I see." >&4
8825 : see if socketpair exists
8826 set socketpair d_sockpair
8829 : see if stat knows about block sizes
8831 set d_statblks stat st_blocks $i_sysstat sys/stat.h
8834 : see if _ptr and _cnt from stdio act std
8836 if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
8837 echo "(Looks like you have stdio.h from Linux.)"
8838 case "$stdio_ptr" in
8839 '') stdio_ptr='((fp)->_IO_read_ptr)'
8842 *) ptr_lval=$d_stdio_ptr_lval;;
8844 case "$stdio_cnt" in
8845 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
8848 *) cnt_lval=$d_stdio_cnt_lval;;
8850 case "$stdio_base" in
8851 '') stdio_base='((fp)->_IO_read_base)';;
8853 case "$stdio_bufsiz" in
8854 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
8857 case "$stdio_ptr" in
8858 '') stdio_ptr='((fp)->_ptr)'
8861 *) ptr_lval=$d_stdio_ptr_lval;;
8863 case "$stdio_cnt" in
8864 '') stdio_cnt='((fp)->_cnt)'
8867 *) cnt_lval=$d_stdio_cnt_lval;;
8869 case "$stdio_base" in
8870 '') stdio_base='((fp)->_base)';;
8872 case "$stdio_bufsiz" in
8873 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
8876 : test whether _ptr and _cnt really work
8877 echo "Checking how std your stdio is..." >&4
8880 #define FILE_ptr(fp) $stdio_ptr
8881 #define FILE_cnt(fp) $stdio_cnt
8883 FILE *fp = fopen("try.c", "r");
8886 18 <= FILE_cnt(fp) &&
8887 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
8895 if eval $compile; then
8897 echo "Your stdio acts pretty std."
8900 echo "Your stdio isn't very std."
8903 echo "Your stdio doesn't appear very std."
8909 : Can _ptr be used as an lvalue?
8910 case "$d_stdstdio$ptr_lval" in
8911 $define$define) val=$define ;;
8914 set d_stdio_ptr_lval
8917 : Can _cnt be used as an lvalue?
8918 case "$d_stdstdio$cnt_lval" in
8919 $define$define) val=$define ;;
8922 set d_stdio_cnt_lval
8925 : see if _base is also standard
8927 case "$d_stdstdio" in
8931 #define FILE_base(fp) $stdio_base
8932 #define FILE_bufsiz(fp) $stdio_bufsiz
8934 FILE *fp = fopen("try.c", "r");
8937 19 <= FILE_bufsiz(fp) &&
8938 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
8945 if eval $compile; then
8947 echo "And its _base field acts std."
8950 echo "But its _base field isn't std."
8953 echo "However, it seems to be lacking the _base field."
8961 : see if strcoll exists
8962 set strcoll d_strcoll
8965 : check for structure copying
8967 echo "Checking to see if your C compiler can copy structs..." >&4
8968 $cat >try.c <<'EOCP'
8978 if $cc -c try.c >/dev/null 2>&1 ; then
8983 echo "Nope, it can't."
8989 : see if strerror and/or sys_errlist[] exist
8991 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
8992 if set strerror val -f d_strerror; eval $csym; $val; then
8993 echo 'strerror() found.' >&4
8994 d_strerror="$define"
8995 d_strerrm='strerror(e)'
8996 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
8997 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
8998 d_syserrlst="$define"
9000 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
9001 d_syserrlst="$undef"
9003 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
9004 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
9005 echo 'strerror() found in string header.' >&4
9006 d_strerror="$define"
9007 d_strerrm='strerror(e)'
9008 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9009 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
9010 d_syserrlst="$define"
9012 echo "(You don't appear to have any sys_errlist[], how can this be?)"
9013 d_syserrlst="$undef"
9015 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9016 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
9018 d_syserrlst="$define"
9019 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
9021 echo 'strerror() and sys_errlist[] NOT found.' >&4
9023 d_syserrlst="$undef"
9024 d_strerrm='"unknown"'
9028 : see if strtod exists
9032 : see if strtol exists
9036 : see if strtoul exists
9037 set strtoul d_strtoul
9040 : see if strxfrm exists
9041 set strxfrm d_strxfrm
9044 : see if symlink exists
9045 set symlink d_symlink
9048 : see if syscall exists
9049 set syscall d_syscall
9052 : see if sysconf exists
9053 set sysconf d_sysconf
9056 : see if system exists
9060 : see if tcgetpgrp exists
9061 set tcgetpgrp d_tcgetpgrp
9064 : see if tcsetpgrp exists
9065 set tcsetpgrp d_tcsetpgrp
9068 : define an is-a-typedef? function
9069 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9071 "") inclist="sys/types.h";;
9073 eval "varval=\$$var";
9077 for inc in $inclist; do
9078 echo "#include <$inc>" >>temp.c;
9080 echo "#ifdef $type" >> temp.c;
9081 echo "printf(\"We have $type\");" >> temp.c;
9082 echo "#endif" >> temp.c;
9083 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9084 if $contains $type temp.E >/dev/null 2>&1; then
9090 *) eval "$var=\$varval";;
9093 : define an is-a-typedef? function that prompts if the type is not available.
9094 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9096 "") inclist="sys/types.h";;
9098 eval "varval=\$$var";
9102 for inc in $inclist; do
9103 echo "#include <$inc>" >>temp.c;
9105 echo "#ifdef $type" >> temp.c;
9106 echo "printf(\"We have $type\");" >> temp.c;
9107 echo "#endif" >> temp.c;
9108 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9110 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9111 if $contains $type temp.E >/dev/null 2>&1; then
9112 echo "$type found." >&4;
9115 echo "$type NOT found." >&4;
9121 *) eval "$var=\$varval";;
9124 : see if this is a sys/times.h system
9125 set sys/times.h i_systimes
9128 : see if times exists
9130 if set times val -f d_times; eval $csym; $val; then
9131 echo 'times() found.' >&4
9134 case "$i_systimes" in
9135 "$define") inc='sys/times.h';;
9137 rp="What is the type returned by times() on this system?"
9138 set clock_t clocktype long stdio.h sys/types.h $inc
9141 echo 'times() NOT found, hope that will do.' >&4
9146 : see if truncate exists
9147 set truncate d_truncate
9150 : see if tzname[] exists
9152 if set tzname val -a d_tzname; eval $csym; $val; then
9154 echo 'tzname[] found.' >&4
9157 echo 'tzname[] NOT found.' >&4
9162 : see if umask exists
9166 : see how we will look up host name
9169 : dummy stub to allow use of elif
9170 elif set uname val -f d_uname; eval $csym; $val; then
9173 uname() was found, but you're running xenix, and older versions of xenix
9174 have a broken uname(). If you don't really know whether your xenix is old
9175 enough to have a broken system call, use the default answer.
9182 rp='Is your uname() broken?'
9185 n*) d_uname="$define"; call=uname;;
9188 echo 'uname() found.' >&4
9193 case "$d_gethname" in
9194 '') d_gethname="$undef";;
9197 '') d_uname="$undef";;
9199 case "$d_phostname" in
9200 '') d_phostname="$undef";;
9203 : backward compatibility for d_hvfork
9204 if test X$d_hvfork != X; then
9208 : see if there is a vfork
9213 : Ok, but do we want to use it. vfork is reportedly unreliable in
9214 : perl on Solaris 2.x, and probably elsewhere.
9222 rp="Some systems have problems with vfork(). Do you want to use it?"
9227 echo "Ok, we won't use vfork()."
9236 $define) usevfork='true';;
9237 *) usevfork='false';;
9240 : see if this is an sysdir system
9241 set sys/dir.h i_sysdir
9244 : see if this is an sysndir system
9245 set sys/ndir.h i_sysndir
9248 : see if sys/types.h has to be included
9249 set sys/types.h i_systypes
9252 : see if closedir exists
9253 set closedir d_closedir
9256 case "$d_closedir" in
9259 echo "Checking whether closedir() returns a status..." >&4
9260 cat > closedir.c <<EOM
9261 #$i_dirent I_DIRENT /**/
9262 #$i_sysdir I_SYS_DIR /**/
9263 #$i_sysndir I_SYS_NDIR /**/
9264 #$i_systypes I_SYS_TYPES /**/
9266 #if defined(I_SYS_TYPES)
9267 #include <sys/types.h>
9269 #if defined(I_DIRENT)
9271 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
9272 #include <sys/dir.h>
9276 #include <sys/ndir.h>
9280 #include <ndir.h> /* may be wrong in the future */
9282 #include <sys/dir.h>
9287 int main() { return closedir(opendir(".")); }
9290 if eval $compile_ok; then
9291 if ./closedir > /dev/null 2>&1 ; then
9292 echo "Yes, it does."
9295 echo "No, it doesn't."
9299 echo "(I can't seem to compile the test program--assuming it doesn't)"
9310 : check for volatile keyword
9312 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
9313 $cat >try.c <<'EOCP'
9316 typedef struct _goo_struct goo_struct;
9317 goo_struct * volatile goo = ((goo_struct *)0);
9318 struct _goo_struct {
9323 typedef unsigned short foo_t;
9326 volatile foo_t blech;
9330 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
9332 echo "Yup, it does."
9335 echo "Nope, it doesn't."
9341 : see if there is a wait4
9345 : see if waitpid exists
9346 set waitpid d_waitpid
9349 : see if wcstombs exists
9350 set wcstombs d_wcstombs
9353 : see if wctomb exists
9357 : preserve RCS keywords in files with variable substitution, grrr
9362 Revision='$Revision'
9364 : check for alignment requirements
9366 case "$alignbytes" in
9367 '') echo "Checking alignment constraints..." >&4
9368 $cat >try.c <<'EOCP'
9375 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
9379 if eval $compile_ok; then
9383 echo "(I can't seem to compile the test program...)"
9386 *) dflt="$alignbytes"
9389 rp="Doubles must be aligned on a how-many-byte boundary?"
9394 : check for ordering of bytes in a long
9395 case "$byteorder" in
9399 In the following, larger digits indicate more significance. A big-endian
9400 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
9401 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
9402 machines may have weird orders like 3412. A Cray will report 87654321. If
9403 the test program works the default is probably right.
9404 I'm now running the test program...
9406 $cat >try.c <<'EOCP'
9413 char c[sizeof(long)];
9416 if (sizeof(long) > 4)
9417 u.l = (0x08070605L << 32) | 0x04030201L;
9420 for (i = 0; i < sizeof(long); i++)
9421 printf("%c", u.c[i]+'0');
9428 if eval $compile && ./try > /dev/null; then
9431 [1-4][1-4][1-4][1-4]|12345678|87654321)
9432 echo "(The test program ran ok.)"
9433 echo "byteorder=$dflt"
9436 ????|????????) echo "(The test program ran ok.)" ;;
9437 *) echo "(The test program didn't run right for some reason.)" ;;
9442 (I can't seem to compile the test program. Guessing big-endian...)
9445 case "$xxx_prompt" in
9447 rp="What is the order of bytes in a long?"
9458 : how do we catenate cpp tokens here?
9460 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
9461 $cat >cpp_stuff.c <<'EOCP'
9462 #define RCAT(a,b)a/**/b
9463 #define ACAT(a,b)a ## b
9467 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
9468 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
9469 echo "Oh! Smells like ANSI's been here." >&4
9470 echo "We can catify or stringify, separately or together!"
9472 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
9473 echo "Ah, yes! The good old days!" >&4
9474 echo "However, in the good old days we don't know how to stringify and"
9475 echo "catify at the same time."
9479 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
9480 to have to edit the values of CAT[2-5] in config.h...
9482 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
9486 : see if this is a db.h system
9494 echo "Checking Berkeley DB version ..." >&4
9500 #include <sys/types.h>
9505 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
9506 int Major, Minor, Patch ;
9507 unsigned long Version ;
9508 (void)db_version(&Major, &Minor, &Patch) ;
9509 printf("You have Berkeley DB Version 2 or greater\n");
9511 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
9512 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
9513 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
9514 Major, Minor, Patch) ;
9516 /* check that db.h & libdb are compatible */
9517 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
9518 printf("db.h and libdb are incompatible\n") ;
9522 printf("db.h and libdb are compatible\n") ;
9524 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
9525 + DB_VERSION_PATCH ;
9527 /* needs to be >= 2.3.4 */
9528 if (Version < 2003004) {
9529 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
9530 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
9536 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
9537 printf("You have Berkeley DB Version 1\n");
9538 exit(0); /* DB version < 2: the coast is clear. */
9540 exit(1); /* <db.h> not Berkeley DB? */
9546 if eval $compile && ./try; then
9547 echo 'Looks OK.' >&4
9549 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
9553 : Remove db from list of libraries to use
9554 echo "Removing unusable -ldb from library list" >&4
9555 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
9558 echo "libs = $libs" >&4
9568 : Check the return type needed for hash
9570 echo "Checking return type needed for hash for Berkeley DB ..." >&4
9576 #include <sys/types.h>
9579 #ifndef DB_VERSION_MAJOR
9580 u_int32_t hash_cb (ptr, size)
9588 info.hash = hash_cb;
9592 if $cc $ccflags -c try.c >try.out 2>&1 ; then
9593 if $contains warning try.out >>/dev/null 2>&1 ; then
9596 db_hashtype='u_int32_t'
9599 : XXX Maybe we should just give up here.
9600 db_hashtype=u_int32_t
9602 echo "Help: I can't seem to compile the db test program." >&4
9603 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
9606 echo "Your version of Berkeley DB uses $db_hashtype for hash."
9608 *) db_hashtype=u_int32_t
9613 : Check the return type needed for prefix
9615 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
9621 #include <sys/types.h>
9624 #ifndef DB_VERSION_MAJOR
9625 size_t prefix_cb (key1, key2)
9633 info.prefix = prefix_cb;
9637 if $cc $ccflags -c try.c >try.out 2>&1 ; then
9638 if $contains warning try.out >>/dev/null 2>&1 ; then
9641 db_prefixtype='size_t'
9644 db_prefixtype='size_t'
9645 : XXX Maybe we should just give up here.
9647 echo "Help: I can't seem to compile the db test program." >&4
9648 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
9651 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
9653 *) db_prefixtype='size_t'
9657 : check for void type
9659 echo "Checking to see how well your C compiler groks the void type..." >&4
9660 case "$voidflags" in
9662 $cat >try.c <<'EOCP'
9668 extern void moo(); /* function returning void */
9669 void (*goo)(); /* ptr to func returning void */
9671 void *hue; /* generic ptr */
9684 int main() { sub(); }
9686 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
9687 voidflags=$defvoidused
9688 echo "Good. It appears to support void to the level $package wants.">&4
9689 if $contains warning .out >/dev/null 2>&1; then
9690 echo "However, you might get some warnings that look like this:"
9694 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
9695 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
9696 echo "It supports 1..."
9697 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
9698 echo "It also supports 2..."
9699 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
9701 echo "And it supports 4 but not 8 definitely."
9703 echo "It doesn't support 4..."
9704 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
9706 echo "But it supports 8."
9709 echo "Neither does it support 8."
9713 echo "It does not support 2..."
9714 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
9716 echo "But it supports 4 and 8."
9718 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
9720 echo "And it supports 4 but has not heard about 8."
9722 echo "However it supports 8 but not 4."
9727 echo "There is no support at all for void."
9732 case "$voidflags" in
9735 Support flag bits are:
9736 1: basic void declarations.
9737 2: arrays of pointers to functions returning void.
9738 4: operations between pointers to and addresses of void functions.
9739 8: generic void pointers.
9742 rp="Your void support flags add up to what?"
9749 : check for length of double
9751 case "$doublesize" in
9753 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
9754 $cat >try.c <<'EOCP'
9758 printf("%d\n", sizeof(double));
9762 if eval $compile_ok; then
9764 $echo " $doublesize bytes." >&4
9767 echo "(I can't seem to compile the test program. Guessing...)"
9768 rp="What is the size of a double precision number (in bytes)?"
9777 echo "Determining whether or not we are on an EBCDIC system..." >&4
9778 $cat >tebcdic.c <<EOM
9781 if ('M'==0xd4) return 0;
9787 if eval $compile_ok; then
9789 echo "You have EBCDIC." >&4
9792 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4
9795 echo "I'm unable to compile the test program." >&4
9796 echo "I'll assume ASCII or some ISO Latin." >&4
9798 $rm -f tebcdic.c tebcdic
9802 : see what type file positions are declared as in the library
9803 rp="What is the type for file position used by fsetpos()?"
9804 set fpos_t fpostype long stdio.h sys/types.h
9807 : get csh whereabouts
9809 'csh') val="$undef" ;;
9814 : Respect a hint or command line value for full_csh.
9816 '') full_csh=$csh ;;
9819 : Store the full pathname to the sed program for use in the C program
9822 : Store the full pathname to the ar program for use in the Makefile.SH
9823 : Respect a hint or command line value for full_ar.
9828 : see what type gids are declared as in the kernel
9830 echo "Looking for the type for group ids returned by getgid()."
9831 set gid_t gidtype xxx stdio.h sys/types.h
9835 xxx=`./findhdr sys/user.h`
9836 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
9838 unsigned) dflt="$1 $2" ;;
9842 *) dflt="$gidtype";;
9845 gid_t) echo "gid_t found." ;;
9846 *) rp="What is the type for group ids returned by getgid()?"
9852 : see if getgroups exists
9853 set getgroups d_getgrps
9856 : see if setgroups exists
9857 set setgroups d_setgrps
9861 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
9863 case "$d_getgrps$d_setgrps" in
9865 case "$groupstype" in
9866 '') dflt="$gidtype" ;;
9867 *) dflt="$groupstype" ;;
9870 What type of pointer is the second argument to getgroups() and setgroups()?
9871 Usually this is the same as group ids, $gidtype, but not always.
9874 rp='What type pointer is the second argument to getgroups() and setgroups()?'
9878 *) groupstype="$gidtype";;
9881 : see what type lseek is declared as in the kernel
9882 rp="What is the type used for lseek's offset on this system?"
9883 set off_t lseektype long stdio.h sys/types.h
9887 echo "Checking if your $make program sets \$(MAKE)..." >&4
9888 case "$make_set_make" in
9890 $sed 's/^X //' > testmake.mak << 'EOF'
9892 X @echo 'maketemp="$(MAKE)"'
9894 case "`$make -f testmake.mak 2>/dev/null`" in
9895 *maketemp=*) make_set_make='#' ;;
9896 *) make_set_make="MAKE=$make" ;;
9901 case "$make_set_make" in
9902 '#') echo "Yup, it does.";;
9903 *) echo "Nope, it doesn't.";;
9906 : see what type is used for mode_t
9907 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
9908 set mode_t modetype int stdio.h sys/types.h
9911 : define a fucntion to check prototypes
9912 $cat > protochk <<EOSH
9915 optimize="$optimize"
9917 prototype="$prototype"
9922 $cat >> protochk <<'EOSH'
9927 while test $# -ge 2; do
9929 $define) echo "#include <$2>" >> try.c ;;
9930 literal) echo "$2" >> try.c ;;
9934 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9935 cat >> try.c <<'EOCP'
9936 #ifdef CAN_PROTOTYPE
9937 #define _(args) args
9942 echo "$foo" >> try.c
9943 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9944 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9952 : see what type is used for size_t
9953 rp="What is the type used for the length parameter for string functions?"
9954 set size_t sizetype 'unsigned int' stdio.h sys/types.h
9957 : check for type of arguments to gethostbyaddr.
9958 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
9959 case "$d_gethbyaddr" in
9963 Checking to see what type of arguments are accepted by gethostbyaddr().
9965 hdrs="$define sys/types.h
9966 $d_socket sys/socket.h
9967 $i_niin netinet/in.h
9970 : The first arg can 'char *' or 'void *'
9971 : The second arg is some of integral type
9972 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
9973 for yyy in size_t long int; do
9974 case "$netdb_host_type" in
9975 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
9976 if ./protochk "$try" $hdrs; then
9977 echo "Your system accepts $xxx for the first arg."
9978 echo "...and $yyy for the second arg."
9979 netdb_host_type="$xxx"
9980 netdb_hlen_type="$yyy"
9986 : In case none of those worked, prompt the user.
9987 case "$netdb_host_type" in
9988 '') rp='What is the type for the 1st argument to gethostbyaddr?'
9991 netdb_host_type=$ans
9992 rp='What is the type for the 2nd argument to gethostbyaddr?'
9995 netdb_hlen_type=$ans
9999 *) : no gethostbyaddr, so pick harmless defaults
10000 netdb_host_type='char *'
10001 netdb_hlen_type="$sizetype"
10004 # Remove the "const" if needed. -- but then we'll have a
10006 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
10009 : check for type of argument to gethostbyname.
10010 if test "X$netdb_name_type" = X ; then
10011 case "$d_gethbyname" in
10015 Checking to see what type of argument is accepted by gethostbyname().
10017 hdrs="$define sys/types.h
10018 $d_socket sys/socket.h
10019 $i_niin netinet/in.h
10021 $i_unistd unistd.h"
10022 for xxx in "const char *" "char *"; do
10023 case "$netdb_name_type" in
10024 '') try="extern struct hostent *gethostbyname($xxx);"
10025 if ./protochk "$try" $hdrs; then
10026 echo "Your system accepts $xxx."
10027 netdb_name_type="$xxx"
10032 : In case none of those worked, prompt the user.
10033 case "$netdb_name_type" in
10034 '') rp='What is the type for the 1st argument to gethostbyname?'
10037 netdb_name_type=$ans
10041 *) : no gethostbyname, so pick harmless default
10042 netdb_name_type='char *'
10047 : check for type of 1st argument to getnetbyaddr.
10048 if test "X$netdb_net_type" = X ; then
10049 case "$d_getnbyaddr" in
10053 Checking to see what type of 1st argument is accepted by getnetbyaddr().
10055 hdrs="$define sys/types.h
10056 $d_socket sys/socket.h
10057 $i_niin netinet/in.h
10059 $i_unistd unistd.h"
10060 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
10061 case "$netdb_net_type" in
10062 '') try="extern struct netent *getnetbyaddr($xxx, int);"
10063 if ./protochk "$try" $hdrs; then
10064 echo "Your system accepts $xxx."
10065 netdb_net_type="$xxx"
10070 : In case none of those worked, prompt the user.
10071 case "$netdb_net_type" in
10072 '') rp='What is the type for the 1st argument to getnetbyaddr?'
10075 netdb_net_type=$ans
10079 *) : no getnetbyaddr, so pick harmless default
10080 netdb_net_type='long'
10084 : locate the preferred pager for this system
10098 '') dflt=/usr/ucb/more;;
10105 rp='What pager is used on your system?'
10109 : see what type pids are declared as in the kernel
10110 rp="What is the type of process ids on this system?"
10111 set pid_t pidtype int stdio.h sys/types.h
10114 : check for length of pointer
10118 $echo $n "Checking to see how big your pointers are...$c" >&4
10119 if test "$voidflags" -gt 7; then
10120 echo '#define VOID_PTR char *' > try.c
10122 echo '#define VOID_PTR void *' > try.c
10124 $cat >>try.c <<'EOCP'
10128 printf("%d\n", sizeof(VOID_PTR));
10133 if eval $compile_ok; then
10135 $echo " $ptrsize bytes." >&4
10138 echo "(I can't seem to compile the test program. Guessing...)" >&4
10139 rp="What is the size of a pointer (in bytes)?"
10147 : check for size of random number generator
10149 case "$randbits" in
10151 echo "Checking to see how many bits your rand function produces..." >&4
10153 #$i_unistd I_UNISTD
10154 #$i_stdlib I_STDLIB
10157 # include <unistd.h>
10160 # include <stdlib.h>
10163 $cat >>try.c <<'EOCP'
10167 register unsigned long tmp;
10168 register unsigned long max = 0L;
10170 for (i = 1000; i; i--) {
10171 tmp = (unsigned long)rand();
10172 if (tmp > max) max = tmp;
10174 for (i = 0; max; i++)
10180 if eval $compile_ok; then
10184 echo "(I can't seem to compile the test program...)"
10191 rp='How many bits does your rand() function produce?'
10196 : see if ar generates random libraries by itself
10198 echo "Checking how to generate random libraries on your machine..." >&4
10199 echo 'int bar1() { return bar2(); }' > bar1.c
10200 echo 'int bar2() { return 2; }' > bar2.c
10201 $cat > foo.c <<'EOP'
10202 int main() { printf("%d\n", bar1()); exit(0); }
10204 $cc $ccflags -c bar1.c >/dev/null 2>&1
10205 $cc $ccflags -c bar2.c >/dev/null 2>&1
10206 $cc $ccflags -c foo.c >/dev/null 2>&1
10207 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
10208 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
10209 ./foobar >/dev/null 2>&1; then
10210 echo "$ar appears to generate random libraries itself."
10213 elif $ar ts bar$_a >/dev/null 2>&1 &&
10214 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
10215 ./foobar >/dev/null 2>&1; then
10216 echo "a table of contents needs to be added with '$ar ts'."
10223 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
10224 $test -f $ranlib || ranlib=''
10227 if $test -n "$ranlib"; then
10228 echo "your system has '$ranlib'; we'll use that."
10231 echo "your system doesn't seem to support random libraries"
10232 echo "so we'll use lorder and tsort to order the libraries."
10239 : see if sys/select.h has to be included
10240 set sys/select.h i_sysselct
10243 : see if we should include time.h, sys/time.h, or both
10245 if test "X$timeincl" = X; then
10246 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10247 $echo $n "I'm now running the test program...$c"
10248 $cat >try.c <<'EOCP'
10249 #include <sys/types.h>
10254 #ifdef SYSTIMEKERNEL
10257 #include <sys/time.h>
10260 #include <sys/select.h>
10266 struct timeval bar;
10269 struct timezone tzp;
10271 if (foo.tm_sec == foo.tm_sec)
10274 if (bar.tv_sec == bar.tv_sec)
10281 for s_timezone in '-DS_TIMEZONE' ''; do
10283 for s_timeval in '-DS_TIMEVAL' ''; do
10284 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10285 for i_time in '' '-DI_TIME'; do
10286 for i_systime in '-DI_SYSTIME' ''; do
10289 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10290 if eval $compile; then
10291 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10295 $echo $n "Succeeded with $flags$c"
10307 *SYSTIMEKERNEL*) i_systimek="$define"
10308 timeincl=`./findhdr sys/time.h`
10309 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10310 *) i_systimek="$undef";;
10313 *I_TIME*) i_time="$define"
10314 timeincl=`./findhdr time.h`" $timeincl"
10315 echo "We'll include <time.h>." >&4;;
10316 *) i_time="$undef";;
10319 *I_SYSTIME*) i_systime="$define"
10320 timeincl=`./findhdr sys/time.h`" $timeincl"
10321 echo "We'll include <sys/time.h>." >&4;;
10322 *) i_systime="$undef";;
10327 : check for fd_set items
10330 Checking to see how well your C compiler handles fd_set and friends ...
10332 $cat >fd_set.c <<EOCP
10333 #$i_systime I_SYS_TIME
10334 #$i_sysselct I_SYS_SELECT
10335 #$d_socket HAS_SOCKET
10336 #include <sys/types.h>
10338 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
10341 #include <sys/time.h>
10343 #ifdef I_SYS_SELECT
10344 #include <sys/select.h>
10353 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
10360 set fd_set -DTRYBITS
10361 if eval $compile; then
10362 d_fds_bits="$define"
10364 echo "Well, your system knows about the normal fd_set typedef..." >&4
10366 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
10367 d_fd_macros="$define"
10370 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
10372 d_fd_macros="$undef"
10376 Hmm, your compiler has some difficulty with fd_set. Checking further...
10379 if eval $compile; then
10380 d_fds_bits="$undef"
10382 echo "Well, your system has some sort of fd_set available..." >&4
10384 echo "and you have the normal fd_set macros." >&4
10385 d_fd_macros="$define"
10388 but not the normal fd_set macros! Gross! More work for me...
10390 d_fd_macros="$undef"
10393 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
10395 d_fds_bits="$undef"
10396 d_fd_macros="$undef"
10401 : check for type of arguments to select.
10402 case "$selecttype" in
10403 '') case "$d_select" in
10406 Checking to see what type of arguments are accepted by select().
10408 hdrs="$define sys/types.h
10409 $i_systime sys/time.h
10410 $i_sysselct sys/select.h
10411 $d_socket sys/socket.h"
10412 : The first arg can be int, unsigned, or size_t
10413 : The last arg may or may not be 'const'
10415 : void pointer has been seen but using that
10416 : breaks the selectminbits test
10417 for xxx in 'fd_set *' 'int *'; do
10418 for nfd in 'int' 'size_t' 'unsigned' 'unsigned long'; do
10419 for tmo in 'struct timeval *' 'const struct timeval *'; do
10421 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
10422 if ./protochk "$try" $hdrs; then
10423 echo "Your system accepts $xxx."
10432 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
10433 case "$d_fd_set" in
10434 $define) dflt="fd_set *" ;;
10443 *) : no select, so pick a harmless default
10450 : check for the select 'width'
10451 case "$selectminbits" in
10452 '') case "$d_select" in
10456 Checking to see on how many bits at a time your select() operates...
10459 #include <sys/types.h>
10461 #$i_systime I_SYS_TIME
10462 #$i_systimek I_SYS_TIME_KERNEL
10467 # ifdef I_SYS_TIME_KERNEL
10470 # include <sys/time.h>
10471 # ifdef I_SYS_TIME_KERNEL
10475 #$i_sysselct I_SYS_SELECT
10476 #ifdef I_SYS_SELECT
10477 #include <sys/select.h>
10481 #define S sizeof(*(b))
10483 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
10484 #define NBITS (NBYTES * 8)
10493 fp = fopen("try.c", "r");
10499 b = ($selecttype)s;
10500 for (i = 0; i < NBITS; i++)
10504 select(fd + 1, b, 0, 0, &t);
10505 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
10506 printf("%d\n", i + 1);
10511 if eval $compile_ok; then
10512 selectminbits=`./try`
10513 case "$selectminbits" in
10515 Cannot figure out on how many bits at a time your select() operates.
10516 I'll play safe and guess it is 32 bits.
10522 *) bits="$selectminbits bits" ;;
10524 echo "Your select() operates on $bits at a time." >&4
10526 rp='What is the minimum number of bits your select() operates on?'
10527 case "$byteorder" in
10528 1234|12345678) dflt=32 ;;
10533 selectminbits="$val"
10537 *) : no select, so pick a harmless default
10544 : Trace out the files included by signal.h, then look for SIGxxx names.
10545 : Remove SIGARRAYSIZE used by HPUX.
10546 : Remove SIGTYP void lines used by OS2.
10547 xxx=`echo '#include <signal.h>' |
10548 $cppstdin $cppminus $cppflags 2>/dev/null |
10549 $grep '^[ ]*#.*include' |
10550 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
10551 : Check this list of files to be sure we have parsed the cpp output ok.
10552 : This will also avoid potentially non-existent files, such
10555 for xx in $xxx /dev/null ; do
10556 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
10558 : If we have found no files, at least try signal.h
10559 case "$xxxfiles" in
10560 '') xxxfiles=`./findhdr signal.h` ;;
10563 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ {
10564 print substr($2, 4, 20)
10566 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
10567 print substr($3, 4, 20)
10569 : Append some common names just in case the awk scan failed.
10570 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
10571 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
10572 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
10573 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
10574 : generate a few handy files for later
10575 $cat > signal.c <<'EOCP'
10576 #include <sys/types.h>
10577 #include <signal.h>
10581 /* Strange style to avoid deeply-nested #if/#else/#endif */
10584 # define NSIG (_NSIG)
10590 # define NSIG (SIGMAX+1)
10596 # define NSIG (SIG_MAX+1)
10602 # define NSIG (MAXSIG+1)
10608 # define NSIG (MAX_SIG+1)
10613 # ifdef SIGARRAYSIZE
10614 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
10620 # define NSIG (_sys_nsig) /* Solaris 2.5 */
10624 /* Default to some arbitrary number that's big enough to get most
10625 of the common signals.
10631 printf("NSIG %d\n", NSIG);
10637 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
10639 printf "#ifdef SIG"; printf $1; printf "\n"
10640 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
10641 printf $1; printf ");\n"
10645 printf "#endif /* JUST_NSIG */\n";
10649 $cat >signal.awk <<'EOP'
10650 BEGIN { ndups = 0 }
10651 $1 ~ /^NSIG$/ { nsig = $2 }
10652 ($1 !~ /^NSIG$/) && (NF == 2) {
10653 if ($2 > maxsig) { maxsig = $2 }
10654 if (sig_name[$2]) {
10655 dup_name[ndups] = $1
10656 dup_num[ndups] = $2
10666 if (nsig == 0) { nsig = maxsig + 1 }
10667 for (n = 1; n < nsig; n++) {
10669 printf("%s %d\n", sig_name[n], sig_num[n])
10672 printf("NUM%d %d\n", n, n)
10675 for (n = 0; n < ndups; n++) {
10676 printf("%s %d\n", dup_name[n], dup_num[n])
10680 $cat >signal_cmd <<EOS
10682 if $test -s signal.lst; then
10683 echo "Using your existing signal.lst file"
10688 $cat >>signal_cmd <<'EOS'
10691 if eval $compile_ok; then
10692 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
10694 echo "(I can't seem be able to compile the whole test program)" >&4
10695 echo "(I'll try it in little pieces.)" >&4
10696 set signal -DJUST_NSIG
10697 if eval $compile_ok; then
10698 ./signal$_exe > signal.nsg
10701 echo "I can't seem to figure out how many signals you have." >&4
10702 echo "Guessing 50." >&4
10703 echo 'NSIG 50' > signal.nsg
10705 : Now look at all the signal names, one at a time.
10706 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
10707 $cat > signal.c <<EOCP
10708 #include <sys/types.h>
10709 #include <signal.h>
10712 printf("$xx %d\n", SIG${xx});
10717 if eval $compile; then
10718 echo "SIG${xx} found."
10719 ./signal$_exe >> signal.ls1
10721 echo "SIG${xx} NOT found."
10724 if $test -s signal.ls1; then
10725 $cat signal.nsg signal.ls1 |
10726 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
10730 if $test -s signal.lst; then
10733 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
10734 echo 'kill -l' >signal
10735 set X `csh -f <signal`
10739 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
10741 echo $@ | $tr ' ' $trnl | \
10742 $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
10744 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
10746 chmod a+x signal_cmd
10747 $eunicefix signal_cmd
10749 : generate list of signal names
10751 case "$sig_name_init" in
10753 *) case "$sig_num_init" in
10754 ''|*,*) doinit=yes ;;
10759 echo "Generating a list of signal names and numbers..." >&4
10761 sig_name=`$awk '{printf "%s ", $1}' signal.lst`
10762 sig_name="ZERO $sig_name"
10763 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
10764 { printf "\"%s\", ", $1 }
10765 END { printf "0\n" }' signal.lst`
10766 sig_num=`$awk '{printf "%d ", $2}' signal.lst`
10767 sig_num="0 $sig_num"
10768 sig_num_init=`$awk 'BEGIN { printf "0, " }
10769 { printf "%d, ", $2}
10770 END { printf "0\n"}' signal.lst`
10773 echo "The following signals are available:"
10775 echo $sig_name | $awk \
10776 'BEGIN { linelen = 0 }
10778 for (i = 1; i <= NF; i++) {
10779 name = "SIG" $i " "
10780 linelen = linelen + length(name)
10781 if (linelen > 70) {
10783 linelen = length(name)
10789 $rm -f signal signal.c signal.awk signal.lst signal_cmd
10791 : see what type is used for signed size_t
10792 set ssize_t ssizetype int stdio.h sys/types.h
10795 $cat > ssize.c <<EOM
10797 #include <sys/types.h>
10798 #define Size_t $sizetype
10799 #define SSize_t $dflt
10802 if (sizeof(Size_t) == sizeof(SSize_t))
10804 else if (sizeof(Size_t) == sizeof(int))
10813 if eval $compile_ok && ./ssize > /dev/null; then
10814 ssizetype=`./ssize`
10815 echo "I'll be using $ssizetype for functions returning a byte count." >&4
10818 Help! I can't compile and run the ssize_t test program: please enlighten me!
10819 (This is probably a misconfiguration in your system or libraries, and
10820 you really ought to fix it. Still, I'll try anyway.)
10822 I need a type that is the same size as $sizetype, but is guaranteed to
10823 be signed. Common values are ssize_t, int and long.
10826 rp="What signed type is the same size as $sizetype?"
10830 $rm -f ssize ssize.*
10832 : see what type of char stdio uses.
10834 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
10835 echo "Your stdio uses unsigned chars." >&4
10836 stdchar="unsigned char"
10838 echo "Your stdio uses signed chars." >&4
10842 : see if time exists
10844 if test "X$d_time" = X -o X"$timetype" = X; then
10845 if set time val -f d_time; eval $csym; $val; then
10846 echo 'time() found.' >&4
10848 rp="What is the type returned by time() on this system?"
10849 set time_t timetype long stdio.h sys/types.h
10852 echo 'time() not found, hope that will do.' >&4
10860 : see what type uids are declared as in the kernel
10862 echo "Looking for the type for user ids returned by getuid()."
10863 set uid_t uidtype xxx stdio.h sys/types.h
10867 xxx=`./findhdr sys/user.h`
10868 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
10870 unsigned) dflt="$1 $2" ;;
10874 *) dflt="$uidtype";;
10877 uid_t) echo "uid_t found." ;;
10878 *) rp="What is the type for user ids returned by getuid()?"
10884 : see if dbm.h is available
10885 : see if dbmclose exists
10886 set dbmclose d_dbmclose
10889 case "$d_dbmclose" in
10899 *) set rpcsvc/dbm.h i_rpcsvcdbm
10904 *) echo "We won't be including <dbm.h>"
10914 : see if this is a sys/file.h system
10919 : do we need to include sys/file.h ?
10923 if $h_sysfile; then
10925 echo "We'll be including <sys/file.h>." >&4
10928 echo "We won't be including <sys/file.h>." >&4
10938 : see if fcntl.h is there
10943 : see if we can include fcntl.h
10949 echo "We'll be including <fcntl.h>." >&4
10952 if $h_sysfile; then
10953 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
10955 echo "We won't be including <fcntl.h>." >&4
10967 : see if this is an grp system
10973 : see if setgrent exists
10974 set setgrent d_setgrent
10977 : see if getgrent exists
10978 set getgrent d_getgrent
10981 : see if endgrent exists
10982 set endgrent d_endgrent
10985 xxx=`./findhdr grp.h`
10986 $cppstdin $cppflags $cppminus < $xxx >$$.h
10988 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10998 *) # Assume all is lost as far as the d_*gr* go.
11000 set d_setgrent; eval $setvar
11001 set d_getgrent; eval $setvar
11002 set d_endgrent; eval $setvar
11003 set d_grpasswd; eval $setvar
11007 : see if locale.h is available
11008 set locale.h i_locale
11011 : see if this is a math.h system
11015 : see if ndbm.h is available
11020 : see if dbm_open exists
11021 set dbm_open d_dbm_open
11023 case "$d_dbm_open" in
11026 echo "We won't be including <ndbm.h>"
11035 : see if net/errno.h is available
11037 set net/errno.h val
11040 : Unfortunately, it causes problems on some systems. Arrgh.
11043 cat > try.c <<'EOM'
11046 #include <net/errno.h>
11052 if $cc $ccflags -c try.c >/dev/null 2>&1; then
11053 echo "We'll be including <net/errno.h>." >&4
11055 echo "We won't be including <net/errno.h>." >&4
11064 : get C preprocessor symbols handy
11066 $echo $n "Hmm... $c"
11067 echo $al | $tr ' ' $trnl >Cppsym.know
11068 $cat <<EOSS >Cppsym
11076 case "\$list\$#" in
11079 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
11081 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
11084 unknown="\$unknown \$sym"
11094 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
11096 exit 0; _ _ _ _\1\\ \1\\
11099 echo "exit 1; _ _ _" >>Cppsym\$\$
11100 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
11102 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
11108 $rm -f Cppsym\$\$ Cppsym2\$\$
11113 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
11115 : now check the C compiler for additional symbols
11116 postprocess_cc_v=''
11118 aix) postprocess_cc_v="|$tr , ' '" ;;
11125 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
11128 -D*) echo "\$i" | $sed 's/^-D//';;
11129 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
11134 unset postprocess_cc_v
11137 ./ccsym > ccsym1.raw
11138 if $test -s ccsym1.raw; then
11139 $sort ccsym1.raw | $uniq >ccsym.raw
11141 mv ccsym1.raw ccsym.raw
11144 $awk '/\=/ { print $0; next }
11145 { print $0"=1" }' ccsym.raw >ccsym.list
11146 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
11147 $comm -13 ccsym.true ccsym.list >ccsym.own
11148 $comm -12 ccsym.true ccsym.list >ccsym.com
11149 $comm -23 ccsym.true ccsym.list >ccsym.cpp
11151 if $test -z ccsym.raw; then
11152 echo "Your C compiler doesn't seem to define any symbol!" >&4
11154 echo "However, your C preprocessor defines the following ones:"
11157 cppsymbols=`$cat Cppsym.true`
11158 cppsymbols=`echo $cppsymbols`
11159 cppccsymbols="$cppsymbols"
11161 if $test -s ccsym.com; then
11162 echo "Your C compiler and pre-processor define these symbols:"
11163 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
11166 $test "$silent" || sleep 1
11167 cppccsymbols=`$cat ccsym.com`
11168 cppccsymbols=`echo $cppccsymbols`
11170 if $test -s ccsym.cpp; then
11171 $test "$also" && echo " "
11172 echo "Your C pre-processor ${also}defines the following symbols:"
11173 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
11175 $test "$silent" || sleep 1
11176 cppsymbols=`$cat ccsym.cpp`
11177 cppsymbols=`echo $cppsymbols`
11179 if $test -s ccsym.own; then
11180 $test "$also" && echo " "
11181 echo "Your C compiler ${also}defines the following cpp symbols:"
11182 $sed -e 's/\(.*\)=1/\1/' ccsym.own
11183 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
11184 $test "$silent" || sleep 1
11185 ccsymbols=`$cat ccsym.own`
11186 ccsymbols=`echo $ccsymbols`
11191 : see if this is a termio system
11195 if $test `./findhdr termios.h`; then
11196 set tcsetattr i_termios
11202 "$define") echo "You have POSIX termios.h... good!" >&4;;
11203 *) if ./Cppsym pyr; then
11204 case "`/bin/universe`" in
11205 ucb) if $test `./findhdr sgtty.h`; then
11207 echo "<sgtty.h> found." >&4
11209 echo "System is pyramid with BSD universe."
11210 echo "<sgtty.h> not found--you could have problems." >&4
11212 *) if $test `./findhdr termio.h`; then
11214 echo "<termio.h> found." >&4
11216 echo "System is pyramid with USG universe."
11217 echo "<termio.h> not found--you could have problems." >&4
11221 if $test `./findhdr termio.h`; then
11222 echo "<termio.h> found." >&4
11224 elif $test `./findhdr sgtty.h`; then
11225 echo "<sgtty.h> found." >&4
11228 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
11231 if $test `./findhdr sgtty.h`; then
11232 echo "<sgtty.h> found." >&4
11234 elif $test `./findhdr termio.h`; then
11235 echo "<termio.h> found." >&4
11238 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
11242 set i_termio; eval $setvar
11243 val=$val2; set i_sgtty; eval $setvar
11244 val=$val3; set i_termios; eval $setvar
11246 : see if stdarg is available
11248 if $test `./findhdr stdarg.h`; then
11249 echo "<stdarg.h> found." >&4
11252 echo "<stdarg.h> NOT found." >&4
11256 : see if varags is available
11258 if $test `./findhdr varargs.h`; then
11259 echo "<varargs.h> found." >&4
11261 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11264 : set up the varargs testing programs
11265 $cat > varargs.c <<EOP
11267 #include <stdarg.h>
11270 #include <varargs.h>
11274 int f(char *p, ...)
11288 p = va_arg(ap, char *);
11293 $cat > varargs <<EOP
11295 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11304 : now check which varargs header should be included
11309 if `./varargs I_STDARG`; then
11311 elif `./varargs I_VARARGS`; then
11316 if `./varargs I_VARARGS`; then
11323 echo "I could not find the definition for va_dcl... You have problems..." >&4
11324 val="$undef"; set i_stdarg; eval $setvar
11325 val="$undef"; set i_varargs; eval $setvar
11330 case "$i_varhdr" in
11332 val="$define"; set i_stdarg; eval $setvar
11333 val="$undef"; set i_varargs; eval $setvar
11336 val="$undef"; set i_stdarg; eval $setvar
11337 val="$define"; set i_varargs; eval $setvar
11340 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11344 : see if stddef is available
11345 set stddef.h i_stddef
11348 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
11349 set sys/filio.h i_sysfilio
11352 if $test `./findhdr sys/ioctl.h`; then
11354 echo '<sys/ioctl.h> found.' >&4
11357 if $test $i_sysfilio = "$define"; then
11358 echo '<sys/ioctl.h> NOT found.' >&4
11360 $test $i_sgtty = "$define" && xxx="sgtty.h"
11361 $test $i_termio = "$define" && xxx="termio.h"
11362 $test $i_termios = "$define" && xxx="termios.h"
11363 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
11369 : see if sys/resource.h has to be included
11370 set sys/resource.h i_sysresrc
11373 : see if this is a sys/un.h system
11374 set sys/un.h i_sysun
11377 : see if this is a syswait system
11378 set sys/wait.h i_syswait
11381 : see if this is an utime system
11382 set utime.h i_utime
11385 : see if this is a values.h system
11386 set values.h i_values
11389 : see if this is a vfork system
11392 set vfork.h i_vfork
11400 : see if gdbm.h is available
11405 : see if gdbm_open exists
11406 set gdbm_open d_gdbm_open
11408 case "$d_gdbm_open" in
11411 echo "We won't be including <gdbm.h>"
11421 echo "Looking for extensions..." >&4
11424 : If we are using the old config.sh, known_extensions may contain
11425 : old or inaccurate or duplicate values.
11426 known_extensions=''
11427 nonxs_extensions=''
11428 : We do not use find because it might not be available.
11429 : We do not just use MANIFEST because the user may have dropped
11430 : some additional extensions into the source tree and expect them
11434 DynaLoader|dynaload) ;;
11435 *) if $test -f $xxx/$xxx.xs; then
11436 known_extensions="$known_extensions $xxx"
11437 elif $test -f $xxx/Makefile.PL; then
11438 nonxs_extensions="$nonxs_extensions $xxx"
11440 if $test -d $xxx; then
11441 # Look for nested extensions, eg. Devel/Dprof.
11444 if $test -f $yyy/$yyy.xs; then
11445 known_extensions="$known_extensions $xxx/$yyy"
11446 elif $test -f $yyy/Makefile.PL; then
11447 nonxs_extensions="$nonxs_extensions $xxx/$yyy"
11456 set X $nonxs_extensions
11458 nonxs_extensions="$*"
11459 set X $known_extensions
11461 known_extensions="$*"
11464 : Now see which are supported on this system.
11466 for xxx in $known_extensions ; do
11470 $define) avail_ext="$avail_ext $xxx" ;;
11473 GDBM_File|gdbm_fil)
11475 $define) avail_ext="$avail_ext $xxx" ;;
11478 NDBM_File|ndbm_fil)
11480 $define) avail_ext="$avail_ext $xxx" ;;
11483 ODBM_File|odbm_fil)
11484 case "${i_dbm}${i_rpcsvcdbm}" in
11485 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
11489 case "$useposix" in
11490 true|define|y) avail_ext="$avail_ext $xxx" ;;
11494 case "$useopcode" in
11495 true|define|y) avail_ext="$avail_ext $xxx" ;;
11499 case "$d_socket" in
11500 true|$define|y) avail_ext="$avail_ext $xxx" ;;
11504 case "$usethreads" in
11505 true|$define|y) avail_ext="$avail_ext $xxx" ;;
11509 : XXX Do we need a useipcsysv variable here
11510 case "${d_msg}${d_sem}${d_shm}" in
11511 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
11514 *) avail_ext="$avail_ext $xxx"
11523 : Now see which nonxs extensions are supported on this system.
11524 : For now assume all are.
11526 for xxx in $nonxs_extensions ; do
11528 *) nonxs_ext="$nonxs_ext $xxx"
11540 A number of extensions are supplied with $package. You may choose to
11541 compile these extensions for dynamic loading (the default), compile
11542 them into the $package executable (static loading), or not include
11543 them at all. Answer "none" to include no extensions.
11544 Note that DynaLoader is always built and need not be mentioned here.
11547 case "$dynamic_ext" in
11548 '') dflt="$avail_ext" ;;
11549 *) dflt="$dynamic_ext"
11550 # Perhaps we are reusing an old out-of-date config.sh.
11553 if test X"$dynamic_ext" != X"$avail_ext"; then
11555 NOTICE: Your previous config.sh list may be incorrect.
11556 The extensions now available to you are
11558 but the default list from your previous config.sh is
11570 rp="What extensions do you wish to load dynamically?"
11573 none) dynamic_ext=' ' ;;
11574 *) dynamic_ext="$ans" ;;
11577 case "$static_ext" in
11579 : Exclude those already listed in dynamic linking
11581 for xxx in $avail_ext; do
11582 case " $dynamic_ext " in
11584 *) dflt="$dflt $xxx" ;;
11591 *) dflt="$static_ext"
11598 rp="What extensions do you wish to load statically?"
11601 none) static_ext=' ' ;;
11602 *) static_ext="$ans" ;;
11607 A number of extensions are supplied with $package. Answer "none"
11608 to include no extensions.
11609 Note that DynaLoader is always built and need not be mentioned here.
11612 case "$static_ext" in
11613 '') dflt="$avail_ext" ;;
11614 *) dflt="$static_ext"
11615 # Perhaps we are reusing an old out-of-date config.sh.
11618 if test X"$static_ext" != X"$avail_ext"; then
11620 NOTICE: Your previous config.sh list may be incorrect.
11621 The extensions now available to you are
11623 but the default list from your previous config.sh is
11632 : Exclude those that are not xs extensions
11636 rp="What extensions do you wish to include?"
11639 none) static_ext=' ' ;;
11640 *) static_ext="$ans" ;;
11645 set X $dynamic_ext $static_ext $nonxs_ext
11649 : Remove build directory name from cppstdin so it can be used from
11650 : either the present location or the final installed location.
11652 : Get out of the UU directory to get correct path name.
11654 case "$cppstdin" in
11656 echo "Stripping down cppstdin path name"
11662 : end of configuration questions
11664 echo "End of configuration questions."
11667 : back to where it started
11668 if test -d ../UU; then
11672 : configuration may be patched via a 'config.over' file
11673 if $test -f config.over; then
11676 rp='I see a config.over file. Do you wish to load it?'
11679 n*) echo "OK, I'll ignore it.";;
11681 echo "Configuration override changes have been loaded."
11686 : in case they want portability, strip down executable paths
11687 case "$d_portable" in
11690 echo "Stripping down executable paths..." >&4
11691 for file in $loclist $trylist; do
11692 if test X$file != Xln -a X$file != Xar -o X$osname != Xos2; then
11693 eval $file="\$file"
11699 : create config.sh file
11701 echo "Creating config.sh..." >&4
11702 $spitshell <<EOT >config.sh
11705 # This file was produced by running the Configure script. It holds all the
11706 # definitions figured out by Configure. Should you modify one of these values,
11707 # do not forget to propagate your changes by running "Configure -der". You may
11708 # instead choose to run each of the .SH files by yourself, or "Configure -S".
11711 # Package name : $package
11712 # Source directory : $src
11713 # Configuration time: $cf_time
11714 # Configured by : $cf_by
11715 # Target system : $myuname
11725 Revision='$Revision'
11732 alignbytes='$alignbytes'
11733 ansi2knr='$ansi2knr'
11734 aphostname='$aphostname'
11735 apiversion='$apiversion'
11738 archlibexp='$archlibexp'
11739 archname='$archname'
11740 archobjs='$archobjs'
11748 byteorder='$byteorder'
11750 castflags='$castflags'
11753 cccdlflags='$cccdlflags'
11754 ccdlflags='$ccdlflags'
11756 ccsymbols='$ccsymbols'
11758 cf_email='$cf_email'
11763 clocktype='$clocktype'
11765 compress='$compress'
11766 contains='$contains'
11770 cpp_stuff='$cpp_stuff'
11771 cppflags='$cppflags'
11773 cppminus='$cppminus'
11775 cppstdin='$cppstdin'
11776 cppsymbols='$cppsymbols'
11777 cppccsymbols='$cppccsymbols'
11778 cryptlib='$cryptlib'
11780 d_Gconvert='$d_Gconvert'
11781 d_access='$d_access'
11783 d_archlib='$d_archlib'
11784 d_attribut='$d_attribut'
11788 d_bsdgetpgrp='$d_bsdgetpgrp'
11789 d_bsdsetpgrp='$d_bsdsetpgrp'
11791 d_casti32='$d_casti32'
11792 d_castneg='$d_castneg'
11793 d_charvspr='$d_charvspr'
11795 d_chroot='$d_chroot'
11796 d_chsize='$d_chsize'
11797 d_closedir='$d_closedir'
11801 d_cuserid='$d_cuserid'
11802 d_dbl_dig='$d_dbl_dig'
11803 d_difftime='$d_difftime'
11804 d_dirnamlen='$d_dirnamlen'
11805 d_dlerror='$d_dlerror'
11806 d_dlopen='$d_dlopen'
11807 d_dlsymun='$d_dlsymun'
11808 d_dosuid='$d_dosuid'
11810 d_endgrent='$d_endgrent'
11811 d_endhent='$d_endhent'
11812 d_endnent='$d_endnent'
11813 d_endpent='$d_endpent'
11814 d_endpwent='$d_endpwent'
11815 d_endsent='$d_endsent'
11816 d_eofnblk='$d_eofnblk'
11817 d_eunice='$d_eunice'
11818 d_fchmod='$d_fchmod'
11819 d_fchown='$d_fchown'
11821 d_fd_macros='$d_fd_macros'
11822 d_fd_set='$d_fd_set'
11823 d_fds_bits='$d_fds_bits'
11824 d_fgetpos='$d_fgetpos'
11825 d_flexfnam='$d_flexfnam'
11828 d_fpathconf='$d_fpathconf'
11829 d_fsetpos='$d_fsetpos'
11830 d_fstatfs='$d_fstatfs'
11831 d_statfsflags='$d_statfsflags'
11832 d_fstatvfs='$d_fstatvfs'
11833 d_getmntent='$d_getmntent'
11834 d_hasmntopt='$d_hasmntopt'
11836 d_getgrent='$d_getgrent'
11837 d_getgrps='$d_getgrps'
11838 d_gethbyaddr='$d_gethbyaddr'
11839 d_gethbyname='$d_gethbyname'
11840 d_gethent='$d_gethent'
11841 d_gethname='$d_gethname'
11842 d_gethostprotos='$d_gethostprotos'
11843 d_getlogin='$d_getlogin'
11844 d_getnbyaddr='$d_getnbyaddr'
11845 d_getnbyname='$d_getnbyname'
11846 d_getnent='$d_getnent'
11847 d_getnetprotos='$d_getnetprotos'
11848 d_getpbyname='$d_getpbyname'
11849 d_getpbynumber='$d_getpbynumber'
11850 d_getpent='$d_getpent'
11851 d_getpgid='$d_getpgid'
11852 d_getpgrp2='$d_getpgrp2'
11853 d_getpgrp='$d_getpgrp'
11854 d_getppid='$d_getppid'
11855 d_getprior='$d_getprior'
11856 d_getprotoprotos='$d_getprotoprotos'
11857 d_getpwent='$d_getpwent'
11858 d_getsbyname='$d_getsbyname'
11859 d_getsbyport='$d_getsbyport'
11860 d_getsent='$d_getsent'
11861 d_getservprotos='$d_getservprotos'
11862 d_gettimeod='$d_gettimeod'
11863 d_gnulibc='$d_gnulibc'
11864 d_grpasswd='$d_grpasswd'
11867 d_inetaton='$d_inetaton'
11868 d_isascii='$d_isascii'
11869 d_killpg='$d_killpg'
11870 d_lchown='$d_lchown'
11872 d_locconv='$d_locconv'
11874 d_longdbl='$d_longdbl'
11875 d_longlong='$d_longlong'
11878 d_mbstowcs='$d_mbstowcs'
11879 d_mbtowc='$d_mbtowc'
11880 d_memcmp='$d_memcmp'
11881 d_memcpy='$d_memcpy'
11882 d_memmove='$d_memmove'
11883 d_memset='$d_memset'
11885 d_mkfifo='$d_mkfifo'
11886 d_mktime='$d_mktime'
11888 d_msgctl='$d_msgctl'
11889 d_msgget='$d_msgget'
11890 d_msgrcv='$d_msgrcv'
11891 d_msgsnd='$d_msgsnd'
11892 d_mymalloc='$d_mymalloc'
11894 d_oldpthreads='$d_oldpthreads'
11895 d_oldsock='$d_oldsock'
11897 d_pathconf='$d_pathconf'
11899 d_phostname='$d_phostname'
11902 d_portable='$d_portable'
11903 d_pthread_yield='$d_pthread_yield'
11904 d_pthreads_created_joinable='$d_pthreads_created_joinable'
11906 d_pwchange='$d_pwchange'
11907 d_pwclass='$d_pwclass'
11908 d_pwcomment='$d_pwcomment'
11909 d_pwexpire='$d_pwexpire'
11910 d_pwgecos='$d_pwgecos'
11911 d_pwquota='$d_pwquota'
11912 d_pwpasswd='$d_pwpasswd'
11913 d_readdir='$d_readdir'
11914 d_readlink='$d_readlink'
11915 d_rename='$d_rename'
11916 d_rewinddir='$d_rewinddir'
11918 d_safebcpy='$d_safebcpy'
11919 d_safemcpy='$d_safemcpy'
11920 d_sanemcmp='$d_sanemcmp'
11921 d_sched_yield='$d_sched_yield'
11922 d_seekdir='$d_seekdir'
11923 d_select='$d_select'
11925 d_semctl='$d_semctl'
11926 d_semctl_semid_ds='$d_semctl_semid_ds'
11927 d_semctl_semun='$d_semctl_semun'
11928 d_semget='$d_semget'
11930 d_setegid='$d_setegid'
11931 d_seteuid='$d_seteuid'
11932 d_setgrent='$d_setgrent'
11933 d_setgrps='$d_setgrps'
11934 d_sethent='$d_sethent'
11935 d_setlinebuf='$d_setlinebuf'
11936 d_setlocale='$d_setlocale'
11937 d_setnent='$d_setnent'
11938 d_setpent='$d_setpent'
11939 d_setpgid='$d_setpgid'
11940 d_setpgrp2='$d_setpgrp2'
11941 d_setpgrp='$d_setpgrp'
11942 d_setprior='$d_setprior'
11943 d_setpwent='$d_setpwent'
11944 d_setregid='$d_setregid'
11945 d_setresgid='$d_setresgid'
11946 d_setresuid='$d_setresuid'
11947 d_setreuid='$d_setreuid'
11948 d_setrgid='$d_setrgid'
11949 d_setruid='$d_setruid'
11950 d_setsent='$d_setsent'
11951 d_setsid='$d_setsid'
11952 d_setvbuf='$d_setvbuf'
11956 d_shmatprototype='$d_shmatprototype'
11957 d_shmctl='$d_shmctl'
11959 d_shmget='$d_shmget'
11960 d_sigaction='$d_sigaction'
11961 d_sigsetjmp='$d_sigsetjmp'
11962 d_socket='$d_socket'
11963 d_sockpair='$d_sockpair'
11964 d_statblks='$d_statblks'
11965 d_stdio_cnt_lval='$d_stdio_cnt_lval'
11966 d_stdio_ptr_lval='$d_stdio_ptr_lval'
11967 d_stdiobase='$d_stdiobase'
11968 d_stdstdio='$d_stdstdio'
11969 d_strchr='$d_strchr'
11970 d_strcoll='$d_strcoll'
11971 d_strctcpy='$d_strctcpy'
11972 d_strerrm='$d_strerrm'
11973 d_strerror='$d_strerror'
11974 d_strtod='$d_strtod'
11975 d_strtol='$d_strtol'
11976 d_strtoul='$d_strtoul'
11977 d_strxfrm='$d_strxfrm'
11978 d_suidsafe='$d_suidsafe'
11979 d_symlink='$d_symlink'
11980 d_syscall='$d_syscall'
11981 d_sysconf='$d_sysconf'
11982 d_sysernlst='$d_sysernlst'
11983 d_syserrlst='$d_syserrlst'
11984 d_system='$d_system'
11985 d_tcgetpgrp='$d_tcgetpgrp'
11986 d_tcsetpgrp='$d_tcsetpgrp'
11987 d_telldir='$d_telldir'
11990 d_truncate='$d_truncate'
11991 d_tzname='$d_tzname'
11994 d_union_semun='$d_union_semun'
11996 d_void_closedir='$d_void_closedir'
11997 d_voidsig='$d_voidsig'
11998 d_voidtty='$d_voidtty'
11999 d_volatile='$d_volatile'
12000 d_vprintf='$d_vprintf'
12002 d_waitpid='$d_waitpid'
12003 d_wcstombs='$d_wcstombs'
12004 d_wctomb='$d_wctomb'
12007 db_hashtype='$db_hashtype'
12008 db_prefixtype='$db_prefixtype'
12009 defvoidused='$defvoidused'
12010 direntrytype='$direntrytype'
12013 doublesize='$doublesize'
12014 dynamic_ext='$dynamic_ext'
12020 eunicefix='$eunicefix'
12023 extensions='$extensions'
12025 firstmakefile='$firstmakefile'
12027 fpostype='$fpostype'
12028 freetype='$freetype'
12030 full_csh='$full_csh'
12031 full_sed='$full_sed'
12032 gccversion='$gccversion'
12036 groupcat='$groupcat'
12037 groupstype='$groupstype'
12040 h_sysfile='$h_sysfile'
12044 i_arpainet='$i_arpainet'
12045 i_bsdioctl='$i_bsdioctl'
12048 i_dirent='$i_dirent'
12055 i_limits='$i_limits'
12056 i_locale='$i_locale'
12057 i_malloc='$i_malloc'
12058 i_machcthreads='$i_machcthreads'
12060 i_memory='$i_memory'
12061 i_mntent='$i_mntent'
12064 i_neterrno='$i_neterrno'
12067 i_pthread='$i_pthread'
12068 i_rpcsvcdbm='$i_rpcsvcdbm'
12071 i_stdarg='$i_stdarg'
12072 i_stddef='$i_stddef'
12073 i_stdlib='$i_stdlib'
12074 i_string='$i_string'
12075 i_sysdir='$i_sysdir'
12076 i_sysfile='$i_sysfile'
12077 i_sysfilio='$i_sysfilio'
12079 i_sysioctl='$i_sysioctl'
12080 i_sysmount='$i_sysmount'
12081 i_sysndir='$i_sysndir'
12082 i_sysparam='$i_sysparam'
12083 i_sysresrc='$i_sysresrc'
12084 i_sysselct='$i_sysselct'
12085 i_syssockio='$i_syssockio'
12086 i_sysstat='$i_sysstat'
12087 i_sysstatvfs='$i_sysstatvfs'
12088 i_systime='$i_systime'
12089 i_systimek='$i_systimek'
12090 i_systimes='$i_systimes'
12091 i_systypes='$i_systypes'
12093 i_syswait='$i_syswait'
12094 i_termio='$i_termio'
12095 i_termios='$i_termios'
12097 i_unistd='$i_unistd'
12099 i_values='$i_values'
12100 i_varargs='$i_varargs'
12101 i_varhdr='$i_varhdr'
12103 ignore_versioned_solibs='$ignore_versioned_solibs'
12106 installarchlib='$installarchlib'
12107 installbin='$installbin'
12108 installman1dir='$installman1dir'
12109 installman3dir='$installman3dir'
12110 installprivlib='$installprivlib'
12111 installscript='$installscript'
12112 installsitearch='$installsitearch'
12113 installsitelib='$installsitelib'
12114 installusrbinperl='$installusrbinperl'
12116 known_extensions='$known_extensions'
12120 lddlflags='$lddlflags'
12128 libswanted='$libswanted'
12134 locincpth='$locincpth'
12135 loclibpth='$loclibpth'
12136 longdblsize='$longdblsize'
12137 longlongsize='$longlongsize'
12138 longsize='$longsize'
12142 lseektype='$lseektype'
12146 make_set_make='$make_set_make'
12147 mallocobj='$mallocobj'
12148 mallocsrc='$mallocsrc'
12149 malloctype='$malloctype'
12151 man1direxp='$man1direxp'
12154 man3direxp='$man3direxp'
12158 mips_type='$mips_type'
12161 modetype='$modetype'
12164 myarchname='$myarchname'
12165 mydomain='$mydomain'
12166 myhostname='$myhostname'
12169 netdb_hlen_type='$netdb_hlen_type'
12170 netdb_host_type='$netdb_host_type'
12171 netdb_name_type='$netdb_name_type'
12172 netdb_net_type='$netdb_net_type'
12175 nm_so_opt='$nm_so_opt'
12176 nonxs_ext='$nonxs_ext'
12178 o_nonblock='$o_nonblock'
12180 optimize='$optimize'
12181 orderlib='$orderlib'
12187 patchlevel='$patchlevel'
12188 path_sep='$path_sep'
12190 perladmin='$perladmin'
12191 perlpath='$perlpath'
12193 phostname='$phostname'
12199 prefixexp='$prefixexp'
12201 privlibexp='$privlibexp'
12202 prototype='$prototype'
12204 randbits='$randbits'
12206 rd_nodata='$rd_nodata'
12210 scriptdir='$scriptdir'
12211 scriptdirexp='$scriptdirexp'
12213 selectminbits='$selectminbits'
12214 selecttype='$selecttype'
12215 sendmail='$sendmail'
12218 sharpbang='$sharpbang'
12219 shmattype='$shmattype'
12220 shortsize='$shortsize'
12223 sig_name='$sig_name'
12224 sig_name_init='$sig_name_init'
12226 sig_num_init='$sig_num_init'
12227 signal_t='$signal_t'
12228 sitearch='$sitearch'
12229 sitearchexp='$sitearchexp'
12231 sitelibexp='$sitelibexp'
12232 sizetype='$sizetype'
12237 sockethdr='$sockethdr'
12238 socketlib='$socketlib'
12240 spackage='$spackage'
12241 spitshell='$spitshell'
12244 ssizetype='$ssizetype'
12245 startperl='$startperl'
12247 static_ext='$static_ext'
12249 stdio_base='$stdio_base'
12250 stdio_bufsiz='$stdio_bufsiz'
12251 stdio_cnt='$stdio_cnt'
12252 stdio_filbuf='$stdio_filbuf'
12253 stdio_ptr='$stdio_ptr'
12256 subversion='$subversion'
12263 timeincl='$timeincl'
12264 timetype='$timetype'
12273 usemymalloc='$usemymalloc'
12275 useopcode='$useopcode'
12276 useperlio='$useperlio'
12277 useposix='$useposix'
12279 useshrplib='$useshrplib'
12280 usethreads='$usethreads'
12281 usevfork='$usevfork'
12286 voidflags='$voidflags'
12292 : Add in command line options if available
12293 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
12295 : add special variables
12296 $test -f $src/patchlevel.h && \
12297 awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
12298 echo "CONFIG=true" >>config.sh
12300 : propagate old symbols
12301 if $test -f UU/config.sh; then
12302 <UU/config.sh sort | uniq >UU/oldconfig.sh
12303 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
12304 sort | uniq -u >UU/oldsyms
12305 set X `cat UU/oldsyms`
12311 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
12313 echo "# Variables propagated from previous config.sh file." >>config.sh
12314 for sym in `cat UU/oldsyms`; do
12315 echo " Propagating $hint variable "'$'"$sym..."
12316 eval 'tmp="$'"${sym}"'"'
12318 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
12324 : Finish up by extracting the .SH files
12338 If you'd like to make any changes to the config.sh file before I begin
12339 to configure things, do it as a shell escape now (e.g. !vi config.sh).
12342 rp="Press return or use a shell escape to edit config.sh:"
12347 *) : in case they cannot read
12348 sh 1>&4 -c "$ans";;
12353 : if this fails, just run all the .SH files by hand
12360 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
12367 Now you need to generate make dependencies by running "make depend".
12368 You might prefer to run it in background: "make depend > makedepend.out &"
12369 It can take a while, so you might not want to run it right now.
12374 rp="Run make depend now?"
12378 make depend && echo "Now you must run a make."
12381 echo "You must run 'make depend' then 'make'."
12384 elif test -f [Mm]akefile; then
12386 echo "Now you must run a make."
12391 if $test -f Policy.sh; then
12394 If you compile $package on a different machine or from a different object
12395 directory, copy the Policy.sh file from this object directory to the
12396 new one before you run Configure -- this will help you with most of
12397 the policy defaults.
12401 if $test -f config.msg; then
12402 echo "Hmm. I also noted the following information while running:"
12404 $cat config.msg >&4
12407 $rm -f kit*isdone ark*isdone