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 Sat Feb 20 15:44:46 EET 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 case "$inksh/$needksh" in
118 case "$inksh/$avoidksh" in
124 case "$inksh/$needksh-$avoidksh-" in
127 (I see you are using the Korn shell. Some ksh's blow up on $me,
128 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
134 echo "(Feeding myself to $newsh $reason.)"
136 Configure|*/Configure) exec $newsh $0 "$@";;
137 *) exec $newsh Configure "$@";;
142 : if needed set CDPATH to a harmless value that is not chatty
143 : avoid bash 2.02 problems with empty CDPATH.
147 *bash*) CDPATH='.' ;;
152 : Configure runs within the UU subdirectory
153 test -d UU || mkdir UU
424 d_old_pthread_create_joinable=''
425 old_pthread_create_joinable=''
683 ignore_versioned_solibs=''
808 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
811 : We must find out about Eunice early
813 if test -f /etc/unixtovms; then
814 eunicefix=/etc/unixtovms
816 if test -f /etc/unixtovms.exe; then
817 eunicefix=/etc/unixtovms.exe
821 : Possible local include directories to search.
822 : Set locincpth to "" in a hint file to defeat local include searches.
823 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
824 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
826 : no include file wanted by default
829 : list of known cpp symbols, sorted alphabetically
830 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
831 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
832 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
833 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
834 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
835 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
836 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
837 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
838 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
839 al="$al VMS Xenix286"
840 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
841 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
842 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
843 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
844 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
845 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
846 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
847 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
848 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
849 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
850 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
851 al="$al __SVR4_2__ __UMAXV__"
852 al="$al ____386BSD____ __alpha __alpha__ __amiga"
853 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
854 al="$al __host_mips__"
855 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
856 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
857 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
858 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
859 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
860 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
861 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
862 al="$al __mc88100 __mc88100__ __mips __mips__"
863 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
864 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
865 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
866 al="$al _host_mips _mips _unix"
867 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
868 al="$al apollo ardent att386 att3b"
869 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
870 al="$al cadmus clipper concurrent convex cray ctix"
871 al="$al dmert encore gcos gcx gimpel gould"
872 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
873 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
874 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
875 al="$al i186 i286 i386 i486 i8086"
876 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
877 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
878 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
879 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
880 al="$al mc88000 mc88100 merlin mert mips mvs n16"
881 al="$al ncl_el ncl_mr"
882 al="$al news1500 news1700 news1800 news1900 news3700"
883 al="$al news700 news800 news900 ns16000 ns32000"
884 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
885 al="$al parisc pc532 pdp11 plexus posix pyr"
886 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
887 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
888 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
889 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
890 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
891 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
894 : Trailing extension. Override this in a hint file, if needed.
896 : Extra object files, if any, needed on this platform.
899 : change the next line if compiling for Xenix/286 on Xenix/386
900 xlibpth='/usr/lib/386 /lib/386'
902 : Possible local library directories to search.
903 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
904 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
906 : general looking path for locating libraries
907 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
908 glibpth="$glibpth /lib /usr/lib $xlibpth"
909 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
910 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
912 : Private path used by Configure to find libraries. Its value
913 : is prepended to libpth. This variable takes care of special
914 : machines, like the mips. Usually, it should be empty.
917 : default library list
919 : some systems want to use only the non-versioned libso:s
920 ignore_versioned_solibs=''
921 : full support for void wanted by default
924 : set useposix=false in your hint file to disable the POSIX extension.
926 : set useopcode=false in your hint file to disable the Opcode extension.
928 : set usemultiplicity on the Configure command line to enable multiplicity.
929 : set usethreads on the Configure command line to enable threads.
930 : List of libraries we want.
931 : If anyone needs -lnet, put it in a hint file.
932 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
933 libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
934 libswanted="$libswanted ucb bsd BSD PW x"
935 : We probably want to search /usr/shlib before most other libraries.
936 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
937 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
938 glibpth="/usr/shlib $glibpth"
939 : Do not use vfork unless overridden by a hint file.
942 : Find the basic shell for Bourne shell scripts
946 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
949 if test -f "$xxx"; then
952 : Build up a list and do a single loop so we can 'break' out.
953 pth=`echo $PATH | sed -e "s/$p_/ /g"`
954 for xxx in sh bash ksh pdksh ash; do
956 try="$try ${p}/${xxx}"
960 if test -f "$xxx"; then
963 elif test -f "$xxx.exe"; then
974 $me: Fatal Error: I can't find a Bourne Shell anywhere.
976 Usually it's in /bin/sh. How did you even get this far?
977 Please contact me (Perl Maintainers) at perlbug@perl.com and
978 we'll try to straighten this all out.
984 : see if sh knows # comments
985 if `$sh -c '#' >/dev/null 2>&1`; then
989 test -f $xcat || xcat=/usr/bin/cat
994 if test -s today; then
997 echo "#! $xcat" > try
1001 if test -s today; then
1009 echo "Your $sh doesn't grok # comments--I will strip them later on."
1012 echo "exec grep -v '^[ ]*#'" >spitshell
1014 $eunicefix spitshell
1015 spitshell=`pwd`/spitshell
1017 echo "I presume that if # doesn't work, #! won't work either!"
1022 : figure out how to guarantee sh startup
1024 '') startsh=${sharpbang}${sh} ;;
1036 : echo "Yup, it does."
1038 echo "Hmm... '$startsh' does not guarantee sh startup..."
1039 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1044 : Save command line options in file UU/cmdline.opt for later use in
1045 : generating config.sh.
1046 cat > cmdline.opt <<EOSH
1047 # Configure command line arguments.
1054 cat >>cmdline.opt <<EOSH
1055 config_arg$argn='$arg'
1057 argn=`expr $argn + 1`
1060 : produce awk script to parse command line options
1061 cat >options.awk <<'EOF'
1063 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
1065 len = length(optstr);
1066 for (i = 1; i <= len; i++) {
1067 c = substr(optstr, i, 1);
1068 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1079 if (substr(str, 1, 1) != "-") {
1080 printf("'%s'\n", str);
1084 for (i = 2; i <= len; i++) {
1085 c = substr(str, i, 1);
1087 printf("-%s\n", substr(str, i));
1093 printf("'%s'\n", substr(str, i + 1));
1106 : process the command line options
1107 set X `for arg in "$@"; do echo "X$arg"; done |
1108 sed -e s/X// | awk -f options.awk`
1113 : set up default values
1124 cat >optdef.sh <<EOS
1130 while test $# -gt 0; do
1132 -d) shift; fastread=yes;;
1133 -e) shift; alldone=cont;;
1137 if test -r "$1"; then
1140 echo "$me: cannot read config file $1." >&2
1145 -h) shift; error=true;;
1146 -r) shift; reuseval=true;;
1147 -s) shift; silent=true; realsilent=true;;
1148 -E) shift; alldone=exit;;
1149 -K) shift; knowitall=true;;
1150 -O) shift; override=true;;
1151 -S) shift; silent=true; extractsh=true;;
1156 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1157 echo "$me: ignoring -D $1" >&2
1160 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1161 *) echo "$1='define'" >> optdef.sh;;
1168 *=) echo "$1" >> optdef.sh;;
1170 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1171 echo "$me: ignoring -U $1" >&2
1173 *) echo "$1='undef'" >> optdef.sh;;
1177 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1180 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1188 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1189 [-U symbol] [-U symbol=]
1190 -d : use defaults for all answers.
1191 -e : go on without questioning past the production of config.sh.
1192 -f : specify an alternate default configuration file.
1193 -h : print this help message and exit (with an error status).
1194 -r : reuse C symbols value if possible (skips costly nm extraction).
1195 -s : silent mode, only echoes questions and essential information.
1196 -D : define symbol to have some value:
1197 -D symbol symbol gets the value 'define'
1198 -D symbol=value symbol gets the value 'value'
1199 -E : stop at the end of questions, after having produced config.sh.
1200 -K : do not use unless you know what you are doing.
1201 -O : let -D and -U override definitions from loaded configuration file.
1202 -S : perform variable substitutions on all .SH files (can mix with -f)
1203 -U : undefine symbol:
1204 -U symbol symbol gets the value 'undef'
1205 -U symbol= symbol gets completely empty
1206 -V : print version number and exit (with a zero status).
1213 case "$fastread$alldone" in
1216 if test ! -t 0; then
1217 echo "Say 'sh Configure', not 'sh <Configure'"
1225 true) exec 1>/dev/null;;
1228 : run the defines and the undefines, if any, but leave the file out there...
1234 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1235 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1236 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1237 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1238 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1241 : Some greps do not return status, grrr.
1242 echo "grimblepritz" >grimble
1243 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1245 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1251 : the following should work in any shell
1255 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1256 cat >contains <<'EOSS'
1257 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1262 : Find the path to the source tree
1265 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
1276 if test -f $rsrc/Configure && \
1277 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1279 : found it, so we are ok.
1282 for src in . .. ../.. ../../.. ../../../..; do
1283 if test -f ../$src/Configure && \
1284 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1295 Sorry, I can't seem to locate the source dir for $package. Please start
1296 Configure with an explicit path -- i.e. /some/path/Configure.
1304 echo "Sources for $package found in \"$src\"." >&4
1308 : script used to extract .SH files with variable substitutions
1309 cat >extract <<'EOS'
1311 echo "Doing variable substitutions on .SH files..."
1312 if test -f $src/MANIFEST; then
1313 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1315 echo "(Looking for .SH files under the source directory.)"
1316 set x `(cd $src; find . -name "*.SH" -print)`
1320 0) set x `(cd $src; echo *.SH)`; shift;;
1322 if test ! -f $src/$1; then
1328 while test $name; do
1329 if test ! -d "$name"; then
1330 create="$name $create";
1331 name=`echo $name | sed -e "s|^[^/]*$||"`;
1332 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1337 for file in $create; do
1346 dir=`expr X$file : 'X\(.*\)/'`
1347 file=`expr X$file : 'X.*/\(.*\)'`
1348 (cd $dir && . ./$file)
1358 dir=`expr X$file : 'X\(.*\)/'`
1359 file=`expr X$file : 'X.*/\(.*\)'`
1360 (set x $dir; shift; eval $mkdir_p)
1370 if test -f $src/config_h.SH; then
1371 if test ! -f config.h; then
1372 : oops, they left it out of MANIFEST, probably, so do it anyway.
1378 : extract files and exit if asked to do so
1379 case "$extractsh" in
1381 case "$realsilent" in
1385 case "$config_sh" in
1386 '') config_sh='config.sh';;
1389 echo "Fetching answers from $config_sh..."
1392 test "$override" && . ./optdef.sh
1401 : Eunice requires " " instead of "", can you believe it
1404 echo "Beginning of configuration questions for $package."
1406 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1408 : first determine how to suppress newline on echo command
1410 echo "Checking echo to see how to suppress newlines..."
1411 (echo "hi there\c" ; echo " ") >.echotmp
1412 if $contains c .echotmp >/dev/null 2>&1 ; then
1423 echo $n "The star should be here-->$c"
1427 : Now test for existence of everything in MANIFEST
1429 if test -f $rsrc/MANIFEST; then
1430 echo "First let's make sure your kit is complete. Checking..." >&4
1431 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1434 for filelist in x??; do
1435 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1437 if test -s missing; then
1441 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1443 You have the option of continuing the configuration process, despite the
1444 distinct possibility that your kit is damaged, by typing 'y'es. If you
1445 do, don't blame me if something goes wrong. I advise you to type 'n'o
1446 and contact the author (perlbug@perl.com).
1449 echo $n "Continue? [n] $c" >&4
1453 echo "Continuing..." >&4
1457 echo "ABORTING..." >&4
1462 echo "Looks good..."
1465 echo "There is no MANIFEST file. I hope your kit is complete !"
1470 : Find the appropriate value for a newline for tr
1471 if test -n "$DJGPP"; then
1474 if test X"$trnl" = X; then
1475 case "`echo foo|tr '\n' x 2>/dev/null`" in
1479 if test X"$trnl" = X; then
1480 case "`echo foo|tr '\012' x 2>/dev/null`" in
1481 foox) trnl='\012' ;;
1484 if test X"$trnl" = X; then
1487 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1493 : compute the number of columns on the terminal for proper question formatting
1498 : set up the echo used in my read
1499 myecho="case \"\$xxxm\" in
1500 '') echo $n \"\$rp $c\" >&4;;
1502 '') echo $n \"[\$xxxm] $c\";;
1504 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1506 echo $n \"[\$xxxm] $c\" >&4
1508 echo $n \"\$rp [\$xxxm] $c\" >&4
1514 : now set up to do reads with possible shell escape and default assignment
1520 case "\$fastread" in
1521 yes) case "\$dflt" in
1524 case "\$silent-\$rp" in
1529 *) case "\$silent" in
1530 true) case "\$rp" in
1535 while expr "X\$ans" : "X!" >/dev/null; do
1539 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1547 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1556 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1561 echo "(OK, I'll run with -d after this question.)" >&4
1564 echo "*** Sorry, \$1 not supported yet." >&4
1574 echo "*** Substitution done -- please confirm."
1576 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1581 echo "*** Error -- try again."
1588 case "\$ans\$xxxm\$nostick" in
1600 : create .config dir to save info across Configure sessions
1601 test -d ../.config || mkdir ../.config
1602 cat >../.config/README <<EOF
1603 This directory created by Configure to save information that should
1604 persist across sessions for $package.
1606 You may safely delete it if you wish.
1609 : general instructions
1612 user=`(logname) 2>/dev/null`
1614 '') user=`whoami 2>&1`;;
1616 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1619 rp='Would you like to see the instructions?'
1630 This installation shell script will examine your system and ask you questions
1631 to determine how the perl5 package should be installed. If you get
1632 stuck on a question, you may use a ! shell escape to start a subshell or
1633 execute a command. Many of the questions will have default answers in square
1634 brackets; typing carriage return will give you the default.
1636 On some of the questions which ask for file or directory names you are allowed
1637 to use the ~name construct to specify the login directory belonging to "name",
1638 even if you don't have a shell which knows about that. Questions where this is
1639 allowed will be marked "(~name ok)".
1643 dflt='Type carriage return to continue'
1647 The prompter used in this script allows you to use shell variables and
1648 backticks in your answers. You may use $1, $2, etc... to refer to the words
1649 in the default answer, as if the default line was a set of arguments given to a
1650 script shell. This means you may also use $* to repeat the whole default line,
1651 so you do not have to re-type everything to add something to the default.
1653 Everytime there is a substitution, you will have to confirm. If there is an
1654 error (e.g. an unmatched backtick), the default answer will remain unchanged
1655 and you will be prompted again.
1657 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1658 the questions and use the computed defaults (or the previous answers if there
1659 was already a config.sh file). Type 'Configure -h' for a list of options.
1660 You may also start interactively and then answer '& -d' at any prompt to turn
1661 on the non-interactive behaviour for the remainder of the execution.
1667 Much effort has been expended to ensure that this shell script will run on any
1668 Unix system. If despite that it blows up on yours, your best bet is to edit
1669 Configure and run it again. If you can't run Configure for some reason,
1670 you'll have to generate a config.sh file by hand. Whatever problems you
1671 have, let me (perlbug@perl.com) know how I blew it.
1673 This installation script affects things in two ways:
1675 1) it may do direct variable substitutions on some of the files included
1677 2) it builds a config.h file for inclusion in C programs. You may edit
1678 any of these files as the need arises after running this script.
1680 If you make a mistake on a question, there is no easy way to back up to it
1681 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1682 files. Configure will offer to let you do this before it runs the SH files.
1685 dflt='Type carriage return to continue'
1687 case "$firsttime" in
1688 true) echo $user >>../.config/instruct;;
1692 : find out where common programs are
1694 echo "Locating common programs..." >&4
1707 if test -d \$dir/\$thing; then
1713 for thisthing in \$dir/\$thing; do
1714 : just loop through to pick last item
1716 if test -f \$thisthing; then
1719 elif test -f \$dir/\$thing.exe; then
1720 if test -n "$DJGPP"; then
1721 echo \$dir/\$thing.exe
1723 : on Eunice apparently
1774 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1775 pth="$pth /lib /usr/lib"
1776 for file in $loclist; do
1780 if test -f "$xxx"; then
1783 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1784 xxx=`./loc $file $file $pth`
1787 '') xxx=`./loc $file $file $pth`;;
1788 *) xxx=`./loc $xxx $xxx $pth`;;
1794 echo $file is in $xxx.
1797 echo $file is in $xxx.
1800 echo "I don't know where '$file' is, and my life depends on it." >&4
1801 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1807 echo "Don't worry if any of the following aren't found..."
1809 for file in $trylist; do
1813 if test -f "$xxx"; then
1816 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1817 xxx=`./loc $file $file $pth`
1820 '') xxx=`./loc $file $file $pth`;;
1821 *) xxx=`./loc $xxx $xxx $pth`;;
1827 echo $file is in $xxx.
1830 echo $file is in $xxx.
1833 echo "I don't see $file out there, $say."
1840 echo "Substituting grep for egrep."
1846 echo "Substituting cp for ln."
1852 echo "Hopefully test is built into your sh."
1855 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1856 echo "Using the test built into your sh."
1864 echo "Hopefully echo is built into your sh."
1869 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1870 $echo $n "hi there$c" >foo1
1871 echo $n "hi there$c" >foo2
1872 if cmp foo1 foo2 >/dev/null 2>&1; then
1873 echo "They are compatible. In fact, they may be identical."
1880 They are not compatible! You are probably running ksh on a non-USG system.
1881 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1882 have echo built in and we may have to run some Bourne shell scripts. That
1883 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1886 $echo $n "The star should be here-->$c"
1893 : determine whether symbolic links are supported
1896 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1897 echo "Symbolic links are supported." >&4
1900 echo "Symbolic links are NOT supported." >&4
1905 : see whether [:lower:] and [:upper:] are supported character classes
1907 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1909 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1913 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
1914 # (0xc9 and 0xd1), therefore that is a nice testing point.
1915 if test "X$up" = X -o "X$low" = X; then
1916 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
1922 if test "X$up" = X -o "X$low" = X; then
1923 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
1929 if test "X$up" = X -o "X$low" = X; then
1930 case "`echo IJ | od -x 2>/dev/null`" in
1932 echo "Hey, this might be EBCDIC." >&4
1933 if test "X$up" = X -o "X$low" = X; then
1934 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
1935 ij) up='[A-IJ-RS-Z]'
1940 if test "X$up" = X -o "X$low" = X; then
1941 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
1951 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
1953 echo "Using $up and $low to convert case." >&4
1956 echo "I don't know how to translate letters from upper to lower case." >&4
1957 echo "Your tr is not acting any way I know of." >&4
1961 : set up the translation script tr, must be called with ./tr of course
1965 '[A-Z][a-z]') exec $tr '$up' '$low';;
1966 '[a-z][A-Z]') exec $tr '$low' '$up';;
1973 : Try to determine whether config.sh was made on this system
1974 case "$config_sh" in
1976 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1977 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
1978 # because the A-Z/a-z are not consecutive.
1979 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1980 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
1981 newmyuname="$myuname"
1983 case "$knowitall" in
1985 if test -f ../config.sh; then
1986 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1987 eval "`grep myuname= ../config.sh`"
1989 if test "X$myuname" = "X$newmyuname"; then
1997 : Get old answers from old config file if Configure was run on the
1998 : same system, otherwise use the hints.
2001 if test -f config.sh; then
2003 rp="I see a config.sh file. Shall I use it to set the defaults?"
2006 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2007 *) echo "Fetching default answers from your old config.sh file..." >&4
2015 : Older versions did not always set $sh. Catch re-use of such
2024 if test ! -f config.sh; then
2027 First time through, eh? I have some defaults handy for some systems
2028 that need some extra help getting the Configure answers right:
2031 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2033 : Half the following guesses are probably wrong... If you have better
2034 : tests or hints, please send them to perlbug@perl.com
2035 : The metaconfig authors would also appreciate a copy...
2036 $test -f /irix && osname=irix
2037 $test -f /xenix && osname=sco_xenix
2038 $test -f /dynix && osname=dynix
2039 $test -f /dnix && osname=dnix
2040 $test -f /lynx.os && osname=lynxos
2041 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2042 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2043 $test -f /bin/mips && /bin/mips && osname=mips
2044 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2045 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2046 $test -d /usr/apollo/bin && osname=apollo
2047 $test -f /etc/saf/_sactab && osname=svr4
2048 $test -d /usr/include/minix && osname=minix
2049 if $test -d /MachTen -o -d /MachTen_Folder; then
2051 if $test -x /sbin/version; then
2052 osvers=`/sbin/version | $awk '{print $2}' |
2053 $sed -e 's/[A-Za-z]$//'`
2054 elif $test -x /usr/etc/version; then
2055 osvers=`/usr/etc/version | $awk '{print $2}' |
2056 $sed -e 's/[A-Za-z]$//'`
2061 $test -f /sys/posix.dll &&
2062 $test -f /usr/bin/what &&
2063 set X `/usr/bin/what /sys/posix.dll` &&
2064 $test "$3" = UWIN &&
2067 if $test -f $uname; then
2075 umips) osname=umips ;;
2078 [23]100) osname=mips ;;
2079 next*) osname=next ;;
2081 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2082 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2085 elif $test -f /etc/kconfig; then
2087 if test "$lns" = "ln -s"; then
2089 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2091 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2098 if test -n "$DJGPP"; then
2107 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2109 'not found') osvers="$4"."$3" ;;
2110 '<3240'|'<>3240') osvers=3.2.0 ;;
2111 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2112 '=3250'|'>3250') osvers=3.2.5 ;;
2116 *dc.osx) osname=dcosx
2122 domainos) osname=apollo
2128 dynixptx*) osname=dynixptx
2129 osvers=`echo "$4"|sed 's/^v//'`
2131 freebsd) osname=freebsd
2133 genix) osname=genix ;;
2135 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2151 netbsd*) osname=netbsd
2154 news-os) osvers="$3"
2156 4*) osname=newsos4 ;;
2160 bsd386) osname=bsd386
2163 POSIX-BC | posix-bc ) osname=posix-bc
2166 powerux | power_ux | powermax_os | powermaxos | \
2167 powerunix | power_unix) osname=powerux
2170 next*) osname=next ;;
2171 solaris) osname=solaris
2173 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2180 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2184 titanos) osname=titanos
2193 ultrix) osname=ultrix
2196 osf1|mls+) case "$5" in
2199 osvers=`echo "$3" | sed 's/^[xvt]//'`
2201 hp*) osname=hp_osf1 ;;
2202 mips) osname=mips_osf1 ;;
2211 $2) case "$osname" in
2215 : svr4.x or possibly later
2225 if test -f /stand/boot ; then
2226 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2227 if test -n "$INITPROG" -a -f "$INITPROG"; then
2228 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2229 if test -n "$isesix"; then
2237 *) if test -f /etc/systemid; then
2239 set `echo $3 | $sed 's/\./ /g'` $4
2240 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2242 elif $test -f $src/hints/sco_$1_$2.sh; then
2244 elif $test -f $src/hints/sco_$1.sh; then
2249 '') : Still unknown. Probably a generic Sys V.
2258 *) case "$osname" in
2259 '') : Still unknown. Probably a generic BSD.
2267 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2268 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2269 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2272 $rm -f UU/kernel.what
2273 elif test -d c:/.; then
2280 : Now look for a hint file osname_osvers, unless one has been
2281 : specified already.
2284 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2285 : Also try without trailing minor version numbers.
2286 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2287 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2288 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2289 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2292 *) case "$osvers" in
2295 *) if $test -f $src/hints/$file.sh ; then
2297 elif $test -f $src/hints/$xfile.sh ; then
2299 elif $test -f $src/hints/$xxfile.sh ; then
2301 elif $test -f $src/hints/$xxxfile.sh ; then
2303 elif $test -f $src/hints/$xxxxfile.sh ; then
2305 elif $test -f "$src/hints/${osname}.sh" ; then
2314 if $test -f Policy.sh ; then
2317 none) dflt="Policy" ;;
2318 *) dflt="Policy $dflt" ;;
2323 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2327 if $test -f Policy.sh ; then
2330 There's also a Policy hint file available, which should make the
2331 site-specific (policy) questions easier to answer.
2338 You may give one or more space-separated answers, or "none" if appropriate.
2339 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2340 is a good thing. DO NOT give a wrong version.
2344 rp="Which of these apply, if any?"
2347 for file in $tans; do
2348 if $test X$file = XPolicy -a -f Policy.sh; then
2350 $cat Policy.sh >> UU/config.sh
2351 elif $test -f $src/hints/$file.sh; then
2352 . $src/hints/$file.sh
2353 $cat $src/hints/$file.sh >> UU/config.sh
2354 elif $test X$tans = X -o X$tans = Xnone ; then
2357 : Give one chance to correct a possible typo.
2358 echo "$file.sh does not exist"
2360 rp="hint to use instead?"
2362 for file in $ans; do
2363 if $test -f "$src/hints/$file.sh"; then
2364 . $src/hints/$file.sh
2365 $cat $src/hints/$file.sh >> UU/config.sh
2366 elif $test X$ans = X -o X$ans = Xnone ; then
2369 echo "$file.sh does not exist -- ignored."
2376 : Remember our hint file for later.
2377 if $test -f "$src/hints/$file.sh" ; then
2387 echo "Fetching default answers from $config_sh..." >&4
2391 cp $config_sh config.sh 2>/dev/null
2401 test "$override" && . ./optdef.sh
2402 myuname="$newmyuname"
2404 : Restore computed paths
2405 for file in $loclist $trylist; do
2406 eval $file="\$_$file"
2411 Configure uses the operating system name and version to set some defaults.
2412 The default value is probably right if the name rings a bell. Otherwise,
2413 since spelling matters for me, either accept the default or answer "none"
2420 ''|' '|none) dflt=none ;;
2421 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2424 *) dflt="$osname" ;;
2426 rp="Operating system name?"
2430 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2436 ''|' '|none) dflt=none ;;
2437 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2438 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2440 ''|' ') dflt=none ;;
2445 *) dflt="$osvers" ;;
2447 rp="Operating system version?"
2454 : who configured the system
2455 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2456 cf_by=`(logname) 2>/dev/null`
2459 cf_by=`(whoami) 2>/dev/null`
2461 "") cf_by=unknown ;;
2465 : set up the script used to warn in case of inconsistency
2472 echo "*** WHOA THERE!!! ***" >&4
2473 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2474 rp=" Keep the $hint value?"
2477 y) td=$was; tu=$was;;
2481 : function used to set $1 to $val
2482 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2484 $define$undef) . ./whoa; eval "$var=\$td";;
2485 $undef$define) . ./whoa; eval "$var=\$tu";;
2486 *) eval "$var=$val";;
2491 Perl can be built to take advantage of threads, on some systems.
2492 To do so, Configure must be run with -Dusethreads.
2494 Note that threading is a highly experimental feature, and
2495 some known race conditions still remain. If you choose to try
2496 it, be very sure to not actually deploy it for production
2497 purposes. README.threads has more details, and is required
2498 reading if you enable threads.
2500 case "$usethreads" in
2501 $define|true|[yY]*) dflt='y';;
2504 rp='Build a threading Perl?'
2507 y|Y) val="$define" ;;
2513 case "$d_oldpthreads" in
2514 '') : Configure tests would be welcome here. For now, assume undef.
2516 *) val="$d_oldpthreads" ;;
2522 case "$usethreads" in
2523 "$define"|true|[yY]*)
2524 : Look for a hint-file generated 'call-back-unit'. If the
2525 : user has specified that a threading perl is to be built,
2526 : we may need to set or change some other defaults.
2527 if $test -f usethreads.cbu; then
2531 aix|dec_osf|dos_djgpp|freebsd|hpux|irix|linux|openbsd|os2|solaris|vmesa)
2532 # Known thread-capable platforms.
2536 $osname is not known to support threads.
2537 Please let perlbug@perl.com know how to do that.
2539 Cannot continue, aborting.
2549 Perl can be built so that multiple Perl interpreters can coexist
2550 within the same Perl executable. To do so, Configure must be run with
2553 Normally you do not need this and you should answer no.
2556 case "$usemultiplicity" in
2557 $define|true|[yY]*) dflt='y';;
2560 rp='Build Perl for multiplicity?'
2563 y|Y) val="$define" ;;
2571 Perl can be built to take advantage of explicit 64-bit interfaces,
2572 on some systems. To do so, Configure must be run with -Duse64bits.
2574 If this doesn't make any sense to you, just accept the default 'n'.
2576 case "$use64bits" in
2577 $define|true|[yY]*) dflt='y';;
2580 rp='Try to use explicit 64-bit interfaces, if available?'
2593 case "$archname64" in
2594 '') archname64='' ;; # not a typo
2597 case "$use64bits" in
2598 "$define"|true|[yY]*)
2599 : Look for a hint-file generated 'call-back-unit'. If the
2600 : user has specified that a threading perl is to be built,
2601 : we may need to set or change some other defaults.
2602 if $test -f use64bits.cbu; then
2606 dec_osf|hpux|irix|solaris|unicos)
2607 # Known 64-bit capable platforms.
2611 $osname is not known to support 64-bit interfaces.
2612 Please let perlbug@perl.com know how to do that.
2614 Cannot continue, aborting.
2622 : determine the architecture name
2624 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
2625 tarch=`arch`"-$osname"
2626 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
2627 if uname -m > tmparch 2>&1 ; then
2628 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
2629 -e 's/$/'"-$osname/" tmparch`
2637 case "$myarchname" in
2640 echo "(Your architecture name used to be $myarchname.)"
2647 *) dflt="$archname";;
2649 rp='What is your architecture name'
2652 case "$usethreads" in
2654 echo "Threads selected." >&4
2656 *-thread*) echo "...and architecture name already has -thread." >&4
2658 *) archname="$archname-thread"
2659 echo "...setting architecture name to $archname." >&4
2664 case "$usemultiplicity" in
2666 echo "Multiplicity selected." >&4
2668 *-multi*) echo "...and architecture name already has -multi." >&4
2670 *) archname="$archname-multi"
2671 echo "...setting architecture name to $archname." >&4
2676 case "$use64bits" in
2678 echo "Explicit 64-bitness selected." >&4
2679 case "$archname64" in
2684 *-$archname64*) echo "...and architecture name already has $archname64." >&4
2686 *) archname="$archname-$archname64"
2687 echo "...setting architecture name to $archname." >&4
2697 $define|true) afs=true ;;
2698 $undef|false) afs=false ;;
2699 *) if test -d /afs; then
2707 echo "AFS may be running... I'll be extra cautious then..." >&4
2709 echo "AFS does not seem to be running..." >&4
2712 : decide how portable to be. Allow command line overrides.
2713 case "$d_portable" in
2715 *) d_portable="$define" ;;
2718 : set up shell script to do ~ expansion
2724 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2727 if $test -f /bin/csh; then
2728 /bin/csh -f -c "glob \$1"
2733 name=\`$expr x\$1 : '..\([^/]*\)'\`
2734 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2735 if $test ! -d "\$dir"; then
2737 echo "\$me: can't locate home directory for: \$name" >&2
2742 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2758 : now set up to get a file name
2762 cat <<'EOSC' >>getfile
2775 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
2776 fn=`echo $fn | sed 's/(.*)//'`
2782 loc_file=`expr $fn : '.*:\(.*\)'`
2783 fn=`expr $fn : '\(.*\):.*'`
2791 */*) fullpath=true;;
2800 *e*) exp_file=true;;
2803 *p*) nopath_ok=true;;
2808 *d*) type='Directory';;
2809 *l*) type='Locate';;
2814 Locate) what='File';;
2819 case "$d_portable" in
2827 while test "$type"; do
2832 true) rp="$rp (~name ok)";;
2835 if test -f UU/getfile.ok && \
2836 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2855 value=`UU/filexp $ans`
2858 if test "$ans" != "$value"; then
2859 echo "(That expands to $value on this system.)"
2873 /*) value="$ansexp" ;;
2878 echo "I shall only accept a full path name, as in /bin/ls." >&4
2879 echo "Use a ! shell escape if you wish to check pathnames." >&4
2882 echo "Please give a full path name, starting with slash." >&4
2885 echo "Note that using ~name is ok provided it expands well." >&4
2898 if test -f "$ansexp"; then
2900 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2902 echo "($value is not a plain file, but that's ok.)"
2907 if test -d "$ansexp"; then
2912 if test -d "$ansexp"; then
2913 echo "(Looking for $loc_file in directory $value.)"
2914 value="$value/$loc_file"
2915 ansexp="$ansexp/$loc_file"
2917 if test -f "$ansexp"; then
2920 case "$nopath_ok" in
2921 true) case "$value" in
2923 *) echo "Assuming $value will be in people's path."
2939 if test "$fastread" = yes; then
2944 rp="$what $value doesn't exist. Use that name anyway?"
2965 : determine root of directory hierarchy where package will be installed.
2968 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
2976 By default, $package will be installed in $dflt/bin, manual
2977 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2978 all installation directories. Typically set to /usr/local, but you
2979 may choose /usr if you wish to install $package among your system
2980 binaries. If you wish to have binaries under /bin but manual pages
2981 under /usr/local/man, that's ok: you will be prompted separately
2982 for each of the installation directories, the prefix being only used
2983 to set the defaults.
2987 rp='Installation prefix to use?'
2995 *) oldprefix="$prefix";;
3002 : set the prefixit variable, to compute a suitable default value
3003 prefixit='case "$3" in
3005 case "$oldprefix" in
3006 "") eval "$1=\"\$$2\"";;
3013 ""|" ") eval "$1=\"\$$2\"";;
3019 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3021 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3022 /*-$oldprefix/*|\~*-$oldprefix/*)
3023 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3024 *) eval "$1=\"\$$2\"";;
3028 : set the base revision
3031 : get the patchlevel
3033 echo "Getting the current patchlevel..." >&4
3034 if $test -r $rsrc/patchlevel.h;then
3035 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3036 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3041 $echo $n "(You have $package" $c
3044 *) $echo $n " $baserev" $c ;;
3046 $echo $n " patchlevel $patchlevel" $c
3047 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3050 if test 0 -eq "$subversion"; then
3051 version=`LC_ALL=C; export LC_ALL; \
3052 echo $baserev $patchlevel | \
3053 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3055 version=`LC_ALL=C; export LC_ALL; \
3056 echo $baserev $patchlevel $subversion | \
3057 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3059 : Figure out perl API version. Perhaps this should be in patchlevel.h
3060 if test "$subversion" -lt 50; then
3061 apiversion=`LC_ALL=C; export LC_ALL; \
3062 LANGUAGE=C; export LANGUAGE; \
3063 echo $baserev $patchlevel | \
3064 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3066 apiversion="$version"
3069 : determine where private library files go
3070 : Usual default is /usr/local/lib/perl5/$version.
3071 : Also allow things like /opt/perl/lib/$version, since
3072 : /opt/perl/lib/perl5... would be redundant.
3074 *perl*) set dflt privlib lib/$version ;;
3075 *) set dflt privlib lib/$package/$version ;;
3080 There are some auxiliary files for $package that need to be put into a
3081 private library directory that is accessible by everyone.
3085 rp='Pathname where the private library files will reside?'
3087 if $test "X$privlibexp" != "X$ansexp"; then
3091 privlibexp="$ansexp"
3095 Since you are running AFS, I need to distinguish the directory in which
3096 private files reside from the directory in which they are installed (and from
3097 which they are presumably copied to the former directory by occult means).
3100 case "$installprivlib" in
3101 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
3102 *) dflt="$installprivlib";;
3105 rp='Where will private files be installed?'
3107 installprivlib="$ans"
3109 installprivlib="$privlibexp"
3112 : set the prefixup variable, to restore leading tilda escape
3113 prefixup='case "$prefixexp" in
3115 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3118 : determine where public architecture dependent libraries go
3121 : privlib default is /usr/local/lib/$package/$version
3122 : archlib default is /usr/local/lib/$package/$version/$archname
3123 : privlib may have an optional trailing /share.
3124 tdflt=`echo $privlib | $sed 's,/share$,,'`
3125 tdflt=$tdflt/$archname
3134 $spackage contains architecture-dependent library files. If you are
3135 sharing libraries in a heterogeneous environment, you might store
3136 these files in a separate location. Otherwise, you can just include
3137 them with the rest of the public library files.
3141 rp='Where do you want to put the public architecture-dependent libraries?'
3144 archlibexp="$ansexp"
3149 Since you are running AFS, I need to distinguish the directory in
3150 which architecture-dependent library files reside from the directory
3151 in which they are installed (and from which they are presumably copied
3152 to the former directory by occult means).
3155 case "$installarchlib" in
3156 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
3157 *) dflt="$installarchlib";;
3160 rp='Where will architecture-dependent library files be installed?'
3162 installarchlib="$ans"
3164 installarchlib="$archlibexp"
3166 if $test X"$archlib" = X"$privlib"; then
3172 : make some quick guesses about what we are up against
3174 $echo $n "Hmm... $c"
3184 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3185 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3187 echo "Looks kind of like an OSF/1 system, but we'll see..."
3189 elif test `echo abc | tr a-z A-Z` = Abc ; then
3190 xxx=`./loc addbib blurfl $pth`
3191 if $test -f $xxx; then
3192 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3196 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3197 echo "Looks kind of like an extended USG system, but we'll see..."
3199 echo "Looks kind of like a USG system, but we'll see..."
3203 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3204 echo "Looks kind of like a BSD system, but we'll see..."
3208 echo "Looks kind of like a Version 7 system, but we'll see..."
3211 case "$eunicefix" in
3214 There is, however, a strange, musty smell in the air that reminds me of
3215 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3219 : it so happens the Eunice I know will not run shell scripts in Unix format
3223 echo "Congratulations. You aren't running Eunice."
3227 : Detect OS2. The p_ variable is set above in the Head.U unit.
3232 I have the feeling something is not exactly right, however...don't tell me...
3233 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3238 if test -f /xenix; then
3239 echo "Actually, this looks more like a XENIX system..."
3244 echo "It's not Xenix..."
3249 if test -f /venix; then
3250 echo "Actually, this looks more like a VENIX system..."
3257 echo "Nor is it Venix..."
3260 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3261 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3264 : see if setuid scripts can be secure
3267 Some kernels have a bug that prevents setuid #! scripts from being
3268 secure. Some sites have disabled setuid #! scripts because of this.
3270 First let's decide if your kernel supports secure setuid #! scripts.
3271 (If setuid #! scripts would be secure but have been disabled anyway,
3272 don't say that they are secure if asked.)
3277 if $test -d /dev/fd; then
3278 echo "#!$ls" >reflect
3279 chmod +x,u+s reflect
3280 ./reflect >flect 2>&1
3281 if $contains "/dev/fd" flect >/dev/null; then
3282 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3286 If you are not sure if they are secure, I can check but I'll need a
3287 username and password different from the one you are using right now.
3288 If you don't have such a username or don't want me to test, simply
3292 rp='Other username to test security of setuid scripts with?'
3297 case "$d_suidsafe" in
3298 '') echo "I'll assume setuid scripts are *not* secure." >&4
3301 echo "Well, the $hint value is *not* secure." >&4
3303 *) echo "Well, the $hint value *is* secure." >&4
3308 $rm -f reflect flect
3309 echo "#!$ls" >reflect
3310 chmod +x,u+s reflect
3313 echo '"su" will (probably) prompt you for '"$ans's password."
3314 su $ans -c './reflect >flect'
3315 if $contains "/dev/fd" flect >/dev/null; then
3316 echo "Okay, it looks like setuid scripts are secure." >&4
3319 echo "I don't think setuid scripts are secure." >&4
3324 rp='Does your kernel have *secure* setuid scripts?'
3327 [yY]*) val="$define";;
3332 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3333 echo "(That's for file descriptors, not floppy disks.)"
3339 $rm -f reflect flect
3341 : now see if they want to do setuid emulation
3344 case "$d_suidsafe" in
3347 echo "No need to emulate SUID scripts since they are secure here." >& 4
3351 Some systems have disabled setuid scripts, especially systems where
3352 setuid scripts cannot be secure. On systems where setuid scripts have
3353 been disabled, the setuid/setgid bits on scripts are currently
3354 useless. It is possible for $package to detect those bits and emulate
3355 setuid/setgid in a secure fashion. This emulation will only work if
3356 setuid scripts have been disabled in your kernel.
3360 "$define") dflt=y ;;
3363 rp="Do you want to do setuid/setgid emulation?"
3366 [yY]*) val="$define";;
3374 : determine where manual pages are on this system
3378 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
3379 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
3380 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
3381 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
3382 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
3383 sysman=`./loc . /usr/man/man1 $syspath`
3386 if $test -d "$sysman"; then
3387 echo "System manual is in $sysman." >&4
3389 echo "Could not find manual pages in source form." >&4
3392 : see what memory models we can support
3395 $cat >pdp11.c <<'EOP'
3404 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
3405 if $test -f pdp11 && ./pdp11 2>/dev/null; then
3406 dflt='unsplit split'
3408 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3411 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3416 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3419 if $test -d /lib/large || $test -d /usr/lib/large; then
3422 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3431 Some systems have different model sizes. On most systems they are called
3432 small, medium, large, and huge. On the PDP11 they are called unsplit and
3433 split. If your system doesn't support different memory models, say "none".
3434 If you wish to force everything to one memory model, say "none" here and
3435 put the appropriate flags later when it asks you for other cc and ld flags.
3436 Venix systems may wish to put "none" and let the compiler figure things out.
3437 (In the following question multiple model names should be space separated.)
3439 The default for most systems is "none".
3442 rp="Which memory models are supported?"
3457 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3458 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3465 rp="What flag indicates separate I and D space?"
3473 *large*|*small*|*medium*|*huge*)
3480 rp="What flag indicates large model?"
3490 *huge*) case "$huge" in
3494 rp="What flag indicates huge model?"
3504 *medium*) case "$medium" in
3508 rp="What flag indicates medium model?"
3515 *) medium="$large";;
3518 *small*) case "$small" in
3522 rp="What flag indicates small model?"
3533 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3536 $rm -f pdp11.* pdp11
3538 : see if we need a special compiler
3546 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3547 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3561 On some older systems the default C compiler will not resolve multiple global
3562 references that happen to have the same name. On some such systems the "Mcc"
3563 command may be used to force these to be resolved. On other systems a "cc -M"
3564 command is required. (Note that the -M flag on other systems indicates a
3565 memory model to use!) If you have the Gnu C compiler, you might wish to use
3571 rp="Use which C compiler?"
3579 rp="Use which C compiler?"
3583 : Look for a hint-file generated 'call-back-unit'. Now that the
3584 : user has specified the compiler, we may need to set or change some
3586 if $test -f cc.cbu; then
3590 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3591 $cat >gccvers.c <<EOM
3596 printf("%s\n", __VERSION__);
3598 printf("%s\n", "1");
3604 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3605 gccversion=`./gccvers`
3606 case "$gccversion" in
3607 '') echo "You are not using GNU cc." ;;
3608 *) echo "You are using GNU cc $gccversion." ;;
3612 echo "*** WHOA THERE!!! ***" >&4
3613 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3614 case "$knowitall" in
3616 echo " You'd better start hunting for one and let me know about it." >&4
3622 case "$gccversion" in
3623 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3626 : What should the include directory be ?
3628 $echo $n "Hmm... $c"
3632 if $test -f /bin/mips && /bin/mips; then
3633 echo "Looks like a MIPS system..."
3634 $cat >usr.c <<'EOCP'
3635 #ifdef SYSTYPE_BSD43
3639 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3640 dflt='/bsd43/usr/include'
3644 mips_type='System V'
3646 $rm -f usr.c usr.out
3647 echo "and you're compiling with the $mips_type compiler and libraries."
3651 echo "Doesn't look like a MIPS system."
3661 case "$xxx_prompt" in
3664 rp='Where are the include files you want to use?'
3672 : see how we invoke the C preprocessor
3674 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3675 cat <<'EOT' >testcpp.c
3681 if test ! -f cppstdin; then
3682 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3684 echo "Keeping your $hint cppstdin wrapper."
3687 wrapper=`pwd`/cppstdin
3691 if $test "X$cppstdin" != "X" && \
3692 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3693 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3695 echo "You used to use $cppstdin $cppminus so we'll use that again."
3697 '') echo "But let's see if we can live without a wrapper..." ;;
3699 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3700 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3702 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3705 echo "(However, $cpprun $cpplast does not work, let's see...)"
3713 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3720 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3721 $cc -E <testcpp.c >testcpp.out 2>&1; \
3722 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3723 echo "Yup, it does."
3726 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3727 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3728 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3729 echo "Yup, it does."
3732 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3733 $cc -P <testcpp.c >testcpp.out 2>&1; \
3734 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3735 echo "Yipee, that works!"
3738 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3739 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3740 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3741 echo "At long last!"
3744 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3745 $cpp <testcpp.c >testcpp.out 2>&1; \
3746 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3750 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3751 $cpp - <testcpp.c >testcpp.out 2>&1; \
3752 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3753 echo "Hooray, it works! I was beginning to wonder."
3756 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3757 $wrapper <testcpp.c >testcpp.out 2>&1; \
3758 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3764 rp="No dice. I can't find a C preprocessor. Name one:"
3768 $x_cpp <testcpp.c >testcpp.out 2>&1
3769 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3770 echo "OK, that will do." >&4
3772 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3787 echo "Perhaps can we force $cc -E using a wrapper..."
3788 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3789 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3795 echo "Nope, we'll have to live without it..."
3809 "$wrapper"|'cppstdin') ;;
3810 *) $rm -f $wrapper;;
3812 $rm -f testcpp.c testcpp.out
3814 : Set private lib path
3817 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3822 '') dlist="$loclibpth $plibpth $glibpth";;
3823 *) dlist="$libpth";;
3826 : Now check and see which directories actually exist, avoiding duplicates
3830 if $test -d $xxx; then
3833 *) libpth="$libpth $xxx";;
3839 Some systems have incompatible or broken versions of libraries. Among
3840 the directories listed in the question below, please remove any you
3841 know not to be holding relevant libraries, and add any that are needed.
3842 Say "none" for none.
3853 rp="Directories to use for library searches?"
3860 : compute shared library extension
3863 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3873 On some systems, shared libraries may be available. Answer 'none' if
3874 you want to suppress searching of shared libraries for the remaining
3875 of this configuration.
3878 rp='What is the file extension used for shared libraries?'
3882 : Define several unixisms.
3883 : Hints files or command line option can be used to override them.
3884 : The convoluted testing is in case hints files set either the old
3887 '') case "$exe_ext" in
3889 *) _exe="$exe_ext" ;;
3894 '') case "$lib_ext" in
3901 '') case "$obj_ext" in
3908 '') case "$path_sep" in
3919 : Which makefile gets called first. This is used by make depend.
3920 case "$firstmakefile" in
3921 '') firstmakefile='makefile';;
3924 : Looking for optional libraries
3926 echo "Checking for optional libraries..." >&4
3931 case "$libswanted" in
3932 '') libswanted='c_s';;
3934 for thislib in $libswanted; do
3936 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3937 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3938 echo "Found -l$thislib (shared)."
3941 *) dflt="$dflt -l$thislib";;
3943 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3944 echo "Found -l$thislib (shared)."
3947 *) dflt="$dflt -l$thislib";;
3949 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3950 echo "Found -l$thislib."
3953 *) dflt="$dflt -l$thislib";;
3955 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3956 echo "Found -l$thislib."
3959 *) dflt="$dflt -l$thislib";;
3961 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3962 echo "Found -l${thislib}_s."
3965 *) dflt="$dflt -l${thislib}_s";;
3967 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3968 echo "Found -l$thislib."
3971 *) dflt="$dflt -l$thislib";;
3974 echo "No -l$thislib."
3985 ' '|'') dflt='none';;
3990 Some versions of Unix support shared libraries, which make executables smaller
3991 but make load time slightly longer.
3993 On some systems, mostly System V Release 3's, the shared library is included
3994 by putting the option "-lc_s" as the last thing on the cc command line when
3995 linking. Other systems use shared libraries by default. There may be other
3996 libraries needed to compile $package on your machine as well. If your system
3997 needs the "-lc_s" option, include it here. Include any other special libraries
3998 here as well. Say "none" for none.
4002 rp="Any additional libraries?"
4009 : determine optimize, if desired, or use for debug flag also
4011 ' '|$undef) dflt='none';;
4013 *) dflt="$optimize";;
4017 Some C compilers have problems with their optimizers. By default, $package
4018 compiles with the -O flag to use the optimizer. Alternately, you might want
4019 to use the symbolic debugger, which uses the -g flag (on traditional Unix
4020 systems). Either flag can be specified here. To use neither flag, specify
4024 rp="What optimizer/debugger flag should be used?"
4028 'none') optimize=" ";;
4032 : We will not override a previous value, but we might want to
4033 : augment a hint file
4036 case "$gccversion" in
4037 1*) dflt='-fpcc-struct-return' ;;
4040 *-g*) dflt="$dflt -DDEBUGGING";;
4042 case "$gccversion" in
4043 2*) if test -d /etc/conf/kconfig.d &&
4044 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4053 case "$mips_type" in
4054 *BSD*|'') inclwanted="$locincpth $usrinc";;
4055 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4057 for thisincl in $inclwanted; do
4058 if $test -d $thisincl; then
4059 if $test x$thisincl != x$usrinc; then
4062 *) dflt="$dflt -I$thisincl";;
4068 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4070 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4078 *) dflt="$dflt -D$2";;
4082 set signal.h LANGUAGE_C; eval $inctest
4085 none|recommended) dflt="$ccflags $dflt" ;;
4086 *) dflt="$ccflags";;
4094 Your C compiler may want other flags. For this question you should include
4095 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4096 but you should NOT include libraries or ld flags like -lwhatever. If you
4097 want $package to honor its debug switch, you should include -DDEBUGGING here.
4098 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4100 To use no flags, specify the word "none".
4106 rp="Any additional cc flags?"
4113 : the following weeds options from ccflags that are of no interest to cpp
4115 case "$gccversion" in
4116 1*) cppflags="$cppflags -D__GNUC__"
4118 case "$mips_type" in
4120 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4126 echo "Let me guess what the preprocessor flags are..." >&4
4140 *) ftry="$previous $flag";;
4142 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4143 >cpp1.out 2>/dev/null && \
4144 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4145 >cpp2.out 2>/dev/null && \
4146 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4147 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4149 cppflags="$cppflags $ftry"
4159 *-*) echo "They appear to be: $cppflags";;
4161 $rm -f cpp.c cpp?.out
4165 : flags used in final linking phase
4167 '') if ./venix; then
4173 *-posix*) dflt="$dflt -posix" ;;
4176 *) dflt="$ldflags";;
4179 : Try to guess additional flags to pick up local libraries.
4180 for thislibdir in $libpth; do
4181 case " $loclibpth " in
4184 *"-L$thislibdir "*) ;;
4185 *) dflt="$dflt -L$thislibdir" ;;
4197 Your C linker may need flags. For this question you should
4198 include -L/whatever and any other flags used by the C linker, but you
4199 should NOT include libraries like -lwhatever.
4201 Make sure you include the appropriate -L/path flags if your C linker
4202 does not normally search all of the directories you specified above,
4205 To use no flags, specify the word "none".
4209 rp="Any additional ld flags (NOT including libraries)?"
4215 rmlist="$rmlist pdp11"
4219 echo "Checking your choice of C compiler and flags for coherency..." >&4
4220 $cat > try.c <<'EOF'
4222 int main() { printf("Ok\n"); exit(0); }
4224 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4226 $cat >try.msg <<'EOM'
4227 I've tried to compile and run the following simple program:
4230 $cat try.c >> try.msg
4232 $cat >> try.msg <<EOM
4239 and I got the following output:
4243 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4244 if sh -c './try' >>try.msg 2>&1; then
4248 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4251 cat >> try.msg <<'EOQS'
4252 If $libs contains -lsfio, and sfio is mis-configured, then it
4253 sometimes (apparently) runs and exits with a 0 status, but with no
4254 output! It may have to do with sfio's use of _exit vs. exit.
4257 rp="You have a big problem. Shall I abort Configure"
4264 echo "The program compiled OK, but exited with status $?." >>try.msg
4265 rp="You have a problem. Shall I abort Configure"
4269 echo "I can't compile the test program." >>try.msg
4270 rp="You have a BIG problem. Shall I abort Configure"
4276 case "$knowitall" in
4278 echo "(The supplied flags or libraries might be incorrect.)"
4286 *) echo "Ok. Stopping Configure." >&4
4291 n) echo "OK, that should do.";;
4293 $rm -f try try.* core
4295 : determine filename position in cpp output
4297 echo "Computing filename position in cpp output for #include directives..." >&4
4298 echo '#include <stdio.h>' > foo.c
4301 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4302 $grep '^[ ]*#.*stdio\.h' | \
4303 while read cline; do
4306 while $test \$# -gt 0; do
4307 if $test -r \`echo \$1 | $tr -d '"'\`; then
4312 pos=\`expr \$pos + 1\`
4324 *) pos="${fieldn}th";;
4326 echo "Your cpp writes the filename in the $pos field of the line."
4328 : locate header file
4333 if test -f $usrinc/\$wanted; then
4334 echo "$usrinc/\$wanted"
4337 awkprg='{ print \$$fieldn }'
4338 echo "#include <\$wanted>" > foo\$\$.c
4339 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4340 $grep "^[ ]*#.*\$wanted" | \
4341 while read cline; do
4342 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4344 */\$wanted) echo "\$name"; exit 0;;
4355 : define an alternate in-header-list? function
4356 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4357 cont=true; xxf="echo \"<\$1> found.\" >&4";
4358 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4359 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4361 case $# in 4) instead=instead;; *) instead="at last";; esac;
4362 while $test "$cont"; do
4364 var=$2; eval "was=\$$2";
4365 if $test "$xxx" && $test -r "$xxx";
4367 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4370 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4371 set $yyy; shift; shift; yyy=$@;
4372 case $# in 0) cont="";;
4373 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4374 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4375 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4376 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4380 do set $yyy; var=$2; eval "was=\$$2";
4381 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4382 set $yyy; shift; shift; yyy=$@;
4385 : see if this is a malloc.h system
4386 set malloc.h i_malloc
4389 : see if stdlib is available
4390 set stdlib.h i_stdlib
4393 : determine which malloc to compile in
4395 case "$usemymalloc" in
4396 ''|[yY]*|true|$define) dflt='y' ;;
4399 rp="Do you wish to attempt to use the malloc that comes with $package?"
4405 mallocsrc='malloc.c'
4406 mallocobj="malloc$_o"
4407 d_mymalloc="$define"
4410 : Remove malloc from list of libraries to use
4411 echo "Removing unneeded -lmalloc from library list" >&4
4412 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4415 echo "libs = $libs" >&4
4427 : compute the return types of malloc and free
4429 $cat >malloc.c <<END
4433 #include <sys/types.h>
4447 case "$malloctype" in
4449 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4456 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4460 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4467 echo "Your system uses $freetype free(), it would seem." >&4
4469 : Cruising for prototypes
4471 echo "Checking out function prototypes..." >&4
4472 $cat >prototype.c <<'EOCP'
4473 int main(int argc, char *argv[]) {
4476 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4477 echo "Your C compiler appears to support function prototypes."
4480 echo "Your C compiler doesn't seem to understand function prototypes."
4487 case "$prototype" in
4489 *) ansi2knr='ansi2knr'
4494 This version of $package can only be compiled by a compiler that
4495 understands function prototypes. Unfortunately, your C compiler
4497 doesn't seem to understand them. Sorry about that.
4499 If GNU cc is available for your system, perhaps you could try that instead.
4501 Eventually, we hope to support building Perl with pre-ANSI compilers.
4502 If you would like to help in that effort, please contact <perlbug@perl.org>.
4504 Aborting Configure now.
4510 : determine where public executables go
4515 rp='Pathname where the public executables will reside?'
4517 if $test "X$ansexp" != "X$binexp"; then
4525 Since you are running AFS, I need to distinguish the directory in which
4526 executables reside from the directory in which they are installed (and from
4527 which they are presumably copied to the former directory by occult means).
4530 case "$installbin" in
4531 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
4532 *) dflt="$installbin";;
4535 rp='Where will public executables be installed?'
4539 installbin="$binexp"
4542 : determine whether to install perl also as /usr/bin/perl
4545 if test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4547 Many scripts expect to perl to be installed as /usr/bin/perl.
4548 I can install the perl you are about to compile also as /usr/bin/perl
4549 (in addition to $installbin/perl).
4551 case "$installusrbinperl" in
4552 "$undef"|[nN]*) dflt='n';;
4555 rp="Do you want to install perl as /usr/bin/perl?"
4558 [yY]*) val="$define";;
4564 set installusrbinperl
4567 : define a shorthand compile call
4571 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4572 : define a shorthand compile call for compilations that should be ok.
4576 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4579 echo "Checking for GNU C Library..." >&4
4580 cat >gnulibc.c <<EOM
4592 if eval $compile_ok && ./gnulibc; then
4594 echo "You are using the GNU C Library"
4597 echo "You are not using the GNU C Library"
4603 : see if nm is to be used to determine whether a symbol is defined or not
4607 case "$d_gnulibc" in
4610 echo "nm probably won't work on the GNU C Library." >&4
4616 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4618 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4619 echo "'nm' won't be sufficient on this sytem." >&4
4625 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4626 if $test $dflt -gt 20; then
4636 true|$define) dflt=y;;
4643 I can use $nm to extract the symbols from your C libraries. This
4644 is a time consuming task which may generate huge output on the disk (up
4645 to 3 megabytes) but that should make the symbols extraction faster. The
4646 alternative is to skip the 'nm' extraction part and to compile a small
4647 test program instead to determine whether each symbol is present. If
4648 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4649 this may be the best solution.
4651 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4654 rp="Shall I use $nm to extract C symbols from the libraries?"
4657 [Nn]*) usenm=false;;
4666 : nm options which may be necessary
4668 '') if $test -f /mach_boot; then
4670 elif $test -d /usr/ccs/lib; then
4671 nm_opt='-p' # Solaris (and SunOS?)
4672 elif $test -f /dgux; then
4674 elif $test -f /lib64/rld; then
4675 nm_opt='-p' # 64-bit Irix
4681 : nm options which may be necessary for shared libraries but illegal
4682 : for archive libraries. Thank you, Linux.
4683 case "$nm_so_opt" in
4684 '') case "$myuname" in
4686 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4687 nm_so_opt='--dynamic'
4696 : get list of predefined functions in a handy place
4701 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4708 *) for thislib in $libs; do
4711 : Handle C library specially below.
4714 thislib=`echo $thislib | $sed -e 's/^-l//'`
4715 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4717 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4719 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4721 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4723 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4725 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4727 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4732 libnames="$libnames $try"
4734 *) libnames="$libnames $thislib" ;;
4743 for xxx in $libpth; do
4744 $test -r $1 || set $xxx/libc.$so
4745 : The messy sed command sorts on library version numbers.
4747 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4748 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4750 s/[0-9][0-9]*/0000&/g
4751 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4754 sort | $sed -e 's/^.* //'`
4757 $test -r $1 || set /usr/ccs/lib/libc.$so
4758 $test -r $1 || set /lib/libsys_s$_a
4764 if $test -r "$1"; then
4765 echo "Your (shared) C library seems to be in $1."
4767 elif $test -r /lib/libc && $test -r /lib/clib; then
4768 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4770 libc='/lib/clib /lib/libc'
4771 if $test -r /lib/syslib; then
4772 echo "(Your math library is in /lib/syslib.)"
4773 libc="$libc /lib/syslib"
4775 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4776 echo "Your C library seems to be in $libc, as you said before."
4777 elif $test -r $incpath/usr/lib/libc$_a; then
4778 libc=$incpath/usr/lib/libc$_a;
4779 echo "Your C library seems to be in $libc. That's fine."
4780 elif $test -r /lib/libc$_a; then
4782 echo "Your C library seems to be in $libc. You're normal."
4784 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4786 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4787 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4788 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4790 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4792 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4795 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4797 if $test -r "$tans"; then
4798 echo "Your C library seems to be in $tans, of all places."
4804 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4808 If the guess above is wrong (which it might be if you're using a strange
4809 compiler, or your machine supports multiple models), you can override it here.
4814 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
4816 I can't seem to find your C library. I've looked in the following places:
4819 $sed 's/^/ /' libpath
4822 None of these seems to contain your C library. I need to get its name...
4827 rp='Where is your C library?'
4832 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
4833 set X `cat libnames`
4836 case $# in 1) xxx=file; esac
4837 echo "Extracting names from the following $xxx for later perusal:" >&4
4839 $sed 's/^/ /' libnames >&4
4841 $echo $n "This may take a while...$c" >&4
4845 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4846 *) $nm $nm_opt $file 2>/dev/null;;
4851 $grep fprintf libc.tmp > libc.ptf
4852 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4853 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4855 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4857 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4859 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4861 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4863 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4865 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4867 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4869 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4871 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4873 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4875 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4877 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4879 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4880 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4882 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4884 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4886 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4888 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4890 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4892 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4894 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4896 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4898 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4900 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4902 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4904 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4906 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4908 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
4910 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4913 $nm -p $* 2>/dev/null >libc.tmp
4914 $grep fprintf libc.tmp > libc.ptf
4915 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4916 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4922 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4924 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4925 for thisname in $libnames $libc; do
4926 $ar t $thisname >>libc.tmp
4928 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4930 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4931 # Repeat libc to extract forwarders to DLL entries too
4932 for thisname in $libnames $libc; do
4933 $ar tv $thisname >>libc.tmp
4934 # Revision 50 of EMX has bug in $ar.
4935 # it will not extract forwarders to DLL entries
4936 # Use emximp which will extract exactly them.
4937 emximp -o tmp.imp $thisname \
4939 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
4940 < tmp.imp >>libc.tmp
4943 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
4946 echo "$ar didn't seem to work right." >&4
4947 echo "Maybe this is a Cray...trying bld instead..." >&4
4948 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
4950 for thisname in $libnames; do
4952 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
4953 $ar t $thisname >>libc.tmp
4957 echo "That didn't work either. Giving up." >&4
4964 if $test -f /lib/syscalls.exp; then
4966 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4967 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
4971 $rm -f libnames libpath
4973 : see if dld is available
4977 : is a C symbol defined?
4980 -v) tf=libc.tmp; tc=""; tdc="";;
4981 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4982 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4985 case "$reuseval-$4" in
4987 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4993 if $contains $tlook $tf >/dev/null 2>&1;
4998 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4999 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5007 $define) tval=true;;
5013 : define an is-in-libc? function
5014 inlibc='echo " "; td=$define; tu=$undef;
5015 sym=$1; var=$2; eval "was=\$$2";
5017 case "$reuseval$was" in
5027 echo "$sym() found." >&4;
5028 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5030 echo "$sym() NOT found." >&4;
5031 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5035 $define) echo "$sym() found." >&4;;
5036 *) echo "$sym() NOT found." >&4;;
5040 : see if dlopen exists
5047 : determine which dynamic loading, if any, to compile in
5049 dldir="ext/DynaLoader"
5062 $define) dflt='y' ;;
5065 $define) dflt='y' ;;
5067 : Does a dl_xxx.xs file exist for this operating system
5068 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5071 rp="Do you wish to use dynamic loading?"
5078 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5079 dflt="$dldir/dl_${osname}.xs"
5080 elif $test "$d_dlopen" = "$define" ; then
5081 dflt="$dldir/dl_dlopen.xs"
5082 elif $test "$i_dld" = "$define" ; then
5083 dflt="$dldir/dl_dld.xs"
5088 *) dflt="$dldir/$dlsrc"
5091 echo "The following dynamic loading files are available:"
5092 : Can not go over to $dldir because getfile has path hard-coded in.
5093 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5094 rp="Source file to use for dynamic loading"
5096 # XXX This getfile call will fail the existence check if you try
5097 # building away from $src (this is not supported yet).
5101 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5105 Some systems may require passing special flags to $cc -c to
5106 compile modules that will be used to create a shared library.
5107 To use no flags, say "none".
5110 case "$cccdlflags" in
5111 '') case "$gccversion" in
5112 '') case "$osname" in
5114 next) dflt='none' ;;
5115 irix*) dflt='-KPIC' ;;
5116 svr4*|esix*|solaris) dflt='-KPIC' ;;
5117 sunos) dflt='-pic' ;;
5121 *) case "$osname" in
5122 svr4*|esix*|solaris) dflt='-fPIC' ;;
5127 *) dflt="$cccdlflags" ;;
5129 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5132 none) cccdlflags=' ' ;;
5133 *) cccdlflags="$ans" ;;
5138 Some systems use ld to create libraries that can be dynamically loaded,
5139 while other systems (such as those using ELF) use $cc.
5143 '') $cat >try.c <<'EOM'
5144 /* Test for whether ELF binaries are produced */
5149 int i = open("a.out",O_RDONLY);
5152 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5153 exit(0); /* succeed (yes, it's ELF) */
5158 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5160 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5164 echo "I'll use ld to build dynamic libraries."
5173 rp="What command should be used to create dynamic libraries?"
5179 Some systems may require passing special flags to $ld to create a
5180 library that can be dynamically loaded. If your ld flags include
5181 -L/other/path options to locate libraries outside your loader's normal
5182 search path, you may need to specify those -L options here as well. To
5183 use no flags, say "none".
5186 case "$lddlflags" in
5187 '') case "$osname" in
5188 beos) dflt='-nostart' ;;
5190 linux|irix*) dflt='-shared' ;;
5191 next) dflt='none' ;;
5192 solaris) dflt='-G' ;;
5193 sunos) dflt='-assert nodefinitions' ;;
5194 svr4*|esix*) dflt="-G $ldflags" ;;
5198 *) dflt="$lddlflags" ;;
5201 : Try to guess additional flags to pick up local libraries.
5202 : Be careful not to append to a plain 'none'
5206 for thisflag in $ldflags; do
5211 *) dflt="$dflt $thisflag" ;;
5218 ''|' ') dflt='none' ;;
5221 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5224 none) lddlflags=' ' ;;
5225 *) lddlflags="$ans" ;;
5230 Some systems may require passing special flags to $cc to indicate that
5231 the resulting executable will use dynamic linking. To use no flags,
5235 case "$ccdlflags" in
5236 '') case "$osname" in
5237 hpux) dflt='-Wl,-E' ;;
5238 linux) dflt='-rdynamic' ;;
5239 next) dflt='none' ;;
5240 sunos) dflt='none' ;;
5244 *) dflt="$ccdlflags" ;;
5246 rp="Any special flags to pass to $cc to use dynamic loading?"
5249 none) ccdlflags=' ' ;;
5250 *) ccdlflags="$ans" ;;
5264 # No dynamic loading being used, so don't bother even to prompt.
5267 *) case "$useshrplib" in
5268 '') case "$osname" in
5269 svr4*|dgux|dynixptx|esix|powerux|beos)
5271 also='Building a shared libperl is required for dynamic loading to work on your system.'
5276 also='Building a shared libperl is needed for MAB support.'
5294 The perl executable is normally obtained by linking perlmain.c with
5295 libperl${_a}, any static extensions (usually just DynaLoader), and
5296 any other libraries needed on this system (such as -lm, etc.). Since
5297 your system supports dynamic loading, it is probably possible to build
5298 a shared libperl.$so. If you will have more than one executable linked
5299 to libperl.$so, this will significantly reduce the size of each
5300 executable, but it may have a noticeable affect on performance. The
5301 default is probably sensible for your system.
5305 rp="Build a shared libperl.$so (y/n)"
5310 # Why does next4 have to be so different?
5311 case "${osname}${osvers}" in
5312 next4*) xxx='DYLD_LIBRARY_PATH' ;;
5313 os2*) xxx='' ;; # Nothing special needed.
5315 *) xxx='LD_LIBRARY_PATH' ;;
5317 if test X"$xxx" != "X"; then
5318 $cat <<EOM | $tee -a ../config.msg >&4
5320 To build perl, you must add the current working directory to your
5321 $xxx environment variable before running make. You can do
5323 $xxx=\`pwd\`:\$$xxx; export $xxx
5324 for Bourne-style shells, or
5326 for Csh-style shells. You *MUST* do this before running make.
5331 *) useshrplib='false' ;;
5336 case "$useshrplib" in
5340 # Figure out a good name for libperl.so. Since it gets stored in
5341 # a version-specific architecture-dependent library, the version
5342 # number isn't really that important, except for making cc/ld happy.
5344 # A name such as libperl.so.3.1
5345 majmin="libperl.$so.$patchlevel.$subversion"
5346 # A name such as libperl.so.301
5347 majonly=`echo $patchlevel $subversion |
5348 $awk '{printf "%d%02d", $1, $2}'`
5349 majonly=libperl.$so.$majonly
5350 # I'd prefer to keep the os-specific stuff here to a minimum, and
5351 # rely on figuring it out from the naming of libc.
5352 case "${osname}${osvers}" in
5355 # XXX How handle the --version stuff for MAB?
5357 linux*) # ld won't link with a bare -lperl otherwise.
5360 *) # Try to guess based on whether libc has major.minor.
5362 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5363 *libc.$so.[0-9]*) dflt=$majonly ;;
5364 *) dflt=libperl.$so ;;
5374 I need to select a good name for the shared libperl. If your system uses
5375 library names with major and minor numbers, then you might want something
5376 like $majmin. Alternatively, if your system uses a single version
5377 number for shared libraries, then you might want to use $majonly.
5378 Or, your system might be quite happy with a simple libperl.$so.
5380 Since the shared libperl will get installed into a version-specific
5381 architecture-dependent directory, the version number of the shared perl
5382 library probably isn't important, so the default should be o.k.
5385 rp='What name do you want to give to the shared libperl?'
5388 echo "Ok, I'll use $libperl"
5391 libperl="libperl${_a}"
5395 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5399 WARNING: Use of the shrpdir variable for the installation location of
5400 the shared $libperl is not supported. It was never documented and
5401 will not work in this version. Let me (perlbug@perl.com)
5402 know of any problems this may cause.
5408 But your current setting of $shrpdir is
5409 the default anyway, so it's harmless.
5414 Further, your current attempted setting of $shrpdir
5415 conflicts with the value of $archlibexp/CORE
5416 that installperl will use.
5423 # How will the perl executable find the installed shared $libperl?
5424 # Add $xxx to ccdlflags.
5425 # If we can't figure out a command-line option, use $shrpenv to
5426 # set env LD_RUN_PATH. The main perl makefile uses this.
5427 shrpdir=$archlibexp/CORE
5430 if "$useshrplib"; then
5433 # We'll set it in Makefile.SH...
5439 xxx="-Wl,-R$shrpdir"
5441 linux|irix*|dec_osf)
5442 xxx="-Wl,-rpath,$shrpdir"
5445 # next doesn't like the default...
5448 # beos doesn't like the default, either.
5451 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5457 # Only add $xxx if it isn't already in ccdlflags.
5458 case " $ccdlflags " in
5460 *) ccdlflags="$ccdlflags $xxx"
5463 Adding $xxx to the flags
5464 passed to $ld so that the perl executable will find the
5465 installed shared $libperl.
5473 # Respect a hint or command-line value.
5475 '') shrpenv="$tmp_shrpenv" ;;
5478 : determine where manual pages go
5479 set man1dir man1dir none
5483 $spackage has manual pages available in source form.
5487 echo "However, you don't have nroff, so they're probably useless to you."
5489 '') man1dir="none";;
5492 echo "If you don't want the manual sources installed, answer 'none'."
5497 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5498 lookpath="$lookpath $prefixexp/man/p_man/man1"
5499 lookpath="$lookpath $prefixexp/man/u_man/man1"
5500 lookpath="$lookpath $prefixexp/man/man.1"
5502 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5503 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5513 rp="Where do the main $spackage manual pages (source) go?"
5515 if $test "X$man1direxp" != "X$ansexp"; then
5519 man1direxp="$ansexp"
5527 Since you are running AFS, I need to distinguish the directory in which
5528 manual pages reside from the directory in which they are installed (and from
5529 which they are presumably copied to the former directory by occult means).
5532 case "$installman1dir" in
5533 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
5534 *) dflt="$installman1dir";;
5537 rp='Where will man pages be installed?'
5539 installman1dir="$ans"
5541 installman1dir="$man1direxp"
5544 : What suffix to use on installed man pages
5551 rp="What suffix should be used for the main $spackage man pages?"
5553 '') case "$man1dir" in
5567 *) dflt="$man1ext";;
5574 : see if we can have long filenames
5576 rmlist="$rmlist /tmp/cf$$"
5577 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5578 first=123456789abcdef
5579 second=/tmp/cf$$/$first
5580 $rm -f $first $second
5581 if (echo hi >$first) 2>/dev/null; then
5582 if $test -f 123456789abcde; then
5583 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5586 if (echo hi >$second) 2>/dev/null; then
5587 if $test -f /tmp/cf$$/123456789abcde; then
5589 That's peculiar... You can have filenames longer than 14 characters, but only
5590 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5591 I shall consider your system cannot support long filenames at all.
5595 echo 'You can have filenames longer than 14 characters.' >&4
5600 How confusing! Some of your filesystems are sane enough to allow filenames
5601 longer than 14 characters but some others like /tmp can't even think about them.
5602 So, for now on, I shall assume your kernel does not allow them at all.
5609 You can't have filenames longer than 14 chars. You can't even think about them!
5615 $rm -rf /tmp/cf$$ 123456789abcde*
5617 : determine where library module manual pages go
5618 set man3dir man3dir none
5622 $spackage has manual pages for many of the library modules.
5628 However, you don't have nroff, so they're probably useless to you.
5631 '') man3dir="none";;
5635 case "$d_flexfnam" in
5638 However, your system can't handle the long file names like File::Basename.3.
5641 '') man3dir="none";;
5645 echo "If you don't want the manual sources installed, answer 'none'."
5646 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5648 '') case "$prefix" in
5649 *$prog*) dflt=`echo $man1dir |
5650 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
5651 *) dflt="$privlib/man/man3" ;;
5655 *) dflt="$man3dir" ;;
5660 rp="Where do the $package library man pages (source) go?"
5662 if test "X$man3direxp" != "X$ansexp"; then
5667 man3direxp="$ansexp"
5675 Since you are running AFS, I need to distinguish the directory in which
5676 manual pages reside from the directory in which they are installed (and from
5677 which they are presumably copied to the former directory by occult means).
5680 case "$installman3dir" in
5681 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
5682 *) dflt="$installman3dir";;
5685 rp='Where will man pages be installed?'
5687 installman3dir="$ans"
5689 installman3dir="$man3direxp"
5692 : What suffix to use on installed man pages
5699 rp="What suffix should be used for the $package library man pages?"
5701 '') case "$man3dir" in
5715 *) dflt="$man3ext";;
5722 : see if we have to deal with yellow pages, now NIS.
5723 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5724 if $test -f /usr/etc/nibindd; then
5726 echo "I'm fairly confident you're on a NeXT."
5728 rp='Do you get the hosts file via NetInfo?'
5737 y*) hostcat='nidump hosts .';;
5738 *) case "$hostcat" in
5739 nidump*) hostcat='';;
5749 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5757 rp='Are you getting the hosts file via yellow pages?'
5760 y*) hostcat='ypcat hosts';;
5761 *) hostcat='cat /etc/hosts';;
5767 '') hostcat='cat /etc/hosts';;
5770 '') groupcat='cat /etc/group';;
5773 '') passcat='cat /etc/passwd';;
5776 : now get the host name
5778 echo "Figuring out host name..." >&4
5779 case "$myhostname" in
5781 echo 'Maybe "hostname" will work...'
5782 if tans=`sh -c hostname 2>&1` ; then
5790 if $test "$cont"; then
5792 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5793 if tans=`cat /etc/systemid 2>&1` ; then
5795 phostname='cat /etc/systemid'
5796 echo "Whadyaknow. Xenix always was a bit strange..."
5799 elif $test -r /etc/systemid; then
5800 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5803 if $test "$cont"; then
5804 echo 'No, maybe "uuname -l" will work...'
5805 if tans=`sh -c 'uuname -l' 2>&1` ; then
5807 phostname='uuname -l'
5809 echo 'Strange. Maybe "uname -n" will work...'
5810 if tans=`sh -c 'uname -n' 2>&1` ; then
5812 phostname='uname -n'
5814 echo 'Oh well, maybe I can mine it out of whoami.h...'
5815 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
5816 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
5817 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
5819 case "$myhostname" in
5820 '') echo "Does this machine have an identity crisis or something?"
5823 echo "Well, you said $myhostname before..."
5824 phostname='echo $myhostname';;
5830 : you do not want to know about this
5835 if $test "$myhostname" ; then
5837 rp='Your host name appears to be "'$myhostname'".'" Right?"
5845 : bad guess or no guess
5846 while $test "X$myhostname" = X ; do
5848 rp="Please type the (one word) name of your host:"
5853 : translate upper to lower if necessary
5854 case "$myhostname" in
5856 echo "(Normalizing case in your host name)"
5857 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
5861 case "$myhostname" in
5863 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
5864 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
5865 echo "(Trimming domain name from host name--host name is now $myhostname)"
5867 *) case "$mydomain" in
5870 test "X$hostcat" = "Xypcat hosts" &&
5871 ypmatch "$myhostname" hosts 2>/dev/null |\
5872 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
5875 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
5876 /[ ]$myhostname[ . ]/p" > hosts
5879 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
5880 END { print sum }" hosts` = x1 || tmp_re="[ ]"
5881 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
5882 hosts | $sort | $uniq | \
5883 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
5884 case `$echo X$dflt` in
5885 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
5888 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
5893 tans=`./loc resolv.conf X /etc /usr/etc`
5894 if $test -f "$tans"; then
5895 echo "(Attempting domain name extraction from $tans)"
5896 dflt=.`$sed -n -e 's/ / /g' \
5897 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
5898 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5900 .) dflt=.`$sed -n -e 's/ / /g' \
5901 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
5902 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5909 .) echo "(No help from resolv.conf either -- attempting clever guess)"
5910 dflt=.`sh -c domainname 2>/dev/null`
5913 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
5918 .) echo "(Lost all hope -- silly guess then)"
5924 *) dflt="$mydomain";;
5928 rp="What is your domain name?"
5938 : translate upper to lower if necessary
5941 echo "(Normalizing case in your domain name)"
5942 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
5946 : a little sanity check here
5947 case "$phostname" in
5950 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
5951 $myhostname$mydomain|$myhostname) ;;
5953 case "$phostname" in
5955 echo "(That doesn't agree with your whoami.h file, by the way.)"
5958 echo "(That doesn't agree with your $phostname command, by the way.)"
5968 I need to get your e-mail address in Internet format if possible, i.e.
5969 something like user@host.domain. Please answer accurately since I have
5970 no easy means to double check it. The default value provided below
5971 is most probably close to the reality but may not be valid from outside
5972 your organization...
5976 while test "$cont"; do
5978 '') dflt="$cf_by@$myhostname$mydomain";;
5979 *) dflt="$cf_email";;
5981 rp='What is your e-mail address?'
5987 rp='Address does not look like an Internet one. Use it anyway?'
6003 If you or somebody else will be maintaining perl at your site, please
6004 fill in the correct e-mail address here so that they may be contacted
6005 if necessary. Currently, the "perlbug" program included with perl
6006 will send mail to this address in addition to perlbug@perl.com. You may
6007 enter "none" for no administrator.
6010 case "$perladmin" in
6011 '') dflt="$cf_email";;
6012 *) dflt="$perladmin";;
6014 rp='Perl administrator e-mail address'
6018 : figure out how to guarantee perl startup
6019 case "$startperl" in
6021 case "$sharpbang" in
6025 I can use the #! construct to start perl on your system. This will
6026 make startup of perl scripts faster, but may cause problems if you
6027 want to share those scripts and perl is not in a standard place
6028 ($binexp/perl) on all your platforms. The alternative is to force
6029 a shell by starting the script with a single ':' character.
6033 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6036 none) startperl=": # use perl";;
6037 *) startperl="#!$ans"
6038 if $test 30 -lt `echo "$ans" | wc -c`; then
6041 WARNING: Some systems limit the #! command to 32 characters.
6042 If you experience difficulty running Perl scripts with #!, try
6043 installing Perl in a directory with a shorter pathname.
6049 *) startperl=": # use perl"
6054 echo "I'll use $startperl to start perl scripts."
6056 : figure best path for perl in scripts
6059 perlpath="$binexp/perl"
6060 case "$startperl" in
6065 I will use the "eval 'exec'" idiom to start Perl on your system.
6066 I can use the full path of your Perl binary for this purpose, but
6067 doing so may cause problems if you want to share those scripts and
6068 Perl is not always in a standard place ($binexp/perl).
6072 rp="What path shall I use in \"eval 'exec'\"?"
6079 case "$startperl" in
6081 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6084 : determine where public executable scripts go
6085 set scriptdir scriptdir
6087 case "$scriptdir" in
6090 : guess some guesses
6091 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6092 $test -d /usr/share/bin && dflt=/usr/share/bin
6093 $test -d /usr/local/script && dflt=/usr/local/script
6094 $test -d $prefixexp/script && dflt=$prefixexp/script
6098 *) dflt="$scriptdir"
6103 Some installations have a separate directory just for executable scripts so
6104 that they can mount it across multiple architectures but keep the scripts in
6105 one spot. You might, for example, have a subdirectory of /usr/share for this.
6106 Or you might just lump your scripts in with all your other executables.
6110 rp='Where do you keep publicly executable scripts?'
6112 if $test "X$ansexp" != "X$scriptdirexp"; then
6116 scriptdirexp="$ansexp"
6120 Since you are running AFS, I need to distinguish the directory in which
6121 scripts reside from the directory in which they are installed (and from
6122 which they are presumably copied to the former directory by occult means).
6125 case "$installscript" in
6126 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
6127 *) dflt="$installscript";;
6130 rp='Where will public scripts be installed?'
6132 installscript="$ans"
6134 installscript="$scriptdirexp"
6137 : determine where site specific libraries go.
6138 : Usual default is /usr/local/lib/perl5/site_perl/$apiversion
6139 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6141 *perl*) set dflt sitelib lib/site_$prog/$apiversion ;;
6142 *) set dflt sitelib lib/$package/site_$prog/$apiversion ;;
6147 The installation process will also create a directory for
6148 site-specific extensions and modules. Some users find it convenient
6149 to place all local files in this directory rather than in the main
6150 distribution directory.
6154 rp='Pathname for the site-specific library files?'
6156 if $test "X$sitelibexp" != "X$ansexp"; then
6160 sitelibexp="$ansexp"
6164 Since you are running AFS, I need to distinguish the directory in
6165 which site-specific files reside from the directory in which they are
6166 installed (and from which they are presumably copied to the former
6167 directory by occult means).
6170 case "$installsitelib" in
6171 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
6172 *) dflt="$installsitelib";;
6175 rp='Where will site-specific files be installed?'
6177 installsitelib="$ans"
6179 installsitelib="$sitelibexp"
6182 : determine where site specific architecture-dependent libraries go.
6183 : sitelib default is /usr/local/lib/perl5/site_perl/$apiversion
6184 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6185 : sitelib may have an optional trailing /share.
6186 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6187 tdflt="$tdflt/$archname"
6188 set sitearch sitearch none
6191 '') dflt="$tdflt" ;;
6192 *) dflt="$sitearch" ;;
6196 The installation process will also create a directory for
6197 architecture-dependent site-specific extensions and modules.
6201 rp='Pathname for the site-specific architecture-dependent library files?'
6203 if $test "X$sitearchexp" != "X$ansexp"; then
6207 sitearchexp="$ansexp"
6211 Since you are running AFS, I need to distinguish the directory in
6212 which site-specific architecture-dependent library files reside from
6213 the directory in which they are installed (and from which they are
6214 presumably copied to the former directory by occult means).
6217 case "$installsitearch" in
6218 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
6219 *) dflt="$installsitearch";;
6222 rp='Where will site-specific architecture-dependent files be installed?'
6224 installsitearch="$ans"
6226 installsitearch="$sitearchexp"
6231 Previous version of $package used the standard IO mechanisms as defined
6232 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6233 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6234 the default. This abstraction layer can use AT&T's sfio (if you already
6235 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6236 problems with some extension modules. Using PerlIO with stdio is safe,
6237 but it is slower than plain stdio and therefore is not the default.
6239 If this doesn't make any sense to you, just accept the default 'n'.
6241 case "$useperlio" in
6242 $define|true|[yY]*) dflt='y';;
6245 rp='Use the experimental PerlIO abstraction layer?'
6252 echo "Ok, doing things the stdio way"
6259 : Check how to convert floats to strings.
6260 if test "X$d_Gconvert" = X; then
6262 echo "Checking for an efficient way to convert floats to strings."
6265 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6266 char *myname = "gconvert";
6269 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6270 char *myname = "gcvt";
6273 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6274 char *myname = "sprintf";
6280 checkit(expect, got)
6284 if (strcmp(expect, got)) {
6285 printf("%s oddity: Expected %s, got %s\n",
6286 myname, expect, got);
6296 /* This must be 1st test on (which?) platform */
6297 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6298 Gconvert(0.1, 8, 0, buf);
6299 checkit("0.1", buf);
6301 Gconvert(1.0, 8, 0, buf);
6304 Gconvert(0.0, 8, 0, buf);
6307 Gconvert(-1.0, 8, 0, buf);
6310 /* Some Linux gcvt's give 1.e+5 here. */
6311 Gconvert(100000.0, 8, 0, buf);
6312 checkit("100000", buf);
6314 /* Some Linux gcvt's give -1.e+5 here. */
6315 Gconvert(-100000.0, 8, 0, buf);
6316 checkit("-100000", buf);
6321 case "$d_Gconvert" in
6322 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6323 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6324 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6325 *) xxx_list='gconvert gcvt sprintf' ;;
6328 for xxx_convert in $xxx_list; do
6329 echo "Trying $xxx_convert"
6331 set try -DTRY_$xxx_convert
6332 if eval $compile; then
6333 echo "$xxx_convert" found. >&4
6335 echo "I'll use $xxx_convert to convert floats into a string." >&4
6338 echo "...But $xxx_convert didn't work as I expected."
6341 echo "$xxx_convert NOT found." >&4
6345 case "$xxx_convert" in
6346 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6347 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6348 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6352 : Initialize h_fcntl
6355 : Initialize h_sysfile
6358 : access call always available on UNIX
6362 : locate the flags for 'access()'
6366 $cat >access.c <<'EOCP'
6367 #include <sys/types.h>
6372 #include <sys/file.h>
6381 : check sys/file.h first, no particular reason here
6382 if $test `./findhdr sys/file.h` && \
6383 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
6385 echo "<sys/file.h> defines the *_OK access constants." >&4
6386 elif $test `./findhdr fcntl.h` && \
6387 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
6389 echo "<fcntl.h> defines the *_OK access constants." >&4
6390 elif $test `./findhdr unistd.h` && \
6391 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
6392 echo "<unistd.h> defines the *_OK access constants." >&4
6394 echo "I can't find the four *_OK access constants--I'll use mine." >&4
6400 : see if accessx exists
6401 set accessx d_accessx
6404 : see if alarm exists
6408 : Look for GNU-cc style attribute checking
6410 echo "Checking whether your compiler can handle __attribute__ ..." >&4
6411 $cat >attrib.c <<'EOCP'
6413 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
6415 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
6416 if $contains 'warning' attrib.out >/dev/null 2>&1; then
6417 echo "Your C compiler doesn't fully support __attribute__."
6420 echo "Your C compiler supports __attribute__."
6424 echo "Your C compiler doesn't seem to understand __attribute__ at all."
6431 : see if bcmp exists
6435 : see if bcopy exists
6439 : see if this is a unistd.h system
6440 set unistd.h i_unistd
6443 : see if getpgrp exists
6444 set getpgrp d_getpgrp
6447 case "$d_getpgrp" in
6450 echo "Checking to see which flavor of getpgrp is in use..."
6453 #include <sys/types.h>
6455 # include <unistd.h>
6459 if (getuid() == 0) {
6460 printf("(I see you are running Configure as super-user...)\n");
6464 if (getpgrp(1) == 0)
6473 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6474 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
6476 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6477 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
6480 echo "I can't seem to compile and run the test program."
6482 xxx="a USG one, i.e. you use getpgrp()."
6484 # SVR4 systems can appear rather BSD-ish.
6487 xxx="a BSD one, i.e. you use getpgrp(pid)."
6491 xxx="probably a USG one, i.e. you use getpgrp()."
6496 echo "Assuming your getpgrp is $xxx" >&4
6505 : see if setpgrp exists
6506 set setpgrp d_setpgrp
6509 case "$d_setpgrp" in
6512 echo "Checking to see which flavor of setpgrp is in use..."
6515 #include <sys/types.h>
6517 # include <unistd.h>
6521 if (getuid() == 0) {
6522 printf("(I see you are running Configure as super-user...)\n");
6526 if (-1 == setpgrp(1, 1))
6529 if (setpgrp() != -1)
6535 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6536 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
6538 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6539 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
6542 echo "(I can't seem to compile and run the test program.)"
6544 xxx="a USG one, i.e. you use setpgrp()."
6546 # SVR4 systems can appear rather BSD-ish.
6549 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
6553 xxx="probably a USG one, i.e. you use setpgrp()."
6558 echo "Assuming your setpgrp is $xxx" >&4
6566 : see if bzero exists
6570 : check for lengths of integral types
6574 echo "Checking to see how big your integers are..." >&4
6575 $cat >intsize.c <<'EOCP'
6579 printf("intsize=%d;\n", sizeof(int));
6580 printf("longsize=%d;\n", sizeof(long));
6581 printf("shortsize=%d;\n", sizeof(short));
6586 if eval $compile_ok && ./intsize > /dev/null; then
6588 echo "Your integers are $intsize bytes long."
6589 echo "Your long integers are $longsize bytes long."
6590 echo "Your short integers are $shortsize bytes long."
6594 Help! I can't compile and run the intsize test program: please enlighten me!
6595 (This is probably a misconfiguration in your system or libraries, and
6596 you really ought to fix it. Still, I'll try anyway.)
6600 rp="What is the size of an integer (in bytes)?"
6604 rp="What is the size of a long integer (in bytes)?"
6608 rp="What is the size of a short integer (in bytes)?"
6614 $rm -f intsize intsize.*
6616 : see if signal is declared as pointer to function returning int or void
6618 xxx=`./findhdr signal.h`
6619 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
6620 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6621 echo "You have int (*signal())() instead of void." >&4
6623 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6624 echo "You have void (*signal())()." >&4
6626 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
6627 echo "You have int (*signal())() instead of void." >&4
6629 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
6630 echo "You have void (*signal())()." >&4
6633 case "$d_voidsig" in
6635 echo "I can't determine whether signal handler returns void or int..." >&4
6637 rp="What type does your signal handler return?"
6644 echo "As you already told me, signal handler returns void." >&4
6647 *) echo "As you already told me, signal handler returns int." >&4
6654 case "$d_voidsig" in
6655 "$define") signal_t="void";;
6660 : check for ability to cast large floats to 32-bit ints.
6662 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
6663 if $test "$intsize" -ge 4; then
6670 #include <sys/types.h>
6672 $signal_t blech(s) int s; { exit(3); }
6679 signal(SIGFPE, blech);
6681 /* Don't let compiler optimize the test away. Store the number
6682 in a writable string for gcc to pass to sscanf under HP/UX.
6684 sprintf(str, "2147483647");
6685 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
6689 /* x86 processors will probably give 0x8000 0000, which is a
6690 sign change. We don't want that. We want to mimic SPARC
6691 behavior here, which is to preserve the sign and give
6694 if (i32 != ($xxx) f)
6700 if eval $compile_ok; then
6704 echo "(I can't seem to compile the test program--assuming it can't)"
6712 echo "Nope, it can't."
6719 : check for ability to cast negative floats to unsigned
6721 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
6724 #include <sys/types.h>
6726 $signal_t blech(s) int s; { exit(7); }
6727 $signal_t blech_in_list(s) int s; { exit(4); }
6728 unsigned long dummy_long(p) unsigned long p; { return p; }
6729 unsigned int dummy_int(p) unsigned int p; { return p; }
6730 unsigned short dummy_short(p) unsigned short p; { return p; }
6734 unsigned long along;
6736 unsigned short ashort;
6740 /* Frustrate gcc-2.7.2's optimizer which failed this test with
6741 a direct f = -123. assignment. gcc-2.8.0 reportedly
6742 optimized the whole file away
6744 /* Store the number in a writable string for gcc to pass to
6747 sprintf(str, "-123");
6748 sscanf(str, "%lf", &f); /* f = -123.; */
6750 signal(SIGFPE, blech);
6751 along = (unsigned long)f;
6752 aint = (unsigned int)f;
6753 ashort = (unsigned short)f;
6754 if (along != (unsigned long)-123)
6756 if (aint != (unsigned int)-123)
6758 if (ashort != (unsigned short)-123)
6760 sprintf(str, "1073741824.");
6761 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
6764 along = (unsigned long)f;
6765 if (along != 0x80000000)
6769 along = (unsigned long)f;
6770 if (along != 0x7fffffff)
6774 along = (unsigned long)f;
6775 if (along != 0x80000001)
6779 signal(SIGFPE, blech_in_list);
6780 sprintf(str, "123.");
6781 sscanf(str, "%lf", &f); /* f = 123.; */
6782 along = dummy_long((unsigned long)f);
6783 aint = dummy_int((unsigned int)f);
6784 ashort = dummy_short((unsigned short)f);
6785 if (along != (unsigned long)123)
6787 if (aint != (unsigned int)123)
6789 if (ashort != (unsigned short)123)
6796 if eval $compile_ok; then
6800 echo "(I can't seem to compile the test program--assuming it can't)"
6803 case "$castflags" in
6808 echo "Nope, it can't."
6815 : see if vprintf exists
6817 if set vprintf val -f d_vprintf; eval $csym; $val; then
6818 echo 'vprintf() found.' >&4
6820 $cat >vprintf.c <<'EOF'
6821 #include <varargs.h>
6823 int main() { xxx("foo"); }
6832 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
6836 if eval $compile && ./vprintf; then
6837 echo "Your vsprintf() returns (int)." >&4
6840 echo "Your vsprintf() returns (char*)." >&4
6844 echo 'vprintf() NOT found.' >&4
6854 : see if chown exists
6858 : see if chroot exists
6862 : see if chsize exists
6866 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
6867 while $test $# -ge 2; do
6869 $define) echo "#include <$2>";;
6873 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
6874 if eval $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6883 : see if this is a sys/uio.h system
6884 set sys/uio.h i_sysuio
6887 echo "Checking to see if your system supports struct iovec..." >&4
6888 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
6890 case "$d_iovec_s" in
6891 "$define") echo "Yup, it does." >&4
6893 *) echo "Nope, it doesn't." >&4
6899 : see whether socket exists
6901 $echo $n "Hmm... $c" >&4
6902 if set socket val -f d_socket; eval $csym; $val; then
6903 echo "Looks like you have Berkeley networking support." >&4
6905 if set setsockopt val -f; eval $csym; $val; then
6908 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
6912 if $contains socklib libc.list >/dev/null 2>&1; then
6913 echo "Looks like you have Berkeley networking support." >&4
6915 : we will have to assume that it supports the 4.2 BSD interface
6918 echo "You don't have Berkeley networking in libc$_a..." >&4
6919 if test "X$d_socket" = "X$define"; then
6920 echo "...but you seem to believe that you have sockets." >&4
6922 for net in net socket
6924 if test -f /usr/lib/lib$net$_a; then
6925 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
6926 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
6927 if $contains socket libc.list >/dev/null 2>&1; then
6932 echo "...but the Wollongong group seems to have hacked it in." >&4
6933 sockethdr="-I/usr/netinclude"
6936 echo "Found Berkeley sockets interface in lib$net." >& 4
6937 if $contains setsockopt libc.list >/dev/null 2>&1; then
6940 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
6947 if test "X$d_socket" != "X$define"; then
6948 echo "or anywhere else I see." >&4
6956 : see if socketpair exists
6957 set socketpair d_sockpair
6962 echo "Checking the availability of certain socket constants..." >& 4
6963 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
6964 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
6966 #include <sys/types.h>
6967 #include <sys/socket.h>
6973 set try; if eval $compile; then
6976 set d_${enum}; eval $setvar
6980 set sendmsg d_sendmsg
6983 set recvmsg d_recvmsg
6987 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
6988 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
6990 case "$d_msghdr_s" in
6991 "$define") echo "Yup, it does." >&4
6993 *) echo "Nope, it doesn't." >&4
6997 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
6998 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7000 case "$d_cmsghdr_s" in
7001 "$define") echo "Yup, it does." >&4
7003 *) echo "Nope, it doesn't." >&4
7007 : check for const keyword
7009 echo 'Checking to see if your C compiler knows about "const"...' >&4
7010 $cat >const.c <<'EOCP'
7011 typedef struct spug { int drokk; } spug;
7018 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7020 echo "Yup, it does."
7023 echo "Nope, it doesn't."
7028 : see if crypt exists
7030 if set crypt val -f d_crypt; eval $csym; $val; then
7031 echo 'crypt() found.' >&4
7035 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7036 if $test -z "$cryptlib"; then
7037 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7041 if $test -z "$cryptlib"; then
7042 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7046 if $test -z "$cryptlib"; then
7047 cryptlib=`./loc libcrypt$_a "" $libpth`
7051 if $test -z "$cryptlib"; then
7052 echo 'crypt() NOT found.' >&4
7061 : get csh whereabouts
7063 'csh') val="$undef" ;;
7068 : Respect a hint or command line value for full_csh.
7070 '') full_csh=$csh ;;
7073 : see if cuserid exists
7074 set cuserid d_cuserid
7077 : see if this is a limits.h system
7078 set limits.h i_limits
7081 : see if this is a float.h system
7085 : See if number of significant digits in a double precision number is known
7087 $cat >dbl_dig.c <<EOM
7097 printf("Contains DBL_DIG");
7100 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7101 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7102 echo "DBL_DIG found." >&4
7105 echo "DBL_DIG NOT found." >&4
7113 if $test X"$use64bits" = X"$define"; then
7114 : see if dbminit64 exists
7115 set dbminit64 d_dbminit64
7118 : see if dbmclose64 exists
7119 set dbmclose64 d_dbmclose64
7122 : see if fetch64 exists
7123 set fetch64 d_fetch64
7126 : see if store64 exists
7127 set store64 d_store64
7130 : see if delete64 exists
7131 set delete64 d_delete64
7134 : see if firstkey64 exists
7135 set firstkey64 d_firstkey64
7138 : see if nextkey64 exists
7139 set nextkey64 d_nextkey64
7143 for xxx in d_dbminit64 d_dbmclose64 d_fetch64 d_store64 d_delete64 d_firstkey64 d_nextkey64
7150 : see if difftime exists
7151 set difftime d_difftime
7154 : see if sys/stat.h is available
7155 set sys/stat.h i_sysstat
7158 : see if this is a dirent system
7160 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7162 echo "<dirent.h> found." >&4
7165 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7166 echo "<sys/dir.h> found." >&4
7169 xinc=`./findhdr sys/ndir.h`
7171 echo "<dirent.h> NOT found." >&4
7176 : Look for type of directory structure.
7178 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7180 case "$direntrytype" in
7183 $define) guess1='struct dirent' ;;
7184 *) guess1='struct direct' ;;
7187 *) guess1="$direntrytype"
7192 'struct dirent') guess2='struct direct' ;;
7193 *) guess2='struct dirent' ;;
7196 if $contains "$guess1" try.c >/dev/null 2>&1; then
7197 direntrytype="$guess1"
7198 echo "Your directory entries are $direntrytype." >&4
7199 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7200 direntrytype="$guess2"
7201 echo "Your directory entries seem to be $direntrytype." >&4
7203 echo "I don't recognize your system's directory entries." >&4
7204 rp="What type is used for directory entries on this system?"
7212 : see if the directory entry stores field length
7214 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7215 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7216 echo "Good, your directory entry keeps length information in d_namlen." >&4
7219 echo "Your directory entry does not know about the d_namlen field." >&4
7227 if $test X"$use64bits" = X"$define"; then
7228 : see if fstat64 exists
7229 set fstat64 d_fstat64
7232 : see if ftruncate64 exists
7233 set ftruncate64 d_ftruncate64
7236 : see if lockf64 exists
7237 set lockf64 d_lockf64
7240 : see if lseek64 exists
7241 set lseek64 d_lseek64
7244 : see if lstat64 exists
7245 set lstat64 d_lstat64
7248 : see if open64 exists
7252 : see if opendir64 exists
7253 set opendir64 d_opendir64
7256 : see if readdir64 exists
7257 set readdir64 d_readdir64
7260 : see if seekdir64 exists
7261 set seekdir64 d_seekdir64
7264 : see if stat64 exists
7268 : see if telldir64 exists
7269 set telldir64 d_telldir64
7272 : see if truncate64 exists
7273 set truncate64 d_truncate64
7278 echo $n "Checking to see if your system supports off64_t...$c" >&4
7280 #include <sys/types.h>
7281 off64_t foo() { off64_t x; x = 7; return x; }'
7283 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7285 echo " Yup, it does." >&4
7288 echo " Nope, it doesn't." >&4
7296 echo $n "Checking to see if your system supports ino64_t...$c" >&4
7298 case "$i_sysstat" in
7301 #include <sys/types.h>
7302 #include <sys/stat.h>
7303 ino64_t foo() { ino64_t x; x = 7; return x; }'
7305 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7311 if $test "X$val" = X"$define"; then
7312 echo " Yup, it does." >&4
7314 echo " Nope, it doesn't." >&4
7319 : check for struct flock64
7321 echo "Checking to see if your system supports struct flock64..." >&4
7323 set d_flock64_s flock64 l_len define fcntl.h
7330 case "$d_flock64_s" in
7331 "$define") echo "Yup, it does." >&4
7333 *) echo "Nope, it doesn't." >&4
7337 : check for struct dirent64
7339 echo "Checking to see if your system supports struct dirent64..." >&4
7340 set d_dirent64_s dirent64 d_off $i_dirent dirent.h
7342 case "$d_dirent64_s" in
7343 "$define") echo "Yup, it does." >&4
7345 *) echo "Nope, it doesn't." >&4
7351 for xxx in d_fstat64 d_ftruncate64 d_lockf64 d_lseek64 d_lstat64 d_open64 d_opendir64 d_readdir64 d_seekdir64 d_stat64 d_telldir64 d_truncate64 d_off64t d_ino64t d_flock64_s d_dirent64_s
7358 : see if dlerror exists
7361 set dlerror d_dlerror
7365 : see if dlfcn is available
7373 On a few systems, the dynamically loaded modules that perl generates and uses
7374 will need a different extension than shared libs. The default will probably
7382 rp='What is the extension of dynamically loaded modules'
7391 : Check if dlsym need a leading underscore
7397 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7398 $cat >dyna.c <<'EOM'
7407 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7409 #include <sys/types.h>
7423 int mode = RTLD_LAZY ;
7425 handle = dlopen("./dyna.$dlext", mode) ;
7426 if (handle == NULL) {
7431 symbol = dlsym(handle, "fred") ;
7432 if (symbol == NULL) {
7433 /* try putting a leading underscore */
7434 symbol = dlsym(handle, "_fred") ;
7435 if (symbol == NULL) {
7448 : Call the object file tmp-dyna.o in case dlext=o.
7449 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
7450 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
7451 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
7452 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
7455 1) echo "Test program failed using dlopen." >&4
7456 echo "Perhaps you should not use dynamic loading." >&4;;
7457 2) echo "Test program failed using dlsym." >&4
7458 echo "Perhaps you should not use dynamic loading." >&4;;
7459 3) echo "dlsym needs a leading underscore" >&4
7461 4) echo "dlsym doesn't need a leading underscore." >&4;;
7464 echo "I can't compile and run the test program." >&4
7469 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
7474 hasproto='varname=$1; func=$2; shift; shift;
7475 while $test $# -ge 2; do
7477 $define) echo "#include <$2>";;
7481 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
7482 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
7483 echo "$func() prototype found.";
7486 echo "$func() prototype NOT found.";
7491 $rm -f try.c tryout.c'
7493 : see if prototype for drand48 is available
7495 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
7498 : see if dup2 exists
7502 : see if eaccess exists
7503 set eaccess d_eaccess
7506 : see if endgrent exists
7507 set endgrent d_endgrent
7510 : see if endhostent exists
7511 set endhostent d_endhent
7514 : see if endnetent exists
7515 set endnetent d_endnent
7518 : see if endprotoent exists
7519 set endprotoent d_endpent
7522 : see if endpwent exists
7523 set endpwent d_endpwent
7526 : see if endservent exists
7527 set endservent d_endsent
7530 : Locate the flags for 'open()'
7532 $cat >open3.c <<'EOCP'
7533 #include <sys/types.h>
7538 #include <sys/file.h>
7549 : check sys/file.h first to get FREAD on Sun
7550 if $test `./findhdr sys/file.h` && \
7551 set open3 -DI_SYS_FILE && eval $compile; then
7553 echo "<sys/file.h> defines the O_* constants..." >&4
7555 echo "and you have the 3 argument form of open()." >&4
7558 echo "but not the 3 argument form of open(). Oh, well." >&4
7561 elif $test `./findhdr fcntl.h` && \
7562 set open3 -DI_FCNTL && eval $compile; then
7564 echo "<fcntl.h> defines the O_* constants..." >&4
7566 echo "and you have the 3 argument form of open()." >&4
7569 echo "but not the 3 argument form of open(). Oh, well." >&4
7574 echo "I can't find the O_* constant definitions! You got problems." >&4
7580 : check for non-blocking I/O stuff
7581 case "$h_sysfile" in
7582 true) echo "#include <sys/file.h>" > head.c;;
7585 true) echo "#include <fcntl.h>" > head.c;;
7586 *) echo "#include <sys/fcntl.h>" > head.c;;
7591 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
7592 case "$o_nonblock" in
7595 $cat >>try.c <<'EOCP'
7598 printf("O_NONBLOCK\n");
7602 printf("O_NDELAY\n");
7606 printf("FNDELAY\n");
7613 if eval $compile_ok; then
7615 case "$o_nonblock" in
7616 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
7617 *) echo "Seems like we can use $o_nonblock.";;
7620 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
7623 *) echo "Using $hint value $o_nonblock.";;
7625 $rm -f try try.* .out core
7628 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
7634 #include <sys/types.h>
7636 #define MY_O_NONBLOCK $o_nonblock
7637 #ifndef errno /* XXX need better Configure test */
7640 $signal_t blech(x) int x; { exit(3); }
7642 $cat >> try.c <<'EOCP'
7650 pipe(pd); /* Down: child -> parent */
7651 pipe(pu); /* Up: parent -> child */
7654 close(pd[1]); /* Parent reads from pd[0] */
7655 close(pu[0]); /* Parent writes (blocking) to pu[1] */
7656 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
7658 signal(SIGALRM, blech);
7660 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
7662 sprintf(string, "%d\n", ret);
7663 write(2, string, strlen(string));
7666 if (errno == EAGAIN) {
7672 if (errno == EWOULDBLOCK)
7673 printf("EWOULDBLOCK\n");
7676 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
7677 sleep(2); /* Give it time to close our pipe */
7679 ret = read(pd[0], buf, 1); /* Should read EOF */
7681 sprintf(string, "%d\n", ret);
7682 write(3, string, strlen(string));
7686 close(pd[0]); /* We write to pd[1] */
7687 close(pu[1]); /* We read from pu[0] */
7688 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
7689 close(pd[1]); /* Pipe pd is now fully closed! */
7690 exit(0); /* Bye bye, thank you for playing! */
7694 if eval $compile_ok; then
7695 echo "$startsh" >mtry
7696 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
7698 ./mtry >/dev/null 2>&1
7700 0) eagain=`$cat try.out`;;
7701 1) echo "Could not perform non-blocking setting!";;
7702 2) echo "I did a successful read() for something that was not there!";;
7703 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
7704 *) echo "Something terribly wrong happened during testing.";;
7706 rd_nodata=`$cat try.ret`
7707 echo "A read() system call with no data present returns $rd_nodata."
7708 case "$rd_nodata" in
7711 echo "(That's peculiar, fixing that to be -1.)"
7717 echo "Forcing errno EAGAIN on read() with no data available."
7721 echo "Your read() sets errno to $eagain when no data is available."
7724 status=`$cat try.err`
7726 0) echo "And it correctly returns 0 to signal EOF.";;
7727 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
7728 *) echo "However, your read() returns '$status' on EOF??";;
7731 if test "$status" = "$rd_nodata"; then
7732 echo "WARNING: you can't distinguish between EOF and no data!"
7736 echo "I can't compile the test program--assuming errno EAGAIN will do."
7743 echo "Using $hint value $eagain."
7744 echo "Your read() returns $rd_nodata when no data is present."
7745 case "$d_eofnblk" in
7746 "$define") echo "And you can see EOF because read() returns 0.";;
7747 "$undef") echo "But you can't see EOF status from read() returned value.";;
7749 echo "(Assuming you can't see EOF status from read anyway.)"
7755 $rm -f try try.* .out core head.c mtry
7757 : see if fchmod exists
7761 : see if fchown exists
7765 : see if this is an fcntl system
7769 : see if sys/select.h has to be included
7770 set sys/select.h i_sysselct
7773 : see if we should include time.h, sys/time.h, or both
7775 if test "X$timeincl" = X; then
7776 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
7777 $echo $n "I'm now running the test program...$c"
7778 $cat >try.c <<'EOCP'
7779 #include <sys/types.h>
7784 #ifdef SYSTIMEKERNEL
7787 #include <sys/time.h>
7790 #include <sys/select.h>
7799 struct timezone tzp;
7801 if (foo.tm_sec == foo.tm_sec)
7804 if (bar.tv_sec == bar.tv_sec)
7811 for s_timezone in '-DS_TIMEZONE' ''; do
7813 for s_timeval in '-DS_TIMEVAL' ''; do
7814 for i_systimek in '' '-DSYSTIMEKERNEL'; do
7815 for i_time in '' '-DI_TIME'; do
7816 for i_systime in '-DI_SYSTIME' ''; do
7819 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
7820 if eval $compile; then
7821 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
7825 $echo $n "Succeeded with $flags$c"
7837 *SYSTIMEKERNEL*) i_systimek="$define"
7838 timeincl=`./findhdr sys/time.h`
7839 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
7840 *) i_systimek="$undef";;
7843 *I_TIME*) i_time="$define"
7844 timeincl=`./findhdr time.h`" $timeincl"
7845 echo "We'll include <time.h>." >&4;;
7846 *) i_time="$undef";;
7849 *I_SYSTIME*) i_systime="$define"
7850 timeincl=`./findhdr sys/time.h`" $timeincl"
7851 echo "We'll include <sys/time.h>." >&4;;
7852 *) i_systime="$undef";;
7857 : check for fd_set items
7860 Checking to see how well your C compiler handles fd_set and friends ...
7862 $cat >fd_set.c <<EOCP
7863 #$i_systime I_SYS_TIME
7864 #$i_sysselct I_SYS_SELECT
7865 #$d_socket HAS_SOCKET
7866 #include <sys/types.h>
7868 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
7871 #include <sys/time.h>
7874 #include <sys/select.h>
7883 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
7890 set fd_set -DTRYBITS
7891 if eval $compile; then
7892 d_fds_bits="$define"
7894 echo "Well, your system knows about the normal fd_set typedef..." >&4
7896 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
7897 d_fd_macros="$define"
7900 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
7902 d_fd_macros="$undef"
7906 Hmm, your compiler has some difficulty with fd_set. Checking further...
7909 if eval $compile; then
7912 echo "Well, your system has some sort of fd_set available..." >&4
7914 echo "and you have the normal fd_set macros." >&4
7915 d_fd_macros="$define"
7918 but not the normal fd_set macros! Gross! More work for me...
7920 d_fd_macros="$undef"
7923 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
7926 d_fd_macros="$undef"
7931 : see if fgetpos exists
7932 set fgetpos d_fgetpos
7936 if $test X"$use64bits" = X"$define"; then
7937 : see if fgetpos64 exists
7938 set fgetpos64 d_fgetpos64
7941 : see if fopen64 exists
7942 set freopen64 d_fopen64
7945 : see if freopen64 exists
7946 set freopen64 d_freopen64
7949 : see if fseek64 exists
7950 set fseek64 d_fseek64
7953 : see if fseeko64 exists
7954 set fseeko64 d_fseeko64
7957 : see if fsetpos64 exists
7958 set fsetpos64 d_fsetpos64
7961 : see if ftell64 exists
7962 set ftell64 d_ftell64
7965 : see if ftello64 exists
7966 set ftello64 d_ftello64
7969 : see if tmpfile64 exists
7970 set tmpfile64 d_tmpfile64
7974 for xxx in d_fgetpos64 d_fopen64 d_freopen64 d_fseek64 d_fseeko64 d_fsetpos64 d_ftell64 d_ftello64 d_tmpfile64
7981 : see if flock exists
7985 : see if fork exists
7989 : see if pathconf exists
7990 set pathconf d_pathconf
7993 : see if fpathconf exists
7994 set fpathconf d_fpathconf
7997 : see if fseeko exists
8001 : see if fsetpos exists
8002 set fsetpos d_fsetpos
8005 : see if this is a sys/param system
8006 set sys/param.h i_sysparam
8009 : see if this is a sys/mount.h system
8010 set sys/mount.h i_sysmount
8014 : see if statfs exists
8018 : see if fstatfs exists
8019 set fstatfs d_fstatfs
8022 : see if statfs knows about mount flags
8023 set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
8027 : see if statvfs exists
8028 set statvfs d_statvfs
8031 : see if fstatvfs exists
8032 set fstatvfs d_fstatvfs
8036 : see if ftello exists
8040 : see if getgrent exists
8041 set getgrent d_getgrent
8044 : see if gethostbyaddr exists
8045 set gethostbyaddr d_gethbyaddr
8048 : see if gethostbyname exists
8049 set gethostbyname d_gethbyname
8052 : see if gethostent exists
8053 set gethostent d_gethent
8056 : see how we will look up host name
8059 : dummy stub to allow use of elif
8060 elif set gethostname val -f d_gethname; eval $csym; $val; then
8061 echo 'gethostname() found.' >&4
8062 d_gethname="$define"
8064 elif set uname val -f d_uname; eval $csym; $val; then
8067 uname() was found, but you're running xenix, and older versions of xenix
8068 have a broken uname(). If you don't really know whether your xenix is old
8069 enough to have a broken system call, use the default answer.
8076 rp='Is your uname() broken?'
8079 n*) d_uname="$define"; call=uname;;
8082 echo 'uname() found.' >&4
8087 case "$d_gethname" in
8088 '') d_gethname="$undef";;
8091 '') d_uname="$undef";;
8093 case "$d_uname$d_gethname" in
8098 Every now and then someone has a $call() that lies about the hostname
8099 but can't be fixed for political or economic reasons. If you wish, I can
8100 pretend $call() isn't there and maybe compute hostname at run-time
8101 thanks to the '$phostname' command.
8104 rp="Shall I ignore $call() from now on?"
8107 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8110 case "$phostname" in
8112 *) case "$aphostname" in
8118 file=`./loc $file $file $pth`
8119 aphostname=`echo $file $*`
8124 case "$d_uname$d_gethname" in
8127 case "$phostname" in
8129 echo "There will be no way for $package to get your hostname." >&4;;
8131 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8135 case "$d_phostname" in
8136 '') d_phostname="$undef";;
8139 : see if this is a netdb.h system
8143 : see if prototypes for various gethostxxx netdb.h functions are available
8145 set d_gethostprotos gethostent $i_netdb netdb.h
8148 : see if getlogin exists
8149 set getlogin d_getlogin
8152 : see if getmntent exists
8153 set getmntent d_getmntent
8156 : see if getnetbyaddr exists
8157 set getnetbyaddr d_getnbyaddr
8160 : see if getnetbyname exists
8161 set getnetbyname d_getnbyname
8164 : see if getnetent exists
8165 set getnetent d_getnent
8168 : see if prototypes for various getnetxxx netdb.h functions are available
8170 set d_getnetprotos getnetent $i_netdb netdb.h
8174 : see if getprotobyname exists
8175 set getprotobyname d_getpbyname
8178 : see if getprotobynumber exists
8179 set getprotobynumber d_getpbynumber
8182 : see if getprotoent exists
8183 set getprotoent d_getpent
8186 : see if getpgid exists
8187 set getpgid d_getpgid
8190 : see if getpgrp2 exists
8191 set getpgrp2 d_getpgrp2
8194 : see if getppid exists
8195 set getppid d_getppid
8198 : see if getpriority exists
8199 set getpriority d_getprior
8202 : see if prototypes for various getprotoxxx netdb.h functions are available
8204 set d_getprotoprotos getprotoent $i_netdb netdb.h
8207 : see if getpwent exists
8208 set getpwent d_getpwent
8212 : see if getservbyname exists
8213 set getservbyname d_getsbyname
8216 : see if getservbyport exists
8217 set getservbyport d_getsbyport
8220 : see if getservent exists
8221 set getservent d_getsent
8224 : see if prototypes for various getservxxx netdb.h functions are available
8226 set d_getservprotos getservent $i_netdb netdb.h
8229 : see if gettimeofday or ftime exists
8230 set gettimeofday d_gettimeod
8232 case "$d_gettimeod" in
8238 val="$undef"; set d_ftime; eval $setvar
8241 case "$d_gettimeod$d_ftime" in
8244 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8248 : see if this is an grp system
8254 xxx=`./findhdr grp.h`
8255 $cppstdin $cppflags $cppminus < $xxx >$$.h
8257 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8269 set d_grpasswd; eval $setvar
8273 : see if hasmntopt exists
8274 set hasmntopt d_hasmntopt
8277 : see if this is a netinet/in.h or sys/in.h system
8278 set netinet/in.h i_niin sys/in.h i_sysin
8281 : see if arpa/inet.h has to be included
8282 set arpa/inet.h i_arpainet
8285 : see if htonl --and friends-- exists
8290 : Maybe they are macros.
8295 #include <sys/types.h>
8296 #$i_niin I_NETINET_IN
8298 #$i_arpainet I_ARPA_INET
8300 #include <netinet/in.h>
8306 #include <arpa/inet.h>
8309 printf("Defined as a macro.");
8312 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8313 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8315 echo "But it seems to be defined as a macro." >&4
8323 : see which of string.h or strings.h is needed
8325 strings=`./findhdr string.h`
8326 if $test "$strings" && $test -r "$strings"; then
8327 echo "Using <string.h> instead of <strings.h>." >&4
8331 strings=`./findhdr strings.h`
8332 if $test "$strings" && $test -r "$strings"; then
8333 echo "Using <strings.h> instead of <string.h>." >&4
8335 echo "No string header found -- You'll surely have problems." >&4
8341 "$undef") strings=`./findhdr strings.h`;;
8342 *) strings=`./findhdr string.h`;;
8347 if set index val -f; eval $csym; $val; then
8348 if set strchr val -f d_strchr; eval $csym; $val; then
8349 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8352 echo "strchr() found." >&4
8356 echo "index() found." >&4
8361 echo "index() found." >&4
8364 if set strchr val -f d_strchr; eval $csym; $val; then
8367 echo "strchr() found." >&4
8369 echo "No index() or strchr() found!" >&4
8374 set d_strchr; eval $setvar
8376 set d_index; eval $setvar
8378 : check whether inet_aton exists
8379 set inet_aton d_inetaton
8382 : see if inttypes.h is available
8383 : we want a real compile instead of Inhdr because some systems
8384 : have an inttypes.h which includes non-existent headers
8387 #include <inttypes.h>
8389 static int32_t foo32 = 0x12345678;
8393 if eval $compile; then
8394 echo "<inttypes.h> found." >&4
8397 echo "<inttypes.h> NOT found." >&4
8405 case "$use64bits" in
8408 echo $n "Checking to see if your system supports int64_t...$c" >&4
8410 #include <sys/types.h>
8411 #$i_inttypes I_INTTYPES
8413 #include <inttypes.h>
8415 int64_t foo() { int64_t x; x = 7; return x; }
8417 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8419 echo " Yup, it does." >&4
8422 echo " Nope, it doesn't." >&4
8435 $cat >isascii.c <<'EOCP'
8447 if eval $compile; then
8448 echo "isascii() found." >&4
8451 echo "isascii() NOT found." >&4
8458 : see if killpg exists
8462 : see if lchown exists
8464 $cat > try.c <<'EOCP'
8465 /* System header to define __stub macros and hopefully few prototypes,
8466 which can conflict with char lchown(); below. */
8468 /* Override any gcc2 internal prototype to avoid an error. */
8469 /* We use char because int might match the return type of a gcc2
8470 builtin and then its argument prototype would still apply. */
8473 /* The GNU C library defines this for functions which it implements
8474 to always fail with ENOSYS. Some functions are actually named
8475 something starting with __ and the normal name is an alias. */
8476 #if defined (__stub_lchown) || defined (__stub___lchown)
8484 if eval $compile; then
8485 $echo "lchown() found." >&4
8488 $echo "lchown() NOT found." >&4
8494 : see if link exists
8498 : see if localeconv exists
8499 set localeconv d_locconv
8502 : see if lockf exists
8506 : check for length of double
8508 case "$doublesize" in
8510 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
8511 $cat >try.c <<'EOCP'
8515 printf("%d\n", sizeof(double));
8519 if eval $compile_ok; then
8521 $echo " $doublesize bytes." >&4
8524 echo "(I can't seem to compile the test program. Guessing...)"
8525 rp="What is the size of a double precision number (in bytes)?"
8533 : check for long doubles
8535 echo $n "Checking to see if your system supports long doubles...$c" >&4
8536 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
8537 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8539 echo " Yup, it does." >&4
8542 echo " Nope, it doesn't." >&4
8548 : check for length of long double
8549 case "${d_longdbl}${longdblsize}" in
8552 $echo $n "Checking to see how big your long doubles are...$c" >&4
8553 $cat >try.c <<'EOCP'
8557 printf("%d\n", sizeof(long double));
8561 if eval $compile; then
8563 $echo " $longdblsize bytes." >&4
8567 echo "(I can't seem to compile the test program. Guessing...)" >&4
8568 rp="What is the size of a long double (in bytes)?"
8572 if $test "X$doublesize" = "X$longdblsize"; then
8573 echo "(That isn't any different from an ordinary double.)"
8579 : check for long long
8581 echo $n "Checking to see if your system supports long long...$c" >&4
8582 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
8583 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8585 echo " Yup, it does." >&4
8588 echo " Nope, it doesn't." >&4
8594 : check for length of long long
8595 case "${d_longlong}${longlongsize}" in
8598 $echo $n "Checking to see how big your long longs are...$c" >&4
8599 $cat >try.c <<'EOCP'
8603 printf("%d\n", sizeof(long long));
8607 if eval $compile_ok; then
8608 longlongsize=`./try`
8609 $echo " $longlongsize bytes." >&4
8613 echo "(I can't seem to compile the test program. Guessing...)"
8614 rp="What is the size of a long long (in bytes)?"
8618 if $test "X$longsize" = "X$longlongsize"; then
8619 echo "(That isn't any different from an ordinary long.)"
8625 : see if lstat exists
8629 : see if madvise exists
8630 set madvise d_madvise
8633 : see if mblen exists
8637 : see if mbstowcs exists
8638 set mbstowcs d_mbstowcs
8641 : see if mbtowc exists
8645 : see if memcmp exists
8649 : see if memcpy exists
8653 : see if memmove exists
8654 set memmove d_memmove
8657 : see if memset exists
8661 : see if mkdir exists
8665 : see if mkfifo exists
8669 : see if mktime exists
8673 : see if this is a sys/mman.h system
8674 set sys/mman.h i_sysmman
8677 : see if mmap exists
8680 : see what shmat returns
8681 : default to something harmless
8683 case "$i_sysmman$d_mmap" in
8685 $cat >mmap.c <<'END'
8686 #include <sys/mman.h>
8689 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
8694 echo "and it returns ($mmaptype)." >&4
8700 : see if mprotect exists
8701 set mprotect d_mprotect
8704 : see if msgctl exists
8708 : see if msgget exists
8712 : see if msgsnd exists
8716 : see if msgrcv exists
8720 : see how much of the 'msg*(2)' library is present.
8723 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
8724 *"$undef"*) h_msg=false;;
8728 case "`ipcs 2>&1`" in
8729 "SVID messages"*"not configured"*)
8730 echo "Your $osname does not have the msg*(2) configured." >&4
8745 : we could also check for sys/ipc.h ...
8746 if $h_msg && $test `./findhdr sys/msg.h`; then
8747 echo "You have the full msg*(2) library." >&4
8750 echo "You don't have the full msg*(2) library." >&4
8756 : see if msync exists
8760 : see if munmap exists
8764 : see if nice exists
8768 : how to create joinable pthreads
8769 if test "X$usethreads" = "X$define"; then
8771 echo "Checking what constant to use for creating joinable pthreads..." >&4
8772 $cat >try.c <<'EOCP'
8773 #include <pthread.h>
8775 int detachstate = JOINABLE;
8778 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
8779 if eval $compile; then
8780 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
8781 val="$undef" # Yes, undef.
8782 set d_old_pthread_create_joinable
8785 set old_pthread_create_joinable
8788 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
8789 if eval $compile; then
8790 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
8792 set d_old_pthread_create_joinable
8794 val=PTHREAD_CREATE_UNDETACHED
8795 set old_pthread_create_joinable
8798 set try -DJOINABLE=__UNDETACHED
8799 if eval $compile; then
8800 echo "You seem to use __UNDETACHED." >&4
8802 set d_old_pthread_create_joinable
8805 set old_pthread_create_joinable
8808 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
8810 set d_old_pthread_create_joinable
8813 set old_pthread_create_joinable
8820 d_old_pthread_create_joinable="$undef"
8821 old_pthread_create_joinable=""
8824 : see if pause exists
8828 : see if pipe exists
8832 : see if poll exists
8837 : see whether the various POSIXish _yields exist
8839 #include <pthread.h>
8845 #ifdef PTHREAD_YIELD
8848 #ifdef PTHREAD_YIELD_NULL
8849 pthread_yield(NULL);
8855 : see if sched_yield exists
8856 set try -DSCHED_YIELD
8857 if eval $compile; then
8859 sched_yield='sched_yield()'
8863 case "$usethreads" in
8866 $define) echo 'sched_yield() found.' >&4 ;;
8867 *) echo 'sched_yield() NOT found.' >&4 ;;
8873 : see if pthread_yield exists
8874 set try -DPTHREAD_YIELD
8875 if eval $compile; then
8877 case "$sched_yield" in
8878 '') sched_yield='pthread_yield()' ;;
8881 set try -DPTHREAD_YIELD_NULL
8882 if eval $compile; then
8884 case "$sched_yield" in
8885 '') sched_yield='pthread_yield(NULL)' ;;
8891 case "$usethreads" in
8894 $define) echo 'pthread_yield() found.' >&4 ;;
8895 *) echo 'pthread_yield() NOT found.' >&4 ;;
8902 case "$sched_yield" in
8903 '') sched_yield=undef ;;
8908 : see if this is a pwd.h system
8914 xxx=`./findhdr pwd.h`
8915 $cppstdin $cppflags $cppminus < $xxx >$$.h
8917 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
8925 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
8933 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
8941 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
8949 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
8957 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
8965 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
8973 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
8985 set d_pwquota; eval $setvar
8986 set d_pwage; eval $setvar
8987 set d_pwchange; eval $setvar
8988 set d_pwclass; eval $setvar
8989 set d_pwexpire; eval $setvar
8990 set d_pwcomment; eval $setvar
8991 set d_pwgecos; eval $setvar
8992 set d_pwpasswd; eval $setvar
8996 : see if readdir and friends exist
8997 set readdir d_readdir
8999 set seekdir d_seekdir
9001 set telldir d_telldir
9003 set rewinddir d_rewinddir
9006 : see if readlink exists
9007 set readlink d_readlink
9010 : see if readv exists
9014 : see if rename exists
9018 : see if rmdir exists
9022 : see if memory.h is available.
9027 : See if it conflicts with string.h
9033 $cppstdin $cppflags $cppminus < $strings > mem.h
9034 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9036 echo "We won't be including <memory.h>."
9046 : can bcopy handle overlapping blocks?
9051 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9058 $cat >>try.c <<'EOCP'
9061 # include <memory.h>
9064 # include <stdlib.h>
9067 # include <string.h>
9069 # include <strings.h>
9072 # include <unistd.h> /* Needed for NetBSD */
9076 char buf[128], abc[128];
9082 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9084 for (align = 7; align >= 0; align--) {
9085 for (len = 36; len; len--) {
9088 for (off = 1; off <= len; off++) {
9089 bcopy(b, b+off, len);
9090 bcopy(b+off, b, len);
9091 if (bcmp(b, abc, len))
9100 if eval $compile_ok; then
9101 if ./try 2>/dev/null; then
9105 echo "It can't, sorry."
9106 case "$d_memmove" in
9107 "$define") echo "But that's Ok since you have memmove()." ;;
9111 echo "(I can't compile the test program, so we'll assume not...)"
9112 case "$d_memmove" in
9113 "$define") echo "But that's Ok since you have memmove()." ;;
9118 $rm -f try.* try core
9122 : can memcpy handle overlapping blocks?
9127 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9134 $cat >>try.c <<'EOCP'
9137 # include <memory.h>
9140 # include <stdlib.h>
9143 # include <string.h>
9145 # include <strings.h>
9148 # include <unistd.h> /* Needed for NetBSD */
9152 char buf[128], abc[128];
9158 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9159 try to store the string in read-only memory. */
9160 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9162 for (align = 7; align >= 0; align--) {
9163 for (len = 36; len; len--) {
9165 memcpy(b, abc, len);
9166 for (off = 1; off <= len; off++) {
9167 memcpy(b+off, b, len);
9168 memcpy(b, b+off, len);
9169 if (memcmp(b, abc, len))
9178 if eval $compile_ok; then
9179 if ./try 2>/dev/null; then
9183 echo "It can't, sorry."
9184 case "$d_memmove" in
9185 "$define") echo "But that's Ok since you have memmove()." ;;
9189 echo "(I can't compile the test program, so we'll assume not...)"
9190 case "$d_memmove" in
9191 "$define") echo "But that's Ok since you have memmove()." ;;
9196 $rm -f try.* try core
9200 : can memcmp be trusted to compare relative magnitude?
9205 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9212 $cat >>try.c <<'EOCP'
9215 # include <memory.h>
9218 # include <stdlib.h>
9221 # include <string.h>
9223 # include <strings.h>
9226 # include <unistd.h> /* Needed for NetBSD */
9232 if ((a < b) && memcmp(&a, &b, 1) < 0)
9238 if eval $compile_ok; then
9239 if ./try 2>/dev/null; then
9243 echo "No, it can't (it uses signed chars)."
9246 echo "(I can't compile the test program, so we'll assume not...)"
9250 $rm -f try.* try core
9254 : see if select exists
9258 : see if semctl exists
9262 : see if semget exists
9266 : see if semop exists
9270 : see how much of the 'sem*(2)' library is present.
9273 case "$d_semctl$d_semget$d_semop" in
9274 *"$undef"*) h_sem=false;;
9278 case "`ipcs 2>&1`" in
9279 "SVID messages"*"not configured"*)
9280 echo "Your $osname does not have the sem*(2) configured." >&4
9293 : we could also check for sys/ipc.h ...
9294 if $h_sem && $test `./findhdr sys/sem.h`; then
9295 echo "You have the full sem*(2) library." >&4
9298 echo "You don't have the full sem*(2) library." >&4
9304 : see whether sys/sem.h defines union semun
9306 $cat > try.c <<'END'
9307 #include <sys/types.h>
9308 #include <sys/ipc.h>
9309 #include <sys/sem.h>
9310 int main () { union semun semun; semun.buf = 0; }
9313 if eval $compile; then
9314 echo "You have union semun in <sys/sem.h>." >&4
9317 echo "You do not have union semun in <sys/sem.h>." >&4
9320 $rm -f try try.c try.h
9324 : see how to do semctl IPC_STAT
9327 : see whether semctl IPC_STAT can use union semun
9332 # define S_IRUSR S_IREAD
9333 # define S_IWUSR S_IWRITE
9334 # define S_IXUSR S_IEXEC
9336 # define S_IRUSR 0400
9337 # define S_IWUSR 0200
9338 # define S_IXUSR 0100
9340 # define S_IRGRP (S_IRUSR>>3)
9341 # define S_IWGRP (S_IWUSR>>3)
9342 # define S_IXGRP (S_IXUSR>>3)
9343 # define S_IROTH (S_IRUSR>>6)
9344 # define S_IWOTH (S_IWUSR>>6)
9345 # define S_IXOTH (S_IXUSR>>6)
9348 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9349 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9350 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9355 #include <sys/types.h>
9356 #include <sys/ipc.h>
9357 #include <sys/sem.h>
9358 #include <sys/stat.h>
9365 #$d_union_semun HAS_UNION_SEMUN
9368 #ifndef HAS_UNION_SEMUN
9371 struct semid_ds *buf;
9372 unsigned short *array;
9378 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9379 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9381 struct semid_ds argbuf;
9384 st = semctl(sem, 0, IPC_STAT, arg);
9388 # endif /* IPC_STAT */
9389 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9391 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9392 # endif /* IPC_RMID */
9393 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9395 #endif /* IPC_PRIVATE && ... */
9396 printf("semget failed: errno = %d\n", errno);
9402 if eval $compile; then
9405 semun) val="$define" ;;
9411 case "$d_semctl_semun" in
9413 echo "You can use union semun for semctl IPC_STAT." >&4
9416 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9421 : see whether semctl IPC_STAT can use struct semid_ds pointer
9422 $cat > try.c <<'END'
9423 #include <sys/types.h>
9424 #include <sys/ipc.h>
9425 #include <sys/sem.h>
9426 #include <sys/stat.h>
9434 struct semid_ds arg;
9437 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9438 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9441 st = semctl(sem, 0, IPC_STAT, &arg);
9443 printf("semid_ds\n");
9445 # endif /* IPC_STAT */
9446 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9448 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9449 # endif /* IPC_RMID */
9450 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9452 #endif /* IPC_PRIVATE && ... */
9453 printf("semget failed: errno = %d\n", errno);
9460 if eval $compile; then
9463 semid_ds) val="$define" ;;
9467 set d_semctl_semid_ds
9469 case "$d_semctl_semid_ds" in
9471 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
9473 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
9480 # We do not have the full sem*(2) library, so assume we can not
9486 set d_semctl_semid_ds
9491 : see if setegid exists
9492 set setegid d_setegid
9495 : see if seteuid exists
9496 set seteuid d_seteuid
9499 : see if setgrent exists
9500 set setgrent d_setgrent
9503 : see if sethostent exists
9504 set sethostent d_sethent
9507 : see if setlinebuf exists
9508 set setlinebuf d_setlinebuf
9511 : see if setlocale exists
9512 set setlocale d_setlocale
9515 : see if setnetent exists
9516 set setnetent d_setnent
9519 : see if setprotoent exists
9520 set setprotoent d_setpent
9523 : see if setpgid exists
9524 set setpgid d_setpgid
9527 : see if setpgrp2 exists
9528 set setpgrp2 d_setpgrp2
9531 : see if setpriority exists
9532 set setpriority d_setprior
9535 : see if setpwent exists
9536 set setpwent d_setpwent
9539 : see if setregid exists
9540 set setregid d_setregid
9542 set setresgid d_setresgid
9545 : see if setreuid exists
9546 set setreuid d_setreuid
9548 set setresuid d_setresuid
9551 : see if setrgid exists
9552 set setrgid d_setrgid
9555 : see if setruid exists
9556 set setruid d_setruid
9559 : see if setservent exists
9560 set setservent d_setsent
9563 : see if setsid exists
9567 : see if setvbuf exists
9568 set setvbuf d_setvbuf
9571 : see if sfio.h is available
9576 : see if sfio library is available
9587 : Ok, but do we want to use it.
9591 true|$define|[yY]*) dflt='y';;
9594 echo "$package can use the sfio library, but it is experimental."
9595 rp="You seem to have sfio available, do you want to try using it?"
9599 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
9601 : Remove sfio from list of libraries to use
9602 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
9605 echo "libs = $libs" >&4
9609 *) case "$usesfio" in
9611 echo "Sorry, cannot find sfio on this machine" >&4
9612 echo "Ignoring your setting of usesfio=$usesfio" >&4
9620 $define) usesfio='true';;
9621 *) usesfio='false';;
9624 : see if shmctl exists
9628 : see if shmget exists
9632 : see if shmat exists
9635 : see what shmat returns
9638 $cat >shmat.c <<'END'
9639 #include <sys/shm.h>
9642 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
9647 echo "and it returns ($shmattype)." >&4
9648 : see if a prototype for shmat is available
9649 xxx=`./findhdr sys/shm.h`
9650 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
9651 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
9662 set d_shmatprototype
9665 : see if shmdt exists
9669 : see how much of the 'shm*(2)' library is present.
9672 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
9673 *"$undef"*) h_shm=false;;
9677 case "`ipcs 2>&1`" in
9678 "SVID shared memory"*"not configured"*)
9679 echo "Your $osname does not have the shm*(2) configured." >&4
9694 : we could also check for sys/ipc.h ...
9695 if $h_shm && $test `./findhdr sys/shm.h`; then
9696 echo "You have the full shm*(2) library." >&4
9699 echo "You don't have the full shm*(2) library." >&4
9706 : see if we have sigaction
9707 if set sigaction val -f d_sigaction; eval $csym; $val; then
9708 echo 'sigaction() found.' >&4
9709 $cat > try.c <<'EOP'
9711 #include <sys/types.h>
9715 struct sigaction act, oact;
9719 if eval $compile_ok; then
9722 echo "But you don't seem to have a useable struct sigaction." >&4
9726 echo 'sigaction NOT found.' >&4
9729 set d_sigaction; eval $setvar
9730 $rm -f try try$_o try.c
9732 : see if sigsetjmp exists
9734 case "$d_sigsetjmp" in
9742 if (sigsetjmp(env,1))
9750 if eval $compile; then
9751 if ./try >/dev/null 2>&1; then
9752 echo "POSIX sigsetjmp found." >&4
9756 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
9762 echo "sigsetjmp not found." >&4
9766 *) val="$d_sigsetjmp"
9767 case "$d_sigsetjmp" in
9768 $define) echo "POSIX sigsetjmp found." >&4;;
9769 $undef) echo "sigsetjmp not found." >&4;;
9777 : see if stat knows about block sizes
9779 set d_statblks stat st_blocks $i_sysstat sys/stat.h
9782 : see if _ptr and _cnt from stdio act std
9784 if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
9785 echo "(Looks like you have stdio.h from Linux.)"
9786 case "$stdio_ptr" in
9787 '') stdio_ptr='((fp)->_IO_read_ptr)'
9790 *) ptr_lval=$d_stdio_ptr_lval;;
9792 case "$stdio_cnt" in
9793 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
9796 *) cnt_lval=$d_stdio_cnt_lval;;
9798 case "$stdio_base" in
9799 '') stdio_base='((fp)->_IO_read_base)';;
9801 case "$stdio_bufsiz" in
9802 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
9805 case "$stdio_ptr" in
9806 '') stdio_ptr='((fp)->_ptr)'
9809 *) ptr_lval=$d_stdio_ptr_lval;;
9811 case "$stdio_cnt" in
9812 '') stdio_cnt='((fp)->_cnt)'
9815 *) cnt_lval=$d_stdio_cnt_lval;;
9817 case "$stdio_base" in
9818 '') stdio_base='((fp)->_base)';;
9820 case "$stdio_bufsiz" in
9821 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
9824 : test whether _ptr and _cnt really work
9825 echo "Checking how std your stdio is..." >&4
9828 #define FILE_ptr(fp) $stdio_ptr
9829 #define FILE_cnt(fp) $stdio_cnt
9831 FILE *fp = fopen("try.c", "r");
9834 18 <= FILE_cnt(fp) &&
9835 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
9843 if eval $compile; then
9845 echo "Your stdio acts pretty std."
9848 echo "Your stdio isn't very std."
9851 echo "Your stdio doesn't appear very std."
9857 : Can _ptr be used as an lvalue?
9858 case "$d_stdstdio$ptr_lval" in
9859 $define$define) val=$define ;;
9862 set d_stdio_ptr_lval
9865 : Can _cnt be used as an lvalue?
9866 case "$d_stdstdio$cnt_lval" in
9867 $define$define) val=$define ;;
9870 set d_stdio_cnt_lval
9873 : see if _base is also standard
9875 case "$d_stdstdio" in
9879 #define FILE_base(fp) $stdio_base
9880 #define FILE_bufsiz(fp) $stdio_bufsiz
9882 FILE *fp = fopen("try.c", "r");
9885 19 <= FILE_bufsiz(fp) &&
9886 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
9893 if eval $compile; then
9895 echo "And its _base field acts std."
9898 echo "But its _base field isn't std."
9901 echo "However, it seems to be lacking the _base field."
9909 : see if strcoll exists
9910 set strcoll d_strcoll
9913 : check for structure copying
9915 echo "Checking to see if your C compiler can copy structs..." >&4
9916 $cat >try.c <<'EOCP'
9926 if $cc -c try.c >/dev/null 2>&1 ; then
9931 echo "Nope, it can't."
9937 : see if strerror and/or sys_errlist[] exist
9939 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
9940 if set strerror val -f d_strerror; eval $csym; $val; then
9941 echo 'strerror() found.' >&4
9942 d_strerror="$define"
9943 d_strerrm='strerror(e)'
9944 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9945 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
9946 d_syserrlst="$define"
9948 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
9949 d_syserrlst="$undef"
9951 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
9952 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
9953 echo 'strerror() found in string header.' >&4
9954 d_strerror="$define"
9955 d_strerrm='strerror(e)'
9956 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9957 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
9958 d_syserrlst="$define"
9960 echo "(You don't appear to have any sys_errlist[], how can this be?)"
9961 d_syserrlst="$undef"
9963 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9964 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
9966 d_syserrlst="$define"
9967 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
9969 echo 'strerror() and sys_errlist[] NOT found.' >&4
9971 d_syserrlst="$undef"
9972 d_strerrm='"unknown"'
9976 : see if strtod exists
9980 : see if strtol exists
9984 : see if strtoul exists
9985 set strtoul d_strtoul
9988 : see if strxfrm exists
9989 set strxfrm d_strxfrm
9992 : see if symlink exists
9993 set symlink d_symlink
9996 : see if syscall exists
9997 set syscall d_syscall
10000 : see if sysconf exists
10001 set sysconf d_sysconf
10004 : see if system exists
10005 set system d_system
10008 : see if tcgetpgrp exists
10009 set tcgetpgrp d_tcgetpgrp
10012 : see if tcsetpgrp exists
10013 set tcsetpgrp d_tcsetpgrp
10016 : see if sys/types.h has to be included
10017 set sys/types.h i_systypes
10020 : see if prototype for telldir is available
10022 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10025 : define an is-a-typedef? function
10026 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10028 "") inclist="sys/types.h";;
10030 eval "varval=\$$var";
10034 for inc in $inclist; do
10035 echo "#include <$inc>" >>temp.c;
10037 echo "#ifdef $type" >> temp.c;
10038 echo "printf(\"We have $type\");" >> temp.c;
10039 echo "#endif" >> temp.c;
10040 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10041 if $contains $type temp.E >/dev/null 2>&1; then
10042 eval "$var=\$type";
10047 *) eval "$var=\$varval";;
10050 : define an is-a-typedef? function that prompts if the type is not available.
10051 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10053 "") inclist="sys/types.h";;
10055 eval "varval=\$$var";
10059 for inc in $inclist; do
10060 echo "#include <$inc>" >>temp.c;
10062 echo "#ifdef $type" >> temp.c;
10063 echo "printf(\"We have $type\");" >> temp.c;
10064 echo "#endif" >> temp.c;
10065 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10067 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10068 if $contains $type temp.E >/dev/null 2>&1; then
10069 echo "$type found." >&4;
10070 eval "$var=\$type";
10072 echo "$type NOT found." >&4;
10078 *) eval "$var=\$varval";;
10081 : see if this is a sys/times.h system
10082 set sys/times.h i_systimes
10085 : see if times exists
10087 if set times val -f d_times; eval $csym; $val; then
10088 echo 'times() found.' >&4
10091 case "$i_systimes" in
10092 "$define") inc='sys/times.h';;
10094 rp="What is the type returned by times() on this system?"
10095 set clock_t clocktype long stdio.h sys/types.h $inc
10098 echo 'times() NOT found, hope that will do.' >&4
10103 : see if truncate exists
10104 set truncate d_truncate
10107 : see if tzname[] exists
10109 if set tzname val -a d_tzname; eval $csym; $val; then
10111 echo 'tzname[] found.' >&4
10114 echo 'tzname[] NOT found.' >&4
10119 : see if umask exists
10123 : backward compatibility for d_hvfork
10124 if test X$d_hvfork != X; then
10125 d_vfork="$d_hvfork"
10128 : see if there is a vfork
10133 : Ok, but do we want to use it. vfork is reportedly unreliable in
10134 : perl on Solaris 2.x, and probably elsewhere.
10138 case "$usevfork" in
10142 rp="Some systems have problems with vfork(). Do you want to use it?"
10147 echo "Ok, we won't use vfork()."
10156 $define) usevfork='true';;
10157 *) usevfork='false';;
10160 : see if this is an sysdir system
10161 set sys/dir.h i_sysdir
10164 : see if this is an sysndir system
10165 set sys/ndir.h i_sysndir
10168 : see if closedir exists
10169 set closedir d_closedir
10172 case "$d_closedir" in
10175 echo "Checking whether closedir() returns a status..." >&4
10176 cat > closedir.c <<EOM
10177 #$i_dirent I_DIRENT /**/
10178 #$i_sysdir I_SYS_DIR /**/
10179 #$i_sysndir I_SYS_NDIR /**/
10180 #$i_systypes I_SYS_TYPES /**/
10182 #if defined(I_SYS_TYPES)
10183 #include <sys/types.h>
10185 #if defined(I_DIRENT)
10186 #include <dirent.h>
10187 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10188 #include <sys/dir.h>
10192 #include <sys/ndir.h>
10196 #include <ndir.h> /* may be wrong in the future */
10198 #include <sys/dir.h>
10203 int main() { return closedir(opendir(".")); }
10206 if eval $compile_ok; then
10207 if ./closedir > /dev/null 2>&1 ; then
10208 echo "Yes, it does."
10211 echo "No, it doesn't."
10215 echo "(I can't seem to compile the test program--assuming it doesn't)"
10223 set d_void_closedir
10226 : check for volatile keyword
10228 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10229 $cat >try.c <<'EOCP'
10232 typedef struct _goo_struct goo_struct;
10233 goo_struct * volatile goo = ((goo_struct *)0);
10234 struct _goo_struct {
10239 typedef unsigned short foo_t;
10240 char *volatile foo;
10242 volatile foo_t blech;
10246 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10248 echo "Yup, it does."
10251 echo "Nope, it doesn't."
10257 : see if there is a wait4
10261 : see if waitpid exists
10262 set waitpid d_waitpid
10265 : see if wcstombs exists
10266 set wcstombs d_wcstombs
10269 : see if wctomb exists
10270 set wctomb d_wctomb
10273 : see if writev exists
10274 set writev d_writev
10277 : preserve RCS keywords in files with variable substitution, grrr
10282 Revision='$Revision'
10284 : check for alignment requirements
10286 case "$alignbytes" in
10287 '') echo "Checking alignment constraints..." >&4
10288 $cat >try.c <<'EOCP'
10295 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10299 if eval $compile_ok; then
10303 echo "(I can't seem to compile the test program...)"
10306 *) dflt="$alignbytes"
10309 rp="Doubles must be aligned on a how-many-byte boundary?"
10314 : check for ordering of bytes in a long
10315 case "$byteorder" in
10319 In the following, larger digits indicate more significance. A big-endian
10320 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10321 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10322 machines may have weird orders like 3412. A Cray will report 87654321. If
10323 the test program works the default is probably right.
10324 I'm now running the test program...
10326 $cat >try.c <<'EOCP'
10333 char c[sizeof(long)];
10336 if (sizeof(long) > 4)
10337 u.l = (0x08070605L << 32) | 0x04030201L;
10340 for (i = 0; i < sizeof(long); i++)
10341 printf("%c", u.c[i]+'0');
10348 if eval $compile && ./try > /dev/null; then
10351 [1-4][1-4][1-4][1-4]|12345678|87654321)
10352 echo "(The test program ran ok.)"
10353 echo "byteorder=$dflt"
10356 ????|????????) echo "(The test program ran ok.)" ;;
10357 *) echo "(The test program didn't run right for some reason.)" ;;
10362 (I can't seem to compile the test program. Guessing big-endian...)
10365 case "$xxx_prompt" in
10367 rp="What is the order of bytes in a long?"
10378 : how do we catenate cpp tokens here?
10380 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
10381 $cat >cpp_stuff.c <<'EOCP'
10382 #define RCAT(a,b)a/**/b
10383 #define ACAT(a,b)a ## b
10387 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
10388 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
10389 echo "Oh! Smells like ANSI's been here." >&4
10390 echo "We can catify or stringify, separately or together!"
10392 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
10393 echo "Ah, yes! The good old days!" >&4
10394 echo "However, in the good old days we don't know how to stringify and"
10395 echo "catify at the same time."
10399 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
10400 to have to edit the values of CAT[2-5] in config.h...
10402 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
10406 : see if this is a db.h system
10412 : Check db version.
10414 echo "Checking Berkeley DB version ..." >&4
10420 #include <sys/types.h>
10425 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
10426 int Major, Minor, Patch ;
10427 unsigned long Version ;
10428 (void)db_version(&Major, &Minor, &Patch) ;
10429 printf("You have Berkeley DB Version 2 or greater\n");
10431 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
10432 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
10433 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
10434 Major, Minor, Patch) ;
10436 /* check that db.h & libdb are compatible */
10437 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
10438 printf("db.h and libdb are incompatible\n") ;
10442 printf("db.h and libdb are compatible\n") ;
10444 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
10445 + DB_VERSION_PATCH ;
10447 /* needs to be >= 2.3.4 */
10448 if (Version < 2003004) {
10449 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
10450 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
10456 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
10457 printf("You have Berkeley DB Version 1\n");
10458 exit(0); /* DB version < 2: the coast is clear. */
10460 exit(1); /* <db.h> not Berkeley DB? */
10466 if eval $compile && ./try; then
10467 echo 'Looks OK.' >&4
10469 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
10473 : Remove db from list of libraries to use
10474 echo "Removing unusable -ldb from library list" >&4
10475 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
10478 echo "libs = $libs" >&4
10488 : Check the return type needed for hash
10490 echo "Checking return type needed for hash for Berkeley DB ..." >&4
10496 #include <sys/types.h>
10499 #ifndef DB_VERSION_MAJOR
10500 u_int32_t hash_cb (ptr, size)
10508 info.hash = hash_cb;
10512 if $cc $ccflags -c try.c >try.out 2>&1 ; then
10513 if $contains warning try.out >>/dev/null 2>&1 ; then
10516 db_hashtype='u_int32_t'
10519 : XXX Maybe we should just give up here.
10520 db_hashtype=u_int32_t
10522 echo "Help: I can't seem to compile the db test program." >&4
10523 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
10526 echo "Your version of Berkeley DB uses $db_hashtype for hash."
10528 *) db_hashtype=u_int32_t
10533 : Check the return type needed for prefix
10535 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
10541 #include <sys/types.h>
10544 #ifndef DB_VERSION_MAJOR
10545 size_t prefix_cb (key1, key2)
10553 info.prefix = prefix_cb;
10557 if $cc $ccflags -c try.c >try.out 2>&1 ; then
10558 if $contains warning try.out >>/dev/null 2>&1 ; then
10559 db_prefixtype='int'
10561 db_prefixtype='size_t'
10564 db_prefixtype='size_t'
10565 : XXX Maybe we should just give up here.
10567 echo "Help: I can't seem to compile the db test program." >&4
10568 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
10571 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
10573 *) db_prefixtype='size_t'
10577 : check for void type
10579 echo "Checking to see how well your C compiler groks the void type..." >&4
10580 case "$voidflags" in
10582 $cat >try.c <<'EOCP'
10588 extern void moo(); /* function returning void */
10589 void (*goo)(); /* ptr to func returning void */
10591 void *hue; /* generic ptr */
10604 int main() { sub(); }
10606 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
10607 voidflags=$defvoidused
10608 echo "Good. It appears to support void to the level $package wants.">&4
10609 if $contains warning .out >/dev/null 2>&1; then
10610 echo "However, you might get some warnings that look like this:"
10614 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
10615 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
10616 echo "It supports 1..."
10617 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
10618 echo "It also supports 2..."
10619 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
10621 echo "And it supports 4 but not 8 definitely."
10623 echo "It doesn't support 4..."
10624 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
10626 echo "But it supports 8."
10629 echo "Neither does it support 8."
10633 echo "It does not support 2..."
10634 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
10636 echo "But it supports 4 and 8."
10638 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
10640 echo "And it supports 4 but has not heard about 8."
10642 echo "However it supports 8 but not 4."
10647 echo "There is no support at all for void."
10652 case "$voidflags" in
10654 *) $cat >&4 <<'EOM'
10655 Support flag bits are:
10656 1: basic void declarations.
10657 2: arrays of pointers to functions returning void.
10658 4: operations between pointers to and addresses of void functions.
10659 8: generic void pointers.
10662 rp="Your void support flags add up to what?"
10670 : How can we generate normalized random numbers ?
10672 echo "Looking for a random number function..." >&4
10673 case "$randfunc" in
10675 if set drand48 val -f; eval $csym; $val; then
10677 echo "Good, found drand48()." >&4
10678 elif set random val -f; eval $csym; $val; then
10680 echo "OK, found random()." >&4
10683 echo "Yick, looks like I have to use rand()." >&4
10694 *-Dmy_rand=*|*-Dmy_srand=*)
10695 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
10696 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
10697 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
10698 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
10702 while $test "$cont"; do
10703 rp="Use which function to generate random numbers?"
10705 if $test "$ans" = "$dflt"; then
10711 if set $ans val -f; eval $csym; $val; then
10715 rp="I cannot find function $ans. Use that name anyway?"
10724 case "$randfunc" in
10726 drand01="drand48()"
10732 case "$randbits" in
10734 echo "Checking to see how many bits your $randfunc() function produces..." >&4
10736 #$i_unistd I_UNISTD
10737 #$i_stdlib I_STDLIB
10740 # include <unistd.h>
10743 # include <stdlib.h>
10748 register unsigned long tmp;
10749 register unsigned long max = 0L;
10751 for (i = 1000; i; i--) {
10752 tmp = (unsigned long) $randfunc();
10753 if (tmp > max) max = tmp;
10755 for (i = 0; max; i++)
10761 if eval $compile_ok; then
10765 echo "(I can't seem to compile the test program...)"
10772 rp="How many bits does your $randfunc() function produce?"
10776 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
10777 seedfunc="s$randfunc"
10778 randseedtype=unsigned
10782 rp="How many bits does your $randfunc() function produce?"
10785 seedfunc="s$randfunc"
10786 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
10787 if set $seedfunc val -f; eval $csym; $val; then
10788 echo "(Using $seedfunc() to seed random generator)"
10790 echo "(Warning: no $seedfunc() to seed random generator)"
10793 randseedtype=unsigned
10801 echo "Determining whether or not we are on an EBCDIC system..." >&4
10802 $cat >tebcdic.c <<'EOM'
10805 if ('M'==0xd4) return 0;
10812 if eval $compile_ok; then
10814 echo "You have EBCDIC." >&4
10817 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4
10820 echo "I'm unable to compile the test program." >&4
10821 echo "I'll assume ASCII or some ISO Latin." >&4
10823 $rm -f tebcdic.c tebcdic
10827 : see what type file positions are declared as in the library
10828 rp="What is the type for file position used by fsetpos()?"
10829 set fpos_t fpostype long stdio.h sys/types.h
10832 : Store the full pathname to the ar program for use in the C program
10833 : Respect a hint or command line value for full_ar.
10838 : Store the full pathname to the sed program for use in the C program
10841 : see what type gids are declared as in the kernel
10843 echo "Looking for the type for group ids returned by getgid()."
10844 set gid_t gidtype xxx stdio.h sys/types.h
10848 xxx=`./findhdr sys/user.h`
10849 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
10851 unsigned) dflt="$1 $2" ;;
10855 *) dflt="$gidtype";;
10858 gid_t) echo "gid_t found." ;;
10859 *) rp="What is the type for group ids returned by getgid()?"
10865 : see if getgroups exists
10866 set getgroups d_getgrps
10869 : see if setgroups exists
10870 set setgroups d_setgrps
10874 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
10876 case "$d_getgrps$d_setgrps" in
10878 case "$groupstype" in
10879 '') dflt="$gidtype" ;;
10880 *) dflt="$groupstype" ;;
10883 What type of pointer is the second argument to getgroups() and setgroups()?
10884 Usually this is the same as group ids, $gidtype, but not always.
10887 rp='What type pointer is the second argument to getgroups() and setgroups()?'
10891 *) groupstype="$gidtype";;
10894 : see what type lseek is declared as in the kernel
10895 rp="What is the type used for lseek's offset on this system?"
10896 set off_t lseektype long stdio.h sys/types.h
10900 $echo $n "Checking to see how big your file offsets are...$c" >&4
10902 #include <sys/types.h>
10906 printf("%d\n", sizeof($lseektype));
10910 if eval $compile_ok; then
10912 $echo " $lseeksize bytes." >&4
10916 echo "(I can't seem to compile the test program. Guessing...)"
10917 rp="What is the size of your file offsets (in bytes)?"
10924 echo "Checking if your $make program sets \$(MAKE)..." >&4
10925 case "$make_set_make" in
10927 $sed 's/^X //' > testmake.mak << 'EOF'
10929 X @echo 'maketemp="$(MAKE)"'
10931 case "`$make -f testmake.mak 2>/dev/null`" in
10932 *maketemp=*) make_set_make='#' ;;
10933 *) make_set_make="MAKE=$make" ;;
10935 $rm -f testmake.mak
10938 case "$make_set_make" in
10939 '#') echo "Yup, it does.";;
10940 *) echo "Nope, it doesn't.";;
10943 : see what type is used for mode_t
10944 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
10945 set mode_t modetype int stdio.h sys/types.h
10948 : define a fucntion to check prototypes
10949 $cat > protochk <<EOSH
10952 optimize="$optimize"
10954 prototype="$prototype"
10959 $cat >> protochk <<'EOSH'
10964 while test $# -ge 2; do
10966 $define) echo "#include <$2>" >> try.c ;;
10967 literal) echo "$2" >> try.c ;;
10971 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10972 cat >> try.c <<'EOCP'
10973 #ifdef CAN_PROTOTYPE
10974 #define _(args) args
10979 echo "$foo" >> try.c
10980 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10981 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10987 $eunicefix protochk
10989 : see what type is used for size_t
10990 rp="What is the type used for the length parameter for string functions?"
10991 set size_t sizetype 'unsigned int' stdio.h sys/types.h
10994 : check for type of arguments to gethostbyaddr.
10995 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
10996 case "$d_gethbyaddr" in
11000 Checking to see what type of arguments are accepted by gethostbyaddr().
11002 hdrs="$define sys/types.h
11003 $d_socket sys/socket.h
11004 $i_niin netinet/in.h
11006 $i_unistd unistd.h"
11007 : The first arg can 'char *' or 'void *'
11008 : The second arg is some of integral type
11009 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11010 for yyy in size_t long int; do
11011 case "$netdb_host_type" in
11012 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11013 if ./protochk "$try" $hdrs; then
11014 echo "Your system accepts $xxx for the first arg."
11015 echo "...and $yyy for the second arg."
11016 netdb_host_type="$xxx"
11017 netdb_hlen_type="$yyy"
11023 : In case none of those worked, prompt the user.
11024 case "$netdb_host_type" in
11025 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11028 netdb_host_type=$ans
11029 rp='What is the type for the 2nd argument to gethostbyaddr?'
11032 netdb_hlen_type=$ans
11036 *) : no gethostbyaddr, so pick harmless defaults
11037 netdb_host_type='char *'
11038 netdb_hlen_type="$sizetype"
11041 # Remove the "const" if needed. -- but then we'll have a
11043 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11046 : check for type of argument to gethostbyname.
11047 if test "X$netdb_name_type" = X ; then
11048 case "$d_gethbyname" in
11052 Checking to see what type of argument is accepted by gethostbyname().
11054 hdrs="$define sys/types.h
11055 $d_socket sys/socket.h
11056 $i_niin netinet/in.h
11058 $i_unistd unistd.h"
11059 for xxx in "const char *" "char *"; do
11060 case "$netdb_name_type" in
11061 '') try="extern struct hostent *gethostbyname($xxx);"
11062 if ./protochk "$try" $hdrs; then
11063 echo "Your system accepts $xxx."
11064 netdb_name_type="$xxx"
11069 : In case none of those worked, prompt the user.
11070 case "$netdb_name_type" in
11071 '') rp='What is the type for the 1st argument to gethostbyname?'
11074 netdb_name_type=$ans
11078 *) : no gethostbyname, so pick harmless default
11079 netdb_name_type='char *'
11084 : check for type of 1st argument to getnetbyaddr.
11085 if test "X$netdb_net_type" = X ; then
11086 case "$d_getnbyaddr" in
11090 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11092 hdrs="$define sys/types.h
11093 $d_socket sys/socket.h
11094 $i_niin netinet/in.h
11096 $i_unistd unistd.h"
11097 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11098 case "$netdb_net_type" in
11099 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11100 if ./protochk "$try" $hdrs; then
11101 echo "Your system accepts $xxx."
11102 netdb_net_type="$xxx"
11107 : In case none of those worked, prompt the user.
11108 case "$netdb_net_type" in
11109 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11112 netdb_net_type=$ans
11116 *) : no getnetbyaddr, so pick harmless default
11117 netdb_net_type='long'
11121 : locate the preferred pager for this system
11135 '') dflt=/usr/ucb/more;;
11142 rp='What pager is used on your system?'
11146 : see what type pids are declared as in the kernel
11147 rp="What is the type of process ids on this system?"
11148 set pid_t pidtype int stdio.h sys/types.h
11151 : check for length of pointer
11155 $echo $n "Checking to see how big your pointers are...$c" >&4
11156 if test "$voidflags" -gt 7; then
11157 echo '#define VOID_PTR char *' > try.c
11159 echo '#define VOID_PTR void *' > try.c
11161 $cat >>try.c <<'EOCP'
11165 printf("%d\n", sizeof(VOID_PTR));
11170 if eval $compile_ok; then
11172 $echo " $ptrsize bytes." >&4
11175 echo "(I can't seem to compile the test program. Guessing...)" >&4
11176 rp="What is the size of a pointer (in bytes)?"
11184 : see if ar generates random libraries by itself
11186 echo "Checking how to generate random libraries on your machine..." >&4
11187 echo 'int bar1() { return bar2(); }' > bar1.c
11188 echo 'int bar2() { return 2; }' > bar2.c
11189 $cat > foo.c <<'EOP'
11190 int main() { printf("%d\n", bar1()); exit(0); }
11192 $cc $ccflags -c bar1.c >/dev/null 2>&1
11193 $cc $ccflags -c bar2.c >/dev/null 2>&1
11194 $cc $ccflags -c foo.c >/dev/null 2>&1
11195 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
11196 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11197 ./foobar >/dev/null 2>&1; then
11198 echo "$ar appears to generate random libraries itself."
11201 elif $ar ts bar$_a >/dev/null 2>&1 &&
11202 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11203 ./foobar >/dev/null 2>&1; then
11204 echo "a table of contents needs to be added with '$ar ts'."
11211 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
11212 $test -f $ranlib || ranlib=''
11215 if $test -n "$ranlib"; then
11216 echo "your system has '$ranlib'; we'll use that."
11219 echo "your system doesn't seem to support random libraries"
11220 echo "so we'll use lorder and tsort to order the libraries."
11227 : check for type of arguments to select.
11228 case "$selecttype" in
11229 '') case "$d_select" in
11232 Checking to see what type of arguments are accepted by select().
11234 hdrs="$define sys/types.h
11235 $i_systime sys/time.h
11236 $i_sysselct sys/select.h
11237 $d_socket sys/socket.h"
11238 : The first arg can be int, unsigned, or size_t
11239 : The last arg may or may not be 'const'
11241 : void pointer has been seen but using that
11242 : breaks the selectminbits test
11243 for xxx in 'fd_set *' 'int *'; do
11244 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
11245 for tmo in 'struct timeval *' 'const struct timeval *'; do
11247 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
11248 if ./protochk "$try" $hdrs; then
11249 echo "Your system accepts $xxx."
11258 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
11259 case "$d_fd_set" in
11260 $define) dflt="fd_set *" ;;
11269 *) : no select, so pick a harmless default
11276 : check for the select 'width'
11277 case "$selectminbits" in
11278 '') case "$d_select" in
11282 Checking to see on how many bits at a time your select() operates...
11285 #include <sys/types.h>
11287 #$i_systime I_SYS_TIME
11288 #$i_systimek I_SYS_TIME_KERNEL
11293 # ifdef I_SYS_TIME_KERNEL
11296 # include <sys/time.h>
11297 # ifdef I_SYS_TIME_KERNEL
11301 #$i_sysselct I_SYS_SELECT
11302 #ifdef I_SYS_SELECT
11303 #include <sys/select.h>
11307 #define S sizeof(*(b))
11309 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
11310 #define NBITS (NBYTES * 8)
11319 fp = fopen("try.c", "r");
11325 b = ($selecttype)s;
11326 for (i = 0; i < NBITS; i++)
11330 select(fd + 1, b, 0, 0, &t);
11331 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
11332 printf("%d\n", i + 1);
11337 if eval $compile_ok; then
11338 selectminbits=`./try`
11339 case "$selectminbits" in
11341 Cannot figure out on how many bits at a time your select() operates.
11342 I'll play safe and guess it is 32 bits.
11348 *) bits="$selectminbits bits" ;;
11350 echo "Your select() operates on $bits at a time." >&4
11352 rp='What is the minimum number of bits your select() operates on?'
11353 case "$byteorder" in
11354 1234|12345678) dflt=32 ;;
11359 selectminbits="$val"
11363 *) : no select, so pick a harmless default
11370 : Trace out the files included by signal.h, then look for SIGxxx names.
11371 : Remove SIGARRAYSIZE used by HPUX.
11372 : Remove SIGTYP void lines used by OS2.
11373 xxx=`echo '#include <signal.h>' |
11374 $cppstdin $cppminus $cppflags 2>/dev/null |
11375 $grep '^[ ]*#.*include' |
11376 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
11377 : Check this list of files to be sure we have parsed the cpp output ok.
11378 : This will also avoid potentially non-existent files, such
11381 for xx in $xxx /dev/null ; do
11382 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
11384 : If we have found no files, at least try signal.h
11385 case "$xxxfiles" in
11386 '') xxxfiles=`./findhdr signal.h` ;;
11389 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ {
11390 print substr($2, 4, 20)
11392 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
11393 print substr($3, 4, 20)
11395 : Append some common names just in case the awk scan failed.
11396 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
11397 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
11398 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
11399 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
11400 : generate a few handy files for later
11401 $cat > signal.c <<'EOCP'
11402 #include <sys/types.h>
11403 #include <signal.h>
11407 /* Strange style to avoid deeply-nested #if/#else/#endif */
11410 # define NSIG (_NSIG)
11416 # define NSIG (SIGMAX+1)
11422 # define NSIG (SIG_MAX+1)
11428 # define NSIG (MAXSIG+1)
11434 # define NSIG (MAX_SIG+1)
11439 # ifdef SIGARRAYSIZE
11440 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
11446 # define NSIG (_sys_nsig) /* Solaris 2.5 */
11450 /* Default to some arbitrary number that's big enough to get most
11451 of the common signals.
11457 printf("NSIG %d\n", NSIG);
11463 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
11465 printf "#ifdef SIG"; printf $1; printf "\n"
11466 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
11467 printf $1; printf ");\n"
11471 printf "#endif /* JUST_NSIG */\n";
11475 $cat >signal.awk <<'EOP'
11476 BEGIN { ndups = 0 }
11477 $1 ~ /^NSIG$/ { nsig = $2 }
11478 ($1 !~ /^NSIG$/) && (NF == 2) {
11479 if ($2 > maxsig) { maxsig = $2 }
11480 if (sig_name[$2]) {
11481 dup_name[ndups] = $1
11482 dup_num[ndups] = $2
11492 if (nsig == 0) { nsig = maxsig + 1 }
11493 for (n = 1; n < nsig; n++) {
11495 printf("%s %d\n", sig_name[n], sig_num[n])
11498 printf("NUM%d %d\n", n, n)
11501 for (n = 0; n < ndups; n++) {
11502 printf("%s %d\n", dup_name[n], dup_num[n])
11506 $cat >signal_cmd <<EOS
11508 if $test -s signal.lst; then
11509 echo "Using your existing signal.lst file"
11514 $cat >>signal_cmd <<'EOS'
11517 if eval $compile_ok; then
11518 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
11520 echo "(I can't seem be able to compile the whole test program)" >&4
11521 echo "(I'll try it in little pieces.)" >&4
11522 set signal -DJUST_NSIG
11523 if eval $compile_ok; then
11524 ./signal$_exe > signal.nsg
11527 echo "I can't seem to figure out how many signals you have." >&4
11528 echo "Guessing 50." >&4
11529 echo 'NSIG 50' > signal.nsg
11531 : Now look at all the signal names, one at a time.
11532 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
11533 $cat > signal.c <<EOCP
11534 #include <sys/types.h>
11535 #include <signal.h>
11538 printf("$xx %d\n", SIG${xx});
11543 if eval $compile; then
11544 echo "SIG${xx} found."
11545 ./signal$_exe >> signal.ls1
11547 echo "SIG${xx} NOT found."
11550 if $test -s signal.ls1; then
11551 $cat signal.nsg signal.ls1 |
11552 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
11556 if $test -s signal.lst; then
11559 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
11560 echo 'kill -l' >signal
11561 set X `csh -f <signal`
11565 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
11567 echo $@ | $tr ' ' $trnl | \
11568 $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
11570 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
11572 chmod a+x signal_cmd
11573 $eunicefix signal_cmd
11575 : generate list of signal names
11577 case "$sig_name_init" in
11579 *) case "$sig_num_init" in
11580 ''|*,*) doinit=yes ;;
11585 echo "Generating a list of signal names and numbers..." >&4
11587 sig_name=`$awk '{printf "%s ", $1}' signal.lst`
11588 sig_name="ZERO $sig_name"
11589 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
11590 { printf "\"%s\", ", $1 }
11591 END { printf "0\n" }' signal.lst`
11592 sig_num=`$awk '{printf "%d ", $2}' signal.lst`
11593 sig_num="0 $sig_num"
11594 sig_num_init=`$awk 'BEGIN { printf "0, " }
11595 { printf "%d, ", $2}
11596 END { printf "0\n"}' signal.lst`
11599 echo "The following signals are available:"
11601 echo $sig_name | $awk \
11602 'BEGIN { linelen = 0 }
11604 for (i = 1; i <= NF; i++) {
11605 name = "SIG" $i " "
11606 linelen = linelen + length(name)
11607 if (linelen > 70) {
11609 linelen = length(name)
11615 $rm -f signal signal.c signal.awk signal.lst signal_cmd
11617 : see what type is used for signed size_t
11618 set ssize_t ssizetype int stdio.h sys/types.h
11621 $cat > ssize.c <<EOM
11623 #include <sys/types.h>
11624 #define Size_t $sizetype
11625 #define SSize_t $dflt
11628 if (sizeof(Size_t) == sizeof(SSize_t))
11630 else if (sizeof(Size_t) == sizeof(int))
11639 if eval $compile_ok && ./ssize > /dev/null; then
11640 ssizetype=`./ssize`
11641 echo "I'll be using $ssizetype for functions returning a byte count." >&4
11644 Help! I can't compile and run the ssize_t test program: please enlighten me!
11645 (This is probably a misconfiguration in your system or libraries, and
11646 you really ought to fix it. Still, I'll try anyway.)
11648 I need a type that is the same size as $sizetype, but is guaranteed to
11649 be signed. Common values are ssize_t, int and long.
11652 rp="What signed type is the same size as $sizetype?"
11656 $rm -f ssize ssize.*
11658 : see what type of char stdio uses.
11660 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11661 echo "Your stdio uses unsigned chars." >&4
11662 stdchar="unsigned char"
11664 echo "Your stdio uses signed chars." >&4
11668 : see if time exists
11670 if test "X$d_time" = X -o X"$timetype" = X; then
11671 if set time val -f d_time; eval $csym; $val; then
11672 echo 'time() found.' >&4
11674 rp="What is the type returned by time() on this system?"
11675 set time_t timetype long stdio.h sys/types.h
11678 echo 'time() not found, hope that will do.' >&4
11686 : see what type uids are declared as in the kernel
11688 echo "Looking for the type for user ids returned by getuid()."
11689 set uid_t uidtype xxx stdio.h sys/types.h
11693 xxx=`./findhdr sys/user.h`
11694 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
11696 unsigned) dflt="$1 $2" ;;
11700 *) dflt="$uidtype";;
11703 uid_t) echo "uid_t found." ;;
11704 *) rp="What is the type for user ids returned by getuid()?"
11710 : see if dbm.h is available
11711 : see if dbmclose exists
11712 set dbmclose d_dbmclose
11715 case "$d_dbmclose" in
11725 *) set rpcsvc/dbm.h i_rpcsvcdbm
11730 *) echo "We won't be including <dbm.h>"
11740 : see if this is a sys/file.h system
11745 : do we need to include sys/file.h ?
11749 if $h_sysfile; then
11751 echo "We'll be including <sys/file.h>." >&4
11754 echo "We won't be including <sys/file.h>." >&4
11764 : see if fcntl.h is there
11769 : see if we can include fcntl.h
11775 echo "We'll be including <fcntl.h>." >&4
11778 if $h_sysfile; then
11779 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11781 echo "We won't be including <fcntl.h>." >&4
11793 : see if locale.h is available
11794 set locale.h i_locale
11797 : see if mach cthreads are available
11798 if test "X$usethreads" = "X$define"; then
11799 set mach/cthreads.h i_machcthr
11802 i_machcthr="$undef"
11807 : see if this is a math.h system
11811 : see if this is a mntent.h system
11812 set mntent.h i_mntent
11815 : see if ndbm.h is available
11820 : see if dbm_open exists
11821 set dbm_open d_dbm_open
11823 case "$d_dbm_open" in
11826 echo "We won't be including <ndbm.h>"
11835 : see if net/errno.h is available
11837 set net/errno.h val
11840 : Unfortunately, it causes problems on some systems. Arrgh.
11843 cat > try.c <<'EOM'
11846 #include <net/errno.h>
11852 if $cc $ccflags -c try.c >/dev/null 2>&1; then
11853 echo "We'll be including <net/errno.h>." >&4
11855 echo "We won't be including <net/errno.h>." >&4
11864 : see if this is a poll.h system
11868 : get C preprocessor symbols handy
11870 $echo $n "Hmm... $c"
11871 echo $al | $tr ' ' $trnl >Cppsym.know
11872 $cat <<EOSS >Cppsym
11880 case "\$list\$#" in
11883 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
11885 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
11888 unknown="\$unknown \$sym"
11898 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
11900 exit 0; _ _ _ _\1\\ \1\\
11903 echo "exit 1; _ _ _" >>Cppsym\$\$
11904 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
11906 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
11912 $rm -f Cppsym\$\$ Cppsym2\$\$
11917 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
11919 : now check the C compiler for additional symbols
11925 for i in \`$cc -v -c tmp.c 2>&1\`
11928 -D*) echo "\$i" | $sed 's/^-D//';;
11929 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
11936 ./ccsym > ccsym1.raw
11937 if $test -s ccsym1.raw; then
11938 $sort ccsym1.raw | $uniq >ccsym.raw
11940 mv ccsym1.raw ccsym.raw
11943 $awk '/\=/ { print $0; next }
11944 { print $0"=1" }' ccsym.raw >ccsym.list
11945 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
11946 $comm -13 ccsym.true ccsym.list >ccsym.own
11947 $comm -12 ccsym.true ccsym.list >ccsym.com
11948 $comm -23 ccsym.true ccsym.list >ccsym.cpp
11950 if $test -z ccsym.raw; then
11951 echo "Your C compiler doesn't seem to define any symbols!" >&4
11953 echo "However, your C preprocessor defines the following symbols:"
11956 cppsymbols=`$cat Cppsym.true`
11957 cppsymbols=`echo $cppsymbols`
11958 cppccsymbols="$cppsymbols"
11960 if $test -s ccsym.com; then
11961 echo "Your C compiler and pre-processor define these symbols:"
11962 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
11965 cppccsymbols=`$cat ccsym.com`
11966 cppccsymbols=`echo $cppccsymbols`
11967 $test "$silent" || sleep 1
11969 if $test -s ccsym.cpp; then
11970 $test "$also" && echo " "
11971 echo "Your C pre-processor ${also}defines the following symbols:"
11972 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
11974 cppsymbols=`$cat ccsym.cpp`
11975 cppsymbols=`echo $cppsymbols`
11976 $test "$silent" || sleep 1
11978 if $test -s ccsym.own; then
11979 $test "$also" && echo " "
11980 echo "Your C compiler ${also}defines the following cpp symbols:"
11981 $sed -e 's/\(.*\)=1/\1/' ccsym.own
11982 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
11983 ccsymbols=`$cat ccsym.own`
11984 ccsymbols=`echo $ccsymbols`
11985 $test "$silent" || sleep 1
11990 : see if this is a termio system
11994 if $test `./findhdr termios.h`; then
11995 set tcsetattr i_termios
12001 "$define") echo "You have POSIX termios.h... good!" >&4;;
12002 *) if ./Cppsym pyr; then
12003 case "`/bin/universe`" in
12004 ucb) if $test `./findhdr sgtty.h`; then
12006 echo "<sgtty.h> found." >&4
12008 echo "System is pyramid with BSD universe."
12009 echo "<sgtty.h> not found--you could have problems." >&4
12011 *) if $test `./findhdr termio.h`; then
12013 echo "<termio.h> found." >&4
12015 echo "System is pyramid with USG universe."
12016 echo "<termio.h> not found--you could have problems." >&4
12020 if $test `./findhdr termio.h`; then
12021 echo "<termio.h> found." >&4
12023 elif $test `./findhdr sgtty.h`; then
12024 echo "<sgtty.h> found." >&4
12027 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12030 if $test `./findhdr sgtty.h`; then
12031 echo "<sgtty.h> found." >&4
12033 elif $test `./findhdr termio.h`; then
12034 echo "<termio.h> found." >&4
12037 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12041 set i_termio; eval $setvar
12042 val=$val2; set i_sgtty; eval $setvar
12043 val=$val3; set i_termios; eval $setvar
12045 : see if stdarg is available
12047 if $test `./findhdr stdarg.h`; then
12048 echo "<stdarg.h> found." >&4
12051 echo "<stdarg.h> NOT found." >&4
12055 : see if varags is available
12057 if $test `./findhdr varargs.h`; then
12058 echo "<varargs.h> found." >&4
12060 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12063 : set up the varargs testing programs
12064 $cat > varargs.c <<EOP
12066 #include <stdarg.h>
12069 #include <varargs.h>
12073 int f(char *p, ...)
12087 p = va_arg(ap, char *);
12092 $cat > varargs <<EOP
12094 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
12103 : now check which varargs header should be included
12108 if `./varargs I_STDARG`; then
12110 elif `./varargs I_VARARGS`; then
12115 if `./varargs I_VARARGS`; then
12122 echo "I could not find the definition for va_dcl... You have problems..." >&4
12123 val="$undef"; set i_stdarg; eval $setvar
12124 val="$undef"; set i_varargs; eval $setvar
12129 case "$i_varhdr" in
12131 val="$define"; set i_stdarg; eval $setvar
12132 val="$undef"; set i_varargs; eval $setvar
12135 val="$undef"; set i_stdarg; eval $setvar
12136 val="$define"; set i_varargs; eval $setvar
12139 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
12143 : see if stddef is available
12144 set stddef.h i_stddef
12147 : see if sys/access.h is available
12148 set sys/access.h i_sysaccess
12151 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
12152 set sys/filio.h i_sysfilio
12155 if $test `./findhdr sys/ioctl.h`; then
12157 echo '<sys/ioctl.h> found.' >&4
12160 if $test $i_sysfilio = "$define"; then
12161 echo '<sys/ioctl.h> NOT found.' >&4
12163 $test $i_sgtty = "$define" && xxx="sgtty.h"
12164 $test $i_termio = "$define" && xxx="termio.h"
12165 $test $i_termios = "$define" && xxx="termios.h"
12166 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
12172 : see if sys/resource.h has to be included
12173 set sys/resource.h i_sysresrc
12176 : see if sys/security.h is available
12177 set sys/security.h i_syssecrt
12180 : see if this is a sys/statvfs.h system
12181 set sys/statvfs.h i_sysstatvfs
12184 : see if this is a sys/un.h system
12185 set sys/un.h i_sysun
12188 : see if this is a syswait system
12189 set sys/wait.h i_syswait
12192 : see if this is an utime system
12193 set utime.h i_utime
12196 : see if this is a values.h system
12197 set values.h i_values
12200 : see if this is a vfork system
12203 set vfork.h i_vfork
12211 : see if gdbm.h is available
12216 : see if gdbm_open exists
12217 set gdbm_open d_gdbm_open
12219 case "$d_gdbm_open" in
12222 echo "We won't be including <gdbm.h>"
12232 echo "Looking for extensions..." >&4
12235 : If we are using the old config.sh, known_extensions may contain
12236 : old or inaccurate or duplicate values.
12237 known_extensions=''
12238 nonxs_extensions=''
12239 : We do not use find because it might not be available.
12240 : We do not just use MANIFEST because the user may have dropped
12241 : some additional extensions into the source tree and expect them
12245 DynaLoader|dynaload) ;;
12246 *) if $test -f $xxx/$xxx.xs; then
12247 known_extensions="$known_extensions $xxx"
12248 elif $test -f $xxx/Makefile.PL; then
12249 nonxs_extensions="$nonxs_extensions $xxx"
12251 if $test -d $xxx; then
12252 # Look for nested extensions, eg. Devel/Dprof.
12255 if $test -f $yyy/$yyy.xs; then
12256 known_extensions="$known_extensions $xxx/$yyy"
12257 elif $test -f $yyy/Makefile.PL; then
12258 nonxs_extensions="$nonxs_extensions $xxx/$yyy"
12267 set X $nonxs_extensions
12269 nonxs_extensions="$*"
12270 set X $known_extensions
12272 known_extensions="$*"
12275 : Now see which are supported on this system.
12277 for xxx in $known_extensions ; do
12281 $define) avail_ext="$avail_ext $xxx" ;;
12284 GDBM_File|gdbm_fil)
12286 $define) avail_ext="$avail_ext $xxx" ;;
12289 NDBM_File|ndbm_fil)
12291 $define) avail_ext="$avail_ext $xxx" ;;
12294 ODBM_File|odbm_fil)
12295 case "${i_dbm}${i_rpcsvcdbm}" in
12296 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
12300 case "$useposix" in
12301 true|define|y) avail_ext="$avail_ext $xxx" ;;
12305 case "$useopcode" in
12306 true|define|y) avail_ext="$avail_ext $xxx" ;;
12310 case "$d_socket" in
12311 true|$define|y) avail_ext="$avail_ext $xxx" ;;
12315 case "$usethreads" in
12316 true|$define|y) avail_ext="$avail_ext $xxx" ;;
12320 : XXX Do we need a useipcsysv variable here
12321 case "${d_msg}${d_sem}${d_shm}" in
12322 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
12325 *) avail_ext="$avail_ext $xxx"
12334 : Now see which nonxs extensions are supported on this system.
12335 : For now assume all are.
12337 for xxx in $nonxs_extensions ; do
12339 *) nonxs_ext="$nonxs_ext $xxx"
12351 A number of extensions are supplied with $package. You may choose to
12352 compile these extensions for dynamic loading (the default), compile
12353 them into the $package executable (static loading), or not include
12354 them at all. Answer "none" to include no extensions.
12355 Note that DynaLoader is always built and need not be mentioned here.
12358 case "$dynamic_ext" in
12359 '') dflt="$avail_ext" ;;
12360 *) dflt="$dynamic_ext"
12361 # Perhaps we are reusing an old out-of-date config.sh.
12364 if test X"$dynamic_ext" != X"$avail_ext"; then
12366 NOTICE: Your previous config.sh list may be incorrect.
12367 The extensions now available to you are
12369 but the default list from your previous config.sh is
12381 rp="What extensions do you wish to load dynamically?"
12384 none) dynamic_ext=' ' ;;
12385 *) dynamic_ext="$ans" ;;
12388 case "$static_ext" in
12390 : Exclude those already listed in dynamic linking
12392 for xxx in $avail_ext; do
12393 case " $dynamic_ext " in
12395 *) dflt="$dflt $xxx" ;;
12402 *) dflt="$static_ext"
12409 rp="What extensions do you wish to load statically?"
12412 none) static_ext=' ' ;;
12413 *) static_ext="$ans" ;;
12418 A number of extensions are supplied with $package. Answer "none"
12419 to include no extensions.
12420 Note that DynaLoader is always built and need not be mentioned here.
12423 case "$static_ext" in
12424 '') dflt="$avail_ext" ;;
12425 *) dflt="$static_ext"
12426 # Perhaps we are reusing an old out-of-date config.sh.
12429 if test X"$static_ext" != X"$avail_ext"; then
12431 NOTICE: Your previous config.sh list may be incorrect.
12432 The extensions now available to you are
12434 but the default list from your previous config.sh is
12443 : Exclude those that are not xs extensions
12447 rp="What extensions do you wish to include?"
12450 none) static_ext=' ' ;;
12451 *) static_ext="$ans" ;;
12456 set X $dynamic_ext $static_ext $nonxs_ext
12460 : Remove build directory name from cppstdin so it can be used from
12461 : either the present location or the final installed location.
12463 : Get out of the UU directory to get correct path name.
12465 case "$cppstdin" in
12467 echo "Stripping down cppstdin path name"
12473 : end of configuration questions
12475 echo "End of configuration questions."
12478 : back to where it started
12479 if test -d ../UU; then
12483 : configuration may be patched via a 'config.over' file
12484 if $test -f config.over; then
12487 rp='I see a config.over file. Do you wish to load it?'
12490 n*) echo "OK, I'll ignore it.";;
12492 echo "Configuration override changes have been loaded."
12497 : in case they want portability, strip down executable paths
12498 case "$d_portable" in
12501 echo "Stripping down executable paths..." >&4
12502 for file in $loclist $trylist; do
12503 if test X$file != Xln -a X$file != Xar -o X$osname != Xos2; then
12504 eval $file="\$file"
12510 : create config.sh file
12512 echo "Creating config.sh..." >&4
12513 $spitshell <<EOT >config.sh
12516 # This file was produced by running the Configure script. It holds all the
12517 # definitions figured out by Configure. Should you modify one of these values,
12518 # do not forget to propagate your changes by running "Configure -der". You may
12519 # instead choose to run each of the .SH files by yourself, or "Configure -S".
12522 # Package name : $package
12523 # Source directory : $src
12524 # Configuration time: $cf_time
12525 # Configured by : $cf_by
12526 # Target system : $myuname
12536 Revision='$Revision'
12543 alignbytes='$alignbytes'
12544 ansi2knr='$ansi2knr'
12545 aphostname='$aphostname'
12546 apiversion='$apiversion'
12549 archlibexp='$archlibexp'
12550 archname64='$archname64'
12551 archname='$archname'
12552 archobjs='$archobjs'
12560 byteorder='$byteorder'
12562 castflags='$castflags'
12565 cccdlflags='$cccdlflags'
12566 ccdlflags='$ccdlflags'
12568 ccsymbols='$ccsymbols'
12570 cf_email='$cf_email'
12575 clocktype='$clocktype'
12577 compress='$compress'
12578 contains='$contains'
12582 cpp_stuff='$cpp_stuff'
12583 cppccsymbols='$cppccsymbols'
12584 cppflags='$cppflags'
12586 cppminus='$cppminus'
12588 cppstdin='$cppstdin'
12589 cppsymbols='$cppsymbols'
12590 cryptlib='$cryptlib'
12592 d_Gconvert='$d_Gconvert'
12593 d_access='$d_access'
12594 d_accessx='$d_accessx'
12596 d_archlib='$d_archlib'
12597 d_attribut='$d_attribut'
12601 d_bsdgetpgrp='$d_bsdgetpgrp'
12602 d_bsdsetpgrp='$d_bsdsetpgrp'
12604 d_casti32='$d_casti32'
12605 d_castneg='$d_castneg'
12606 d_charvspr='$d_charvspr'
12608 d_chroot='$d_chroot'
12609 d_chsize='$d_chsize'
12610 d_closedir='$d_closedir'
12611 d_cmsghdr_s='$d_cmsghdr_s'
12615 d_cuserid='$d_cuserid'
12616 d_dbl_dig='$d_dbl_dig'
12617 d_dbmclose64='$d_dbmclose64'
12618 d_dbminit64='$d_dbminit64'
12619 d_delete64='$d_delete64'
12620 d_difftime='$d_difftime'
12621 d_dirent64_s='$d_dirent64_s'
12622 d_dirnamlen='$d_dirnamlen'
12623 d_dlerror='$d_dlerror'
12624 d_dlopen='$d_dlopen'
12625 d_dlsymun='$d_dlsymun'
12626 d_dosuid='$d_dosuid'
12627 d_drand48proto='$d_drand48proto'
12629 d_eaccess='$d_eaccess'
12630 d_endgrent='$d_endgrent'
12631 d_endhent='$d_endhent'
12632 d_endnent='$d_endnent'
12633 d_endpent='$d_endpent'
12634 d_endpwent='$d_endpwent'
12635 d_endsent='$d_endsent'
12636 d_eofnblk='$d_eofnblk'
12637 d_eunice='$d_eunice'
12638 d_fchmod='$d_fchmod'
12639 d_fchown='$d_fchown'
12641 d_fd_macros='$d_fd_macros'
12642 d_fd_set='$d_fd_set'
12643 d_fds_bits='$d_fds_bits'
12644 d_fetch64='$d_fetch64'
12645 d_fgetpos64='$d_fgetpos64'
12646 d_fgetpos='$d_fgetpos'
12647 d_firstkey64='$d_firstkey64'
12648 d_flexfnam='$d_flexfnam'
12649 d_flock64_s='$d_flock64_s'
12651 d_fopen64='$d_fopen64'
12653 d_fpathconf='$d_fpathconf'
12654 d_freopen64='$d_freopen64'
12655 d_fseek64='$d_fseek64'
12656 d_fseeko64='$d_fseeko64'
12657 d_fseeko='$d_fseeko'
12658 d_fsetpos64='$d_fsetpos64'
12659 d_fsetpos='$d_fsetpos'
12660 d_fstat64='$d_fstat64'
12661 d_fstatfs='$d_fstatfs'
12662 d_fstatvfs='$d_fstatvfs'
12663 d_ftell64='$d_ftell64'
12664 d_ftello64='$d_ftello64'
12665 d_ftello='$d_ftello'
12667 d_ftruncate64='$d_ftruncate64'
12668 d_getgrent='$d_getgrent'
12669 d_getgrps='$d_getgrps'
12670 d_gethbyaddr='$d_gethbyaddr'
12671 d_gethbyname='$d_gethbyname'
12672 d_gethent='$d_gethent'
12673 d_gethname='$d_gethname'
12674 d_gethostprotos='$d_gethostprotos'
12675 d_getlogin='$d_getlogin'
12676 d_getmntent='$d_getmntent'
12677 d_getnbyaddr='$d_getnbyaddr'
12678 d_getnbyname='$d_getnbyname'
12679 d_getnent='$d_getnent'
12680 d_getnetprotos='$d_getnetprotos'
12681 d_getpbyname='$d_getpbyname'
12682 d_getpbynumber='$d_getpbynumber'
12683 d_getpent='$d_getpent'
12684 d_getpgid='$d_getpgid'
12685 d_getpgrp2='$d_getpgrp2'
12686 d_getpgrp='$d_getpgrp'
12687 d_getppid='$d_getppid'
12688 d_getprior='$d_getprior'
12689 d_getprotoprotos='$d_getprotoprotos'
12690 d_getpwent='$d_getpwent'
12691 d_getsbyname='$d_getsbyname'
12692 d_getsbyport='$d_getsbyport'
12693 d_getsent='$d_getsent'
12694 d_getservprotos='$d_getservprotos'
12695 d_gettimeod='$d_gettimeod'
12696 d_gnulibc='$d_gnulibc'
12697 d_grpasswd='$d_grpasswd'
12698 d_hasmntopt='$d_hasmntopt'
12701 d_inetaton='$d_inetaton'
12702 d_ino64t='$d_ino64t'
12703 d_int64t='$d_int64t'
12704 d_iovec_s='$d_iovec_s'
12705 d_isascii='$d_isascii'
12706 d_killpg='$d_killpg'
12707 d_lchown='$d_lchown'
12709 d_locconv='$d_locconv'
12710 d_lockf64='$d_lockf64'
12712 d_longdbl='$d_longdbl'
12713 d_longlong='$d_longlong'
12714 d_lseek64='$d_lseek64'
12715 d_lstat64='$d_lstat64'
12717 d_madvise='$d_madvise'
12719 d_mbstowcs='$d_mbstowcs'
12720 d_mbtowc='$d_mbtowc'
12721 d_memcmp='$d_memcmp'
12722 d_memcpy='$d_memcpy'
12723 d_memmove='$d_memmove'
12724 d_memset='$d_memset'
12726 d_mkfifo='$d_mkfifo'
12727 d_mktime='$d_mktime'
12729 d_mprotect='$d_mprotect'
12731 d_msg_ctrunc='$d_msg_ctrunc'
12732 d_msg_dontroute='$d_msg_dontroute'
12733 d_msg_oob='$d_msg_oob'
12734 d_msg_peek='$d_msg_peek'
12735 d_msg_proxy='$d_msg_proxy'
12736 d_msgctl='$d_msgctl'
12737 d_msgget='$d_msgget'
12738 d_msghdr_s='$d_msghdr_s'
12739 d_msgrcv='$d_msgrcv'
12740 d_msgsnd='$d_msgsnd'
12742 d_munmap='$d_munmap'
12743 d_mymalloc='$d_mymalloc'
12744 d_nextkey64='$d_nextkey64'
12746 d_off64t='$d_off64t'
12747 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
12748 d_oldpthreads='$d_oldpthreads'
12749 d_oldsock='$d_oldsock'
12751 d_open64='$d_open64'
12752 d_opendir64='$d_opendir64'
12753 d_pathconf='$d_pathconf'
12755 d_phostname='$d_phostname'
12758 d_portable='$d_portable'
12759 d_pthread_yield='$d_pthread_yield'
12761 d_pwchange='$d_pwchange'
12762 d_pwclass='$d_pwclass'
12763 d_pwcomment='$d_pwcomment'
12764 d_pwexpire='$d_pwexpire'
12765 d_pwgecos='$d_pwgecos'
12766 d_pwpasswd='$d_pwpasswd'
12767 d_pwquota='$d_pwquota'
12768 d_readdir64='$d_readdir64'
12769 d_readdir='$d_readdir'
12770 d_readlink='$d_readlink'
12772 d_recvmsg='$d_recvmsg'
12773 d_rename='$d_rename'
12774 d_rewinddir='$d_rewinddir'
12776 d_safebcpy='$d_safebcpy'
12777 d_safemcpy='$d_safemcpy'
12778 d_sanemcmp='$d_sanemcmp'
12779 d_sched_yield='$d_sched_yield'
12780 d_scm_rights='$d_scm_rights'
12781 d_seekdir64='$d_seekdir64'
12782 d_seekdir='$d_seekdir'
12783 d_select='$d_select'
12785 d_semctl='$d_semctl'
12786 d_semctl_semid_ds='$d_semctl_semid_ds'
12787 d_semctl_semun='$d_semctl_semun'
12788 d_semget='$d_semget'
12790 d_sendmsg='$d_sendmsg'
12791 d_setegid='$d_setegid'
12792 d_seteuid='$d_seteuid'
12793 d_setgrent='$d_setgrent'
12794 d_setgrps='$d_setgrps'
12795 d_sethent='$d_sethent'
12796 d_setlinebuf='$d_setlinebuf'
12797 d_setlocale='$d_setlocale'
12798 d_setnent='$d_setnent'
12799 d_setpent='$d_setpent'
12800 d_setpgid='$d_setpgid'
12801 d_setpgrp2='$d_setpgrp2'
12802 d_setpgrp='$d_setpgrp'
12803 d_setprior='$d_setprior'
12804 d_setpwent='$d_setpwent'
12805 d_setregid='$d_setregid'
12806 d_setresgid='$d_setresgid'
12807 d_setresuid='$d_setresuid'
12808 d_setreuid='$d_setreuid'
12809 d_setrgid='$d_setrgid'
12810 d_setruid='$d_setruid'
12811 d_setsent='$d_setsent'
12812 d_setsid='$d_setsid'
12813 d_setvbuf='$d_setvbuf'
12817 d_shmatprototype='$d_shmatprototype'
12818 d_shmctl='$d_shmctl'
12820 d_shmget='$d_shmget'
12821 d_sigaction='$d_sigaction'
12822 d_sigsetjmp='$d_sigsetjmp'
12823 d_socket='$d_socket'
12824 d_sockpair='$d_sockpair'
12825 d_stat64='$d_stat64'
12826 d_statblks='$d_statblks'
12827 d_statfs='$d_statfs'
12828 d_statfsflags='$d_statfsflags'
12829 d_statvfs='$d_statvfs'
12830 d_stdio_cnt_lval='$d_stdio_cnt_lval'
12831 d_stdio_ptr_lval='$d_stdio_ptr_lval'
12832 d_stdiobase='$d_stdiobase'
12833 d_stdstdio='$d_stdstdio'
12834 d_store64='$d_store64'
12835 d_strchr='$d_strchr'
12836 d_strcoll='$d_strcoll'
12837 d_strctcpy='$d_strctcpy'
12838 d_strerrm='$d_strerrm'
12839 d_strerror='$d_strerror'
12840 d_strtod='$d_strtod'
12841 d_strtol='$d_strtol'
12842 d_strtoul='$d_strtoul'
12843 d_strxfrm='$d_strxfrm'
12844 d_suidsafe='$d_suidsafe'
12845 d_symlink='$d_symlink'
12846 d_syscall='$d_syscall'
12847 d_sysconf='$d_sysconf'
12848 d_sysernlst='$d_sysernlst'
12849 d_syserrlst='$d_syserrlst'
12850 d_system='$d_system'
12851 d_tcgetpgrp='$d_tcgetpgrp'
12852 d_tcsetpgrp='$d_tcsetpgrp'
12853 d_telldir64='$d_telldir64'
12854 d_telldir='$d_telldir'
12855 d_telldirproto='$d_telldirproto'
12858 d_tmpfile64='$d_tmpfile64'
12859 d_truncate64='$d_truncate64'
12860 d_truncate='$d_truncate'
12861 d_tzname='$d_tzname'
12864 d_union_semun='$d_union_semun'
12866 d_void_closedir='$d_void_closedir'
12867 d_voidsig='$d_voidsig'
12868 d_voidtty='$d_voidtty'
12869 d_volatile='$d_volatile'
12870 d_vprintf='$d_vprintf'
12872 d_waitpid='$d_waitpid'
12873 d_wcstombs='$d_wcstombs'
12874 d_wctomb='$d_wctomb'
12875 d_writev='$d_writev'
12878 db_hashtype='$db_hashtype'
12879 db_prefixtype='$db_prefixtype'
12880 defvoidused='$defvoidused'
12881 direntrytype='$direntrytype'
12884 doublesize='$doublesize'
12886 dynamic_ext='$dynamic_ext'
12892 eunicefix='$eunicefix'
12895 extensions='$extensions'
12897 firstmakefile='$firstmakefile'
12899 fpostype='$fpostype'
12900 freetype='$freetype'
12902 full_csh='$full_csh'
12903 full_sed='$full_sed'
12904 gccversion='$gccversion'
12908 groupcat='$groupcat'
12909 groupstype='$groupstype'
12912 h_sysfile='$h_sysfile'
12916 i_arpainet='$i_arpainet'
12917 i_bsdioctl='$i_bsdioctl'
12920 i_dirent='$i_dirent'
12927 i_inttypes='$i_inttypes'
12928 i_limits='$i_limits'
12929 i_locale='$i_locale'
12930 i_machcthr='$i_machcthr'
12931 i_malloc='$i_malloc'
12933 i_memory='$i_memory'
12934 i_mntent='$i_mntent'
12937 i_neterrno='$i_neterrno'
12941 i_rpcsvcdbm='$i_rpcsvcdbm'
12944 i_stdarg='$i_stdarg'
12945 i_stddef='$i_stddef'
12946 i_stdlib='$i_stdlib'
12947 i_string='$i_string'
12948 i_sysaccess='$i_sysaccess'
12949 i_sysdir='$i_sysdir'
12950 i_sysfile='$i_sysfile'
12951 i_sysfilio='$i_sysfilio'
12953 i_sysioctl='$i_sysioctl'
12954 i_sysmman='$i_sysmman'
12955 i_sysmount='$i_sysmount'
12956 i_sysndir='$i_sysndir'
12957 i_sysparam='$i_sysparam'
12958 i_sysresrc='$i_sysresrc'
12959 i_syssecrt='$i_syssecrt'
12960 i_sysselct='$i_sysselct'
12961 i_syssockio='$i_syssockio'
12962 i_sysstat='$i_sysstat'
12963 i_sysstatvfs='$i_sysstatvfs'
12964 i_systime='$i_systime'
12965 i_systimek='$i_systimek'
12966 i_systimes='$i_systimes'
12967 i_systypes='$i_systypes'
12968 i_sysuio='$i_sysuio'
12970 i_syswait='$i_syswait'
12971 i_termio='$i_termio'
12972 i_termios='$i_termios'
12974 i_unistd='$i_unistd'
12976 i_values='$i_values'
12977 i_varargs='$i_varargs'
12978 i_varhdr='$i_varhdr'
12980 ignore_versioned_solibs='$ignore_versioned_solibs'
12983 installarchlib='$installarchlib'
12984 installbin='$installbin'
12985 installman1dir='$installman1dir'
12986 installman3dir='$installman3dir'
12987 installprivlib='$installprivlib'
12988 installscript='$installscript'
12989 installsitearch='$installsitearch'
12990 installsitelib='$installsitelib'
12991 installusrbinperl='$installusrbinperl'
12993 known_extensions='$known_extensions'
12997 lddlflags='$lddlflags'
13005 libswanted='$libswanted'
13011 locincpth='$locincpth'
13012 loclibpth='$loclibpth'
13013 longdblsize='$longdblsize'
13014 longlongsize='$longlongsize'
13015 longsize='$longsize'
13019 lseeksize='$lseeksize'
13020 lseektype='$lseektype'
13024 make_set_make='$make_set_make'
13025 mallocobj='$mallocobj'
13026 mallocsrc='$mallocsrc'
13027 malloctype='$malloctype'
13029 man1direxp='$man1direxp'
13032 man3direxp='$man3direxp'
13036 mips_type='$mips_type'
13038 mmaptype='$mmaptype'
13040 modetype='$modetype'
13043 myarchname='$myarchname'
13044 mydomain='$mydomain'
13045 myhostname='$myhostname'
13048 netdb_hlen_type='$netdb_hlen_type'
13049 netdb_host_type='$netdb_host_type'
13050 netdb_name_type='$netdb_name_type'
13051 netdb_net_type='$netdb_net_type'
13054 nm_so_opt='$nm_so_opt'
13055 nonxs_ext='$nonxs_ext'
13057 o_nonblock='$o_nonblock'
13059 old_pthread_create_joinable='$old_pthread_create_joinable'
13060 optimize='$optimize'
13061 orderlib='$orderlib'
13067 patchlevel='$patchlevel'
13068 path_sep='$path_sep'
13070 perladmin='$perladmin'
13071 perlpath='$perlpath'
13073 phostname='$phostname'
13079 prefixexp='$prefixexp'
13081 privlibexp='$privlibexp'
13082 prototype='$prototype'
13084 randbits='$randbits'
13085 randfunc='$randfunc'
13086 randseedtype='$randseedtype'
13088 rd_nodata='$rd_nodata'
13092 sched_yield='$sched_yield'
13093 scriptdir='$scriptdir'
13094 scriptdirexp='$scriptdirexp'
13096 seedfunc='$seedfunc'
13097 selectminbits='$selectminbits'
13098 selecttype='$selecttype'
13099 sendmail='$sendmail'
13102 sharpbang='$sharpbang'
13103 shmattype='$shmattype'
13104 shortsize='$shortsize'
13107 sig_name='$sig_name'
13108 sig_name_init='$sig_name_init'
13110 sig_num_init='$sig_num_init'
13111 signal_t='$signal_t'
13112 sitearch='$sitearch'
13113 sitearchexp='$sitearchexp'
13115 sitelibexp='$sitelibexp'
13116 sizetype='$sizetype'
13121 sockethdr='$sockethdr'
13122 socketlib='$socketlib'
13124 spackage='$spackage'
13125 spitshell='$spitshell'
13128 ssizetype='$ssizetype'
13129 startperl='$startperl'
13131 static_ext='$static_ext'
13133 stdio_base='$stdio_base'
13134 stdio_bufsiz='$stdio_bufsiz'
13135 stdio_cnt='$stdio_cnt'
13136 stdio_filbuf='$stdio_filbuf'
13137 stdio_ptr='$stdio_ptr'
13140 subversion='$subversion'
13147 timeincl='$timeincl'
13148 timetype='$timetype'
13156 use64bits='$use64bits'
13158 usemultiplicity='$usemultiplicity'
13159 usemymalloc='$usemymalloc'
13161 useopcode='$useopcode'
13162 useperlio='$useperlio'
13163 useposix='$useposix'
13165 useshrplib='$useshrplib'
13166 usethreads='$usethreads'
13167 usevfork='$usevfork'
13172 voidflags='$voidflags'
13178 : Add in command line options if available
13179 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
13181 : add special variables
13182 $test -f $src/patchlevel.h && \
13183 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
13184 echo "CONFIG=true" >>config.sh
13186 : propagate old symbols
13187 if $test -f UU/config.sh; then
13188 <UU/config.sh sort | uniq >UU/oldconfig.sh
13189 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
13190 sort | uniq -u >UU/oldsyms
13191 set X `cat UU/oldsyms`
13197 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
13199 echo "# Variables propagated from previous config.sh file." >>config.sh
13200 for sym in `cat UU/oldsyms`; do
13201 echo " Propagating $hint variable "'$'"$sym..."
13202 eval 'tmp="$'"${sym}"'"'
13204 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
13210 : Finish up by extracting the .SH files
13224 If you'd like to make any changes to the config.sh file before I begin
13225 to configure things, do it as a shell escape now (e.g. !vi config.sh).
13228 rp="Press return or use a shell escape to edit config.sh:"
13233 *) : in case they cannot read
13234 sh 1>&4 -c "$ans";;
13239 : if this fails, just run all the .SH files by hand
13246 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
13253 Now you need to generate make dependencies by running "$make depend".
13254 You might prefer to run it in background: "$make depend > makedepend.out &"
13255 It can take a while, so you might not want to run it right now.
13260 rp="Run $make depend now?"
13264 $make depend && echo "Now you must run a $make."
13267 echo "You must run '$make depend' then '$make'."
13270 elif test -f [Mm]akefile; then
13272 echo "Now you must run a $make."
13277 if $test -f Policy.sh; then
13280 If you compile $package on a different machine or from a different object
13281 directory, copy the Policy.sh file from this object directory to the
13282 new one before you run Configure -- this will help you with most of
13283 the policy defaults.
13287 if $test -f config.msg; then
13288 echo "Hmm. I also noted the following information while running:"
13290 $cat config.msg >&4
13293 $rm -f kit*isdone ark*isdone