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 Thu Nov 12 19:00:08 EET 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
412 d_pthread_create_joinable=''
413 pthread_create_joinable=''
645 ignore_versioned_solibs=''
770 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
773 : We must find out about Eunice early
775 if test -f /etc/unixtovms; then
776 eunicefix=/etc/unixtovms
778 if test -f /etc/unixtovms.exe; then
779 eunicefix=/etc/unixtovms.exe
783 : change the next line if compiling for Xenix/286 on Xenix/386
784 xlibpth='/usr/lib/386 /lib/386'
786 : Possible local library directories to search.
787 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
788 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
790 : general looking path for locating libraries
791 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
792 glibpth="$glibpth /lib /usr/lib $xlibpth"
793 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
794 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
796 : Private path used by Configure to find libraries. Its value
797 : is prepended to libpth. This variable takes care of special
798 : machines, like the mips. Usually, it should be empty.
801 : Possible local include directories to search.
802 : Set locincpth to "" in a hint file to defeat local include searches.
803 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
804 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
806 : no include file wanted by default
809 : list of known cpp symbols, sorted alphabetically
810 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
811 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
812 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
813 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
814 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
815 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
816 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
817 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
818 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
819 al="$al VMS Xenix286"
820 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
821 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
822 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
823 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
824 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
825 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
826 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
827 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
828 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
829 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
830 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
831 al="$al __SVR4_2__ __UMAXV__"
832 al="$al ____386BSD____ __alpha __alpha__ __amiga"
833 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
834 al="$al __host_mips__"
835 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
836 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
837 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
838 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
839 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
840 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
841 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
842 al="$al __mc88100 __mc88100__ __mips __mips__"
843 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
844 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
845 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
846 al="$al _host_mips _mips _unix"
847 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
848 al="$al apollo ardent att386 att3b"
849 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
850 al="$al cadmus clipper concurrent convex cray ctix"
851 al="$al dmert encore gcos gcx gimpel gould"
852 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
853 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
854 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
855 al="$al i186 i286 i386 i486 i8086"
856 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
857 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
858 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
859 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
860 al="$al mc88000 mc88100 merlin mert mips mvs n16"
861 al="$al ncl_el ncl_mr"
862 al="$al news1500 news1700 news1800 news1900 news3700"
863 al="$al news700 news800 news900 ns16000 ns32000"
864 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
865 al="$al parisc pc532 pdp11 plexus posix pyr"
866 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
867 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
868 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
869 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
870 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
871 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
874 : Trailing extension. Override this in a hint file, if needed.
876 : Extra object files, if any, needed on this platform.
879 : default library list
881 : some systems want to use only the non-versioned libso:s
882 ignore_versioned_solibs=''
883 : full support for void wanted by default
886 : set useposix=false in your hint file to disable the POSIX extension.
888 : set useopcode=false in your hint file to disable the Opcode extension.
890 : set usemultiplicity on the Configure command line to enable multiplicity.
891 : set usethreads on the Configure command line to enable threads.
892 : List of libraries we want.
893 : If anyone needs -lnet, put it in a hint file.
894 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
895 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
896 libswanted="$libswanted ucb bsd BSD PW x"
897 : We probably want to search /usr/shlib before most other libraries.
898 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
899 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
900 glibpth="/usr/shlib $glibpth"
901 : Do not use vfork unless overridden by a hint file.
904 : Find the basic shell for Bourne shell scripts
908 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
911 if test -f "$xxx"; then
914 : Build up a list and do a single loop so we can 'break' out.
915 pth=`echo $PATH | sed -e "s/$p_/ /g"`
916 for xxx in sh bash ksh pdksh ash; do
918 try="$try ${p}/${xxx}"
922 if test -f "$xxx"; then
925 elif test -f "$xxx.exe"; then
936 $me: Fatal Error: I can't find a Bourne Shell anywhere.
938 Usually it's in /bin/sh. How did you even get this far?
939 Please contact me (Jarkko Hietaniemi) at jhi@iki.fi and
940 we'll try to straighten this all out.
946 : see if sh knows # comments
947 if `$sh -c '#' >/dev/null 2>&1`; then
951 test -f $xcat || xcat=/usr/bin/cat
956 if test -s today; then
959 echo "#! $xcat" > try
963 if test -s today; then
971 echo "Your $sh doesn't grok # comments--I will strip them later on."
974 echo "exec grep -v '^[ ]*#'" >spitshell
977 spitshell=`pwd`/spitshell
979 echo "I presume that if # doesn't work, #! won't work either!"
984 : figure out how to guarantee sh startup
986 '') startsh=${sharpbang}${sh} ;;
998 : echo "Yup, it does."
1000 echo "Hmm... '$startsh' does not guarantee sh startup..."
1001 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1006 : Save command line options in file UU/cmdline.opt for later use in
1007 : generating config.sh.
1008 cat > cmdline.opt <<EOSH
1009 # Configure command line arguments.
1016 cat >>cmdline.opt <<EOSH
1017 config_arg$argn='$arg'
1019 argn=`expr $argn + 1`
1022 : produce awk script to parse command line options
1023 cat >options.awk <<'EOF'
1025 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
1027 len = length(optstr);
1028 for (i = 1; i <= len; i++) {
1029 c = substr(optstr, i, 1);
1030 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1041 if (substr(str, 1, 1) != "-") {
1042 printf("'%s'\n", str);
1046 for (i = 2; i <= len; i++) {
1047 c = substr(str, i, 1);
1049 printf("-%s\n", substr(str, i));
1055 printf("'%s'\n", substr(str, i + 1));
1068 : process the command line options
1069 set X `for arg in "$@"; do echo "X$arg"; done |
1070 sed -e s/X// | awk -f options.awk`
1075 : set up default values
1086 cat >optdef.sh <<EOS
1092 while test $# -gt 0; do
1094 -d) shift; fastread=yes;;
1095 -e) shift; alldone=cont;;
1099 if test -r "$1"; then
1102 echo "$me: cannot read config file $1." >&2
1107 -h) shift; error=true;;
1108 -r) shift; reuseval=true;;
1109 -s) shift; silent=true; realsilent=true;;
1110 -E) shift; alldone=exit;;
1111 -K) shift; knowitall=true;;
1112 -O) shift; override=true;;
1113 -S) shift; silent=true; extractsh=true;;
1118 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1119 echo "$me: ignoring -D $1" >&2
1122 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1123 *) echo "$1='define'" >> optdef.sh;;
1130 *=) echo "$1" >> optdef.sh;;
1132 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1133 echo "$me: ignoring -U $1" >&2
1135 *) echo "$1='undef'" >> optdef.sh;;
1139 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1142 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1150 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1151 [-U symbol] [-U symbol=]
1152 -d : use defaults for all answers.
1153 -e : go on without questioning past the production of config.sh.
1154 -f : specify an alternate default configuration file.
1155 -h : print this help message and exit (with an error status).
1156 -r : reuse C symbols value if possible (skips costly nm extraction).
1157 -s : silent mode, only echoes questions and essential information.
1158 -D : define symbol to have some value:
1159 -D symbol symbol gets the value 'define'
1160 -D symbol=value symbol gets the value 'value'
1161 -E : stop at the end of questions, after having produced config.sh.
1162 -K : do not use unless you know what you are doing.
1163 -O : let -D and -U override definitions from loaded configuration file.
1164 -S : perform variable substitutions on all .SH files (can mix with -f)
1165 -U : undefine symbol:
1166 -U symbol symbol gets the value 'undef'
1167 -U symbol= symbol gets completely empty
1168 -V : print version number and exit (with a zero status).
1175 case "$fastread$alldone" in
1178 if test ! -t 0; then
1179 echo "Say 'sh Configure', not 'sh <Configure'"
1187 true) exec 1>/dev/null;;
1190 : run the defines and the undefines, if any, but leave the file out there...
1196 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1197 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1198 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1199 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1200 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1203 : Some greps do not return status, grrr.
1204 echo "grimblepritz" >grimble
1205 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1207 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1213 : the following should work in any shell
1217 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1218 cat >contains <<'EOSS'
1219 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1224 : Find the path to the source tree
1227 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
1238 if test -f $rsrc/Configure && \
1239 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1241 : found it, so we are ok.
1244 for src in . .. ../.. ../../.. ../../../..; do
1245 if test -f ../$src/Configure && \
1246 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1257 Sorry, I can't seem to locate the source dir for $package. Please start
1258 Configure with an explicit path -- i.e. /some/path/Configure.
1266 echo "Sources for $package found in \"$src\"." >&4
1270 : script used to extract .SH files with variable substitutions
1271 cat >extract <<'EOS'
1273 echo "Doing variable substitutions on .SH files..."
1274 if test -f $src/MANIFEST; then
1275 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1277 echo "(Looking for .SH files under the source directory.)"
1278 set x `(cd $src; find . -name "*.SH" -print)`
1282 0) set x `(cd $src; echo *.SH)`; shift;;
1284 if test ! -f $src/$1; then
1290 while test $name; do
1291 if test ! -d "$name"; then
1292 create="$name $create";
1293 name=`echo $name | sed -e "s|^[^/]*$||"`;
1294 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1299 for file in $create; do
1308 dir=`expr X$file : 'X\(.*\)/'`
1309 file=`expr X$file : 'X.*/\(.*\)'`
1310 (cd $dir && . ./$file)
1320 dir=`expr X$file : 'X\(.*\)/'`
1321 file=`expr X$file : 'X.*/\(.*\)'`
1322 (set x $dir; shift; eval $mkdir_p)
1332 if test -f $src/config_h.SH; then
1333 if test ! -f config.h; then
1334 : oops, they left it out of MANIFEST, probably, so do it anyway.
1340 : extract files and exit if asked to do so
1341 case "$extractsh" in
1343 case "$realsilent" in
1347 case "$config_sh" in
1348 '') config_sh='config.sh';;
1351 echo "Fetching answers from $config_sh..."
1354 test "$override" && . ./optdef.sh
1363 : Eunice requires " " instead of "", can you believe it
1366 echo "Beginning of configuration questions for $package."
1368 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1370 : first determine how to suppress newline on echo command
1372 echo "Checking echo to see how to suppress newlines..."
1373 (echo "hi there\c" ; echo " ") >.echotmp
1374 if $contains c .echotmp >/dev/null 2>&1 ; then
1385 echo $n "The star should be here-->$c"
1389 : Now test for existence of everything in MANIFEST
1391 if test -f $rsrc/MANIFEST; then
1392 echo "First let's make sure your kit is complete. Checking..." >&4
1393 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1396 for filelist in x??; do
1397 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1399 if test -s missing; then
1403 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1405 You have the option of continuing the configuration process, despite the
1406 distinct possibility that your kit is damaged, by typing 'y'es. If you
1407 do, don't blame me if something goes wrong. I advise you to type 'n'o
1408 and contact the author (jhi@iki.fi).
1411 echo $n "Continue? [n] $c" >&4
1415 echo "Continuing..." >&4
1419 echo "ABORTING..." >&4
1424 echo "Looks good..."
1427 echo "There is no MANIFEST file. I hope your kit is complete !"
1432 : Find the appropriate value for a newline for tr
1433 if test -n "$DJGPP"; then
1436 if test X"$trnl" = X; then
1437 case "`echo foo|tr '\n' x 2>/dev/null`" in
1441 if test X"$trnl" = X; then
1442 case "`echo foo|tr '\012' x 2>/dev/null`" in
1443 foox) trnl='\012' ;;
1446 if test X"$trnl" = X; then
1449 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1455 : compute the number of columns on the terminal for proper question formatting
1460 : set up the echo used in my read
1461 myecho="case \"\$xxxm\" in
1462 '') echo $n \"\$rp $c\" >&4;;
1464 '') echo $n \"[\$xxxm] $c\";;
1466 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1468 echo $n \"[\$xxxm] $c\" >&4
1470 echo $n \"\$rp [\$xxxm] $c\" >&4
1476 : now set up to do reads with possible shell escape and default assignment
1482 case "\$fastread" in
1483 yes) case "\$dflt" in
1486 case "\$silent-\$rp" in
1491 *) case "\$silent" in
1492 true) case "\$rp" in
1497 while expr "X\$ans" : "X!" >/dev/null; do
1501 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1509 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1518 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1523 echo "(OK, I'll run with -d after this question.)" >&4
1526 echo "*** Sorry, \$1 not supported yet." >&4
1536 echo "*** Substitution done -- please confirm."
1538 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1543 echo "*** Error -- try again."
1550 case "\$ans\$xxxm\$nostick" in
1562 : create .config dir to save info across Configure sessions
1563 test -d ../.config || mkdir ../.config
1564 cat >../.config/README <<EOF
1565 This directory created by Configure to save information that should
1566 persist across sessions for $package.
1568 You may safely delete it if you wish.
1571 : general instructions
1574 user=`(logname) 2>/dev/null`
1576 '') user=`whoami 2>&1`;;
1578 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1581 rp='Would you like to see the instructions?'
1592 This installation shell script will examine your system and ask you questions
1593 to determine how the perl5 package should be installed. If you get
1594 stuck on a question, you may use a ! shell escape to start a subshell or
1595 execute a command. Many of the questions will have default answers in square
1596 brackets; typing carriage return will give you the default.
1598 On some of the questions which ask for file or directory names you are allowed
1599 to use the ~name construct to specify the login directory belonging to "name",
1600 even if you don't have a shell which knows about that. Questions where this is
1601 allowed will be marked "(~name ok)".
1605 dflt='Type carriage return to continue'
1609 The prompter used in this script allows you to use shell variables and
1610 backticks in your answers. You may use $1, $2, etc... to refer to the words
1611 in the default answer, as if the default line was a set of arguments given to a
1612 script shell. This means you may also use $* to repeat the whole default line,
1613 so you do not have to re-type everything to add something to the default.
1615 Everytime there is a substitution, you will have to confirm. If there is an
1616 error (e.g. an unmatched backtick), the default answer will remain unchanged
1617 and you will be prompted again.
1619 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1620 the questions and use the computed defaults (or the previous answers if there
1621 was already a config.sh file). Type 'Configure -h' for a list of options.
1622 You may also start interactively and then answer '& -d' at any prompt to turn
1623 on the non-interactive behaviour for the remainder of the execution.
1629 Much effort has been expended to ensure that this shell script will run on any
1630 Unix system. If despite that it blows up on yours, your best bet is to edit
1631 Configure and run it again. If you can't run Configure for some reason,
1632 you'll have to generate a config.sh file by hand. Whatever problems you
1633 have, let me (jhi@iki.fi) know how I blew it.
1635 This installation script affects things in two ways:
1637 1) it may do direct variable substitutions on some of the files included
1639 2) it builds a config.h file for inclusion in C programs. You may edit
1640 any of these files as the need arises after running this script.
1642 If you make a mistake on a question, there is no easy way to back up to it
1643 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1644 files. Configure will offer to let you do this before it runs the SH files.
1647 dflt='Type carriage return to continue'
1649 case "$firsttime" in
1650 true) echo $user >>../.config/instruct;;
1654 : find out where common programs are
1656 echo "Locating common programs..." >&4
1669 if test -d \$dir/\$thing; then
1675 for thisthing in \$dir/\$thing; do
1676 : just loop through to pick last item
1678 if test -f \$thisthing; then
1681 elif test -f \$dir/\$thing.exe; then
1682 if test -n "$DJGPP"; then
1683 echo \$dir/\$thing.exe
1685 : on Eunice apparently
1736 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1737 pth="$pth /lib /usr/lib"
1738 for file in $loclist; 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 know where '$file' is, and my life depends on it." >&4
1763 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1769 echo "Don't worry if any of the following aren't found..."
1771 for file in $trylist; do
1775 if test -f "$xxx"; then
1778 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1779 xxx=`./loc $file $file $pth`
1782 '') xxx=`./loc $file $file $pth`;;
1783 *) xxx=`./loc $xxx $xxx $pth`;;
1789 echo $file is in $xxx.
1792 echo $file is in $xxx.
1795 echo "I don't see $file out there, $say."
1802 echo "Substituting grep for egrep."
1808 echo "Substituting cp for ln."
1814 echo "Hopefully test is built into your sh."
1817 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1818 echo "Using the test built into your sh."
1826 echo "Hopefully echo is built into your sh."
1831 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1832 $echo $n "hi there$c" >foo1
1833 echo $n "hi there$c" >foo2
1834 if cmp foo1 foo2 >/dev/null 2>&1; then
1835 echo "They are compatible. In fact, they may be identical."
1842 They are not compatible! You are probably running ksh on a non-USG system.
1843 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1844 have echo built in and we may have to run some Bourne shell scripts. That
1845 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1848 $echo $n "The star should be here-->$c"
1855 : determine whether symbolic links are supported
1858 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1859 echo "Symbolic links are supported." >&4
1862 echo "Symbolic links are NOT supported." >&4
1867 : see whether [:lower:] and [:upper:] are supported character classes
1869 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1871 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1875 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
1876 # (0xc9 and 0xd1), therefore that is a nice testing point.
1877 if test "X$up" = X -o "X$low" = X; then
1878 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
1884 if test "X$up" = X -o "X$low" = X; then
1885 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
1891 if test "X$up" = X -o "X$low" = X; then
1892 case "`echo IJ | od -x 2>/dev/null`" in
1894 echo "Hey, this might be EBCDIC." >&4
1895 if test "X$up" = X -o "X$low" = X; then
1896 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
1897 ij) up='[A-IJ-RS-Z]'
1902 if test "X$up" = X -o "X$low" = X; then
1903 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
1913 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
1915 echo "Using $up and $low to convert case." >&4
1918 echo "I don't know how to translate letters from upper to lower case." >&4
1919 echo "Your tr is not acting any way I know of." >&4
1923 : set up the translation script tr, must be called with ./tr of course
1927 '[A-Z][a-z]') exec $tr '$up' '$low';;
1928 '[a-z][A-Z]') exec $tr '$low' '$up';;
1935 : Try to determine whether config.sh was made on this system
1936 case "$config_sh" in
1938 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1939 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
1940 # because the A-Z/a-z are not consecutive.
1941 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1942 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
1943 newmyuname="$myuname"
1945 case "$knowitall" in
1947 if test -f ../config.sh; then
1948 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1949 eval "`grep myuname= ../config.sh`"
1951 if test "X$myuname" = "X$newmyuname"; then
1959 : Get old answers from old config file if Configure was run on the
1960 : same system, otherwise use the hints.
1963 if test -f config.sh; then
1965 rp="I see a config.sh file. Shall I use it to set the defaults?"
1968 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1969 *) echo "Fetching default answers from your old config.sh file..." >&4
1977 : Older versions did not always set $sh. Catch re-use of such
1986 if test ! -f config.sh; then
1989 First time through, eh? I have some defaults handy for some systems
1990 that need some extra help getting the Configure answers right:
1993 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
1995 : Half the following guesses are probably wrong... If you have better
1996 : tests or hints, please send them to jhi@iki.fi
1997 : The metaconfig authors would also appreciate a copy...
1998 $test -f /irix && osname=irix
1999 $test -f /xenix && osname=sco_xenix
2000 $test -f /dynix && osname=dynix
2001 $test -f /dnix && osname=dnix
2002 $test -f /lynx.os && osname=lynxos
2003 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2004 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2005 $test -f /bin/mips && /bin/mips && osname=mips
2006 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2007 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2008 $test -d /usr/apollo/bin && osname=apollo
2009 $test -f /etc/saf/_sactab && osname=svr4
2010 $test -d /usr/include/minix && osname=minix
2011 if $test -d /MachTen -o -d /MachTen_Folder; then
2013 if $test -x /sbin/version; then
2014 osvers=`/sbin/version | $awk '{print $2}' |
2015 $sed -e 's/[A-Za-z]$//'`
2016 elif $test -x /usr/etc/version; then
2017 osvers=`/usr/etc/version | $awk '{print $2}' |
2018 $sed -e 's/[A-Za-z]$//'`
2023 $test -f /sys/posix.dll &&
2024 $test -f /usr/bin/what &&
2025 set X `/usr/bin/what /sys/posix.dll` &&
2026 $test "$3" = UWIN &&
2029 if $test -f $uname; then
2037 umips) osname=umips ;;
2040 [23]100) osname=mips ;;
2041 next*) osname=next ;;
2043 if $test -f /etc/kconfig; then
2045 if test "$lns" = "ln -s"; then
2047 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2049 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2055 if test -n "$DJGPP"; then
2064 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2066 'not found') osvers="$4"."$3" ;;
2067 '<3240'|'<>3240') osvers=3.2.0 ;;
2068 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2069 '=3250'|'>3250') osvers=3.2.5 ;;
2073 *dc.osx) osname=dcosx
2079 domainos) osname=apollo
2085 dynixptx*) osname=dynixptx
2086 osvers=`echo "$4"|sed 's/^v//'`
2088 freebsd) osname=freebsd
2090 genix) osname=genix ;;
2092 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2108 netbsd*) osname=netbsd
2111 news-os) osvers="$3"
2113 4*) osname=newsos4 ;;
2117 bsd386) osname=bsd386
2120 POSIX-BC | posix-bc ) osname=posix-bc
2123 powerux | power_ux | powermax_os | powermaxos | \
2124 powerunix | power_unix) osname=powerux
2127 next*) osname=next ;;
2128 solaris) osname=solaris
2130 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2137 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2141 titanos) osname=titanos
2150 ultrix) osname=ultrix
2153 osf1|mls+) case "$5" in
2156 osvers=`echo "$3" | sed 's/^[xvt]//'`
2158 hp*) osname=hp_osf1 ;;
2159 mips) osname=mips_osf1 ;;
2168 $2) case "$osname" in
2172 : svr4.x or possibly later
2182 if test -f /stand/boot ; then
2183 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2184 if test -n "$INITPROG" -a -f "$INITPROG"; then
2185 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2186 if test -n "$isesix"; then
2194 *) if test -f /etc/systemid; then
2196 set `echo $3 | $sed 's/\./ /g'` $4
2197 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2199 elif $test -f $src/hints/sco_$1_$2.sh; then
2201 elif $test -f $src/hints/sco_$1.sh; then
2206 '') : Still unknown. Probably a generic Sys V.
2215 *) case "$osname" in
2216 '') : Still unknown. Probably a generic BSD.
2224 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2225 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2226 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2229 $rm -f UU/kernel.what
2230 elif test -d c:/.; then
2237 : Now look for a hint file osname_osvers, unless one has been
2238 : specified already.
2241 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2242 : Also try without trailing minor version numbers.
2243 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2244 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2245 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2246 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2249 *) case "$osvers" in
2252 *) if $test -f $src/hints/$file.sh ; then
2254 elif $test -f $src/hints/$xfile.sh ; then
2256 elif $test -f $src/hints/$xxfile.sh ; then
2258 elif $test -f $src/hints/$xxxfile.sh ; then
2260 elif $test -f $src/hints/$xxxxfile.sh ; then
2262 elif $test -f "$src/hints/${osname}.sh" ; then
2271 if $test -f Policy.sh ; then
2274 none) dflt="Policy" ;;
2275 *) dflt="Policy $dflt" ;;
2280 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2284 if $test -f Policy.sh ; then
2287 There's also a Policy hint file available, which should make the
2288 site-specific (policy) questions easier to answer.
2295 You may give one or more space-separated answers, or "none" if appropriate.
2296 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2297 is a good thing. DO NOT give a wrong version.
2301 rp="Which of these apply, if any?"
2304 for file in $tans; do
2305 if $test X$file = XPolicy -a -f Policy.sh; then
2307 $cat Policy.sh >> UU/config.sh
2308 elif $test -f $src/hints/$file.sh; then
2309 . $src/hints/$file.sh
2310 $cat $src/hints/$file.sh >> UU/config.sh
2311 elif $test X$tans = X -o X$tans = Xnone ; then
2314 : Give one chance to correct a possible typo.
2315 echo "$file.sh does not exist"
2317 rp="hint to use instead?"
2319 for file in $ans; do
2320 if $test -f "$src/hints/$file.sh"; then
2321 . $src/hints/$file.sh
2322 $cat $src/hints/$file.sh >> UU/config.sh
2323 elif $test X$ans = X -o X$ans = Xnone ; then
2326 echo "$file.sh does not exist -- ignored."
2333 : Remember our hint file for later.
2334 if $test -f "$src/hints/$file.sh" ; then
2344 echo "Fetching default answers from $config_sh..." >&4
2348 cp $config_sh config.sh 2>/dev/null
2358 test "$override" && . ./optdef.sh
2359 myuname="$newmyuname"
2361 : Restore computed paths
2362 for file in $loclist $trylist; do
2363 eval $file="\$_$file"
2368 Configure uses the operating system name and version to set some defaults.
2369 The default value is probably right if the name rings a bell. Otherwise,
2370 since spelling matters for me, either accept the default or answer "none"
2377 ''|' '|none) dflt=none ;;
2378 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2381 *) dflt="$osname" ;;
2383 rp="Operating system name?"
2387 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2393 ''|' '|none) dflt=none ;;
2394 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2395 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2397 ''|' ') dflt=none ;;
2402 *) dflt="$osvers" ;;
2404 rp="Operating system version?"
2411 : who configured the system
2412 cf_time=`LC_ALL=C; export LC_ALL; $date 2>&1`
2413 cf_by=`(logname) 2>/dev/null`
2416 cf_by=`(whoami) 2>/dev/null`
2418 "") cf_by=unknown ;;
2422 : set up the script used to warn in case of inconsistency
2429 echo "*** WHOA THERE!!! ***" >&4
2430 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2431 rp=" Keep the $hint value?"
2434 y) td=$was; tu=$was;;
2438 : function used to set $1 to $val
2439 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2441 $define$undef) . ./whoa; eval "$var=\$td";;
2442 $undef$define) . ./whoa; eval "$var=\$tu";;
2443 *) eval "$var=$val";;
2448 Perl can be built to take advantage of threads, on some systems.
2449 To do so, Configure must be run with -Dusethreads.
2450 (See README.threads for details.)
2452 case "$usethreads" in
2453 $define|true|[yY]*) dflt='y';;
2456 rp='Build a threading Perl?'
2459 y|Y) val="$define" ;;
2464 : Look for a hint-file generated 'call-back-unit'. Now that the
2465 : user has specified if a threading perl is to be built, we may need
2466 : to set or change some other defaults.
2467 if $test -f usethreads.cbu; then
2470 case "$d_oldpthreads" in
2471 '') : Configure tests would be welcome here. For now, assume undef.
2473 *) val="$d_oldpthreads" ;;
2480 Perl can be built so that multiple Perl interpreters can coexist
2481 within the same Perl executable. To do so, Configure must be run with
2484 Normally you do not need this and you should answer no.
2487 case "$usemultiplicity" in
2488 $define|true|[yY]*) dflt='y';;
2491 rp='Build Perl for multiplicity?'
2494 y|Y) val="$define" ;;
2502 Perl can be built to take advantage of explicit 64-bit interfaces,
2503 on some systems. To do so, Configure must be run with -Duse64bits.
2505 If this doesn't make any sense to you, just accept the default 'n'.
2507 case "$use64bits" in
2508 $define|true|[yY]*) dflt='y';;
2511 rp='Try to use explicit 64-bit interfaces, if available?'
2526 : determine the architecture name
2528 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
2529 tarch=`arch`"-$osname"
2530 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
2531 if uname -m > tmparch 2>&1 ; then
2532 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
2533 -e 's/$/'"-$osname/" tmparch`
2541 case "$myarchname" in
2544 echo "(Your architecture name used to be $myarchname.)"
2551 *) dflt="$archname";;
2553 rp='What is your architecture name'
2556 case "$usethreads" in
2558 echo "Threads selected." >&4
2560 *-thread*) echo "...and architecture name already has -thread." >&4
2562 *) archname="$archname-thread"
2563 echo "...setting architecture name to $archname." >&4
2568 case "$usemultiplicity" in
2570 echo "Multiplicity selected." >&4
2572 *-multi*) echo "...and architecture name already has -multi." >&4
2574 *) archname="$archname-multi"
2575 echo "...setting architecture name to $archname." >&4
2580 case "$use64bits" in
2582 echo "Explicit 64-bitness selected." >&4
2583 case "$archname64" in
2588 *-$archname64*) echo "...and architecture name already has $archname64." >&4
2590 *) archname="$archname-$archname64"
2591 echo "...setting architecture name to $archname." >&4
2601 $define|true) afs=true ;;
2602 $undef|false) afs=false ;;
2603 *) if test -d /afs; then
2611 echo "AFS may be running... I'll be extra cautious then..." >&4
2613 echo "AFS does not seem to be running..." >&4
2616 : decide how portable to be. Allow command line overrides.
2617 case "$d_portable" in
2619 *) d_portable="$define" ;;
2622 : set up shell script to do ~ expansion
2628 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2631 if $test -f /bin/csh; then
2632 /bin/csh -f -c "glob \$1"
2637 name=\`$expr x\$1 : '..\([^/]*\)'\`
2638 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2639 if $test ! -d "\$dir"; then
2641 echo "\$me: can't locate home directory for: \$name" >&2
2646 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2662 : now set up to get a file name
2666 cat <<'EOSC' >>getfile
2679 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
2680 fn=`echo $fn | sed 's/(.*)//'`
2686 loc_file=`expr $fn : '.*:\(.*\)'`
2687 fn=`expr $fn : '\(.*\):.*'`
2695 */*) fullpath=true;;
2704 *e*) exp_file=true;;
2707 *p*) nopath_ok=true;;
2712 *d*) type='Directory';;
2713 *l*) type='Locate';;
2718 Locate) what='File';;
2723 case "$d_portable" in
2731 while test "$type"; do
2736 true) rp="$rp (~name ok)";;
2739 if test -f UU/getfile.ok && \
2740 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2759 value=`UU/filexp $ans`
2762 if test "$ans" != "$value"; then
2763 echo "(That expands to $value on this system.)"
2777 /*) value="$ansexp" ;;
2782 echo "I shall only accept a full path name, as in /bin/ls." >&4
2783 echo "Use a ! shell escape if you wish to check pathnames." >&4
2786 echo "Please give a full path name, starting with slash." >&4
2789 echo "Note that using ~name is ok provided it expands well." >&4
2802 if test -f "$ansexp"; then
2804 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2806 echo "($value is not a plain file, but that's ok.)"
2811 if test -d "$ansexp"; then
2816 if test -d "$ansexp"; then
2817 echo "(Looking for $loc_file in directory $value.)"
2818 value="$value/$loc_file"
2819 ansexp="$ansexp/$loc_file"
2821 if test -f "$ansexp"; then
2824 case "$nopath_ok" in
2825 true) case "$value" in
2827 *) echo "Assuming $value will be in people's path."
2843 if test "$fastread" = yes; then
2848 rp="$what $value doesn't exist. Use that name anyway?"
2869 : determine root of directory hierarchy where package will be installed.
2872 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
2880 By default, $package will be installed in $dflt/bin, manual
2881 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2882 all installation directories. Typically set to /usr/local, but you
2883 may choose /usr if you wish to install $package among your system
2884 binaries. If you wish to have binaries under /bin but manual pages
2885 under /usr/local/man, that's ok: you will be prompted separately
2886 for each of the installation directories, the prefix being only used
2887 to set the defaults.
2891 rp='Installation prefix to use?'
2899 *) oldprefix="$prefix";;
2906 : set the prefixit variable, to compute a suitable default value
2907 prefixit='case "$3" in
2909 case "$oldprefix" in
2910 "") eval "$1=\"\$$2\"";;
2917 ""|" ") eval "$1=\"\$$2\"";;
2923 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
2925 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
2926 /*-$oldprefix/*|\~*-$oldprefix/*)
2927 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
2928 *) eval "$1=\"\$$2\"";;
2932 : set the base revision
2935 : get the patchlevel
2937 echo "Getting the current patchlevel..." >&4
2938 if $test -r $rsrc/patchlevel.h;then
2939 patchlevel=`awk '/define[ ]+PATCHLEVEL/ {print $3}' $rsrc/patchlevel.h`
2940 subversion=`awk '/define[ ]+SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
2945 $echo $n "(You have $package" $c
2948 *) $echo $n " $baserev" $c ;;
2950 $echo $n " patchlevel $patchlevel" $c
2951 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
2954 if test 0 -eq "$subversion"; then
2955 version=`LC_ALL=C; export LC_ALL; \
2956 echo $baserev $patchlevel | \
2957 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
2959 version=`LC_ALL=C; export LC_ALL; \
2960 echo $baserev $patchlevel $subversion | \
2961 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
2963 : Figure out perl API version. Perhaps this should be in patchlevel.h
2964 if test "$subversion" -lt 50; then
2965 apiversion=`LC_ALL=C; export LC_ALL; \
2966 echo $baserev $patchlevel | \
2967 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
2969 apiversion="$version"
2972 : determine where private library files go
2973 : Usual default is /usr/local/lib/perl5/$version.
2974 : Also allow things like /opt/perl/lib/$version, since
2975 : /opt/perl/lib/perl5... would be redundant.
2977 *perl*) set dflt privlib lib/$version ;;
2978 *) set dflt privlib lib/$package/$version ;;
2983 There are some auxiliary files for $package that need to be put into a
2984 private library directory that is accessible by everyone.
2988 rp='Pathname where the private library files will reside?'
2990 if $test "X$privlibexp" != "X$ansexp"; then
2994 privlibexp="$ansexp"
2998 Since you are running AFS, I need to distinguish the directory in which
2999 private files reside from the directory in which they are installed (and from
3000 which they are presumably copied to the former directory by occult means).
3003 case "$installprivlib" in
3004 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
3005 *) dflt="$installprivlib";;
3008 rp='Where will private files be installed?'
3010 installprivlib="$ans"
3012 installprivlib="$privlibexp"
3015 : set the prefixup variable, to restore leading tilda escape
3016 prefixup='case "$prefixexp" in
3018 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3021 : determine where public architecture dependent libraries go
3024 : privlib default is /usr/local/lib/$package/$version
3025 : archlib default is /usr/local/lib/$package/$version/$archname
3026 : privlib may have an optional trailing /share.
3027 tdflt=`echo $privlib | $sed 's,/share$,,'`
3028 tdflt=$tdflt/$archname
3037 $spackage contains architecture-dependent library files. If you are
3038 sharing libraries in a heterogeneous environment, you might store
3039 these files in a separate location. Otherwise, you can just include
3040 them with the rest of the public library files.
3044 rp='Where do you want to put the public architecture-dependent libraries?'
3047 archlibexp="$ansexp"
3052 Since you are running AFS, I need to distinguish the directory in
3053 which architecture-dependent library files reside from the directory
3054 in which they are installed (and from which they are presumably copied
3055 to the former directory by occult means).
3058 case "$installarchlib" in
3059 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
3060 *) dflt="$installarchlib";;
3063 rp='Where will architecture-dependent library files be installed?'
3065 installarchlib="$ans"
3067 installarchlib="$archlibexp"
3069 if $test X"$archlib" = X"$privlib"; then
3075 : make some quick guesses about what we are up against
3077 $echo $n "Hmm... $c"
3087 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3088 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3090 echo "Looks kind of like an OSF/1 system, but we'll see..."
3092 elif test `echo abc | tr a-z A-Z` = Abc ; then
3093 xxx=`./loc addbib blurfl $pth`
3094 if $test -f $xxx; then
3095 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3099 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3100 echo "Looks kind of like an extended USG system, but we'll see..."
3102 echo "Looks kind of like a USG system, but we'll see..."
3106 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3107 echo "Looks kind of like a BSD system, but we'll see..."
3111 echo "Looks kind of like a Version 7 system, but we'll see..."
3114 case "$eunicefix" in
3117 There is, however, a strange, musty smell in the air that reminds me of
3118 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3122 : it so happens the Eunice I know will not run shell scripts in Unix format
3126 echo "Congratulations. You aren't running Eunice."
3130 : Detect OS2. The p_ variable is set above in the Head.U unit.
3135 I have the feeling something is not exactly right, however...don't tell me...
3136 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3141 if test -f /xenix; then
3142 echo "Actually, this looks more like a XENIX system..."
3147 echo "It's not Xenix..."
3152 if test -f /venix; then
3153 echo "Actually, this looks more like a VENIX system..."
3160 echo "Nor is it Venix..."
3163 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3164 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3167 : see if setuid scripts can be secure
3170 Some kernels have a bug that prevents setuid #! scripts from being
3171 secure. Some sites have disabled setuid #! scripts because of this.
3173 First let's decide if your kernel supports secure setuid #! scripts.
3174 (If setuid #! scripts would be secure but have been disabled anyway,
3175 don't say that they are secure if asked.)
3180 if $test -d /dev/fd; then
3181 echo "#!$ls" >reflect
3182 chmod +x,u+s reflect
3183 ./reflect >flect 2>&1
3184 if $contains "/dev/fd" flect >/dev/null; then
3185 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3189 If you are not sure if they are secure, I can check but I'll need a
3190 username and password different from the one you are using right now.
3191 If you don't have such a username or don't want me to test, simply
3195 rp='Other username to test security of setuid scripts with?'
3200 case "$d_suidsafe" in
3201 '') echo "I'll assume setuid scripts are *not* secure." >&4
3204 echo "Well, the $hint value is *not* secure." >&4
3206 *) echo "Well, the $hint value *is* secure." >&4
3211 $rm -f reflect flect
3212 echo "#!$ls" >reflect
3213 chmod +x,u+s reflect
3216 echo '"su" will (probably) prompt you for '"$ans's password."
3217 su $ans -c './reflect >flect'
3218 if $contains "/dev/fd" flect >/dev/null; then
3219 echo "Okay, it looks like setuid scripts are secure." >&4
3222 echo "I don't think setuid scripts are secure." >&4
3227 rp='Does your kernel have *secure* setuid scripts?'
3230 [yY]*) val="$define";;
3235 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3236 echo "(That's for file descriptors, not floppy disks.)"
3242 $rm -f reflect flect
3244 : now see if they want to do setuid emulation
3247 case "$d_suidsafe" in
3250 echo "No need to emulate SUID scripts since they are secure here." >& 4
3254 Some systems have disabled setuid scripts, especially systems where
3255 setuid scripts cannot be secure. On systems where setuid scripts have
3256 been disabled, the setuid/setgid bits on scripts are currently
3257 useless. It is possible for $package to detect those bits and emulate
3258 setuid/setgid in a secure fashion. This emulation will only work if
3259 setuid scripts have been disabled in your kernel.
3263 "$define") dflt=y ;;
3266 rp="Do you want to do setuid/setgid emulation?"
3269 [yY]*) val="$define";;
3277 : determine where manual pages are on this system
3281 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
3282 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
3283 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
3284 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
3285 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
3286 sysman=`./loc . /usr/man/man1 $syspath`
3289 if $test -d "$sysman"; then
3290 echo "System manual is in $sysman." >&4
3292 echo "Could not find manual pages in source form." >&4
3295 : see what memory models we can support
3298 $cat >pdp11.c <<'EOP'
3307 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
3308 if $test -f pdp11 && ./pdp11 2>/dev/null; then
3309 dflt='unsplit split'
3311 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3314 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3319 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3322 if $test -d /lib/large || $test -d /usr/lib/large; then
3325 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3334 Some systems have different model sizes. On most systems they are called
3335 small, medium, large, and huge. On the PDP11 they are called unsplit and
3336 split. If your system doesn't support different memory models, say "none".
3337 If you wish to force everything to one memory model, say "none" here and
3338 put the appropriate flags later when it asks you for other cc and ld flags.
3339 Venix systems may wish to put "none" and let the compiler figure things out.
3340 (In the following question multiple model names should be space separated.)
3342 The default for most systems is "none".
3345 rp="Which memory models are supported?"
3360 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3361 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3368 rp="What flag indicates separate I and D space?"
3376 *large*|*small*|*medium*|*huge*)
3383 rp="What flag indicates large model?"
3393 *huge*) case "$huge" in
3397 rp="What flag indicates huge model?"
3407 *medium*) case "$medium" in
3411 rp="What flag indicates medium model?"
3418 *) medium="$large";;
3421 *small*) case "$small" in
3425 rp="What flag indicates small model?"
3436 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3439 $rm -f pdp11.* pdp11
3441 : see if we need a special compiler
3449 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3450 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3464 On some older systems the default C compiler will not resolve multiple global
3465 references that happen to have the same name. On some such systems the "Mcc"
3466 command may be used to force these to be resolved. On other systems a "cc -M"
3467 command is required. (Note that the -M flag on other systems indicates a
3468 memory model to use!) If you have the Gnu C compiler, you might wish to use
3474 rp="Use which C compiler?"
3482 rp="Use which C compiler?"
3486 : Look for a hint-file generated 'call-back-unit'. Now that the
3487 : user has specified the compiler, we may need to set or change some
3489 if $test -f cc.cbu; then
3493 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3494 $cat >gccvers.c <<EOM
3499 printf("%s\n", __VERSION__);
3501 printf("%s\n", "1");
3507 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3508 gccversion=`./gccvers`
3509 case "$gccversion" in
3510 '') echo "You are not using GNU cc." ;;
3511 *) echo "You are using GNU cc $gccversion." ;;
3515 echo "*** WHOA THERE!!! ***" >&4
3516 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3517 case "$knowitall" in
3519 echo " You'd better start hunting for one and let me know about it." >&4
3525 case "$gccversion" in
3526 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3529 : What should the include directory be ?
3531 $echo $n "Hmm... $c"
3535 if $test -f /bin/mips && /bin/mips; then
3536 echo "Looks like a MIPS system..."
3537 $cat >usr.c <<'EOCP'
3538 #ifdef SYSTYPE_BSD43
3542 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3543 dflt='/bsd43/usr/include'
3547 mips_type='System V'
3549 $rm -f usr.c usr.out
3550 echo "and you're compiling with the $mips_type compiler and libraries."
3554 echo "Doesn't look like a MIPS system."
3564 case "$xxx_prompt" in
3567 rp='Where are the include files you want to use?'
3575 : see how we invoke the C preprocessor
3577 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3578 cat <<'EOT' >testcpp.c
3584 if test ! -f cppstdin; then
3585 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3587 echo "Keeping your $hint cppstdin wrapper."
3590 wrapper=`pwd`/cppstdin
3594 if $test "X$cppstdin" != "X" && \
3595 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3596 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3598 echo "You used to use $cppstdin $cppminus so we'll use that again."
3600 '') echo "But let's see if we can live without a wrapper..." ;;
3602 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3603 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3605 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3608 echo "(However, $cpprun $cpplast does not work, let's see...)"
3616 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3623 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3624 $cc -E <testcpp.c >testcpp.out 2>&1; \
3625 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3626 echo "Yup, it does."
3629 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3630 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3631 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3632 echo "Yup, it does."
3635 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3636 $cc -P <testcpp.c >testcpp.out 2>&1; \
3637 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3638 echo "Yipee, that works!"
3641 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3642 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3643 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3644 echo "At long last!"
3647 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3648 $cpp <testcpp.c >testcpp.out 2>&1; \
3649 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3653 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3654 $cpp - <testcpp.c >testcpp.out 2>&1; \
3655 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3656 echo "Hooray, it works! I was beginning to wonder."
3659 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3660 $wrapper <testcpp.c >testcpp.out 2>&1; \
3661 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3667 rp="No dice. I can't find a C preprocessor. Name one:"
3671 $x_cpp <testcpp.c >testcpp.out 2>&1
3672 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3673 echo "OK, that will do." >&4
3675 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3690 echo "Perhaps can we force $cc -E using a wrapper..."
3691 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3692 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3698 echo "Nope, we'll have to live without it..."
3713 *) $rm -f $wrapper;;
3715 $rm -f testcpp.c testcpp.out
3717 : Set private lib path
3720 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3725 '') dlist="$loclibpth $plibpth $glibpth";;
3726 *) dlist="$libpth";;
3729 : Now check and see which directories actually exist, avoiding duplicates
3733 if $test -d $xxx; then
3736 *) libpth="$libpth $xxx";;
3742 Some systems have incompatible or broken versions of libraries. Among
3743 the directories listed in the question below, please remove any you
3744 know not to be holding relevant libraries, and add any that are needed.
3745 Say "none" for none.
3756 rp="Directories to use for library searches?"
3763 : compute shared library extension
3766 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3776 On some systems, shared libraries may be available. Answer 'none' if
3777 you want to suppress searching of shared libraries for the remaining
3778 of this configuration.
3781 rp='What is the file extension used for shared libraries?'
3785 : Define several unixisms.
3786 : Hints files or command line option can be used to override them.
3787 : The convoluted testing is in case hints files set either the old
3790 '') case "$exe_ext" in
3792 *) _exe="$exe_ext" ;;
3797 '') case "$lib_ext" in
3804 '') case "$obj_ext" in
3811 '') case "$path_sep" in
3822 : Which makefile gets called first. This is used by make depend.
3823 case "$firstmakefile" in
3824 '') firstmakefile='makefile';;
3827 : Looking for optional libraries
3829 echo "Checking for optional libraries..." >&4
3834 case "$libswanted" in
3835 '') libswanted='c_s';;
3837 for thislib in $libswanted; do
3839 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3840 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3841 echo "Found -l$thislib (shared)."
3844 *) dflt="$dflt -l$thislib";;
3846 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3847 echo "Found -l$thislib (shared)."
3850 *) dflt="$dflt -l$thislib";;
3852 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3853 echo "Found -l$thislib."
3856 *) dflt="$dflt -l$thislib";;
3858 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3859 echo "Found -l$thislib."
3862 *) dflt="$dflt -l$thislib";;
3864 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3865 echo "Found -l${thislib}_s."
3868 *) dflt="$dflt -l${thislib}_s";;
3870 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3871 echo "Found -l$thislib."
3874 *) dflt="$dflt -l$thislib";;
3877 echo "No -l$thislib."
3888 ' '|'') dflt='none';;
3893 Some versions of Unix support shared libraries, which make executables smaller
3894 but make load time slightly longer.
3896 On some systems, mostly System V Release 3's, the shared library is included
3897 by putting the option "-lc_s" as the last thing on the cc command line when
3898 linking. Other systems use shared libraries by default. There may be other
3899 libraries needed to compile $package on your machine as well. If your system
3900 needs the "-lc_s" option, include it here. Include any other special libraries
3901 here as well. Say "none" for none.
3905 rp="Any additional libraries?"
3912 : determine optimize, if desired, or use for debug flag also
3914 ' '|$undef) dflt='none';;
3916 *) dflt="$optimize";;
3920 Some C compilers have problems with their optimizers. By default, $package
3921 compiles with the -O flag to use the optimizer. Alternately, you might want
3922 to use the symbolic debugger, which uses the -g flag (on traditional Unix
3923 systems). Either flag can be specified here. To use neither flag, specify
3927 rp="What optimizer/debugger flag should be used?"
3931 'none') optimize=" ";;
3935 : We will not override a previous value, but we might want to
3936 : augment a hint file
3939 case "$gccversion" in
3940 1*) dflt='-fpcc-struct-return' ;;
3943 *-g*) dflt="$dflt -DDEBUGGING";;
3945 case "$gccversion" in
3946 2*) if test -d /etc/conf/kconfig.d &&
3947 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3956 case "$mips_type" in
3957 *BSD*|'') inclwanted="$locincpth $usrinc";;
3958 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3960 for thisincl in $inclwanted; do
3961 if $test -d $thisincl; then
3962 if $test x$thisincl != x$usrinc; then
3965 *) dflt="$dflt -I$thisincl";;
3971 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3973 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3981 *) dflt="$dflt -D$2";;
3986 set signal.h __LANGUAGE_C__; eval $inctest
3988 set signal.h LANGUAGE_C; eval $inctest
3992 none|recommended) dflt="$ccflags $dflt" ;;
3993 *) dflt="$ccflags";;
4001 Your C compiler may want other flags. For this question you should include
4002 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4003 but you should NOT include libraries or ld flags like -lwhatever. If you
4004 want $package to honor its debug switch, you should include -DDEBUGGING here.
4005 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4007 To use no flags, specify the word "none".
4013 rp="Any additional cc flags?"
4020 : the following weeds options from ccflags that are of no interest to cpp
4022 case "$gccversion" in
4023 1*) cppflags="$cppflags -D__GNUC__"
4025 case "$mips_type" in
4027 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4033 echo "Let me guess what the preprocessor flags are..." >&4
4047 *) ftry="$previous $flag";;
4049 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4050 >cpp1.out 2>/dev/null && \
4051 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4052 >cpp2.out 2>/dev/null && \
4053 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4054 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4056 cppflags="$cppflags $ftry"
4066 *-*) echo "They appear to be: $cppflags";;
4068 $rm -f cpp.c cpp?.out
4072 : flags used in final linking phase
4074 '') if ./venix; then
4080 *-posix*) dflt="$dflt -posix" ;;
4083 *) dflt="$ldflags";;
4086 : Try to guess additional flags to pick up local libraries.
4087 for thislibdir in $libpth; do
4088 case " $loclibpth " in
4091 *"-L$thislibdir "*) ;;
4092 *) dflt="$dflt -L$thislibdir" ;;
4104 Your C linker may need flags. For this question you should
4105 include -L/whatever and any other flags used by the C linker, but you
4106 should NOT include libraries like -lwhatever.
4108 Make sure you include the appropriate -L/path flags if your C linker
4109 does not normally search all of the directories you specified above,
4112 To use no flags, specify the word "none".
4116 rp="Any additional ld flags (NOT including libraries)?"
4122 rmlist="$rmlist pdp11"
4126 echo "Checking your choice of C compiler and flags for coherency..." >&4
4127 $cat > try.c <<'EOF'
4129 main() { printf("Ok\n"); exit(0); }
4131 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4133 $cat >try.msg <<'EOM'
4134 I've tried to compile and run the following simple program:
4139 $cat >> try.msg <<EOM
4146 and I got the following output:
4150 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4151 if sh -c './try' >>try.msg 2>&1; then
4155 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4158 cat >> try.msg <<'EOQS'
4159 If $libs contains -lsfio, and sfio is mis-configured, then it
4160 sometimes (apparently) runs and exits with a 0 status, but with no
4161 output! It may have to do with sfio's use of _exit vs. exit.
4164 rp="You have a big problem. Shall I abort Configure"
4171 echo "The program compiled OK, but exited with status $?." >>try.msg
4172 rp="You have a problem. Shall I abort Configure"
4176 echo "I can't compile the test program." >>try.msg
4177 rp="You have a BIG problem. Shall I abort Configure"
4183 case "$knowitall" in
4185 echo "(The supplied flags or libraries might be incorrect.)"
4193 *) echo "Ok. Stopping Configure." >&4
4198 n) echo "OK, that should do.";;
4200 $rm -f try try.* core
4202 : determine filename position in cpp output
4204 echo "Computing filename position in cpp output for #include directives..." >&4
4205 echo '#include <stdio.h>' > foo.c
4208 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4209 $grep '^[ ]*#.*stdio\.h' | \
4210 while read cline; do
4213 while $test \$# -gt 0; do
4214 if $test -r \`echo \$1 | $tr -d '"'\`; then
4219 pos=\`expr \$pos + 1\`
4231 *) pos="${fieldn}th";;
4233 echo "Your cpp writes the filename in the $pos field of the line."
4235 : locate header file
4240 if test -f $usrinc/\$wanted; then
4241 echo "$usrinc/\$wanted"
4244 awkprg='{ print \$$fieldn }'
4245 echo "#include <\$wanted>" > foo\$\$.c
4246 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4247 $grep "^[ ]*#.*\$wanted" | \
4248 while read cline; do
4249 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4251 */\$wanted) echo "\$name"; exit 0;;
4262 : define an alternate in-header-list? function
4263 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4264 cont=true; xxf="echo \"<\$1> found.\" >&4";
4265 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4266 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4268 case $# in 4) instead=instead;; *) instead="at last";; esac;
4269 while $test "$cont"; do
4271 var=$2; eval "was=\$$2";
4272 if $test "$xxx" && $test -r "$xxx";
4274 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4277 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4278 set $yyy; shift; shift; yyy=$@;
4279 case $# in 0) cont="";;
4280 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4281 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4282 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4283 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4287 do set $yyy; var=$2; eval "was=\$$2";
4288 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4289 set $yyy; shift; shift; yyy=$@;
4292 : see if this is a malloc.h system
4293 set malloc.h i_malloc
4296 : see if stdlib is available
4297 set stdlib.h i_stdlib
4300 : determine which malloc to compile in
4302 case "$usemymalloc" in
4303 ''|[yY]*|true|$define) dflt='y' ;;
4306 rp="Do you wish to attempt to use the malloc that comes with $package?"
4312 mallocsrc='malloc.c'
4313 mallocobj="malloc$_o"
4314 d_mymalloc="$define"
4317 : Remove malloc from list of libraries to use
4318 echo "Removing unneeded -lmalloc from library list" >&4
4319 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4322 echo "libs = $libs" >&4
4334 : compute the return types of malloc and free
4336 $cat >malloc.c <<END
4340 #include <sys/types.h>
4354 case "$malloctype" in
4356 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4363 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4367 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4374 echo "Your system uses $freetype free(), it would seem." >&4
4376 : Cruising for prototypes
4378 echo "Checking out function prototypes..." >&4
4379 $cat >prototype.c <<'EOCP'
4380 main(int argc, char *argv[]) {
4383 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4384 echo "Your C compiler appears to support function prototypes."
4387 echo "Your C compiler doesn't seem to understand function prototypes."
4394 case "$prototype" in
4396 *) ansi2knr='ansi2knr'
4401 This version of $package can only be compiled by a compiler that
4402 understands function prototypes. Unfortunately, your C compiler
4404 doesn't seem to understand them. Sorry about that.
4406 If GNU cc is available for your system, perhaps you could try that instead.
4408 Eventually, we hope to support building Perl with pre-ANSI compilers.
4409 If you would like to help in that effort, please contact <perlbug@perl.org>.
4411 Aborting Configure now.
4417 : determine where public executables go
4422 rp='Pathname where the public executables will reside?'
4424 if $test "X$ansexp" != "X$binexp"; then
4432 Since you are running AFS, I need to distinguish the directory in which
4433 executables reside from the directory in which they are installed (and from
4434 which they are presumably copied to the former directory by occult means).
4437 case "$installbin" in
4438 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
4439 *) dflt="$installbin";;
4442 rp='Where will public executables be installed?'
4446 installbin="$binexp"
4449 : define a shorthand compile call
4453 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4454 : define a shorthand compile call for compilations that should be ok.
4458 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4461 echo "Checking for GNU C Library..." >&4
4462 cat >gnulibc.c <<EOM
4475 if eval $compile_ok && ./gnulibc; then
4477 echo "You are using the GNU C Library"
4480 echo "You are not using the GNU C Library"
4486 : see if nm is to be used to determine whether a symbol is defined or not
4490 case "$d_gnulibc" in
4493 echo "nm probably won't work on the GNU C Library." >&4
4499 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4501 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4502 echo "'nm' won't be sufficient on this sytem." >&4
4508 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4509 if $test $dflt -gt 20; then
4519 true|$define) dflt=y;;
4526 I can use $nm to extract the symbols from your C libraries. This
4527 is a time consuming task which may generate huge output on the disk (up
4528 to 3 megabytes) but that should make the symbols extraction faster. The
4529 alternative is to skip the 'nm' extraction part and to compile a small
4530 test program instead to determine whether each symbol is present. If
4531 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4532 this may be the best solution.
4534 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4537 rp="Shall I use $nm to extract C symbols from the libraries?"
4540 [Nn]*) usenm=false;;
4549 : nm options which may be necessary
4551 '') if $test -f /mach_boot; then
4553 elif $test -d /usr/ccs/lib; then
4554 nm_opt='-p' # Solaris (and SunOS?)
4555 elif $test -f /dgux; then
4557 elif $test -f /lib64/rld; then
4558 nm_opt='-p' # 64-bit Irix
4564 : nm options which may be necessary for shared libraries but illegal
4565 : for archive libraries. Thank you, Linux.
4566 case "$nm_so_opt" in
4567 '') case "$myuname" in
4569 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4570 nm_so_opt='--dynamic'
4579 : get list of predefined functions in a handy place
4584 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4591 *) for thislib in $libs; do
4594 : Handle C library specially below.
4597 thislib=`echo $thislib | $sed -e 's/^-l//'`
4598 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4600 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4602 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4604 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4606 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4608 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4610 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4615 libnames="$libnames $try"
4617 *) libnames="$libnames $thislib" ;;
4626 for xxx in $libpth; do
4627 $test -r $1 || set $xxx/libc.$so
4628 : The messy sed command sorts on library version numbers.
4630 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4631 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4633 s/[0-9][0-9]*/0000&/g
4634 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4637 sort | $sed -e 's/^.* //'`
4640 $test -r $1 || set /usr/ccs/lib/libc.$so
4641 $test -r $1 || set /lib/libsys_s$_a
4647 if $test -r "$1"; then
4648 echo "Your (shared) C library seems to be in $1."
4650 elif $test -r /lib/libc && $test -r /lib/clib; then
4651 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4653 libc='/lib/clib /lib/libc'
4654 if $test -r /lib/syslib; then
4655 echo "(Your math library is in /lib/syslib.)"
4656 libc="$libc /lib/syslib"
4658 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4659 echo "Your C library seems to be in $libc, as you said before."
4660 elif $test -r $incpath/usr/lib/libc$_a; then
4661 libc=$incpath/usr/lib/libc$_a;
4662 echo "Your C library seems to be in $libc. That's fine."
4663 elif $test -r /lib/libc$_a; then
4665 echo "Your C library seems to be in $libc. You're normal."
4667 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4669 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4670 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4671 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4673 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4675 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4678 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4680 if $test -r "$tans"; then
4681 echo "Your C library seems to be in $tans, of all places."
4687 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4691 If the guess above is wrong (which it might be if you're using a strange
4692 compiler, or your machine supports multiple models), you can override it here.
4697 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
4699 I can't seem to find your C library. I've looked in the following places:
4702 $sed 's/^/ /' libpath
4705 None of these seems to contain your C library. I need to get its name...
4710 rp='Where is your C library?'
4715 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
4716 set X `cat libnames`
4719 case $# in 1) xxx=file; esac
4720 echo "Extracting names from the following $xxx for later perusal:" >&4
4722 $sed 's/^/ /' libnames >&4
4724 $echo $n "This may take a while...$c" >&4
4728 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4729 *) $nm $nm_opt $file 2>/dev/null;;
4734 $grep fprintf libc.tmp > libc.ptf
4735 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4736 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4738 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4740 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4742 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4744 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4746 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4748 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4750 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4752 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4754 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4756 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4758 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4760 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4762 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4763 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4765 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4767 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4769 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4771 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4773 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4775 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4777 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4779 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4781 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4783 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4785 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4787 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4789 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4792 $nm -p $* 2>/dev/null >libc.tmp
4793 $grep fprintf libc.tmp > libc.ptf
4794 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4795 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4801 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4803 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4804 for thisname in $libnames $libc; do
4805 $ar t $thisname >>libc.tmp
4807 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4809 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4810 # Repeat libc to extract forwarders to DLL entries too
4811 for thisname in $libnames $libc; do
4812 $ar tv $thisname >>libc.tmp
4813 # Revision 50 of EMX has bug in $ar.
4814 # it will not extract forwarders to DLL entries
4815 # Use emximp which will extract exactly them.
4816 emximp -o tmp.imp $thisname \
4818 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
4819 < tmp.imp >>libc.tmp
4822 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
4825 echo "$ar didn't seem to work right." >&4
4826 echo "Maybe this is a Cray...trying bld instead..." >&4
4827 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
4829 for thisname in $libnames; do
4831 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
4832 $ar t $thisname >>libc.tmp
4836 echo "That didn't work either. Giving up." >&4
4843 if $test -f /lib/syscalls.exp; then
4845 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4846 $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
4850 $rm -f libnames libpath
4852 : see if dld is available
4856 : is a C symbol defined?
4859 -v) tf=libc.tmp; tc=""; tdc="";;
4860 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4861 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4864 case "$reuseval-$4" in
4866 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4872 if $contains $tlook $tf >/dev/null 2>&1;
4877 echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4878 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
4886 $define) tval=true;;
4892 : define an is-in-libc? function
4893 inlibc='echo " "; td=$define; tu=$undef;
4894 sym=$1; var=$2; eval "was=\$$2";
4896 case "$reuseval$was" in
4906 echo "$sym() found." >&4;
4907 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
4909 echo "$sym() NOT found." >&4;
4910 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
4914 $define) echo "$sym() found." >&4;;
4915 *) echo "$sym() NOT found." >&4;;
4919 : see if dlopen exists
4926 : determine which dynamic loading, if any, to compile in
4928 dldir="ext/DynaLoader"
4941 $define) dflt='y' ;;
4944 $define) dflt='y' ;;
4946 : Does a dl_xxx.xs file exist for this operating system
4947 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
4950 rp="Do you wish to use dynamic loading?"
4957 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
4958 dflt="$dldir/dl_${osname}.xs"
4959 elif $test "$d_dlopen" = "$define" ; then
4960 dflt="$dldir/dl_dlopen.xs"
4961 elif $test "$i_dld" = "$define" ; then
4962 dflt="$dldir/dl_dld.xs"
4967 *) dflt="$dldir/$dlsrc"
4970 echo "The following dynamic loading files are available:"
4971 : Can not go over to $dldir because getfile has path hard-coded in.
4972 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
4973 rp="Source file to use for dynamic loading"
4975 # XXX This getfile call will fail the existence check if you try
4976 # building away from $src (this is not supported yet).
4980 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
4984 Some systems may require passing special flags to $cc -c to
4985 compile modules that will be used to create a shared library.
4986 To use no flags, say "none".
4989 case "$cccdlflags" in
4990 '') case "$gccversion" in
4991 '') case "$osname" in
4993 next) dflt='none' ;;
4994 irix*) dflt='-KPIC' ;;
4995 svr4*|esix*|solaris) dflt='-KPIC' ;;
4996 sunos) dflt='-pic' ;;
5000 *) case "$osname" in
5001 svr4*|esix*|solaris) dflt='-fPIC' ;;
5006 *) dflt="$cccdlflags" ;;
5008 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5011 none) cccdlflags=' ' ;;
5012 *) cccdlflags="$ans" ;;
5017 Some systems use ld to create libraries that can be dynamically loaded,
5018 while other systems (such as those using ELF) use $cc.
5022 '') $cat >try.c <<'EOM'
5023 /* Test for whether ELF binaries are produced */
5028 int i = open("a.out",O_RDONLY);
5031 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5032 exit(0); /* succeed (yes, it's ELF) */
5037 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5039 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5043 echo "I'll use ld to build dynamic libraries."
5052 rp="What command should be used to create dynamic libraries?"
5058 Some systems may require passing special flags to $ld to create a
5059 library that can be dynamically loaded. If your ld flags include
5060 -L/other/path options to locate libraries outside your loader's normal
5061 search path, you may need to specify those -L options here as well. To
5062 use no flags, say "none".
5065 case "$lddlflags" in
5066 '') case "$osname" in
5068 linux|irix*) dflt='-shared' ;;
5069 next) dflt='none' ;;
5070 solaris) dflt='-G' ;;
5071 sunos) dflt='-assert nodefinitions' ;;
5072 svr4*|esix*) dflt="-G $ldflags" ;;
5076 *) dflt="$lddlflags" ;;
5079 : Try to guess additional flags to pick up local libraries.
5080 for thisflag in $ldflags; do
5085 *) dflt="$dflt $thisflag" ;;
5092 ''|' ') dflt='none' ;;
5095 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5098 none) lddlflags=' ' ;;
5099 *) lddlflags="$ans" ;;
5104 Some systems may require passing special flags to $cc to indicate that
5105 the resulting executable will use dynamic linking. To use no flags,
5109 case "$ccdlflags" in
5110 '') case "$osname" in
5111 hpux) dflt='-Wl,-E' ;;
5112 linux) dflt='-rdynamic' ;;
5113 next) dflt='none' ;;
5114 sunos) dflt='none' ;;
5118 *) dflt="$ccdlflags" ;;
5120 rp="Any special flags to pass to $cc to use dynamic loading?"
5123 none) ccdlflags=' ' ;;
5124 *) ccdlflags="$ans" ;;
5138 # No dynamic loading being used, so don't bother even to prompt.
5141 *) case "$useshrplib" in
5142 '') case "$osname" in
5143 svr4*|dgux|dynixptx|esix|powerux)
5145 also='Building a shared libperl is required for dynamic loading to work on your system.'
5150 also='Building a shared libperl is needed for MAB support.'
5168 The perl executable is normally obtained by linking perlmain.c with
5169 libperl${_a}, any static extensions (usually just DynaLoader), and
5170 any other libraries needed on this system (such as -lm, etc.). Since
5171 your system supports dynamic loading, it is probably possible to build
5172 a shared libperl.$so. If you will have more than one executable linked
5173 to libperl.$so, this will significantly reduce the size of each
5174 executable, but it may have a noticeable affect on performance. The
5175 default is probably sensible for your system.
5179 rp="Build a shared libperl.$so (y/n)"
5184 # Why does next4 have to be so different?
5185 case "${osname}${osvers}" in
5186 next4*) xxx='DYLD_LIBRARY_PATH' ;;
5187 os2*) xxx='' ;; # Nothing special needed.
5188 *) xxx='LD_LIBRARY_PATH' ;;
5190 if test X"$xxx" != "X"; then
5191 $cat <<EOM | $tee -a ../config.msg >&4
5193 To build perl, you must add the current working directory to your
5194 $xxx environment variable before running make. You can do
5196 $xxx=\`pwd\`; export $xxx
5197 for Bourne-style shells, or
5199 for Csh-style shells. You *MUST* do this before running make.
5204 *) useshrplib='false' ;;
5209 case "$useshrplib" in
5213 # Figure out a good name for libperl.so. Since it gets stored in
5214 # a version-specific architecture-dependent library, the version
5215 # number isn't really that important, except for making cc/ld happy.
5217 # A name such as libperl.so.3.1
5218 majmin="libperl.$so.$patchlevel.$subversion"
5219 # A name such as libperl.so.301
5220 majonly=`echo $patchlevel $subversion |
5221 $awk '{printf "%d%02d", $1, $2}'`
5222 majonly=libperl.$so.$majonly
5223 # I'd prefer to keep the os-specific stuff here to a minimum, and
5224 # rely on figuring it out from the naming of libc.
5225 case "${osname}${osvers}" in
5228 # XXX How handle the --version stuff for MAB?
5230 linux*) # ld won't link with a bare -lperl otherwise.
5233 *) # Try to guess based on whether libc has major.minor.
5235 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5236 *libc.$so.[0-9]*) dflt=$majonly ;;
5237 *) dflt=libperl.$so ;;
5247 I need to select a good name for the shared libperl. If your system uses
5248 library names with major and minor numbers, then you might want something
5249 like $majmin. Alternatively, if your system uses a single version
5250 number for shared libraries, then you might want to use $majonly.
5251 Or, your system might be quite happy with a simple libperl.$so.
5253 Since the shared libperl will get installed into a version-specific
5254 architecture-dependent directory, the version number of the shared perl
5255 library probably isn't important, so the default should be o.k.
5258 rp='What name do you want to give to the shared libperl?'
5261 echo "Ok, I'll use $libperl"
5264 libperl="libperl${_a}"
5268 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5272 WARNING: Use of the shrpdir variable for the installation location of
5273 the shared $libperl is not supported. It was never documented and
5274 will not work in this version. Let me (jhi@iki.fi)
5275 know of any problems this may cause.
5281 But your current setting of $shrpdir is
5282 the default anyway, so it's harmless.
5287 Further, your current attempted setting of $shrpdir
5288 conflicts with the value of $archlibexp/CORE
5289 that installperl will use.
5296 # How will the perl executable find the installed shared $libperl?
5297 # Add $xxx to ccdlflags.
5298 # If we can't figure out a command-line option, use $shrpenv to
5299 # set env LD_RUN_PATH. The main perl makefile uses this.
5300 shrpdir=$archlibexp/CORE
5303 if "$useshrplib"; then
5306 # We'll set it in Makefile.SH...
5312 xxx="-Wl,-R$shrpdir"
5314 linux|irix*|dec_osf)
5315 xxx="-Wl,-rpath,$shrpdir"
5318 # next doesn't like the default...
5321 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5327 # Only add $xxx if it isn't already in ccdlflags.
5328 case " $ccdlflags " in
5330 *) ccdlflags="$ccdlflags $xxx"
5333 Adding $xxx to the flags
5334 passed to $ld so that the perl executable will find the
5335 installed shared $libperl.
5343 # Respect a hint or command-line value.
5345 '') shrpenv="$tmp_shrpenv" ;;
5348 : determine where manual pages go
5349 set man1dir man1dir none
5353 $spackage has manual pages available in source form.
5357 echo "However, you don't have nroff, so they're probably useless to you."
5359 '') man1dir="none";;
5362 echo "If you don't want the manual sources installed, answer 'none'."
5367 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5368 lookpath="$lookpath $prefixexp/man/p_man/man1"
5369 lookpath="$lookpath $prefixexp/man/u_man/man1"
5370 lookpath="$lookpath $prefixexp/man/man.1"
5372 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5373 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5383 rp="Where do the main $spackage manual pages (source) go?"
5385 if $test "X$man1direxp" != "X$ansexp"; then
5389 man1direxp="$ansexp"
5397 Since you are running AFS, I need to distinguish the directory in which
5398 manual pages reside from the directory in which they are installed (and from
5399 which they are presumably copied to the former directory by occult means).
5402 case "$installman1dir" in
5403 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
5404 *) dflt="$installman1dir";;
5407 rp='Where will man pages be installed?'
5409 installman1dir="$ans"
5411 installman1dir="$man1direxp"
5414 : What suffix to use on installed man pages
5421 rp="What suffix should be used for the main $spackage man pages?"
5423 '') case "$man1dir" in
5437 *) dflt="$man1ext";;
5444 : see if we can have long filenames
5446 rmlist="$rmlist /tmp/cf$$"
5447 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5448 first=123456789abcdef
5449 second=/tmp/cf$$/$first
5450 $rm -f $first $second
5451 if (echo hi >$first) 2>/dev/null; then
5452 if $test -f 123456789abcde; then
5453 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5456 if (echo hi >$second) 2>/dev/null; then
5457 if $test -f /tmp/cf$$/123456789abcde; then
5459 That's peculiar... You can have filenames longer than 14 characters, but only
5460 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5461 I shall consider your system cannot support long filenames at all.
5465 echo 'You can have filenames longer than 14 characters.' >&4
5470 How confusing! Some of your filesystems are sane enough to allow filenames
5471 longer than 14 characters but some others like /tmp can't even think about them.
5472 So, for now on, I shall assume your kernel does not allow them at all.
5479 You can't have filenames longer than 14 chars. You can't even think about them!
5485 $rm -rf /tmp/cf$$ 123456789abcde*
5487 : determine where library module manual pages go
5488 set man3dir man3dir none
5492 $spackage has manual pages for many of the library modules.
5498 However, you don't have nroff, so they're probably useless to you.
5501 '') man3dir="none";;
5505 case "$d_flexfnam" in
5508 However, your system can't handle the long file names like File::Basename.3.
5511 '') man3dir="none";;
5515 echo "If you don't want the manual sources installed, answer 'none'."
5516 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5518 '') case "$prefix" in
5519 *$prog*) dflt=`echo $man1dir |
5520 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
5521 *) dflt="$privlib/man/man3" ;;
5525 *) dflt="$man3dir" ;;
5530 rp="Where do the $package library man pages (source) go?"
5532 if test "X$man3direxp" != "X$ansexp"; then
5537 man3direxp="$ansexp"
5545 Since you are running AFS, I need to distinguish the directory in which
5546 manual pages reside from the directory in which they are installed (and from
5547 which they are presumably copied to the former directory by occult means).
5550 case "$installman3dir" in
5551 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
5552 *) dflt="$installman3dir";;
5555 rp='Where will man pages be installed?'
5557 installman3dir="$ans"
5559 installman3dir="$man3direxp"
5562 : What suffix to use on installed man pages
5569 rp="What suffix should be used for the $package library man pages?"
5571 '') case "$man3dir" in
5585 *) dflt="$man3ext";;
5592 : see if we have to deal with yellow pages, now NIS.
5593 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5594 if $test -f /usr/etc/nibindd; then
5596 echo "I'm fairly confident you're on a NeXT."
5598 rp='Do you get the hosts file via NetInfo?'
5607 y*) hostcat='nidump hosts .';;
5608 *) case "$hostcat" in
5609 nidump*) hostcat='';;
5619 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5627 rp='Are you getting the hosts file via yellow pages?'
5630 y*) hostcat='ypcat hosts';;
5631 *) hostcat='cat /etc/hosts';;
5637 '') hostcat='cat /etc/hosts';;
5640 '') groupcat='cat /etc/group';;
5643 '') passcat='cat /etc/passwd';;
5646 : now get the host name
5648 echo "Figuring out host name..." >&4
5649 case "$myhostname" in
5651 echo 'Maybe "hostname" will work...'
5652 if tans=`sh -c hostname 2>&1` ; then
5660 if $test "$cont"; then
5662 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5663 if tans=`cat /etc/systemid 2>&1` ; then
5665 phostname='cat /etc/systemid'
5666 echo "Whadyaknow. Xenix always was a bit strange..."
5669 elif $test -r /etc/systemid; then
5670 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5673 if $test "$cont"; then
5674 echo 'No, maybe "uuname -l" will work...'
5675 if tans=`sh -c 'uuname -l' 2>&1` ; then
5677 phostname='uuname -l'
5679 echo 'Strange. Maybe "uname -n" will work...'
5680 if tans=`sh -c 'uname -n' 2>&1` ; then
5682 phostname='uname -n'
5684 echo 'Oh well, maybe I can mine it out of whoami.h...'
5685 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
5686 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
5687 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
5689 case "$myhostname" in
5690 '') echo "Does this machine have an identity crisis or something?"
5693 echo "Well, you said $myhostname before..."
5694 phostname='echo $myhostname';;
5700 : you do not want to know about this
5705 if $test "$myhostname" ; then
5707 rp='Your host name appears to be "'$myhostname'".'" Right?"
5715 : bad guess or no guess
5716 while $test "X$myhostname" = X ; do
5718 rp="Please type the (one word) name of your host:"
5723 : translate upper to lower if necessary
5724 case "$myhostname" in
5726 echo "(Normalizing case in your host name)"
5727 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
5731 case "$myhostname" in
5733 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
5734 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
5735 echo "(Trimming domain name from host name--host name is now $myhostname)"
5737 *) case "$mydomain" in
5740 test "X$hostcat" = "Xypcat hosts" &&
5741 ypmatch "$myhostname" hosts 2>/dev/null |\
5742 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
5745 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
5746 /[ ]$myhostname[ . ]/p" > hosts
5749 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
5750 END { print sum }" hosts` = x1 || tmp_re="[ ]"
5751 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
5752 hosts | $sort | $uniq | \
5753 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
5754 case `$echo X$dflt` in
5755 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
5758 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
5763 tans=`./loc resolv.conf X /etc /usr/etc`
5764 if $test -f "$tans"; then
5765 echo "(Attempting domain name extraction from $tans)"
5766 dflt=.`$sed -n -e 's/ / /g' \
5767 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
5768 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5770 .) dflt=.`$sed -n -e 's/ / /g' \
5771 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
5772 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5779 .) echo "(No help from resolv.conf either -- attempting clever guess)"
5780 dflt=.`sh -c domainname 2>/dev/null`
5783 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
5788 .) echo "(Lost all hope -- silly guess then)"
5794 *) dflt="$mydomain";;
5798 rp="What is your domain name?"
5808 : translate upper to lower if necessary
5811 echo "(Normalizing case in your domain name)"
5812 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
5816 : a little sanity check here
5817 case "$phostname" in
5820 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
5821 $myhostname$mydomain|$myhostname) ;;
5823 case "$phostname" in
5825 echo "(That doesn't agree with your whoami.h file, by the way.)"
5828 echo "(That doesn't agree with your $phostname command, by the way.)"
5838 I need to get your e-mail address in Internet format if possible, i.e.
5839 something like user@host.domain. Please answer accurately since I have
5840 no easy means to double check it. The default value provided below
5841 is most probably close to the reality but may not be valid from outside
5842 your organization...
5846 while test "$cont"; do
5848 '') dflt="$cf_by@$myhostname$mydomain";;
5849 *) dflt="$cf_email";;
5851 rp='What is your e-mail address?'
5857 rp='Address does not look like an Internet one. Use it anyway?'
5873 If you or somebody else will be maintaining perl at your site, please
5874 fill in the correct e-mail address here so that they may be contacted
5875 if necessary. Currently, the "perlbug" program included with perl
5876 will send mail to this address in addition to perlbug@perl.com. You may
5877 enter "none" for no administrator.
5880 case "$perladmin" in
5881 '') dflt="$cf_email";;
5882 *) dflt="$perladmin";;
5884 rp='Perl administrator e-mail address'
5888 : figure out how to guarantee perl startup
5889 case "$startperl" in
5891 case "$sharpbang" in
5895 I can use the #! construct to start perl on your system. This will
5896 make startup of perl scripts faster, but may cause problems if you
5897 want to share those scripts and perl is not in a standard place
5898 ($binexp/perl) on all your platforms. The alternative is to force
5899 a shell by starting the script with a single ':' character.
5903 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
5906 none) startperl=": # use perl";;
5907 *) startperl="#!$ans"
5908 if $test 30 -lt `echo "$ans" | wc -c`; then
5911 WARNING: Some systems limit the #! command to 32 characters.
5912 If you experience difficulty running Perl scripts with #!, try
5913 installing Perl in a directory with a shorter pathname.
5919 *) startperl=": # use perl"
5924 echo "I'll use $startperl to start perl scripts."
5926 : figure best path for perl in scripts
5929 perlpath="$binexp/perl"
5930 case "$startperl" in
5935 I will use the "eval 'exec'" idiom to start Perl on your system.
5936 I can use the full path of your Perl binary for this purpose, but
5937 doing so may cause problems if you want to share those scripts and
5938 Perl is not always in a standard place ($binexp/perl).
5942 rp="What path shall I use in \"eval 'exec'\"?"
5949 case "$startperl" in
5951 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
5954 : determine where public executable scripts go
5955 set scriptdir scriptdir
5957 case "$scriptdir" in
5960 : guess some guesses
5961 $test -d /usr/share/scripts && dflt=/usr/share/scripts
5962 $test -d /usr/share/bin && dflt=/usr/share/bin
5963 $test -d /usr/local/script && dflt=/usr/local/script
5964 $test -d $prefixexp/script && dflt=$prefixexp/script
5968 *) dflt="$scriptdir"
5973 Some installations have a separate directory just for executable scripts so
5974 that they can mount it across multiple architectures but keep the scripts in
5975 one spot. You might, for example, have a subdirectory of /usr/share for this.
5976 Or you might just lump your scripts in with all your other executables.
5980 rp='Where do you keep publicly executable scripts?'
5982 if $test "X$ansexp" != "X$scriptdirexp"; then
5986 scriptdirexp="$ansexp"
5990 Since you are running AFS, I need to distinguish the directory in which
5991 scripts reside from the directory in which they are installed (and from
5992 which they are presumably copied to the former directory by occult means).
5995 case "$installscript" in
5996 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
5997 *) dflt="$installscript";;
6000 rp='Where will public scripts be installed?'
6002 installscript="$ans"
6004 installscript="$scriptdirexp"
6007 : determine where site specific libraries go.
6008 : Usual default is /usr/local/lib/perl5/site_perl/$apiversion
6009 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6011 *perl*) set dflt sitelib lib/site_$prog/$apiversion ;;
6012 *) set dflt sitelib lib/$package/site_$prog/$apiversion ;;
6017 The installation process will also create a directory for
6018 site-specific extensions and modules. Some users find it convenient
6019 to place all local files in this directory rather than in the main
6020 distribution directory.
6024 rp='Pathname for the site-specific library files?'
6026 if $test "X$sitelibexp" != "X$ansexp"; then
6030 sitelibexp="$ansexp"
6034 Since you are running AFS, I need to distinguish the directory in
6035 which site-specific files reside from the directory in which they are
6036 installed (and from which they are presumably copied to the former
6037 directory by occult means).
6040 case "$installsitelib" in
6041 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
6042 *) dflt="$installsitelib";;
6045 rp='Where will site-specific files be installed?'
6047 installsitelib="$ans"
6049 installsitelib="$sitelibexp"
6052 : determine where site specific architecture-dependent libraries go.
6053 : sitelib default is /usr/local/lib/perl5/site_perl/$apiversion
6054 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6055 : sitelib may have an optional trailing /share.
6056 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6057 tdflt="$tdflt/$archname"
6058 set sitearch sitearch none
6061 '') dflt="$tdflt" ;;
6062 *) dflt="$sitearch" ;;
6066 The installation process will also create a directory for
6067 architecture-dependent site-specific extensions and modules.
6071 rp='Pathname for the site-specific architecture-dependent library files?'
6073 if $test "X$sitearchexp" != "X$ansexp"; then
6077 sitearchexp="$ansexp"
6081 Since you are running AFS, I need to distinguish the directory in
6082 which site-specific architecture-dependent library files reside from
6083 the directory in which they are installed (and from which they are
6084 presumably copied to the former directory by occult means).
6087 case "$installsitearch" in
6088 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
6089 *) dflt="$installsitearch";;
6092 rp='Where will site-specific architecture-dependent files be installed?'
6094 installsitearch="$ans"
6096 installsitearch="$sitearchexp"
6101 Previous version of $package used the standard IO mechanisms as defined
6102 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6103 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6104 the default. This abstraction layer can use AT&T's sfio (if you already
6105 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6106 problems with some extension modules. Using PerlIO with stdio is safe,
6107 but it is slower than plain stdio and therefore is not the default.
6109 If this doesn't make any sense to you, just accept the default 'n'.
6111 case "$useperlio" in
6112 $define|true|[yY]*) dflt='y';;
6115 rp='Use the experimental PerlIO abstraction layer?'
6122 echo "Ok, doing things the stdio way"
6129 : Check how to convert floats to strings.
6130 if test "X$d_Gconvert" = X; then
6132 echo "Checking for an efficient way to convert floats to strings."
6135 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6136 char *myname = "gconvert";
6139 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6140 char *myname = "gcvt";
6143 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6144 char *myname = "sprintf";
6150 checkit(expect, got)
6154 if (strcmp(expect, got)) {
6155 printf("%s oddity: Expected %s, got %s\n",
6156 myname, expect, got);
6167 /* This must be 1st test on (which?) platform */
6168 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6169 Gconvert(0.1, 8, 0, buf);
6170 checkit("0.1", buf);
6172 Gconvert(1.0, 8, 0, buf);
6175 Gconvert(0.0, 8, 0, buf);
6178 Gconvert(-1.0, 8, 0, buf);
6181 /* Some Linux gcvt's give 1.e+5 here. */
6182 Gconvert(100000.0, 8, 0, buf);
6183 checkit("100000", buf);
6185 /* Some Linux gcvt's give -1.e+5 here. */
6186 Gconvert(-100000.0, 8, 0, buf);
6187 checkit("-100000", buf);
6192 case "$d_Gconvert" in
6193 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6194 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6195 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6196 *) xxx_list='gconvert gcvt sprintf' ;;
6199 for xxx_convert in $xxx_list; do
6200 echo "Trying $xxx_convert"
6202 set try -DTRY_$xxx_convert
6203 if eval $compile; then
6204 echo "$xxx_convert" found. >&4
6206 echo "I'll use $xxx_convert to convert floats into a string." >&4
6209 echo "...But $xxx_convert didn't work as I expected."
6212 echo "$xxx_convert NOT found." >&4
6216 case "$xxx_convert" in
6217 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6218 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6219 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6223 : Initialize h_fcntl
6226 : Initialize h_sysfile
6229 : access call always available on UNIX
6233 : locate the flags for 'access()'
6237 $cat >access.c <<'EOCP'
6238 #include <sys/types.h>
6243 #include <sys/file.h>
6252 : check sys/file.h first, no particular reason here
6253 if $test `./findhdr sys/file.h` && \
6254 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
6256 echo "<sys/file.h> defines the *_OK access constants." >&4
6257 elif $test `./findhdr fcntl.h` && \
6258 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
6260 echo "<fcntl.h> defines the *_OK access constants." >&4
6261 elif $test `./findhdr unistd.h` && \
6262 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
6263 echo "<unistd.h> defines the *_OK access constants." >&4
6265 echo "I can't find the four *_OK access constants--I'll use mine." >&4
6271 : see if accessx exists
6272 set accessx d_accessx
6275 : see if alarm exists
6279 : Look for GNU-cc style attribute checking
6281 echo "Checking whether your compiler can handle __attribute__ ..." >&4
6282 $cat >attrib.c <<'EOCP'
6284 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
6286 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
6287 if $contains 'warning' attrib.out >/dev/null 2>&1; then
6288 echo "Your C compiler doesn't fully support __attribute__."
6291 echo "Your C compiler supports __attribute__."
6295 echo "Your C compiler doesn't seem to understand __attribute__ at all."
6302 : see if bcmp exists
6306 : see if bcopy exists
6310 : see if this is a unistd.h system
6311 set unistd.h i_unistd
6314 : see if getpgrp exists
6315 set getpgrp d_getpgrp
6318 case "$d_getpgrp" in
6321 echo "Checking to see which flavor of getpgrp is in use..."
6324 #include <sys/types.h>
6326 # include <unistd.h>
6330 if (getuid() == 0) {
6331 printf("(I see you are running Configure as super-user...)\n");
6335 if (getpgrp(1) == 0)
6344 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6345 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
6347 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6348 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
6351 echo "I can't seem to compile and run the test program."
6353 xxx="a USG one, i.e. you use getpgrp()."
6355 # SVR4 systems can appear rather BSD-ish.
6358 xxx="a BSD one, i.e. you use getpgrp(pid)."
6362 xxx="probably a USG one, i.e. you use getpgrp()."
6367 echo "Assuming your getpgrp is $xxx" >&4
6376 : see if setpgrp exists
6377 set setpgrp d_setpgrp
6380 case "$d_setpgrp" in
6383 echo "Checking to see which flavor of setpgrp is in use..."
6386 #include <sys/types.h>
6388 # include <unistd.h>
6392 if (getuid() == 0) {
6393 printf("(I see you are running Configure as super-user...)\n");
6397 if (-1 == setpgrp(1, 1))
6400 if (setpgrp() != -1)
6406 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6407 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
6409 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6410 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
6413 echo "(I can't seem to compile and run the test program.)"
6415 xxx="a USG one, i.e. you use setpgrp()."
6417 # SVR4 systems can appear rather BSD-ish.
6420 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
6424 xxx="probably a USG one, i.e. you use setpgrp()."
6429 echo "Assuming your setpgrp is $xxx" >&4
6437 : see if bzero exists
6441 : check for lengths of integral types
6445 echo "Checking to see how big your integers are..." >&4
6446 $cat >intsize.c <<'EOCP'
6450 printf("intsize=%d;\n", sizeof(int));
6451 printf("longsize=%d;\n", sizeof(long));
6452 printf("shortsize=%d;\n", sizeof(short));
6457 if eval $compile_ok && ./intsize > /dev/null; then
6459 echo "Your integers are $intsize bytes long."
6460 echo "Your long integers are $longsize bytes long."
6461 echo "Your short integers are $shortsize bytes long."
6465 Help! I can't compile and run the intsize test program: please enlighten me!
6466 (This is probably a misconfiguration in your system or libraries, and
6467 you really ought to fix it. Still, I'll try anyway.)
6471 rp="What is the size of an integer (in bytes)?"
6475 rp="What is the size of a long integer (in bytes)?"
6479 rp="What is the size of a short integer (in bytes)?"
6485 $rm -f intsize intsize.*
6487 : see if signal is declared as pointer to function returning int or void
6489 xxx=`./findhdr signal.h`
6490 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
6491 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6492 echo "You have int (*signal())() instead of void." >&4
6494 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6495 echo "You have void (*signal())()." >&4
6497 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
6498 echo "You have int (*signal())() instead of void." >&4
6500 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
6501 echo "You have void (*signal())()." >&4
6504 case "$d_voidsig" in
6506 echo "I can't determine whether signal handler returns void or int..." >&4
6508 rp="What type does your signal handler return?"
6515 echo "As you already told me, signal handler returns void." >&4
6518 *) echo "As you already told me, signal handler returns int." >&4
6525 case "$d_voidsig" in
6526 "$define") signal_t="void";;
6531 : check for ability to cast large floats to 32-bit ints.
6533 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
6534 if $test "$intsize" -ge 4; then
6541 #include <sys/types.h>
6543 $signal_t blech(s) int s; { exit(3); }
6550 signal(SIGFPE, blech);
6552 /* Don't let compiler optimize the test away. Store the number
6553 in a writable string for gcc to pass to sscanf under HP/UX.
6555 sprintf(str, "2147483647");
6556 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
6560 /* x86 processors will probably give 0x8000 0000, which is a
6561 sign change. We don't want that. We want to mimic SPARC
6562 behavior here, which is to preserve the sign and give
6565 if (i32 != ($xxx) f)
6571 if eval $compile_ok; then
6575 echo "(I can't seem to compile the test program--assuming it can't)"
6583 echo "Nope, it can't."
6590 : check for ability to cast negative floats to unsigned
6592 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
6595 #include <sys/types.h>
6597 $signal_t blech(s) int s; { exit(7); }
6598 $signal_t blech_in_list(s) int s; { exit(4); }
6599 unsigned long dummy_long(p) unsigned long p; { return p; }
6600 unsigned int dummy_int(p) unsigned int p; { return p; }
6601 unsigned short dummy_short(p) unsigned short p; { return p; }
6605 unsigned long along;
6607 unsigned short ashort;
6611 /* Frustrate gcc-2.7.2's optimizer which failed this test with
6612 a direct f = -123. assignment. gcc-2.8.0 reportedly
6613 optimized the whole file away
6615 /* Store the number in a writable string for gcc to pass to
6618 sprintf(str, "-123");
6619 sscanf(str, "%lf", &f); /* f = -123.; */
6621 signal(SIGFPE, blech);
6622 along = (unsigned long)f;
6623 aint = (unsigned int)f;
6624 ashort = (unsigned short)f;
6625 if (along != (unsigned long)-123)
6627 if (aint != (unsigned int)-123)
6629 if (ashort != (unsigned short)-123)
6631 sprintf(str, "1073741824.");
6632 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
6635 along = (unsigned long)f;
6636 if (along != 0x80000000)
6640 along = (unsigned long)f;
6641 if (along != 0x7fffffff)
6645 along = (unsigned long)f;
6646 if (along != 0x80000001)
6650 signal(SIGFPE, blech_in_list);
6651 sprintf(str, "123.");
6652 sscanf(str, "%lf", &f); /* f = 123.; */
6653 along = dummy_long((unsigned long)f);
6654 aint = dummy_int((unsigned int)f);
6655 ashort = dummy_short((unsigned short)f);
6656 if (along != (unsigned long)123)
6658 if (aint != (unsigned int)123)
6660 if (ashort != (unsigned short)123)
6667 if eval $compile_ok; then
6671 echo "(I can't seem to compile the test program--assuming it can't)"
6674 case "$castflags" in
6679 echo "Nope, it can't."
6686 : see if vprintf exists
6688 if set vprintf val -f d_vprintf; eval $csym; $val; then
6689 echo 'vprintf() found.' >&4
6691 $cat >vprintf.c <<'EOF'
6692 #include <varargs.h>
6694 main() { xxx("foo"); }
6703 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
6707 if eval $compile && ./vprintf; then
6708 echo "Your vsprintf() returns (int)." >&4
6711 echo "Your vsprintf() returns (char*)." >&4
6715 echo 'vprintf() NOT found.' >&4
6725 : see if chown exists
6729 : see if chroot exists
6733 : see if chsize exists
6737 : check for const keyword
6739 echo 'Checking to see if your C compiler knows about "const"...' >&4
6740 $cat >const.c <<'EOCP'
6741 typedef struct spug { int drokk; } spug;
6748 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
6750 echo "Yup, it does."
6753 echo "Nope, it doesn't."
6758 : see if crypt exists
6760 if set crypt val -f d_crypt; eval $csym; $val; then
6761 echo 'crypt() found.' >&4
6765 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
6766 if $test -z "$cryptlib"; then
6767 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
6771 if $test -z "$cryptlib"; then
6772 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
6776 if $test -z "$cryptlib"; then
6777 cryptlib=`./loc libcrypt$_a "" $libpth`
6781 if $test -z "$cryptlib"; then
6782 echo 'crypt() NOT found.' >&4
6791 : get csh whereabouts
6793 'csh') val="$undef" ;;
6798 : Respect a hint or command line value for full_csh.
6800 '') full_csh=$csh ;;
6803 : see if cuserid exists
6804 set cuserid d_cuserid
6807 : see if this is a limits.h system
6808 set limits.h i_limits
6811 : see if this is a float.h system
6815 : See if number of significant digits in a double precision number is known
6817 $cat >dbl_dig.c <<EOM
6827 printf("Contains DBL_DIG");
6830 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
6831 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
6832 echo "DBL_DIG found." >&4
6835 echo "DBL_DIG NOT found." >&4
6843 if $test X"$use64bits" = X"$define"; then
6844 : see if dbminit64 exists
6845 set dbminit64 d_dbminit64
6848 : see if dbmclose64 exists
6849 set dbmclose64 d_dbmclose64
6852 : see if fetch64 exists
6853 set fetch64 d_fetch64
6856 : see if store64 exists
6857 set store64 d_store64
6860 : see if delete64 exists
6861 set delete64 d_delete64
6864 : see if firstkey64 exists
6865 set firstkey64 d_firstkey64
6868 : see if nextkey64 exists
6869 set nextkey64 d_nextkey64
6873 for xxx in d_dbminit64 d_dbmclose64 d_fetch64 d_store64 d_delete64 d_firstkey64 d_nextkey64
6880 : see if difftime exists
6881 set difftime d_difftime
6884 : see if sys/stat.h is available
6885 set sys/stat.h i_sysstat
6888 : see if this is a dirent system
6890 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
6892 echo "<dirent.h> found." >&4
6895 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
6896 echo "<sys/dir.h> found." >&4
6899 xinc=`./findhdr sys/ndir.h`
6901 echo "<dirent.h> NOT found." >&4
6906 : Look for type of directory structure.
6908 $cppstdin $cppflags $cppminus < "$xinc" > try.c
6910 case "$direntrytype" in
6913 $define) guess1='struct dirent' ;;
6914 *) guess1='struct direct' ;;
6917 *) guess1="$direntrytype"
6922 'struct dirent') guess2='struct direct' ;;
6923 *) guess2='struct dirent' ;;
6926 if $contains "$guess1" try.c >/dev/null 2>&1; then
6927 direntrytype="$guess1"
6928 echo "Your directory entries are $direntrytype." >&4
6929 elif $contains "$guess2" try.c >/dev/null 2>&1; then
6930 direntrytype="$guess2"
6931 echo "Your directory entries seem to be $direntrytype." >&4
6933 echo "I don't recognize your system's directory entries." >&4
6934 rp="What type is used for directory entries on this system?"
6942 : see if the directory entry stores field length
6944 $cppstdin $cppflags $cppminus < "$xinc" > try.c
6945 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
6946 echo "Good, your directory entry keeps length information in d_namlen." >&4
6949 echo "Your directory entry does not know about the d_namlen field." >&4
6956 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
6957 while $test $# -ge 2; do
6959 $define) echo "#include <$2>";;
6963 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
6964 if eval $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6974 if $test X"$use64bits" = X"$define"; then
6975 : see if fstat64 exists
6976 set fstat64 d_fstat64
6979 : see if ftruncate64 exists
6980 set ftruncate64 d_ftruncate64
6983 : see if lockf64 exists
6984 set lockf64 d_lockf64
6987 : see if lseek64 exists
6988 set lseek64 d_lseek64
6991 : see if lstat64 exists
6992 set lstat64 d_lstat64
6995 : see if open64 exists
6999 : see if opendir64 exists
7000 set opendir64 d_opendir64
7003 : see if readdir64 exists
7004 set readdir64 d_readdir64
7007 : see if seekdir64 exists
7008 set seekdir64 d_seekdir64
7011 : see if stat64 exists
7015 : see if telldir64 exists
7016 set telldir64 d_telldir64
7019 : see if truncate64 exists
7020 set truncate64 d_truncate64
7025 echo $n "Checking to see if your system supports off64_t...$c" >&4
7027 #include <sys/types.h>
7028 off64_t foo() { off64_t x; x = 7; return x; }'
7030 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7032 echo " Yup, it does." >&4
7035 echo " Nope, it doesn't." >&4
7043 echo $n "Checking to see if your system supports ino64_t...$c" >&4
7045 case "$i_sysstat" in
7048 #include <sys/types.h>
7049 #include <sys/stat.h>
7050 ino64_t foo() { ino64_t x; x = 7; return x; }'
7052 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7058 if $test "X$val" = X"$define"; then
7059 echo " Yup, it does." >&4
7061 echo " Nope, it doesn't." >&4
7066 : check for struct flock64
7068 echo "Checking to see if your system supports struct flock64..." >&4
7070 set d_flock64s flock64 l_len define fcntl.h
7077 case "$d_flock64s" in
7078 "$define") echo "Yup, it does." >&4
7080 *) echo "Nope, it doesn't." >&4
7084 : check for struct dirent64
7086 echo "Checking to see if your system supports struct dirent64..." >&4
7087 set d_dirent64s dirent64 d_off $i_dirent dirent.h
7089 case "$d_flock64s" in
7090 "$define") echo "Yup, it does." >&4
7092 *) echo "Nope, it doesn't." >&4
7098 for xxx in d_fstat64 d_ftruncate64 d_lockf64 d_lseek64 d_lstat64 d_open64 d_opendir64 d_readdir64 d_seekdir64 d_stat64 d_telldir64 d_truncate64 d_off64t d_ino64t d_flock64s d_dirent64s
7105 : see if dlerror exists
7108 set dlerror d_dlerror
7112 : see if dlfcn is available
7120 On a few systems, the dynamically loaded modules that perl generates and uses
7121 will need a different extension than shared libs. The default will probably
7129 rp='What is the extension of dynamically loaded modules'
7138 : Check if dlsym need a leading underscore
7144 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7145 $cat >dyna.c <<'EOM'
7154 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7156 #include <sys/types.h>
7170 int mode = RTLD_LAZY ;
7172 handle = dlopen("./dyna.$dlext", mode) ;
7173 if (handle == NULL) {
7178 symbol = dlsym(handle, "fred") ;
7179 if (symbol == NULL) {
7180 /* try putting a leading underscore */
7181 symbol = dlsym(handle, "_fred") ;
7182 if (symbol == NULL) {
7195 : Call the object file tmp-dyna.o in case dlext=o.
7196 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
7197 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
7198 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
7199 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
7202 1) echo "Test program failed using dlopen." >&4
7203 echo "Perhaps you should not use dynamic loading." >&4;;
7204 2) echo "Test program failed using dlsym." >&4
7205 echo "Perhaps you should not use dynamic loading." >&4;;
7206 3) echo "dlsym needs a leading underscore" >&4
7208 4) echo "dlsym doesn't need a leading underscore." >&4;;
7211 echo "I can't compile and run the test program." >&4
7216 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
7221 hasproto='varname=$1; func=$2; shift; shift;
7222 while $test $# -ge 2; do
7224 $define) echo "#include <$2>";;
7228 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
7229 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
7230 echo "$func() prototype found.";
7233 echo "$func() prototype NOT found.";
7238 $rm -f try.c tryout.c'
7240 : see if prototype for drand48 is available
7242 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
7245 : see if dup2 exists
7249 : see if eaccess exists
7250 set eaccess d_eaccess
7253 : see if endgrent exists
7254 set endgrent d_endgrent
7257 : see if endhostent exists
7258 set endhostent d_endhent
7261 : see if endnetent exists
7262 set endnetent d_endnent
7265 : see if endprotoent exists
7266 set endprotoent d_endpent
7269 : see if endpwent exists
7270 set endpwent d_endpwent
7273 : see if endservent exists
7274 set endservent d_endsent
7277 : Locate the flags for 'open()'
7279 $cat >open3.c <<'EOCP'
7280 #include <sys/types.h>
7285 #include <sys/file.h>
7296 : check sys/file.h first to get FREAD on Sun
7297 if $test `./findhdr sys/file.h` && \
7298 set open3 -DI_SYS_FILE && eval $compile; then
7300 echo "<sys/file.h> defines the O_* constants..." >&4
7302 echo "and you have the 3 argument form of open()." >&4
7305 echo "but not the 3 argument form of open(). Oh, well." >&4
7308 elif $test `./findhdr fcntl.h` && \
7309 set open3 -DI_FCNTL && eval $compile; then
7311 echo "<fcntl.h> defines the O_* constants..." >&4
7313 echo "and you have the 3 argument form of open()." >&4
7316 echo "but not the 3 argument form of open(). Oh, well." >&4
7321 echo "I can't find the O_* constant definitions! You got problems." >&4
7327 : check for non-blocking I/O stuff
7328 case "$h_sysfile" in
7329 true) echo "#include <sys/file.h>" > head.c;;
7332 true) echo "#include <fcntl.h>" > head.c;;
7333 *) echo "#include <sys/fcntl.h>" > head.c;;
7338 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
7339 case "$o_nonblock" in
7342 $cat >>try.c <<'EOCP'
7345 printf("O_NONBLOCK\n");
7349 printf("O_NDELAY\n");
7353 printf("FNDELAY\n");
7360 if eval $compile_ok; then
7362 case "$o_nonblock" in
7363 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
7364 *) echo "Seems like we can use $o_nonblock.";;
7367 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
7370 *) echo "Using $hint value $o_nonblock.";;
7372 $rm -f try try.* .out core
7375 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
7381 #include <sys/types.h>
7383 #define MY_O_NONBLOCK $o_nonblock
7384 #ifndef errno /* XXX need better Configure test */
7387 $signal_t blech(x) int x; { exit(3); }
7389 $cat >> try.c <<'EOCP'
7397 pipe(pd); /* Down: child -> parent */
7398 pipe(pu); /* Up: parent -> child */
7401 close(pd[1]); /* Parent reads from pd[0] */
7402 close(pu[0]); /* Parent writes (blocking) to pu[1] */
7403 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
7405 signal(SIGALRM, blech);
7407 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
7409 sprintf(string, "%d\n", ret);
7410 write(2, string, strlen(string));
7413 if (errno == EAGAIN) {
7419 if (errno == EWOULDBLOCK)
7420 printf("EWOULDBLOCK\n");
7423 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
7424 sleep(2); /* Give it time to close our pipe */
7426 ret = read(pd[0], buf, 1); /* Should read EOF */
7428 sprintf(string, "%d\n", ret);
7429 write(3, string, strlen(string));
7433 close(pd[0]); /* We write to pd[1] */
7434 close(pu[1]); /* We read from pu[0] */
7435 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
7436 close(pd[1]); /* Pipe pd is now fully closed! */
7437 exit(0); /* Bye bye, thank you for playing! */
7441 if eval $compile_ok; then
7442 echo "$startsh" >mtry
7443 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
7445 ./mtry >/dev/null 2>&1
7447 0) eagain=`$cat try.out`;;
7448 1) echo "Could not perform non-blocking setting!";;
7449 2) echo "I did a successful read() for something that was not there!";;
7450 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
7451 *) echo "Something terribly wrong happened during testing.";;
7453 rd_nodata=`$cat try.ret`
7454 echo "A read() system call with no data present returns $rd_nodata."
7455 case "$rd_nodata" in
7458 echo "(That's peculiar, fixing that to be -1.)"
7464 echo "Forcing errno EAGAIN on read() with no data available."
7468 echo "Your read() sets errno to $eagain when no data is available."
7471 status=`$cat try.err`
7473 0) echo "And it correctly returns 0 to signal EOF.";;
7474 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
7475 *) echo "However, your read() returns '$status' on EOF??";;
7478 if test "$status" = "$rd_nodata"; then
7479 echo "WARNING: you can't distinguish between EOF and no data!"
7483 echo "I can't compile the test program--assuming errno EAGAIN will do."
7490 echo "Using $hint value $eagain."
7491 echo "Your read() returns $rd_nodata when no data is present."
7492 case "$d_eofnblk" in
7493 "$define") echo "And you can see EOF because read() returns 0.";;
7494 "$undef") echo "But you can't see EOF status from read() returned value.";;
7496 echo "(Assuming you can't see EOF status from read anyway.)"
7502 $rm -f try try.* .out core head.c mtry
7504 : see if fchmod exists
7508 : see if fchown exists
7512 : see if this is an fcntl system
7518 : see whether socket exists
7520 $echo $n "Hmm... $c" >&4
7521 if set socket val -f d_socket; eval $csym; $val; then
7522 echo "Looks like you have Berkeley networking support." >&4
7524 if set setsockopt val -f; eval $csym; $val; then
7527 echo "...but it uses the old BSD 4.1c interface, rather than 4.2" >&4
7531 if $contains socklib libc.list >/dev/null 2>&1; then
7532 echo "Looks like you have Berkeley networking support." >&4
7534 : we will have to assume that it supports the 4.2 BSD interface
7537 echo "You don't have Berkeley networking in libc$_a..." >&4
7538 if test "X$d_socket" = "X$define"; then
7539 echo "...but you seem to believe that you have sockets." >&4
7541 for net in net socket
7543 if test -f /usr/lib/lib$net$_a; then
7544 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
7545 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
7546 if $contains socket libc.list >/dev/null 2>&1; then
7551 echo "...but the Wollongong group seems to have hacked it in." >&4
7552 sockethdr="-I/usr/netinclude"
7555 echo "Found Berkeley sockets interface in lib$net." >& 4
7556 if $contains setsockopt libc.list >/dev/null 2>&1; then
7559 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7566 if test "X$d_socket" != "X$define"; then
7567 echo "or anywhere else I see." >&4
7575 : see if socketpair exists
7576 set socketpair d_sockpair
7579 : see if sys/select.h has to be included
7580 set sys/select.h i_sysselct
7583 : see if we should include time.h, sys/time.h, or both
7585 if test "X$timeincl" = X; then
7586 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
7587 $echo $n "I'm now running the test program...$c"
7588 $cat >try.c <<'EOCP'
7589 #include <sys/types.h>
7594 #ifdef SYSTIMEKERNEL
7597 #include <sys/time.h>
7600 #include <sys/select.h>
7609 struct timezone tzp;
7611 if (foo.tm_sec == foo.tm_sec)
7614 if (bar.tv_sec == bar.tv_sec)
7621 for s_timezone in '-DS_TIMEZONE' ''; do
7623 for s_timeval in '-DS_TIMEVAL' ''; do
7624 for i_systimek in '' '-DSYSTIMEKERNEL'; do
7625 for i_time in '' '-DI_TIME'; do
7626 for i_systime in '-DI_SYSTIME' ''; do
7629 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
7630 if eval $compile; then
7631 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
7635 $echo $n "Succeeded with $flags$c"
7647 *SYSTIMEKERNEL*) i_systimek="$define"
7648 timeincl=`./findhdr sys/time.h`
7649 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
7650 *) i_systimek="$undef";;
7653 *I_TIME*) i_time="$define"
7654 timeincl=`./findhdr time.h`" $timeincl"
7655 echo "We'll include <time.h>." >&4;;
7656 *) i_time="$undef";;
7659 *I_SYSTIME*) i_systime="$define"
7660 timeincl=`./findhdr sys/time.h`" $timeincl"
7661 echo "We'll include <sys/time.h>." >&4;;
7662 *) i_systime="$undef";;
7667 : check for fd_set items
7670 Checking to see how well your C compiler handles fd_set and friends ...
7672 $cat >fd_set.c <<EOCP
7673 #$i_systime I_SYS_TIME
7674 #$i_sysselct I_SYS_SELECT
7675 #$d_socket HAS_SOCKET
7676 #include <sys/types.h>
7678 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
7681 #include <sys/time.h>
7684 #include <sys/select.h>
7693 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
7700 set fd_set -DTRYBITS
7701 if eval $compile; then
7702 d_fds_bits="$define"
7704 echo "Well, your system knows about the normal fd_set typedef..." >&4
7706 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
7707 d_fd_macros="$define"
7710 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
7712 d_fd_macros="$undef"
7716 Hmm, your compiler has some difficulty with fd_set. Checking further...
7719 if eval $compile; then
7722 echo "Well, your system has some sort of fd_set available..." >&4
7724 echo "and you have the normal fd_set macros." >&4
7725 d_fd_macros="$define"
7728 but not the normal fd_set macros! Gross! More work for me...
7730 d_fd_macros="$undef"
7733 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
7736 d_fd_macros="$undef"
7741 : see if fgetpos exists
7742 set fgetpos d_fgetpos
7746 if $test X"$use64bits" = X"$define"; then
7747 : see if fgetpos64 exists
7748 set fgetpos64 d_fgetpos64
7751 : see if fopen64 exists
7752 set freopen64 d_fopen64
7755 : see if freopen64 exists
7756 set freopen64 d_freopen64
7759 : see if fseek64 exists
7760 set fseek64 d_fseek64
7763 : see if fseeko64 exists
7764 set fseeko64 d_fseeko64
7767 : see if fsetpos64 exists
7768 set fsetpos64 d_fsetpos64
7771 : see if ftell64 exists
7772 set ftell64 d_ftell64
7775 : see if ftello64 exists
7776 set ftello64 d_ftello64
7779 : see if tmpfile64 exists
7780 set tmpfile64 d_tmpfile64
7784 for xxx in d_fgetpos64 d_fopen64 d_freopen64 d_fseek64 d_fseeko64 d_fsetpos64 d_ftell64 d_ftello64 d_tmpfile64
7791 : see if flock exists
7795 : see if fork exists
7799 : see if pathconf exists
7800 set pathconf d_pathconf
7803 : see if fpathconf exists
7804 set fpathconf d_fpathconf
7807 : see if fseeko exists
7811 : see if fsetpos exists
7812 set fsetpos d_fsetpos
7815 : see if ftello exists
7819 : see if getgrent exists
7820 set getgrent d_getgrent
7823 : see if gethostbyaddr exists
7824 set gethostbyaddr d_gethbyaddr
7827 : see if gethostbyname exists
7828 set gethostbyname d_gethbyname
7831 : see if gethostent exists
7832 set gethostent d_gethent
7835 : see how we will look up host name
7838 : dummy stub to allow use of elif
7839 elif set gethostname val -f d_gethname; eval $csym; $val; then
7840 echo 'gethostname() found.' >&4
7841 d_gethname="$define"
7843 elif set uname val -f d_uname; eval $csym; $val; then
7846 uname() was found, but you're running xenix, and older versions of xenix
7847 have a broken uname(). If you don't really know whether your xenix is old
7848 enough to have a broken system call, use the default answer.
7855 rp='Is your uname() broken?'
7858 n*) d_uname="$define"; call=uname;;
7861 echo 'uname() found.' >&4
7866 case "$d_gethname" in
7867 '') d_gethname="$undef";;
7870 '') d_uname="$undef";;
7872 case "$d_uname$d_gethname" in
7877 Every now and then someone has a $call() that lies about the hostname
7878 but can't be fixed for political or economic reasons. If you wish, I can
7879 pretend $call() isn't there and maybe compute hostname at run-time
7880 thanks to the '$phostname' command.
7883 rp="Shall I ignore $call() from now on?"
7886 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
7889 case "$phostname" in
7891 *) case "$aphostname" in
7897 file=`./loc $file $file $pth`
7898 aphostname=`echo $file $*`
7903 case "$d_uname$d_gethname" in
7906 case "$phostname" in
7908 echo "There will be no way for $package to get your hostname." >&4;;
7910 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
7914 case "$d_phostname" in
7915 '') d_phostname="$undef";;
7918 : see if this is a netdb.h system
7922 : see if prototypes for various gethostxxx netdb.h functions are available
7924 set d_gethostprotos gethostent $i_netdb netdb.h
7927 : see if getlogin exists
7928 set getlogin d_getlogin
7931 : see if getnetbyaddr exists
7932 set getnetbyaddr d_getnbyaddr
7935 : see if getnetbyname exists
7936 set getnetbyname d_getnbyname
7939 : see if getnetent exists
7940 set getnetent d_getnent
7943 : see if prototypes for various getnetxxx netdb.h functions are available
7945 set d_getnetprotos getnetent $i_netdb netdb.h
7949 : see if getprotobyname exists
7950 set getprotobyname d_getpbyname
7953 : see if getprotobynumber exists
7954 set getprotobynumber d_getpbynumber
7957 : see if getprotoent exists
7958 set getprotoent d_getpent
7961 : see if getpgid exists
7962 set getpgid d_getpgid
7965 : see if getpgrp2 exists
7966 set getpgrp2 d_getpgrp2
7969 : see if getppid exists
7970 set getppid d_getppid
7973 : see if getpriority exists
7974 set getpriority d_getprior
7977 : see if prototypes for various getprotoxxx netdb.h functions are available
7979 set d_getprotoprotos getprotoent $i_netdb netdb.h
7982 : see if getpwent exists
7983 set getpwent d_getpwent
7987 : see if getservbyname exists
7988 set getservbyname d_getsbyname
7991 : see if getservbyport exists
7992 set getservbyport d_getsbyport
7995 : see if getservent exists
7996 set getservent d_getsent
7999 : see if prototypes for various getservxxx netdb.h functions are available
8001 set d_getservprotos getservent $i_netdb netdb.h
8004 : see if gettimeofday or ftime exists
8005 set gettimeofday d_gettimeod
8007 case "$d_gettimeod" in
8013 val="$undef"; set d_ftime; eval $setvar
8016 case "$d_gettimeod$d_ftime" in
8019 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8023 : see if this is an grp system
8029 xxx=`./findhdr grp.h`
8030 $cppstdin $cppflags $cppminus < $xxx >$$.h
8032 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8044 set d_grpasswd; eval $setvar
8048 : see if this is a netinet/in.h or sys/in.h system
8049 set netinet/in.h i_niin sys/in.h i_sysin
8052 : see if arpa/inet.h has to be included
8053 set arpa/inet.h i_arpainet
8056 : see if htonl --and friends-- exists
8061 : Maybe they are macros.
8066 #include <sys/types.h>
8067 #$i_niin I_NETINET_IN
8069 #$i_arpainet I_ARPA_INET
8071 #include <netinet/in.h>
8077 #include <arpa/inet.h>
8080 printf("Defined as a macro.");
8083 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8084 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8086 echo "But it seems to be defined as a macro." >&4
8094 : see which of string.h or strings.h is needed
8096 strings=`./findhdr string.h`
8097 if $test "$strings" && $test -r "$strings"; then
8098 echo "Using <string.h> instead of <strings.h>." >&4
8102 strings=`./findhdr strings.h`
8103 if $test "$strings" && $test -r "$strings"; then
8104 echo "Using <strings.h> instead of <string.h>." >&4
8106 echo "No string header found -- You'll surely have problems." >&4
8112 "$undef") strings=`./findhdr strings.h`;;
8113 *) strings=`./findhdr string.h`;;
8118 if set index val -f; eval $csym; $val; then
8119 if set strchr val -f d_strchr; eval $csym; $val; then
8120 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8123 echo "strchr() found." >&4
8127 echo "index() found." >&4
8132 echo "index() found." >&4
8135 if set strchr val -f d_strchr; eval $csym; $val; then
8138 echo "strchr() found." >&4
8140 echo "No index() or strchr() found!" >&4
8145 set d_strchr; eval $setvar
8147 set d_index; eval $setvar
8149 : check whether inet_aton exists
8150 set inet_aton d_inetaton
8153 : see if inttypes.h is available
8154 : we want a real compile instead of Inhdr because some systems
8155 : have an inttypes.h which includes non-existent headers
8158 #include <inttypes.h>
8160 static int32_t foo32 = 0x12345678;
8164 if eval $compile; then
8165 echo "<inttypes.h> found." >&4
8168 echo "<inttypes.h> NOT found." >&4
8176 case "$use64bits" in
8179 echo $n "Checking to see if your system supports int64_t...$c" >&4
8181 #include <sys/types.h>
8182 #$i_inttypes I_INTTYPES
8184 #include <inttypes.h>
8186 int64_t foo() { int64_t x; x = 7; return x; }
8188 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8190 echo " Yup, it does." >&4
8193 echo " Nope, it doesn't." >&4
8206 $cat >isascii.c <<'EOCP'
8218 if eval $compile; then
8219 echo "isascii() found." >&4
8222 echo "isascii() NOT found." >&4
8229 : see if killpg exists
8233 : see if lchown exists
8235 $cat > try.c <<'EOCP'
8236 /* System header to define __stub macros and hopefully few prototypes,
8237 which can conflict with char lchown(); below. */
8239 /* Override any gcc2 internal prototype to avoid an error. */
8240 /* We use char because int might match the return type of a gcc2
8241 builtin and then its argument prototype would still apply. */
8244 /* The GNU C library defines this for functions which it implements
8245 to always fail with ENOSYS. Some functions are actually named
8246 something starting with __ and the normal name is an alias. */
8247 #if defined (__stub_lchown) || defined (__stub___lchown)
8255 if eval $compile; then
8256 $echo "lchown() found." >&4
8259 $echo "lchown() NOT found." >&4
8265 : see if link exists
8269 : see if localeconv exists
8270 set localeconv d_locconv
8273 : see if lockf exists
8277 : check for length of double
8279 case "$doublesize" in
8281 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
8282 $cat >try.c <<'EOCP'
8286 printf("%d\n", sizeof(double));
8290 if eval $compile_ok; then
8292 $echo " $doublesize bytes." >&4
8295 echo "(I can't seem to compile the test program. Guessing...)"
8296 rp="What is the size of a double precision number (in bytes)?"
8304 : check for long doubles
8306 echo $n "Checking to see if your system supports long doubles...$c" >&4
8307 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
8308 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8310 echo " Yup, it does." >&4
8313 echo " Nope, it doesn't." >&4
8319 : check for length of long double
8320 case "${d_longdbl}${longdblsize}" in
8323 $echo $n "Checking to see how big your long doubles are...$c" >&4
8324 $cat >try.c <<'EOCP'
8328 printf("%d\n", sizeof(long double));
8332 if eval $compile; then
8334 $echo " $longdblsize bytes." >&4
8338 echo "(I can't seem to compile the test program. Guessing...)" >&4
8339 rp="What is the size of a long double (in bytes)?"
8343 if $test "X$doublesize" = "X$longdblsize"; then
8344 echo "(That isn't any different from an ordinary double.)"
8350 : check for long long
8352 echo $n "Checking to see if your system supports long long...$c" >&4
8353 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
8354 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8356 echo " Yup, it does." >&4
8359 echo " Nope, it doesn't." >&4
8365 : check for length of long long
8366 case "${d_longlong}${longlongsize}" in
8369 $echo $n "Checking to see how big your long longs are...$c" >&4
8370 $cat >try.c <<'EOCP'
8374 printf("%d\n", sizeof(long long));
8378 if eval $compile_ok; then
8379 longlongsize=`./try`
8380 $echo " $longlongsize bytes." >&4
8384 echo "(I can't seem to compile the test program. Guessing...)"
8385 rp="What is the size of a long long (in bytes)?"
8389 if $test "X$longsize" = "X$longlongsize"; then
8390 echo "(That isn't any different from an ordinary long.)"
8396 : see if lstat exists
8400 : see if mblen exists
8404 : see if mbstowcs exists
8405 set mbstowcs d_mbstowcs
8408 : see if mbtowc exists
8412 : see if memcmp exists
8416 : see if memcpy exists
8420 : see if memmove exists
8421 set memmove d_memmove
8424 : see if memset exists
8428 : see if mkdir exists
8432 : see if mkfifo exists
8436 : see if mktime exists
8440 : see if msgctl exists
8444 : see if msgget exists
8448 : see if msgsnd exists
8452 : see if msgrcv exists
8456 : see how much of the 'msg*(2)' library is present.
8459 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
8460 *"$undef"*) h_msg=false;;
8464 case "`ipcs 2>&1`" in
8465 "SVID messages"*"not configured"*)
8466 echo "Your $osname does not have the msg*(2) configured." >&4
8481 : we could also check for sys/ipc.h ...
8482 if $h_msg && $test `./findhdr sys/msg.h`; then
8483 echo "You have the full msg*(2) library." >&4
8486 echo "You don't have the full msg*(2) library." >&4
8492 : see if nice exists
8496 : see if pause exists
8500 : see if pipe exists
8504 : see if poll exists
8508 : how to create joinable pthreads
8509 if test "X$usethreads" = "X$define"; then
8511 echo "Checking what constant to use for creating joinable pthreads..." >&4
8512 $cat >try.c <<'EOCP'
8513 #include <pthread.h>
8515 int detachstate = JOINABLE;
8518 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
8519 if eval $compile; then
8520 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&2
8522 set d_pthread_create_joinable
8525 set pthread_create_joinable
8528 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
8529 if eval $compile; then
8530 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&2
8532 set d_pthread_create_joinable
8534 val=PTHREAD_CREATE_UNDETACHED
8535 set pthread_create_joinable
8538 set try -DJOINABLE=__UNDETACHED
8539 if eval $compile; then
8540 echo "You seem to use __UNDETACHED." >&2
8542 set d_pthread_create_joinable
8545 set pthread_create_joinable
8548 echo "Egads, nothing obvious found. Guessing that you use 0." >&2
8550 set d_pthread_create_joinable
8553 set pthread_create_joinable
8560 d_pthread_create_joinable="$undef"
8561 pthread_create_joinable=0
8565 : see whether the various POSIXish _yields exist
8567 #include <pthread.h>
8573 #ifdef PTHREAD_YIELD
8576 #ifdef PTHREAD_YIELD_NULL
8577 pthread_yield(NULL);
8583 : see if sched_yield exists
8584 set try -DSCHED_YIELD
8585 if eval $compile; then
8587 sched_yield='sched_yield()'
8591 case "$usethreads" in
8594 $define) echo 'sched_yield() found.' >&4 ;;
8595 *) echo 'sched_yield() NOT found.' >&4 ;;
8601 : see if pthread_yield exists
8602 set try -DPTHREAD_YIELD
8603 if eval $compile; then
8605 case "$sched_yield" in
8606 '') sched_yield='pthread_yield()' ;;
8609 set try -DPTHREAD_YIELD_NULL
8610 if eval $compile; then
8612 case "$sched_yield" in
8613 '') sched_yield='pthread_yield(NULL)' ;;
8619 case "$usethreads" in
8622 $define) echo 'pthread_yield() found.' >&4 ;;
8623 *) echo 'pthread_yield() NOT found.' >&4 ;;
8630 case "$sched_yield" in
8631 '') sched_yield=undef ;;
8636 : see if this is a pwd.h system
8642 xxx=`./findhdr pwd.h`
8643 $cppstdin $cppflags $cppminus < $xxx >$$.h
8645 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
8653 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
8661 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
8669 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
8677 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
8685 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
8693 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
8701 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
8713 set d_pwquota; eval $setvar
8714 set d_pwage; eval $setvar
8715 set d_pwchange; eval $setvar
8716 set d_pwclass; eval $setvar
8717 set d_pwexpire; eval $setvar
8718 set d_pwcomment; eval $setvar
8719 set d_pwgecos; eval $setvar
8720 set d_pwpasswd; eval $setvar
8724 : see if readdir and friends exist
8725 set readdir d_readdir
8727 set seekdir d_seekdir
8729 set telldir d_telldir
8731 set rewinddir d_rewinddir
8734 : see if readlink exists
8735 set readlink d_readlink
8738 : see if rename exists
8742 : see if rmdir exists
8746 : see if memory.h is available.
8751 : See if it conflicts with string.h
8757 $cppstdin $cppflags $cppminus < $strings > mem.h
8758 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
8760 echo "We won't be including <memory.h>."
8770 : can bcopy handle overlapping blocks?
8775 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
8782 $cat >>try.c <<'EOCP'
8785 # include <memory.h>
8788 # include <stdlib.h>
8791 # include <string.h>
8793 # include <strings.h>
8796 # include <unistd.h> /* Needed for NetBSD */
8800 char buf[128], abc[128];
8806 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
8808 for (align = 7; align >= 0; align--) {
8809 for (len = 36; len; len--) {
8812 for (off = 1; off <= len; off++) {
8813 bcopy(b, b+off, len);
8814 bcopy(b+off, b, len);
8815 if (bcmp(b, abc, len))
8824 if eval $compile_ok; then
8825 if ./try 2>/dev/null; then
8829 echo "It can't, sorry."
8830 case "$d_memmove" in
8831 "$define") echo "But that's Ok since you have memmove()." ;;
8835 echo "(I can't compile the test program, so we'll assume not...)"
8836 case "$d_memmove" in
8837 "$define") echo "But that's Ok since you have memmove()." ;;
8842 $rm -f try.* try core
8846 : can memcpy handle overlapping blocks?
8851 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
8858 $cat >>try.c <<'EOCP'
8861 # include <memory.h>
8864 # include <stdlib.h>
8867 # include <string.h>
8869 # include <strings.h>
8872 # include <unistd.h> /* Needed for NetBSD */
8876 char buf[128], abc[128];
8882 /* Copy "abcde..." string to char abc[] so that gcc doesn't
8883 try to store the string in read-only memory. */
8884 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
8886 for (align = 7; align >= 0; align--) {
8887 for (len = 36; len; len--) {
8889 memcpy(b, abc, len);
8890 for (off = 1; off <= len; off++) {
8891 memcpy(b+off, b, len);
8892 memcpy(b, b+off, len);
8893 if (memcmp(b, abc, len))
8902 if eval $compile_ok; then
8903 if ./try 2>/dev/null; then
8907 echo "It can't, sorry."
8908 case "$d_memmove" in
8909 "$define") echo "But that's Ok since you have memmove()." ;;
8913 echo "(I can't compile the test program, so we'll assume not...)"
8914 case "$d_memmove" in
8915 "$define") echo "But that's Ok since you have memmove()." ;;
8920 $rm -f try.* try core
8924 : can memcmp be trusted to compare relative magnitude?
8929 echo "Checking if your memcmp() can compare relative magnitude..." >&4
8936 $cat >>try.c <<'EOCP'
8939 # include <memory.h>
8942 # include <stdlib.h>
8945 # include <string.h>
8947 # include <strings.h>
8950 # include <unistd.h> /* Needed for NetBSD */
8956 if ((a < b) && memcmp(&a, &b, 1) < 0)
8962 if eval $compile_ok; then
8963 if ./try 2>/dev/null; then
8967 echo "No, it can't (it uses signed chars)."
8970 echo "(I can't compile the test program, so we'll assume not...)"
8974 $rm -f try.* try core
8978 : see if select exists
8982 : see if semctl exists
8986 : see if semget exists
8990 : see if semop exists
8994 : see how much of the 'sem*(2)' library is present.
8997 case "$d_semctl$d_semget$d_semop" in
8998 *"$undef"*) h_sem=false;;
9002 case "`ipcs 2>&1`" in
9003 "SVID messages"*"not configured"*)
9004 echo "Your $osname does not have the sem*(2) configured." >&4
9017 : we could also check for sys/ipc.h ...
9018 if $h_sem && $test `./findhdr sys/sem.h`; then
9019 echo "You have the full sem*(2) library." >&4
9022 echo "You don't have the full sem*(2) library." >&4
9028 : see whether sys/sem.h defines union semun
9030 $cat > try.c <<'END'
9031 #include <sys/types.h>
9032 #include <sys/ipc.h>
9033 #include <sys/sem.h>
9034 int main () { union semun semun; semun.buf = 0; }
9037 if eval $compile; then
9038 echo "You have union semun in <sys/sem.h>." >&4
9041 echo "You do not have union semun in <sys/sem.h>." >&4
9044 $rm -f try try.c try.h
9048 : see how to do semctl IPC_STAT
9051 : see whether semctl IPC_STAT can use union semun
9056 # define S_IRUSR S_IREAD
9057 # define S_IWUSR S_IWRITE
9058 # define S_IXUSR S_IEXEC
9060 # define S_IRUSR 0400
9061 # define S_IWUSR 0200
9062 # define S_IXUSR 0100
9064 # define S_IRGRP (S_IRUSR>>3)
9065 # define S_IWGRP (S_IWUSR>>3)
9066 # define S_IXGRP (S_IXUSR>>3)
9067 # define S_IROTH (S_IRUSR>>6)
9068 # define S_IWOTH (S_IWUSR>>6)
9069 # define S_IXOTH (S_IXUSR>>6)
9072 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9073 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9074 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9079 #include <sys/types.h>
9080 #include <sys/ipc.h>
9081 #include <sys/sem.h>
9082 #include <sys/stat.h>
9089 #$d_union_semun HAS_UNION_SEMUN
9092 #ifndef HAS_UNION_SEMUN
9095 struct semid_ds *buf;
9096 unsigned short *array;
9102 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9103 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9105 struct semid_ds argbuf;
9108 st = semctl(sem, 0, IPC_STAT, arg);
9112 # endif /* IPC_STAT */
9113 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9115 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9116 # endif /* IPC_RMID */
9117 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9119 #endif /* IPC_PRIVATE && ... */
9120 printf("semget failed: errno = %d\n", errno);
9126 if eval $compile; then
9129 semun) val="$define" ;;
9135 case "$d_semctl_semun" in
9137 echo "You can use union semun for semctl IPC_STAT." >&4
9140 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9145 : see whether semctl IPC_STAT can use struct semid_ds pointer
9146 $cat > try.c <<'END'
9147 #include <sys/types.h>
9148 #include <sys/ipc.h>
9149 #include <sys/sem.h>
9150 #include <sys/stat.h>
9158 struct semid_ds arg;
9161 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9162 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9165 st = semctl(sem, 0, IPC_STAT, &arg);
9167 printf("semid_ds\n");
9169 # endif /* IPC_STAT */
9170 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9172 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9173 # endif /* IPC_RMID */
9174 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9176 #endif /* IPC_PRIVATE && ... */
9177 printf("semget failed: errno = %d\n", errno);
9184 if eval $compile; then
9187 semid_ds) val="$define" ;;
9191 set d_semctl_semid_ds
9193 case "$d_semctl_semid_ds" in
9195 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
9197 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
9204 # We do not have the full sem*(2) library, so assume we can not
9210 set d_semctl_semid_ds
9215 : see if setegid exists
9216 set setegid d_setegid
9219 : see if seteuid exists
9220 set seteuid d_seteuid
9223 : see if setgrent exists
9224 set setgrent d_setgrent
9227 : see if sethostent exists
9228 set sethostent d_sethent
9231 : see if setlinebuf exists
9232 set setlinebuf d_setlinebuf
9235 : see if setlocale exists
9236 set setlocale d_setlocale
9239 : see if setnetent exists
9240 set setnetent d_setnent
9243 : see if setprotoent exists
9244 set setprotoent d_setpent
9247 : see if setpgid exists
9248 set setpgid d_setpgid
9251 : see if setpgrp2 exists
9252 set setpgrp2 d_setpgrp2
9255 : see if setpriority exists
9256 set setpriority d_setprior
9259 : see if setpwent exists
9260 set setpwent d_setpwent
9263 : see if setregid exists
9264 set setregid d_setregid
9266 set setresgid d_setresgid
9269 : see if setreuid exists
9270 set setreuid d_setreuid
9272 set setresuid d_setresuid
9275 : see if setrgid exists
9276 set setrgid d_setrgid
9279 : see if setruid exists
9280 set setruid d_setruid
9283 : see if setservent exists
9284 set setservent d_setsent
9287 : see if setsid exists
9291 : see if setvbuf exists
9292 set setvbuf d_setvbuf
9295 : see if sfio.h is available
9300 : see if sfio library is available
9311 : Ok, but do we want to use it.
9315 true|$define|[yY]*) dflt='y';;
9318 echo "$package can use the sfio library, but it is experimental."
9319 rp="You seem to have sfio available, do you want to try using it?"
9323 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
9325 : Remove sfio from list of libraries to use
9326 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
9329 echo "libs = $libs" >&4
9333 *) case "$usesfio" in
9335 echo "Sorry, cannot find sfio on this machine" >&4
9336 echo "Ignoring your setting of usesfio=$usesfio" >&4
9344 $define) usesfio='true';;
9345 *) usesfio='false';;
9348 : see if shmctl exists
9352 : see if shmget exists
9356 : see if shmat exists
9359 : see what shmat returns
9362 $cat >shmat.c <<'END'
9363 #include <sys/shm.h>
9366 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
9371 echo "and it returns ($shmattype)." >&4
9372 : see if a prototype for shmat is available
9373 xxx=`./findhdr sys/shm.h`
9374 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
9375 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
9386 set d_shmatprototype
9389 : see if shmdt exists
9393 : see how much of the 'shm*(2)' library is present.
9396 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
9397 *"$undef"*) h_shm=false;;
9401 case "`ipcs 2>&1`" in
9402 "SVID shared memory"*"not configured"*)
9403 echo "Your $osname does not have the shm*(2) configured." >&4
9418 : we could also check for sys/ipc.h ...
9419 if $h_shm && $test `./findhdr sys/shm.h`; then
9420 echo "You have the full shm*(2) library." >&4
9423 echo "You don't have the full shm*(2) library." >&4
9430 : see if we have sigaction
9431 if set sigaction val -f d_sigaction; eval $csym; $val; then
9432 echo 'sigaction() found.' >&4
9433 $cat > try.c <<'EOP'
9435 #include <sys/types.h>
9439 struct sigaction act, oact;
9443 if eval $compile_ok; then
9446 echo "But you don't seem to have a useable struct sigaction." >&4
9450 echo 'sigaction NOT found.' >&4
9453 set d_sigaction; eval $setvar
9454 $rm -f try try$_o try.c
9456 : see if sigsetjmp exists
9458 case "$d_sigsetjmp" in
9466 if (sigsetjmp(env,1))
9474 if eval $compile; then
9475 if ./try >/dev/null 2>&1; then
9476 echo "POSIX sigsetjmp found." >&4
9480 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
9486 echo "sigsetjmp not found." >&4
9490 *) val="$d_sigsetjmp"
9491 case "$d_sigsetjmp" in
9492 $define) echo "POSIX sigsetjmp found." >&4;;
9493 $undef) echo "sigsetjmp not found." >&4;;
9501 : see if stat knows about block sizes
9503 set d_statblks stat st_blocks $i_sysstat sys/stat.h
9506 : see if _ptr and _cnt from stdio act std
9508 if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
9509 echo "(Looks like you have stdio.h from Linux.)"
9510 case "$stdio_ptr" in
9511 '') stdio_ptr='((fp)->_IO_read_ptr)'
9514 *) ptr_lval=$d_stdio_ptr_lval;;
9516 case "$stdio_cnt" in
9517 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
9520 *) cnt_lval=$d_stdio_cnt_lval;;
9522 case "$stdio_base" in
9523 '') stdio_base='((fp)->_IO_read_base)';;
9525 case "$stdio_bufsiz" in
9526 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
9529 case "$stdio_ptr" in
9530 '') stdio_ptr='((fp)->_ptr)'
9533 *) ptr_lval=$d_stdio_ptr_lval;;
9535 case "$stdio_cnt" in
9536 '') stdio_cnt='((fp)->_cnt)'
9539 *) cnt_lval=$d_stdio_cnt_lval;;
9541 case "$stdio_base" in
9542 '') stdio_base='((fp)->_base)';;
9544 case "$stdio_bufsiz" in
9545 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
9548 : test whether _ptr and _cnt really work
9549 echo "Checking how std your stdio is..." >&4
9552 #define FILE_ptr(fp) $stdio_ptr
9553 #define FILE_cnt(fp) $stdio_cnt
9555 FILE *fp = fopen("try.c", "r");
9558 18 <= FILE_cnt(fp) &&
9559 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
9567 if eval $compile; then
9569 echo "Your stdio acts pretty std."
9572 echo "Your stdio isn't very std."
9575 echo "Your stdio doesn't appear very std."
9581 : Can _ptr be used as an lvalue?
9582 case "$d_stdstdio$ptr_lval" in
9583 $define$define) val=$define ;;
9586 set d_stdio_ptr_lval
9589 : Can _cnt be used as an lvalue?
9590 case "$d_stdstdio$cnt_lval" in
9591 $define$define) val=$define ;;
9594 set d_stdio_cnt_lval
9597 : see if _base is also standard
9599 case "$d_stdstdio" in
9603 #define FILE_base(fp) $stdio_base
9604 #define FILE_bufsiz(fp) $stdio_bufsiz
9606 FILE *fp = fopen("try.c", "r");
9609 19 <= FILE_bufsiz(fp) &&
9610 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
9617 if eval $compile; then
9619 echo "And its _base field acts std."
9622 echo "But its _base field isn't std."
9625 echo "However, it seems to be lacking the _base field."
9633 : see if strcoll exists
9634 set strcoll d_strcoll
9637 : check for structure copying
9639 echo "Checking to see if your C compiler can copy structs..." >&4
9640 $cat >try.c <<'EOCP'
9650 if $cc -c try.c >/dev/null 2>&1 ; then
9655 echo "Nope, it can't."
9661 : see if strerror and/or sys_errlist[] exist
9663 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
9664 if set strerror val -f d_strerror; eval $csym; $val; then
9665 echo 'strerror() found.' >&4
9666 d_strerror="$define"
9667 d_strerrm='strerror(e)'
9668 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9669 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
9670 d_syserrlst="$define"
9672 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
9673 d_syserrlst="$undef"
9675 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
9676 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
9677 echo 'strerror() found in string header.' >&4
9678 d_strerror="$define"
9679 d_strerrm='strerror(e)'
9680 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9681 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
9682 d_syserrlst="$define"
9684 echo "(You don't appear to have any sys_errlist[], how can this be?)"
9685 d_syserrlst="$undef"
9687 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9688 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
9690 d_syserrlst="$define"
9691 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
9693 echo 'strerror() and sys_errlist[] NOT found.' >&4
9695 d_syserrlst="$undef"
9696 d_strerrm='"unknown"'
9700 : see if strtod exists
9704 : see if strtol exists
9708 : see if strtoul exists
9709 set strtoul d_strtoul
9712 : see if strxfrm exists
9713 set strxfrm d_strxfrm
9716 : see if symlink exists
9717 set symlink d_symlink
9720 : see if syscall exists
9721 set syscall d_syscall
9724 : see if sysconf exists
9725 set sysconf d_sysconf
9728 : see if system exists
9732 : see if tcgetpgrp exists
9733 set tcgetpgrp d_tcgetpgrp
9736 : see if tcsetpgrp exists
9737 set tcsetpgrp d_tcsetpgrp
9740 : define an is-a-typedef? function
9741 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9743 "") inclist="sys/types.h";;
9745 eval "varval=\$$var";
9749 for inc in $inclist; do
9750 echo "#include <$inc>" >>temp.c;
9752 echo "#ifdef $type" >> temp.c;
9753 echo "printf(\"We have $type\");" >> temp.c;
9754 echo "#endif" >> temp.c;
9755 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9756 if $contains $type temp.E >/dev/null 2>&1; then
9762 *) eval "$var=\$varval";;
9765 : define an is-a-typedef? function that prompts if the type is not available.
9766 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9768 "") inclist="sys/types.h";;
9770 eval "varval=\$$var";
9774 for inc in $inclist; do
9775 echo "#include <$inc>" >>temp.c;
9777 echo "#ifdef $type" >> temp.c;
9778 echo "printf(\"We have $type\");" >> temp.c;
9779 echo "#endif" >> temp.c;
9780 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9782 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9783 if $contains $type temp.E >/dev/null 2>&1; then
9784 echo "$type found." >&4;
9787 echo "$type NOT found." >&4;
9793 *) eval "$var=\$varval";;
9796 : see if this is a sys/times.h system
9797 set sys/times.h i_systimes
9800 : see if times exists
9802 if set times val -f d_times; eval $csym; $val; then
9803 echo 'times() found.' >&4
9806 case "$i_systimes" in
9807 "$define") inc='sys/times.h';;
9809 rp="What is the type returned by times() on this system?"
9810 set clock_t clocktype long stdio.h sys/types.h $inc
9813 echo 'times() NOT found, hope that will do.' >&4
9818 : see if truncate exists
9819 set truncate d_truncate
9822 : see if tzname[] exists
9824 if set tzname val -a d_tzname; eval $csym; $val; then
9826 echo 'tzname[] found.' >&4
9829 echo 'tzname[] NOT found.' >&4
9834 : see if umask exists
9838 : backward compatibility for d_hvfork
9839 if test X$d_hvfork != X; then
9843 : see if there is a vfork
9848 : Ok, but do we want to use it. vfork is reportedly unreliable in
9849 : perl on Solaris 2.x, and probably elsewhere.
9857 rp="Some systems have problems with vfork(). Do you want to use it?"
9862 echo "Ok, we won't use vfork()."
9871 $define) usevfork='true';;
9872 *) usevfork='false';;
9875 : see if this is an sysdir system
9876 set sys/dir.h i_sysdir
9879 : see if this is an sysndir system
9880 set sys/ndir.h i_sysndir
9883 : see if sys/types.h has to be included
9884 set sys/types.h i_systypes
9887 : see if closedir exists
9888 set closedir d_closedir
9891 case "$d_closedir" in
9894 echo "Checking whether closedir() returns a status..." >&4
9895 cat > closedir.c <<EOM
9896 #$i_dirent I_DIRENT /**/
9897 #$i_sysdir I_SYS_DIR /**/
9898 #$i_sysndir I_SYS_NDIR /**/
9899 #$i_systypes I_SYS_TYPES /**/
9901 #if defined(I_SYS_TYPES)
9902 #include <sys/types.h>
9904 #if defined(I_DIRENT)
9906 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
9907 #include <sys/dir.h>
9911 #include <sys/ndir.h>
9915 #include <ndir.h> /* may be wrong in the future */
9917 #include <sys/dir.h>
9922 int main() { return closedir(opendir(".")); }
9925 if eval $compile_ok; then
9926 if ./closedir > /dev/null 2>&1 ; then
9927 echo "Yes, it does."
9930 echo "No, it doesn't."
9934 echo "(I can't seem to compile the test program--assuming it doesn't)"
9945 : check for volatile keyword
9947 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
9948 $cat >try.c <<'EOCP'
9951 typedef struct _goo_struct goo_struct;
9952 goo_struct * volatile goo = ((goo_struct *)0);
9953 struct _goo_struct {
9958 typedef unsigned short foo_t;
9961 volatile foo_t blech;
9965 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
9967 echo "Yup, it does."
9970 echo "Nope, it doesn't."
9976 : see if there is a wait4
9980 : see if waitpid exists
9981 set waitpid d_waitpid
9984 : see if wcstombs exists
9985 set wcstombs d_wcstombs
9988 : see if wctomb exists
9992 : preserve RCS keywords in files with variable substitution, grrr
9997 Revision='$Revision'
9999 : check for alignment requirements
10001 case "$alignbytes" in
10002 '') echo "Checking alignment constraints..." >&4
10003 $cat >try.c <<'EOCP'
10010 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
10014 if eval $compile_ok; then
10018 echo "(I can't seem to compile the test program...)"
10021 *) dflt="$alignbytes"
10024 rp="Doubles must be aligned on a how-many-byte boundary?"
10029 : check for ordering of bytes in a long
10030 case "$byteorder" in
10034 In the following, larger digits indicate more significance. A big-endian
10035 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10036 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10037 machines may have weird orders like 3412. A Cray will report 87654321. If
10038 the test program works the default is probably right.
10039 I'm now running the test program...
10041 $cat >try.c <<'EOCP'
10048 char c[sizeof(long)];
10051 if (sizeof(long) > 4)
10052 u.l = (0x08070605L << 32) | 0x04030201L;
10055 for (i = 0; i < sizeof(long); i++)
10056 printf("%c", u.c[i]+'0');
10063 if eval $compile && ./try > /dev/null; then
10066 [1-4][1-4][1-4][1-4]|12345678|87654321)
10067 echo "(The test program ran ok.)"
10068 echo "byteorder=$dflt"
10071 ????|????????) echo "(The test program ran ok.)" ;;
10072 *) echo "(The test program didn't run right for some reason.)" ;;
10077 (I can't seem to compile the test program. Guessing big-endian...)
10080 case "$xxx_prompt" in
10082 rp="What is the order of bytes in a long?"
10093 : how do we catenate cpp tokens here?
10095 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
10096 $cat >cpp_stuff.c <<'EOCP'
10097 #define RCAT(a,b)a/**/b
10098 #define ACAT(a,b)a ## b
10102 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
10103 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
10104 echo "Oh! Smells like ANSI's been here." >&4
10105 echo "We can catify or stringify, separately or together!"
10107 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
10108 echo "Ah, yes! The good old days!" >&4
10109 echo "However, in the good old days we don't know how to stringify and"
10110 echo "catify at the same time."
10114 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
10115 to have to edit the values of CAT[2-5] in config.h...
10117 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
10121 : see if this is a db.h system
10127 : Check db version.
10129 echo "Checking Berkeley DB version ..." >&4
10135 #include <sys/types.h>
10140 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
10141 int Major, Minor, Patch ;
10142 unsigned long Version ;
10143 (void)db_version(&Major, &Minor, &Patch) ;
10144 printf("You have Berkeley DB Version 2 or greater\n");
10146 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
10147 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
10148 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
10149 Major, Minor, Patch) ;
10151 /* check that db.h & libdb are compatible */
10152 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
10153 printf("db.h and libdb are incompatible\n") ;
10157 printf("db.h and libdb are compatible\n") ;
10159 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
10160 + DB_VERSION_PATCH ;
10162 /* needs to be >= 2.3.4 */
10163 if (Version < 2003004) {
10164 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
10165 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
10171 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
10172 printf("You have Berkeley DB Version 1\n");
10173 exit(0); /* DB version < 2: the coast is clear. */
10175 exit(1); /* <db.h> not Berkeley DB? */
10181 if eval $compile && ./try; then
10182 echo 'Looks OK.' >&4
10184 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
10188 : Remove db from list of libraries to use
10189 echo "Removing unusable -ldb from library list" >&4
10190 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
10193 echo "libs = $libs" >&4
10203 : Check the return type needed for hash
10205 echo "Checking return type needed for hash for Berkeley DB ..." >&4
10211 #include <sys/types.h>
10214 #ifndef DB_VERSION_MAJOR
10215 u_int32_t hash_cb (ptr, size)
10223 info.hash = hash_cb;
10227 if $cc $ccflags -c try.c >try.out 2>&1 ; then
10228 if $contains warning try.out >>/dev/null 2>&1 ; then
10231 db_hashtype='u_int32_t'
10234 : XXX Maybe we should just give up here.
10235 db_hashtype=u_int32_t
10237 echo "Help: I can't seem to compile the db test program." >&4
10238 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
10241 echo "Your version of Berkeley DB uses $db_hashtype for hash."
10243 *) db_hashtype=u_int32_t
10248 : Check the return type needed for prefix
10250 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
10256 #include <sys/types.h>
10259 #ifndef DB_VERSION_MAJOR
10260 size_t prefix_cb (key1, key2)
10268 info.prefix = prefix_cb;
10272 if $cc $ccflags -c try.c >try.out 2>&1 ; then
10273 if $contains warning try.out >>/dev/null 2>&1 ; then
10274 db_prefixtype='int'
10276 db_prefixtype='size_t'
10279 db_prefixtype='size_t'
10280 : XXX Maybe we should just give up here.
10282 echo "Help: I can't seem to compile the db test program." >&4
10283 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
10286 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
10288 *) db_prefixtype='size_t'
10292 : check for void type
10294 echo "Checking to see how well your C compiler groks the void type..." >&4
10295 case "$voidflags" in
10297 $cat >try.c <<'EOCP'
10303 extern void moo(); /* function returning void */
10304 void (*goo)(); /* ptr to func returning void */
10306 void *hue; /* generic ptr */
10321 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
10322 voidflags=$defvoidused
10323 echo "Good. It appears to support void to the level $package wants.">&4
10324 if $contains warning .out >/dev/null 2>&1; then
10325 echo "However, you might get some warnings that look like this:"
10329 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
10330 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
10331 echo "It supports 1..."
10332 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
10333 echo "It also supports 2..."
10334 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
10336 echo "And it supports 4 but not 8 definitely."
10338 echo "It doesn't support 4..."
10339 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
10341 echo "But it supports 8."
10344 echo "Neither does it support 8."
10348 echo "It does not support 2..."
10349 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
10351 echo "But it supports 4 and 8."
10353 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
10355 echo "And it supports 4 but has not heard about 8."
10357 echo "However it supports 8 but not 4."
10362 echo "There is no support at all for void."
10367 case "$voidflags" in
10369 *) $cat >&4 <<'EOM'
10370 Support flag bits are:
10371 1: basic void declarations.
10372 2: arrays of pointers to functions returning void.
10373 4: operations between pointers to and addresses of void functions.
10374 8: generic void pointers.
10377 rp="Your void support flags add up to what?"
10385 : How can we generate normalized random numbers ?
10387 case "$randfunc" in
10389 if set drand48 val -f; eval $csym; $val; then
10391 echo "Good, found drand48()." >&4
10392 elif set random val -f; eval $csym; $val; then
10394 echo "OK, found random()." >&4
10397 echo "Yick, looks like I have to use rand()." >&4
10408 *-Dmy_rand=*|*-Dmy_srand=*)
10409 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
10410 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
10411 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
10412 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
10416 while $test "$cont"; do
10417 rp="Use which function to generate random numbers?"
10419 if $test "$ans" = "$dflt"; then
10425 if set $ans val -f; eval $csym; $val; then
10429 rp="Function $ans does not exists. Use that name anyway?"
10438 case "$randfunc" in
10440 drand01="drand48()"
10446 case "$randbits" in
10448 echo "Checking to see how many bits your $randfunc() function produces..." >&4
10450 #$i_unistd I_UNISTD
10451 #$i_stdlib I_STDLIB
10454 # include <unistd.h>
10457 # include <stdlib.h>
10462 register unsigned long tmp;
10463 register unsigned long max = 0L;
10465 for (i = 1000; i; i--) {
10466 tmp = (unsigned long) $randfunc();
10467 if (tmp > max) max = tmp;
10469 for (i = 0; max; i++)
10475 if eval $compile_ok; then
10479 echo "(I can't seem to compile the test program...)"
10486 rp="How many bits does your $randfunc() function produce?"
10490 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
10491 seedfunc="s$randfunc"
10492 randseedtype=unsigned
10496 rp="How many bits does your $randfunc() function produce?"
10499 seedfunc="s$randfunc"
10500 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
10501 if set $seedfunc val -f; eval $csym; $val; then
10502 echo "(Using $seedfunc() to seed random generator)"
10504 echo "(Warning: no $seedfunc() to seed random generator)"
10507 randseedtype=unsigned
10515 echo "Determining whether or not we are on an EBCDIC system..." >&4
10516 $cat >tebcdic.c <<'EOM'
10519 if ('M'==0xd4) return 0;
10526 if eval $compile_ok; then
10528 echo "You have EBCDIC." >&4
10531 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4
10534 echo "I'm unable to compile the test program." >&4
10535 echo "I'll assume ASCII or some ISO Latin." >&4
10537 $rm -f tebcdic.c tebcdic
10541 : see what type file positions are declared as in the library
10542 rp="What is the type for file position used by fsetpos()?"
10543 set fpos_t fpostype long stdio.h sys/types.h
10546 : Store the full pathname to the sed program for use in the C program
10549 : see what type gids are declared as in the kernel
10551 echo "Looking for the type for group ids returned by getgid()."
10552 set gid_t gidtype xxx stdio.h sys/types.h
10556 xxx=`./findhdr sys/user.h`
10557 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
10559 unsigned) dflt="$1 $2" ;;
10563 *) dflt="$gidtype";;
10566 gid_t) echo "gid_t found." ;;
10567 *) rp="What is the type for group ids returned by getgid()?"
10573 : see if getgroups exists
10574 set getgroups d_getgrps
10577 : see if setgroups exists
10578 set setgroups d_setgrps
10582 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
10584 case "$d_getgrps$d_setgrps" in
10586 case "$groupstype" in
10587 '') dflt="$gidtype" ;;
10588 *) dflt="$groupstype" ;;
10591 What type of pointer is the second argument to getgroups() and setgroups()?
10592 Usually this is the same as group ids, $gidtype, but not always.
10595 rp='What type pointer is the second argument to getgroups() and setgroups()?'
10599 *) groupstype="$gidtype";;
10602 : see what type lseek is declared as in the kernel
10603 rp="What is the type used for lseek's offset on this system?"
10604 set off_t lseektype long stdio.h sys/types.h
10608 $echo $n "Checking to see how big your file offsets are...$c" >&4
10610 #include <sys/types.h>
10614 printf("%d\n", sizeof($lseektype));
10618 if eval $compile_ok; then
10620 $echo " $lseeksize bytes." >&4
10624 echo "(I can't seem to compile the test program. Guessing...)"
10625 rp="What is the size of your file offsets (in bytes)?"
10632 echo "Checking if your $make program sets \$(MAKE)..." >&4
10633 case "$make_set_make" in
10635 $sed 's/^X //' > testmake.mak << 'EOF'
10637 X @echo 'maketemp="$(MAKE)"'
10639 case "`$make -f testmake.mak 2>/dev/null`" in
10640 *maketemp=*) make_set_make='#' ;;
10641 *) make_set_make="MAKE=$make" ;;
10643 $rm -f testmake.mak
10646 case "$make_set_make" in
10647 '#') echo "Yup, it does.";;
10648 *) echo "Nope, it doesn't.";;
10651 : see what type is used for mode_t
10652 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
10653 set mode_t modetype int stdio.h sys/types.h
10656 : define a fucntion to check prototypes
10657 $cat > protochk <<EOSH
10660 optimize="$optimize"
10662 prototype="$prototype"
10667 $cat >> protochk <<'EOSH'
10672 while test $# -ge 2; do
10674 $define) echo "#include <$2>" >> try.c ;;
10675 literal) echo "$2" >> try.c ;;
10679 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10680 cat >> try.c <<'EOCP'
10681 #ifdef CAN_PROTOTYPE
10682 #define _(args) args
10687 echo "$foo" >> try.c
10688 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10689 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10695 $eunicefix protochk
10697 : see what type is used for size_t
10698 rp="What is the type used for the length parameter for string functions?"
10699 set size_t sizetype 'unsigned int' stdio.h sys/types.h
10702 : check for type of arguments to gethostbyaddr.
10703 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
10704 case "$d_gethbyaddr" in
10708 Checking to see what type of arguments are accepted by gethostbyaddr().
10710 hdrs="$define sys/types.h
10711 $d_socket sys/socket.h
10712 $i_niin netinet/in.h
10714 $i_unistd unistd.h"
10715 : The first arg can 'char *' or 'void *'
10716 : The second arg is some of integral type
10717 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
10718 for yyy in size_t long int; do
10719 case "$netdb_host_type" in
10720 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
10721 if ./protochk "$try" $hdrs; then
10722 echo "Your system accepts $xxx for the first arg."
10723 echo "...and $yyy for the second arg."
10724 netdb_host_type="$xxx"
10725 netdb_hlen_type="$yyy"
10731 : In case none of those worked, prompt the user.
10732 case "$netdb_host_type" in
10733 '') rp='What is the type for the 1st argument to gethostbyaddr?'
10736 netdb_host_type=$ans
10737 rp='What is the type for the 2nd argument to gethostbyaddr?'
10740 netdb_hlen_type=$ans
10744 *) : no gethostbyaddr, so pick harmless defaults
10745 netdb_host_type='char *'
10746 netdb_hlen_type="$sizetype"
10749 # Remove the "const" if needed. -- but then we'll have a
10751 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
10754 : check for type of argument to gethostbyname.
10755 if test "X$netdb_name_type" = X ; then
10756 case "$d_gethbyname" in
10760 Checking to see what type of argument is accepted by gethostbyname().
10762 hdrs="$define sys/types.h
10763 $d_socket sys/socket.h
10764 $i_niin netinet/in.h
10766 $i_unistd unistd.h"
10767 for xxx in "const char *" "char *"; do
10768 case "$netdb_name_type" in
10769 '') try="extern struct hostent *gethostbyname($xxx);"
10770 if ./protochk "$try" $hdrs; then
10771 echo "Your system accepts $xxx."
10772 netdb_name_type="$xxx"
10777 : In case none of those worked, prompt the user.
10778 case "$netdb_name_type" in
10779 '') rp='What is the type for the 1st argument to gethostbyname?'
10782 netdb_name_type=$ans
10786 *) : no gethostbyname, so pick harmless default
10787 netdb_name_type='char *'
10792 : check for type of 1st argument to getnetbyaddr.
10793 if test "X$netdb_net_type" = X ; then
10794 case "$d_getnbyaddr" in
10798 Checking to see what type of 1st argument is accepted by getnetbyaddr().
10800 hdrs="$define sys/types.h
10801 $d_socket sys/socket.h
10802 $i_niin netinet/in.h
10804 $i_unistd unistd.h"
10805 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
10806 case "$netdb_net_type" in
10807 '') try="extern struct netent *getnetbyaddr($xxx, int);"
10808 if ./protochk "$try" $hdrs; then
10809 echo "Your system accepts $xxx."
10810 netdb_net_type="$xxx"
10815 : In case none of those worked, prompt the user.
10816 case "$netdb_net_type" in
10817 '') rp='What is the type for the 1st argument to getnetbyaddr?'
10820 netdb_net_type=$ans
10824 *) : no getnetbyaddr, so pick harmless default
10825 netdb_net_type='long'
10829 : locate the preferred pager for this system
10843 '') dflt=/usr/ucb/more;;
10850 rp='What pager is used on your system?'
10854 : see what type pids are declared as in the kernel
10855 rp="What is the type of process ids on this system?"
10856 set pid_t pidtype int stdio.h sys/types.h
10859 : check for length of pointer
10863 $echo $n "Checking to see how big your pointers are...$c" >&4
10864 if test "$voidflags" -gt 7; then
10865 echo '#define VOID_PTR char *' > try.c
10867 echo '#define VOID_PTR void *' > try.c
10869 $cat >>try.c <<'EOCP'
10873 printf("%d\n", sizeof(VOID_PTR));
10878 if eval $compile_ok; then
10880 $echo " $ptrsize bytes." >&4
10883 echo "(I can't seem to compile the test program. Guessing...)" >&4
10884 rp="What is the size of a pointer (in bytes)?"
10892 : see if ar generates random libraries by itself
10894 echo "Checking how to generate random libraries on your machine..." >&4
10895 echo 'int bar1() { return bar2(); }' > bar1.c
10896 echo 'int bar2() { return 2; }' > bar2.c
10897 $cat > foo.c <<'EOP'
10898 main() { printf("%d\n", bar1()); exit(0); }
10900 $cc $ccflags -c bar1.c >/dev/null 2>&1
10901 $cc $ccflags -c bar2.c >/dev/null 2>&1
10902 $cc $ccflags -c foo.c >/dev/null 2>&1
10903 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
10904 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
10905 ./foobar >/dev/null 2>&1; then
10906 echo "$ar appears to generate random libraries itself."
10909 elif $ar ts bar$_a >/dev/null 2>&1 &&
10910 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
10911 ./foobar >/dev/null 2>&1; then
10912 echo "a table of contents needs to be added with '$ar ts'."
10919 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
10920 $test -f $ranlib || ranlib=''
10923 if $test -n "$ranlib"; then
10924 echo "your system has '$ranlib'; we'll use that."
10927 echo "your system doesn't seem to support random libraries"
10928 echo "so we'll use lorder and tsort to order the libraries."
10935 : check for type of arguments to select.
10936 case "$selecttype" in
10937 '') case "$d_select" in
10940 Checking to see what type of arguments are accepted by select().
10942 hdrs="$define sys/types.h
10943 $i_systime sys/time.h
10944 $i_sysselct sys/select.h
10945 $d_socket sys/socket.h"
10946 : The first arg can be int, unsigned, or size_t
10947 : The last arg may or may not be 'const'
10949 : void pointer has been seen but using that
10950 : breaks the selectminbits test
10951 for xxx in 'fd_set *' 'int *'; do
10952 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
10953 for tmo in 'struct timeval *' 'const struct timeval *'; do
10955 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
10956 if ./protochk "$try" $hdrs; then
10957 echo "Your system accepts $xxx."
10966 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
10967 case "$d_fd_set" in
10968 $define) dflt="fd_set *" ;;
10977 *) : no select, so pick a harmless default
10984 : check for the select 'width'
10985 case "$selectminbits" in
10986 '') case "$d_select" in
10990 Checking to see on how many bits at a time your select() operates...
10993 #include <sys/types.h>
10995 #$i_systime I_SYS_TIME
10996 #$i_systimek I_SYS_TIME_KERNEL
11001 # ifdef I_SYS_TIME_KERNEL
11004 # include <sys/time.h>
11005 # ifdef I_SYS_TIME_KERNEL
11009 #$i_sysselct I_SYS_SELECT
11010 #ifdef I_SYS_SELECT
11011 #include <sys/select.h>
11015 #define S sizeof(*(b))
11017 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
11018 #define NBITS (NBYTES * 8)
11027 fp = fopen("try.c", "r");
11033 b = ($selecttype)s;
11034 for (i = 0; i < NBITS; i++)
11038 select(fd + 1, b, 0, 0, &t);
11039 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
11040 printf("%d\n", i + 1);
11045 if eval $compile_ok; then
11046 selectminbits=`./try`
11047 case "$selectminbits" in
11049 Cannot figure out on how many bits at a time your select() operates.
11050 I'll play safe and guess it is 32 bits.
11056 *) bits="$selectminbits bits" ;;
11058 echo "Your select() operates on $bits at a time." >&4
11060 rp='What is the minimum number of bits your select() operates on?'
11061 case "$byteorder" in
11062 1234|12345678) dflt=32 ;;
11067 selectminbits="$val"
11071 *) : no select, so pick a harmless default
11078 : Trace out the files included by signal.h, then look for SIGxxx names.
11079 : Remove SIGARRAYSIZE used by HPUX.
11080 : Remove SIGTYP void lines used by OS2.
11081 xxx=`echo '#include <signal.h>' |
11082 $cppstdin $cppminus $cppflags 2>/dev/null |
11083 $grep '^[ ]*#.*include' |
11084 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
11085 : Check this list of files to be sure we have parsed the cpp output ok.
11086 : This will also avoid potentially non-existent files, such
11089 for xx in $xxx /dev/null ; do
11090 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
11092 : If we have found no files, at least try signal.h
11093 case "$xxxfiles" in
11094 '') xxxfiles=`./findhdr signal.h` ;;
11097 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ {
11098 print substr($2, 4, 20)
11100 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
11101 print substr($3, 4, 20)
11103 : Append some common names just in case the awk scan failed.
11104 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
11105 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
11106 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
11107 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
11108 : generate a few handy files for later
11109 $cat > signal.c <<'EOCP'
11110 #include <sys/types.h>
11111 #include <signal.h>
11115 /* Strange style to avoid deeply-nested #if/#else/#endif */
11118 # define NSIG (_NSIG)
11124 # define NSIG (SIGMAX+1)
11130 # define NSIG (SIG_MAX+1)
11136 # define NSIG (MAXSIG+1)
11142 # define NSIG (MAX_SIG+1)
11147 # ifdef SIGARRAYSIZE
11148 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
11154 # define NSIG (_sys_nsig) /* Solaris 2.5 */
11158 /* Default to some arbitrary number that's big enough to get most
11159 of the common signals.
11165 printf("NSIG %d\n", NSIG);
11171 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
11173 printf "#ifdef SIG"; printf $1; printf "\n"
11174 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
11175 printf $1; printf ");\n"
11179 printf "#endif /* JUST_NSIG */\n";
11183 $cat >signal.awk <<'EOP'
11184 BEGIN { ndups = 0 }
11185 $1 ~ /^NSIG$/ { nsig = $2 }
11186 ($1 !~ /^NSIG$/) && (NF == 2) {
11187 if ($2 > maxsig) { maxsig = $2 }
11188 if (sig_name[$2]) {
11189 dup_name[ndups] = $1
11190 dup_num[ndups] = $2
11200 if (nsig == 0) { nsig = maxsig + 1 }
11201 for (n = 1; n < nsig; n++) {
11203 printf("%s %d\n", sig_name[n], sig_num[n])
11206 printf("NUM%d %d\n", n, n)
11209 for (n = 0; n < ndups; n++) {
11210 printf("%s %d\n", dup_name[n], dup_num[n])
11214 $cat >signal_cmd <<EOS
11216 if $test -s signal.lst; then
11217 echo "Using your existing signal.lst file"
11222 $cat >>signal_cmd <<'EOS'
11225 if eval $compile_ok; then
11226 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
11228 echo "(I can't seem be able to compile the whole test program)" >&4
11229 echo "(I'll try it in little pieces.)" >&4
11230 set signal -DJUST_NSIG
11231 if eval $compile_ok; then
11232 ./signal$_exe > signal.nsg
11235 echo "I can't seem to figure out how many signals you have." >&4
11236 echo "Guessing 50." >&4
11237 echo 'NSIG 50' > signal.nsg
11239 : Now look at all the signal names, one at a time.
11240 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
11241 $cat > signal.c <<EOCP
11242 #include <sys/types.h>
11243 #include <signal.h>
11246 printf("$xx %d\n", SIG${xx});
11251 if eval $compile; then
11252 echo "SIG${xx} found."
11253 ./signal$_exe >> signal.ls1
11255 echo "SIG${xx} NOT found."
11258 if $test -s signal.ls1; then
11259 $cat signal.nsg signal.ls1 |
11260 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
11264 if $test -s signal.lst; then
11267 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
11268 echo 'kill -l' >signal
11269 set X `csh -f <signal`
11273 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
11275 echo $@ | $tr ' ' $trnl | \
11276 $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
11278 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
11280 chmod a+x signal_cmd
11281 $eunicefix signal_cmd
11283 : generate list of signal names
11285 case "$sig_name_init" in
11287 *) case "$sig_num_init" in
11288 ''|*,*) doinit=yes ;;
11293 echo "Generating a list of signal names and numbers..." >&4
11295 sig_name=`$awk '{printf "%s ", $1}' signal.lst`
11296 sig_name="ZERO $sig_name"
11297 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
11298 { printf "\"%s\", ", $1 }
11299 END { printf "0\n" }' signal.lst`
11300 sig_num=`$awk '{printf "%d ", $2}' signal.lst`
11301 sig_num="0 $sig_num"
11302 sig_num_init=`$awk 'BEGIN { printf "0, " }
11303 { printf "%d, ", $2}
11304 END { printf "0\n"}' signal.lst`
11307 echo "The following signals are available:"
11309 echo $sig_name | $awk \
11310 'BEGIN { linelen = 0 }
11312 for (i = 1; i <= NF; i++) {
11313 name = "SIG" $i " "
11314 linelen = linelen + length(name)
11315 if (linelen > 70) {
11317 linelen = length(name)
11323 $rm -f signal signal.c signal.awk signal.lst signal_cmd
11325 : see what type is used for signed size_t
11326 set ssize_t ssizetype int stdio.h sys/types.h
11329 $cat > ssize.c <<EOM
11331 #include <sys/types.h>
11332 #define Size_t $sizetype
11333 #define SSize_t $dflt
11336 if (sizeof(Size_t) == sizeof(SSize_t))
11338 else if (sizeof(Size_t) == sizeof(int))
11347 if eval $compile_ok && ./ssize > /dev/null; then
11348 ssizetype=`./ssize`
11349 echo "I'll be using $ssizetype for functions returning a byte count." >&4
11352 Help! I can't compile and run the ssize_t test program: please enlighten me!
11353 (This is probably a misconfiguration in your system or libraries, and
11354 you really ought to fix it. Still, I'll try anyway.)
11356 I need a type that is the same size as $sizetype, but is guaranteed to
11357 be signed. Common values are ssize_t, int and long.
11360 rp="What signed type is the same size as $sizetype?"
11364 $rm -f ssize ssize.*
11366 : see what type of char stdio uses.
11368 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11369 echo "Your stdio uses unsigned chars." >&4
11370 stdchar="unsigned char"
11372 echo "Your stdio uses signed chars." >&4
11376 : see if time exists
11378 if test "X$d_time" = X -o X"$timetype" = X; then
11379 if set time val -f d_time; eval $csym; $val; then
11380 echo 'time() found.' >&4
11382 rp="What is the type returned by time() on this system?"
11383 set time_t timetype long stdio.h sys/types.h
11386 echo 'time() not found, hope that will do.' >&4
11394 : see what type uids are declared as in the kernel
11396 echo "Looking for the type for user ids returned by getuid()."
11397 set uid_t uidtype xxx stdio.h sys/types.h
11401 xxx=`./findhdr sys/user.h`
11402 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
11404 unsigned) dflt="$1 $2" ;;
11408 *) dflt="$uidtype";;
11411 uid_t) echo "uid_t found." ;;
11412 *) rp="What is the type for user ids returned by getuid()?"
11418 : see if dbm.h is available
11419 : see if dbmclose exists
11420 set dbmclose d_dbmclose
11423 case "$d_dbmclose" in
11433 *) set rpcsvc/dbm.h i_rpcsvcdbm
11438 *) echo "We won't be including <dbm.h>"
11448 : see if this is a sys/file.h system
11453 : do we need to include sys/file.h ?
11457 if $h_sysfile; then
11459 echo "We'll be including <sys/file.h>." >&4
11462 echo "We won't be including <sys/file.h>." >&4
11472 : see if fcntl.h is there
11477 : see if we can include fcntl.h
11483 echo "We'll be including <fcntl.h>." >&4
11486 if $h_sysfile; then
11487 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11489 echo "We won't be including <fcntl.h>." >&4
11501 : see if locale.h is available
11502 set locale.h i_locale
11505 : see if mach cthreads are available
11506 if test "X$usethreads" = "X$define"; then
11507 set mach/cthreads.h i_machcthr
11510 i_machcthr="$undef"
11515 : see if this is a math.h system
11519 : see if ndbm.h is available
11524 : see if dbm_open exists
11525 set dbm_open d_dbm_open
11527 case "$d_dbm_open" in
11530 echo "We won't be including <ndbm.h>"
11539 : see if net/errno.h is available
11541 set net/errno.h val
11544 : Unfortunately, it causes problems on some systems. Arrgh.
11547 cat > try.c <<'EOM'
11550 #include <net/errno.h>
11556 if $cc $ccflags -c try.c >/dev/null 2>&1; then
11557 echo "We'll be including <net/errno.h>." >&4
11559 echo "We won't be including <net/errno.h>." >&4
11568 : get C preprocessor symbols handy
11570 $echo $n "Hmm... $c"
11571 echo $al | $tr ' ' $trnl >Cppsym.know
11572 $cat <<EOSS >Cppsym
11580 case "\$list\$#" in
11583 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
11585 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
11588 unknown="\$unknown \$sym"
11598 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
11600 exit 0; _ _ _ _\1\\ \1\\
11603 echo "exit 1; _ _ _" >>Cppsym\$\$
11604 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
11606 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
11612 $rm -f Cppsym\$\$ Cppsym2\$\$
11617 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
11619 : now check the C compiler for additional symbols
11625 for i in \`$cc -v -c tmp.c 2>&1\`
11628 -D*) echo "\$i" | $sed 's/^-D//';;
11629 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
11636 ./ccsym > ccsym1.raw
11637 if $test -s ccsym1.raw; then
11638 $sort ccsym1.raw | $uniq >ccsym.raw
11640 mv ccsym1.raw ccsym.raw
11643 $awk '/\=/ { print $0; next }
11644 { print $0"=1" }' ccsym.raw >ccsym.list
11645 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
11646 $comm -13 ccsym.true ccsym.list >ccsym.own
11647 $comm -12 ccsym.true ccsym.list >ccsym.com
11648 $comm -23 ccsym.true ccsym.list >ccsym.cpp
11651 if $test -z ccsym.raw; then
11652 echo "Your C compiler doesn't seem to define any symbol!" >&4
11654 echo "However, your C preprocessor defines the following ones:"
11657 if $test -s ccsym.com; then
11658 echo "Your C compiler and pre-processor define these symbols:"
11659 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
11662 $test "$silent" || sleep 1
11664 if $test -s ccsym.cpp; then
11665 $test "$also" && echo " "
11666 echo "Your C pre-processor ${also}defines the following $symbols:"
11667 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
11669 $test "$silent" || sleep 1
11671 if $test -s ccsym.own; then
11672 $test "$also" && echo " "
11673 echo "Your C compiler ${also}defines the following cpp variables:"
11674 $sed -e 's/\(.*\)=1/\1/' ccsym.own
11675 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
11676 $test "$silent" || sleep 1
11681 : see if this is a termio system
11685 if $test `./findhdr termios.h`; then
11686 set tcsetattr i_termios
11692 "$define") echo "You have POSIX termios.h... good!" >&4;;
11693 *) if ./Cppsym pyr; then
11694 case "`/bin/universe`" in
11695 ucb) if $test `./findhdr sgtty.h`; then
11697 echo "<sgtty.h> found." >&4
11699 echo "System is pyramid with BSD universe."
11700 echo "<sgtty.h> not found--you could have problems." >&4
11702 *) if $test `./findhdr termio.h`; then
11704 echo "<termio.h> found." >&4
11706 echo "System is pyramid with USG universe."
11707 echo "<termio.h> not found--you could have problems." >&4
11711 if $test `./findhdr termio.h`; then
11712 echo "<termio.h> found." >&4
11714 elif $test `./findhdr sgtty.h`; then
11715 echo "<sgtty.h> found." >&4
11718 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
11721 if $test `./findhdr sgtty.h`; then
11722 echo "<sgtty.h> found." >&4
11724 elif $test `./findhdr termio.h`; then
11725 echo "<termio.h> found." >&4
11728 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
11732 set i_termio; eval $setvar
11733 val=$val2; set i_sgtty; eval $setvar
11734 val=$val3; set i_termios; eval $setvar
11736 : see if stdarg is available
11738 if $test `./findhdr stdarg.h`; then
11739 echo "<stdarg.h> found." >&4
11742 echo "<stdarg.h> NOT found." >&4
11746 : see if varags is available
11748 if $test `./findhdr varargs.h`; then
11749 echo "<varargs.h> found." >&4
11751 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11754 : set up the varargs testing programs
11755 $cat > varargs.c <<EOP
11757 #include <stdarg.h>
11760 #include <varargs.h>
11764 int f(char *p, ...)
11778 p = va_arg(ap, char *);
11783 $cat > varargs <<EOP
11785 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11794 : now check which varargs header should be included
11799 if `./varargs I_STDARG`; then
11801 elif `./varargs I_VARARGS`; then
11806 if `./varargs I_VARARGS`; then
11813 echo "I could not find the definition for va_dcl... You have problems..." >&4
11814 val="$undef"; set i_stdarg; eval $setvar
11815 val="$undef"; set i_varargs; eval $setvar
11820 case "$i_varhdr" in
11822 val="$define"; set i_stdarg; eval $setvar
11823 val="$undef"; set i_varargs; eval $setvar
11826 val="$undef"; set i_stdarg; eval $setvar
11827 val="$define"; set i_varargs; eval $setvar
11830 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11834 : see if stddef is available
11835 set stddef.h i_stddef
11838 : see if sys/access.h is available
11839 set sys/access.h i_sysaccess
11842 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
11843 set sys/filio.h i_sysfilio
11846 if $test `./findhdr sys/ioctl.h`; then
11848 echo '<sys/ioctl.h> found.' >&4
11851 if $test $i_sysfilio = "$define"; then
11852 echo '<sys/ioctl.h> NOT found.' >&4
11854 $test $i_sgtty = "$define" && xxx="sgtty.h"
11855 $test $i_termio = "$define" && xxx="termio.h"
11856 $test $i_termios = "$define" && xxx="termios.h"
11857 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
11863 : see if this is a sys/param system
11864 set sys/param.h i_sysparam
11867 : see if sys/resource.h has to be included
11868 set sys/resource.h i_sysresrc
11871 : see if sys/security.h is available
11872 set sys/security.h i_syssecrt
11875 : see if this is a sys/un.h system
11876 set sys/un.h i_sysun
11879 : see if this is a syswait system
11880 set sys/wait.h i_syswait
11883 : see if this is an utime system
11884 set utime.h i_utime
11887 : see if this is a values.h system
11888 set values.h i_values
11891 : see if this is a vfork system
11894 set vfork.h i_vfork
11902 : see if gdbm.h is available
11907 : see if gdbm_open exists
11908 set gdbm_open d_gdbm_open
11910 case "$d_gdbm_open" in
11913 echo "We won't be including <gdbm.h>"
11923 echo "Looking for extensions..." >&4
11926 : If we are using the old config.sh, known_extensions may contain
11927 : old or inaccurate or duplicate values.
11928 known_extensions=''
11929 nonxs_extensions=''
11930 : We do not use find because it might not be available.
11931 : We do not just use MANIFEST because the user may have dropped
11932 : some additional extensions into the source tree and expect them
11936 DynaLoader|dynaload) ;;
11937 *) if $test -f $xxx/$xxx.xs; then
11938 known_extensions="$known_extensions $xxx"
11939 elif $test -f $xxx/Makefile.PL; then
11940 nonxs_extensions="$nonxs_extensions $xxx"
11942 if $test -d $xxx; then
11943 # Look for nested extensions, eg. Devel/Dprof.
11946 if $test -f $yyy/$yyy.xs; then
11947 known_extensions="$known_extensions $xxx/$yyy"
11948 elif $test -f $yyy/Makefile.PL; then
11949 nonxs_extensions="$nonxs_extensions $xxx/$yyy"
11958 set X $nonxs_extensions
11960 nonxs_extensions="$*"
11961 set X $known_extensions
11963 known_extensions="$*"
11966 : Now see which are supported on this system.
11968 for xxx in $known_extensions ; do
11972 $define) avail_ext="$avail_ext $xxx" ;;
11975 GDBM_File|gdbm_fil)
11977 $define) avail_ext="$avail_ext $xxx" ;;
11980 NDBM_File|ndbm_fil)
11982 $define) avail_ext="$avail_ext $xxx" ;;
11985 ODBM_File|odbm_fil)
11986 case "${i_dbm}${i_rpcsvcdbm}" in
11987 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
11991 case "$useposix" in
11992 true|define|y) avail_ext="$avail_ext $xxx" ;;
11996 case "$useopcode" in
11997 true|define|y) avail_ext="$avail_ext $xxx" ;;
12001 case "$d_socket" in
12002 true|$define|y) avail_ext="$avail_ext $xxx" ;;
12006 case "$usethreads" in
12007 true|$define|y) avail_ext="$avail_ext $xxx" ;;
12011 : XXX Do we need a useipcsysv variable here
12012 case "${d_msg}${d_sem}${d_shm}" in
12013 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
12016 *) avail_ext="$avail_ext $xxx"
12025 : Now see which nonxs extensions are supported on this system.
12026 : For now assume all are.
12028 for xxx in $nonxs_extensions ; do
12030 *) nonxs_ext="$nonxs_ext $xxx"
12042 A number of extensions are supplied with $package. You may choose to
12043 compile these extensions for dynamic loading (the default), compile
12044 them into the $package executable (static loading), or not include
12045 them at all. Answer "none" to include no extensions.
12046 Note that DynaLoader is always built and need not be mentioned here.
12049 case "$dynamic_ext" in
12050 '') dflt="$avail_ext" ;;
12051 *) dflt="$dynamic_ext"
12052 # Perhaps we are reusing an old out-of-date config.sh.
12055 if test X"$dynamic_ext" != X"$avail_ext"; then
12057 NOTICE: Your previous config.sh list may be incorrect.
12058 The extensions now available to you are
12060 but the default list from your previous config.sh is
12072 rp="What extensions do you wish to load dynamically?"
12075 none) dynamic_ext=' ' ;;
12076 *) dynamic_ext="$ans" ;;
12079 case "$static_ext" in
12081 : Exclude those already listed in dynamic linking
12083 for xxx in $avail_ext; do
12084 case " $dynamic_ext " in
12086 *) dflt="$dflt $xxx" ;;
12093 *) dflt="$static_ext"
12100 rp="What extensions do you wish to load statically?"
12103 none) static_ext=' ' ;;
12104 *) static_ext="$ans" ;;
12109 A number of extensions are supplied with $package. Answer "none"
12110 to include no extensions.
12111 Note that DynaLoader is always built and need not be mentioned here.
12114 case "$static_ext" in
12115 '') dflt="$avail_ext" ;;
12116 *) dflt="$static_ext"
12117 # Perhaps we are reusing an old out-of-date config.sh.
12120 if test X"$static_ext" != X"$avail_ext"; then
12122 NOTICE: Your previous config.sh list may be incorrect.
12123 The extensions now available to you are
12125 but the default list from your previous config.sh is
12134 : Exclude those that are not xs extensions
12138 rp="What extensions do you wish to include?"
12141 none) static_ext=' ' ;;
12142 *) static_ext="$ans" ;;
12147 set X $dynamic_ext $static_ext $nonxs_ext
12151 : Remove build directory name from cppstdin so it can be used from
12152 : either the present location or the final installed location.
12154 : Get out of the UU directory to get correct path name.
12156 case "$cppstdin" in
12158 echo "Stripping down cppstdin path name"
12164 : end of configuration questions
12166 echo "End of configuration questions."
12169 : back to where it started
12170 if test -d ../UU; then
12174 : configuration may be patched via a 'config.over' file
12175 if $test -f config.over; then
12178 rp='I see a config.over file. Do you wish to load it?'
12181 n*) echo "OK, I'll ignore it.";;
12183 echo "Configuration override changes have been loaded."
12188 : in case they want portability, strip down executable paths
12189 case "$d_portable" in
12192 echo "Stripping down executable paths..." >&4
12193 for file in $loclist $trylist; do
12194 if test X$file != Xln -a X$file != Xar -o X$osname != Xos2; then
12195 eval $file="\$file"
12201 : create config.sh file
12203 echo "Creating config.sh..." >&4
12204 $spitshell <<EOT >config.sh
12207 # This file was produced by running the Configure script. It holds all the
12208 # definitions figured out by Configure. Should you modify one of these values,
12209 # do not forget to propagate your changes by running "Configure -der". You may
12210 # instead choose to run each of the .SH files by yourself, or "Configure -S".
12213 # Package name : $package
12214 # Source directory : $src
12215 # Configuration time: $cf_time
12216 # Configured by : $cf_by
12217 # Target system : $myuname
12227 Revision='$Revision'
12234 alignbytes='$alignbytes'
12235 ansi2knr='$ansi2knr'
12236 aphostname='$aphostname'
12237 apiversion='$apiversion'
12240 archlibexp='$archlibexp'
12241 archname64='$archname64'
12242 archname='$archname'
12243 archobjs='$archobjs'
12251 byteorder='$byteorder'
12253 castflags='$castflags'
12256 cccdlflags='$cccdlflags'
12257 ccdlflags='$ccdlflags'
12260 cf_email='$cf_email'
12265 clocktype='$clocktype'
12267 compress='$compress'
12268 contains='$contains'
12272 cpp_stuff='$cpp_stuff'
12273 cppflags='$cppflags'
12275 cppminus='$cppminus'
12277 cppstdin='$cppstdin'
12278 cryptlib='$cryptlib'
12280 d_Gconvert='$d_Gconvert'
12281 d_access='$d_access'
12282 d_accessx='$d_accessx'
12284 d_archlib='$d_archlib'
12285 d_attribut='$d_attribut'
12289 d_bsdgetpgrp='$d_bsdgetpgrp'
12290 d_bsdsetpgrp='$d_bsdsetpgrp'
12292 d_casti32='$d_casti32'
12293 d_castneg='$d_castneg'
12294 d_charvspr='$d_charvspr'
12296 d_chroot='$d_chroot'
12297 d_chsize='$d_chsize'
12298 d_closedir='$d_closedir'
12302 d_cuserid='$d_cuserid'
12303 d_dbl_dig='$d_dbl_dig'
12304 d_dbmclose64='$d_dbmclose64'
12305 d_dbminit64='$d_dbminit64'
12306 d_delete64='$d_delete64'
12307 d_difftime='$d_difftime'
12308 d_dirent64s='$d_dirent64s'
12309 d_dirnamlen='$d_dirnamlen'
12310 d_dlerror='$d_dlerror'
12311 d_dlopen='$d_dlopen'
12312 d_dlsymun='$d_dlsymun'
12313 d_dosuid='$d_dosuid'
12314 d_drand48proto='$d_drand48proto'
12316 d_eaccess='$d_eaccess'
12317 d_endgrent='$d_endgrent'
12318 d_endhent='$d_endhent'
12319 d_endnent='$d_endnent'
12320 d_endpent='$d_endpent'
12321 d_endpwent='$d_endpwent'
12322 d_endsent='$d_endsent'
12323 d_eofnblk='$d_eofnblk'
12324 d_eunice='$d_eunice'
12325 d_fchmod='$d_fchmod'
12326 d_fchown='$d_fchown'
12328 d_fd_macros='$d_fd_macros'
12329 d_fd_set='$d_fd_set'
12330 d_fds_bits='$d_fds_bits'
12331 d_fetch64='$d_fetch64'
12332 d_fgetpos64='$d_fgetpos64'
12333 d_fgetpos='$d_fgetpos'
12334 d_firstkey64='$d_firstkey64'
12335 d_flexfnam='$d_flexfnam'
12336 d_flock64s='$d_flock64s'
12338 d_fopen64='$d_fopen64'
12340 d_fpathconf='$d_fpathconf'
12341 d_freopen64='$d_freopen64'
12342 d_fseek64='$d_fseek64'
12343 d_fseeko64='$d_fseeko64'
12344 d_fseeko='$d_fseeko'
12345 d_fsetpos64='$d_fsetpos64'
12346 d_fsetpos='$d_fsetpos'
12347 d_fstat64='$d_fstat64'
12348 d_ftell64='$d_ftell64'
12349 d_ftello64='$d_ftello64'
12350 d_ftello='$d_ftello'
12352 d_ftruncate64='$d_ftruncate64'
12353 d_getgrent='$d_getgrent'
12354 d_getgrps='$d_getgrps'
12355 d_gethbyaddr='$d_gethbyaddr'
12356 d_gethbyname='$d_gethbyname'
12357 d_gethent='$d_gethent'
12358 d_gethname='$d_gethname'
12359 d_gethostprotos='$d_gethostprotos'
12360 d_getlogin='$d_getlogin'
12361 d_getnbyaddr='$d_getnbyaddr'
12362 d_getnbyname='$d_getnbyname'
12363 d_getnent='$d_getnent'
12364 d_getnetprotos='$d_getnetprotos'
12365 d_getpbyname='$d_getpbyname'
12366 d_getpbynumber='$d_getpbynumber'
12367 d_getpent='$d_getpent'
12368 d_getpgid='$d_getpgid'
12369 d_getpgrp2='$d_getpgrp2'
12370 d_getpgrp='$d_getpgrp'
12371 d_getppid='$d_getppid'
12372 d_getprior='$d_getprior'
12373 d_getprotoprotos='$d_getprotoprotos'
12374 d_getpwent='$d_getpwent'
12375 d_getsbyname='$d_getsbyname'
12376 d_getsbyport='$d_getsbyport'
12377 d_getsent='$d_getsent'
12378 d_getservprotos='$d_getservprotos'
12379 d_gettimeod='$d_gettimeod'
12380 d_gnulibc='$d_gnulibc'
12381 d_grpasswd='$d_grpasswd'
12384 d_inetaton='$d_inetaton'
12385 d_ino64t='$d_ino64t'
12386 d_int64t='$d_int64t'
12387 d_isascii='$d_isascii'
12388 d_killpg='$d_killpg'
12389 d_lchown='$d_lchown'
12391 d_locconv='$d_locconv'
12392 d_lockf64='$d_lockf64'
12394 d_longdbl='$d_longdbl'
12395 d_longlong='$d_longlong'
12396 d_lseek64='$d_lseek64'
12397 d_lstat64='$d_lstat64'
12400 d_mbstowcs='$d_mbstowcs'
12401 d_mbtowc='$d_mbtowc'
12402 d_memcmp='$d_memcmp'
12403 d_memcpy='$d_memcpy'
12404 d_memmove='$d_memmove'
12405 d_memset='$d_memset'
12407 d_mkfifo='$d_mkfifo'
12408 d_mktime='$d_mktime'
12410 d_msgctl='$d_msgctl'
12411 d_msgget='$d_msgget'
12412 d_msgrcv='$d_msgrcv'
12413 d_msgsnd='$d_msgsnd'
12414 d_mymalloc='$d_mymalloc'
12415 d_nextkey64='$d_nextkey64'
12417 d_off64t='$d_off64t'
12418 d_oldpthreads='$d_oldpthreads'
12419 d_oldsock='$d_oldsock'
12421 d_open64='$d_open64'
12422 d_opendir64='$d_opendir64'
12423 d_pathconf='$d_pathconf'
12425 d_phostname='$d_phostname'
12428 d_portable='$d_portable'
12429 d_pthread_create_joinable='$d_pthread_create_joinable'
12430 d_pthread_yield='$d_pthread_yield'
12432 d_pwchange='$d_pwchange'
12433 d_pwclass='$d_pwclass'
12434 d_pwcomment='$d_pwcomment'
12435 d_pwexpire='$d_pwexpire'
12436 d_pwgecos='$d_pwgecos'
12437 d_pwpasswd='$d_pwpasswd'
12438 d_pwquota='$d_pwquota'
12439 d_readdir64='$d_readdir64'
12440 d_readdir='$d_readdir'
12441 d_readlink='$d_readlink'
12442 d_rename='$d_rename'
12443 d_rewinddir='$d_rewinddir'
12445 d_safebcpy='$d_safebcpy'
12446 d_safemcpy='$d_safemcpy'
12447 d_sanemcmp='$d_sanemcmp'
12448 d_sched_yield='$d_sched_yield'
12449 d_seekdir64='$d_seekdir64'
12450 d_seekdir='$d_seekdir'
12451 d_select='$d_select'
12453 d_semctl='$d_semctl'
12454 d_semctl_semid_ds='$d_semctl_semid_ds'
12455 d_semctl_semun='$d_semctl_semun'
12456 d_semget='$d_semget'
12458 d_setegid='$d_setegid'
12459 d_seteuid='$d_seteuid'
12460 d_setgrent='$d_setgrent'
12461 d_setgrps='$d_setgrps'
12462 d_sethent='$d_sethent'
12463 d_setlinebuf='$d_setlinebuf'
12464 d_setlocale='$d_setlocale'
12465 d_setnent='$d_setnent'
12466 d_setpent='$d_setpent'
12467 d_setpgid='$d_setpgid'
12468 d_setpgrp2='$d_setpgrp2'
12469 d_setpgrp='$d_setpgrp'
12470 d_setprior='$d_setprior'
12471 d_setpwent='$d_setpwent'
12472 d_setregid='$d_setregid'
12473 d_setresgid='$d_setresgid'
12474 d_setresuid='$d_setresuid'
12475 d_setreuid='$d_setreuid'
12476 d_setrgid='$d_setrgid'
12477 d_setruid='$d_setruid'
12478 d_setsent='$d_setsent'
12479 d_setsid='$d_setsid'
12480 d_setvbuf='$d_setvbuf'
12484 d_shmatprototype='$d_shmatprototype'
12485 d_shmctl='$d_shmctl'
12487 d_shmget='$d_shmget'
12488 d_sigaction='$d_sigaction'
12489 d_sigsetjmp='$d_sigsetjmp'
12490 d_socket='$d_socket'
12491 d_sockpair='$d_sockpair'
12492 d_stat64='$d_stat64'
12493 d_statblks='$d_statblks'
12494 d_stdio_cnt_lval='$d_stdio_cnt_lval'
12495 d_stdio_ptr_lval='$d_stdio_ptr_lval'
12496 d_stdiobase='$d_stdiobase'
12497 d_stdstdio='$d_stdstdio'
12498 d_store64='$d_store64'
12499 d_strchr='$d_strchr'
12500 d_strcoll='$d_strcoll'
12501 d_strctcpy='$d_strctcpy'
12502 d_strerrm='$d_strerrm'
12503 d_strerror='$d_strerror'
12504 d_strtod='$d_strtod'
12505 d_strtol='$d_strtol'
12506 d_strtoul='$d_strtoul'
12507 d_strxfrm='$d_strxfrm'
12508 d_suidsafe='$d_suidsafe'
12509 d_symlink='$d_symlink'
12510 d_syscall='$d_syscall'
12511 d_sysconf='$d_sysconf'
12512 d_sysernlst='$d_sysernlst'
12513 d_syserrlst='$d_syserrlst'
12514 d_system='$d_system'
12515 d_tcgetpgrp='$d_tcgetpgrp'
12516 d_tcsetpgrp='$d_tcsetpgrp'
12517 d_telldir64='$d_telldir64'
12518 d_telldir='$d_telldir'
12521 d_tmpfile64='$d_tmpfile64'
12522 d_truncate64='$d_truncate64'
12523 d_truncate='$d_truncate'
12524 d_tzname='$d_tzname'
12527 d_union_semun='$d_union_semun'
12529 d_void_closedir='$d_void_closedir'
12530 d_voidsig='$d_voidsig'
12531 d_voidtty='$d_voidtty'
12532 d_volatile='$d_volatile'
12533 d_vprintf='$d_vprintf'
12535 d_waitpid='$d_waitpid'
12536 d_wcstombs='$d_wcstombs'
12537 d_wctomb='$d_wctomb'
12540 db_hashtype='$db_hashtype'
12541 db_prefixtype='$db_prefixtype'
12542 defvoidused='$defvoidused'
12543 direntrytype='$direntrytype'
12546 doublesize='$doublesize'
12548 dynamic_ext='$dynamic_ext'
12554 eunicefix='$eunicefix'
12557 extensions='$extensions'
12559 firstmakefile='$firstmakefile'
12561 fpostype='$fpostype'
12562 freetype='$freetype'
12563 full_csh='$full_csh'
12564 full_sed='$full_sed'
12565 gccversion='$gccversion'
12569 groupcat='$groupcat'
12570 groupstype='$groupstype'
12573 h_sysfile='$h_sysfile'
12577 i_arpainet='$i_arpainet'
12578 i_bsdioctl='$i_bsdioctl'
12581 i_dirent='$i_dirent'
12588 i_inttypes='$i_inttypes'
12589 i_limits='$i_limits'
12590 i_locale='$i_locale'
12591 i_machcthr='$i_machcthr'
12592 i_malloc='$i_malloc'
12594 i_memory='$i_memory'
12597 i_neterrno='$i_neterrno'
12600 i_rpcsvcdbm='$i_rpcsvcdbm'
12603 i_stdarg='$i_stdarg'
12604 i_stddef='$i_stddef'
12605 i_stdlib='$i_stdlib'
12606 i_string='$i_string'
12607 i_sysaccess='$i_sysaccess'
12608 i_sysdir='$i_sysdir'
12609 i_sysfile='$i_sysfile'
12610 i_sysfilio='$i_sysfilio'
12612 i_sysioctl='$i_sysioctl'
12613 i_sysndir='$i_sysndir'
12614 i_sysparam='$i_sysparam'
12615 i_sysresrc='$i_sysresrc'
12616 i_syssecrt='$i_syssecrt'
12617 i_sysselct='$i_sysselct'
12618 i_syssockio='$i_syssockio'
12619 i_sysstat='$i_sysstat'
12620 i_systime='$i_systime'
12621 i_systimek='$i_systimek'
12622 i_systimes='$i_systimes'
12623 i_systypes='$i_systypes'
12625 i_syswait='$i_syswait'
12626 i_termio='$i_termio'
12627 i_termios='$i_termios'
12629 i_unistd='$i_unistd'
12631 i_values='$i_values'
12632 i_varargs='$i_varargs'
12633 i_varhdr='$i_varhdr'
12635 ignore_versioned_solibs='$ignore_versioned_solibs'
12638 installarchlib='$installarchlib'
12639 installbin='$installbin'
12640 installman1dir='$installman1dir'
12641 installman3dir='$installman3dir'
12642 installprivlib='$installprivlib'
12643 installscript='$installscript'
12644 installsitearch='$installsitearch'
12645 installsitelib='$installsitelib'
12647 known_extensions='$known_extensions'
12651 lddlflags='$lddlflags'
12659 libswanted='$libswanted'
12665 locincpth='$locincpth'
12666 loclibpth='$loclibpth'
12667 longdblsize='$longdblsize'
12668 longlongsize='$longlongsize'
12669 longsize='$longsize'
12673 lseeksize='$lseeksize'
12674 lseektype='$lseektype'
12678 make_set_make='$make_set_make'
12679 mallocobj='$mallocobj'
12680 mallocsrc='$mallocsrc'
12681 malloctype='$malloctype'
12683 man1direxp='$man1direxp'
12686 man3direxp='$man3direxp'
12690 mips_type='$mips_type'
12693 modetype='$modetype'
12696 myarchname='$myarchname'
12697 mydomain='$mydomain'
12698 myhostname='$myhostname'
12701 netdb_hlen_type='$netdb_hlen_type'
12702 netdb_host_type='$netdb_host_type'
12703 netdb_name_type='$netdb_name_type'
12704 netdb_net_type='$netdb_net_type'
12707 nm_so_opt='$nm_so_opt'
12708 nonxs_ext='$nonxs_ext'
12710 o_nonblock='$o_nonblock'
12712 optimize='$optimize'
12713 orderlib='$orderlib'
12719 patchlevel='$patchlevel'
12720 path_sep='$path_sep'
12722 perladmin='$perladmin'
12723 perlpath='$perlpath'
12725 phostname='$phostname'
12731 prefixexp='$prefixexp'
12733 privlibexp='$privlibexp'
12734 prototype='$prototype'
12735 pthread_create_joinable='$pthread_create_joinable'
12737 randbits='$randbits'
12738 randfunc='$randfunc'
12739 randseedtype='$randseedtype'
12741 rd_nodata='$rd_nodata'
12745 sched_yield='$sched_yield'
12746 scriptdir='$scriptdir'
12747 scriptdirexp='$scriptdirexp'
12749 seedfunc='$seedfunc'
12750 selectminbits='$selectminbits'
12751 selecttype='$selecttype'
12752 sendmail='$sendmail'
12755 sharpbang='$sharpbang'
12756 shmattype='$shmattype'
12757 shortsize='$shortsize'
12760 sig_name='$sig_name'
12761 sig_name_init='$sig_name_init'
12763 sig_num_init='$sig_num_init'
12764 signal_t='$signal_t'
12765 sitearch='$sitearch'
12766 sitearchexp='$sitearchexp'
12768 sitelibexp='$sitelibexp'
12769 sizetype='$sizetype'
12774 sockethdr='$sockethdr'
12775 socketlib='$socketlib'
12777 spackage='$spackage'
12778 spitshell='$spitshell'
12781 ssizetype='$ssizetype'
12782 startperl='$startperl'
12784 static_ext='$static_ext'
12786 stdio_base='$stdio_base'
12787 stdio_bufsiz='$stdio_bufsiz'
12788 stdio_cnt='$stdio_cnt'
12789 stdio_filbuf='$stdio_filbuf'
12790 stdio_ptr='$stdio_ptr'
12793 subversion='$subversion'
12800 timeincl='$timeincl'
12801 timetype='$timetype'
12809 use64bits='$use64bits'
12811 usemultiplicity='$usemultiplicity'
12812 usemymalloc='$usemymalloc'
12814 useopcode='$useopcode'
12815 useperlio='$useperlio'
12816 useposix='$useposix'
12818 useshrplib='$useshrplib'
12819 usethreads='$usethreads'
12820 usevfork='$usevfork'
12825 voidflags='$voidflags'
12831 : Add in command line options if available
12832 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
12834 : add special variables
12835 $test -f $src/patchlevel.h && \
12836 awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
12837 echo "CONFIG=true" >>config.sh
12839 : propagate old symbols
12840 if $test -f UU/config.sh; then
12841 <UU/config.sh sort | uniq >UU/oldconfig.sh
12842 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
12843 sort | uniq -u >UU/oldsyms
12844 set X `cat UU/oldsyms`
12850 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
12852 echo "# Variables propagated from previous config.sh file." >>config.sh
12853 for sym in `cat UU/oldsyms`; do
12854 echo " Propagating $hint variable "'$'"$sym..."
12855 eval 'tmp="$'"${sym}"'"'
12857 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
12863 : Finish up by extracting the .SH files
12877 If you'd like to make any changes to the config.sh file before I begin
12878 to configure things, do it as a shell escape now (e.g. !vi config.sh).
12881 rp="Press return or use a shell escape to edit config.sh:"
12886 *) : in case they cannot read
12887 sh 1>&4 -c "$ans";;
12892 : if this fails, just run all the .SH files by hand
12899 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
12906 Now you need to generate make dependencies by running "$make depend".
12907 You might prefer to run it in background: "$make depend > makedepend.out &"
12908 It can take a while, so you might not want to run it right now.
12913 rp="Run $make depend now?"
12917 $make depend && echo "Now you must run a $make."
12920 echo "You must run '$make depend' then '$make'."
12923 elif test -f [Mm]akefile; then
12925 echo "Now you must run a $make."
12930 if $test -f Policy.sh; then
12933 If you compile $package on a different machine or from a different object
12934 directory, copy the Policy.sh file from this object directory to the
12935 new one before you run Configure -- this will help you with most of
12936 the policy defaults.
12940 if $test -f config.msg; then
12941 echo "Hmm. I also noted the following information while running:"
12943 $cat config.msg >&4
12946 $rm -f kit*isdone ark*isdone