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 Fri Jul 23 13:08:17 EET DST 1999 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
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 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
436 d_old_pthread_create_joinable=''
437 old_pthread_create_joinable=''
705 ignore_versioned_solibs=''
809 d_stdio_stream_array=''
810 stdio_stream_array=''
835 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
838 : We must find out about Eunice early
840 if test -f /etc/unixtovms; then
841 eunicefix=/etc/unixtovms
843 if test -f /etc/unixtovms.exe; then
844 eunicefix=/etc/unixtovms.exe
848 : Possible local include directories to search.
849 : Set locincpth to "" in a hint file to defeat local include searches.
850 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
851 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
853 : no include file wanted by default
856 : list of known cpp symbols, sorted alphabetically
857 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
858 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
859 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
860 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
861 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
862 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
863 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
864 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
865 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
866 al="$al VMS Xenix286"
867 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
868 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
869 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
870 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
871 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
872 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
873 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
874 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
875 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
876 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
877 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
878 al="$al __SVR4_2__ __UMAXV__"
879 al="$al ____386BSD____ __alpha __alpha__ __amiga"
880 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
881 al="$al __host_mips__"
882 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
883 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
884 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
885 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
886 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
887 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
888 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
889 al="$al __mc88100 __mc88100__ __mips __mips__"
890 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
891 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
892 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
893 al="$al _host_mips _mips _unix"
894 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
895 al="$al apollo ardent att386 att3b"
896 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
897 al="$al cadmus clipper concurrent convex cray ctix"
898 al="$al dmert encore gcos gcx gimpel gould"
899 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
900 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
901 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
902 al="$al i186 i286 i386 i486 i8086"
903 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
904 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
905 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
906 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
907 al="$al mc88000 mc88100 merlin mert mips mvs n16"
908 al="$al ncl_el ncl_mr"
909 al="$al news1500 news1700 news1800 news1900 news3700"
910 al="$al news700 news800 news900 ns16000 ns32000"
911 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
912 al="$al parisc pc532 pdp11 plexus posix pyr"
913 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
914 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
915 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
916 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
917 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
918 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
921 : Trailing extension. Override this in a hint file, if needed.
923 : Extra object files, if any, needed on this platform.
926 : change the next line if compiling for Xenix/286 on Xenix/386
927 xlibpth='/usr/lib/386 /lib/386'
929 : Possible local library directories to search.
930 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
931 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
933 : general looking path for locating libraries
934 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
935 glibpth="$glibpth /lib /usr/lib $xlibpth"
936 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
937 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
939 : Private path used by Configure to find libraries. Its value
940 : is prepended to libpth. This variable takes care of special
941 : machines, like the mips. Usually, it should be empty.
944 : default library list
946 : some systems want to use only the non-versioned libso:s
947 ignore_versioned_solibs=''
948 : full support for void wanted by default
951 : set useposix=false in your hint file to disable the POSIX extension.
953 : set useopcode=false in your hint file to disable the Opcode extension.
955 : set usemultiplicity on the Configure command line to enable multiplicity.
956 : set usesocks on the Configure command line to enable socks.
957 : set usethreads on the Configure command line to enable threads.
958 : List of libraries we want.
959 : If anyone needs -lnet, put it in a hint file.
960 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
961 libswanted="$libswanted dld ld sun m rt c cposix posix"
962 libswanted="$libswanted ndir dir crypt sec"
963 libswanted="$libswanted ucb bsd BSD PW x"
964 : We probably want to search /usr/shlib before most other libraries.
965 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
966 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
967 glibpth="/usr/shlib $glibpth"
968 : Do not use vfork unless overridden by a hint file.
971 : Find the basic shell for Bourne shell scripts
975 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
978 if test -f "$xxx"; then
981 : Build up a list and do a single loop so we can 'break' out.
982 pth=`echo $PATH | sed -e "s/$p_/ /g"`
983 for xxx in sh bash ksh pdksh ash; do
985 try="$try ${p}/${xxx}"
989 if test -f "$xxx"; then
992 elif test -f "$xxx.exe"; then
1003 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1005 Usually it's in /bin/sh. How did you even get this far?
1006 Please contact me (Perl Maintainers) at perlbug@perl.com and
1007 we'll try to straighten this all out.
1013 : see if sh knows # comments
1014 if `$sh -c '#' >/dev/null 2>&1`; then
1018 test -f $xcat || xcat=/usr/bin/cat
1023 if test -s today; then
1026 echo "#! $xcat" > try
1030 if test -s today; then
1038 echo "Your $sh doesn't grok # comments--I will strip them later on."
1041 echo "exec grep -v '^[ ]*#'" >spitshell
1043 $eunicefix spitshell
1044 spitshell=`pwd`/spitshell
1046 echo "I presume that if # doesn't work, #! won't work either!"
1051 : figure out how to guarantee sh startup
1053 '') startsh=${sharpbang}${sh} ;;
1065 : echo "Yup, it does."
1067 echo "Hmm... '$startsh' does not guarantee sh startup..."
1068 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1073 : Save command line options in file UU/cmdline.opt for later use in
1074 : generating config.sh.
1075 cat > cmdline.opt <<EOSH
1076 # Configure command line arguments.
1083 cat >>cmdline.opt <<EOSH
1084 config_arg$argn='$arg'
1086 argn=`expr $argn + 1`
1089 : produce awk script to parse command line options
1090 cat >options.awk <<'EOF'
1092 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
1094 len = length(optstr);
1095 for (i = 1; i <= len; i++) {
1096 c = substr(optstr, i, 1);
1097 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1108 if (substr(str, 1, 1) != "-") {
1109 printf("'%s'\n", str);
1113 for (i = 2; i <= len; i++) {
1114 c = substr(str, i, 1);
1116 printf("-%s\n", substr(str, i));
1122 printf("'%s'\n", substr(str, i + 1));
1135 : process the command line options
1136 set X `for arg in "$@"; do echo "X$arg"; done |
1137 sed -e s/X// | awk -f options.awk`
1142 : set up default values
1153 cat >optdef.sh <<EOS
1159 while test $# -gt 0; do
1161 -d) shift; fastread=yes;;
1162 -e) shift; alldone=cont;;
1166 if test -r "$1"; then
1169 echo "$me: cannot read config file $1." >&2
1174 -h) shift; error=true;;
1175 -r) shift; reuseval=true;;
1176 -s) shift; silent=true; realsilent=true;;
1177 -E) shift; alldone=exit;;
1178 -K) shift; knowitall=true;;
1179 -O) shift; override=true;;
1180 -S) shift; silent=true; extractsh=true;;
1185 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1186 echo "$me: ignoring -D $1" >&2
1189 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1190 *) echo "$1='define'" >> optdef.sh;;
1197 *=) echo "$1" >> optdef.sh;;
1199 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1200 echo "$me: ignoring -U $1" >&2
1202 *) echo "$1='undef'" >> optdef.sh;;
1206 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1209 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1217 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1218 [-U symbol] [-U symbol=]
1219 -d : use defaults for all answers.
1220 -e : go on without questioning past the production of config.sh.
1221 -f : specify an alternate default configuration file.
1222 -h : print this help message and exit (with an error status).
1223 -r : reuse C symbols value if possible (skips costly nm extraction).
1224 -s : silent mode, only echoes questions and essential information.
1225 -D : define symbol to have some value:
1226 -D symbol symbol gets the value 'define'
1227 -D symbol=value symbol gets the value 'value'
1228 -E : stop at the end of questions, after having produced config.sh.
1229 -K : do not use unless you know what you are doing.
1230 -O : let -D and -U override definitions from loaded configuration file.
1231 -S : perform variable substitutions on all .SH files (can mix with -f)
1232 -U : undefine symbol:
1233 -U symbol symbol gets the value 'undef'
1234 -U symbol= symbol gets completely empty
1235 -V : print version number and exit (with a zero status).
1242 case "$fastread$alldone" in
1245 if test ! -t 0; then
1246 echo "Say 'sh Configure', not 'sh <Configure'"
1254 true) exec 1>/dev/null;;
1257 : run the defines and the undefines, if any, but leave the file out there...
1263 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1264 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1265 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1266 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1267 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1270 : Some greps do not return status, grrr.
1271 echo "grimblepritz" >grimble
1272 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1274 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1280 : the following should work in any shell
1284 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1285 cat >contains <<'EOSS'
1286 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1291 : Find the path to the source tree
1294 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
1305 if test -f $rsrc/Configure && \
1306 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1308 : found it, so we are ok.
1311 for src in . .. ../.. ../../.. ../../../..; do
1312 if test -f ../$src/Configure && \
1313 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1324 Sorry, I can't seem to locate the source dir for $package. Please start
1325 Configure with an explicit path -- i.e. /some/path/Configure.
1333 echo "Sources for $package found in \"$src\"." >&4
1337 : script used to extract .SH files with variable substitutions
1338 cat >extract <<'EOS'
1340 echo "Doing variable substitutions on .SH files..."
1341 if test -f $src/MANIFEST; then
1342 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1344 echo "(Looking for .SH files under the source directory.)"
1345 set x `(cd $src; find . -name "*.SH" -print)`
1349 0) set x `(cd $src; echo *.SH)`; shift;;
1351 if test ! -f $src/$1; then
1357 while test $name; do
1358 if test ! -d "$name"; then
1359 create="$name $create";
1360 name=`echo $name | sed -e "s|^[^/]*$||"`;
1361 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1366 for file in $create; do
1375 dir=`expr X$file : 'X\(.*\)/'`
1376 file=`expr X$file : 'X.*/\(.*\)'`
1377 (cd $dir && . ./$file)
1387 dir=`expr X$file : 'X\(.*\)/'`
1388 file=`expr X$file : 'X.*/\(.*\)'`
1389 (set x $dir; shift; eval $mkdir_p)
1399 if test -f $src/config_h.SH; then
1400 if test ! -f config.h; then
1401 : oops, they left it out of MANIFEST, probably, so do it anyway.
1407 : extract files and exit if asked to do so
1408 case "$extractsh" in
1410 case "$realsilent" in
1414 case "$config_sh" in
1415 '') config_sh='config.sh';;
1418 echo "Fetching answers from $config_sh..."
1421 test "$override" && . ./optdef.sh
1430 : Eunice requires " " instead of "", can you believe it
1433 echo "Beginning of configuration questions for $package."
1435 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1437 : first determine how to suppress newline on echo command
1439 echo "Checking echo to see how to suppress newlines..."
1440 (echo "hi there\c" ; echo " ") >.echotmp
1441 if $contains c .echotmp >/dev/null 2>&1 ; then
1452 echo $n "The star should be here-->$c"
1456 : Now test for existence of everything in MANIFEST
1458 if test -f $rsrc/MANIFEST; then
1459 echo "First let's make sure your kit is complete. Checking..." >&4
1460 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1463 for filelist in x??; do
1464 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1466 if test -s missing; then
1470 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1472 You have the option of continuing the configuration process, despite the
1473 distinct possibility that your kit is damaged, by typing 'y'es. If you
1474 do, don't blame me if something goes wrong. I advise you to type 'n'o
1475 and contact the author (perlbug@perl.com).
1478 echo $n "Continue? [n] $c" >&4
1482 echo "Continuing..." >&4
1486 echo "ABORTING..." >&4
1491 echo "Looks good..."
1494 echo "There is no MANIFEST file. I hope your kit is complete !"
1499 : Find the appropriate value for a newline for tr
1500 if test -n "$DJGPP"; then
1503 if test X"$trnl" = X; then
1504 case "`echo foo|tr '\n' x 2>/dev/null`" in
1508 if test X"$trnl" = X; then
1509 case "`echo foo|tr '\012' x 2>/dev/null`" in
1510 foox) trnl='\012' ;;
1513 if test X"$trnl" = X; then
1516 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1522 : compute the number of columns on the terminal for proper question formatting
1527 : set up the echo used in my read
1528 myecho="case \"\$xxxm\" in
1529 '') echo $n \"\$rp $c\" >&4;;
1531 '') echo $n \"[\$xxxm] $c\";;
1533 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1535 echo $n \"[\$xxxm] $c\" >&4
1537 echo $n \"\$rp [\$xxxm] $c\" >&4
1543 : now set up to do reads with possible shell escape and default assignment
1549 case "\$fastread" in
1550 yes) case "\$dflt" in
1553 case "\$silent-\$rp" in
1558 *) case "\$silent" in
1559 true) case "\$rp" in
1564 while expr "X\$ans" : "X!" >/dev/null; do
1568 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1576 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1585 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1590 echo "(OK, I'll run with -d after this question.)" >&4
1593 echo "*** Sorry, \$1 not supported yet." >&4
1603 echo "*** Substitution done -- please confirm."
1605 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1610 echo "*** Error -- try again."
1617 case "\$ans\$xxxm\$nostick" in
1629 : create .config dir to save info across Configure sessions
1630 test -d ../.config || mkdir ../.config
1631 cat >../.config/README <<EOF
1632 This directory created by Configure to save information that should
1633 persist across sessions for $package.
1635 You may safely delete it if you wish.
1638 : general instructions
1641 user=`(logname) 2>/dev/null`
1643 '') user=`whoami 2>&1`;;
1645 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1648 rp='Would you like to see the instructions?'
1659 This installation shell script will examine your system and ask you questions
1660 to determine how the perl5 package should be installed. If you get
1661 stuck on a question, you may use a ! shell escape to start a subshell or
1662 execute a command. Many of the questions will have default answers in square
1663 brackets; typing carriage return will give you the default.
1665 On some of the questions which ask for file or directory names you are allowed
1666 to use the ~name construct to specify the login directory belonging to "name",
1667 even if you don't have a shell which knows about that. Questions where this is
1668 allowed will be marked "(~name ok)".
1672 dflt='Type carriage return to continue'
1676 The prompter used in this script allows you to use shell variables and
1677 backticks in your answers. You may use $1, $2, etc... to refer to the words
1678 in the default answer, as if the default line was a set of arguments given to a
1679 script shell. This means you may also use $* to repeat the whole default line,
1680 so you do not have to re-type everything to add something to the default.
1682 Everytime there is a substitution, you will have to confirm. If there is an
1683 error (e.g. an unmatched backtick), the default answer will remain unchanged
1684 and you will be prompted again.
1686 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1687 the questions and use the computed defaults (or the previous answers if there
1688 was already a config.sh file). Type 'Configure -h' for a list of options.
1689 You may also start interactively and then answer '& -d' at any prompt to turn
1690 on the non-interactive behaviour for the remainder of the execution.
1696 Much effort has been expended to ensure that this shell script will run on any
1697 Unix system. If despite that it blows up on yours, your best bet is to edit
1698 Configure and run it again. If you can't run Configure for some reason,
1699 you'll have to generate a config.sh file by hand. Whatever problems you
1700 have, let me (perlbug@perl.com) know how I blew it.
1702 This installation script affects things in two ways:
1704 1) it may do direct variable substitutions on some of the files included
1706 2) it builds a config.h file for inclusion in C programs. You may edit
1707 any of these files as the need arises after running this script.
1709 If you make a mistake on a question, there is no easy way to back up to it
1710 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1711 files. Configure will offer to let you do this before it runs the SH files.
1714 dflt='Type carriage return to continue'
1716 case "$firsttime" in
1717 true) echo $user >>../.config/instruct;;
1721 : find out where common programs are
1723 echo "Locating common programs..." >&4
1736 if test -d \$dir/\$thing; then
1742 for thisthing in \$dir/\$thing; do
1743 : just loop through to pick last item
1745 if test -f \$thisthing; then
1748 elif test -f \$dir/\$thing.exe; then
1749 if test -n "$DJGPP"; then
1750 echo \$dir/\$thing.exe
1752 : on Eunice apparently
1802 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1803 pth="$pth /lib /usr/lib"
1804 for file in $loclist; do
1808 if test -f "$xxx"; then
1811 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1812 xxx=`./loc $file $file $pth`
1815 '') xxx=`./loc $file $file $pth`;;
1816 *) xxx=`./loc $xxx $xxx $pth`;;
1822 echo $file is in $xxx.
1825 echo $file is in $xxx.
1828 echo "I don't know where '$file' is, and my life depends on it." >&4
1829 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1835 echo "Don't worry if any of the following aren't found..."
1837 for file in $trylist; do
1841 if test -f "$xxx"; then
1844 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1845 xxx=`./loc $file $file $pth`
1848 '') xxx=`./loc $file $file $pth`;;
1849 *) xxx=`./loc $xxx $xxx $pth`;;
1855 echo $file is in $xxx.
1858 echo $file is in $xxx.
1861 echo "I don't see $file out there, $say."
1868 echo "Substituting grep for egrep."
1874 echo "Substituting cp for ln."
1880 echo "Hopefully test is built into your sh."
1883 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1884 echo "Using the test built into your sh."
1892 echo "Hopefully echo is built into your sh."
1897 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1898 $echo $n "hi there$c" >foo1
1899 echo $n "hi there$c" >foo2
1900 if cmp foo1 foo2 >/dev/null 2>&1; then
1901 echo "They are compatible. In fact, they may be identical."
1908 They are not compatible! You are probably running ksh on a non-USG system.
1909 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1910 have echo built in and we may have to run some Bourne shell scripts. That
1911 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1914 $echo $n "The star should be here-->$c"
1921 : determine whether symbolic links are supported
1924 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1925 echo "Symbolic links are supported." >&4
1928 echo "Symbolic links are NOT supported." >&4
1933 : see whether [:lower:] and [:upper:] are supported character classes
1935 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1937 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1941 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
1942 # (0xc9 and 0xd1), therefore that is a nice testing point.
1943 if test "X$up" = X -o "X$low" = X; then
1944 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
1950 if test "X$up" = X -o "X$low" = X; then
1951 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
1957 if test "X$up" = X -o "X$low" = X; then
1958 case "`echo IJ | od -x 2>/dev/null`" in
1960 echo "Hey, this might be EBCDIC." >&4
1961 if test "X$up" = X -o "X$low" = X; then
1962 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
1963 ij) up='[A-IJ-RS-Z]'
1968 if test "X$up" = X -o "X$low" = X; then
1969 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
1979 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
1981 echo "Using $up and $low to convert case." >&4
1984 echo "I don't know how to translate letters from upper to lower case." >&4
1985 echo "Your tr is not acting any way I know of." >&4
1989 : set up the translation script tr, must be called with ./tr of course
1993 '[A-Z][a-z]') exec $tr '$up' '$low';;
1994 '[a-z][A-Z]') exec $tr '$low' '$up';;
2001 : Try to determine whether config.sh was made on this system
2002 case "$config_sh" in
2004 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2005 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2006 # because the A-Z/a-z are not consecutive.
2007 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2008 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2009 newmyuname="$myuname"
2011 case "$knowitall" in
2013 if test -f ../config.sh; then
2014 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2015 eval "`grep myuname= ../config.sh`"
2017 if test "X$myuname" = "X$newmyuname"; then
2025 : Get old answers from old config file if Configure was run on the
2026 : same system, otherwise use the hints.
2029 if test -f config.sh; then
2031 rp="I see a config.sh file. Shall I use it to set the defaults?"
2034 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2035 *) echo "Fetching default answers from your old config.sh file..." >&4
2043 : Older versions did not always set $sh. Catch re-use of such
2052 if test ! -f config.sh; then
2055 First time through, eh? I have some defaults handy for some systems
2056 that need some extra help getting the Configure answers right:
2059 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2061 : Half the following guesses are probably wrong... If you have better
2062 : tests or hints, please send them to perlbug@perl.com
2063 : The metaconfig authors would also appreciate a copy...
2064 $test -f /irix && osname=irix
2065 $test -f /xenix && osname=sco_xenix
2066 $test -f /dynix && osname=dynix
2067 $test -f /dnix && osname=dnix
2068 $test -f /lynx.os && osname=lynxos
2069 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2070 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2071 $test -f /bin/mips && /bin/mips && osname=mips
2072 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2073 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2074 $test -d /usr/apollo/bin && osname=apollo
2075 $test -f /etc/saf/_sactab && osname=svr4
2076 $test -d /usr/include/minix && osname=minix
2077 if $test -d /MachTen -o -d /MachTen_Folder; then
2079 if $test -x /sbin/version; then
2080 osvers=`/sbin/version | $awk '{print $2}' |
2081 $sed -e 's/[A-Za-z]$//'`
2082 elif $test -x /usr/etc/version; then
2083 osvers=`/usr/etc/version | $awk '{print $2}' |
2084 $sed -e 's/[A-Za-z]$//'`
2089 $test -f /sys/posix.dll &&
2090 $test -f /usr/bin/what &&
2091 set X `/usr/bin/what /sys/posix.dll` &&
2092 $test "$3" = UWIN &&
2095 if $test -f $uname; then
2103 umips) osname=umips ;;
2106 [23]100) osname=mips ;;
2107 next*) osname=next ;;
2109 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2110 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2113 elif $test -f /etc/kconfig; then
2115 if test "$lns" = "$ln -s"; then
2117 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2119 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2126 if test -n "$DJGPP"; then
2135 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2137 'not found') osvers="$4"."$3" ;;
2138 '<3240'|'<>3240') osvers=3.2.0 ;;
2139 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2140 '=3250'|'>3250') osvers=3.2.5 ;;
2144 *dc.osx) osname=dcosx
2150 domainos) osname=apollo
2156 dynixptx*) osname=dynixptx
2157 osvers=`echo "$4"|sed 's/^v//'`
2159 freebsd) osname=freebsd
2161 genix) osname=genix ;;
2163 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2179 netbsd*) osname=netbsd
2182 news-os) osvers="$3"
2184 4*) osname=newsos4 ;;
2188 bsd386) osname=bsd386
2191 POSIX-BC | posix-bc ) osname=posix-bc
2194 powerux | power_ux | powermax_os | powermaxos | \
2195 powerunix | power_unix) osname=powerux
2198 next*) osname=next ;;
2199 solaris) osname=solaris
2201 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2208 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2212 titanos) osname=titanos
2221 ultrix) osname=ultrix
2224 osf1|mls+) case "$5" in
2227 osvers=`echo "$3" | sed 's/^[xvt]//'`
2229 hp*) osname=hp_osf1 ;;
2230 mips) osname=mips_osf1 ;;
2239 $2) case "$osname" in
2243 : svr4.x or possibly later
2253 if test -f /stand/boot ; then
2254 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2255 if test -n "$INITPROG" -a -f "$INITPROG"; then
2256 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2257 if test -n "$isesix"; then
2265 *) if test -f /etc/systemid; then
2267 set `echo $3 | $sed 's/\./ /g'` $4
2268 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2270 elif $test -f $src/hints/sco_$1_$2.sh; then
2272 elif $test -f $src/hints/sco_$1.sh; then
2277 '') : Still unknown. Probably a generic Sys V.
2286 *) case "$osname" in
2287 '') : Still unknown. Probably a generic BSD.
2295 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2296 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2297 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2300 $rm -f UU/kernel.what
2301 elif test -d c:/.; then
2308 : Now look for a hint file osname_osvers, unless one has been
2309 : specified already.
2312 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2313 : Also try without trailing minor version numbers.
2314 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2315 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2316 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2317 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2320 *) case "$osvers" in
2323 *) if $test -f $src/hints/$file.sh ; then
2325 elif $test -f $src/hints/$xfile.sh ; then
2327 elif $test -f $src/hints/$xxfile.sh ; then
2329 elif $test -f $src/hints/$xxxfile.sh ; then
2331 elif $test -f $src/hints/$xxxxfile.sh ; then
2333 elif $test -f "$src/hints/${osname}.sh" ; then
2342 if $test -f Policy.sh ; then
2345 none) dflt="Policy" ;;
2346 *) dflt="Policy $dflt" ;;
2351 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2355 if $test -f Policy.sh ; then
2358 There's also a Policy hint file available, which should make the
2359 site-specific (policy) questions easier to answer.
2366 You may give one or more space-separated answers, or "none" if appropriate.
2367 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2368 is a good thing. DO NOT give a wrong version.
2372 rp="Which of these apply, if any?"
2375 for file in $tans; do
2376 if $test X$file = XPolicy -a -f Policy.sh; then
2378 $cat Policy.sh >> UU/config.sh
2379 elif $test -f $src/hints/$file.sh; then
2380 . $src/hints/$file.sh
2381 $cat $src/hints/$file.sh >> UU/config.sh
2382 elif $test X$tans = X -o X$tans = Xnone ; then
2385 : Give one chance to correct a possible typo.
2386 echo "$file.sh does not exist"
2388 rp="hint to use instead?"
2390 for file in $ans; do
2391 if $test -f "$src/hints/$file.sh"; then
2392 . $src/hints/$file.sh
2393 $cat $src/hints/$file.sh >> UU/config.sh
2394 elif $test X$ans = X -o X$ans = Xnone ; then
2397 echo "$file.sh does not exist -- ignored."
2404 : Remember our hint file for later.
2405 if $test -f "$src/hints/$file.sh" ; then
2415 echo "Fetching default answers from $config_sh..." >&4
2419 cp $config_sh config.sh 2>/dev/null
2429 test "$override" && . ./optdef.sh
2430 myuname="$newmyuname"
2432 : Restore computed paths
2433 for file in $loclist $trylist; do
2434 eval $file="\$_$file"
2439 Configure uses the operating system name and version to set some defaults.
2440 The default value is probably right if the name rings a bell. Otherwise,
2441 since spelling matters for me, either accept the default or answer "none"
2448 ''|' '|none) dflt=none ;;
2449 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2452 *) dflt="$osname" ;;
2454 rp="Operating system name?"
2458 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2464 ''|' '|none) dflt=none ;;
2465 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2466 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2468 ''|' ') dflt=none ;;
2473 *) dflt="$osvers" ;;
2475 rp="Operating system version?"
2482 : who configured the system
2483 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2484 cf_by=`(logname) 2>/dev/null`
2487 cf_by=`(whoami) 2>/dev/null`
2489 "") cf_by=unknown ;;
2493 : set up the script used to warn in case of inconsistency
2500 echo "*** WHOA THERE!!! ***" >&4
2501 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2502 rp=" Keep the $hint value?"
2505 y) td=$was; tu=$was;;
2509 : function used to set $1 to $val
2510 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2512 $define$undef) . ./whoa; eval "$var=\$td";;
2513 $undef$define) . ./whoa; eval "$var=\$tu";;
2514 *) eval "$var=$val";;
2519 Perl can be built to take advantage of threads, on some systems.
2520 To do so, Configure must be run with -Dusethreads.
2522 Note that threading is a highly experimental feature, and
2523 some known race conditions still remain. If you choose to try
2524 it, be very sure to not actually deploy it for production
2525 purposes. README.threads has more details, and is required
2526 reading if you enable threads.
2528 case "$usethreads" in
2529 $define|true|[yY]*) dflt='y';;
2532 rp='Build a threading Perl?'
2535 y|Y) val="$define" ;;
2541 case "$d_oldpthreads" in
2542 '') : Configure tests would be welcome here. For now, assume undef.
2544 *) val="$d_oldpthreads" ;;
2550 case "$usethreads" in
2551 "$define"|true|[yY]*)
2552 : Look for a hint-file generated 'call-back-unit'. If the
2553 : user has specified that a threading perl is to be built,
2554 : we may need to set or change some other defaults.
2555 if $test -f usethreads.cbu; then
2559 aix|dec_osf|dos_djgpp|freebsd|hpux|irix|linux|next|openbsd|os2|solaris|vmesa)
2560 # Known thread-capable platforms.
2564 $osname is not known to support threads.
2565 Please let perlbug@perl.com know how to do that.
2567 Cannot continue, aborting.
2577 Perl can be built so that multiple Perl interpreters can coexist
2578 within the same Perl executable. To do so, Configure must be run with
2581 Normally you do not need this and you should answer no.
2584 case "$usemultiplicity" in
2585 $define|true|[yY]*) dflt='y';;
2588 rp='Build Perl for multiplicity?'
2591 y|Y) val="$define" ;;
2599 Perl can be built to take advantage of explicit 64-bit interfaces,
2600 on some systems. To do so, Configure must be run with -Duse64bits.
2602 If this doesn't make any sense to you, just accept the default 'n'.
2604 case "$use64bits" in
2605 $define|true|[yY]*) dflt='y';;
2608 rp='Try to use explicit 64-bit interfaces, if available?'
2621 case "$archname64" in
2622 '') archname64='' ;; # not a typo
2625 case "$use64bits" in
2626 "$define"|true|[yY]*)
2627 : Look for a hint-file generated 'call-back-unit'. If the
2628 : user has specified that a threading perl is to be built,
2629 : we may need to set or change some other defaults.
2630 if $test -f use64bits.cbu; then
2634 aix|dec_osf|hpux|irix|solaris|unicos)
2635 # Known 64-bit capable platforms.
2639 $osname is not known to support 64-bit interfaces.
2640 Please let perlbug@perl.com know how to do that.
2642 Cannot continue, aborting.
2650 : determine the architecture name
2652 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
2653 tarch=`arch`"-$osname"
2654 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
2655 if uname -m > tmparch 2>&1 ; then
2656 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
2657 -e 's/$/'"-$osname/" tmparch`
2665 case "$myarchname" in
2668 echo "(Your architecture name used to be $myarchname.)"
2675 *) dflt="$archname";;
2677 rp='What is your architecture name'
2680 case "$usethreads" in
2682 echo "Threads selected." >&4
2684 *-thread*) echo "...and architecture name already has -thread." >&4
2686 *) archname="$archname-thread"
2687 echo "...setting architecture name to $archname." >&4
2692 case "$usemultiplicity" in
2694 echo "Multiplicity selected." >&4
2696 *-multi*) echo "...and architecture name already has -multi." >&4
2698 *) archname="$archname-multi"
2699 echo "...setting architecture name to $archname." >&4
2704 case "$use64bits" in
2706 echo "Explicit 64-bitness selected." >&4
2707 case "$archname64" in
2712 *-$archname64*) echo "...and architecture name already has $archname64." >&4
2714 *) archname="$archname-$archname64"
2715 echo "...setting architecture name to $archname." >&4
2725 $define|true) afs=true ;;
2726 $undef|false) afs=false ;;
2727 *) if test -d /afs; then
2735 echo "AFS may be running... I'll be extra cautious then..." >&4
2737 echo "AFS does not seem to be running..." >&4
2740 : decide how portable to be. Allow command line overrides.
2741 case "$d_portable" in
2743 *) d_portable="$define" ;;
2746 : set up shell script to do ~ expansion
2752 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2755 if $test -f /bin/csh; then
2756 /bin/csh -f -c "glob \$1"
2761 name=\`$expr x\$1 : '..\([^/]*\)'\`
2762 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2763 if $test ! -d "\$dir"; then
2765 echo "\$me: can't locate home directory for: \$name" >&2
2770 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2786 : now set up to get a file name
2790 cat <<'EOSC' >>getfile
2803 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
2804 fn=`echo $fn | sed 's/(.*)//'`
2810 loc_file=`expr $fn : '.*:\(.*\)'`
2811 fn=`expr $fn : '\(.*\):.*'`
2819 */*) fullpath=true;;
2828 *e*) exp_file=true;;
2831 *p*) nopath_ok=true;;
2836 *d*) type='Directory';;
2837 *l*) type='Locate';;
2842 Locate) what='File';;
2847 case "$d_portable" in
2855 while test "$type"; do
2860 true) rp="$rp (~name ok)";;
2863 if test -f UU/getfile.ok && \
2864 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2883 value=`UU/filexp $ans`
2886 if test "$ans" != "$value"; then
2887 echo "(That expands to $value on this system.)"
2901 /*) value="$ansexp" ;;
2906 echo "I shall only accept a full path name, as in /bin/ls." >&4
2907 echo "Use a ! shell escape if you wish to check pathnames." >&4
2910 echo "Please give a full path name, starting with slash." >&4
2913 echo "Note that using ~name is ok provided it expands well." >&4
2926 if test -f "$ansexp"; then
2928 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2930 echo "($value is not a plain file, but that's ok.)"
2935 if test -d "$ansexp"; then
2940 if test -d "$ansexp"; then
2941 echo "(Looking for $loc_file in directory $value.)"
2942 value="$value/$loc_file"
2943 ansexp="$ansexp/$loc_file"
2945 if test -f "$ansexp"; then
2948 case "$nopath_ok" in
2949 true) case "$value" in
2951 *) echo "Assuming $value will be in people's path."
2967 if test "$fastread" = yes; then
2972 rp="$what $value doesn't exist. Use that name anyway?"
2993 : determine root of directory hierarchy where package will be installed.
2996 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3004 By default, $package will be installed in $dflt/bin, manual
3005 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
3006 all installation directories. Typically set to /usr/local, but you
3007 may choose /usr if you wish to install $package among your system
3008 binaries. If you wish to have binaries under /bin but manual pages
3009 under /usr/local/man, that's ok: you will be prompted separately
3010 for each of the installation directories, the prefix being only used
3011 to set the defaults.
3015 rp='Installation prefix to use?'
3023 *) oldprefix="$prefix";;
3030 : set the prefixit variable, to compute a suitable default value
3031 prefixit='case "$3" in
3033 case "$oldprefix" in
3034 "") eval "$1=\"\$$2\"";;
3041 ""|" ") eval "$1=\"\$$2\"";;
3047 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3049 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3050 /*-$oldprefix/*|\~*-$oldprefix/*)
3051 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3052 *) eval "$1=\"\$$2\"";;
3056 : set the base revision
3059 : get the patchlevel
3061 echo "Getting the current patchlevel..." >&4
3062 if $test -r $rsrc/patchlevel.h;then
3063 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3064 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3069 $echo $n "(You have $package" $c
3072 *) $echo $n " $baserev" $c ;;
3074 $echo $n " patchlevel $patchlevel" $c
3075 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3078 if test 0 -eq "$subversion"; then
3079 version=`LC_ALL=C; export LC_ALL; \
3080 echo $baserev $patchlevel | \
3081 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3083 version=`LC_ALL=C; export LC_ALL; \
3084 echo $baserev $patchlevel $subversion | \
3085 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3087 : Figure out perl API version. Perhaps this should be in patchlevel.h
3088 if test "$subversion" -lt 50; then
3089 apiversion=`LC_ALL=C; export LC_ALL; \
3090 LANGUAGE=C; export LANGUAGE; \
3091 echo $baserev $patchlevel | \
3092 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3094 apiversion="$version"
3097 : determine where private library files go
3098 : Usual default is /usr/local/lib/perl5/$version.
3099 : Also allow things like /opt/perl/lib/$version, since
3100 : /opt/perl/lib/perl5... would be redundant.
3102 *perl*) set dflt privlib lib/$version ;;
3103 *) set dflt privlib lib/$package/$version ;;
3108 There are some auxiliary files for $package that need to be put into a
3109 private library directory that is accessible by everyone.
3113 rp='Pathname where the private library files will reside?'
3115 if $test "X$privlibexp" != "X$ansexp"; then
3119 privlibexp="$ansexp"
3123 Since you are running AFS, I need to distinguish the directory in which
3124 private files reside from the directory in which they are installed (and from
3125 which they are presumably copied to the former directory by occult means).
3128 case "$installprivlib" in
3129 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
3130 *) dflt="$installprivlib";;
3133 rp='Where will private files be installed?'
3135 installprivlib="$ans"
3137 installprivlib="$privlibexp"
3140 : set the prefixup variable, to restore leading tilda escape
3141 prefixup='case "$prefixexp" in
3143 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3146 : determine where public architecture dependent libraries go
3149 : privlib default is /usr/local/lib/$package/$version
3150 : archlib default is /usr/local/lib/$package/$version/$archname
3151 : privlib may have an optional trailing /share.
3152 tdflt=`echo $privlib | $sed 's,/share$,,'`
3153 tdflt=$tdflt/$archname
3162 $spackage contains architecture-dependent library files. If you are
3163 sharing libraries in a heterogeneous environment, you might store
3164 these files in a separate location. Otherwise, you can just include
3165 them with the rest of the public library files.
3169 rp='Where do you want to put the public architecture-dependent libraries?'
3172 archlibexp="$ansexp"
3177 Since you are running AFS, I need to distinguish the directory in
3178 which architecture-dependent library files reside from the directory
3179 in which they are installed (and from which they are presumably copied
3180 to the former directory by occult means).
3183 case "$installarchlib" in
3184 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
3185 *) dflt="$installarchlib";;
3188 rp='Where will architecture-dependent library files be installed?'
3190 installarchlib="$ans"
3192 installarchlib="$archlibexp"
3194 if $test X"$archlib" = X"$privlib"; then
3200 : make some quick guesses about what we are up against
3202 $echo $n "Hmm... $c"
3212 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3213 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3215 echo "Looks kind of like an OSF/1 system, but we'll see..."
3217 elif test `echo abc | tr a-z A-Z` = Abc ; then
3218 xxx=`./loc addbib blurfl $pth`
3219 if $test -f $xxx; then
3220 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3224 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3225 echo "Looks kind of like an extended USG system, but we'll see..."
3227 echo "Looks kind of like a USG system, but we'll see..."
3231 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3232 echo "Looks kind of like a BSD system, but we'll see..."
3236 echo "Looks kind of like a Version 7 system, but we'll see..."
3239 case "$eunicefix" in
3242 There is, however, a strange, musty smell in the air that reminds me of
3243 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3247 : it so happens the Eunice I know will not run shell scripts in Unix format
3251 echo "Congratulations. You aren't running Eunice."
3255 : Detect OS2. The p_ variable is set above in the Head.U unit.
3260 I have the feeling something is not exactly right, however...don't tell me...
3261 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3266 if test -f /xenix; then
3267 echo "Actually, this looks more like a XENIX system..."
3272 echo "It's not Xenix..."
3277 if test -f /venix; then
3278 echo "Actually, this looks more like a VENIX system..."
3285 echo "Nor is it Venix..."
3288 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3289 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3292 : see if setuid scripts can be secure
3295 Some kernels have a bug that prevents setuid #! scripts from being
3296 secure. Some sites have disabled setuid #! scripts because of this.
3298 First let's decide if your kernel supports secure setuid #! scripts.
3299 (If setuid #! scripts would be secure but have been disabled anyway,
3300 don't say that they are secure if asked.)
3305 if $test -d /dev/fd; then
3306 echo "#!$ls" >reflect
3307 chmod +x,u+s reflect
3308 ./reflect >flect 2>&1
3309 if $contains "/dev/fd" flect >/dev/null; then
3310 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3314 If you are not sure if they are secure, I can check but I'll need a
3315 username and password different from the one you are using right now.
3316 If you don't have such a username or don't want me to test, simply
3320 rp='Other username to test security of setuid scripts with?'
3325 case "$d_suidsafe" in
3326 '') echo "I'll assume setuid scripts are *not* secure." >&4
3329 echo "Well, the $hint value is *not* secure." >&4
3331 *) echo "Well, the $hint value *is* secure." >&4
3336 $rm -f reflect flect
3337 echo "#!$ls" >reflect
3338 chmod +x,u+s reflect
3341 echo '"su" will (probably) prompt you for '"$ans's password."
3342 su $ans -c './reflect >flect'
3343 if $contains "/dev/fd" flect >/dev/null; then
3344 echo "Okay, it looks like setuid scripts are secure." >&4
3347 echo "I don't think setuid scripts are secure." >&4
3352 rp='Does your kernel have *secure* setuid scripts?'
3355 [yY]*) val="$define";;
3360 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3361 echo "(That's for file descriptors, not floppy disks.)"
3367 $rm -f reflect flect
3369 : now see if they want to do setuid emulation
3372 case "$d_suidsafe" in
3375 echo "No need to emulate SUID scripts since they are secure here." >& 4
3379 Some systems have disabled setuid scripts, especially systems where
3380 setuid scripts cannot be secure. On systems where setuid scripts have
3381 been disabled, the setuid/setgid bits on scripts are currently
3382 useless. It is possible for $package to detect those bits and emulate
3383 setuid/setgid in a secure fashion. This emulation will only work if
3384 setuid scripts have been disabled in your kernel.
3388 "$define") dflt=y ;;
3391 rp="Do you want to do setuid/setgid emulation?"
3394 [yY]*) val="$define";;
3402 : determine where manual pages are on this system
3406 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
3407 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
3408 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
3409 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
3410 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
3411 sysman=`./loc . /usr/man/man1 $syspath`
3414 if $test -d "$sysman"; then
3415 echo "System manual is in $sysman." >&4
3417 echo "Could not find manual pages in source form." >&4
3420 : see what memory models we can support
3423 $cat >pdp11.c <<'EOP'
3432 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
3433 if $test -f pdp11 && ./pdp11 2>/dev/null; then
3434 dflt='unsplit split'
3436 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3439 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3444 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3447 if $test -d /lib/large || $test -d /usr/lib/large; then
3450 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3459 Some systems have different model sizes. On most systems they are called
3460 small, medium, large, and huge. On the PDP11 they are called unsplit and
3461 split. If your system doesn't support different memory models, say "none".
3462 If you wish to force everything to one memory model, say "none" here and
3463 put the appropriate flags later when it asks you for other cc and ld flags.
3464 Venix systems may wish to put "none" and let the compiler figure things out.
3465 (In the following question multiple model names should be space separated.)
3467 The default for most systems is "none".
3470 rp="Which memory models are supported?"
3485 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3486 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3493 rp="What flag indicates separate I and D space?"
3501 *large*|*small*|*medium*|*huge*)
3508 rp="What flag indicates large model?"
3518 *huge*) case "$huge" in
3522 rp="What flag indicates huge model?"
3532 *medium*) case "$medium" in
3536 rp="What flag indicates medium model?"
3543 *) medium="$large";;
3546 *small*) case "$small" in
3550 rp="What flag indicates small model?"
3561 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3564 $rm -f pdp11.* pdp11
3566 : see if we need a special compiler
3574 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3575 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3589 On some older systems the default C compiler will not resolve multiple global
3590 references that happen to have the same name. On some such systems the "Mcc"
3591 command may be used to force these to be resolved. On other systems a "cc -M"
3592 command is required. (Note that the -M flag on other systems indicates a
3593 memory model to use!) If you have the Gnu C compiler, you might wish to use
3599 rp="Use which C compiler?"
3607 rp="Use which C compiler?"
3611 : Look for a hint-file generated 'call-back-unit'. Now that the
3612 : user has specified the compiler, we may need to set or change some
3614 if $test -f cc.cbu; then
3618 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3619 $cat >gccvers.c <<EOM
3624 printf("%s\n", __VERSION__);
3626 printf("%s\n", "1");
3632 if $cc -o gccvers gccvers.c; then
3633 gccversion=`./gccvers`
3634 case "$gccversion" in
3635 '') echo "You are not using GNU cc." ;;
3636 *) echo "You are using GNU cc $gccversion." ;;
3640 echo "*** WHOA THERE!!! ***" >&4
3641 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3642 case "$knowitall" in
3644 echo " You'd better start hunting for one and let me know about it." >&4
3650 case "$gccversion" in
3651 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3654 : What should the include directory be ?
3656 $echo $n "Hmm... $c"
3660 if $test -f /bin/mips && /bin/mips; then
3661 echo "Looks like a MIPS system..."
3662 $cat >usr.c <<'EOCP'
3663 #ifdef SYSTYPE_BSD43
3667 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3668 dflt='/bsd43/usr/include'
3672 mips_type='System V'
3674 $rm -f usr.c usr.out
3675 echo "and you're compiling with the $mips_type compiler and libraries."
3679 echo "Doesn't look like a MIPS system."
3689 case "$xxx_prompt" in
3692 rp='Where are the include files you want to use?'
3700 : see how we invoke the C preprocessor
3702 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3703 cat <<'EOT' >testcpp.c
3709 if test ! -f cppstdin; then
3710 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3712 echo "Keeping your $hint cppstdin wrapper."
3715 wrapper=`pwd`/cppstdin
3719 if $test "X$cppstdin" != "X" && \
3720 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3721 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3723 echo "You used to use $cppstdin $cppminus so we'll use that again."
3725 '') echo "But let's see if we can live without a wrapper..." ;;
3727 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3728 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3730 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3733 echo "(However, $cpprun $cpplast does not work, let's see...)"
3741 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3748 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3749 $cc -E <testcpp.c >testcpp.out 2>&1; \
3750 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3751 echo "Yup, it does."
3754 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3755 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3756 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3757 echo "Yup, it does."
3760 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3761 $cc -P <testcpp.c >testcpp.out 2>&1; \
3762 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3763 echo "Yipee, that works!"
3766 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3767 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3768 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3769 echo "At long last!"
3772 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3773 $cpp <testcpp.c >testcpp.out 2>&1; \
3774 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3778 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3779 $cpp - <testcpp.c >testcpp.out 2>&1; \
3780 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3781 echo "Hooray, it works! I was beginning to wonder."
3784 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3785 $wrapper <testcpp.c >testcpp.out 2>&1; \
3786 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3792 rp="No dice. I can't find a C preprocessor. Name one:"
3796 $x_cpp <testcpp.c >testcpp.out 2>&1
3797 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3798 echo "OK, that will do." >&4
3800 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3815 echo "Perhaps can we force $cc -E using a wrapper..."
3816 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3817 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3823 echo "Nope, we'll have to live without it..."
3837 "$wrapper"|'cppstdin') ;;
3838 *) $rm -f $wrapper;;
3840 $rm -f testcpp.c testcpp.out
3842 : Set private lib path
3845 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3850 '') dlist="$loclibpth $plibpth $glibpth";;
3851 *) dlist="$libpth";;
3854 : Now check and see which directories actually exist, avoiding duplicates
3858 if $test -d $xxx; then
3861 *) libpth="$libpth $xxx";;
3867 Some systems have incompatible or broken versions of libraries. Among
3868 the directories listed in the question below, please remove any you
3869 know not to be holding relevant libraries, and add any that are needed.
3870 Say "none" for none.
3881 rp="Directories to use for library searches?"
3888 : compute shared library extension
3891 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3901 On some systems, shared libraries may be available. Answer 'none' if
3902 you want to suppress searching of shared libraries for the remaining
3903 of this configuration.
3906 rp='What is the file extension used for shared libraries?'
3910 : Define several unixisms.
3911 : Hints files or command line option can be used to override them.
3912 : The convoluted testing is in case hints files set either the old
3915 '') case "$exe_ext" in
3917 *) _exe="$exe_ext" ;;
3922 '') case "$lib_ext" in
3929 '') case "$obj_ext" in
3936 '') case "$path_sep" in
3947 : Which makefile gets called first. This is used by make depend.
3948 case "$firstmakefile" in
3949 '') firstmakefile='makefile';;
3954 Perl can be built to use the SOCKS proxy protocol library. To do so,
3955 Configure must be run with -Dusesocks.
3957 Normally you do not need this and you should answer no.
3961 $define|true|[yY]*) dflt='y';;
3964 rp='Build Perl for SOCKS?'
3967 y|Y) val="$define" ;;
3973 : Looking for optional libraries
3975 echo "Checking for optional libraries..." >&4
3980 case "$libswanted" in
3981 '') libswanted='c_s';;
3985 libswanted="$libswanted socks5 socks5_sh"
3988 for thislib in $libswanted; do
3990 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3991 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3992 echo "Found -l$thislib (shared)."
3995 *) dflt="$dflt -l$thislib";;
3997 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3998 echo "Found -l$thislib (shared)."
4001 *) dflt="$dflt -l$thislib";;
4003 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4004 echo "Found -l$thislib."
4007 *) dflt="$dflt -l$thislib";;
4009 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4010 echo "Found -l$thislib."
4013 *) dflt="$dflt -l$thislib";;
4015 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4016 echo "Found -l${thislib}_s."
4019 *) dflt="$dflt -l${thislib}_s";;
4021 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4022 echo "Found -l$thislib."
4025 *) dflt="$dflt -l$thislib";;
4028 echo "No -l$thislib."
4039 ' '|'') dflt='none';;
4044 In order to compile $package on your machine, a number of libraries
4045 are usually needed. Include any other special libraries here as well.
4046 Say "none" for none. The default list is almost always right.
4050 rp="What libraries to use?"
4057 : determine optimize, if desired, or use for debug flag also
4059 ' '|$undef) dflt='none';;
4061 *) dflt="$optimize";;
4065 Some C compilers have problems with their optimizers. By default, $package
4066 compiles with the -O flag to use the optimizer. Alternately, you might want
4067 to use the symbolic debugger, which uses the -g flag (on traditional Unix
4068 systems). Either flag can be specified here. To use neither flag, specify
4072 rp="What optimizer/debugger flag should be used?"
4076 'none') optimize=" ";;
4080 : We will not override a previous value, but we might want to
4081 : augment a hint file
4084 case "$gccversion" in
4085 1*) dflt='-fpcc-struct-return' ;;
4088 *-g*) dflt="$dflt -DDEBUGGING";;
4090 case "$gccversion" in
4091 2*) if test -d /etc/conf/kconfig.d &&
4092 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4101 case "$mips_type" in
4102 *BSD*|'') inclwanted="$locincpth $usrinc";;
4103 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4105 for thisincl in $inclwanted; do
4106 if $test -d $thisincl; then
4107 if $test x$thisincl != x$usrinc; then
4110 *) dflt="$dflt -I$thisincl";;
4116 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4118 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4126 *) dflt="$dflt -D$2";;
4130 set signal.h LANGUAGE_C; eval $inctest
4134 ccflags="$ccflags -DSOCKS"
4139 none|recommended) dflt="$ccflags $dflt" ;;
4140 *) dflt="$ccflags";;
4148 Your C compiler may want other flags. For this question you should include
4149 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4150 but you should NOT include libraries or ld flags like -lwhatever. If you
4151 want $package to honor its debug switch, you should include -DDEBUGGING here.
4152 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4154 To use no flags, specify the word "none".
4160 rp="Any additional cc flags?"
4167 : the following weeds options from ccflags that are of no interest to cpp
4169 case "$gccversion" in
4170 1*) cppflags="$cppflags -D__GNUC__"
4172 case "$mips_type" in
4174 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4180 echo "Let me guess what the preprocessor flags are..." >&4
4194 *) ftry="$previous $flag";;
4196 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4197 >cpp1.out 2>/dev/null && \
4198 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4199 >cpp2.out 2>/dev/null && \
4200 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4201 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4203 cppflags="$cppflags $ftry"
4213 *-*) echo "They appear to be: $cppflags";;
4215 $rm -f cpp.c cpp?.out
4219 : flags used in final linking phase
4221 '') if ./venix; then
4227 *-posix*) dflt="$dflt -posix" ;;
4230 *) dflt="$ldflags";;
4233 : Try to guess additional flags to pick up local libraries.
4234 for thislibdir in $libpth; do
4235 case " $loclibpth " in
4238 *"-L$thislibdir "*) ;;
4239 *) dflt="$dflt -L$thislibdir" ;;
4251 Your C linker may need flags. For this question you should
4252 include -L/whatever and any other flags used by the C linker, but you
4253 should NOT include libraries like -lwhatever.
4255 Make sure you include the appropriate -L/path flags if your C linker
4256 does not normally search all of the directories you specified above,
4259 To use no flags, specify the word "none".
4263 rp="Any additional ld flags (NOT including libraries)?"
4269 rmlist="$rmlist pdp11"
4273 echo "Checking your choice of C compiler and flags for coherency..." >&4
4274 $cat > try.c <<'EOF'
4276 int main() { printf("Ok\n"); exit(0); }
4278 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4280 $cat >try.msg <<'EOM'
4281 I've tried to compile and run the following simple program:
4284 $cat try.c >> try.msg
4286 $cat >> try.msg <<EOM
4293 and I got the following output:
4297 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4298 if sh -c './try' >>try.msg 2>&1; then
4302 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4305 cat >> try.msg <<'EOQS'
4306 If $libs contains -lsfio, and sfio is mis-configured, then it
4307 sometimes (apparently) runs and exits with a 0 status, but with no
4308 output! It may have to do with sfio's use of _exit vs. exit.
4311 rp="You have a big problem. Shall I abort Configure"
4318 echo "The program compiled OK, but exited with status $?." >>try.msg
4319 rp="You have a problem. Shall I abort Configure"
4323 echo "I can't compile the test program." >>try.msg
4324 rp="You have a BIG problem. Shall I abort Configure"
4330 case "$knowitall" in
4332 echo "(The supplied flags or libraries might be incorrect.)"
4340 *) echo "Ok. Stopping Configure." >&4
4345 n) echo "OK, that should do.";;
4347 $rm -f try try.* core
4349 : determine filename position in cpp output
4351 echo "Computing filename position in cpp output for #include directives..." >&4
4352 echo '#include <stdio.h>' > foo.c
4355 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4356 $grep '^[ ]*#.*stdio\.h' | \
4357 while read cline; do
4360 while $test \$# -gt 0; do
4361 if $test -r \`echo \$1 | $tr -d '"'\`; then
4366 pos=\`expr \$pos + 1\`
4378 *) pos="${fieldn}th";;
4380 echo "Your cpp writes the filename in the $pos field of the line."
4382 : locate header file
4387 for usrincdir in $usrinc
4389 if test -f \$usrincdir/\$wanted; then
4390 echo "\$usrincdir/\$wanted"
4394 awkprg='{ print \$$fieldn }'
4395 echo "#include <\$wanted>" > foo\$\$.c
4396 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4397 $grep "^[ ]*#.*\$wanted" | \
4398 while read cline; do
4399 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4401 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4402 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4407 # status = 0: grep returned 0 lines, case statement not executed
4408 # status = 1: headerfile found
4409 # status = 2: while loop executed, no headerfile found
4413 if test \$status -eq 1; then
4420 : define an alternate in-header-list? function
4421 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4422 cont=true; xxf="echo \"<\$1> found.\" >&4";
4423 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4424 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4426 case $# in 4) instead=instead;; *) instead="at last";; esac;
4427 while $test "$cont"; do
4429 var=$2; eval "was=\$$2";
4430 if $test "$xxx" && $test -r "$xxx";
4432 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4435 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4436 set $yyy; shift; shift; yyy=$@;
4437 case $# in 0) cont="";;
4438 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4439 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4440 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4441 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4445 do set $yyy; var=$2; eval "was=\$$2";
4446 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4447 set $yyy; shift; shift; yyy=$@;
4450 : see if this is a malloc.h system
4451 set malloc.h i_malloc
4454 : see if stdlib is available
4455 set stdlib.h i_stdlib
4458 : determine which malloc to compile in
4460 case "$usemymalloc" in
4461 ''|[yY]*|true|$define) dflt='y' ;;
4464 rp="Do you wish to attempt to use the malloc that comes with $package?"
4470 mallocsrc='malloc.c'
4471 mallocobj="malloc$_o"
4472 d_mymalloc="$define"
4475 : Remove malloc from list of libraries to use
4476 echo "Removing unneeded -lmalloc from library list" >&4
4477 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4480 echo "libs = $libs" >&4
4492 : compute the return types of malloc and free
4494 $cat >malloc.c <<END
4498 #include <sys/types.h>
4512 case "$malloctype" in
4514 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4521 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4525 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4532 echo "Your system uses $freetype free(), it would seem." >&4
4534 : Cruising for prototypes
4536 echo "Checking out function prototypes..." >&4
4537 $cat >prototype.c <<'EOCP'
4538 int main(int argc, char *argv[]) {
4541 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4542 echo "Your C compiler appears to support function prototypes."
4545 echo "Your C compiler doesn't seem to understand function prototypes."
4552 case "$prototype" in
4554 *) ansi2knr='ansi2knr'
4559 This version of $package can only be compiled by a compiler that
4560 understands function prototypes. Unfortunately, your C compiler
4562 doesn't seem to understand them. Sorry about that.
4564 If GNU cc is available for your system, perhaps you could try that instead.
4566 Eventually, we hope to support building Perl with pre-ANSI compilers.
4567 If you would like to help in that effort, please contact <perlbug@perl.org>.
4569 Aborting Configure now.
4575 : determine where public executables go
4580 rp='Pathname where the public executables will reside?'
4582 if $test "X$ansexp" != "X$binexp"; then
4590 Since you are running AFS, I need to distinguish the directory in which
4591 executables reside from the directory in which they are installed (and from
4592 which they are presumably copied to the former directory by occult means).
4595 case "$installbin" in
4596 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
4597 *) dflt="$installbin";;
4600 rp='Where will public executables be installed?'
4604 installbin="$binexp"
4607 : determine whether to install perl also as /usr/bin/perl
4610 if test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4612 Many scripts expect to perl to be installed as /usr/bin/perl.
4613 I can install the perl you are about to compile also as /usr/bin/perl
4614 (in addition to $installbin/perl).
4616 case "$installusrbinperl" in
4617 "$undef"|[nN]*) dflt='n';;
4620 rp="Do you want to install perl as /usr/bin/perl?"
4623 [yY]*) val="$define";;
4629 set installusrbinperl
4632 : define a shorthand compile call
4636 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4637 : define a shorthand compile call for compilations that should be ok.
4641 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4644 echo "Checking for GNU C Library..." >&4
4645 cat >gnulibc.c <<EOM
4657 if eval $compile_ok && ./gnulibc; then
4659 echo "You are using the GNU C Library"
4662 echo "You are not using the GNU C Library"
4668 : see if nm is to be used to determine whether a symbol is defined or not
4672 case "$d_gnulibc" in
4675 echo "nm probably won't work on the GNU C Library." >&4
4681 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4683 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4684 echo "'nm' won't be sufficient on this sytem." >&4
4690 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4691 if $test $dflt -gt 20; then
4701 true|$define) dflt=y;;
4708 I can use $nm to extract the symbols from your C libraries. This
4709 is a time consuming task which may generate huge output on the disk (up
4710 to 3 megabytes) but that should make the symbols extraction faster. The
4711 alternative is to skip the 'nm' extraction part and to compile a small
4712 test program instead to determine whether each symbol is present. If
4713 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4714 this may be the best solution.
4716 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4719 rp="Shall I use $nm to extract C symbols from the libraries?"
4722 [Nn]*) usenm=false;;
4731 : nm options which may be necessary
4733 '') if $test -f /mach_boot; then
4735 elif $test -d /usr/ccs/lib; then
4736 nm_opt='-p' # Solaris (and SunOS?)
4737 elif $test -f /dgux; then
4739 elif $test -f /lib64/rld; then
4740 nm_opt='-p' # 64-bit Irix
4746 : nm options which may be necessary for shared libraries but illegal
4747 : for archive libraries. Thank you, Linux.
4748 case "$nm_so_opt" in
4749 '') case "$myuname" in
4751 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4752 nm_so_opt='--dynamic'
4761 : get list of predefined functions in a handy place
4766 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4773 *) for thislib in $libs; do
4776 : Handle C library specially below.
4779 thislib=`echo $thislib | $sed -e 's/^-l//'`
4780 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4782 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4784 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4786 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4788 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4790 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4792 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4797 libnames="$libnames $try"
4799 *) libnames="$libnames $thislib" ;;
4808 for xxx in $libpth; do
4809 $test -r $1 || set $xxx/libc.$so
4810 : The messy sed command sorts on library version numbers.
4812 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4813 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4815 s/[0-9][0-9]*/0000&/g
4816 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4819 sort | $sed -e 's/^.* //'`
4822 $test -r $1 || set /usr/ccs/lib/libc.$so
4823 $test -r $1 || set /lib/libsys_s$_a
4829 if $test -r "$1"; then
4830 echo "Your (shared) C library seems to be in $1."
4832 elif $test -r /lib/libc && $test -r /lib/clib; then
4833 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4835 libc='/lib/clib /lib/libc'
4836 if $test -r /lib/syslib; then
4837 echo "(Your math library is in /lib/syslib.)"
4838 libc="$libc /lib/syslib"
4840 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4841 echo "Your C library seems to be in $libc, as you said before."
4842 elif $test -r $incpath/usr/lib/libc$_a; then
4843 libc=$incpath/usr/lib/libc$_a;
4844 echo "Your C library seems to be in $libc. That's fine."
4845 elif $test -r /lib/libc$_a; then
4847 echo "Your C library seems to be in $libc. You're normal."
4849 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4851 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4852 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4853 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4855 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4857 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4860 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4862 if $test -r "$tans"; then
4863 echo "Your C library seems to be in $tans, of all places."
4869 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4873 If the guess above is wrong (which it might be if you're using a strange
4874 compiler, or your machine supports multiple models), you can override it here.
4879 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
4881 I can't seem to find your C library. I've looked in the following places:
4884 $sed 's/^/ /' libpath
4887 None of these seems to contain your C library. I need to get its name...
4892 rp='Where is your C library?'
4897 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
4898 set X `cat libnames`
4901 case $# in 1) xxx=file; esac
4902 echo "Extracting names from the following $xxx for later perusal:" >&4
4904 $sed 's/^/ /' libnames >&4
4906 $echo $n "This may take a while...$c" >&4
4910 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4911 *) $nm $nm_opt $file 2>/dev/null;;
4916 $grep fprintf libc.tmp > libc.ptf
4917 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4918 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4920 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4922 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4924 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4926 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4928 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4930 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4932 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4934 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4936 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4938 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4940 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4942 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4944 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4945 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4947 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4949 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4951 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4953 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4955 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4957 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4959 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4961 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4963 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4965 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4967 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4969 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4971 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4973 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
4975 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4978 $nm -p $* 2>/dev/null >libc.tmp
4979 $grep fprintf libc.tmp > libc.ptf
4980 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4981 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4987 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4989 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4990 for thisname in $libnames $libc; do
4991 $ar t $thisname >>libc.tmp
4993 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4995 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4996 # Repeat libc to extract forwarders to DLL entries too
4997 for thisname in $libnames $libc; do
4998 $ar tv $thisname >>libc.tmp
4999 # Revision 50 of EMX has bug in $ar.
5000 # it will not extract forwarders to DLL entries
5001 # Use emximp which will extract exactly them.
5002 emximp -o tmp.imp $thisname \
5004 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5005 < tmp.imp >>libc.tmp
5008 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5011 echo "$ar didn't seem to work right." >&4
5012 echo "Maybe this is a Cray...trying bld instead..." >&4
5013 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5015 for thisname in $libnames; do
5017 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5018 $ar t $thisname >>libc.tmp
5022 echo "That didn't work either. Giving up." >&4
5029 if $test -f /lib/syscalls.exp; then
5031 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5032 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5036 $rm -f libnames libpath
5038 : see if dld is available
5042 : is a C symbol defined?
5045 -v) tf=libc.tmp; tc=""; tdc="";;
5046 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5047 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5050 case "$reuseval-$4" in
5052 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5058 if $contains $tlook $tf >/dev/null 2>&1;
5063 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5064 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5072 $define) tval=true;;
5078 : define an is-in-libc? function
5079 inlibc='echo " "; td=$define; tu=$undef;
5080 sym=$1; var=$2; eval "was=\$$2";
5082 case "$reuseval$was" in
5092 echo "$sym() found." >&4;
5093 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5095 echo "$sym() NOT found." >&4;
5096 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5100 $define) echo "$sym() found." >&4;;
5101 *) echo "$sym() NOT found." >&4;;
5105 : see if dlopen exists
5112 : determine which dynamic loading, if any, to compile in
5114 dldir="ext/DynaLoader"
5127 $define) dflt='y' ;;
5130 $define) dflt='y' ;;
5132 : Does a dl_xxx.xs file exist for this operating system
5133 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5136 rp="Do you wish to use dynamic loading?"
5143 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5144 dflt="$dldir/dl_${osname}.xs"
5145 elif $test "$d_dlopen" = "$define" ; then
5146 dflt="$dldir/dl_dlopen.xs"
5147 elif $test "$i_dld" = "$define" ; then
5148 dflt="$dldir/dl_dld.xs"
5153 *) dflt="$dldir/$dlsrc"
5156 echo "The following dynamic loading files are available:"
5157 : Can not go over to $dldir because getfile has path hard-coded in.
5158 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5159 rp="Source file to use for dynamic loading"
5161 # XXX This getfile call will fail the existence check if you try
5162 # building away from $src (this is not supported yet).
5166 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5170 Some systems may require passing special flags to $cc -c to
5171 compile modules that will be used to create a shared library.
5172 To use no flags, say "none".
5175 case "$cccdlflags" in
5176 '') case "$gccversion" in
5177 '') case "$osname" in
5179 next) dflt='none' ;;
5180 irix*) dflt='-KPIC' ;;
5181 svr4*|esix*|solaris) dflt='-KPIC' ;;
5182 sunos) dflt='-pic' ;;
5186 *) case "$osname" in
5187 svr4*|esix*|solaris) dflt='-fPIC' ;;
5192 *) dflt="$cccdlflags" ;;
5194 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5197 none) cccdlflags=' ' ;;
5198 *) cccdlflags="$ans" ;;
5203 Some systems use ld to create libraries that can be dynamically loaded,
5204 while other systems (such as those using ELF) use $cc.
5208 '') $cat >try.c <<'EOM'
5209 /* Test for whether ELF binaries are produced */
5214 int i = open("a.out",O_RDONLY);
5217 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5218 exit(0); /* succeed (yes, it's ELF) */
5223 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5225 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5229 echo "I'll use ld to build dynamic libraries."
5238 rp="What command should be used to create dynamic libraries?"
5244 Some systems may require passing special flags to $ld to create a
5245 library that can be dynamically loaded. If your ld flags include
5246 -L/other/path options to locate libraries outside your loader's normal
5247 search path, you may need to specify those -L options here as well. To
5248 use no flags, say "none".
5251 case "$lddlflags" in
5252 '') case "$osname" in
5253 beos) dflt='-nostart' ;;
5255 linux|irix*) dflt='-shared' ;;
5256 next) dflt='none' ;;
5257 solaris) dflt='-G' ;;
5258 sunos) dflt='-assert nodefinitions' ;;
5259 svr4*|esix*) dflt="-G $ldflags" ;;
5263 *) dflt="$lddlflags" ;;
5266 : Try to guess additional flags to pick up local libraries.
5267 : Be careful not to append to a plain 'none'
5271 for thisflag in $ldflags; do
5276 *) dflt="$dflt $thisflag" ;;
5283 ''|' ') dflt='none' ;;
5286 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5289 none) lddlflags=' ' ;;
5290 *) lddlflags="$ans" ;;
5295 Some systems may require passing special flags to $cc to indicate that
5296 the resulting executable will use dynamic linking. To use no flags,
5300 case "$ccdlflags" in
5301 '') case "$osname" in
5302 hpux) dflt='-Wl,-E' ;;
5303 linux) dflt='-rdynamic' ;;
5304 next) dflt='none' ;;
5305 sunos) dflt='none' ;;
5309 *) dflt="$ccdlflags" ;;
5311 rp="Any special flags to pass to $cc to use dynamic loading?"
5314 none) ccdlflags=' ' ;;
5315 *) ccdlflags="$ans" ;;
5329 # No dynamic loading being used, so don't bother even to prompt.
5332 *) case "$useshrplib" in
5333 '') case "$osname" in
5334 svr4*|dgux|dynixptx|esix|powerux|beos)
5336 also='Building a shared libperl is required for dynamic loading to work on your system.'
5341 also='Building a shared libperl is needed for MAB support.'
5359 The perl executable is normally obtained by linking perlmain.c with
5360 libperl${_a}, any static extensions (usually just DynaLoader), and
5361 any other libraries needed on this system (such as -lm, etc.). Since
5362 your system supports dynamic loading, it is probably possible to build
5363 a shared libperl.$so. If you will have more than one executable linked
5364 to libperl.$so, this will significantly reduce the size of each
5365 executable, but it may have a noticeable affect on performance. The
5366 default is probably sensible for your system.
5370 rp="Build a shared libperl.$so (y/n)"
5374 useshrplib='true' ;;
5375 *) useshrplib='false' ;;
5380 case "$useshrplib" in
5384 # Figure out a good name for libperl.so. Since it gets stored in
5385 # a version-specific architecture-dependent library, the version
5386 # number isn't really that important, except for making cc/ld happy.
5388 # A name such as libperl.so.3.1
5389 majmin="libperl.$so.$patchlevel.$subversion"
5390 # A name such as libperl.so.301
5391 majonly=`echo $patchlevel $subversion |
5392 $awk '{printf "%d%02d", $1, $2}'`
5393 majonly=libperl.$so.$majonly
5394 # I'd prefer to keep the os-specific stuff here to a minimum, and
5395 # rely on figuring it out from the naming of libc.
5396 case "${osname}${osvers}" in
5399 # XXX How handle the --version stuff for MAB?
5401 linux*) # ld won't link with a bare -lperl otherwise.
5404 *) # Try to guess based on whether libc has major.minor.
5406 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5407 *libc.$so.[0-9]*) dflt=$majonly ;;
5408 *) dflt=libperl.$so ;;
5418 I need to select a good name for the shared libperl. If your system uses
5419 library names with major and minor numbers, then you might want something
5420 like $majmin. Alternatively, if your system uses a single version
5421 number for shared libraries, then you might want to use $majonly.
5422 Or, your system might be quite happy with a simple libperl.$so.
5424 Since the shared libperl will get installed into a version-specific
5425 architecture-dependent directory, the version number of the shared perl
5426 library probably isn't important, so the default should be o.k.
5429 rp='What name do you want to give to the shared libperl?'
5432 echo "Ok, I'll use $libperl"
5435 libperl="libperl${_a}"
5439 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5443 WARNING: Use of the shrpdir variable for the installation location of
5444 the shared $libperl is not supported. It was never documented and
5445 will not work in this version. Let me (perlbug@perl.com)
5446 know of any problems this may cause.
5452 But your current setting of $shrpdir is
5453 the default anyway, so it's harmless.
5458 Further, your current attempted setting of $shrpdir
5459 conflicts with the value of $archlibexp/CORE
5460 that installperl will use.
5467 # How will the perl executable find the installed shared $libperl?
5468 # Add $xxx to ccdlflags.
5469 # If we can't figure out a command-line option, use $shrpenv to
5470 # set env LD_RUN_PATH. The main perl makefile uses this.
5471 shrpdir=$archlibexp/CORE
5474 if "$useshrplib"; then
5477 # We'll set it in Makefile.SH...
5483 xxx="-Wl,-R$shrpdir"
5485 linux|irix*|dec_osf)
5486 xxx="-Wl,-rpath,$shrpdir"
5489 # next doesn't like the default...
5492 # beos doesn't like the default, either.
5495 # hpux doesn't like the default, either.
5496 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5499 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5505 # Only add $xxx if it isn't already in ccdlflags.
5506 case " $ccdlflags " in
5508 *) ccdlflags="$ccdlflags $xxx"
5511 Adding $xxx to the flags
5512 passed to $ld so that the perl executable will find the
5513 installed shared $libperl.
5521 # Fix ccdlflags in AIX for building external extensions.
5522 # (For building Perl itself bare -bE:perl.exp is needed,
5523 # Makefile.SH takes care of this.)
5525 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5527 # Respect a hint or command-line value.
5529 '') shrpenv="$tmp_shrpenv" ;;
5531 case "$ldlibpthname" in
5532 '') ldlibpthname=LD_LIBRARY_PATH ;;
5533 none) ldlibpthname='' ;;
5536 : determine where manual pages go
5537 set man1dir man1dir none
5541 $spackage has manual pages available in source form.
5545 echo "However, you don't have nroff, so they're probably useless to you."
5547 '') man1dir="none";;
5550 echo "If you don't want the manual sources installed, answer 'none'."
5555 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5556 lookpath="$lookpath $prefixexp/man/p_man/man1"
5557 lookpath="$lookpath $prefixexp/man/u_man/man1"
5558 lookpath="$lookpath $prefixexp/man/man.1"
5560 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5561 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5571 rp="Where do the main $spackage manual pages (source) go?"
5573 if $test "X$man1direxp" != "X$ansexp"; then
5577 man1direxp="$ansexp"
5585 Since you are running AFS, I need to distinguish the directory in which
5586 manual pages reside from the directory in which they are installed (and from
5587 which they are presumably copied to the former directory by occult means).
5590 case "$installman1dir" in
5591 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
5592 *) dflt="$installman1dir";;
5595 rp='Where will man pages be installed?'
5597 installman1dir="$ans"
5599 installman1dir="$man1direxp"
5602 : What suffix to use on installed man pages
5609 rp="What suffix should be used for the main $spackage man pages?"
5611 '') case "$man1dir" in
5625 *) dflt="$man1ext";;
5632 : see if we can have long filenames
5634 rmlist="$rmlist /tmp/cf$$"
5635 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5636 first=123456789abcdef
5637 second=/tmp/cf$$/$first
5638 $rm -f $first $second
5639 if (echo hi >$first) 2>/dev/null; then
5640 if $test -f 123456789abcde; then
5641 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5644 if (echo hi >$second) 2>/dev/null; then
5645 if $test -f /tmp/cf$$/123456789abcde; then
5647 That's peculiar... You can have filenames longer than 14 characters, but only
5648 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5649 I shall consider your system cannot support long filenames at all.
5653 echo 'You can have filenames longer than 14 characters.' >&4
5658 How confusing! Some of your filesystems are sane enough to allow filenames
5659 longer than 14 characters but some others like /tmp can't even think about them.
5660 So, for now on, I shall assume your kernel does not allow them at all.
5667 You can't have filenames longer than 14 chars. You can't even think about them!
5673 $rm -rf /tmp/cf$$ 123456789abcde*
5675 : determine where library module manual pages go
5676 set man3dir man3dir none
5680 $spackage has manual pages for many of the library modules.
5686 However, you don't have nroff, so they're probably useless to you.
5689 '') man3dir="none";;
5693 case "$d_flexfnam" in
5696 However, your system can't handle the long file names like File::Basename.3.
5699 '') man3dir="none";;
5703 echo "If you don't want the manual sources installed, answer 'none'."
5704 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5706 '') case "$prefix" in
5707 *$prog*) dflt=`echo $man1dir |
5708 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
5709 *) dflt="$privlib/man/man3" ;;
5713 *) dflt="$man3dir" ;;
5718 rp="Where do the $package library man pages (source) go?"
5720 if test "X$man3direxp" != "X$ansexp"; then
5725 man3direxp="$ansexp"
5733 Since you are running AFS, I need to distinguish the directory in which
5734 manual pages reside from the directory in which they are installed (and from
5735 which they are presumably copied to the former directory by occult means).
5738 case "$installman3dir" in
5739 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
5740 *) dflt="$installman3dir";;
5743 rp='Where will man pages be installed?'
5745 installman3dir="$ans"
5747 installman3dir="$man3direxp"
5750 : What suffix to use on installed man pages
5757 rp="What suffix should be used for the $package library man pages?"
5759 '') case "$man3dir" in
5773 *) dflt="$man3ext";;
5780 : see if we have to deal with yellow pages, now NIS.
5781 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5782 if $test -f /usr/etc/nibindd; then
5784 echo "I'm fairly confident you're on a NeXT."
5786 rp='Do you get the hosts file via NetInfo?'
5795 y*) hostcat='nidump hosts .';;
5796 *) case "$hostcat" in
5797 nidump*) hostcat='';;
5807 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5815 rp='Are you getting the hosts file via yellow pages?'
5818 y*) hostcat='ypcat hosts';;
5819 *) hostcat='cat /etc/hosts';;
5825 '') hostcat='cat /etc/hosts';;
5828 '') groupcat='cat /etc/group';;
5831 '') passcat='cat /etc/passwd';;
5834 : now get the host name
5836 echo "Figuring out host name..." >&4
5837 case "$myhostname" in
5839 echo 'Maybe "hostname" will work...'
5840 if tans=`sh -c hostname 2>&1` ; then
5848 if $test "$cont"; then
5850 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5851 if tans=`cat /etc/systemid 2>&1` ; then
5853 phostname='cat /etc/systemid'
5854 echo "Whadyaknow. Xenix always was a bit strange..."
5857 elif $test -r /etc/systemid; then
5858 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5861 if $test "$cont"; then
5862 echo 'No, maybe "uuname -l" will work...'
5863 if tans=`sh -c 'uuname -l' 2>&1` ; then
5865 phostname='uuname -l'
5867 echo 'Strange. Maybe "uname -n" will work...'
5868 if tans=`sh -c 'uname -n' 2>&1` ; then
5870 phostname='uname -n'
5872 echo 'Oh well, maybe I can mine it out of whoami.h...'
5873 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
5874 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
5875 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
5877 case "$myhostname" in
5878 '') echo "Does this machine have an identity crisis or something?"
5881 echo "Well, you said $myhostname before..."
5882 phostname='echo $myhostname';;
5888 : you do not want to know about this
5893 if $test "$myhostname" ; then
5895 rp='Your host name appears to be "'$myhostname'".'" Right?"
5903 : bad guess or no guess
5904 while $test "X$myhostname" = X ; do
5906 rp="Please type the (one word) name of your host:"
5911 : translate upper to lower if necessary
5912 case "$myhostname" in
5914 echo "(Normalizing case in your host name)"
5915 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
5919 case "$myhostname" in
5921 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
5922 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
5923 echo "(Trimming domain name from host name--host name is now $myhostname)"
5925 *) case "$mydomain" in
5928 test "X$hostcat" = "Xypcat hosts" &&
5929 ypmatch "$myhostname" hosts 2>/dev/null |\
5930 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
5933 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
5934 /[ ]$myhostname[ . ]/p" > hosts
5937 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
5938 END { print sum }" hosts` = x1 || tmp_re="[ ]"
5939 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
5940 hosts | $sort | $uniq | \
5941 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
5942 case `$echo X$dflt` in
5943 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
5946 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
5951 tans=`./loc resolv.conf X /etc /usr/etc`
5952 if $test -f "$tans"; then
5953 echo "(Attempting domain name extraction from $tans)"
5954 dflt=.`$sed -n -e 's/ / /g' \
5955 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
5956 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5958 .) dflt=.`$sed -n -e 's/ / /g' \
5959 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
5960 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5967 .) echo "(No help from resolv.conf either -- attempting clever guess)"
5968 dflt=.`sh -c domainname 2>/dev/null`
5971 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
5976 .) echo "(Lost all hope -- silly guess then)"
5982 *) dflt="$mydomain";;
5986 rp="What is your domain name?"
5996 : translate upper to lower if necessary
5999 echo "(Normalizing case in your domain name)"
6000 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6004 : a little sanity check here
6005 case "$phostname" in
6008 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6009 $myhostname$mydomain|$myhostname) ;;
6011 case "$phostname" in
6013 echo "(That doesn't agree with your whoami.h file, by the way.)"
6016 echo "(That doesn't agree with your $phostname command, by the way.)"
6026 I need to get your e-mail address in Internet format if possible, i.e.
6027 something like user@host.domain. Please answer accurately since I have
6028 no easy means to double check it. The default value provided below
6029 is most probably close to the reality but may not be valid from outside
6030 your organization...
6034 while test "$cont"; do
6036 '') dflt="$cf_by@$myhostname$mydomain";;
6037 *) dflt="$cf_email";;
6039 rp='What is your e-mail address?'
6045 rp='Address does not look like an Internet one. Use it anyway?'
6061 If you or somebody else will be maintaining perl at your site, please
6062 fill in the correct e-mail address here so that they may be contacted
6063 if necessary. Currently, the "perlbug" program included with perl
6064 will send mail to this address in addition to perlbug@perl.com. You may
6065 enter "none" for no administrator.
6068 case "$perladmin" in
6069 '') dflt="$cf_email";;
6070 *) dflt="$perladmin";;
6072 rp='Perl administrator e-mail address'
6076 : figure out how to guarantee perl startup
6077 case "$startperl" in
6079 case "$sharpbang" in
6083 I can use the #! construct to start perl on your system. This will
6084 make startup of perl scripts faster, but may cause problems if you
6085 want to share those scripts and perl is not in a standard place
6086 ($binexp/perl) on all your platforms. The alternative is to force
6087 a shell by starting the script with a single ':' character.
6091 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6094 none) startperl=": # use perl";;
6095 *) startperl="#!$ans"
6096 if $test 30 -lt `echo "$ans" | wc -c`; then
6099 WARNING: Some systems limit the #! command to 32 characters.
6100 If you experience difficulty running Perl scripts with #!, try
6101 installing Perl in a directory with a shorter pathname.
6107 *) startperl=": # use perl"
6112 echo "I'll use $startperl to start perl scripts."
6114 : figure best path for perl in scripts
6117 perlpath="$binexp/perl"
6118 case "$startperl" in
6123 I will use the "eval 'exec'" idiom to start Perl on your system.
6124 I can use the full path of your Perl binary for this purpose, but
6125 doing so may cause problems if you want to share those scripts and
6126 Perl is not always in a standard place ($binexp/perl).
6130 rp="What path shall I use in \"eval 'exec'\"?"
6137 case "$startperl" in
6139 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6142 : determine where public executable scripts go
6143 set scriptdir scriptdir
6145 case "$scriptdir" in
6148 : guess some guesses
6149 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6150 $test -d /usr/share/bin && dflt=/usr/share/bin
6151 $test -d /usr/local/script && dflt=/usr/local/script
6152 $test -d $prefixexp/script && dflt=$prefixexp/script
6156 *) dflt="$scriptdir"
6161 Some installations have a separate directory just for executable scripts so
6162 that they can mount it across multiple architectures but keep the scripts in
6163 one spot. You might, for example, have a subdirectory of /usr/share for this.
6164 Or you might just lump your scripts in with all your other executables.
6168 rp='Where do you keep publicly executable scripts?'
6170 if $test "X$ansexp" != "X$scriptdirexp"; then
6174 scriptdirexp="$ansexp"
6178 Since you are running AFS, I need to distinguish the directory in which
6179 scripts reside from the directory in which they are installed (and from
6180 which they are presumably copied to the former directory by occult means).
6183 case "$installscript" in
6184 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
6185 *) dflt="$installscript";;
6188 rp='Where will public scripts be installed?'
6190 installscript="$ans"
6192 installscript="$scriptdirexp"
6195 : determine where site specific libraries go.
6196 : Usual default is /usr/local/lib/perl5/site_perl/$apiversion
6197 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6199 *perl*) set dflt sitelib lib/site_$prog/$apiversion ;;
6200 *) set dflt sitelib lib/$package/site_$prog/$apiversion ;;
6205 The installation process will also create a directory for
6206 site-specific extensions and modules. Some users find it convenient
6207 to place all site-specific files in this directory rather than in the
6208 main distribution directory.
6212 rp='Pathname for the site-specific library files?'
6214 if $test "X$sitelibexp" != "X$ansexp"; then
6218 sitelibexp="$ansexp"
6222 Since you are running AFS, I need to distinguish the directory in
6223 which site-specific files reside from the directory in which they are
6224 installed (and from which they are presumably copied to the former
6225 directory by occult means).
6228 case "$installsitelib" in
6229 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
6230 *) dflt="$installsitelib";;
6233 rp='Where will site-specific files be installed?'
6235 installsitelib="$ans"
6237 installsitelib="$sitelibexp"
6240 : determine where site specific architecture-dependent libraries go.
6241 : sitelib default is /usr/local/lib/perl5/site_perl/$apiversion
6242 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6243 : sitelib may have an optional trailing /share.
6244 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6245 tdflt="$tdflt/$archname"
6246 set sitearch sitearch none
6249 '') dflt="$tdflt" ;;
6250 *) dflt="$sitearch" ;;
6254 The installation process will also create a directory for
6255 architecture-dependent site-specific extensions and modules.
6259 rp='Pathname for the site-specific architecture-dependent library files?'
6261 if $test "X$sitearchexp" != "X$ansexp"; then
6265 sitearchexp="$ansexp"
6269 Since you are running AFS, I need to distinguish the directory in
6270 which site-specific architecture-dependent library files reside from
6271 the directory in which they are installed (and from which they are
6272 presumably copied to the former directory by occult means).
6275 case "$installsitearch" in
6276 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
6277 *) dflt="$installsitearch";;
6280 rp='Where will site-specific architecture-dependent files be installed?'
6282 installsitearch="$ans"
6284 installsitearch="$sitearchexp"
6289 Previous version of $package used the standard IO mechanisms as defined
6290 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6291 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6292 the default. This abstraction layer can use AT&T's sfio (if you already
6293 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6294 problems with some extension modules. Using PerlIO with stdio is safe,
6295 but it is slower than plain stdio and therefore is not the default.
6297 If this doesn't make any sense to you, just accept the default 'n'.
6299 case "$useperlio" in
6300 $define|true|[yY]*) dflt='y';;
6303 rp='Use the experimental PerlIO abstraction layer?'
6310 echo "Ok, doing things the stdio way"
6317 : Check how to convert floats to strings.
6318 if test "X$d_Gconvert" = X; then
6320 echo "Checking for an efficient way to convert floats to strings."
6323 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6324 char *myname = "gconvert";
6327 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6328 char *myname = "gcvt";
6331 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6332 char *myname = "sprintf";
6338 checkit(expect, got)
6342 if (strcmp(expect, got)) {
6343 printf("%s oddity: Expected %s, got %s\n",
6344 myname, expect, got);
6354 /* This must be 1st test on (which?) platform */
6355 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6356 Gconvert(0.1, 8, 0, buf);
6357 checkit("0.1", buf);
6359 Gconvert(1.0, 8, 0, buf);
6362 Gconvert(0.0, 8, 0, buf);
6365 Gconvert(-1.0, 8, 0, buf);
6368 /* Some Linux gcvt's give 1.e+5 here. */
6369 Gconvert(100000.0, 8, 0, buf);
6370 checkit("100000", buf);
6372 /* Some Linux gcvt's give -1.e+5 here. */
6373 Gconvert(-100000.0, 8, 0, buf);
6374 checkit("-100000", buf);
6379 case "$d_Gconvert" in
6380 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6381 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6382 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6383 *) xxx_list='gconvert gcvt sprintf' ;;
6386 for xxx_convert in $xxx_list; do
6387 echo "Trying $xxx_convert"
6389 set try -DTRY_$xxx_convert
6390 if eval $compile; then
6391 echo "$xxx_convert" found. >&4
6393 echo "I'll use $xxx_convert to convert floats into a string." >&4
6396 echo "...But $xxx_convert didn't work as I expected."
6399 echo "$xxx_convert NOT found." >&4
6403 case "$xxx_convert" in
6404 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6405 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6406 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6410 : Initialize h_fcntl
6413 : Initialize h_sysfile
6416 : access call always available on UNIX
6420 : locate the flags for 'access()'
6424 $cat >access.c <<'EOCP'
6425 #include <sys/types.h>
6430 #include <sys/file.h>
6439 : check sys/file.h first, no particular reason here
6440 if $test `./findhdr sys/file.h` && \
6441 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
6443 echo "<sys/file.h> defines the *_OK access constants." >&4
6444 elif $test `./findhdr fcntl.h` && \
6445 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
6447 echo "<fcntl.h> defines the *_OK access constants." >&4
6448 elif $test `./findhdr unistd.h` && \
6449 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
6450 echo "<unistd.h> defines the *_OK access constants." >&4
6452 echo "I can't find the four *_OK access constants--I'll use mine." >&4
6458 : see if accessx exists
6459 set accessx d_accessx
6462 : see if alarm exists
6466 : Look for GNU-cc style attribute checking
6468 echo "Checking whether your compiler can handle __attribute__ ..." >&4
6469 $cat >attrib.c <<'EOCP'
6471 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
6473 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
6474 if $contains 'warning' attrib.out >/dev/null 2>&1; then
6475 echo "Your C compiler doesn't fully support __attribute__."
6478 echo "Your C compiler supports __attribute__."
6482 echo "Your C compiler doesn't seem to understand __attribute__ at all."
6489 : see if bcmp exists
6493 : see if bcopy exists
6497 : see if this is a unistd.h system
6498 set unistd.h i_unistd
6501 : see if getpgrp exists
6502 set getpgrp d_getpgrp
6505 case "$d_getpgrp" in
6508 echo "Checking to see which flavor of getpgrp is in use..."
6511 #include <sys/types.h>
6513 # include <unistd.h>
6517 if (getuid() == 0) {
6518 printf("(I see you are running Configure as super-user...)\n");
6522 if (getpgrp(1) == 0)
6531 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6532 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
6534 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6535 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
6538 echo "I can't seem to compile and run the test program."
6540 xxx="a USG one, i.e. you use getpgrp()."
6542 # SVR4 systems can appear rather BSD-ish.
6545 xxx="a BSD one, i.e. you use getpgrp(pid)."
6549 xxx="probably a USG one, i.e. you use getpgrp()."
6554 echo "Assuming your getpgrp is $xxx" >&4
6563 : see if setpgrp exists
6564 set setpgrp d_setpgrp
6567 case "$d_setpgrp" in
6570 echo "Checking to see which flavor of setpgrp is in use..."
6573 #include <sys/types.h>
6575 # include <unistd.h>
6579 if (getuid() == 0) {
6580 printf("(I see you are running Configure as super-user...)\n");
6584 if (-1 == setpgrp(1, 1))
6587 if (setpgrp() != -1)
6593 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6594 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
6596 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6597 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
6600 echo "(I can't seem to compile and run the test program.)"
6602 xxx="a USG one, i.e. you use setpgrp()."
6604 # SVR4 systems can appear rather BSD-ish.
6607 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
6611 xxx="probably a USG one, i.e. you use setpgrp()."
6616 echo "Assuming your setpgrp is $xxx" >&4
6624 : see if bzero exists
6628 : check for lengths of integral types
6632 echo "Checking to see how big your integers are..." >&4
6633 $cat >intsize.c <<'EOCP'
6637 printf("intsize=%d;\n", sizeof(int));
6638 printf("longsize=%d;\n", sizeof(long));
6639 printf("shortsize=%d;\n", sizeof(short));
6644 if eval $compile_ok && ./intsize > /dev/null; then
6646 echo "Your integers are $intsize bytes long."
6647 echo "Your long integers are $longsize bytes long."
6648 echo "Your short integers are $shortsize bytes long."
6652 Help! I can't compile and run the intsize test program: please enlighten me!
6653 (This is probably a misconfiguration in your system or libraries, and
6654 you really ought to fix it. Still, I'll try anyway.)
6658 rp="What is the size of an integer (in bytes)?"
6662 rp="What is the size of a long integer (in bytes)?"
6666 rp="What is the size of a short integer (in bytes)?"
6672 $rm -f intsize intsize.*
6674 : see if signal is declared as pointer to function returning int or void
6676 xxx=`./findhdr signal.h`
6677 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
6678 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6679 echo "You have int (*signal())() instead of void." >&4
6681 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6682 echo "You have void (*signal())()." >&4
6684 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
6685 echo "You have int (*signal())() instead of void." >&4
6687 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
6688 echo "You have void (*signal())()." >&4
6691 case "$d_voidsig" in
6693 echo "I can't determine whether signal handler returns void or int..." >&4
6695 rp="What type does your signal handler return?"
6702 echo "As you already told me, signal handler returns void." >&4
6705 *) echo "As you already told me, signal handler returns int." >&4
6712 case "$d_voidsig" in
6713 "$define") signal_t="void";;
6718 : check for ability to cast large floats to 32-bit ints.
6720 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
6721 if $test "$intsize" -ge 4; then
6728 #include <sys/types.h>
6730 $signal_t blech(s) int s; { exit(3); }
6737 signal(SIGFPE, blech);
6739 /* Don't let compiler optimize the test away. Store the number
6740 in a writable string for gcc to pass to sscanf under HP/UX.
6742 sprintf(str, "2147483647");
6743 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
6747 /* x86 processors will probably give 0x8000 0000, which is a
6748 sign change. We don't want that. We want to mimic SPARC
6749 behavior here, which is to preserve the sign and give
6752 if (i32 != ($xxx) f)
6758 if eval $compile_ok; then
6762 echo "(I can't seem to compile the test program--assuming it can't)"
6770 echo "Nope, it can't."
6777 : check for ability to cast negative floats to unsigned
6779 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
6782 #include <sys/types.h>
6784 $signal_t blech(s) int s; { exit(7); }
6785 $signal_t blech_in_list(s) int s; { exit(4); }
6786 unsigned long dummy_long(p) unsigned long p; { return p; }
6787 unsigned int dummy_int(p) unsigned int p; { return p; }
6788 unsigned short dummy_short(p) unsigned short p; { return p; }
6792 unsigned long along;
6794 unsigned short ashort;
6798 /* Frustrate gcc-2.7.2's optimizer which failed this test with
6799 a direct f = -123. assignment. gcc-2.8.0 reportedly
6800 optimized the whole file away
6802 /* Store the number in a writable string for gcc to pass to
6805 sprintf(str, "-123");
6806 sscanf(str, "%lf", &f); /* f = -123.; */
6808 signal(SIGFPE, blech);
6809 along = (unsigned long)f;
6810 aint = (unsigned int)f;
6811 ashort = (unsigned short)f;
6812 if (along != (unsigned long)-123)
6814 if (aint != (unsigned int)-123)
6816 if (ashort != (unsigned short)-123)
6818 sprintf(str, "1073741824.");
6819 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
6822 along = (unsigned long)f;
6823 if (along != 0x80000000)
6827 along = (unsigned long)f;
6828 if (along != 0x7fffffff)
6832 along = (unsigned long)f;
6833 if (along != 0x80000001)
6837 signal(SIGFPE, blech_in_list);
6838 sprintf(str, "123.");
6839 sscanf(str, "%lf", &f); /* f = 123.; */
6840 along = dummy_long((unsigned long)f);
6841 aint = dummy_int((unsigned int)f);
6842 ashort = dummy_short((unsigned short)f);
6843 if (along != (unsigned long)123)
6845 if (aint != (unsigned int)123)
6847 if (ashort != (unsigned short)123)
6854 if eval $compile_ok; then
6858 echo "(I can't seem to compile the test program--assuming it can't)"
6861 case "$castflags" in
6866 echo "Nope, it can't."
6873 : see if vprintf exists
6875 if set vprintf val -f d_vprintf; eval $csym; $val; then
6876 echo 'vprintf() found.' >&4
6878 $cat >vprintf.c <<'EOF'
6879 #include <varargs.h>
6881 int main() { xxx("foo"); }
6890 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
6894 if eval $compile && ./vprintf; then
6895 echo "Your vsprintf() returns (int)." >&4
6898 echo "Your vsprintf() returns (char*)." >&4
6902 echo 'vprintf() NOT found.' >&4
6912 : see if chown exists
6916 : see if chroot exists
6920 : see if chsize exists
6924 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
6925 while $test $# -ge 2; do
6927 $define) echo "#include <$2>";;
6931 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
6932 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6941 : see if this is a sys/uio.h system
6942 set sys/uio.h i_sysuio
6945 echo "Checking to see if your system supports struct iovec..." >&4
6946 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
6948 case "$d_iovec_s" in
6949 "$define") echo "Yup, it does." >&4
6951 *) echo "Nope, it doesn't." >&4
6957 : see whether socket exists
6959 $echo $n "Hmm... $c" >&4
6960 if set socket val -f d_socket; eval $csym; $val; then
6961 echo "Looks like you have Berkeley networking support." >&4
6963 if set setsockopt val -f; eval $csym; $val; then
6966 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
6970 if $contains socklib libc.list >/dev/null 2>&1; then
6971 echo "Looks like you have Berkeley networking support." >&4
6973 : we will have to assume that it supports the 4.2 BSD interface
6976 echo "You don't have Berkeley networking in libc$_a..." >&4
6977 if test "X$d_socket" = "X$define"; then
6978 echo "...but you seem to believe that you have sockets." >&4
6980 for net in net socket
6982 if test -f /usr/lib/lib$net$_a; then
6983 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
6984 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
6985 if $contains socket libc.list >/dev/null 2>&1; then
6990 echo "...but the Wollongong group seems to have hacked it in." >&4
6991 sockethdr="-I/usr/netinclude"
6994 echo "Found Berkeley sockets interface in lib$net." >& 4
6995 if $contains setsockopt libc.list >/dev/null 2>&1; then
6998 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7005 if test "X$d_socket" != "X$define"; then
7006 echo "or anywhere else I see." >&4
7014 : see if socketpair exists
7015 set socketpair d_sockpair
7020 echo "Checking the availability of certain socket constants..." >& 4
7021 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
7022 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
7024 #include <sys/types.h>
7025 #include <sys/socket.h>
7031 set try; if eval $compile; then
7034 set d_${enum}; eval $setvar
7038 set sendmsg d_sendmsg
7041 set recvmsg d_recvmsg
7045 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
7046 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7048 case "$d_msghdr_s" in
7049 "$define") echo "Yup, it does." >&4
7051 *) echo "Nope, it doesn't." >&4
7055 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7056 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7058 case "$d_cmsghdr_s" in
7059 "$define") echo "Yup, it does." >&4
7061 *) echo "Nope, it doesn't." >&4
7065 : check for const keyword
7067 echo 'Checking to see if your C compiler knows about "const"...' >&4
7068 $cat >const.c <<'EOCP'
7069 typedef struct spug { int drokk; } spug;
7076 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7078 echo "Yup, it does."
7081 echo "Nope, it doesn't."
7086 : see if crypt exists
7088 if set crypt val -f d_crypt; eval $csym; $val; then
7089 echo 'crypt() found.' >&4
7093 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7094 if $test -z "$cryptlib"; then
7095 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7099 if $test -z "$cryptlib"; then
7100 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7104 if $test -z "$cryptlib"; then
7105 cryptlib=`./loc libcrypt$_a "" $libpth`
7109 if $test -z "$cryptlib"; then
7110 echo 'crypt() NOT found.' >&4
7119 : get csh whereabouts
7121 'csh') val="$undef" ;;
7126 : Respect a hint or command line value for full_csh.
7128 '') full_csh=$csh ;;
7131 : see if cuserid exists
7132 set cuserid d_cuserid
7135 : see if this is a limits.h system
7136 set limits.h i_limits
7139 : see if this is a float.h system
7143 : See if number of significant digits in a double precision number is known
7145 $cat >dbl_dig.c <<EOM
7155 printf("Contains DBL_DIG");
7158 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7159 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7160 echo "DBL_DIG found." >&4
7163 echo "DBL_DIG NOT found." >&4
7171 if $test X"$use64bits" = X"$define"; then
7172 : see if dbminit64 exists
7173 set dbminit64 d_dbminit64
7176 : see if dbmclose64 exists
7177 set dbmclose64 d_dbmclose64
7180 : see if fetch64 exists
7181 set fetch64 d_fetch64
7184 : see if store64 exists
7185 set store64 d_store64
7188 : see if delete64 exists
7189 set delete64 d_delete64
7192 : see if firstkey64 exists
7193 set firstkey64 d_firstkey64
7196 : see if nextkey64 exists
7197 set nextkey64 d_nextkey64
7201 for xxx in d_dbminit64 d_dbmclose64 d_fetch64 d_store64 d_delete64 d_firstkey64 d_nextkey64
7208 : see if difftime exists
7209 set difftime d_difftime
7212 : see if sys/stat.h is available
7213 set sys/stat.h i_sysstat
7216 : see if this is a dirent system
7218 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7220 echo "<dirent.h> found." >&4
7223 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7224 echo "<sys/dir.h> found." >&4
7227 xinc=`./findhdr sys/ndir.h`
7229 echo "<dirent.h> NOT found." >&4
7234 : Look for type of directory structure.
7236 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7238 case "$direntrytype" in
7241 $define) guess1='struct dirent' ;;
7242 *) guess1='struct direct' ;;
7245 *) guess1="$direntrytype"
7250 'struct dirent') guess2='struct direct' ;;
7251 *) guess2='struct dirent' ;;
7254 if $contains "$guess1" try.c >/dev/null 2>&1; then
7255 direntrytype="$guess1"
7256 echo "Your directory entries are $direntrytype." >&4
7257 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7258 direntrytype="$guess2"
7259 echo "Your directory entries seem to be $direntrytype." >&4
7261 echo "I don't recognize your system's directory entries." >&4
7262 rp="What type is used for directory entries on this system?"
7270 : see if the directory entry stores field length
7272 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7273 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7274 echo "Good, your directory entry keeps length information in d_namlen." >&4
7277 echo "Your directory entry does not know about the d_namlen field." >&4
7285 if $test X"$use64bits" = X"$define"; then
7286 : see if fstat64 exists
7287 set fstat64 d_fstat64
7290 : see if ftruncate64 exists
7291 set ftruncate64 d_ftruncate64
7294 : see if lockf64 exists
7295 set lockf64 d_lockf64
7298 : see if llseek exists
7302 : see if lseek64 exists
7303 set lseek64 d_lseek64
7306 : see if lstat64 exists
7307 set lstat64 d_lstat64
7310 : see if open64 exists
7314 : see if opendir64 exists
7315 set opendir64 d_opendir64
7318 : see if readdir64 exists
7319 set readdir64 d_readdir64
7322 : see if seekdir64 exists
7323 set seekdir64 d_seekdir64
7326 : see if stat64 exists
7330 : see if telldir64 exists
7331 set telldir64 d_telldir64
7334 : see if truncate64 exists
7335 set truncate64 d_truncate64
7340 echo $n "Checking to see if your system supports off64_t...$c" >&4
7342 #include <sys/types.h>
7344 off64_t foo() { off64_t x; x = 7; return x; }'
7346 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7348 echo " Yup, it does." >&4
7351 echo " Nope, it doesn't." >&4
7357 : check for offset_t
7359 echo $n "Checking to see if your system supports offset_t...$c" >&4
7361 #include <sys/types.h>
7363 offset_t foo() { offset_t x; x = 7; return x; }'
7365 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7367 echo " Yup, it does." >&4
7370 echo " Nope, it doesn't." >&4
7378 echo $n "Checking to see if your system supports ino64_t...$c" >&4
7380 case "$i_sysstat" in
7383 #include <sys/types.h>
7384 #include <sys/stat.h>
7385 ino64_t foo() { ino64_t x; x = 7; return x; }'
7387 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7393 if $test "X$val" = X"$define"; then
7394 echo " Yup, it does." >&4
7396 echo " Nope, it doesn't." >&4
7401 : check for struct flock64
7403 echo "Checking to see if your system supports struct flock64..." >&4
7405 set d_flock64_s flock64 l_len define fcntl.h
7412 case "$d_flock64_s" in
7413 "$define") echo "Yup, it does." >&4
7415 *) echo "Nope, it doesn't." >&4
7419 : check for struct dirent64
7421 echo "Checking to see if your system supports struct dirent64..." >&4
7422 set d_dirent64_s dirent64 d_off $i_dirent dirent.h
7424 case "$d_dirent64_s" in
7425 "$define") echo "Yup, it does." >&4
7427 *) echo "Nope, it doesn't." >&4
7433 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_off64_t d_offset_t d_ino64_t d_flock64_s d_dirent64_s
7440 : see if dlerror exists
7443 set dlerror d_dlerror
7447 : see if dlfcn is available
7455 On a few systems, the dynamically loaded modules that perl generates and uses
7456 will need a different extension than shared libs. The default will probably
7464 rp='What is the extension of dynamically loaded modules'
7473 : Check if dlsym need a leading underscore
7479 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7480 $cat >dyna.c <<'EOM'
7489 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7491 #include <sys/types.h>
7505 int mode = RTLD_LAZY ;
7507 handle = dlopen("./dyna.$dlext", mode) ;
7508 if (handle == NULL) {
7513 symbol = dlsym(handle, "fred") ;
7514 if (symbol == NULL) {
7515 /* try putting a leading underscore */
7516 symbol = dlsym(handle, "_fred") ;
7517 if (symbol == NULL) {
7530 : Call the object file tmp-dyna.o in case dlext=o.
7531 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
7532 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
7533 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
7534 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
7537 1) echo "Test program failed using dlopen." >&4
7538 echo "Perhaps you should not use dynamic loading." >&4;;
7539 2) echo "Test program failed using dlsym." >&4
7540 echo "Perhaps you should not use dynamic loading." >&4;;
7541 3) echo "dlsym needs a leading underscore" >&4
7543 4) echo "dlsym doesn't need a leading underscore." >&4;;
7546 echo "I can't compile and run the test program." >&4
7551 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
7556 hasproto='varname=$1; func=$2; shift; shift;
7557 while $test $# -ge 2; do
7559 $define) echo "#include <$2>";;
7563 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
7564 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
7565 echo "$func() prototype found.";
7568 echo "$func() prototype NOT found.";
7573 $rm -f try.c tryout.c'
7575 : see if prototype for drand48 is available
7577 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
7580 : see if dup2 exists
7584 : see if eaccess exists
7585 set eaccess d_eaccess
7588 : see if endgrent exists
7589 set endgrent d_endgrent
7592 : see if endhostent exists
7593 set endhostent d_endhent
7596 : see if endnetent exists
7597 set endnetent d_endnent
7600 : see if endprotoent exists
7601 set endprotoent d_endpent
7604 : see if endpwent exists
7605 set endpwent d_endpwent
7608 : see if endservent exists
7609 set endservent d_endsent
7612 : see if endspent exists
7613 set endspent d_endspent
7616 : Locate the flags for 'open()'
7618 $cat >open3.c <<'EOCP'
7619 #include <sys/types.h>
7624 #include <sys/file.h>
7635 : check sys/file.h first to get FREAD on Sun
7636 if $test `./findhdr sys/file.h` && \
7637 set open3 -DI_SYS_FILE && eval $compile; then
7639 echo "<sys/file.h> defines the O_* constants..." >&4
7641 echo "and you have the 3 argument form of open()." >&4
7644 echo "but not the 3 argument form of open(). Oh, well." >&4
7647 elif $test `./findhdr fcntl.h` && \
7648 set open3 -DI_FCNTL && eval $compile; then
7650 echo "<fcntl.h> defines the O_* constants..." >&4
7652 echo "and you have the 3 argument form of open()." >&4
7655 echo "but not the 3 argument form of open(). Oh, well." >&4
7660 echo "I can't find the O_* constant definitions! You got problems." >&4
7666 : check for non-blocking I/O stuff
7667 case "$h_sysfile" in
7668 true) echo "#include <sys/file.h>" > head.c;;
7671 true) echo "#include <fcntl.h>" > head.c;;
7672 *) echo "#include <sys/fcntl.h>" > head.c;;
7677 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
7678 case "$o_nonblock" in
7681 $cat >>try.c <<'EOCP'
7684 printf("O_NONBLOCK\n");
7688 printf("O_NDELAY\n");
7692 printf("FNDELAY\n");
7699 if eval $compile_ok; then
7701 case "$o_nonblock" in
7702 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
7703 *) echo "Seems like we can use $o_nonblock.";;
7706 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
7709 *) echo "Using $hint value $o_nonblock.";;
7711 $rm -f try try.* .out core
7714 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
7720 #include <sys/types.h>
7722 #define MY_O_NONBLOCK $o_nonblock
7723 #ifndef errno /* XXX need better Configure test */
7726 $signal_t blech(x) int x; { exit(3); }
7728 $cat >> try.c <<'EOCP'
7736 pipe(pd); /* Down: child -> parent */
7737 pipe(pu); /* Up: parent -> child */
7740 close(pd[1]); /* Parent reads from pd[0] */
7741 close(pu[0]); /* Parent writes (blocking) to pu[1] */
7742 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
7744 signal(SIGALRM, blech);
7746 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
7748 sprintf(string, "%d\n", ret);
7749 write(2, string, strlen(string));
7752 if (errno == EAGAIN) {
7758 if (errno == EWOULDBLOCK)
7759 printf("EWOULDBLOCK\n");
7762 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
7763 sleep(2); /* Give it time to close our pipe */
7765 ret = read(pd[0], buf, 1); /* Should read EOF */
7767 sprintf(string, "%d\n", ret);
7768 write(3, string, strlen(string));
7772 close(pd[0]); /* We write to pd[1] */
7773 close(pu[1]); /* We read from pu[0] */
7774 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
7775 close(pd[1]); /* Pipe pd is now fully closed! */
7776 exit(0); /* Bye bye, thank you for playing! */
7780 if eval $compile_ok; then
7781 echo "$startsh" >mtry
7782 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
7784 ./mtry >/dev/null 2>&1
7786 0) eagain=`$cat try.out`;;
7787 1) echo "Could not perform non-blocking setting!";;
7788 2) echo "I did a successful read() for something that was not there!";;
7789 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
7790 *) echo "Something terribly wrong happened during testing.";;
7792 rd_nodata=`$cat try.ret`
7793 echo "A read() system call with no data present returns $rd_nodata."
7794 case "$rd_nodata" in
7797 echo "(That's peculiar, fixing that to be -1.)"
7803 echo "Forcing errno EAGAIN on read() with no data available."
7807 echo "Your read() sets errno to $eagain when no data is available."
7810 status=`$cat try.err`
7812 0) echo "And it correctly returns 0 to signal EOF.";;
7813 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
7814 *) echo "However, your read() returns '$status' on EOF??";;
7817 if test "$status" = "$rd_nodata"; then
7818 echo "WARNING: you can't distinguish between EOF and no data!"
7822 echo "I can't compile the test program--assuming errno EAGAIN will do."
7829 echo "Using $hint value $eagain."
7830 echo "Your read() returns $rd_nodata when no data is present."
7831 case "$d_eofnblk" in
7832 "$define") echo "And you can see EOF because read() returns 0.";;
7833 "$undef") echo "But you can't see EOF status from read() returned value.";;
7835 echo "(Assuming you can't see EOF status from read anyway.)"
7841 $rm -f try try.* .out core head.c mtry
7843 : see if fchmod exists
7847 : see if fchown exists
7851 : see if this is an fcntl system
7855 : see if sys/select.h has to be included
7856 set sys/select.h i_sysselct
7859 : see if we should include time.h, sys/time.h, or both
7861 if test "X$timeincl" = X; then
7862 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
7863 $echo $n "I'm now running the test program...$c"
7864 $cat >try.c <<'EOCP'
7865 #include <sys/types.h>
7870 #ifdef SYSTIMEKERNEL
7873 #include <sys/time.h>
7876 #include <sys/select.h>
7885 struct timezone tzp;
7887 if (foo.tm_sec == foo.tm_sec)
7890 if (bar.tv_sec == bar.tv_sec)
7897 for s_timezone in '-DS_TIMEZONE' ''; do
7899 for s_timeval in '-DS_TIMEVAL' ''; do
7900 for i_systimek in '' '-DSYSTIMEKERNEL'; do
7901 for i_time in '' '-DI_TIME'; do
7902 for i_systime in '-DI_SYSTIME' ''; do
7905 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
7906 if eval $compile; then
7907 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
7911 $echo $n "Succeeded with $flags$c"
7923 *SYSTIMEKERNEL*) i_systimek="$define"
7924 timeincl=`./findhdr sys/time.h`
7925 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
7926 *) i_systimek="$undef";;
7929 *I_TIME*) i_time="$define"
7930 timeincl=`./findhdr time.h`" $timeincl"
7931 echo "We'll include <time.h>." >&4;;
7932 *) i_time="$undef";;
7935 *I_SYSTIME*) i_systime="$define"
7936 timeincl=`./findhdr sys/time.h`" $timeincl"
7937 echo "We'll include <sys/time.h>." >&4;;
7938 *) i_systime="$undef";;
7943 : check for fd_set items
7946 Checking to see how well your C compiler handles fd_set and friends ...
7948 $cat >fd_set.c <<EOCP
7949 #$i_systime I_SYS_TIME
7950 #$i_sysselct I_SYS_SELECT
7951 #$d_socket HAS_SOCKET
7952 #include <sys/types.h>
7954 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
7957 #include <sys/time.h>
7960 #include <sys/select.h>
7969 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
7976 set fd_set -DTRYBITS
7977 if eval $compile; then
7978 d_fds_bits="$define"
7980 echo "Well, your system knows about the normal fd_set typedef..." >&4
7982 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
7983 d_fd_macros="$define"
7986 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
7988 d_fd_macros="$undef"
7992 Hmm, your compiler has some difficulty with fd_set. Checking further...
7995 if eval $compile; then
7998 echo "Well, your system has some sort of fd_set available..." >&4
8000 echo "and you have the normal fd_set macros." >&4
8001 d_fd_macros="$define"
8004 but not the normal fd_set macros! Gross! More work for me...
8006 d_fd_macros="$undef"
8009 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8012 d_fd_macros="$undef"
8017 : see if fgetpos exists
8018 set fgetpos d_fgetpos
8022 if $test X"$use64bits" = X"$define"; then
8023 : see if fgetpos64 exists
8024 set fgetpos64 d_fgetpos64
8027 : see if fopen64 exists
8028 set freopen64 d_fopen64
8031 : see if freopen64 exists
8032 set freopen64 d_freopen64
8035 : see if fseek64 exists
8036 set fseek64 d_fseek64
8039 : see if fseeko64 exists
8040 set fseeko64 d_fseeko64
8043 : see if fsetpos64 exists
8044 set fsetpos64 d_fsetpos64
8047 : see if ftell64 exists
8048 set ftell64 d_ftell64
8051 : see if ftello64 exists
8052 set ftello64 d_ftello64
8055 : see if tmpfile64 exists
8056 set tmpfile64 d_tmpfile64
8060 for xxx in d_fgetpos64 d_fopen64 d_freopen64 d_fseek64 d_fseeko64 d_fsetpos64 d_ftell64 d_ftello64 d_tmpfile64
8067 : see if flock exists
8071 : see if fork exists
8075 : see if pathconf exists
8076 set pathconf d_pathconf
8079 : see if fpathconf exists
8080 set fpathconf d_fpathconf
8083 : see if fseeko exists
8087 : see if fsetpos exists
8088 set fsetpos d_fsetpos
8091 : see if this is a sys/param system
8092 set sys/param.h i_sysparam
8095 : see if this is a sys/mount.h system
8096 set sys/mount.h i_sysmount
8100 : see if statfs exists
8104 : see if fstatfs exists
8105 set fstatfs d_fstatfs
8108 : see if statfs knows about mount flags
8109 set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
8113 : see if statvfs exists
8114 set statvfs d_statvfs
8117 : see if fstatvfs exists
8118 set fstatvfs d_fstatvfs
8122 : see if ftello exists
8126 : see if getgrent exists
8127 set getgrent d_getgrent
8130 : see if gethostbyaddr exists
8131 set gethostbyaddr d_gethbyaddr
8134 : see if gethostbyname exists
8135 set gethostbyname d_gethbyname
8138 : see if gethostent exists
8139 set gethostent d_gethent
8142 : see how we will look up host name
8145 if set gethostname val -f d_gethname; eval $csym; $val; then
8146 echo 'gethostname() found.' >&4
8147 d_gethname="$define"
8150 if set uname val -f d_uname; eval $csym; $val; then
8153 uname() was found, but you're running xenix, and older versions of xenix
8154 have a broken uname(). If you don't really know whether your xenix is old
8155 enough to have a broken system call, use the default answer.
8162 rp='Is your uname() broken?'
8165 n*) d_uname="$define"; call=uname;;
8168 echo 'uname() found.' >&4
8175 case "$d_gethname" in
8176 '') d_gethname="$undef";;
8179 '') d_uname="$undef";;
8181 case "$d_uname$d_gethname" in
8186 Every now and then someone has a $call() that lies about the hostname
8187 but can't be fixed for political or economic reasons. If you wish, I can
8188 pretend $call() isn't there and maybe compute hostname at run-time
8189 thanks to the '$phostname' command.
8192 rp="Shall I ignore $call() from now on?"
8195 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8198 case "$phostname" in
8200 *) case "$aphostname" in
8206 file=`./loc $file $file $pth`
8207 aphostname=`echo $file $*`
8212 case "$d_uname$d_gethname" in
8215 case "$phostname" in
8217 echo "There will be no way for $package to get your hostname." >&4;;
8219 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8223 case "$d_phostname" in
8224 '') d_phostname="$undef";;
8227 : see if this is a netdb.h system
8231 : see if prototypes for various gethostxxx netdb.h functions are available
8233 set d_gethostprotos gethostent $i_netdb netdb.h
8236 : see if getlogin exists
8237 set getlogin d_getlogin
8240 : see if getmntent exists
8241 set getmntent d_getmntent
8244 : see if getnetbyaddr exists
8245 set getnetbyaddr d_getnbyaddr
8248 : see if getnetbyname exists
8249 set getnetbyname d_getnbyname
8252 : see if getnetent exists
8253 set getnetent d_getnent
8256 : see if prototypes for various getnetxxx netdb.h functions are available
8258 set d_getnetprotos getnetent $i_netdb netdb.h
8262 : see if getprotobyname exists
8263 set getprotobyname d_getpbyname
8266 : see if getprotobynumber exists
8267 set getprotobynumber d_getpbynumber
8270 : see if getprotoent exists
8271 set getprotoent d_getpent
8274 : see if getpgid exists
8275 set getpgid d_getpgid
8278 : see if getpgrp2 exists
8279 set getpgrp2 d_getpgrp2
8282 : see if getppid exists
8283 set getppid d_getppid
8286 : see if getpriority exists
8287 set getpriority d_getprior
8290 : see if prototypes for various getprotoxxx netdb.h functions are available
8292 set d_getprotoprotos getprotoent $i_netdb netdb.h
8295 : see if getpwent exists
8296 set getpwent d_getpwent
8300 : see if getservbyname exists
8301 set getservbyname d_getsbyname
8304 : see if getservbyport exists
8305 set getservbyport d_getsbyport
8308 : see if getservent exists
8309 set getservent d_getsent
8312 : see if prototypes for various getservxxx netdb.h functions are available
8314 set d_getservprotos getservent $i_netdb netdb.h
8317 : see if getspent exists
8318 set getspent d_getspent
8321 : see if getspnam exists
8322 set getspnam d_getspnam
8325 : see if gettimeofday or ftime exists
8326 set gettimeofday d_gettimeod
8328 case "$d_gettimeod" in
8334 val="$undef"; set d_ftime; eval $setvar
8337 case "$d_gettimeod$d_ftime" in
8340 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8344 : see if this is an grp system
8350 xxx=`./findhdr grp.h`
8351 $cppstdin $cppflags $cppminus < $xxx >$$.h
8353 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8365 set d_grpasswd; eval $setvar
8369 : see if hasmntopt exists
8370 set hasmntopt d_hasmntopt
8373 : see if this is a netinet/in.h or sys/in.h system
8374 set netinet/in.h i_niin sys/in.h i_sysin
8377 : see if arpa/inet.h has to be included
8378 set arpa/inet.h i_arpainet
8381 : see if htonl --and friends-- exists
8386 : Maybe they are macros.
8391 #include <sys/types.h>
8392 #$i_niin I_NETINET_IN
8394 #$i_arpainet I_ARPA_INET
8396 #include <netinet/in.h>
8402 #include <arpa/inet.h>
8405 printf("Defined as a macro.");
8408 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8409 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8411 echo "But it seems to be defined as a macro." >&4
8419 : see which of string.h or strings.h is needed
8421 strings=`./findhdr string.h`
8422 if $test "$strings" && $test -r "$strings"; then
8423 echo "Using <string.h> instead of <strings.h>." >&4
8427 strings=`./findhdr strings.h`
8428 if $test "$strings" && $test -r "$strings"; then
8429 echo "Using <strings.h> instead of <string.h>." >&4
8431 echo "No string header found -- You'll surely have problems." >&4
8437 "$undef") strings=`./findhdr strings.h`;;
8438 *) strings=`./findhdr string.h`;;
8443 if set index val -f; eval $csym; $val; then
8444 if set strchr val -f d_strchr; eval $csym; $val; then
8445 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8448 echo "strchr() found." >&4
8452 echo "index() found." >&4
8457 echo "index() found." >&4
8460 if set strchr val -f d_strchr; eval $csym; $val; then
8463 echo "strchr() found." >&4
8465 echo "No index() or strchr() found!" >&4
8470 set d_strchr; eval $setvar
8472 set d_index; eval $setvar
8474 : check whether inet_aton exists
8475 set inet_aton d_inetaton
8478 : see if inttypes.h is available
8479 : we want a real compile instead of Inhdr because some systems
8480 : have an inttypes.h which includes non-existent headers
8483 #include <inttypes.h>
8485 static int32_t foo32 = 0x12345678;
8489 if eval $compile; then
8490 echo "<inttypes.h> found." >&4
8493 echo "<inttypes.h> NOT found." >&4
8501 case "$use64bits" in
8504 echo $n "Checking to see if your system supports int64_t...$c" >&4
8506 #include <sys/types.h>
8507 #$i_inttypes I_INTTYPES
8509 #include <inttypes.h>
8511 int64_t foo() { int64_t x; x = 7; return x; }
8513 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8515 echo " Yup, it does." >&4
8518 echo " Nope, it doesn't." >&4
8531 $cat >isascii.c <<'EOCP'
8543 if eval $compile; then
8544 echo "isascii() found." >&4
8547 echo "isascii() NOT found." >&4
8554 : see if killpg exists
8558 : see if lchown exists
8560 $cat > try.c <<'EOCP'
8561 /* System header to define __stub macros and hopefully few prototypes,
8562 which can conflict with char lchown(); below. */
8564 /* Override any gcc2 internal prototype to avoid an error. */
8565 /* We use char because int might match the return type of a gcc2
8566 builtin and then its argument prototype would still apply. */
8569 /* The GNU C library defines this for functions which it implements
8570 to always fail with ENOSYS. Some functions are actually named
8571 something starting with __ and the normal name is an alias. */
8572 #if defined (__stub_lchown) || defined (__stub___lchown)
8580 if eval $compile; then
8581 $echo "lchown() found." >&4
8584 $echo "lchown() NOT found." >&4
8590 : see if link exists
8594 : see if localeconv exists
8595 set localeconv d_locconv
8598 : see if lockf exists
8602 : check for length of double
8604 case "$doublesize" in
8606 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
8607 $cat >try.c <<'EOCP'
8611 printf("%d\n", sizeof(double));
8615 if eval $compile_ok; then
8617 $echo " $doublesize bytes." >&4
8620 echo "(I can't seem to compile the test program. Guessing...)"
8621 rp="What is the size of a double precision number (in bytes)?"
8629 : check for long doubles
8631 echo $n "Checking to see if your system supports long doubles...$c" >&4
8632 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
8633 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8635 echo " Yup, it does." >&4
8638 echo " Nope, it doesn't." >&4
8644 : check for length of long double
8645 case "${d_longdbl}${longdblsize}" in
8648 $echo $n "Checking to see how big your long doubles are...$c" >&4
8649 $cat >try.c <<'EOCP'
8653 printf("%d\n", sizeof(long double));
8657 if eval $compile; then
8659 $echo " $longdblsize bytes." >&4
8663 echo "(I can't seem to compile the test program. Guessing...)" >&4
8664 rp="What is the size of a long double (in bytes)?"
8668 if $test "X$doublesize" = "X$longdblsize"; then
8669 echo "(That isn't any different from an ordinary double.)"
8675 : check for long long
8677 echo $n "Checking to see if your system supports long long...$c" >&4
8678 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
8679 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8681 echo " Yup, it does." >&4
8684 echo " Nope, it doesn't." >&4
8690 : check for length of long long
8691 case "${d_longlong}${longlongsize}" in
8694 $echo $n "Checking to see how big your long longs are...$c" >&4
8695 $cat >try.c <<'EOCP'
8699 printf("%d\n", sizeof(long long));
8703 if eval $compile_ok; then
8704 longlongsize=`./try`
8705 $echo " $longlongsize bytes." >&4
8709 echo "(I can't seem to compile the test program. Guessing...)"
8710 rp="What is the size of a long long (in bytes)?"
8714 if $test "X$longsize" = "X$longlongsize"; then
8715 echo "(That isn't any different from an ordinary long.)"
8721 : see if lstat exists
8725 : see if madvise exists
8726 set madvise d_madvise
8729 : see if mblen exists
8733 : see if mbstowcs exists
8734 set mbstowcs d_mbstowcs
8737 : see if mbtowc exists
8741 : see if memchr exists
8745 : see if memcmp exists
8749 : see if memcpy exists
8753 : see if memmove exists
8754 set memmove d_memmove
8757 : see if memset exists
8761 : see if mkdir exists
8765 : see if mkfifo exists
8769 : see if mktime exists
8773 : see if this is a sys/mman.h system
8774 set sys/mman.h i_sysmman
8777 : see if mmap exists
8780 : see what shmat returns
8781 : default to something harmless
8783 case "$i_sysmman$d_mmap" in
8785 $cat >mmap.c <<'END'
8786 #include <sys/mman.h>
8789 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
8794 echo "and it returns ($mmaptype)." >&4
8800 : see if mprotect exists
8801 set mprotect d_mprotect
8804 : see if msgctl exists
8808 : see if msgget exists
8812 : see if msgsnd exists
8816 : see if msgrcv exists
8820 : see how much of the 'msg*(2)' library is present.
8823 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
8824 *"$undef"*) h_msg=false;;
8828 case "`ipcs 2>&1`" in
8829 "SVID messages"*"not configured"*)
8830 echo "Your $osname does not have the msg*(2) configured." >&4
8845 : we could also check for sys/ipc.h ...
8846 if $h_msg && $test `./findhdr sys/msg.h`; then
8847 echo "You have the full msg*(2) library." >&4
8850 echo "You don't have the full msg*(2) library." >&4
8856 : see if msync exists
8860 : see if munmap exists
8864 : see if nice exists
8868 : see if POSIX threads are available
8869 if test "X$usethreads" = "X$define"; then
8870 set pthread.h i_pthread
8878 : how to create joinable pthreads
8879 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
8881 echo "Checking what constant to use for creating joinable pthreads..." >&4
8882 $cat >try.c <<'EOCP'
8883 #include <pthread.h>
8885 int detachstate = JOINABLE;
8888 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
8889 if eval $compile; then
8890 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
8891 val="$undef" # Yes, undef.
8892 set d_old_pthread_create_joinable
8895 set old_pthread_create_joinable
8898 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
8899 if eval $compile; then
8900 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
8902 set d_old_pthread_create_joinable
8904 val=PTHREAD_CREATE_UNDETACHED
8905 set old_pthread_create_joinable
8908 set try -DJOINABLE=__UNDETACHED
8909 if eval $compile; then
8910 echo "You seem to use __UNDETACHED." >&4
8912 set d_old_pthread_create_joinable
8915 set old_pthread_create_joinable
8918 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
8920 set d_old_pthread_create_joinable
8923 set old_pthread_create_joinable
8930 d_old_pthread_create_joinable="$undef"
8931 old_pthread_create_joinable=""
8934 : see if pause exists
8938 : see if pipe exists
8942 : see if poll exists
8947 : see whether the various POSIXish _yields exist
8949 #include <pthread.h>
8955 #ifdef PTHREAD_YIELD
8958 #ifdef PTHREAD_YIELD_NULL
8959 pthread_yield(NULL);
8965 : see if sched_yield exists
8966 set try -DSCHED_YIELD
8967 if eval $compile; then
8969 sched_yield='sched_yield()'
8973 case "$usethreads" in
8976 $define) echo 'sched_yield() found.' >&4 ;;
8977 *) echo 'sched_yield() NOT found.' >&4 ;;
8983 : see if pthread_yield exists
8984 set try -DPTHREAD_YIELD
8985 if eval $compile; then
8987 case "$sched_yield" in
8988 '') sched_yield='pthread_yield()' ;;
8991 set try -DPTHREAD_YIELD_NULL
8992 if eval $compile; then
8994 case "$sched_yield" in
8995 '') sched_yield='pthread_yield(NULL)' ;;
9001 case "$usethreads" in
9004 $define) echo 'pthread_yield() found.' >&4 ;;
9005 *) echo 'pthread_yield() NOT found.' >&4 ;;
9012 case "$sched_yield" in
9013 '') sched_yield=undef ;;
9018 : see if this is a pwd.h system
9024 xxx=`./findhdr pwd.h`
9025 $cppstdin $cppflags $cppminus < $xxx >$$.h
9027 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9035 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9043 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9051 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9059 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9067 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9075 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9083 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9095 set d_pwquota; eval $setvar
9096 set d_pwage; eval $setvar
9097 set d_pwchange; eval $setvar
9098 set d_pwclass; eval $setvar
9099 set d_pwexpire; eval $setvar
9100 set d_pwcomment; eval $setvar
9101 set d_pwgecos; eval $setvar
9102 set d_pwpasswd; eval $setvar
9106 : see if readdir and friends exist
9107 set readdir d_readdir
9109 set seekdir d_seekdir
9111 set telldir d_telldir
9113 set rewinddir d_rewinddir
9116 : see if readlink exists
9117 set readlink d_readlink
9120 : see if readv exists
9124 : see if rename exists
9128 : see if rmdir exists
9132 : see if memory.h is available.
9137 : See if it conflicts with string.h
9143 $cppstdin $cppflags $cppminus < $strings > mem.h
9144 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9146 echo "We won't be including <memory.h>."
9156 : can bcopy handle overlapping blocks?
9161 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9168 $cat >>try.c <<'EOCP'
9171 # include <memory.h>
9174 # include <stdlib.h>
9177 # include <string.h>
9179 # include <strings.h>
9182 # include <unistd.h> /* Needed for NetBSD */
9186 char buf[128], abc[128];
9192 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9194 for (align = 7; align >= 0; align--) {
9195 for (len = 36; len; len--) {
9198 for (off = 1; off <= len; off++) {
9199 bcopy(b, b+off, len);
9200 bcopy(b+off, b, len);
9201 if (bcmp(b, abc, len))
9210 if eval $compile_ok; then
9211 if ./try 2>/dev/null; then
9215 echo "It can't, sorry."
9216 case "$d_memmove" in
9217 "$define") echo "But that's Ok since you have memmove()." ;;
9221 echo "(I can't compile the test program, so we'll assume not...)"
9222 case "$d_memmove" in
9223 "$define") echo "But that's Ok since you have memmove()." ;;
9228 $rm -f try.* try core
9232 : can memcpy handle overlapping blocks?
9237 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9244 $cat >>try.c <<'EOCP'
9247 # include <memory.h>
9250 # include <stdlib.h>
9253 # include <string.h>
9255 # include <strings.h>
9258 # include <unistd.h> /* Needed for NetBSD */
9262 char buf[128], abc[128];
9268 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9269 try to store the string in read-only memory. */
9270 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9272 for (align = 7; align >= 0; align--) {
9273 for (len = 36; len; len--) {
9275 memcpy(b, abc, len);
9276 for (off = 1; off <= len; off++) {
9277 memcpy(b+off, b, len);
9278 memcpy(b, b+off, len);
9279 if (memcmp(b, abc, len))
9288 if eval $compile_ok; then
9289 if ./try 2>/dev/null; then
9293 echo "It can't, sorry."
9294 case "$d_memmove" in
9295 "$define") echo "But that's Ok since you have memmove()." ;;
9299 echo "(I can't compile the test program, so we'll assume not...)"
9300 case "$d_memmove" in
9301 "$define") echo "But that's Ok since you have memmove()." ;;
9306 $rm -f try.* try core
9310 : can memcmp be trusted to compare relative magnitude?
9315 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9322 $cat >>try.c <<'EOCP'
9325 # include <memory.h>
9328 # include <stdlib.h>
9331 # include <string.h>
9333 # include <strings.h>
9336 # include <unistd.h> /* Needed for NetBSD */
9342 if ((a < b) && memcmp(&a, &b, 1) < 0)
9348 if eval $compile_ok; then
9349 if ./try 2>/dev/null; then
9353 echo "No, it can't (it uses signed chars)."
9356 echo "(I can't compile the test program, so we'll assume not...)"
9360 $rm -f try.* try core
9364 : see if select exists
9368 : see if semctl exists
9372 : see if semget exists
9376 : see if semop exists
9380 : see how much of the 'sem*(2)' library is present.
9383 case "$d_semctl$d_semget$d_semop" in
9384 *"$undef"*) h_sem=false;;
9388 case "`ipcs 2>&1`" in
9389 "SVID messages"*"not configured"*)
9390 echo "Your $osname does not have the sem*(2) configured." >&4
9403 : we could also check for sys/ipc.h ...
9404 if $h_sem && $test `./findhdr sys/sem.h`; then
9405 echo "You have the full sem*(2) library." >&4
9408 echo "You don't have the full sem*(2) library." >&4
9414 : see whether sys/sem.h defines union semun
9416 $cat > try.c <<'END'
9417 #include <sys/types.h>
9418 #include <sys/ipc.h>
9419 #include <sys/sem.h>
9420 int main () { union semun semun; semun.buf = 0; }
9423 if eval $compile; then
9424 echo "You have union semun in <sys/sem.h>." >&4
9427 echo "You do not have union semun in <sys/sem.h>." >&4
9430 $rm -f try try.c try.h
9434 : see how to do semctl IPC_STAT
9437 : see whether semctl IPC_STAT can use union semun
9442 # define S_IRUSR S_IREAD
9443 # define S_IWUSR S_IWRITE
9444 # define S_IXUSR S_IEXEC
9446 # define S_IRUSR 0400
9447 # define S_IWUSR 0200
9448 # define S_IXUSR 0100
9450 # define S_IRGRP (S_IRUSR>>3)
9451 # define S_IWGRP (S_IWUSR>>3)
9452 # define S_IXGRP (S_IXUSR>>3)
9453 # define S_IROTH (S_IRUSR>>6)
9454 # define S_IWOTH (S_IWUSR>>6)
9455 # define S_IXOTH (S_IXUSR>>6)
9458 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9459 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9460 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9465 #include <sys/types.h>
9466 #include <sys/ipc.h>
9467 #include <sys/sem.h>
9468 #include <sys/stat.h>
9475 #$d_union_semun HAS_UNION_SEMUN
9478 #ifndef HAS_UNION_SEMUN
9481 struct semid_ds *buf;
9482 unsigned short *array;
9488 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9489 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9491 struct semid_ds argbuf;
9494 st = semctl(sem, 0, IPC_STAT, arg);
9498 # endif /* IPC_STAT */
9499 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9501 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9502 # endif /* IPC_RMID */
9503 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9505 #endif /* IPC_PRIVATE && ... */
9506 printf("semget failed: errno = %d\n", errno);
9512 if eval $compile; then
9515 semun) val="$define" ;;
9521 case "$d_semctl_semun" in
9523 echo "You can use union semun for semctl IPC_STAT." >&4
9526 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9531 : see whether semctl IPC_STAT can use struct semid_ds pointer
9532 $cat > try.c <<'END'
9533 #include <sys/types.h>
9534 #include <sys/ipc.h>
9535 #include <sys/sem.h>
9536 #include <sys/stat.h>
9544 struct semid_ds arg;
9547 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9548 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9551 st = semctl(sem, 0, IPC_STAT, &arg);
9553 printf("semid_ds\n");
9555 # endif /* IPC_STAT */
9556 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9558 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9559 # endif /* IPC_RMID */
9560 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9562 #endif /* IPC_PRIVATE && ... */
9563 printf("semget failed: errno = %d\n", errno);
9570 if eval $compile; then
9573 semid_ds) val="$define" ;;
9577 set d_semctl_semid_ds
9579 case "$d_semctl_semid_ds" in
9581 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
9583 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
9590 # We do not have the full sem*(2) library, so assume we can not
9596 set d_semctl_semid_ds
9601 : see if setegid exists
9602 set setegid d_setegid
9605 : see if seteuid exists
9606 set seteuid d_seteuid
9609 : see if setgrent exists
9610 set setgrent d_setgrent
9613 : see if sethostent exists
9614 set sethostent d_sethent
9617 : see if setlinebuf exists
9618 set setlinebuf d_setlinebuf
9621 : see if setlocale exists
9622 set setlocale d_setlocale
9625 : see if setnetent exists
9626 set setnetent d_setnent
9629 : see if setprotoent exists
9630 set setprotoent d_setpent
9633 : see if setpgid exists
9634 set setpgid d_setpgid
9637 : see if setpgrp2 exists
9638 set setpgrp2 d_setpgrp2
9641 : see if setpriority exists
9642 set setpriority d_setprior
9645 : see if setpwent exists
9646 set setpwent d_setpwent
9649 : see if setregid exists
9650 set setregid d_setregid
9652 set setresgid d_setresgid
9655 : see if setreuid exists
9656 set setreuid d_setreuid
9658 set setresuid d_setresuid
9661 : see if setrgid exists
9662 set setrgid d_setrgid
9665 : see if setruid exists
9666 set setruid d_setruid
9669 : see if setservent exists
9670 set setservent d_setsent
9673 : see if setsid exists
9677 : see if setspent exists
9678 set setspent d_setspent
9681 : see if setvbuf exists
9682 set setvbuf d_setvbuf
9685 : see if sfio.h is available
9690 : see if sfio library is available
9701 : Ok, but do we want to use it.
9705 true|$define|[yY]*) dflt='y';;
9708 echo "$package can use the sfio library, but it is experimental."
9709 rp="You seem to have sfio available, do you want to try using it?"
9713 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
9715 : Remove sfio from list of libraries to use
9716 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
9719 echo "libs = $libs" >&4
9723 *) case "$usesfio" in
9725 echo "Sorry, cannot find sfio on this machine" >&4
9726 echo "Ignoring your setting of usesfio=$usesfio" >&4
9734 $define) usesfio='true';;
9735 *) usesfio='false';;
9738 : see if shmctl exists
9742 : see if shmget exists
9746 : see if shmat exists
9749 : see what shmat returns
9752 $cat >shmat.c <<'END'
9753 #include <sys/shm.h>
9756 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
9761 echo "and it returns ($shmattype)." >&4
9762 : see if a prototype for shmat is available
9763 xxx=`./findhdr sys/shm.h`
9764 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
9765 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
9776 set d_shmatprototype
9779 : see if shmdt exists
9783 : see how much of the 'shm*(2)' library is present.
9786 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
9787 *"$undef"*) h_shm=false;;
9791 case "`ipcs 2>&1`" in
9792 "SVID shared memory"*"not configured"*)
9793 echo "Your $osname does not have the shm*(2) configured." >&4
9808 : we could also check for sys/ipc.h ...
9809 if $h_shm && $test `./findhdr sys/shm.h`; then
9810 echo "You have the full shm*(2) library." >&4
9813 echo "You don't have the full shm*(2) library." >&4
9820 : see if we have sigaction
9821 if set sigaction val -f d_sigaction; eval $csym; $val; then
9822 echo 'sigaction() found.' >&4
9823 $cat > try.c <<'EOP'
9825 #include <sys/types.h>
9829 struct sigaction act, oact;
9833 if eval $compile_ok; then
9836 echo "But you don't seem to have a useable struct sigaction." >&4
9840 echo 'sigaction NOT found.' >&4
9843 set d_sigaction; eval $setvar
9844 $rm -f try try$_o try.c
9846 : see if sigsetjmp exists
9848 case "$d_sigsetjmp" in
9856 if (sigsetjmp(env,1))
9864 if eval $compile; then
9865 if ./try >/dev/null 2>&1; then
9866 echo "POSIX sigsetjmp found." >&4
9870 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
9876 echo "sigsetjmp not found." >&4
9880 *) val="$d_sigsetjmp"
9881 case "$d_sigsetjmp" in
9882 $define) echo "POSIX sigsetjmp found." >&4;;
9883 $undef) echo "sigsetjmp not found." >&4;;
9891 : see if stat knows about block sizes
9893 set d_statblks stat st_blocks $i_sysstat sys/stat.h
9896 : see if _ptr and _cnt from stdio act std
9898 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
9899 echo "(Looks like you have stdio.h from Linux.)"
9900 case "$stdio_ptr" in
9901 '') stdio_ptr='((fp)->_IO_read_ptr)'
9904 *) ptr_lval=$d_stdio_ptr_lval;;
9906 case "$stdio_cnt" in
9907 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
9910 *) cnt_lval=$d_stdio_cnt_lval;;
9912 case "$stdio_base" in
9913 '') stdio_base='((fp)->_IO_read_base)';;
9915 case "$stdio_bufsiz" in
9916 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
9919 case "$stdio_ptr" in
9920 '') stdio_ptr='((fp)->_ptr)'
9923 *) ptr_lval=$d_stdio_ptr_lval;;
9925 case "$stdio_cnt" in
9926 '') stdio_cnt='((fp)->_cnt)'
9929 *) cnt_lval=$d_stdio_cnt_lval;;
9931 case "$stdio_base" in
9932 '') stdio_base='((fp)->_base)';;
9934 case "$stdio_bufsiz" in
9935 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
9938 : test whether _ptr and _cnt really work
9939 echo "Checking how std your stdio is..." >&4
9942 #define FILE_ptr(fp) $stdio_ptr
9943 #define FILE_cnt(fp) $stdio_cnt
9945 FILE *fp = fopen("try.c", "r");
9948 18 <= FILE_cnt(fp) &&
9949 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
9957 if eval $compile; then
9959 echo "Your stdio acts pretty std."
9962 echo "Your stdio isn't very std."
9965 echo "Your stdio doesn't appear very std."
9971 : Can _ptr be used as an lvalue?
9972 case "$d_stdstdio$ptr_lval" in
9973 $define$define) val=$define ;;
9976 set d_stdio_ptr_lval
9979 : Can _cnt be used as an lvalue?
9980 case "$d_stdstdio$cnt_lval" in
9981 $define$define) val=$define ;;
9984 set d_stdio_cnt_lval
9987 : see if _base is also standard
9989 case "$d_stdstdio" in
9993 #define FILE_base(fp) $stdio_base
9994 #define FILE_bufsiz(fp) $stdio_bufsiz
9996 FILE *fp = fopen("try.c", "r");
9999 19 <= FILE_bufsiz(fp) &&
10000 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10007 if eval $compile; then
10009 echo "And its _base field acts std."
10012 echo "But its _base field isn't std."
10015 echo "However, it seems to be lacking the _base field."
10024 Checking how to access stdio streams by file descriptor number...
10026 case "$stdio_stream_array" in
10027 '') $cat >try.c <<EOCP
10030 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10034 for s in _iob __iob __sF
10036 set try -DSTDIO_STREAM_ARRAY=$s
10037 if eval $compile; then
10038 case "`./try$exe_ext`" in
10039 yes) stdio_stream_array=$s; break ;;
10043 $rm -f try.* try$exe_ext
10045 case "$stdio_stream_array" in
10047 I can't figure out how to access stdio streams by file descriptor number.
10049 d_stdio_stream_array="$undef"
10052 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10054 d_stdio_stream_array="$define"
10058 : see if strcoll exists
10059 set strcoll d_strcoll
10062 : check for structure copying
10064 echo "Checking to see if your C compiler can copy structs..." >&4
10065 $cat >try.c <<'EOCP'
10075 if $cc -c try.c >/dev/null 2>&1 ; then
10077 echo "Yup, it can."
10080 echo "Nope, it can't."
10086 : see if strerror and/or sys_errlist[] exist
10088 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10089 if set strerror val -f d_strerror; eval $csym; $val; then
10090 echo 'strerror() found.' >&4
10091 d_strerror="$define"
10092 d_strerrm='strerror(e)'
10093 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10094 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10095 d_syserrlst="$define"
10097 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10098 d_syserrlst="$undef"
10100 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10101 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10102 echo 'strerror() found in string header.' >&4
10103 d_strerror="$define"
10104 d_strerrm='strerror(e)'
10105 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10106 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10107 d_syserrlst="$define"
10109 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10110 d_syserrlst="$undef"
10112 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10113 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10114 d_strerror="$undef"
10115 d_syserrlst="$define"
10116 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10118 echo 'strerror() and sys_errlist[] NOT found.' >&4
10119 d_strerror="$undef"
10120 d_syserrlst="$undef"
10121 d_strerrm='"unknown"'
10125 : see if strtod exists
10126 set strtod d_strtod
10129 : see if strtol exists
10130 set strtol d_strtol
10133 : see if strtoul exists
10134 set strtoul d_strtoul
10137 : see if strxfrm exists
10138 set strxfrm d_strxfrm
10141 : see if symlink exists
10142 set symlink d_symlink
10145 : see if syscall exists
10146 set syscall d_syscall
10149 : see if sysconf exists
10150 set sysconf d_sysconf
10153 : see if system exists
10154 set system d_system
10157 : see if tcgetpgrp exists
10158 set tcgetpgrp d_tcgetpgrp
10161 : see if tcsetpgrp exists
10162 set tcsetpgrp d_tcsetpgrp
10165 : see if sys/types.h has to be included
10166 set sys/types.h i_systypes
10169 : see if prototype for telldir is available
10171 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10174 : define an is-a-typedef? function
10175 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10177 "") inclist="sys/types.h";;
10179 eval "varval=\$$var";
10183 for inc in $inclist; do
10184 echo "#include <$inc>" >>temp.c;
10186 echo "#ifdef $type" >> temp.c;
10187 echo "printf(\"We have $type\");" >> temp.c;
10188 echo "#endif" >> temp.c;
10189 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10190 if $contains $type temp.E >/dev/null 2>&1; then
10191 eval "$var=\$type";
10196 *) eval "$var=\$varval";;
10199 : define an is-a-typedef? function that prompts if the type is not available.
10200 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10202 "") inclist="sys/types.h";;
10204 eval "varval=\$$var";
10208 for inc in $inclist; do
10209 echo "#include <$inc>" >>temp.c;
10211 echo "#ifdef $type" >> temp.c;
10212 echo "printf(\"We have $type\");" >> temp.c;
10213 echo "#endif" >> temp.c;
10214 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10216 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10217 if $contains $type temp.E >/dev/null 2>&1; then
10218 echo "$type found." >&4;
10219 eval "$var=\$type";
10221 echo "$type NOT found." >&4;
10227 *) eval "$var=\$varval";;
10230 : see if this is a sys/times.h system
10231 set sys/times.h i_systimes
10234 : see if times exists
10236 if set times val -f d_times; eval $csym; $val; then
10237 echo 'times() found.' >&4
10240 case "$i_systimes" in
10241 "$define") inc='sys/times.h';;
10243 rp="What is the type returned by times() on this system?"
10244 set clock_t clocktype long stdio.h sys/types.h $inc
10247 echo 'times() NOT found, hope that will do.' >&4
10252 : see if truncate exists
10253 set truncate d_truncate
10256 : see if tzname[] exists
10258 if set tzname val -a d_tzname; eval $csym; $val; then
10260 echo 'tzname[] found.' >&4
10263 echo 'tzname[] NOT found.' >&4
10268 : see if umask exists
10272 : backward compatibility for d_hvfork
10273 if test X$d_hvfork != X; then
10274 d_vfork="$d_hvfork"
10277 : see if there is a vfork
10282 : Ok, but do we want to use it. vfork is reportedly unreliable in
10283 : perl on Solaris 2.x, and probably elsewhere.
10287 case "$usevfork" in
10293 Perl can only use a vfork() that doesn't suffer from strict
10294 restrictions on calling functions or modifying global data in
10295 the child. For example, glibc-2.1 contains such a vfork()
10296 that is unsuitable. If your system provides a proper fork()
10297 call, chances are that you do NOT want perl to use vfork().
10300 rp="Do you still want to use vfork()?"
10305 echo "Ok, we won't use vfork()."
10314 $define) usevfork='true';;
10315 *) usevfork='false';;
10318 : see if this is an sysdir system
10319 set sys/dir.h i_sysdir
10322 : see if this is an sysndir system
10323 set sys/ndir.h i_sysndir
10326 : see if closedir exists
10327 set closedir d_closedir
10330 case "$d_closedir" in
10333 echo "Checking whether closedir() returns a status..." >&4
10334 cat > closedir.c <<EOM
10335 #$i_dirent I_DIRENT /**/
10336 #$i_sysdir I_SYS_DIR /**/
10337 #$i_sysndir I_SYS_NDIR /**/
10338 #$i_systypes I_SYS_TYPES /**/
10340 #if defined(I_SYS_TYPES)
10341 #include <sys/types.h>
10343 #if defined(I_DIRENT)
10344 #include <dirent.h>
10345 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10346 #include <sys/dir.h>
10350 #include <sys/ndir.h>
10354 #include <ndir.h> /* may be wrong in the future */
10356 #include <sys/dir.h>
10361 int main() { return closedir(opendir(".")); }
10364 if eval $compile_ok; then
10365 if ./closedir > /dev/null 2>&1 ; then
10366 echo "Yes, it does."
10369 echo "No, it doesn't."
10373 echo "(I can't seem to compile the test program--assuming it doesn't)"
10381 set d_void_closedir
10384 : check for volatile keyword
10386 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10387 $cat >try.c <<'EOCP'
10390 typedef struct _goo_struct goo_struct;
10391 goo_struct * volatile goo = ((goo_struct *)0);
10392 struct _goo_struct {
10397 typedef unsigned short foo_t;
10398 char *volatile foo;
10400 volatile foo_t blech;
10404 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10406 echo "Yup, it does."
10409 echo "Nope, it doesn't."
10415 : see if there is a wait4
10419 : see if waitpid exists
10420 set waitpid d_waitpid
10423 : see if wcstombs exists
10424 set wcstombs d_wcstombs
10427 : see if wctomb exists
10428 set wctomb d_wctomb
10431 : see if writev exists
10432 set writev d_writev
10435 : preserve RCS keywords in files with variable substitution, grrr
10440 Revision='$Revision'
10442 case "$crosscompile" in
10443 ''|[nN]*) crosscompile="$undef" ;;
10447 next|rhapsody) multiarch="$define" ;;
10449 case "$multiarch" in
10450 ''|[nN]*) multiarch="$undef" ;;
10453 : check for alignment requirements
10455 case "$crosscompile$multiarch" in
10458 You seem to be either cross-compiling or doing a multiarchitecture build,
10459 skipping the memory alignment check.
10462 case "$alignbytes" in
10463 '') alignbytes=8 ;;
10467 case "$alignbytes" in
10468 '') echo "Checking alignment constraints..." >&4
10469 $cat >try.c <<'EOCP'
10476 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10480 if eval $compile_ok; then
10484 echo "(I can't seem to compile the test program...)"
10487 *) dflt="$alignbytes"
10490 rp="Doubles must be aligned on a how-many-byte boundary?"
10498 : check for ordering of bytes in a long
10500 case "$crosscompile$multiarch" in
10503 You seem to be either cross-compiling or doing a multiarchitecture build,
10504 skipping the byteorder check.
10510 case "$byteorder" in
10513 In the following, larger digits indicate more significance. A big-endian
10514 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10515 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10516 machines may have weird orders like 3412. A Cray will report 87654321. If
10517 the test program works the default is probably right.
10518 I'm now running the test program...
10520 $cat >try.c <<'EOCP'
10527 char c[sizeof(long)];
10530 if (sizeof(long) > 4)
10531 u.l = (0x08070605L << 32) | 0x04030201L;
10534 for (i = 0; i < sizeof(long); i++)
10535 printf("%c", u.c[i]+'0');
10542 if eval $compile && ./try > /dev/null; then
10545 [1-4][1-4][1-4][1-4]|12345678|87654321)
10546 echo "(The test program ran ok.)"
10547 echo "byteorder=$dflt"
10550 ????|????????) echo "(The test program ran ok.)" ;;
10551 *) echo "(The test program didn't run right for some reason.)" ;;
10556 (I can't seem to compile the test program. Guessing big-endian...)
10559 case "$xxx_prompt" in
10561 rp="What is the order of bytes in a long?"
10575 : how do we catenate cpp tokens here?
10577 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
10578 $cat >cpp_stuff.c <<'EOCP'
10579 #define RCAT(a,b)a/**/b
10580 #define ACAT(a,b)a ## b
10584 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
10585 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
10586 echo "Oh! Smells like ANSI's been here." >&4
10587 echo "We can catify or stringify, separately or together!"
10589 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
10590 echo "Ah, yes! The good old days!" >&4
10591 echo "However, in the good old days we don't know how to stringify and"
10592 echo "catify at the same time."
10596 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
10597 to have to edit the values of CAT[2-5] in config.h...
10599 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
10603 : see if this is a db.h system
10609 : Check db version.
10611 echo "Checking Berkeley DB version ..." >&4
10617 #include <sys/types.h>
10622 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
10623 int Major, Minor, Patch ;
10624 unsigned long Version ;
10625 (void)db_version(&Major, &Minor, &Patch) ;
10626 printf("You have Berkeley DB Version 2 or greater\n");
10628 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
10629 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
10630 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
10631 Major, Minor, Patch) ;
10633 /* check that db.h & libdb are compatible */
10634 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
10635 printf("db.h and libdb are incompatible\n") ;
10639 printf("db.h and libdb are compatible\n") ;
10641 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
10642 + DB_VERSION_PATCH ;
10644 /* needs to be >= 2.3.4 */
10645 if (Version < 2003004) {
10646 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
10647 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
10653 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
10654 printf("You have Berkeley DB Version 1\n");
10655 exit(0); /* DB version < 2: the coast is clear. */
10657 exit(1); /* <db.h> not Berkeley DB? */
10663 if eval $compile && ./try; then
10664 echo 'Looks OK.' >&4
10666 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
10670 : Remove db from list of libraries to use
10671 echo "Removing unusable -ldb from library list" >&4
10672 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
10675 echo "libs = $libs" >&4
10685 : Check the return type needed for hash
10687 echo "Checking return type needed for hash for Berkeley DB ..." >&4
10693 #include <sys/types.h>
10696 #ifndef DB_VERSION_MAJOR
10697 u_int32_t hash_cb (ptr, size)
10705 info.hash = hash_cb;
10709 if $cc $ccflags -c try.c >try.out 2>&1 ; then
10710 if $contains warning try.out >>/dev/null 2>&1 ; then
10713 db_hashtype='u_int32_t'
10716 : XXX Maybe we should just give up here.
10717 db_hashtype=u_int32_t
10719 echo "Help: I can't seem to compile the db test program." >&4
10720 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
10723 echo "Your version of Berkeley DB uses $db_hashtype for hash."
10725 *) db_hashtype=u_int32_t
10730 : Check the return type needed for prefix
10732 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
10738 #include <sys/types.h>
10741 #ifndef DB_VERSION_MAJOR
10742 size_t prefix_cb (key1, key2)
10750 info.prefix = prefix_cb;
10754 if $cc $ccflags -c try.c >try.out 2>&1 ; then
10755 if $contains warning try.out >>/dev/null 2>&1 ; then
10756 db_prefixtype='int'
10758 db_prefixtype='size_t'
10761 db_prefixtype='size_t'
10762 : XXX Maybe we should just give up here.
10764 echo "Help: I can't seem to compile the db test program." >&4
10765 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
10768 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
10770 *) db_prefixtype='size_t'
10774 : check for void type
10776 echo "Checking to see how well your C compiler groks the void type..." >&4
10777 case "$voidflags" in
10779 $cat >try.c <<'EOCP'
10785 extern void moo(); /* function returning void */
10786 void (*goo)(); /* ptr to func returning void */
10788 void *hue; /* generic ptr */
10801 int main() { sub(); }
10803 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
10804 voidflags=$defvoidused
10805 echo "Good. It appears to support void to the level $package wants.">&4
10806 if $contains warning .out >/dev/null 2>&1; then
10807 echo "However, you might get some warnings that look like this:"
10811 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
10812 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
10813 echo "It supports 1..."
10814 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
10815 echo "It also supports 2..."
10816 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
10818 echo "And it supports 4 but not 8 definitely."
10820 echo "It doesn't support 4..."
10821 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
10823 echo "But it supports 8."
10826 echo "Neither does it support 8."
10830 echo "It does not support 2..."
10831 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
10833 echo "But it supports 4 and 8."
10835 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
10837 echo "And it supports 4 but has not heard about 8."
10839 echo "However it supports 8 but not 4."
10844 echo "There is no support at all for void."
10849 case "$voidflags" in
10851 *) $cat >&4 <<'EOM'
10852 Support flag bits are:
10853 1: basic void declarations.
10854 2: arrays of pointers to functions returning void.
10855 4: operations between pointers to and addresses of void functions.
10856 8: generic void pointers.
10859 rp="Your void support flags add up to what?"
10867 : How can we generate normalized random numbers ?
10869 echo "Looking for a random number function..." >&4
10870 case "$randfunc" in
10872 if set drand48 val -f; eval $csym; $val; then
10874 echo "Good, found drand48()." >&4
10875 elif set random val -f; eval $csym; $val; then
10877 echo "OK, found random()." >&4
10880 echo "Yick, looks like I have to use rand()." >&4
10891 *-Dmy_rand=*|*-Dmy_srand=*)
10892 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
10893 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
10894 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
10895 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
10899 while $test "$cont"; do
10900 rp="Use which function to generate random numbers?"
10902 if $test "$ans" = "$dflt"; then
10908 if set $ans val -f; eval $csym; $val; then
10912 rp="I cannot find function $ans. Use that name anyway?"
10921 case "$randfunc" in
10923 drand01="drand48()"
10929 case "$randbits" in
10931 echo "Checking to see how many bits your $randfunc() function produces..." >&4
10933 #$i_unistd I_UNISTD
10934 #$i_stdlib I_STDLIB
10937 # include <unistd.h>
10940 # include <stdlib.h>
10945 register unsigned long tmp;
10946 register unsigned long max = 0L;
10948 for (i = 1000; i; i--) {
10949 tmp = (unsigned long) $randfunc();
10950 if (tmp > max) max = tmp;
10952 for (i = 0; max; i++)
10958 if eval $compile_ok; then
10962 echo "(I can't seem to compile the test program...)"
10969 rp="How many bits does your $randfunc() function produce?"
10973 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
10974 seedfunc="s$randfunc"
10975 randseedtype=unsigned
10979 rp="How many bits does your $randfunc() function produce?"
10982 seedfunc="s$randfunc"
10983 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
10984 if set $seedfunc val -f; eval $csym; $val; then
10985 echo "(Using $seedfunc() to seed random generator)"
10987 echo "(Warning: no $seedfunc() to seed random generator)"
10990 randseedtype=unsigned
10998 echo "Determining whether or not we are on an EBCDIC system..." >&4
10999 $cat >tebcdic.c <<'EOM'
11002 if ('M'==0xd4) return 0;
11009 if eval $compile_ok; then
11011 echo "You have EBCDIC." >&4
11014 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin, or UTF." >&4
11017 echo "I'm unable to compile the test program." >&4
11018 echo "I'll assume ASCII or some ISO Latin." >&4
11020 $rm -f tebcdic.c tebcdic
11026 Checking how to flush all pending stdio output...
11028 # I only know how to find the first 32 possibly open files on SunOS.
11029 # See also hints/sunos_4_1.sh and util.c --AD
11031 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11033 $cat >>try.c <<EOCP
11035 #$i_unistd I_UNISTD
11037 # include <unistd.h>
11039 #$d_sysconf HAS_SYSCONF
11040 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11041 #ifdef HAS_STDIO_STREAM_ARRAY
11042 # define STDIO_STREAM_ARRAY $stdio_stream_array
11045 FILE* p = fopen("try.out", "w");
11049 # ifdef TRY_FPRINTF
11053 #ifdef TRY_FFLUSH_NULL
11056 #ifdef TRY_FFLUSH_ALL
11058 long open_max = -1;
11059 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11060 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11062 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11063 open_max = sysconf(_SC_OPEN_MAX);
11066 open_max = FOPEN_MAX;
11069 open_max = OPEN_MAX;
11078 # ifdef HAS_STDIO_STREAM_ARRAY
11079 if (open_max > 0) {
11081 for (i = 0; i < open_max; i++)
11082 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11083 STDIO_STREAM_ARRAY[i]._file < open_max &&
11084 STDIO_STREAM_ARRAY[i]._flag)
11085 fflush(&STDIO_STREAM_ARRAY[i]);
11093 : first we have to find out how _not_ to flush
11094 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11096 set try -DTRY_FPUTC
11097 if eval $compile; then
11099 ./try$exe_ext 2>/dev/null
11100 if $test ! -s try.out -a "X$?" = X42; then
11106 set try -DTRY_FPRINTF
11108 if eval $compile; then
11110 ./try$exe_ext 2>/dev/null
11111 if $test ! -s try.out -a "X$?" = X42; then
11112 output=-DTRY_FPRINTF
11118 : check for fflush NULL behaviour
11119 case "$fflushNULL" in
11120 '') set try -DTRY_FFLUSH_NULL $output
11121 if eval $compile; then
11123 ./try$exe_ext 2>/dev/null
11125 if $test -s try.out -a "X$code" = X42; then
11126 fflushNULL="`$cat try.out`"
11128 if $test "X$code" != X42; then
11130 (If this test failed, don't worry, we'll try another method shortly.)
11135 $rm -f core try.core core.try.*
11136 case "$fflushNULL" in
11138 Your fflush(NULL) works okay.
11140 fflushNULL="$define"
11143 Your fflush(NULL) isn't working (contrary to ANSI C).
11145 fflushNULL="$undef"
11148 Cannot figure out whether your fflush(NULL) works or not.
11149 I'm assuming it doesn't (contrary to ANSI C).
11151 fflushNULL="$undef"
11155 $define|true|[yY]*)
11156 fflushNULL="$define"
11159 fflushNULL="$undef"
11162 : check explicit looping only if NULL did not work
11163 case "$fflushNULL" in
11165 : check for fflush all behaviour
11166 case "$fflushall" in
11167 '') set try -DTRY_FFLUSH_ALL $output
11168 if eval $compile; then
11170 (Now testing the other method--but note that also this may fail.)
11173 ./try$exe_ext 2>/dev/null
11174 if $test -s try.out -a "X$?" = X42; then
11175 fflushall="`$cat try.out`"
11178 $rm -f core try.core core.try.*
11179 case "$fflushall" in
11181 Whew. Flushing explicitly all the stdio streams works.
11183 fflushall="$define"
11186 Sigh. Flushing explicitly all the stdio streams doesn't work.
11191 Cannot figure out whether flushing stdio streams explicitly works or not.
11192 I'm assuming it doesn't.
11198 "$define"|true|[yY]*)
11199 fflushall="$define"
11206 *) fflushall="$undef"
11209 case "$fflushNULL$fflushall" in
11212 I cannot figure out how to flush pending stdio output.
11216 $rm -f try.* try$exe_ext
11218 : see what type file positions are declared as in the library
11219 rp="What is the type for file position used by fsetpos()?"
11220 set fpos_t fpostype long stdio.h sys/types.h
11223 : Store the full pathname to the ar program for use in the C program
11224 : Respect a hint or command line value for full_ar.
11229 : Store the full pathname to the sed program for use in the C program
11232 : see what type gids are declared as in the kernel
11234 echo "Looking for the type for group ids returned by getgid()."
11235 set gid_t gidtype xxx stdio.h sys/types.h
11239 xxx=`./findhdr sys/user.h`
11240 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11242 unsigned) dflt="$1 $2" ;;
11246 *) dflt="$gidtype";;
11249 gid_t) echo "gid_t found." ;;
11250 *) rp="What is the type for group ids returned by getgid()?"
11256 : see if getgroups exists
11257 set getgroups d_getgrps
11260 : see if setgroups exists
11261 set setgroups d_setgrps
11265 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11267 case "$d_getgrps$d_setgrps" in
11269 case "$groupstype" in
11270 '') dflt="$gidtype" ;;
11271 *) dflt="$groupstype" ;;
11274 What type of pointer is the second argument to getgroups() and setgroups()?
11275 Usually this is the same as group ids, $gidtype, but not always.
11278 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11282 *) groupstype="$gidtype";;
11285 : see what type lseek is declared as in the kernel
11286 rp="What is the type used for lseek's offset on this system?"
11287 set off_t lseektype long stdio.h sys/types.h
11291 $echo $n "Checking to see how big your file offsets are...$c" >&4
11293 #include <sys/types.h>
11297 printf("%d\n", sizeof($lseektype));
11301 if eval $compile_ok; then
11303 $echo " $lseeksize bytes." >&4
11307 echo "(I can't seem to compile the test program. Guessing...)"
11308 rp="What is the size of your file offsets (in bytes)?"
11315 echo "Checking if your $make program sets \$(MAKE)..." >&4
11316 case "$make_set_make" in
11318 $sed 's/^X //' > testmake.mak << 'EOF'
11320 X @echo 'maketemp="$(MAKE)"'
11322 case "`$make -f testmake.mak 2>/dev/null`" in
11323 *maketemp=*) make_set_make='#' ;;
11324 *) make_set_make="MAKE=$make" ;;
11326 $rm -f testmake.mak
11329 case "$make_set_make" in
11330 '#') echo "Yup, it does.";;
11331 *) echo "Nope, it doesn't.";;
11334 : see what type is used for mode_t
11335 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11336 set mode_t modetype int stdio.h sys/types.h
11339 : define a fucntion to check prototypes
11340 $cat > protochk <<EOSH
11343 optimize="$optimize"
11345 prototype="$prototype"
11350 $cat >> protochk <<'EOSH'
11355 while test $# -ge 2; do
11357 $define) echo "#include <$2>" >> try.c ;;
11358 literal) echo "$2" >> try.c ;;
11362 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11363 cat >> try.c <<'EOCP'
11364 #ifdef CAN_PROTOTYPE
11365 #define _(args) args
11370 echo "$foo" >> try.c
11371 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11372 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11378 $eunicefix protochk
11380 : see what type is used for size_t
11381 rp="What is the type used for the length parameter for string functions?"
11382 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11385 : check for type of arguments to gethostbyaddr.
11386 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11387 case "$d_gethbyaddr" in
11391 Checking to see what type of arguments are accepted by gethostbyaddr().
11393 hdrs="$define sys/types.h
11394 $d_socket sys/socket.h
11395 $i_niin netinet/in.h
11397 $i_unistd unistd.h"
11398 : The first arg can 'char *' or 'void *'
11399 : The second arg is some of integral type
11400 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11401 for yyy in size_t long int; do
11402 case "$netdb_host_type" in
11403 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11404 if ./protochk "$try" $hdrs; then
11405 echo "Your system accepts $xxx for the first arg."
11406 echo "...and $yyy for the second arg."
11407 netdb_host_type="$xxx"
11408 netdb_hlen_type="$yyy"
11414 : In case none of those worked, prompt the user.
11415 case "$netdb_host_type" in
11416 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11419 netdb_host_type=$ans
11420 rp='What is the type for the 2nd argument to gethostbyaddr?'
11423 netdb_hlen_type=$ans
11427 *) : no gethostbyaddr, so pick harmless defaults
11428 netdb_host_type='char *'
11429 netdb_hlen_type="$sizetype"
11432 # Remove the "const" if needed. -- but then we'll have a
11434 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11437 : check for type of argument to gethostbyname.
11438 if test "X$netdb_name_type" = X ; then
11439 case "$d_gethbyname" in
11443 Checking to see what type of argument is accepted by gethostbyname().
11445 hdrs="$define sys/types.h
11446 $d_socket sys/socket.h
11447 $i_niin netinet/in.h
11449 $i_unistd unistd.h"
11450 for xxx in "const char *" "char *"; do
11451 case "$netdb_name_type" in
11452 '') try="extern struct hostent *gethostbyname($xxx);"
11453 if ./protochk "$try" $hdrs; then
11454 echo "Your system accepts $xxx."
11455 netdb_name_type="$xxx"
11460 : In case none of those worked, prompt the user.
11461 case "$netdb_name_type" in
11462 '') rp='What is the type for the 1st argument to gethostbyname?'
11465 netdb_name_type=$ans
11469 *) : no gethostbyname, so pick harmless default
11470 netdb_name_type='char *'
11475 : check for type of 1st argument to getnetbyaddr.
11476 if test "X$netdb_net_type" = X ; then
11477 case "$d_getnbyaddr" in
11481 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11483 hdrs="$define sys/types.h
11484 $d_socket sys/socket.h
11485 $i_niin netinet/in.h
11487 $i_unistd unistd.h"
11488 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11489 case "$netdb_net_type" in
11490 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11491 if ./protochk "$try" $hdrs; then
11492 echo "Your system accepts $xxx."
11493 netdb_net_type="$xxx"
11498 : In case none of those worked, prompt the user.
11499 case "$netdb_net_type" in
11500 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11503 netdb_net_type=$ans
11507 *) : no getnetbyaddr, so pick harmless default
11508 netdb_net_type='long'
11512 : locate the preferred pager for this system
11526 '') dflt=/usr/ucb/more;;
11533 rp='What pager is used on your system?'
11537 : see what type pids are declared as in the kernel
11538 rp="What is the type of process ids on this system?"
11539 set pid_t pidtype int stdio.h sys/types.h
11542 : check for length of pointer
11546 $echo $n "Checking to see how big your pointers are...$c" >&4
11547 if test "$voidflags" -gt 7; then
11548 echo '#define VOID_PTR char *' > try.c
11550 echo '#define VOID_PTR void *' > try.c
11552 $cat >>try.c <<'EOCP'
11556 printf("%d\n", sizeof(VOID_PTR));
11561 if eval $compile_ok; then
11563 $echo " $ptrsize bytes." >&4
11566 echo "(I can't seem to compile the test program. Guessing...)" >&4
11567 rp="What is the size of a pointer (in bytes)?"
11575 : see if ar generates random libraries by itself
11577 echo "Checking how to generate random libraries on your machine..." >&4
11578 echo 'int bar1() { return bar2(); }' > bar1.c
11579 echo 'int bar2() { return 2; }' > bar2.c
11580 $cat > foo.c <<'EOP'
11581 int main() { printf("%d\n", bar1()); exit(0); }
11583 $cc $ccflags -c bar1.c >/dev/null 2>&1
11584 $cc $ccflags -c bar2.c >/dev/null 2>&1
11585 $cc $ccflags -c foo.c >/dev/null 2>&1
11586 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
11587 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11588 ./foobar >/dev/null 2>&1; then
11589 echo "$ar appears to generate random libraries itself."
11592 elif $ar ts bar$_a >/dev/null 2>&1 &&
11593 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11594 ./foobar >/dev/null 2>&1; then
11595 echo "a table of contents needs to be added with '$ar ts'."
11602 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
11603 $test -f $ranlib || ranlib=''
11606 if $test -n "$ranlib"; then
11607 echo "your system has '$ranlib'; we'll use that."
11610 echo "your system doesn't seem to support random libraries"
11611 echo "so we'll use lorder and tsort to order the libraries."
11618 : check for type of arguments to select.
11619 case "$selecttype" in
11620 '') case "$d_select" in
11623 Checking to see what type of arguments are accepted by select().
11625 hdrs="$define sys/types.h
11626 $i_systime sys/time.h
11627 $i_sysselct sys/select.h
11628 $d_socket sys/socket.h"
11629 : The first arg can be int, unsigned, or size_t
11630 : The last arg may or may not be 'const'
11632 : void pointer has been seen but using that
11633 : breaks the selectminbits test
11634 for xxx in 'fd_set *' 'int *'; do
11635 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
11636 for tmo in 'struct timeval *' 'const struct timeval *'; do
11638 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
11639 if ./protochk "$try" $hdrs; then
11640 echo "Your system accepts $xxx."
11649 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
11650 case "$d_fd_set" in
11651 $define) dflt="fd_set *" ;;
11660 *) : no select, so pick a harmless default
11667 : check for the select 'width'
11668 case "$selectminbits" in
11669 '') case "$d_select" in
11673 Checking to see on how many bits at a time your select() operates...
11676 #include <sys/types.h>
11678 #$i_systime I_SYS_TIME
11679 #$i_systimek I_SYS_TIME_KERNEL
11684 # ifdef I_SYS_TIME_KERNEL
11687 # include <sys/time.h>
11688 # ifdef I_SYS_TIME_KERNEL
11692 #$i_sysselct I_SYS_SELECT
11693 #ifdef I_SYS_SELECT
11694 #include <sys/select.h>
11696 #$d_socket HAS_SOCKET
11698 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
11702 #define S sizeof(*(b))
11704 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
11705 #define NBITS (NBYTES * 8)
11714 fp = fopen("try.c", "r");
11720 b = ($selecttype)s;
11721 for (i = 0; i < NBITS; i++)
11725 select(fd + 1, b, 0, 0, &t);
11726 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
11727 printf("%d\n", i + 1);
11732 if eval $compile_ok; then
11733 selectminbits=`./try`
11734 case "$selectminbits" in
11736 Cannot figure out on how many bits at a time your select() operates.
11737 I'll play safe and guess it is 32 bits.
11743 *) bits="$selectminbits bits" ;;
11745 echo "Your select() operates on $bits at a time." >&4
11747 rp='What is the minimum number of bits your select() operates on?'
11748 case "$byteorder" in
11749 1234|12345678) dflt=32 ;;
11754 selectminbits="$val"
11758 *) : no select, so pick a harmless default
11765 : Trace out the files included by signal.h, then look for SIGxxx names.
11766 : Remove SIGARRAYSIZE used by HPUX.
11767 : Remove SIGSTKSIZE used by Linux.
11768 : Remove SIGSTKSZ used by Posix.
11769 : Remove SIGTYP void lines used by OS2.
11770 xxx=`echo '#include <signal.h>' |
11771 $cppstdin $cppminus $cppflags 2>/dev/null |
11772 $grep '^[ ]*#.*include' |
11773 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
11774 : Check this list of files to be sure we have parsed the cpp output ok.
11775 : This will also avoid potentially non-existent files, such
11778 for xx in $xxx /dev/null ; do
11779 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
11781 : If we have found no files, at least try signal.h
11782 case "$xxxfiles" in
11783 '') xxxfiles=`./findhdr signal.h` ;;
11786 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
11787 print substr($2, 4, 20)
11789 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
11790 print substr($3, 4, 20)
11792 : Append some common names just in case the awk scan failed.
11793 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
11794 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
11795 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
11796 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
11797 : generate a few handy files for later
11798 $cat > signal.c <<'EOCP'
11799 #include <sys/types.h>
11800 #include <signal.h>
11804 /* Strange style to avoid deeply-nested #if/#else/#endif */
11807 # define NSIG (_NSIG)
11813 # define NSIG (SIGMAX+1)
11819 # define NSIG (SIG_MAX+1)
11825 # define NSIG (MAXSIG+1)
11831 # define NSIG (MAX_SIG+1)
11836 # ifdef SIGARRAYSIZE
11837 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
11843 # define NSIG (_sys_nsig) /* Solaris 2.5 */
11847 /* Default to some arbitrary number that's big enough to get most
11848 of the common signals.
11854 printf("NSIG %d\n", NSIG);
11860 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
11862 printf "#ifdef SIG"; printf $1; printf "\n"
11863 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
11864 printf $1; printf ");\n"
11868 printf "#endif /* JUST_NSIG */\n";
11872 $cat >signal.awk <<'EOP'
11873 BEGIN { ndups = 0 }
11874 $1 ~ /^NSIG$/ { nsig = $2 }
11875 ($1 !~ /^NSIG$/) && (NF == 2) {
11876 if ($2 > maxsig) { maxsig = $2 }
11877 if (sig_name[$2]) {
11878 dup_name[ndups] = $1
11879 dup_num[ndups] = $2
11891 printf("NSIG %d\n", nsig);
11892 for (n = 1; n < nsig; n++) {
11894 printf("%s %d\n", sig_name[n], sig_num[n])
11897 printf("NUM%d %d\n", n, n)
11900 for (n = 0; n < ndups; n++) {
11901 printf("%s %d\n", dup_name[n], dup_num[n])
11905 $cat >signal_cmd <<EOS
11907 if $test -s signal.lst; then
11908 echo "Using your existing signal.lst file"
11913 $cat >>signal_cmd <<'EOS'
11916 if eval $compile_ok; then
11917 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
11919 echo "(I can't seem be able to compile the whole test program)" >&4
11920 echo "(I'll try it in little pieces.)" >&4
11921 set signal -DJUST_NSIG
11922 if eval $compile_ok; then
11923 ./signal$_exe > signal.nsg
11926 echo "I can't seem to figure out how many signals you have." >&4
11927 echo "Guessing 50." >&4
11928 echo 'NSIG 50' > signal.nsg
11930 : Now look at all the signal names, one at a time.
11931 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
11932 $cat > signal.c <<EOCP
11933 #include <sys/types.h>
11934 #include <signal.h>
11937 printf("$xx %d\n", SIG${xx});
11942 if eval $compile; then
11943 echo "SIG${xx} found."
11944 ./signal$_exe >> signal.ls1
11946 echo "SIG${xx} NOT found."
11949 if $test -s signal.ls1; then
11950 $cat signal.nsg signal.ls1 |
11951 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
11955 if $test -s signal.lst; then
11958 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
11959 echo 'kill -l' >signal
11960 set X `csh -f <signal`
11964 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
11966 echo $@ | $tr ' ' $trnl | \
11967 $awk '{ printf "%s %d\n", $1, ++s; }
11968 END { printf "NSIG %d\n", ++s }' >signal.lst
11970 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
11972 chmod a+x signal_cmd
11973 $eunicefix signal_cmd
11975 : generate list of signal names
11977 case "$sig_name_init" in
11979 *) case "$sig_num_init" in
11980 ''|*,*) doinit=yes ;;
11985 echo "Generating a list of signal names and numbers..." >&4
11987 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
11988 sig_name=`$awk 'BEGIN { printf "ZERO " }
11989 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
11990 sig_num=`$awk 'BEGIN { printf "0 " }
11991 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
11992 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
11993 !/^NSIG/ { printf "\"%s\", ", $1 }
11994 END { printf "0\n" }' signal.lst`
11995 sig_num_init=`$awk 'BEGIN { printf "0, " }
11996 !/^NSIG/ { printf "%d, ", $2}
11997 END { printf "0\n"}' signal.lst`
12000 echo "The following $sig_count signals are available:"
12002 echo $sig_name | $awk \
12003 'BEGIN { linelen = 0 }
12005 for (i = 1; i <= NF; i++) {
12006 name = "SIG" $i " "
12007 linelen = linelen + length(name)
12008 if (linelen > 70) {
12010 linelen = length(name)
12016 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12018 : see what type is used for signed size_t
12019 set ssize_t ssizetype int stdio.h sys/types.h
12022 $cat > ssize.c <<EOM
12024 #include <sys/types.h>
12025 #define Size_t $sizetype
12026 #define SSize_t $dflt
12029 if (sizeof(Size_t) == sizeof(SSize_t))
12031 else if (sizeof(Size_t) == sizeof(int))
12040 if eval $compile_ok && ./ssize > /dev/null; then
12041 ssizetype=`./ssize`
12042 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12045 Help! I can't compile and run the ssize_t test program: please enlighten me!
12046 (This is probably a misconfiguration in your system or libraries, and
12047 you really ought to fix it. Still, I'll try anyway.)
12049 I need a type that is the same size as $sizetype, but is guaranteed to
12050 be signed. Common values are ssize_t, int and long.
12053 rp="What signed type is the same size as $sizetype?"
12057 $rm -f ssize ssize.*
12059 : see what type of char stdio uses.
12061 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12062 echo "Your stdio uses unsigned chars." >&4
12063 stdchar="unsigned char"
12065 echo "Your stdio uses signed chars." >&4
12069 : see if time exists
12071 if test "X$d_time" = X -o X"$timetype" = X; then
12072 if set time val -f d_time; eval $csym; $val; then
12073 echo 'time() found.' >&4
12075 rp="What is the type returned by time() on this system?"
12076 set time_t timetype long stdio.h sys/types.h
12079 echo 'time() not found, hope that will do.' >&4
12087 : see what type uids are declared as in the kernel
12089 echo "Looking for the type for user ids returned by getuid()."
12090 set uid_t uidtype xxx stdio.h sys/types.h
12094 xxx=`./findhdr sys/user.h`
12095 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12097 unsigned) dflt="$1 $2" ;;
12101 *) dflt="$uidtype";;
12104 uid_t) echo "uid_t found." ;;
12105 *) rp="What is the type for user ids returned by getuid()?"
12111 : see if dbm.h is available
12112 : see if dbmclose exists
12113 set dbmclose d_dbmclose
12116 case "$d_dbmclose" in
12126 *) set rpcsvc/dbm.h i_rpcsvcdbm
12131 *) echo "We won't be including <dbm.h>"
12141 : see if this is a sys/file.h system
12146 : do we need to include sys/file.h ?
12150 if $h_sysfile; then
12152 echo "We'll be including <sys/file.h>." >&4
12155 echo "We won't be including <sys/file.h>." >&4
12165 : see if fcntl.h is there
12170 : see if we can include fcntl.h
12176 echo "We'll be including <fcntl.h>." >&4
12179 if $h_sysfile; then
12180 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12182 echo "We won't be including <fcntl.h>." >&4
12194 : see if locale.h is available
12195 set locale.h i_locale
12198 : see if mach cthreads are available
12199 if test "X$usethreads" = "X$define"; then
12200 set mach/cthreads.h i_machcthr
12203 i_machcthr="$undef"
12208 : see if this is a math.h system
12212 : see if this is a mntent.h system
12213 set mntent.h i_mntent
12216 : see if ndbm.h is available
12221 : see if dbm_open exists
12222 set dbm_open d_dbm_open
12224 case "$d_dbm_open" in
12227 echo "We won't be including <ndbm.h>"
12236 : see if net/errno.h is available
12238 set net/errno.h val
12241 : Unfortunately, it causes problems on some systems. Arrgh.
12244 cat > try.c <<'EOM'
12247 #include <net/errno.h>
12253 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12254 echo "We'll be including <net/errno.h>." >&4
12256 echo "We won't be including <net/errno.h>." >&4
12265 : see if netinet/tcp.h is available
12266 set netinet/tcp.h i_netinettcp
12269 : see if this is a poll.h system
12273 : get C preprocessor symbols handy
12275 $echo $n "Hmm... $c"
12276 echo $al | $tr ' ' $trnl >Cppsym.know
12277 $cat <<EOSS >Cppsym
12285 case "\$list\$#" in
12288 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12290 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12293 unknown="\$unknown \$sym"
12303 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12305 exit 0; _ _ _ _\1\\ \1\\
12308 echo "exit 1; _ _ _" >>Cppsym\$\$
12309 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12311 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12317 $rm -f Cppsym\$\$ Cppsym2\$\$
12322 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12324 : now check the C compiler for additional symbols
12325 postprocess_cc_v=''
12327 aix) postprocess_cc_v="|$tr , ' '" ;;
12334 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12337 -D*) echo "\$i" | $sed 's/^-D//';;
12338 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12343 postprocess_cc_v=''
12346 ./ccsym > ccsym1.raw
12347 if $test -s ccsym1.raw; then
12348 $sort ccsym1.raw | $uniq >ccsym.raw
12350 mv ccsym1.raw ccsym.raw
12353 $awk '/\=/ { print $0; next }
12354 { print $0"=1" }' ccsym.raw >ccsym.list
12355 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12356 $comm -13 ccsym.true ccsym.list >ccsym.own
12357 $comm -12 ccsym.true ccsym.list >ccsym.com
12358 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12360 if $test -z ccsym.raw; then
12361 echo "Your C compiler doesn't seem to define any symbols!" >&4
12363 echo "However, your C preprocessor defines the following symbols:"
12366 cppsymbols=`$cat Cppsym.true`
12367 cppsymbols=`echo $cppsymbols`
12368 cppccsymbols="$cppsymbols"
12370 if $test -s ccsym.com; then
12371 echo "Your C compiler and pre-processor define these symbols:"
12372 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12375 cppccsymbols=`$cat ccsym.com`
12376 cppccsymbols=`echo $cppccsymbols`
12377 $test "$silent" || sleep 1
12379 if $test -s ccsym.cpp; then
12380 $test "$also" && echo " "
12381 echo "Your C pre-processor ${also}defines the following symbols:"
12382 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12384 cppsymbols=`$cat ccsym.cpp`
12385 cppsymbols=`echo $cppsymbols`
12386 $test "$silent" || sleep 1
12388 if $test -s ccsym.own; then
12389 $test "$also" && echo " "
12390 echo "Your C compiler ${also}defines the following cpp symbols:"
12391 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12392 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12393 ccsymbols=`$cat ccsym.own`
12394 ccsymbols=`echo $ccsymbols`
12395 $test "$silent" || sleep 1
12400 : see if this is a termio system
12404 if $test `./findhdr termios.h`; then
12405 set tcsetattr i_termios
12411 "$define") echo "You have POSIX termios.h... good!" >&4;;
12412 *) if ./Cppsym pyr; then
12413 case "`/bin/universe`" in
12414 ucb) if $test `./findhdr sgtty.h`; then
12416 echo "<sgtty.h> found." >&4
12418 echo "System is pyramid with BSD universe."
12419 echo "<sgtty.h> not found--you could have problems." >&4
12421 *) if $test `./findhdr termio.h`; then
12423 echo "<termio.h> found." >&4
12425 echo "System is pyramid with USG universe."
12426 echo "<termio.h> not found--you could have problems." >&4
12430 if $test `./findhdr termio.h`; then
12431 echo "<termio.h> found." >&4
12433 elif $test `./findhdr sgtty.h`; then
12434 echo "<sgtty.h> found." >&4
12437 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12440 if $test `./findhdr sgtty.h`; then
12441 echo "<sgtty.h> found." >&4
12443 elif $test `./findhdr termio.h`; then
12444 echo "<termio.h> found." >&4
12447 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12451 set i_termio; eval $setvar
12452 val=$val2; set i_sgtty; eval $setvar
12453 val=$val3; set i_termios; eval $setvar
12455 : see if this is a shadow.h system
12456 set shadow.h i_shadow
12459 : see if this is a socks.h system
12460 set socks.h i_socks
12463 : see if stdarg is available
12465 if $test `./findhdr stdarg.h`; then
12466 echo "<stdarg.h> found." >&4
12469 echo "<stdarg.h> NOT found." >&4
12473 : see if varags is available
12475 if $test `./findhdr varargs.h`; then
12476 echo "<varargs.h> found." >&4
12478 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12481 : set up the varargs testing programs
12482 $cat > varargs.c <<EOP
12484 #include <stdarg.h>
12487 #include <varargs.h>
12491 int f(char *p, ...)
12505 p = va_arg(ap, char *);
12510 $cat > varargs <<EOP
12512 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
12521 : now check which varargs header should be included
12526 if `./varargs I_STDARG`; then
12528 elif `./varargs I_VARARGS`; then
12533 if `./varargs I_VARARGS`; then
12540 echo "I could not find the definition for va_dcl... You have problems..." >&4
12541 val="$undef"; set i_stdarg; eval $setvar
12542 val="$undef"; set i_varargs; eval $setvar
12547 case "$i_varhdr" in
12549 val="$define"; set i_stdarg; eval $setvar
12550 val="$undef"; set i_varargs; eval $setvar
12553 val="$undef"; set i_stdarg; eval $setvar
12554 val="$define"; set i_varargs; eval $setvar
12557 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
12561 : see if stddef is available
12562 set stddef.h i_stddef
12565 : see if sys/access.h is available
12566 set sys/access.h i_sysaccess
12569 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
12570 set sys/filio.h i_sysfilio
12573 if $test `./findhdr sys/ioctl.h`; then
12575 echo '<sys/ioctl.h> found.' >&4
12578 if $test $i_sysfilio = "$define"; then
12579 echo '<sys/ioctl.h> NOT found.' >&4
12581 $test $i_sgtty = "$define" && xxx="sgtty.h"
12582 $test $i_termio = "$define" && xxx="termio.h"
12583 $test $i_termios = "$define" && xxx="termios.h"
12584 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
12590 : see if sys/resource.h has to be included
12591 set sys/resource.h i_sysresrc
12594 : see if sys/security.h is available
12595 set sys/security.h i_syssecrt
12598 : see if this is a sys/statvfs.h system
12599 set sys/statvfs.h i_sysstatvfs
12602 : see if this is a sys/un.h system
12603 set sys/un.h i_sysun
12606 : see if this is a syswait system
12607 set sys/wait.h i_syswait
12610 : see if this is an utime system
12611 set utime.h i_utime
12614 : see if this is a values.h system
12615 set values.h i_values
12618 : see if this is a vfork system
12621 set vfork.h i_vfork
12629 : see if gdbm.h is available
12634 : see if gdbm_open exists
12635 set gdbm_open d_gdbm_open
12637 case "$d_gdbm_open" in
12640 echo "We won't be including <gdbm.h>"
12650 echo "Looking for extensions..." >&4
12651 : If we are using the old config.sh, known_extensions may contain
12652 : old or inaccurate or duplicate values.
12653 known_extensions=''
12654 nonxs_extensions=''
12655 : We do not use find because it might not be available.
12656 : We do not just use MANIFEST because the user may have dropped
12657 : some additional extensions into the source tree and expect them
12660 : Function to recursively find available extensions, ignoring DynaLoader
12661 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
12665 DynaLoader|dynaload) ;;
12667 if $test -f $xxx/$xxx.xs; then
12668 known_extensions="$known_extensions $1$xxx";
12669 elif $test -f $xxx/Makefile.PL; then
12670 nonxs_extensions="$nonxs_extensions $1$xxx";
12672 if $test -d $xxx -a $# -lt 10; then
12675 eval $find_extensions;
12687 eval $find_extensions
12688 set X $nonxs_extensions
12690 nonxs_extensions="$*"
12691 set X $known_extensions
12693 known_extensions="$*"
12696 : Now see which are supported on this system.
12698 for xxx in $known_extensions ; do
12702 $define) avail_ext="$avail_ext $xxx" ;;
12705 GDBM_File|gdbm_fil)
12707 $define) avail_ext="$avail_ext $xxx" ;;
12710 NDBM_File|ndbm_fil)
12712 $define) avail_ext="$avail_ext $xxx" ;;
12715 ODBM_File|odbm_fil)
12716 case "${i_dbm}${i_rpcsvcdbm}" in
12717 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
12721 case "$useposix" in
12722 true|define|y) avail_ext="$avail_ext $xxx" ;;
12726 case "$useopcode" in
12727 true|define|y) avail_ext="$avail_ext $xxx" ;;
12731 case "$d_socket" in
12732 true|$define|y) avail_ext="$avail_ext $xxx" ;;
12736 case "$usethreads" in
12737 true|$define|y) avail_ext="$avail_ext $xxx" ;;
12741 : XXX Do we need a useipcsysv variable here
12742 case "${d_msg}${d_sem}${d_shm}" in
12743 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
12746 *) avail_ext="$avail_ext $xxx"
12755 : Now see which nonxs extensions are supported on this system.
12756 : For now assume all are.
12758 for xxx in $nonxs_extensions ; do
12760 *) nonxs_ext="$nonxs_ext $xxx"
12772 A number of extensions are supplied with $package. You may choose to
12773 compile these extensions for dynamic loading (the default), compile
12774 them into the $package executable (static loading), or not include
12775 them at all. Answer "none" to include no extensions.
12776 Note that DynaLoader is always built and need not be mentioned here.
12779 case "$dynamic_ext" in
12780 '') dflt="$avail_ext" ;;
12781 *) dflt="$dynamic_ext"
12782 # Perhaps we are reusing an old out-of-date config.sh.
12785 if test X"$dynamic_ext" != X"$avail_ext"; then
12787 NOTICE: Your previous config.sh list may be incorrect.
12788 The extensions now available to you are
12790 but the default list from your previous config.sh is
12802 rp="What extensions do you wish to load dynamically?"
12805 none) dynamic_ext=' ' ;;
12806 *) dynamic_ext="$ans" ;;
12809 case "$static_ext" in
12811 : Exclude those already listed in dynamic linking
12813 for xxx in $avail_ext; do
12814 case " $dynamic_ext " in
12816 *) dflt="$dflt $xxx" ;;
12823 *) dflt="$static_ext"
12830 rp="What extensions do you wish to load statically?"
12833 none) static_ext=' ' ;;
12834 *) static_ext="$ans" ;;
12839 A number of extensions are supplied with $package. Answer "none"
12840 to include no extensions.
12841 Note that DynaLoader is always built and need not be mentioned here.
12844 case "$static_ext" in
12845 '') dflt="$avail_ext" ;;
12846 *) dflt="$static_ext"
12847 # Perhaps we are reusing an old out-of-date config.sh.
12850 if test X"$static_ext" != X"$avail_ext"; then
12852 NOTICE: Your previous config.sh list may be incorrect.
12853 The extensions now available to you are
12855 but the default list from your previous config.sh is
12864 : Exclude those that are not xs extensions
12868 rp="What extensions do you wish to include?"
12871 none) static_ext=' ' ;;
12872 *) static_ext="$ans" ;;
12877 set X $dynamic_ext $static_ext $nonxs_ext
12881 : Remove build directory name from cppstdin so it can be used from
12882 : either the present location or the final installed location.
12884 : Get out of the UU directory to get correct path name.
12886 case "$cppstdin" in
12888 echo "Stripping down cppstdin path name"
12894 : end of configuration questions
12896 echo "End of configuration questions."
12899 : back to where it started
12900 if test -d ../UU; then
12904 : configuration may be patched via a 'config.over' file
12905 if $test -f config.over; then
12908 rp='I see a config.over file. Do you wish to load it?'
12911 n*) echo "OK, I'll ignore it.";;
12913 echo "Configuration override changes have been loaded."
12918 : in case they want portability, strip down executable paths
12919 case "$d_portable" in
12922 echo "Stripping down executable paths..." >&4
12923 for file in $loclist $trylist; do
12924 if test X$file != Xln -a X$file != Xar -o X$osname != Xos2; then
12925 eval $file="\$file"
12931 : create config.sh file
12933 echo "Creating config.sh..." >&4
12934 $spitshell <<EOT >config.sh
12937 # This file was produced by running the Configure script. It holds all the
12938 # definitions figured out by Configure. Should you modify one of these values,
12939 # do not forget to propagate your changes by running "Configure -der". You may
12940 # instead choose to run each of the .SH files by yourself, or "Configure -S".
12943 # Package name : $package
12944 # Source directory : $src
12945 # Configuration time: $cf_time
12946 # Configured by : $cf_by
12947 # Target system : $myuname
12957 Revision='$Revision'
12964 alignbytes='$alignbytes'
12965 ansi2knr='$ansi2knr'
12966 aphostname='$aphostname'
12967 apiversion='$apiversion'
12970 archlibexp='$archlibexp'
12971 archname64='$archname64'
12972 archname='$archname'
12973 archobjs='$archobjs'
12981 byteorder='$byteorder'
12983 castflags='$castflags'
12986 cccdlflags='$cccdlflags'
12987 ccdlflags='$ccdlflags'
12989 ccsymbols='$ccsymbols'
12991 cf_email='$cf_email'
12996 clocktype='$clocktype'
12998 compress='$compress'
12999 contains='$contains'
13003 cpp_stuff='$cpp_stuff'
13004 cppccsymbols='$cppccsymbols'
13005 cppflags='$cppflags'
13007 cppminus='$cppminus'
13009 cppstdin='$cppstdin'
13010 cppsymbols='$cppsymbols'
13011 crosscompile='$crosscompile'
13012 cryptlib='$cryptlib'
13014 d_Gconvert='$d_Gconvert'
13015 d_access='$d_access'
13016 d_accessx='$d_accessx'
13018 d_archlib='$d_archlib'
13019 d_attribut='$d_attribut'
13023 d_bsdgetpgrp='$d_bsdgetpgrp'
13024 d_bsdsetpgrp='$d_bsdsetpgrp'
13026 d_casti32='$d_casti32'
13027 d_castneg='$d_castneg'
13028 d_charvspr='$d_charvspr'
13030 d_chroot='$d_chroot'
13031 d_chsize='$d_chsize'
13032 d_closedir='$d_closedir'
13033 d_cmsghdr_s='$d_cmsghdr_s'
13037 d_cuserid='$d_cuserid'
13038 d_dbl_dig='$d_dbl_dig'
13039 d_dbmclose64='$d_dbmclose64'
13040 d_dbminit64='$d_dbminit64'
13041 d_delete64='$d_delete64'
13042 d_difftime='$d_difftime'
13043 d_dirent64_s='$d_dirent64_s'
13044 d_dirnamlen='$d_dirnamlen'
13045 d_dlerror='$d_dlerror'
13046 d_dlopen='$d_dlopen'
13047 d_dlsymun='$d_dlsymun'
13048 d_dosuid='$d_dosuid'
13049 d_drand48proto='$d_drand48proto'
13051 d_eaccess='$d_eaccess'
13052 d_endgrent='$d_endgrent'
13053 d_endhent='$d_endhent'
13054 d_endnent='$d_endnent'
13055 d_endpent='$d_endpent'
13056 d_endpwent='$d_endpwent'
13057 d_endsent='$d_endsent'
13058 d_endspent='$d_endspent'
13059 d_eofnblk='$d_eofnblk'
13060 d_eunice='$d_eunice'
13061 d_fchmod='$d_fchmod'
13062 d_fchown='$d_fchown'
13064 d_fd_macros='$d_fd_macros'
13065 d_fd_set='$d_fd_set'
13066 d_fds_bits='$d_fds_bits'
13067 d_fetch64='$d_fetch64'
13068 d_fgetpos64='$d_fgetpos64'
13069 d_fgetpos='$d_fgetpos'
13070 d_firstkey64='$d_firstkey64'
13071 d_flexfnam='$d_flexfnam'
13072 d_flock64_s='$d_flock64_s'
13074 d_fopen64='$d_fopen64'
13076 d_fpathconf='$d_fpathconf'
13077 d_freopen64='$d_freopen64'
13078 d_fseek64='$d_fseek64'
13079 d_fseeko64='$d_fseeko64'
13080 d_fseeko='$d_fseeko'
13081 d_fsetpos64='$d_fsetpos64'
13082 d_fsetpos='$d_fsetpos'
13083 d_fstat64='$d_fstat64'
13084 d_fstatfs='$d_fstatfs'
13085 d_fstatvfs='$d_fstatvfs'
13086 d_ftell64='$d_ftell64'
13087 d_ftello64='$d_ftello64'
13088 d_ftello='$d_ftello'
13090 d_ftruncate64='$d_ftruncate64'
13091 d_getgrent='$d_getgrent'
13092 d_getgrps='$d_getgrps'
13093 d_gethbyaddr='$d_gethbyaddr'
13094 d_gethbyname='$d_gethbyname'
13095 d_gethent='$d_gethent'
13096 d_gethname='$d_gethname'
13097 d_gethostprotos='$d_gethostprotos'
13098 d_getlogin='$d_getlogin'
13099 d_getmntent='$d_getmntent'
13100 d_getnbyaddr='$d_getnbyaddr'
13101 d_getnbyname='$d_getnbyname'
13102 d_getnent='$d_getnent'
13103 d_getnetprotos='$d_getnetprotos'
13104 d_getpbyname='$d_getpbyname'
13105 d_getpbynumber='$d_getpbynumber'
13106 d_getpent='$d_getpent'
13107 d_getpgid='$d_getpgid'
13108 d_getpgrp2='$d_getpgrp2'
13109 d_getpgrp='$d_getpgrp'
13110 d_getppid='$d_getppid'
13111 d_getprior='$d_getprior'
13112 d_getprotoprotos='$d_getprotoprotos'
13113 d_getpwent='$d_getpwent'
13114 d_getsbyname='$d_getsbyname'
13115 d_getsbyport='$d_getsbyport'
13116 d_getsent='$d_getsent'
13117 d_getservprotos='$d_getservprotos'
13118 d_getspent='$d_getspent'
13119 d_getspnam='$d_getspnam'
13120 d_gettimeod='$d_gettimeod'
13121 d_gnulibc='$d_gnulibc'
13122 d_grpasswd='$d_grpasswd'
13123 d_hasmntopt='$d_hasmntopt'
13126 d_inetaton='$d_inetaton'
13127 d_ino64_t='$d_ino64_t'
13128 d_int64t='$d_int64t'
13129 d_iovec_s='$d_iovec_s'
13130 d_isascii='$d_isascii'
13131 d_killpg='$d_killpg'
13132 d_lchown='$d_lchown'
13134 d_llseek='$d_llseek'
13135 d_locconv='$d_locconv'
13136 d_lockf64='$d_lockf64'
13138 d_longdbl='$d_longdbl'
13139 d_longlong='$d_longlong'
13140 d_lseek64='$d_lseek64'
13141 d_lstat64='$d_lstat64'
13143 d_madvise='$d_madvise'
13145 d_mbstowcs='$d_mbstowcs'
13146 d_mbtowc='$d_mbtowc'
13147 d_memchr='$d_memchr'
13148 d_memcmp='$d_memcmp'
13149 d_memcpy='$d_memcpy'
13150 d_memmove='$d_memmove'
13151 d_memset='$d_memset'
13153 d_mkfifo='$d_mkfifo'
13154 d_mktime='$d_mktime'
13156 d_mprotect='$d_mprotect'
13158 d_msg_ctrunc='$d_msg_ctrunc'
13159 d_msg_dontroute='$d_msg_dontroute'
13160 d_msg_oob='$d_msg_oob'
13161 d_msg_peek='$d_msg_peek'
13162 d_msg_proxy='$d_msg_proxy'
13163 d_msgctl='$d_msgctl'
13164 d_msgget='$d_msgget'
13165 d_msghdr_s='$d_msghdr_s'
13166 d_msgrcv='$d_msgrcv'
13167 d_msgsnd='$d_msgsnd'
13169 d_munmap='$d_munmap'
13170 d_mymalloc='$d_mymalloc'
13171 d_nextkey64='$d_nextkey64'
13173 d_off64_t='$d_off64_t'
13174 d_offset_t='$d_offset_t'
13175 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13176 d_oldpthreads='$d_oldpthreads'
13177 d_oldsock='$d_oldsock'
13179 d_open64='$d_open64'
13180 d_opendir64='$d_opendir64'
13181 d_pathconf='$d_pathconf'
13183 d_phostname='$d_phostname'
13186 d_portable='$d_portable'
13187 d_pthread_yield='$d_pthread_yield'
13189 d_pwchange='$d_pwchange'
13190 d_pwclass='$d_pwclass'
13191 d_pwcomment='$d_pwcomment'
13192 d_pwexpire='$d_pwexpire'
13193 d_pwgecos='$d_pwgecos'
13194 d_pwpasswd='$d_pwpasswd'
13195 d_pwquota='$d_pwquota'
13196 d_readdir64='$d_readdir64'
13197 d_readdir='$d_readdir'
13198 d_readlink='$d_readlink'
13200 d_recvmsg='$d_recvmsg'
13201 d_rename='$d_rename'
13202 d_rewinddir='$d_rewinddir'
13204 d_safebcpy='$d_safebcpy'
13205 d_safemcpy='$d_safemcpy'
13206 d_sanemcmp='$d_sanemcmp'
13207 d_sched_yield='$d_sched_yield'
13208 d_scm_rights='$d_scm_rights'
13209 d_seekdir64='$d_seekdir64'
13210 d_seekdir='$d_seekdir'
13211 d_select='$d_select'
13213 d_semctl='$d_semctl'
13214 d_semctl_semid_ds='$d_semctl_semid_ds'
13215 d_semctl_semun='$d_semctl_semun'
13216 d_semget='$d_semget'
13218 d_sendmsg='$d_sendmsg'
13219 d_setegid='$d_setegid'
13220 d_seteuid='$d_seteuid'
13221 d_setgrent='$d_setgrent'
13222 d_setgrps='$d_setgrps'
13223 d_sethent='$d_sethent'
13224 d_setlinebuf='$d_setlinebuf'
13225 d_setlocale='$d_setlocale'
13226 d_setnent='$d_setnent'
13227 d_setpent='$d_setpent'
13228 d_setpgid='$d_setpgid'
13229 d_setpgrp2='$d_setpgrp2'
13230 d_setpgrp='$d_setpgrp'
13231 d_setprior='$d_setprior'
13232 d_setpwent='$d_setpwent'
13233 d_setregid='$d_setregid'
13234 d_setresgid='$d_setresgid'
13235 d_setresuid='$d_setresuid'
13236 d_setreuid='$d_setreuid'
13237 d_setrgid='$d_setrgid'
13238 d_setruid='$d_setruid'
13239 d_setsent='$d_setsent'
13240 d_setsid='$d_setsid'
13241 d_setspent='$d_setspent'
13242 d_setvbuf='$d_setvbuf'
13246 d_shmatprototype='$d_shmatprototype'
13247 d_shmctl='$d_shmctl'
13249 d_shmget='$d_shmget'
13250 d_sigaction='$d_sigaction'
13251 d_sigsetjmp='$d_sigsetjmp'
13252 d_socket='$d_socket'
13253 d_sockpair='$d_sockpair'
13254 d_stat64='$d_stat64'
13255 d_statblks='$d_statblks'
13256 d_statfs='$d_statfs'
13257 d_statfsflags='$d_statfsflags'
13258 d_statvfs='$d_statvfs'
13259 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13260 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13261 d_stdio_stream_array='$d_stdio_stream_array'
13262 d_stdiobase='$d_stdiobase'
13263 d_stdstdio='$d_stdstdio'
13264 d_store64='$d_store64'
13265 d_strchr='$d_strchr'
13266 d_strcoll='$d_strcoll'
13267 d_strctcpy='$d_strctcpy'
13268 d_strerrm='$d_strerrm'
13269 d_strerror='$d_strerror'
13270 d_strtod='$d_strtod'
13271 d_strtol='$d_strtol'
13272 d_strtoul='$d_strtoul'
13273 d_strxfrm='$d_strxfrm'
13274 d_suidsafe='$d_suidsafe'
13275 d_symlink='$d_symlink'
13276 d_syscall='$d_syscall'
13277 d_sysconf='$d_sysconf'
13278 d_sysernlst='$d_sysernlst'
13279 d_syserrlst='$d_syserrlst'
13280 d_system='$d_system'
13281 d_tcgetpgrp='$d_tcgetpgrp'
13282 d_tcsetpgrp='$d_tcsetpgrp'
13283 d_telldir64='$d_telldir64'
13284 d_telldir='$d_telldir'
13285 d_telldirproto='$d_telldirproto'
13288 d_tmpfile64='$d_tmpfile64'
13289 d_truncate64='$d_truncate64'
13290 d_truncate='$d_truncate'
13291 d_tzname='$d_tzname'
13294 d_union_semun='$d_union_semun'
13296 d_void_closedir='$d_void_closedir'
13297 d_voidsig='$d_voidsig'
13298 d_voidtty='$d_voidtty'
13299 d_volatile='$d_volatile'
13300 d_vprintf='$d_vprintf'
13302 d_waitpid='$d_waitpid'
13303 d_wcstombs='$d_wcstombs'
13304 d_wctomb='$d_wctomb'
13305 d_writev='$d_writev'
13308 db_hashtype='$db_hashtype'
13309 db_prefixtype='$db_prefixtype'
13310 defvoidused='$defvoidused'
13311 direntrytype='$direntrytype'
13314 doublesize='$doublesize'
13316 dynamic_ext='$dynamic_ext'
13322 eunicefix='$eunicefix'
13325 extensions='$extensions'
13326 fflushNULL='$fflushNULL'
13327 fflushall='$fflushall'
13329 firstmakefile='$firstmakefile'
13331 fpostype='$fpostype'
13332 freetype='$freetype'
13334 full_csh='$full_csh'
13335 full_sed='$full_sed'
13336 gccversion='$gccversion'
13340 groupcat='$groupcat'
13341 groupstype='$groupstype'
13344 h_sysfile='$h_sysfile'
13348 i_arpainet='$i_arpainet'
13349 i_bsdioctl='$i_bsdioctl'
13352 i_dirent='$i_dirent'
13359 i_inttypes='$i_inttypes'
13360 i_limits='$i_limits'
13361 i_locale='$i_locale'
13362 i_machcthr='$i_machcthr'
13363 i_malloc='$i_malloc'
13365 i_memory='$i_memory'
13366 i_mntent='$i_mntent'
13369 i_neterrno='$i_neterrno'
13370 i_netinettcp='$i_netinettcp'
13373 i_pthread='$i_pthread'
13375 i_rpcsvcdbm='$i_rpcsvcdbm'
13378 i_shadow='$i_shadow'
13380 i_stdarg='$i_stdarg'
13381 i_stddef='$i_stddef'
13382 i_stdlib='$i_stdlib'
13383 i_string='$i_string'
13384 i_sysaccess='$i_sysaccess'
13385 i_sysdir='$i_sysdir'
13386 i_sysfile='$i_sysfile'
13387 i_sysfilio='$i_sysfilio'
13389 i_sysioctl='$i_sysioctl'
13390 i_sysmman='$i_sysmman'
13391 i_sysmount='$i_sysmount'
13392 i_sysndir='$i_sysndir'
13393 i_sysparam='$i_sysparam'
13394 i_sysresrc='$i_sysresrc'
13395 i_syssecrt='$i_syssecrt'
13396 i_sysselct='$i_sysselct'
13397 i_syssockio='$i_syssockio'
13398 i_sysstat='$i_sysstat'
13399 i_sysstatvfs='$i_sysstatvfs'
13400 i_systime='$i_systime'
13401 i_systimek='$i_systimek'
13402 i_systimes='$i_systimes'
13403 i_systypes='$i_systypes'
13404 i_sysuio='$i_sysuio'
13406 i_syswait='$i_syswait'
13407 i_termio='$i_termio'
13408 i_termios='$i_termios'
13410 i_unistd='$i_unistd'
13412 i_values='$i_values'
13413 i_varargs='$i_varargs'
13414 i_varhdr='$i_varhdr'
13416 ignore_versioned_solibs='$ignore_versioned_solibs'
13419 installarchlib='$installarchlib'
13420 installbin='$installbin'
13421 installman1dir='$installman1dir'
13422 installman3dir='$installman3dir'
13423 installprivlib='$installprivlib'
13424 installscript='$installscript'
13425 installsitearch='$installsitearch'
13426 installsitelib='$installsitelib'
13427 installusrbinperl='$installusrbinperl'
13429 known_extensions='$known_extensions'
13433 lddlflags='$lddlflags'
13435 ldlibpthname='$ldlibpthname'
13442 libswanted='$libswanted'
13448 locincpth='$locincpth'
13449 loclibpth='$loclibpth'
13450 longdblsize='$longdblsize'
13451 longlongsize='$longlongsize'
13452 longsize='$longsize'
13456 lseeksize='$lseeksize'
13457 lseektype='$lseektype'
13461 make_set_make='$make_set_make'
13462 mallocobj='$mallocobj'
13463 mallocsrc='$mallocsrc'
13464 malloctype='$malloctype'
13466 man1direxp='$man1direxp'
13469 man3direxp='$man3direxp'
13473 mips_type='$mips_type'
13475 mmaptype='$mmaptype'
13477 modetype='$modetype'
13479 multiarch='$multiarch'
13481 myarchname='$myarchname'
13482 mydomain='$mydomain'
13483 myhostname='$myhostname'
13486 netdb_hlen_type='$netdb_hlen_type'
13487 netdb_host_type='$netdb_host_type'
13488 netdb_name_type='$netdb_name_type'
13489 netdb_net_type='$netdb_net_type'
13492 nm_so_opt='$nm_so_opt'
13493 nonxs_ext='$nonxs_ext'
13495 o_nonblock='$o_nonblock'
13497 old_pthread_create_joinable='$old_pthread_create_joinable'
13498 optimize='$optimize'
13499 orderlib='$orderlib'
13505 patchlevel='$patchlevel'
13506 path_sep='$path_sep'
13508 perladmin='$perladmin'
13509 perlpath='$perlpath'
13511 phostname='$phostname'
13517 prefixexp='$prefixexp'
13519 privlibexp='$privlibexp'
13520 prototype='$prototype'
13522 randbits='$randbits'
13523 randfunc='$randfunc'
13524 randseedtype='$randseedtype'
13526 rd_nodata='$rd_nodata'
13530 sched_yield='$sched_yield'
13531 scriptdir='$scriptdir'
13532 scriptdirexp='$scriptdirexp'
13534 seedfunc='$seedfunc'
13535 selectminbits='$selectminbits'
13536 selecttype='$selecttype'
13537 sendmail='$sendmail'
13540 sharpbang='$sharpbang'
13541 shmattype='$shmattype'
13542 shortsize='$shortsize'
13545 sig_count='$sig_count'
13546 sig_name='$sig_name'
13547 sig_name_init='$sig_name_init'
13549 sig_num_init='$sig_num_init'
13550 signal_t='$signal_t'
13551 sitearch='$sitearch'
13552 sitearchexp='$sitearchexp'
13554 sitelibexp='$sitelibexp'
13555 sizetype='$sizetype'
13560 sockethdr='$sockethdr'
13561 socketlib='$socketlib'
13563 spackage='$spackage'
13564 spitshell='$spitshell'
13567 ssizetype='$ssizetype'
13568 startperl='$startperl'
13570 static_ext='$static_ext'
13572 stdio_base='$stdio_base'
13573 stdio_bufsiz='$stdio_bufsiz'
13574 stdio_cnt='$stdio_cnt'
13575 stdio_filbuf='$stdio_filbuf'
13576 stdio_ptr='$stdio_ptr'
13577 stdio_stream_array='$stdio_stream_array'
13580 subversion='$subversion'
13587 timeincl='$timeincl'
13588 timetype='$timetype'
13596 use64bits='$use64bits'
13598 usemultiplicity='$usemultiplicity'
13599 usemymalloc='$usemymalloc'
13601 useopcode='$useopcode'
13602 useperlio='$useperlio'
13603 useposix='$useposix'
13605 useshrplib='$useshrplib'
13606 usesocks='$usesocks'
13607 usethreads='$usethreads'
13608 usevfork='$usevfork'
13613 voidflags='$voidflags'
13619 : Add in command line options if available
13620 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
13622 : add special variables
13623 $test -f $src/patchlevel.h && \
13624 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
13625 echo "CONFIGDOTSH=true" >>config.sh
13627 : propagate old symbols
13628 if $test -f UU/config.sh; then
13629 <UU/config.sh sort | uniq >UU/oldconfig.sh
13630 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
13631 sort | uniq -u >UU/oldsyms
13632 set X `cat UU/oldsyms`
13638 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
13640 echo "# Variables propagated from previous config.sh file." >>config.sh
13641 for sym in `cat UU/oldsyms`; do
13642 echo " Propagating $hint variable "'$'"$sym..."
13643 eval 'tmp="$'"${sym}"'"'
13645 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
13651 : Finish up by extracting the .SH files
13665 If you'd like to make any changes to the config.sh file before I begin
13666 to configure things, do it as a shell escape now (e.g. !vi config.sh).
13669 rp="Press return or use a shell escape to edit config.sh:"
13674 *) : in case they cannot read
13675 sh 1>&4 -c "$ans";;
13680 : if this fails, just run all the .SH files by hand
13687 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
13694 Now you need to generate make dependencies by running "$make depend".
13695 You might prefer to run it in background: "$make depend > makedepend.out &"
13696 It can take a while, so you might not want to run it right now.
13701 rp="Run $make depend now?"
13705 $make depend && echo "Now you must run a $make."
13708 echo "You must run '$make depend' then '$make'."
13711 elif test -f [Mm]akefile; then
13713 echo "Now you must run a $make."
13718 if $test -f Policy.sh; then
13721 If you compile $package on a different machine or from a different object
13722 directory, copy the Policy.sh file from this object directory to the
13723 new one before you run Configure -- this will help you with most of
13724 the policy defaults.
13728 if $test -f config.msg; then
13729 echo "Hmm. I also noted the following information while running:"
13731 $cat config.msg >&4
13734 $rm -f kit*isdone ark*isdone