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 Wed May 12 13:22:22 EET DST 1999 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
432 d_old_pthread_create_joinable=''
433 old_pthread_create_joinable=''
696 ignore_versioned_solibs=''
823 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
826 : We must find out about Eunice early
828 if test -f /etc/unixtovms; then
829 eunicefix=/etc/unixtovms
831 if test -f /etc/unixtovms.exe; then
832 eunicefix=/etc/unixtovms.exe
836 : Possible local include directories to search.
837 : Set locincpth to "" in a hint file to defeat local include searches.
838 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
839 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
841 : no include file wanted by default
844 : list of known cpp symbols, sorted alphabetically
845 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
846 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
847 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
848 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
849 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
850 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
851 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
852 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
853 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
854 al="$al VMS Xenix286"
855 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
856 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
857 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
858 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
859 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
860 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
861 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
862 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
863 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
864 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
865 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
866 al="$al __SVR4_2__ __UMAXV__"
867 al="$al ____386BSD____ __alpha __alpha__ __amiga"
868 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
869 al="$al __host_mips__"
870 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
871 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
872 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
873 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
874 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
875 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
876 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
877 al="$al __mc88100 __mc88100__ __mips __mips__"
878 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
879 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
880 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
881 al="$al _host_mips _mips _unix"
882 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
883 al="$al apollo ardent att386 att3b"
884 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
885 al="$al cadmus clipper concurrent convex cray ctix"
886 al="$al dmert encore gcos gcx gimpel gould"
887 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
888 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
889 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
890 al="$al i186 i286 i386 i486 i8086"
891 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
892 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
893 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
894 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
895 al="$al mc88000 mc88100 merlin mert mips mvs n16"
896 al="$al ncl_el ncl_mr"
897 al="$al news1500 news1700 news1800 news1900 news3700"
898 al="$al news700 news800 news900 ns16000 ns32000"
899 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
900 al="$al parisc pc532 pdp11 plexus posix pyr"
901 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
902 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
903 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
904 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
905 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
906 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
909 : Trailing extension. Override this in a hint file, if needed.
911 : Extra object files, if any, needed on this platform.
914 : change the next line if compiling for Xenix/286 on Xenix/386
915 xlibpth='/usr/lib/386 /lib/386'
917 : Possible local library directories to search.
918 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
919 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
921 : general looking path for locating libraries
922 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
923 glibpth="$glibpth /lib /usr/lib $xlibpth"
924 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
925 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
927 : Private path used by Configure to find libraries. Its value
928 : is prepended to libpth. This variable takes care of special
929 : machines, like the mips. Usually, it should be empty.
932 : default library list
934 : some systems want to use only the non-versioned libso:s
935 ignore_versioned_solibs=''
936 : full support for void wanted by default
939 : set useposix=false in your hint file to disable the POSIX extension.
941 : set useopcode=false in your hint file to disable the Opcode extension.
943 : set usemultiplicity on the Configure command line to enable multiplicity.
944 : set usethreads on the Configure command line to enable threads.
945 : List of libraries we want.
946 : If anyone needs -lnet, put it in a hint file.
947 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
948 libswanted="$libswanted dld ld sun m rt c cposix posix"
949 libswanted="$libswanted ndir dir crypt"
950 libswanted="$libswanted ucb bsd BSD PW x"
951 : We probably want to search /usr/shlib before most other libraries.
952 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
953 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
954 glibpth="/usr/shlib $glibpth"
955 : Do not use vfork unless overridden by a hint file.
958 : Find the basic shell for Bourne shell scripts
962 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
965 if test -f "$xxx"; then
968 : Build up a list and do a single loop so we can 'break' out.
969 pth=`echo $PATH | sed -e "s/$p_/ /g"`
970 for xxx in sh bash ksh pdksh ash; do
972 try="$try ${p}/${xxx}"
976 if test -f "$xxx"; then
979 elif test -f "$xxx.exe"; then
990 $me: Fatal Error: I can't find a Bourne Shell anywhere.
992 Usually it's in /bin/sh. How did you even get this far?
993 Please contact me (Perl Maintainers) at perlbug@perl.com and
994 we'll try to straighten this all out.
1000 : see if sh knows # comments
1001 if `$sh -c '#' >/dev/null 2>&1`; then
1005 test -f $xcat || xcat=/usr/bin/cat
1010 if test -s today; then
1013 echo "#! $xcat" > try
1017 if test -s today; then
1025 echo "Your $sh doesn't grok # comments--I will strip them later on."
1028 echo "exec grep -v '^[ ]*#'" >spitshell
1030 $eunicefix spitshell
1031 spitshell=`pwd`/spitshell
1033 echo "I presume that if # doesn't work, #! won't work either!"
1038 : figure out how to guarantee sh startup
1040 '') startsh=${sharpbang}${sh} ;;
1052 : echo "Yup, it does."
1054 echo "Hmm... '$startsh' does not guarantee sh startup..."
1055 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1060 : Save command line options in file UU/cmdline.opt for later use in
1061 : generating config.sh.
1062 cat > cmdline.opt <<EOSH
1063 # Configure command line arguments.
1070 cat >>cmdline.opt <<EOSH
1071 config_arg$argn='$arg'
1073 argn=`expr $argn + 1`
1076 : produce awk script to parse command line options
1077 cat >options.awk <<'EOF'
1079 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
1081 len = length(optstr);
1082 for (i = 1; i <= len; i++) {
1083 c = substr(optstr, i, 1);
1084 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1095 if (substr(str, 1, 1) != "-") {
1096 printf("'%s'\n", str);
1100 for (i = 2; i <= len; i++) {
1101 c = substr(str, i, 1);
1103 printf("-%s\n", substr(str, i));
1109 printf("'%s'\n", substr(str, i + 1));
1122 : process the command line options
1123 set X `for arg in "$@"; do echo "X$arg"; done |
1124 sed -e s/X// | awk -f options.awk`
1129 : set up default values
1140 cat >optdef.sh <<EOS
1146 while test $# -gt 0; do
1148 -d) shift; fastread=yes;;
1149 -e) shift; alldone=cont;;
1153 if test -r "$1"; then
1156 echo "$me: cannot read config file $1." >&2
1161 -h) shift; error=true;;
1162 -r) shift; reuseval=true;;
1163 -s) shift; silent=true; realsilent=true;;
1164 -E) shift; alldone=exit;;
1165 -K) shift; knowitall=true;;
1166 -O) shift; override=true;;
1167 -S) shift; silent=true; extractsh=true;;
1172 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1173 echo "$me: ignoring -D $1" >&2
1176 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1177 *) echo "$1='define'" >> optdef.sh;;
1184 *=) echo "$1" >> optdef.sh;;
1186 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1187 echo "$me: ignoring -U $1" >&2
1189 *) echo "$1='undef'" >> optdef.sh;;
1193 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1196 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1204 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1205 [-U symbol] [-U symbol=]
1206 -d : use defaults for all answers.
1207 -e : go on without questioning past the production of config.sh.
1208 -f : specify an alternate default configuration file.
1209 -h : print this help message and exit (with an error status).
1210 -r : reuse C symbols value if possible (skips costly nm extraction).
1211 -s : silent mode, only echoes questions and essential information.
1212 -D : define symbol to have some value:
1213 -D symbol symbol gets the value 'define'
1214 -D symbol=value symbol gets the value 'value'
1215 -E : stop at the end of questions, after having produced config.sh.
1216 -K : do not use unless you know what you are doing.
1217 -O : let -D and -U override definitions from loaded configuration file.
1218 -S : perform variable substitutions on all .SH files (can mix with -f)
1219 -U : undefine symbol:
1220 -U symbol symbol gets the value 'undef'
1221 -U symbol= symbol gets completely empty
1222 -V : print version number and exit (with a zero status).
1229 case "$fastread$alldone" in
1232 if test ! -t 0; then
1233 echo "Say 'sh Configure', not 'sh <Configure'"
1241 true) exec 1>/dev/null;;
1244 : run the defines and the undefines, if any, but leave the file out there...
1250 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1251 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1252 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1253 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1254 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1257 : Some greps do not return status, grrr.
1258 echo "grimblepritz" >grimble
1259 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1261 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1267 : the following should work in any shell
1271 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1272 cat >contains <<'EOSS'
1273 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1278 : Find the path to the source tree
1281 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
1292 if test -f $rsrc/Configure && \
1293 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1295 : found it, so we are ok.
1298 for src in . .. ../.. ../../.. ../../../..; do
1299 if test -f ../$src/Configure && \
1300 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1311 Sorry, I can't seem to locate the source dir for $package. Please start
1312 Configure with an explicit path -- i.e. /some/path/Configure.
1320 echo "Sources for $package found in \"$src\"." >&4
1324 : script used to extract .SH files with variable substitutions
1325 cat >extract <<'EOS'
1327 echo "Doing variable substitutions on .SH files..."
1328 if test -f $src/MANIFEST; then
1329 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1331 echo "(Looking for .SH files under the source directory.)"
1332 set x `(cd $src; find . -name "*.SH" -print)`
1336 0) set x `(cd $src; echo *.SH)`; shift;;
1338 if test ! -f $src/$1; then
1344 while test $name; do
1345 if test ! -d "$name"; then
1346 create="$name $create";
1347 name=`echo $name | sed -e "s|^[^/]*$||"`;
1348 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1353 for file in $create; do
1362 dir=`expr X$file : 'X\(.*\)/'`
1363 file=`expr X$file : 'X.*/\(.*\)'`
1364 (cd $dir && . ./$file)
1374 dir=`expr X$file : 'X\(.*\)/'`
1375 file=`expr X$file : 'X.*/\(.*\)'`
1376 (set x $dir; shift; eval $mkdir_p)
1386 if test -f $src/config_h.SH; then
1387 if test ! -f config.h; then
1388 : oops, they left it out of MANIFEST, probably, so do it anyway.
1394 : extract files and exit if asked to do so
1395 case "$extractsh" in
1397 case "$realsilent" in
1401 case "$config_sh" in
1402 '') config_sh='config.sh';;
1405 echo "Fetching answers from $config_sh..."
1408 test "$override" && . ./optdef.sh
1417 : Eunice requires " " instead of "", can you believe it
1420 echo "Beginning of configuration questions for $package."
1422 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1424 : first determine how to suppress newline on echo command
1426 echo "Checking echo to see how to suppress newlines..."
1427 (echo "hi there\c" ; echo " ") >.echotmp
1428 if $contains c .echotmp >/dev/null 2>&1 ; then
1439 echo $n "The star should be here-->$c"
1443 : Now test for existence of everything in MANIFEST
1445 if test -f $rsrc/MANIFEST; then
1446 echo "First let's make sure your kit is complete. Checking..." >&4
1447 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1450 for filelist in x??; do
1451 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1453 if test -s missing; then
1457 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1459 You have the option of continuing the configuration process, despite the
1460 distinct possibility that your kit is damaged, by typing 'y'es. If you
1461 do, don't blame me if something goes wrong. I advise you to type 'n'o
1462 and contact the author (perlbug@perl.com).
1465 echo $n "Continue? [n] $c" >&4
1469 echo "Continuing..." >&4
1473 echo "ABORTING..." >&4
1478 echo "Looks good..."
1481 echo "There is no MANIFEST file. I hope your kit is complete !"
1486 : Find the appropriate value for a newline for tr
1487 if test -n "$DJGPP"; then
1490 if test X"$trnl" = X; then
1491 case "`echo foo|tr '\n' x 2>/dev/null`" in
1495 if test X"$trnl" = X; then
1496 case "`echo foo|tr '\012' x 2>/dev/null`" in
1497 foox) trnl='\012' ;;
1500 if test X"$trnl" = X; then
1503 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1509 : compute the number of columns on the terminal for proper question formatting
1514 : set up the echo used in my read
1515 myecho="case \"\$xxxm\" in
1516 '') echo $n \"\$rp $c\" >&4;;
1518 '') echo $n \"[\$xxxm] $c\";;
1520 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1522 echo $n \"[\$xxxm] $c\" >&4
1524 echo $n \"\$rp [\$xxxm] $c\" >&4
1530 : now set up to do reads with possible shell escape and default assignment
1536 case "\$fastread" in
1537 yes) case "\$dflt" in
1540 case "\$silent-\$rp" in
1545 *) case "\$silent" in
1546 true) case "\$rp" in
1551 while expr "X\$ans" : "X!" >/dev/null; do
1555 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1563 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1572 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1577 echo "(OK, I'll run with -d after this question.)" >&4
1580 echo "*** Sorry, \$1 not supported yet." >&4
1590 echo "*** Substitution done -- please confirm."
1592 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1597 echo "*** Error -- try again."
1604 case "\$ans\$xxxm\$nostick" in
1616 : create .config dir to save info across Configure sessions
1617 test -d ../.config || mkdir ../.config
1618 cat >../.config/README <<EOF
1619 This directory created by Configure to save information that should
1620 persist across sessions for $package.
1622 You may safely delete it if you wish.
1625 : general instructions
1628 user=`(logname) 2>/dev/null`
1630 '') user=`whoami 2>&1`;;
1632 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1635 rp='Would you like to see the instructions?'
1646 This installation shell script will examine your system and ask you questions
1647 to determine how the perl5 package should be installed. If you get
1648 stuck on a question, you may use a ! shell escape to start a subshell or
1649 execute a command. Many of the questions will have default answers in square
1650 brackets; typing carriage return will give you the default.
1652 On some of the questions which ask for file or directory names you are allowed
1653 to use the ~name construct to specify the login directory belonging to "name",
1654 even if you don't have a shell which knows about that. Questions where this is
1655 allowed will be marked "(~name ok)".
1659 dflt='Type carriage return to continue'
1663 The prompter used in this script allows you to use shell variables and
1664 backticks in your answers. You may use $1, $2, etc... to refer to the words
1665 in the default answer, as if the default line was a set of arguments given to a
1666 script shell. This means you may also use $* to repeat the whole default line,
1667 so you do not have to re-type everything to add something to the default.
1669 Everytime there is a substitution, you will have to confirm. If there is an
1670 error (e.g. an unmatched backtick), the default answer will remain unchanged
1671 and you will be prompted again.
1673 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1674 the questions and use the computed defaults (or the previous answers if there
1675 was already a config.sh file). Type 'Configure -h' for a list of options.
1676 You may also start interactively and then answer '& -d' at any prompt to turn
1677 on the non-interactive behaviour for the remainder of the execution.
1683 Much effort has been expended to ensure that this shell script will run on any
1684 Unix system. If despite that it blows up on yours, your best bet is to edit
1685 Configure and run it again. If you can't run Configure for some reason,
1686 you'll have to generate a config.sh file by hand. Whatever problems you
1687 have, let me (perlbug@perl.com) know how I blew it.
1689 This installation script affects things in two ways:
1691 1) it may do direct variable substitutions on some of the files included
1693 2) it builds a config.h file for inclusion in C programs. You may edit
1694 any of these files as the need arises after running this script.
1696 If you make a mistake on a question, there is no easy way to back up to it
1697 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1698 files. Configure will offer to let you do this before it runs the SH files.
1701 dflt='Type carriage return to continue'
1703 case "$firsttime" in
1704 true) echo $user >>../.config/instruct;;
1708 : find out where common programs are
1710 echo "Locating common programs..." >&4
1723 if test -d \$dir/\$thing; then
1729 for thisthing in \$dir/\$thing; do
1730 : just loop through to pick last item
1732 if test -f \$thisthing; then
1735 elif test -f \$dir/\$thing.exe; then
1736 if test -n "$DJGPP"; then
1737 echo \$dir/\$thing.exe
1739 : on Eunice apparently
1789 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1790 pth="$pth /lib /usr/lib"
1791 for file in $loclist; do
1795 if test -f "$xxx"; then
1798 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1799 xxx=`./loc $file $file $pth`
1802 '') xxx=`./loc $file $file $pth`;;
1803 *) xxx=`./loc $xxx $xxx $pth`;;
1809 echo $file is in $xxx.
1812 echo $file is in $xxx.
1815 echo "I don't know where '$file' is, and my life depends on it." >&4
1816 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1822 echo "Don't worry if any of the following aren't found..."
1824 for file in $trylist; do
1828 if test -f "$xxx"; then
1831 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1832 xxx=`./loc $file $file $pth`
1835 '') xxx=`./loc $file $file $pth`;;
1836 *) xxx=`./loc $xxx $xxx $pth`;;
1842 echo $file is in $xxx.
1845 echo $file is in $xxx.
1848 echo "I don't see $file out there, $say."
1855 echo "Substituting grep for egrep."
1861 echo "Substituting cp for ln."
1867 echo "Hopefully test is built into your sh."
1870 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1871 echo "Using the test built into your sh."
1879 echo "Hopefully echo is built into your sh."
1884 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1885 $echo $n "hi there$c" >foo1
1886 echo $n "hi there$c" >foo2
1887 if cmp foo1 foo2 >/dev/null 2>&1; then
1888 echo "They are compatible. In fact, they may be identical."
1895 They are not compatible! You are probably running ksh on a non-USG system.
1896 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1897 have echo built in and we may have to run some Bourne shell scripts. That
1898 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1901 $echo $n "The star should be here-->$c"
1908 : determine whether symbolic links are supported
1911 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1912 echo "Symbolic links are supported." >&4
1915 echo "Symbolic links are NOT supported." >&4
1920 : see whether [:lower:] and [:upper:] are supported character classes
1922 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1924 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1928 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
1929 # (0xc9 and 0xd1), therefore that is a nice testing point.
1930 if test "X$up" = X -o "X$low" = X; then
1931 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
1937 if test "X$up" = X -o "X$low" = X; then
1938 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
1944 if test "X$up" = X -o "X$low" = X; then
1945 case "`echo IJ | od -x 2>/dev/null`" in
1947 echo "Hey, this might be EBCDIC." >&4
1948 if test "X$up" = X -o "X$low" = X; then
1949 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
1950 ij) up='[A-IJ-RS-Z]'
1955 if test "X$up" = X -o "X$low" = X; then
1956 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
1966 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
1968 echo "Using $up and $low to convert case." >&4
1971 echo "I don't know how to translate letters from upper to lower case." >&4
1972 echo "Your tr is not acting any way I know of." >&4
1976 : set up the translation script tr, must be called with ./tr of course
1980 '[A-Z][a-z]') exec $tr '$up' '$low';;
1981 '[a-z][A-Z]') exec $tr '$low' '$up';;
1988 : Try to determine whether config.sh was made on this system
1989 case "$config_sh" in
1991 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1992 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
1993 # because the A-Z/a-z are not consecutive.
1994 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1995 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
1996 newmyuname="$myuname"
1998 case "$knowitall" in
2000 if test -f ../config.sh; then
2001 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2002 eval "`grep myuname= ../config.sh`"
2004 if test "X$myuname" = "X$newmyuname"; then
2012 : Get old answers from old config file if Configure was run on the
2013 : same system, otherwise use the hints.
2016 if test -f config.sh; then
2018 rp="I see a config.sh file. Shall I use it to set the defaults?"
2021 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2022 *) echo "Fetching default answers from your old config.sh file..." >&4
2030 : Older versions did not always set $sh. Catch re-use of such
2039 if test ! -f config.sh; then
2042 First time through, eh? I have some defaults handy for some systems
2043 that need some extra help getting the Configure answers right:
2046 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2048 : Half the following guesses are probably wrong... If you have better
2049 : tests or hints, please send them to perlbug@perl.com
2050 : The metaconfig authors would also appreciate a copy...
2051 $test -f /irix && osname=irix
2052 $test -f /xenix && osname=sco_xenix
2053 $test -f /dynix && osname=dynix
2054 $test -f /dnix && osname=dnix
2055 $test -f /lynx.os && osname=lynxos
2056 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2057 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2058 $test -f /bin/mips && /bin/mips && osname=mips
2059 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2060 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2061 $test -d /usr/apollo/bin && osname=apollo
2062 $test -f /etc/saf/_sactab && osname=svr4
2063 $test -d /usr/include/minix && osname=minix
2064 if $test -d /MachTen -o -d /MachTen_Folder; then
2066 if $test -x /sbin/version; then
2067 osvers=`/sbin/version | $awk '{print $2}' |
2068 $sed -e 's/[A-Za-z]$//'`
2069 elif $test -x /usr/etc/version; then
2070 osvers=`/usr/etc/version | $awk '{print $2}' |
2071 $sed -e 's/[A-Za-z]$//'`
2076 $test -f /sys/posix.dll &&
2077 $test -f /usr/bin/what &&
2078 set X `/usr/bin/what /sys/posix.dll` &&
2079 $test "$3" = UWIN &&
2082 if $test -f $uname; then
2090 umips) osname=umips ;;
2093 [23]100) osname=mips ;;
2094 next*) osname=next ;;
2096 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2097 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2100 elif $test -f /etc/kconfig; then
2102 if test "$lns" = "ln -s"; then
2104 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2106 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2113 if test -n "$DJGPP"; then
2122 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2124 'not found') osvers="$4"."$3" ;;
2125 '<3240'|'<>3240') osvers=3.2.0 ;;
2126 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2127 '=3250'|'>3250') osvers=3.2.5 ;;
2131 *dc.osx) osname=dcosx
2137 domainos) osname=apollo
2143 dynixptx*) osname=dynixptx
2144 osvers=`echo "$4"|sed 's/^v//'`
2146 freebsd) osname=freebsd
2148 genix) osname=genix ;;
2150 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2166 netbsd*) osname=netbsd
2169 news-os) osvers="$3"
2171 4*) osname=newsos4 ;;
2175 bsd386) osname=bsd386
2178 POSIX-BC | posix-bc ) osname=posix-bc
2181 powerux | power_ux | powermax_os | powermaxos | \
2182 powerunix | power_unix) osname=powerux
2185 next*) osname=next ;;
2186 solaris) osname=solaris
2188 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2195 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2199 titanos) osname=titanos
2208 ultrix) osname=ultrix
2211 osf1|mls+) case "$5" in
2214 osvers=`echo "$3" | sed 's/^[xvt]//'`
2216 hp*) osname=hp_osf1 ;;
2217 mips) osname=mips_osf1 ;;
2226 $2) case "$osname" in
2230 : svr4.x or possibly later
2240 if test -f /stand/boot ; then
2241 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2242 if test -n "$INITPROG" -a -f "$INITPROG"; then
2243 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2244 if test -n "$isesix"; then
2252 *) if test -f /etc/systemid; then
2254 set `echo $3 | $sed 's/\./ /g'` $4
2255 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2257 elif $test -f $src/hints/sco_$1_$2.sh; then
2259 elif $test -f $src/hints/sco_$1.sh; then
2264 '') : Still unknown. Probably a generic Sys V.
2273 *) case "$osname" in
2274 '') : Still unknown. Probably a generic BSD.
2282 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2283 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2284 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2287 $rm -f UU/kernel.what
2288 elif test -d c:/.; then
2295 : Now look for a hint file osname_osvers, unless one has been
2296 : specified already.
2299 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2300 : Also try without trailing minor version numbers.
2301 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2302 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2303 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2304 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2307 *) case "$osvers" in
2310 *) if $test -f $src/hints/$file.sh ; then
2312 elif $test -f $src/hints/$xfile.sh ; then
2314 elif $test -f $src/hints/$xxfile.sh ; then
2316 elif $test -f $src/hints/$xxxfile.sh ; then
2318 elif $test -f $src/hints/$xxxxfile.sh ; then
2320 elif $test -f "$src/hints/${osname}.sh" ; then
2329 if $test -f Policy.sh ; then
2332 none) dflt="Policy" ;;
2333 *) dflt="Policy $dflt" ;;
2338 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2342 if $test -f Policy.sh ; then
2345 There's also a Policy hint file available, which should make the
2346 site-specific (policy) questions easier to answer.
2353 You may give one or more space-separated answers, or "none" if appropriate.
2354 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2355 is a good thing. DO NOT give a wrong version.
2359 rp="Which of these apply, if any?"
2362 for file in $tans; do
2363 if $test X$file = XPolicy -a -f Policy.sh; then
2365 $cat Policy.sh >> UU/config.sh
2366 elif $test -f $src/hints/$file.sh; then
2367 . $src/hints/$file.sh
2368 $cat $src/hints/$file.sh >> UU/config.sh
2369 elif $test X$tans = X -o X$tans = Xnone ; then
2372 : Give one chance to correct a possible typo.
2373 echo "$file.sh does not exist"
2375 rp="hint to use instead?"
2377 for file in $ans; do
2378 if $test -f "$src/hints/$file.sh"; then
2379 . $src/hints/$file.sh
2380 $cat $src/hints/$file.sh >> UU/config.sh
2381 elif $test X$ans = X -o X$ans = Xnone ; then
2384 echo "$file.sh does not exist -- ignored."
2391 : Remember our hint file for later.
2392 if $test -f "$src/hints/$file.sh" ; then
2402 echo "Fetching default answers from $config_sh..." >&4
2406 cp $config_sh config.sh 2>/dev/null
2416 test "$override" && . ./optdef.sh
2417 myuname="$newmyuname"
2419 : Restore computed paths
2420 for file in $loclist $trylist; do
2421 eval $file="\$_$file"
2426 Configure uses the operating system name and version to set some defaults.
2427 The default value is probably right if the name rings a bell. Otherwise,
2428 since spelling matters for me, either accept the default or answer "none"
2435 ''|' '|none) dflt=none ;;
2436 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2439 *) dflt="$osname" ;;
2441 rp="Operating system name?"
2445 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2451 ''|' '|none) dflt=none ;;
2452 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2453 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2455 ''|' ') dflt=none ;;
2460 *) dflt="$osvers" ;;
2462 rp="Operating system version?"
2469 : who configured the system
2470 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2471 cf_by=`(logname) 2>/dev/null`
2474 cf_by=`(whoami) 2>/dev/null`
2476 "") cf_by=unknown ;;
2480 : set up the script used to warn in case of inconsistency
2487 echo "*** WHOA THERE!!! ***" >&4
2488 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2489 rp=" Keep the $hint value?"
2492 y) td=$was; tu=$was;;
2496 : function used to set $1 to $val
2497 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2499 $define$undef) . ./whoa; eval "$var=\$td";;
2500 $undef$define) . ./whoa; eval "$var=\$tu";;
2501 *) eval "$var=$val";;
2506 Perl can be built to take advantage of threads, on some systems.
2507 To do so, Configure must be run with -Dusethreads.
2509 Note that threading is a highly experimental feature, and
2510 some known race conditions still remain. If you choose to try
2511 it, be very sure to not actually deploy it for production
2512 purposes. README.threads has more details, and is required
2513 reading if you enable threads.
2515 case "$usethreads" in
2516 $define|true|[yY]*) dflt='y';;
2519 rp='Build a threading Perl?'
2522 y|Y) val="$define" ;;
2528 case "$d_oldpthreads" in
2529 '') : Configure tests would be welcome here. For now, assume undef.
2531 *) val="$d_oldpthreads" ;;
2537 case "$usethreads" in
2538 "$define"|true|[yY]*)
2539 : Look for a hint-file generated 'call-back-unit'. If the
2540 : user has specified that a threading perl is to be built,
2541 : we may need to set or change some other defaults.
2542 if $test -f usethreads.cbu; then
2546 aix|dec_osf|dos_djgpp|freebsd|hpux|irix|linux|next|openbsd|os2|solaris|vmesa)
2547 # Known thread-capable platforms.
2551 $osname is not known to support threads.
2552 Please let perlbug@perl.com know how to do that.
2554 Cannot continue, aborting.
2564 Perl can be built so that multiple Perl interpreters can coexist
2565 within the same Perl executable. To do so, Configure must be run with
2568 Normally you do not need this and you should answer no.
2571 case "$usemultiplicity" in
2572 $define|true|[yY]*) dflt='y';;
2575 rp='Build Perl for multiplicity?'
2578 y|Y) val="$define" ;;
2586 Perl can be built to take advantage of explicit 64-bit interfaces,
2587 on some systems. To do so, Configure must be run with -Duse64bits.
2589 If this doesn't make any sense to you, just accept the default 'n'.
2591 case "$use64bits" in
2592 $define|true|[yY]*) dflt='y';;
2595 rp='Try to use explicit 64-bit interfaces, if available?'
2608 case "$archname64" in
2609 '') archname64='' ;; # not a typo
2612 case "$use64bits" in
2613 "$define"|true|[yY]*)
2614 : Look for a hint-file generated 'call-back-unit'. If the
2615 : user has specified that a threading perl is to be built,
2616 : we may need to set or change some other defaults.
2617 if $test -f use64bits.cbu; then
2621 dec_osf|hpux|irix|solaris|unicos)
2622 # Known 64-bit capable platforms.
2626 $osname is not known to support 64-bit interfaces.
2627 Please let perlbug@perl.com know how to do that.
2629 Cannot continue, aborting.
2637 : determine the architecture name
2639 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
2640 tarch=`arch`"-$osname"
2641 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
2642 if uname -m > tmparch 2>&1 ; then
2643 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
2644 -e 's/$/'"-$osname/" tmparch`
2652 case "$myarchname" in
2655 echo "(Your architecture name used to be $myarchname.)"
2662 *) dflt="$archname";;
2664 rp='What is your architecture name'
2667 case "$usethreads" in
2669 echo "Threads selected." >&4
2671 *-thread*) echo "...and architecture name already has -thread." >&4
2673 *) archname="$archname-thread"
2674 echo "...setting architecture name to $archname." >&4
2679 case "$usemultiplicity" in
2681 echo "Multiplicity selected." >&4
2683 *-multi*) echo "...and architecture name already has -multi." >&4
2685 *) archname="$archname-multi"
2686 echo "...setting architecture name to $archname." >&4
2691 case "$use64bits" in
2693 echo "Explicit 64-bitness selected." >&4
2694 case "$archname64" in
2699 *-$archname64*) echo "...and architecture name already has $archname64." >&4
2701 *) archname="$archname-$archname64"
2702 echo "...setting architecture name to $archname." >&4
2712 $define|true) afs=true ;;
2713 $undef|false) afs=false ;;
2714 *) if test -d /afs; then
2722 echo "AFS may be running... I'll be extra cautious then..." >&4
2724 echo "AFS does not seem to be running..." >&4
2727 : decide how portable to be. Allow command line overrides.
2728 case "$d_portable" in
2730 *) d_portable="$define" ;;
2733 : set up shell script to do ~ expansion
2739 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2742 if $test -f /bin/csh; then
2743 /bin/csh -f -c "glob \$1"
2748 name=\`$expr x\$1 : '..\([^/]*\)'\`
2749 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2750 if $test ! -d "\$dir"; then
2752 echo "\$me: can't locate home directory for: \$name" >&2
2757 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2773 : now set up to get a file name
2777 cat <<'EOSC' >>getfile
2790 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
2791 fn=`echo $fn | sed 's/(.*)//'`
2797 loc_file=`expr $fn : '.*:\(.*\)'`
2798 fn=`expr $fn : '\(.*\):.*'`
2806 */*) fullpath=true;;
2815 *e*) exp_file=true;;
2818 *p*) nopath_ok=true;;
2823 *d*) type='Directory';;
2824 *l*) type='Locate';;
2829 Locate) what='File';;
2834 case "$d_portable" in
2842 while test "$type"; do
2847 true) rp="$rp (~name ok)";;
2850 if test -f UU/getfile.ok && \
2851 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2870 value=`UU/filexp $ans`
2873 if test "$ans" != "$value"; then
2874 echo "(That expands to $value on this system.)"
2888 /*) value="$ansexp" ;;
2893 echo "I shall only accept a full path name, as in /bin/ls." >&4
2894 echo "Use a ! shell escape if you wish to check pathnames." >&4
2897 echo "Please give a full path name, starting with slash." >&4
2900 echo "Note that using ~name is ok provided it expands well." >&4
2913 if test -f "$ansexp"; then
2915 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2917 echo "($value is not a plain file, but that's ok.)"
2922 if test -d "$ansexp"; then
2927 if test -d "$ansexp"; then
2928 echo "(Looking for $loc_file in directory $value.)"
2929 value="$value/$loc_file"
2930 ansexp="$ansexp/$loc_file"
2932 if test -f "$ansexp"; then
2935 case "$nopath_ok" in
2936 true) case "$value" in
2938 *) echo "Assuming $value will be in people's path."
2954 if test "$fastread" = yes; then
2959 rp="$what $value doesn't exist. Use that name anyway?"
2980 : determine root of directory hierarchy where package will be installed.
2983 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
2991 By default, $package will be installed in $dflt/bin, manual
2992 pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2993 all installation directories. Typically set to /usr/local, but you
2994 may choose /usr if you wish to install $package among your system
2995 binaries. If you wish to have binaries under /bin but manual pages
2996 under /usr/local/man, that's ok: you will be prompted separately
2997 for each of the installation directories, the prefix being only used
2998 to set the defaults.
3002 rp='Installation prefix to use?'
3010 *) oldprefix="$prefix";;
3017 : set the prefixit variable, to compute a suitable default value
3018 prefixit='case "$3" in
3020 case "$oldprefix" in
3021 "") eval "$1=\"\$$2\"";;
3028 ""|" ") eval "$1=\"\$$2\"";;
3034 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3036 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3037 /*-$oldprefix/*|\~*-$oldprefix/*)
3038 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3039 *) eval "$1=\"\$$2\"";;
3043 : set the base revision
3046 : get the patchlevel
3048 echo "Getting the current patchlevel..." >&4
3049 if $test -r $rsrc/patchlevel.h;then
3050 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3051 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3056 $echo $n "(You have $package" $c
3059 *) $echo $n " $baserev" $c ;;
3061 $echo $n " patchlevel $patchlevel" $c
3062 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3065 if test 0 -eq "$subversion"; then
3066 version=`LC_ALL=C; export LC_ALL; \
3067 echo $baserev $patchlevel | \
3068 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3070 version=`LC_ALL=C; export LC_ALL; \
3071 echo $baserev $patchlevel $subversion | \
3072 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3074 : Figure out perl API version. Perhaps this should be in patchlevel.h
3075 if test "$subversion" -lt 50; then
3076 apiversion=`LC_ALL=C; export LC_ALL; \
3077 LANGUAGE=C; export LANGUAGE; \
3078 echo $baserev $patchlevel | \
3079 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3081 apiversion="$version"
3084 : determine where private library files go
3085 : Usual default is /usr/local/lib/perl5/$version.
3086 : Also allow things like /opt/perl/lib/$version, since
3087 : /opt/perl/lib/perl5... would be redundant.
3089 *perl*) set dflt privlib lib/$version ;;
3090 *) set dflt privlib lib/$package/$version ;;
3095 There are some auxiliary files for $package that need to be put into a
3096 private library directory that is accessible by everyone.
3100 rp='Pathname where the private library files will reside?'
3102 if $test "X$privlibexp" != "X$ansexp"; then
3106 privlibexp="$ansexp"
3110 Since you are running AFS, I need to distinguish the directory in which
3111 private files reside from the directory in which they are installed (and from
3112 which they are presumably copied to the former directory by occult means).
3115 case "$installprivlib" in
3116 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
3117 *) dflt="$installprivlib";;
3120 rp='Where will private files be installed?'
3122 installprivlib="$ans"
3124 installprivlib="$privlibexp"
3127 : set the prefixup variable, to restore leading tilda escape
3128 prefixup='case "$prefixexp" in
3130 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3133 : determine where public architecture dependent libraries go
3136 : privlib default is /usr/local/lib/$package/$version
3137 : archlib default is /usr/local/lib/$package/$version/$archname
3138 : privlib may have an optional trailing /share.
3139 tdflt=`echo $privlib | $sed 's,/share$,,'`
3140 tdflt=$tdflt/$archname
3149 $spackage contains architecture-dependent library files. If you are
3150 sharing libraries in a heterogeneous environment, you might store
3151 these files in a separate location. Otherwise, you can just include
3152 them with the rest of the public library files.
3156 rp='Where do you want to put the public architecture-dependent libraries?'
3159 archlibexp="$ansexp"
3164 Since you are running AFS, I need to distinguish the directory in
3165 which architecture-dependent library files reside from the directory
3166 in which they are installed (and from which they are presumably copied
3167 to the former directory by occult means).
3170 case "$installarchlib" in
3171 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
3172 *) dflt="$installarchlib";;
3175 rp='Where will architecture-dependent library files be installed?'
3177 installarchlib="$ans"
3179 installarchlib="$archlibexp"
3181 if $test X"$archlib" = X"$privlib"; then
3187 : make some quick guesses about what we are up against
3189 $echo $n "Hmm... $c"
3199 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3200 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3202 echo "Looks kind of like an OSF/1 system, but we'll see..."
3204 elif test `echo abc | tr a-z A-Z` = Abc ; then
3205 xxx=`./loc addbib blurfl $pth`
3206 if $test -f $xxx; then
3207 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3211 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3212 echo "Looks kind of like an extended USG system, but we'll see..."
3214 echo "Looks kind of like a USG system, but we'll see..."
3218 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3219 echo "Looks kind of like a BSD system, but we'll see..."
3223 echo "Looks kind of like a Version 7 system, but we'll see..."
3226 case "$eunicefix" in
3229 There is, however, a strange, musty smell in the air that reminds me of
3230 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3234 : it so happens the Eunice I know will not run shell scripts in Unix format
3238 echo "Congratulations. You aren't running Eunice."
3242 : Detect OS2. The p_ variable is set above in the Head.U unit.
3247 I have the feeling something is not exactly right, however...don't tell me...
3248 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3253 if test -f /xenix; then
3254 echo "Actually, this looks more like a XENIX system..."
3259 echo "It's not Xenix..."
3264 if test -f /venix; then
3265 echo "Actually, this looks more like a VENIX system..."
3272 echo "Nor is it Venix..."
3275 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3276 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3279 : see if setuid scripts can be secure
3282 Some kernels have a bug that prevents setuid #! scripts from being
3283 secure. Some sites have disabled setuid #! scripts because of this.
3285 First let's decide if your kernel supports secure setuid #! scripts.
3286 (If setuid #! scripts would be secure but have been disabled anyway,
3287 don't say that they are secure if asked.)
3292 if $test -d /dev/fd; then
3293 echo "#!$ls" >reflect
3294 chmod +x,u+s reflect
3295 ./reflect >flect 2>&1
3296 if $contains "/dev/fd" flect >/dev/null; then
3297 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3301 If you are not sure if they are secure, I can check but I'll need a
3302 username and password different from the one you are using right now.
3303 If you don't have such a username or don't want me to test, simply
3307 rp='Other username to test security of setuid scripts with?'
3312 case "$d_suidsafe" in
3313 '') echo "I'll assume setuid scripts are *not* secure." >&4
3316 echo "Well, the $hint value is *not* secure." >&4
3318 *) echo "Well, the $hint value *is* secure." >&4
3323 $rm -f reflect flect
3324 echo "#!$ls" >reflect
3325 chmod +x,u+s reflect
3328 echo '"su" will (probably) prompt you for '"$ans's password."
3329 su $ans -c './reflect >flect'
3330 if $contains "/dev/fd" flect >/dev/null; then
3331 echo "Okay, it looks like setuid scripts are secure." >&4
3334 echo "I don't think setuid scripts are secure." >&4
3339 rp='Does your kernel have *secure* setuid scripts?'
3342 [yY]*) val="$define";;
3347 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3348 echo "(That's for file descriptors, not floppy disks.)"
3354 $rm -f reflect flect
3356 : now see if they want to do setuid emulation
3359 case "$d_suidsafe" in
3362 echo "No need to emulate SUID scripts since they are secure here." >& 4
3366 Some systems have disabled setuid scripts, especially systems where
3367 setuid scripts cannot be secure. On systems where setuid scripts have
3368 been disabled, the setuid/setgid bits on scripts are currently
3369 useless. It is possible for $package to detect those bits and emulate
3370 setuid/setgid in a secure fashion. This emulation will only work if
3371 setuid scripts have been disabled in your kernel.
3375 "$define") dflt=y ;;
3378 rp="Do you want to do setuid/setgid emulation?"
3381 [yY]*) val="$define";;
3389 : determine where manual pages are on this system
3393 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
3394 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
3395 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
3396 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
3397 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
3398 sysman=`./loc . /usr/man/man1 $syspath`
3401 if $test -d "$sysman"; then
3402 echo "System manual is in $sysman." >&4
3404 echo "Could not find manual pages in source form." >&4
3407 : see what memory models we can support
3410 $cat >pdp11.c <<'EOP'
3419 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
3420 if $test -f pdp11 && ./pdp11 2>/dev/null; then
3421 dflt='unsplit split'
3423 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3426 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3431 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3434 if $test -d /lib/large || $test -d /usr/lib/large; then
3437 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3446 Some systems have different model sizes. On most systems they are called
3447 small, medium, large, and huge. On the PDP11 they are called unsplit and
3448 split. If your system doesn't support different memory models, say "none".
3449 If you wish to force everything to one memory model, say "none" here and
3450 put the appropriate flags later when it asks you for other cc and ld flags.
3451 Venix systems may wish to put "none" and let the compiler figure things out.
3452 (In the following question multiple model names should be space separated.)
3454 The default for most systems is "none".
3457 rp="Which memory models are supported?"
3472 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3473 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3480 rp="What flag indicates separate I and D space?"
3488 *large*|*small*|*medium*|*huge*)
3495 rp="What flag indicates large model?"
3505 *huge*) case "$huge" in
3509 rp="What flag indicates huge model?"
3519 *medium*) case "$medium" in
3523 rp="What flag indicates medium model?"
3530 *) medium="$large";;
3533 *small*) case "$small" in
3537 rp="What flag indicates small model?"
3548 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3551 $rm -f pdp11.* pdp11
3553 : see if we need a special compiler
3561 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3562 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3576 On some older systems the default C compiler will not resolve multiple global
3577 references that happen to have the same name. On some such systems the "Mcc"
3578 command may be used to force these to be resolved. On other systems a "cc -M"
3579 command is required. (Note that the -M flag on other systems indicates a
3580 memory model to use!) If you have the Gnu C compiler, you might wish to use
3586 rp="Use which C compiler?"
3594 rp="Use which C compiler?"
3598 : Look for a hint-file generated 'call-back-unit'. Now that the
3599 : user has specified the compiler, we may need to set or change some
3601 if $test -f cc.cbu; then
3605 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3606 $cat >gccvers.c <<EOM
3611 printf("%s\n", __VERSION__);
3613 printf("%s\n", "1");
3619 if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3620 gccversion=`./gccvers`
3621 case "$gccversion" in
3622 '') echo "You are not using GNU cc." ;;
3623 *) echo "You are using GNU cc $gccversion." ;;
3627 echo "*** WHOA THERE!!! ***" >&4
3628 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3629 case "$knowitall" in
3631 echo " You'd better start hunting for one and let me know about it." >&4
3637 case "$gccversion" in
3638 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3641 : What should the include directory be ?
3643 $echo $n "Hmm... $c"
3647 if $test -f /bin/mips && /bin/mips; then
3648 echo "Looks like a MIPS system..."
3649 $cat >usr.c <<'EOCP'
3650 #ifdef SYSTYPE_BSD43
3654 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3655 dflt='/bsd43/usr/include'
3659 mips_type='System V'
3661 $rm -f usr.c usr.out
3662 echo "and you're compiling with the $mips_type compiler and libraries."
3666 echo "Doesn't look like a MIPS system."
3676 case "$xxx_prompt" in
3679 rp='Where are the include files you want to use?'
3687 : see how we invoke the C preprocessor
3689 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3690 cat <<'EOT' >testcpp.c
3696 if test ! -f cppstdin; then
3697 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3699 echo "Keeping your $hint cppstdin wrapper."
3702 wrapper=`pwd`/cppstdin
3706 if $test "X$cppstdin" != "X" && \
3707 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3708 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3710 echo "You used to use $cppstdin $cppminus so we'll use that again."
3712 '') echo "But let's see if we can live without a wrapper..." ;;
3714 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3715 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3717 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3720 echo "(However, $cpprun $cpplast does not work, let's see...)"
3728 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3735 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3736 $cc -E <testcpp.c >testcpp.out 2>&1; \
3737 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3738 echo "Yup, it does."
3741 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3742 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3743 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3744 echo "Yup, it does."
3747 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3748 $cc -P <testcpp.c >testcpp.out 2>&1; \
3749 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3750 echo "Yipee, that works!"
3753 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3754 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3755 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3756 echo "At long last!"
3759 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3760 $cpp <testcpp.c >testcpp.out 2>&1; \
3761 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3765 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3766 $cpp - <testcpp.c >testcpp.out 2>&1; \
3767 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3768 echo "Hooray, it works! I was beginning to wonder."
3771 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3772 $wrapper <testcpp.c >testcpp.out 2>&1; \
3773 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3779 rp="No dice. I can't find a C preprocessor. Name one:"
3783 $x_cpp <testcpp.c >testcpp.out 2>&1
3784 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3785 echo "OK, that will do." >&4
3787 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3802 echo "Perhaps can we force $cc -E using a wrapper..."
3803 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3804 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3810 echo "Nope, we'll have to live without it..."
3824 "$wrapper"|'cppstdin') ;;
3825 *) $rm -f $wrapper;;
3827 $rm -f testcpp.c testcpp.out
3829 : Set private lib path
3832 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3837 '') dlist="$loclibpth $plibpth $glibpth";;
3838 *) dlist="$libpth";;
3841 : Now check and see which directories actually exist, avoiding duplicates
3845 if $test -d $xxx; then
3848 *) libpth="$libpth $xxx";;
3854 Some systems have incompatible or broken versions of libraries. Among
3855 the directories listed in the question below, please remove any you
3856 know not to be holding relevant libraries, and add any that are needed.
3857 Say "none" for none.
3868 rp="Directories to use for library searches?"
3875 : compute shared library extension
3878 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3888 On some systems, shared libraries may be available. Answer 'none' if
3889 you want to suppress searching of shared libraries for the remaining
3890 of this configuration.
3893 rp='What is the file extension used for shared libraries?'
3897 : Define several unixisms.
3898 : Hints files or command line option can be used to override them.
3899 : The convoluted testing is in case hints files set either the old
3902 '') case "$exe_ext" in
3904 *) _exe="$exe_ext" ;;
3909 '') case "$lib_ext" in
3916 '') case "$obj_ext" in
3923 '') case "$path_sep" in
3934 : Which makefile gets called first. This is used by make depend.
3935 case "$firstmakefile" in
3936 '') firstmakefile='makefile';;
3939 : Looking for optional libraries
3941 echo "Checking for optional libraries..." >&4
3946 case "$libswanted" in
3947 '') libswanted='c_s';;
3949 for thislib in $libswanted; do
3951 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3952 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3953 echo "Found -l$thislib (shared)."
3956 *) dflt="$dflt -l$thislib";;
3958 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3959 echo "Found -l$thislib (shared)."
3962 *) dflt="$dflt -l$thislib";;
3964 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3965 echo "Found -l$thislib."
3968 *) dflt="$dflt -l$thislib";;
3970 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3971 echo "Found -l$thislib."
3974 *) dflt="$dflt -l$thislib";;
3976 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3977 echo "Found -l${thislib}_s."
3980 *) dflt="$dflt -l${thislib}_s";;
3982 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3983 echo "Found -l$thislib."
3986 *) dflt="$dflt -l$thislib";;
3989 echo "No -l$thislib."
4000 ' '|'') dflt='none';;
4005 Some versions of Unix support shared libraries, which make executables smaller
4006 but make load time slightly longer.
4008 On some systems, mostly System V Release 3's, the shared library is included
4009 by putting the option "-lc_s" as the last thing on the cc command line when
4010 linking. Other systems use shared libraries by default. There may be other
4011 libraries needed to compile $package on your machine as well. If your system
4012 needs the "-lc_s" option, include it here. Include any other special libraries
4013 here as well. Say "none" for none.
4017 rp="Any additional libraries?"
4024 : determine optimize, if desired, or use for debug flag also
4026 ' '|$undef) dflt='none';;
4028 *) dflt="$optimize";;
4032 Some C compilers have problems with their optimizers. By default, $package
4033 compiles with the -O flag to use the optimizer. Alternately, you might want
4034 to use the symbolic debugger, which uses the -g flag (on traditional Unix
4035 systems). Either flag can be specified here. To use neither flag, specify
4039 rp="What optimizer/debugger flag should be used?"
4043 'none') optimize=" ";;
4047 : We will not override a previous value, but we might want to
4048 : augment a hint file
4051 case "$gccversion" in
4052 1*) dflt='-fpcc-struct-return' ;;
4055 *-g*) dflt="$dflt -DDEBUGGING";;
4057 case "$gccversion" in
4058 2*) if test -d /etc/conf/kconfig.d &&
4059 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4068 case "$mips_type" in
4069 *BSD*|'') inclwanted="$locincpth $usrinc";;
4070 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4072 for thisincl in $inclwanted; do
4073 if $test -d $thisincl; then
4074 if $test x$thisincl != x$usrinc; then
4077 *) dflt="$dflt -I$thisincl";;
4083 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4085 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4093 *) dflt="$dflt -D$2";;
4097 set signal.h LANGUAGE_C; eval $inctest
4100 none|recommended) dflt="$ccflags $dflt" ;;
4101 *) dflt="$ccflags";;
4109 Your C compiler may want other flags. For this question you should include
4110 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4111 but you should NOT include libraries or ld flags like -lwhatever. If you
4112 want $package to honor its debug switch, you should include -DDEBUGGING here.
4113 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4115 To use no flags, specify the word "none".
4121 rp="Any additional cc flags?"
4128 : the following weeds options from ccflags that are of no interest to cpp
4130 case "$gccversion" in
4131 1*) cppflags="$cppflags -D__GNUC__"
4133 case "$mips_type" in
4135 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4141 echo "Let me guess what the preprocessor flags are..." >&4
4155 *) ftry="$previous $flag";;
4157 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4158 >cpp1.out 2>/dev/null && \
4159 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4160 >cpp2.out 2>/dev/null && \
4161 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4162 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4164 cppflags="$cppflags $ftry"
4174 *-*) echo "They appear to be: $cppflags";;
4176 $rm -f cpp.c cpp?.out
4180 : flags used in final linking phase
4182 '') if ./venix; then
4188 *-posix*) dflt="$dflt -posix" ;;
4191 *) dflt="$ldflags";;
4194 : Try to guess additional flags to pick up local libraries.
4195 for thislibdir in $libpth; do
4196 case " $loclibpth " in
4199 *"-L$thislibdir "*) ;;
4200 *) dflt="$dflt -L$thislibdir" ;;
4212 Your C linker may need flags. For this question you should
4213 include -L/whatever and any other flags used by the C linker, but you
4214 should NOT include libraries like -lwhatever.
4216 Make sure you include the appropriate -L/path flags if your C linker
4217 does not normally search all of the directories you specified above,
4220 To use no flags, specify the word "none".
4224 rp="Any additional ld flags (NOT including libraries)?"
4230 rmlist="$rmlist pdp11"
4234 echo "Checking your choice of C compiler and flags for coherency..." >&4
4235 $cat > try.c <<'EOF'
4237 int main() { printf("Ok\n"); exit(0); }
4239 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4241 $cat >try.msg <<'EOM'
4242 I've tried to compile and run the following simple program:
4245 $cat try.c >> try.msg
4247 $cat >> try.msg <<EOM
4254 and I got the following output:
4258 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4259 if sh -c './try' >>try.msg 2>&1; then
4263 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4266 cat >> try.msg <<'EOQS'
4267 If $libs contains -lsfio, and sfio is mis-configured, then it
4268 sometimes (apparently) runs and exits with a 0 status, but with no
4269 output! It may have to do with sfio's use of _exit vs. exit.
4272 rp="You have a big problem. Shall I abort Configure"
4279 echo "The program compiled OK, but exited with status $?." >>try.msg
4280 rp="You have a problem. Shall I abort Configure"
4284 echo "I can't compile the test program." >>try.msg
4285 rp="You have a BIG problem. Shall I abort Configure"
4291 case "$knowitall" in
4293 echo "(The supplied flags or libraries might be incorrect.)"
4301 *) echo "Ok. Stopping Configure." >&4
4306 n) echo "OK, that should do.";;
4308 $rm -f try try.* core
4310 : determine filename position in cpp output
4312 echo "Computing filename position in cpp output for #include directives..." >&4
4313 echo '#include <stdio.h>' > foo.c
4316 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4317 $grep '^[ ]*#.*stdio\.h' | \
4318 while read cline; do
4321 while $test \$# -gt 0; do
4322 if $test -r \`echo \$1 | $tr -d '"'\`; then
4327 pos=\`expr \$pos + 1\`
4339 *) pos="${fieldn}th";;
4341 echo "Your cpp writes the filename in the $pos field of the line."
4343 : locate header file
4348 for usrincdir in $usrinc
4350 if test -f \$usrincdir/\$wanted; then
4351 echo "\$usrincdir/\$wanted"
4355 awkprg='{ print \$$fieldn }'
4356 echo "#include <\$wanted>" > foo\$\$.c
4357 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4358 $grep "^[ ]*#.*\$wanted" | \
4359 while read cline; do
4360 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4362 *[/\\\\]\$wanted) echo "\$name"; exit 0;;
4373 : define an alternate in-header-list? function
4374 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4375 cont=true; xxf="echo \"<\$1> found.\" >&4";
4376 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4377 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4379 case $# in 4) instead=instead;; *) instead="at last";; esac;
4380 while $test "$cont"; do
4382 var=$2; eval "was=\$$2";
4383 if $test "$xxx" && $test -r "$xxx";
4385 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4388 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4389 set $yyy; shift; shift; yyy=$@;
4390 case $# in 0) cont="";;
4391 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4392 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4393 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4394 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4398 do set $yyy; var=$2; eval "was=\$$2";
4399 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4400 set $yyy; shift; shift; yyy=$@;
4403 : see if this is a malloc.h system
4404 set malloc.h i_malloc
4407 : see if stdlib is available
4408 set stdlib.h i_stdlib
4411 : determine which malloc to compile in
4413 case "$usemymalloc" in
4414 ''|[yY]*|true|$define) dflt='y' ;;
4417 rp="Do you wish to attempt to use the malloc that comes with $package?"
4423 mallocsrc='malloc.c'
4424 mallocobj="malloc$_o"
4425 d_mymalloc="$define"
4428 : Remove malloc from list of libraries to use
4429 echo "Removing unneeded -lmalloc from library list" >&4
4430 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4433 echo "libs = $libs" >&4
4445 : compute the return types of malloc and free
4447 $cat >malloc.c <<END
4451 #include <sys/types.h>
4465 case "$malloctype" in
4467 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4474 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4478 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4485 echo "Your system uses $freetype free(), it would seem." >&4
4487 : Cruising for prototypes
4489 echo "Checking out function prototypes..." >&4
4490 $cat >prototype.c <<'EOCP'
4491 int main(int argc, char *argv[]) {
4494 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4495 echo "Your C compiler appears to support function prototypes."
4498 echo "Your C compiler doesn't seem to understand function prototypes."
4505 case "$prototype" in
4507 *) ansi2knr='ansi2knr'
4512 This version of $package can only be compiled by a compiler that
4513 understands function prototypes. Unfortunately, your C compiler
4515 doesn't seem to understand them. Sorry about that.
4517 If GNU cc is available for your system, perhaps you could try that instead.
4519 Eventually, we hope to support building Perl with pre-ANSI compilers.
4520 If you would like to help in that effort, please contact <perlbug@perl.org>.
4522 Aborting Configure now.
4528 : determine where public executables go
4533 rp='Pathname where the public executables will reside?'
4535 if $test "X$ansexp" != "X$binexp"; then
4543 Since you are running AFS, I need to distinguish the directory in which
4544 executables reside from the directory in which they are installed (and from
4545 which they are presumably copied to the former directory by occult means).
4548 case "$installbin" in
4549 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
4550 *) dflt="$installbin";;
4553 rp='Where will public executables be installed?'
4557 installbin="$binexp"
4560 : determine whether to install perl also as /usr/bin/perl
4563 if test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4565 Many scripts expect to perl to be installed as /usr/bin/perl.
4566 I can install the perl you are about to compile also as /usr/bin/perl
4567 (in addition to $installbin/perl).
4569 case "$installusrbinperl" in
4570 "$undef"|[nN]*) dflt='n';;
4573 rp="Do you want to install perl as /usr/bin/perl?"
4576 [yY]*) val="$define";;
4582 set installusrbinperl
4585 : define a shorthand compile call
4589 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4590 : define a shorthand compile call for compilations that should be ok.
4594 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4597 echo "Checking for GNU C Library..." >&4
4598 cat >gnulibc.c <<EOM
4610 if eval $compile_ok && ./gnulibc; then
4612 echo "You are using the GNU C Library"
4615 echo "You are not using the GNU C Library"
4621 : see if nm is to be used to determine whether a symbol is defined or not
4625 case "$d_gnulibc" in
4628 echo "nm probably won't work on the GNU C Library." >&4
4634 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4636 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4637 echo "'nm' won't be sufficient on this sytem." >&4
4643 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4644 if $test $dflt -gt 20; then
4654 true|$define) dflt=y;;
4661 I can use $nm to extract the symbols from your C libraries. This
4662 is a time consuming task which may generate huge output on the disk (up
4663 to 3 megabytes) but that should make the symbols extraction faster. The
4664 alternative is to skip the 'nm' extraction part and to compile a small
4665 test program instead to determine whether each symbol is present. If
4666 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4667 this may be the best solution.
4669 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4672 rp="Shall I use $nm to extract C symbols from the libraries?"
4675 [Nn]*) usenm=false;;
4684 : nm options which may be necessary
4686 '') if $test -f /mach_boot; then
4688 elif $test -d /usr/ccs/lib; then
4689 nm_opt='-p' # Solaris (and SunOS?)
4690 elif $test -f /dgux; then
4692 elif $test -f /lib64/rld; then
4693 nm_opt='-p' # 64-bit Irix
4699 : nm options which may be necessary for shared libraries but illegal
4700 : for archive libraries. Thank you, Linux.
4701 case "$nm_so_opt" in
4702 '') case "$myuname" in
4704 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4705 nm_so_opt='--dynamic'
4714 : get list of predefined functions in a handy place
4719 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4726 *) for thislib in $libs; do
4729 : Handle C library specially below.
4732 thislib=`echo $thislib | $sed -e 's/^-l//'`
4733 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4735 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4737 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4739 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4741 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4743 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4745 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4750 libnames="$libnames $try"
4752 *) libnames="$libnames $thislib" ;;
4761 for xxx in $libpth; do
4762 $test -r $1 || set $xxx/libc.$so
4763 : The messy sed command sorts on library version numbers.
4765 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4766 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4768 s/[0-9][0-9]*/0000&/g
4769 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4772 sort | $sed -e 's/^.* //'`
4775 $test -r $1 || set /usr/ccs/lib/libc.$so
4776 $test -r $1 || set /lib/libsys_s$_a
4782 if $test -r "$1"; then
4783 echo "Your (shared) C library seems to be in $1."
4785 elif $test -r /lib/libc && $test -r /lib/clib; then
4786 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4788 libc='/lib/clib /lib/libc'
4789 if $test -r /lib/syslib; then
4790 echo "(Your math library is in /lib/syslib.)"
4791 libc="$libc /lib/syslib"
4793 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4794 echo "Your C library seems to be in $libc, as you said before."
4795 elif $test -r $incpath/usr/lib/libc$_a; then
4796 libc=$incpath/usr/lib/libc$_a;
4797 echo "Your C library seems to be in $libc. That's fine."
4798 elif $test -r /lib/libc$_a; then
4800 echo "Your C library seems to be in $libc. You're normal."
4802 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4804 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4805 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4806 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4808 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4810 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4813 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4815 if $test -r "$tans"; then
4816 echo "Your C library seems to be in $tans, of all places."
4822 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4826 If the guess above is wrong (which it might be if you're using a strange
4827 compiler, or your machine supports multiple models), you can override it here.
4832 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
4834 I can't seem to find your C library. I've looked in the following places:
4837 $sed 's/^/ /' libpath
4840 None of these seems to contain your C library. I need to get its name...
4845 rp='Where is your C library?'
4850 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
4851 set X `cat libnames`
4854 case $# in 1) xxx=file; esac
4855 echo "Extracting names from the following $xxx for later perusal:" >&4
4857 $sed 's/^/ /' libnames >&4
4859 $echo $n "This may take a while...$c" >&4
4863 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4864 *) $nm $nm_opt $file 2>/dev/null;;
4869 $grep fprintf libc.tmp > libc.ptf
4870 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4871 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4873 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4875 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4877 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4879 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4881 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4883 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4885 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4887 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4889 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4891 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4893 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4895 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4897 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4898 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4900 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4902 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4904 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4906 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4908 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4910 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4912 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4914 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4916 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4918 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4920 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4922 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4924 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4926 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
4928 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4931 $nm -p $* 2>/dev/null >libc.tmp
4932 $grep fprintf libc.tmp > libc.ptf
4933 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4934 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4940 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4942 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4943 for thisname in $libnames $libc; do
4944 $ar t $thisname >>libc.tmp
4946 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4948 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4949 # Repeat libc to extract forwarders to DLL entries too
4950 for thisname in $libnames $libc; do
4951 $ar tv $thisname >>libc.tmp
4952 # Revision 50 of EMX has bug in $ar.
4953 # it will not extract forwarders to DLL entries
4954 # Use emximp which will extract exactly them.
4955 emximp -o tmp.imp $thisname \
4957 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
4958 < tmp.imp >>libc.tmp
4961 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
4964 echo "$ar didn't seem to work right." >&4
4965 echo "Maybe this is a Cray...trying bld instead..." >&4
4966 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
4968 for thisname in $libnames; do
4970 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
4971 $ar t $thisname >>libc.tmp
4975 echo "That didn't work either. Giving up." >&4
4982 if $test -f /lib/syscalls.exp; then
4984 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4985 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
4989 $rm -f libnames libpath
4991 : see if dld is available
4995 : is a C symbol defined?
4998 -v) tf=libc.tmp; tc=""; tdc="";;
4999 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5000 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5003 case "$reuseval-$4" in
5005 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5011 if $contains $tlook $tf >/dev/null 2>&1;
5016 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5017 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5025 $define) tval=true;;
5031 : define an is-in-libc? function
5032 inlibc='echo " "; td=$define; tu=$undef;
5033 sym=$1; var=$2; eval "was=\$$2";
5035 case "$reuseval$was" in
5045 echo "$sym() found." >&4;
5046 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5048 echo "$sym() NOT found." >&4;
5049 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5053 $define) echo "$sym() found." >&4;;
5054 *) echo "$sym() NOT found." >&4;;
5058 : see if dlopen exists
5065 : determine which dynamic loading, if any, to compile in
5067 dldir="ext/DynaLoader"
5080 $define) dflt='y' ;;
5083 $define) dflt='y' ;;
5085 : Does a dl_xxx.xs file exist for this operating system
5086 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5089 rp="Do you wish to use dynamic loading?"
5096 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5097 dflt="$dldir/dl_${osname}.xs"
5098 elif $test "$d_dlopen" = "$define" ; then
5099 dflt="$dldir/dl_dlopen.xs"
5100 elif $test "$i_dld" = "$define" ; then
5101 dflt="$dldir/dl_dld.xs"
5106 *) dflt="$dldir/$dlsrc"
5109 echo "The following dynamic loading files are available:"
5110 : Can not go over to $dldir because getfile has path hard-coded in.
5111 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5112 rp="Source file to use for dynamic loading"
5114 # XXX This getfile call will fail the existence check if you try
5115 # building away from $src (this is not supported yet).
5119 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5123 Some systems may require passing special flags to $cc -c to
5124 compile modules that will be used to create a shared library.
5125 To use no flags, say "none".
5128 case "$cccdlflags" in
5129 '') case "$gccversion" in
5130 '') case "$osname" in
5132 next) dflt='none' ;;
5133 irix*) dflt='-KPIC' ;;
5134 svr4*|esix*|solaris) dflt='-KPIC' ;;
5135 sunos) dflt='-pic' ;;
5139 *) case "$osname" in
5140 svr4*|esix*|solaris) dflt='-fPIC' ;;
5145 *) dflt="$cccdlflags" ;;
5147 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5150 none) cccdlflags=' ' ;;
5151 *) cccdlflags="$ans" ;;
5156 Some systems use ld to create libraries that can be dynamically loaded,
5157 while other systems (such as those using ELF) use $cc.
5161 '') $cat >try.c <<'EOM'
5162 /* Test for whether ELF binaries are produced */
5167 int i = open("a.out",O_RDONLY);
5170 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5171 exit(0); /* succeed (yes, it's ELF) */
5176 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5178 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5182 echo "I'll use ld to build dynamic libraries."
5191 rp="What command should be used to create dynamic libraries?"
5197 Some systems may require passing special flags to $ld to create a
5198 library that can be dynamically loaded. If your ld flags include
5199 -L/other/path options to locate libraries outside your loader's normal
5200 search path, you may need to specify those -L options here as well. To
5201 use no flags, say "none".
5204 case "$lddlflags" in
5205 '') case "$osname" in
5206 beos) dflt='-nostart' ;;
5208 linux|irix*) dflt='-shared' ;;
5209 next) dflt='none' ;;
5210 solaris) dflt='-G' ;;
5211 sunos) dflt='-assert nodefinitions' ;;
5212 svr4*|esix*) dflt="-G $ldflags" ;;
5216 *) dflt="$lddlflags" ;;
5219 : Try to guess additional flags to pick up local libraries.
5220 : Be careful not to append to a plain 'none'
5224 for thisflag in $ldflags; do
5229 *) dflt="$dflt $thisflag" ;;
5236 ''|' ') dflt='none' ;;
5239 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5242 none) lddlflags=' ' ;;
5243 *) lddlflags="$ans" ;;
5248 Some systems may require passing special flags to $cc to indicate that
5249 the resulting executable will use dynamic linking. To use no flags,
5253 case "$ccdlflags" in
5254 '') case "$osname" in
5255 hpux) dflt='-Wl,-E' ;;
5256 linux) dflt='-rdynamic' ;;
5257 next) dflt='none' ;;
5258 sunos) dflt='none' ;;
5262 *) dflt="$ccdlflags" ;;
5264 rp="Any special flags to pass to $cc to use dynamic loading?"
5267 none) ccdlflags=' ' ;;
5268 *) ccdlflags="$ans" ;;
5282 # No dynamic loading being used, so don't bother even to prompt.
5285 *) case "$useshrplib" in
5286 '') case "$osname" in
5287 svr4*|dgux|dynixptx|esix|powerux|beos)
5289 also='Building a shared libperl is required for dynamic loading to work on your system.'
5294 also='Building a shared libperl is needed for MAB support.'
5312 The perl executable is normally obtained by linking perlmain.c with
5313 libperl${_a}, any static extensions (usually just DynaLoader), and
5314 any other libraries needed on this system (such as -lm, etc.). Since
5315 your system supports dynamic loading, it is probably possible to build
5316 a shared libperl.$so. If you will have more than one executable linked
5317 to libperl.$so, this will significantly reduce the size of each
5318 executable, but it may have a noticeable affect on performance. The
5319 default is probably sensible for your system.
5323 rp="Build a shared libperl.$so (y/n)"
5328 # Why does next4 have to be so different?
5329 case "${osname}${osvers}" in
5331 xxx='DYLD_LIBRARY_PATH' ;;
5332 os2*) xxx='' ;; # Nothing special needed.
5334 *) xxx='LD_LIBRARY_PATH' ;;
5337 *) useshrplib='false' ;;
5342 case "$useshrplib" in
5346 # Figure out a good name for libperl.so. Since it gets stored in
5347 # a version-specific architecture-dependent library, the version
5348 # number isn't really that important, except for making cc/ld happy.
5350 # A name such as libperl.so.3.1
5351 majmin="libperl.$so.$patchlevel.$subversion"
5352 # A name such as libperl.so.301
5353 majonly=`echo $patchlevel $subversion |
5354 $awk '{printf "%d%02d", $1, $2}'`
5355 majonly=libperl.$so.$majonly
5356 # I'd prefer to keep the os-specific stuff here to a minimum, and
5357 # rely on figuring it out from the naming of libc.
5358 case "${osname}${osvers}" in
5361 # XXX How handle the --version stuff for MAB?
5363 linux*) # ld won't link with a bare -lperl otherwise.
5366 *) # Try to guess based on whether libc has major.minor.
5368 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5369 *libc.$so.[0-9]*) dflt=$majonly ;;
5370 *) dflt=libperl.$so ;;
5380 I need to select a good name for the shared libperl. If your system uses
5381 library names with major and minor numbers, then you might want something
5382 like $majmin. Alternatively, if your system uses a single version
5383 number for shared libraries, then you might want to use $majonly.
5384 Or, your system might be quite happy with a simple libperl.$so.
5386 Since the shared libperl will get installed into a version-specific
5387 architecture-dependent directory, the version number of the shared perl
5388 library probably isn't important, so the default should be o.k.
5391 rp='What name do you want to give to the shared libperl?'
5394 echo "Ok, I'll use $libperl"
5397 libperl="libperl${_a}"
5401 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5405 WARNING: Use of the shrpdir variable for the installation location of
5406 the shared $libperl is not supported. It was never documented and
5407 will not work in this version. Let me (perlbug@perl.com)
5408 know of any problems this may cause.
5414 But your current setting of $shrpdir is
5415 the default anyway, so it's harmless.
5420 Further, your current attempted setting of $shrpdir
5421 conflicts with the value of $archlibexp/CORE
5422 that installperl will use.
5429 # How will the perl executable find the installed shared $libperl?
5430 # Add $xxx to ccdlflags.
5431 # If we can't figure out a command-line option, use $shrpenv to
5432 # set env LD_RUN_PATH. The main perl makefile uses this.
5433 shrpdir=$archlibexp/CORE
5436 if "$useshrplib"; then
5439 # We'll set it in Makefile.SH...
5445 xxx="-Wl,-R$shrpdir"
5447 linux|irix*|dec_osf)
5448 xxx="-Wl,-rpath,$shrpdir"
5451 # next doesn't like the default...
5454 # beos doesn't like the default, either.
5457 # hpux doesn't like the default, either.
5458 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5461 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5467 # Only add $xxx if it isn't already in ccdlflags.
5468 case " $ccdlflags " in
5470 *) ccdlflags="$ccdlflags $xxx"
5473 Adding $xxx to the flags
5474 passed to $ld so that the perl executable will find the
5475 installed shared $libperl.
5483 # Respect a hint or command-line value.
5485 '') shrpenv="$tmp_shrpenv" ;;
5488 : determine where manual pages go
5489 set man1dir man1dir none
5493 $spackage has manual pages available in source form.
5497 echo "However, you don't have nroff, so they're probably useless to you."
5499 '') man1dir="none";;
5502 echo "If you don't want the manual sources installed, answer 'none'."
5507 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5508 lookpath="$lookpath $prefixexp/man/p_man/man1"
5509 lookpath="$lookpath $prefixexp/man/u_man/man1"
5510 lookpath="$lookpath $prefixexp/man/man.1"
5512 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5513 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5523 rp="Where do the main $spackage manual pages (source) go?"
5525 if $test "X$man1direxp" != "X$ansexp"; then
5529 man1direxp="$ansexp"
5537 Since you are running AFS, I need to distinguish the directory in which
5538 manual pages reside from the directory in which they are installed (and from
5539 which they are presumably copied to the former directory by occult means).
5542 case "$installman1dir" in
5543 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
5544 *) dflt="$installman1dir";;
5547 rp='Where will man pages be installed?'
5549 installman1dir="$ans"
5551 installman1dir="$man1direxp"
5554 : What suffix to use on installed man pages
5561 rp="What suffix should be used for the main $spackage man pages?"
5563 '') case "$man1dir" in
5577 *) dflt="$man1ext";;
5584 : see if we can have long filenames
5586 rmlist="$rmlist /tmp/cf$$"
5587 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5588 first=123456789abcdef
5589 second=/tmp/cf$$/$first
5590 $rm -f $first $second
5591 if (echo hi >$first) 2>/dev/null; then
5592 if $test -f 123456789abcde; then
5593 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5596 if (echo hi >$second) 2>/dev/null; then
5597 if $test -f /tmp/cf$$/123456789abcde; then
5599 That's peculiar... You can have filenames longer than 14 characters, but only
5600 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5601 I shall consider your system cannot support long filenames at all.
5605 echo 'You can have filenames longer than 14 characters.' >&4
5610 How confusing! Some of your filesystems are sane enough to allow filenames
5611 longer than 14 characters but some others like /tmp can't even think about them.
5612 So, for now on, I shall assume your kernel does not allow them at all.
5619 You can't have filenames longer than 14 chars. You can't even think about them!
5625 $rm -rf /tmp/cf$$ 123456789abcde*
5627 : determine where library module manual pages go
5628 set man3dir man3dir none
5632 $spackage has manual pages for many of the library modules.
5638 However, you don't have nroff, so they're probably useless to you.
5641 '') man3dir="none";;
5645 case "$d_flexfnam" in
5648 However, your system can't handle the long file names like File::Basename.3.
5651 '') man3dir="none";;
5655 echo "If you don't want the manual sources installed, answer 'none'."
5656 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5658 '') case "$prefix" in
5659 *$prog*) dflt=`echo $man1dir |
5660 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
5661 *) dflt="$privlib/man/man3" ;;
5665 *) dflt="$man3dir" ;;
5670 rp="Where do the $package library man pages (source) go?"
5672 if test "X$man3direxp" != "X$ansexp"; then
5677 man3direxp="$ansexp"
5685 Since you are running AFS, I need to distinguish the directory in which
5686 manual pages reside from the directory in which they are installed (and from
5687 which they are presumably copied to the former directory by occult means).
5690 case "$installman3dir" in
5691 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
5692 *) dflt="$installman3dir";;
5695 rp='Where will man pages be installed?'
5697 installman3dir="$ans"
5699 installman3dir="$man3direxp"
5702 : What suffix to use on installed man pages
5709 rp="What suffix should be used for the $package library man pages?"
5711 '') case "$man3dir" in
5725 *) dflt="$man3ext";;
5732 : see if we have to deal with yellow pages, now NIS.
5733 if $test -d /usr/etc/yp || $test -d /etc/yp; then
5734 if $test -f /usr/etc/nibindd; then
5736 echo "I'm fairly confident you're on a NeXT."
5738 rp='Do you get the hosts file via NetInfo?'
5747 y*) hostcat='nidump hosts .';;
5748 *) case "$hostcat" in
5749 nidump*) hostcat='';;
5759 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
5767 rp='Are you getting the hosts file via yellow pages?'
5770 y*) hostcat='ypcat hosts';;
5771 *) hostcat='cat /etc/hosts';;
5777 '') hostcat='cat /etc/hosts';;
5780 '') groupcat='cat /etc/group';;
5783 '') passcat='cat /etc/passwd';;
5786 : now get the host name
5788 echo "Figuring out host name..." >&4
5789 case "$myhostname" in
5791 echo 'Maybe "hostname" will work...'
5792 if tans=`sh -c hostname 2>&1` ; then
5800 if $test "$cont"; then
5802 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
5803 if tans=`cat /etc/systemid 2>&1` ; then
5805 phostname='cat /etc/systemid'
5806 echo "Whadyaknow. Xenix always was a bit strange..."
5809 elif $test -r /etc/systemid; then
5810 echo "(What is a non-Xenix system doing with /etc/systemid?)"
5813 if $test "$cont"; then
5814 echo 'No, maybe "uuname -l" will work...'
5815 if tans=`sh -c 'uuname -l' 2>&1` ; then
5817 phostname='uuname -l'
5819 echo 'Strange. Maybe "uname -n" will work...'
5820 if tans=`sh -c 'uname -n' 2>&1` ; then
5822 phostname='uname -n'
5824 echo 'Oh well, maybe I can mine it out of whoami.h...'
5825 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
5826 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
5827 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
5829 case "$myhostname" in
5830 '') echo "Does this machine have an identity crisis or something?"
5833 echo "Well, you said $myhostname before..."
5834 phostname='echo $myhostname';;
5840 : you do not want to know about this
5845 if $test "$myhostname" ; then
5847 rp='Your host name appears to be "'$myhostname'".'" Right?"
5855 : bad guess or no guess
5856 while $test "X$myhostname" = X ; do
5858 rp="Please type the (one word) name of your host:"
5863 : translate upper to lower if necessary
5864 case "$myhostname" in
5866 echo "(Normalizing case in your host name)"
5867 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
5871 case "$myhostname" in
5873 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
5874 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
5875 echo "(Trimming domain name from host name--host name is now $myhostname)"
5877 *) case "$mydomain" in
5880 test "X$hostcat" = "Xypcat hosts" &&
5881 ypmatch "$myhostname" hosts 2>/dev/null |\
5882 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
5885 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
5886 /[ ]$myhostname[ . ]/p" > hosts
5889 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
5890 END { print sum }" hosts` = x1 || tmp_re="[ ]"
5891 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
5892 hosts | $sort | $uniq | \
5893 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
5894 case `$echo X$dflt` in
5895 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
5898 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
5903 tans=`./loc resolv.conf X /etc /usr/etc`
5904 if $test -f "$tans"; then
5905 echo "(Attempting domain name extraction from $tans)"
5906 dflt=.`$sed -n -e 's/ / /g' \
5907 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
5908 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5910 .) dflt=.`$sed -n -e 's/ / /g' \
5911 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
5912 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
5919 .) echo "(No help from resolv.conf either -- attempting clever guess)"
5920 dflt=.`sh -c domainname 2>/dev/null`
5923 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
5928 .) echo "(Lost all hope -- silly guess then)"
5934 *) dflt="$mydomain";;
5938 rp="What is your domain name?"
5948 : translate upper to lower if necessary
5951 echo "(Normalizing case in your domain name)"
5952 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
5956 : a little sanity check here
5957 case "$phostname" in
5960 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
5961 $myhostname$mydomain|$myhostname) ;;
5963 case "$phostname" in
5965 echo "(That doesn't agree with your whoami.h file, by the way.)"
5968 echo "(That doesn't agree with your $phostname command, by the way.)"
5978 I need to get your e-mail address in Internet format if possible, i.e.
5979 something like user@host.domain. Please answer accurately since I have
5980 no easy means to double check it. The default value provided below
5981 is most probably close to the reality but may not be valid from outside
5982 your organization...
5986 while test "$cont"; do
5988 '') dflt="$cf_by@$myhostname$mydomain";;
5989 *) dflt="$cf_email";;
5991 rp='What is your e-mail address?'
5997 rp='Address does not look like an Internet one. Use it anyway?'
6013 If you or somebody else will be maintaining perl at your site, please
6014 fill in the correct e-mail address here so that they may be contacted
6015 if necessary. Currently, the "perlbug" program included with perl
6016 will send mail to this address in addition to perlbug@perl.com. You may
6017 enter "none" for no administrator.
6020 case "$perladmin" in
6021 '') dflt="$cf_email";;
6022 *) dflt="$perladmin";;
6024 rp='Perl administrator e-mail address'
6028 : figure out how to guarantee perl startup
6029 case "$startperl" in
6031 case "$sharpbang" in
6035 I can use the #! construct to start perl on your system. This will
6036 make startup of perl scripts faster, but may cause problems if you
6037 want to share those scripts and perl is not in a standard place
6038 ($binexp/perl) on all your platforms. The alternative is to force
6039 a shell by starting the script with a single ':' character.
6043 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6046 none) startperl=": # use perl";;
6047 *) startperl="#!$ans"
6048 if $test 30 -lt `echo "$ans" | wc -c`; then
6051 WARNING: Some systems limit the #! command to 32 characters.
6052 If you experience difficulty running Perl scripts with #!, try
6053 installing Perl in a directory with a shorter pathname.
6059 *) startperl=": # use perl"
6064 echo "I'll use $startperl to start perl scripts."
6066 : figure best path for perl in scripts
6069 perlpath="$binexp/perl"
6070 case "$startperl" in
6075 I will use the "eval 'exec'" idiom to start Perl on your system.
6076 I can use the full path of your Perl binary for this purpose, but
6077 doing so may cause problems if you want to share those scripts and
6078 Perl is not always in a standard place ($binexp/perl).
6082 rp="What path shall I use in \"eval 'exec'\"?"
6089 case "$startperl" in
6091 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6094 : determine where public executable scripts go
6095 set scriptdir scriptdir
6097 case "$scriptdir" in
6100 : guess some guesses
6101 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6102 $test -d /usr/share/bin && dflt=/usr/share/bin
6103 $test -d /usr/local/script && dflt=/usr/local/script
6104 $test -d $prefixexp/script && dflt=$prefixexp/script
6108 *) dflt="$scriptdir"
6113 Some installations have a separate directory just for executable scripts so
6114 that they can mount it across multiple architectures but keep the scripts in
6115 one spot. You might, for example, have a subdirectory of /usr/share for this.
6116 Or you might just lump your scripts in with all your other executables.
6120 rp='Where do you keep publicly executable scripts?'
6122 if $test "X$ansexp" != "X$scriptdirexp"; then
6126 scriptdirexp="$ansexp"
6130 Since you are running AFS, I need to distinguish the directory in which
6131 scripts reside from the directory in which they are installed (and from
6132 which they are presumably copied to the former directory by occult means).
6135 case "$installscript" in
6136 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
6137 *) dflt="$installscript";;
6140 rp='Where will public scripts be installed?'
6142 installscript="$ans"
6144 installscript="$scriptdirexp"
6147 : determine where site specific libraries go.
6148 : Usual default is /usr/local/lib/perl5/site_perl/$apiversion
6149 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6151 *perl*) set dflt sitelib lib/site_$prog/$apiversion ;;
6152 *) set dflt sitelib lib/$package/site_$prog/$apiversion ;;
6157 The installation process will also create a directory for
6158 site-specific extensions and modules. Some users find it convenient
6159 to place all site-specific files in this directory rather than in the
6160 main distribution directory.
6164 rp='Pathname for the site-specific library files?'
6166 if $test "X$sitelibexp" != "X$ansexp"; then
6170 sitelibexp="$ansexp"
6174 Since you are running AFS, I need to distinguish the directory in
6175 which site-specific files reside from the directory in which they are
6176 installed (and from which they are presumably copied to the former
6177 directory by occult means).
6180 case "$installsitelib" in
6181 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
6182 *) dflt="$installsitelib";;
6185 rp='Where will site-specific files be installed?'
6187 installsitelib="$ans"
6189 installsitelib="$sitelibexp"
6192 : determine where site specific architecture-dependent libraries go.
6193 : sitelib default is /usr/local/lib/perl5/site_perl/$apiversion
6194 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6195 : sitelib may have an optional trailing /share.
6196 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6197 tdflt="$tdflt/$archname"
6198 set sitearch sitearch none
6201 '') dflt="$tdflt" ;;
6202 *) dflt="$sitearch" ;;
6206 The installation process will also create a directory for
6207 architecture-dependent site-specific extensions and modules.
6211 rp='Pathname for the site-specific architecture-dependent library files?'
6213 if $test "X$sitearchexp" != "X$ansexp"; then
6217 sitearchexp="$ansexp"
6221 Since you are running AFS, I need to distinguish the directory in
6222 which site-specific architecture-dependent library files reside from
6223 the directory in which they are installed (and from which they are
6224 presumably copied to the former directory by occult means).
6227 case "$installsitearch" in
6228 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
6229 *) dflt="$installsitearch";;
6232 rp='Where will site-specific architecture-dependent files be installed?'
6234 installsitearch="$ans"
6236 installsitearch="$sitearchexp"
6241 Previous version of $package used the standard IO mechanisms as defined
6242 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6243 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6244 the default. This abstraction layer can use AT&T's sfio (if you already
6245 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6246 problems with some extension modules. Using PerlIO with stdio is safe,
6247 but it is slower than plain stdio and therefore is not the default.
6249 If this doesn't make any sense to you, just accept the default 'n'.
6251 case "$useperlio" in
6252 $define|true|[yY]*) dflt='y';;
6255 rp='Use the experimental PerlIO abstraction layer?'
6262 echo "Ok, doing things the stdio way"
6269 : Check how to convert floats to strings.
6270 if test "X$d_Gconvert" = X; then
6272 echo "Checking for an efficient way to convert floats to strings."
6275 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6276 char *myname = "gconvert";
6279 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6280 char *myname = "gcvt";
6283 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6284 char *myname = "sprintf";
6290 checkit(expect, got)
6294 if (strcmp(expect, got)) {
6295 printf("%s oddity: Expected %s, got %s\n",
6296 myname, expect, got);
6306 /* This must be 1st test on (which?) platform */
6307 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6308 Gconvert(0.1, 8, 0, buf);
6309 checkit("0.1", buf);
6311 Gconvert(1.0, 8, 0, buf);
6314 Gconvert(0.0, 8, 0, buf);
6317 Gconvert(-1.0, 8, 0, buf);
6320 /* Some Linux gcvt's give 1.e+5 here. */
6321 Gconvert(100000.0, 8, 0, buf);
6322 checkit("100000", buf);
6324 /* Some Linux gcvt's give -1.e+5 here. */
6325 Gconvert(-100000.0, 8, 0, buf);
6326 checkit("-100000", buf);
6331 case "$d_Gconvert" in
6332 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6333 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6334 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6335 *) xxx_list='gconvert gcvt sprintf' ;;
6338 for xxx_convert in $xxx_list; do
6339 echo "Trying $xxx_convert"
6341 set try -DTRY_$xxx_convert
6342 if eval $compile; then
6343 echo "$xxx_convert" found. >&4
6345 echo "I'll use $xxx_convert to convert floats into a string." >&4
6348 echo "...But $xxx_convert didn't work as I expected."
6351 echo "$xxx_convert NOT found." >&4
6355 case "$xxx_convert" in
6356 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6357 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6358 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6362 : Initialize h_fcntl
6365 : Initialize h_sysfile
6368 : access call always available on UNIX
6372 : locate the flags for 'access()'
6376 $cat >access.c <<'EOCP'
6377 #include <sys/types.h>
6382 #include <sys/file.h>
6391 : check sys/file.h first, no particular reason here
6392 if $test `./findhdr sys/file.h` && \
6393 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
6395 echo "<sys/file.h> defines the *_OK access constants." >&4
6396 elif $test `./findhdr fcntl.h` && \
6397 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
6399 echo "<fcntl.h> defines the *_OK access constants." >&4
6400 elif $test `./findhdr unistd.h` && \
6401 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
6402 echo "<unistd.h> defines the *_OK access constants." >&4
6404 echo "I can't find the four *_OK access constants--I'll use mine." >&4
6410 : see if accessx exists
6411 set accessx d_accessx
6414 : see if alarm exists
6418 : Look for GNU-cc style attribute checking
6420 echo "Checking whether your compiler can handle __attribute__ ..." >&4
6421 $cat >attrib.c <<'EOCP'
6423 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
6425 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
6426 if $contains 'warning' attrib.out >/dev/null 2>&1; then
6427 echo "Your C compiler doesn't fully support __attribute__."
6430 echo "Your C compiler supports __attribute__."
6434 echo "Your C compiler doesn't seem to understand __attribute__ at all."
6441 : see if bcmp exists
6445 : see if bcopy exists
6449 : see if this is a unistd.h system
6450 set unistd.h i_unistd
6453 : see if getpgrp exists
6454 set getpgrp d_getpgrp
6457 case "$d_getpgrp" in
6460 echo "Checking to see which flavor of getpgrp is in use..."
6463 #include <sys/types.h>
6465 # include <unistd.h>
6469 if (getuid() == 0) {
6470 printf("(I see you are running Configure as super-user...)\n");
6474 if (getpgrp(1) == 0)
6483 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6484 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
6486 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6487 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
6490 echo "I can't seem to compile and run the test program."
6492 xxx="a USG one, i.e. you use getpgrp()."
6494 # SVR4 systems can appear rather BSD-ish.
6497 xxx="a BSD one, i.e. you use getpgrp(pid)."
6501 xxx="probably a USG one, i.e. you use getpgrp()."
6506 echo "Assuming your getpgrp is $xxx" >&4
6515 : see if setpgrp exists
6516 set setpgrp d_setpgrp
6519 case "$d_setpgrp" in
6522 echo "Checking to see which flavor of setpgrp is in use..."
6525 #include <sys/types.h>
6527 # include <unistd.h>
6531 if (getuid() == 0) {
6532 printf("(I see you are running Configure as super-user...)\n");
6536 if (-1 == setpgrp(1, 1))
6539 if (setpgrp() != -1)
6545 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6546 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
6548 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
6549 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
6552 echo "(I can't seem to compile and run the test program.)"
6554 xxx="a USG one, i.e. you use setpgrp()."
6556 # SVR4 systems can appear rather BSD-ish.
6559 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
6563 xxx="probably a USG one, i.e. you use setpgrp()."
6568 echo "Assuming your setpgrp is $xxx" >&4
6576 : see if bzero exists
6580 : check for lengths of integral types
6584 echo "Checking to see how big your integers are..." >&4
6585 $cat >intsize.c <<'EOCP'
6589 printf("intsize=%d;\n", sizeof(int));
6590 printf("longsize=%d;\n", sizeof(long));
6591 printf("shortsize=%d;\n", sizeof(short));
6596 if eval $compile_ok && ./intsize > /dev/null; then
6598 echo "Your integers are $intsize bytes long."
6599 echo "Your long integers are $longsize bytes long."
6600 echo "Your short integers are $shortsize bytes long."
6604 Help! I can't compile and run the intsize test program: please enlighten me!
6605 (This is probably a misconfiguration in your system or libraries, and
6606 you really ought to fix it. Still, I'll try anyway.)
6610 rp="What is the size of an integer (in bytes)?"
6614 rp="What is the size of a long integer (in bytes)?"
6618 rp="What is the size of a short integer (in bytes)?"
6624 $rm -f intsize intsize.*
6626 : see if signal is declared as pointer to function returning int or void
6628 xxx=`./findhdr signal.h`
6629 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
6630 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6631 echo "You have int (*signal())() instead of void." >&4
6633 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
6634 echo "You have void (*signal())()." >&4
6636 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
6637 echo "You have int (*signal())() instead of void." >&4
6639 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
6640 echo "You have void (*signal())()." >&4
6643 case "$d_voidsig" in
6645 echo "I can't determine whether signal handler returns void or int..." >&4
6647 rp="What type does your signal handler return?"
6654 echo "As you already told me, signal handler returns void." >&4
6657 *) echo "As you already told me, signal handler returns int." >&4
6664 case "$d_voidsig" in
6665 "$define") signal_t="void";;
6670 : check for ability to cast large floats to 32-bit ints.
6672 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
6673 if $test "$intsize" -ge 4; then
6680 #include <sys/types.h>
6682 $signal_t blech(s) int s; { exit(3); }
6689 signal(SIGFPE, blech);
6691 /* Don't let compiler optimize the test away. Store the number
6692 in a writable string for gcc to pass to sscanf under HP/UX.
6694 sprintf(str, "2147483647");
6695 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
6699 /* x86 processors will probably give 0x8000 0000, which is a
6700 sign change. We don't want that. We want to mimic SPARC
6701 behavior here, which is to preserve the sign and give
6704 if (i32 != ($xxx) f)
6710 if eval $compile_ok; then
6714 echo "(I can't seem to compile the test program--assuming it can't)"
6722 echo "Nope, it can't."
6729 : check for ability to cast negative floats to unsigned
6731 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
6734 #include <sys/types.h>
6736 $signal_t blech(s) int s; { exit(7); }
6737 $signal_t blech_in_list(s) int s; { exit(4); }
6738 unsigned long dummy_long(p) unsigned long p; { return p; }
6739 unsigned int dummy_int(p) unsigned int p; { return p; }
6740 unsigned short dummy_short(p) unsigned short p; { return p; }
6744 unsigned long along;
6746 unsigned short ashort;
6750 /* Frustrate gcc-2.7.2's optimizer which failed this test with
6751 a direct f = -123. assignment. gcc-2.8.0 reportedly
6752 optimized the whole file away
6754 /* Store the number in a writable string for gcc to pass to
6757 sprintf(str, "-123");
6758 sscanf(str, "%lf", &f); /* f = -123.; */
6760 signal(SIGFPE, blech);
6761 along = (unsigned long)f;
6762 aint = (unsigned int)f;
6763 ashort = (unsigned short)f;
6764 if (along != (unsigned long)-123)
6766 if (aint != (unsigned int)-123)
6768 if (ashort != (unsigned short)-123)
6770 sprintf(str, "1073741824.");
6771 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
6774 along = (unsigned long)f;
6775 if (along != 0x80000000)
6779 along = (unsigned long)f;
6780 if (along != 0x7fffffff)
6784 along = (unsigned long)f;
6785 if (along != 0x80000001)
6789 signal(SIGFPE, blech_in_list);
6790 sprintf(str, "123.");
6791 sscanf(str, "%lf", &f); /* f = 123.; */
6792 along = dummy_long((unsigned long)f);
6793 aint = dummy_int((unsigned int)f);
6794 ashort = dummy_short((unsigned short)f);
6795 if (along != (unsigned long)123)
6797 if (aint != (unsigned int)123)
6799 if (ashort != (unsigned short)123)
6806 if eval $compile_ok; then
6810 echo "(I can't seem to compile the test program--assuming it can't)"
6813 case "$castflags" in
6818 echo "Nope, it can't."
6825 : see if vprintf exists
6827 if set vprintf val -f d_vprintf; eval $csym; $val; then
6828 echo 'vprintf() found.' >&4
6830 $cat >vprintf.c <<'EOF'
6831 #include <varargs.h>
6833 int main() { xxx("foo"); }
6842 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
6846 if eval $compile && ./vprintf; then
6847 echo "Your vsprintf() returns (int)." >&4
6850 echo "Your vsprintf() returns (char*)." >&4
6854 echo 'vprintf() NOT found.' >&4
6864 : see if chown exists
6868 : see if chroot exists
6872 : see if chsize exists
6876 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
6877 while $test $# -ge 2; do
6879 $define) echo "#include <$2>";;
6883 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
6884 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6893 : see if this is a sys/uio.h system
6894 set sys/uio.h i_sysuio
6897 echo "Checking to see if your system supports struct iovec..." >&4
6898 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
6900 case "$d_iovec_s" in
6901 "$define") echo "Yup, it does." >&4
6903 *) echo "Nope, it doesn't." >&4
6909 : see whether socket exists
6911 $echo $n "Hmm... $c" >&4
6912 if set socket val -f d_socket; eval $csym; $val; then
6913 echo "Looks like you have Berkeley networking support." >&4
6915 if set setsockopt val -f; eval $csym; $val; then
6918 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
6922 if $contains socklib libc.list >/dev/null 2>&1; then
6923 echo "Looks like you have Berkeley networking support." >&4
6925 : we will have to assume that it supports the 4.2 BSD interface
6928 echo "You don't have Berkeley networking in libc$_a..." >&4
6929 if test "X$d_socket" = "X$define"; then
6930 echo "...but you seem to believe that you have sockets." >&4
6932 for net in net socket
6934 if test -f /usr/lib/lib$net$_a; then
6935 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
6936 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
6937 if $contains socket libc.list >/dev/null 2>&1; then
6942 echo "...but the Wollongong group seems to have hacked it in." >&4
6943 sockethdr="-I/usr/netinclude"
6946 echo "Found Berkeley sockets interface in lib$net." >& 4
6947 if $contains setsockopt libc.list >/dev/null 2>&1; then
6950 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
6957 if test "X$d_socket" != "X$define"; then
6958 echo "or anywhere else I see." >&4
6966 : see if socketpair exists
6967 set socketpair d_sockpair
6972 echo "Checking the availability of certain socket constants..." >& 4
6973 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
6974 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
6976 #include <sys/types.h>
6977 #include <sys/socket.h>
6983 set try; if eval $compile; then
6986 set d_${enum}; eval $setvar
6990 set sendmsg d_sendmsg
6993 set recvmsg d_recvmsg
6997 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
6998 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7000 case "$d_msghdr_s" in
7001 "$define") echo "Yup, it does." >&4
7003 *) echo "Nope, it doesn't." >&4
7007 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7008 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7010 case "$d_cmsghdr_s" in
7011 "$define") echo "Yup, it does." >&4
7013 *) echo "Nope, it doesn't." >&4
7017 : check for const keyword
7019 echo 'Checking to see if your C compiler knows about "const"...' >&4
7020 $cat >const.c <<'EOCP'
7021 typedef struct spug { int drokk; } spug;
7028 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7030 echo "Yup, it does."
7033 echo "Nope, it doesn't."
7038 : see if crypt exists
7040 if set crypt val -f d_crypt; eval $csym; $val; then
7041 echo 'crypt() found.' >&4
7045 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7046 if $test -z "$cryptlib"; then
7047 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7051 if $test -z "$cryptlib"; then
7052 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7056 if $test -z "$cryptlib"; then
7057 cryptlib=`./loc libcrypt$_a "" $libpth`
7061 if $test -z "$cryptlib"; then
7062 echo 'crypt() NOT found.' >&4
7071 : get csh whereabouts
7073 'csh') val="$undef" ;;
7078 : Respect a hint or command line value for full_csh.
7080 '') full_csh=$csh ;;
7083 : see if cuserid exists
7084 set cuserid d_cuserid
7087 : see if this is a limits.h system
7088 set limits.h i_limits
7091 : see if this is a float.h system
7095 : See if number of significant digits in a double precision number is known
7097 $cat >dbl_dig.c <<EOM
7107 printf("Contains DBL_DIG");
7110 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7111 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7112 echo "DBL_DIG found." >&4
7115 echo "DBL_DIG NOT found." >&4
7123 if $test X"$use64bits" = X"$define"; then
7124 : see if dbminit64 exists
7125 set dbminit64 d_dbminit64
7128 : see if dbmclose64 exists
7129 set dbmclose64 d_dbmclose64
7132 : see if fetch64 exists
7133 set fetch64 d_fetch64
7136 : see if store64 exists
7137 set store64 d_store64
7140 : see if delete64 exists
7141 set delete64 d_delete64
7144 : see if firstkey64 exists
7145 set firstkey64 d_firstkey64
7148 : see if nextkey64 exists
7149 set nextkey64 d_nextkey64
7153 for xxx in d_dbminit64 d_dbmclose64 d_fetch64 d_store64 d_delete64 d_firstkey64 d_nextkey64
7160 : see if difftime exists
7161 set difftime d_difftime
7164 : see if sys/stat.h is available
7165 set sys/stat.h i_sysstat
7168 : see if this is a dirent system
7170 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7172 echo "<dirent.h> found." >&4
7175 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7176 echo "<sys/dir.h> found." >&4
7179 xinc=`./findhdr sys/ndir.h`
7181 echo "<dirent.h> NOT found." >&4
7186 : Look for type of directory structure.
7188 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7190 case "$direntrytype" in
7193 $define) guess1='struct dirent' ;;
7194 *) guess1='struct direct' ;;
7197 *) guess1="$direntrytype"
7202 'struct dirent') guess2='struct direct' ;;
7203 *) guess2='struct dirent' ;;
7206 if $contains "$guess1" try.c >/dev/null 2>&1; then
7207 direntrytype="$guess1"
7208 echo "Your directory entries are $direntrytype." >&4
7209 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7210 direntrytype="$guess2"
7211 echo "Your directory entries seem to be $direntrytype." >&4
7213 echo "I don't recognize your system's directory entries." >&4
7214 rp="What type is used for directory entries on this system?"
7222 : see if the directory entry stores field length
7224 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7225 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7226 echo "Good, your directory entry keeps length information in d_namlen." >&4
7229 echo "Your directory entry does not know about the d_namlen field." >&4
7237 if $test X"$use64bits" = X"$define"; then
7238 : see if fstat64 exists
7239 set fstat64 d_fstat64
7242 : see if ftruncate64 exists
7243 set ftruncate64 d_ftruncate64
7246 : see if lockf64 exists
7247 set lockf64 d_lockf64
7250 : see if llseek exists
7254 : see if lseek64 exists
7255 set lseek64 d_lseek64
7258 : see if lstat64 exists
7259 set lstat64 d_lstat64
7262 : see if open64 exists
7266 : see if opendir64 exists
7267 set opendir64 d_opendir64
7270 : see if readdir64 exists
7271 set readdir64 d_readdir64
7274 : see if seekdir64 exists
7275 set seekdir64 d_seekdir64
7278 : see if stat64 exists
7282 : see if telldir64 exists
7283 set telldir64 d_telldir64
7286 : see if truncate64 exists
7287 set truncate64 d_truncate64
7292 echo $n "Checking to see if your system supports off64_t...$c" >&4
7294 #include <sys/types.h>
7296 off64_t foo() { off64_t x; x = 7; return x; }'
7298 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7300 echo " Yup, it does." >&4
7303 echo " Nope, it doesn't." >&4
7309 : check for offset_t
7311 echo $n "Checking to see if your system supports offset_t...$c" >&4
7313 #include <sys/types.h>
7315 offset_t foo() { offset_t x; x = 7; return x; }'
7317 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7319 echo " Yup, it does." >&4
7322 echo " Nope, it doesn't." >&4
7330 echo $n "Checking to see if your system supports ino64_t...$c" >&4
7332 case "$i_sysstat" in
7335 #include <sys/types.h>
7336 #include <sys/stat.h>
7337 ino64_t foo() { ino64_t x; x = 7; return x; }'
7339 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7345 if $test "X$val" = X"$define"; then
7346 echo " Yup, it does." >&4
7348 echo " Nope, it doesn't." >&4
7353 : check for struct flock64
7355 echo "Checking to see if your system supports struct flock64..." >&4
7357 set d_flock64_s flock64 l_len define fcntl.h
7364 case "$d_flock64_s" in
7365 "$define") echo "Yup, it does." >&4
7367 *) echo "Nope, it doesn't." >&4
7371 : check for struct dirent64
7373 echo "Checking to see if your system supports struct dirent64..." >&4
7374 set d_dirent64_s dirent64 d_off $i_dirent dirent.h
7376 case "$d_dirent64_s" in
7377 "$define") echo "Yup, it does." >&4
7379 *) echo "Nope, it doesn't." >&4
7385 for xxx in d_fstat64 d_ftruncate64 d_lockf64 d_lseek64 d_lstat64 d_open64 d_opendir64 d_readdir64 d_seekdir64 d_stat64 d_telldir64 d_truncate64 d_off64_t d_offset_t d_ino64_t d_flock64_s d_dirent64_s
7392 : see if dlerror exists
7395 set dlerror d_dlerror
7399 : see if dlfcn is available
7407 On a few systems, the dynamically loaded modules that perl generates and uses
7408 will need a different extension than shared libs. The default will probably
7416 rp='What is the extension of dynamically loaded modules'
7425 : Check if dlsym need a leading underscore
7431 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7432 $cat >dyna.c <<'EOM'
7441 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7443 #include <sys/types.h>
7457 int mode = RTLD_LAZY ;
7459 handle = dlopen("./dyna.$dlext", mode) ;
7460 if (handle == NULL) {
7465 symbol = dlsym(handle, "fred") ;
7466 if (symbol == NULL) {
7467 /* try putting a leading underscore */
7468 symbol = dlsym(handle, "_fred") ;
7469 if (symbol == NULL) {
7482 : Call the object file tmp-dyna.o in case dlext=o.
7483 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
7484 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
7485 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
7486 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
7489 1) echo "Test program failed using dlopen." >&4
7490 echo "Perhaps you should not use dynamic loading." >&4;;
7491 2) echo "Test program failed using dlsym." >&4
7492 echo "Perhaps you should not use dynamic loading." >&4;;
7493 3) echo "dlsym needs a leading underscore" >&4
7495 4) echo "dlsym doesn't need a leading underscore." >&4;;
7498 echo "I can't compile and run the test program." >&4
7503 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
7508 hasproto='varname=$1; func=$2; shift; shift;
7509 while $test $# -ge 2; do
7511 $define) echo "#include <$2>";;
7515 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
7516 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
7517 echo "$func() prototype found.";
7520 echo "$func() prototype NOT found.";
7525 $rm -f try.c tryout.c'
7527 : see if prototype for drand48 is available
7529 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
7532 : see if dup2 exists
7536 : see if eaccess exists
7537 set eaccess d_eaccess
7540 : see if endgrent exists
7541 set endgrent d_endgrent
7544 : see if endhostent exists
7545 set endhostent d_endhent
7548 : see if endnetent exists
7549 set endnetent d_endnent
7552 : see if endprotoent exists
7553 set endprotoent d_endpent
7556 : see if endpwent exists
7557 set endpwent d_endpwent
7560 : see if endservent exists
7561 set endservent d_endsent
7564 : Locate the flags for 'open()'
7566 $cat >open3.c <<'EOCP'
7567 #include <sys/types.h>
7572 #include <sys/file.h>
7583 : check sys/file.h first to get FREAD on Sun
7584 if $test `./findhdr sys/file.h` && \
7585 set open3 -DI_SYS_FILE && eval $compile; then
7587 echo "<sys/file.h> defines the O_* constants..." >&4
7589 echo "and you have the 3 argument form of open()." >&4
7592 echo "but not the 3 argument form of open(). Oh, well." >&4
7595 elif $test `./findhdr fcntl.h` && \
7596 set open3 -DI_FCNTL && eval $compile; then
7598 echo "<fcntl.h> defines the O_* constants..." >&4
7600 echo "and you have the 3 argument form of open()." >&4
7603 echo "but not the 3 argument form of open(). Oh, well." >&4
7608 echo "I can't find the O_* constant definitions! You got problems." >&4
7614 : check for non-blocking I/O stuff
7615 case "$h_sysfile" in
7616 true) echo "#include <sys/file.h>" > head.c;;
7619 true) echo "#include <fcntl.h>" > head.c;;
7620 *) echo "#include <sys/fcntl.h>" > head.c;;
7625 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
7626 case "$o_nonblock" in
7629 $cat >>try.c <<'EOCP'
7632 printf("O_NONBLOCK\n");
7636 printf("O_NDELAY\n");
7640 printf("FNDELAY\n");
7647 if eval $compile_ok; then
7649 case "$o_nonblock" in
7650 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
7651 *) echo "Seems like we can use $o_nonblock.";;
7654 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
7657 *) echo "Using $hint value $o_nonblock.";;
7659 $rm -f try try.* .out core
7662 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
7668 #include <sys/types.h>
7670 #define MY_O_NONBLOCK $o_nonblock
7671 #ifndef errno /* XXX need better Configure test */
7674 $signal_t blech(x) int x; { exit(3); }
7676 $cat >> try.c <<'EOCP'
7684 pipe(pd); /* Down: child -> parent */
7685 pipe(pu); /* Up: parent -> child */
7688 close(pd[1]); /* Parent reads from pd[0] */
7689 close(pu[0]); /* Parent writes (blocking) to pu[1] */
7690 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
7692 signal(SIGALRM, blech);
7694 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
7696 sprintf(string, "%d\n", ret);
7697 write(2, string, strlen(string));
7700 if (errno == EAGAIN) {
7706 if (errno == EWOULDBLOCK)
7707 printf("EWOULDBLOCK\n");
7710 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
7711 sleep(2); /* Give it time to close our pipe */
7713 ret = read(pd[0], buf, 1); /* Should read EOF */
7715 sprintf(string, "%d\n", ret);
7716 write(3, string, strlen(string));
7720 close(pd[0]); /* We write to pd[1] */
7721 close(pu[1]); /* We read from pu[0] */
7722 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
7723 close(pd[1]); /* Pipe pd is now fully closed! */
7724 exit(0); /* Bye bye, thank you for playing! */
7728 if eval $compile_ok; then
7729 echo "$startsh" >mtry
7730 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
7732 ./mtry >/dev/null 2>&1
7734 0) eagain=`$cat try.out`;;
7735 1) echo "Could not perform non-blocking setting!";;
7736 2) echo "I did a successful read() for something that was not there!";;
7737 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
7738 *) echo "Something terribly wrong happened during testing.";;
7740 rd_nodata=`$cat try.ret`
7741 echo "A read() system call with no data present returns $rd_nodata."
7742 case "$rd_nodata" in
7745 echo "(That's peculiar, fixing that to be -1.)"
7751 echo "Forcing errno EAGAIN on read() with no data available."
7755 echo "Your read() sets errno to $eagain when no data is available."
7758 status=`$cat try.err`
7760 0) echo "And it correctly returns 0 to signal EOF.";;
7761 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
7762 *) echo "However, your read() returns '$status' on EOF??";;
7765 if test "$status" = "$rd_nodata"; then
7766 echo "WARNING: you can't distinguish between EOF and no data!"
7770 echo "I can't compile the test program--assuming errno EAGAIN will do."
7777 echo "Using $hint value $eagain."
7778 echo "Your read() returns $rd_nodata when no data is present."
7779 case "$d_eofnblk" in
7780 "$define") echo "And you can see EOF because read() returns 0.";;
7781 "$undef") echo "But you can't see EOF status from read() returned value.";;
7783 echo "(Assuming you can't see EOF status from read anyway.)"
7789 $rm -f try try.* .out core head.c mtry
7791 : see if fchmod exists
7795 : see if fchown exists
7799 : see if this is an fcntl system
7803 : see if sys/select.h has to be included
7804 set sys/select.h i_sysselct
7807 : see if we should include time.h, sys/time.h, or both
7809 if test "X$timeincl" = X; then
7810 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
7811 $echo $n "I'm now running the test program...$c"
7812 $cat >try.c <<'EOCP'
7813 #include <sys/types.h>
7818 #ifdef SYSTIMEKERNEL
7821 #include <sys/time.h>
7824 #include <sys/select.h>
7833 struct timezone tzp;
7835 if (foo.tm_sec == foo.tm_sec)
7838 if (bar.tv_sec == bar.tv_sec)
7845 for s_timezone in '-DS_TIMEZONE' ''; do
7847 for s_timeval in '-DS_TIMEVAL' ''; do
7848 for i_systimek in '' '-DSYSTIMEKERNEL'; do
7849 for i_time in '' '-DI_TIME'; do
7850 for i_systime in '-DI_SYSTIME' ''; do
7853 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
7854 if eval $compile; then
7855 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
7859 $echo $n "Succeeded with $flags$c"
7871 *SYSTIMEKERNEL*) i_systimek="$define"
7872 timeincl=`./findhdr sys/time.h`
7873 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
7874 *) i_systimek="$undef";;
7877 *I_TIME*) i_time="$define"
7878 timeincl=`./findhdr time.h`" $timeincl"
7879 echo "We'll include <time.h>." >&4;;
7880 *) i_time="$undef";;
7883 *I_SYSTIME*) i_systime="$define"
7884 timeincl=`./findhdr sys/time.h`" $timeincl"
7885 echo "We'll include <sys/time.h>." >&4;;
7886 *) i_systime="$undef";;
7891 : check for fd_set items
7894 Checking to see how well your C compiler handles fd_set and friends ...
7896 $cat >fd_set.c <<EOCP
7897 #$i_systime I_SYS_TIME
7898 #$i_sysselct I_SYS_SELECT
7899 #$d_socket HAS_SOCKET
7900 #include <sys/types.h>
7902 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
7905 #include <sys/time.h>
7908 #include <sys/select.h>
7917 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
7924 set fd_set -DTRYBITS
7925 if eval $compile; then
7926 d_fds_bits="$define"
7928 echo "Well, your system knows about the normal fd_set typedef..." >&4
7930 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
7931 d_fd_macros="$define"
7934 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
7936 d_fd_macros="$undef"
7940 Hmm, your compiler has some difficulty with fd_set. Checking further...
7943 if eval $compile; then
7946 echo "Well, your system has some sort of fd_set available..." >&4
7948 echo "and you have the normal fd_set macros." >&4
7949 d_fd_macros="$define"
7952 but not the normal fd_set macros! Gross! More work for me...
7954 d_fd_macros="$undef"
7957 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
7960 d_fd_macros="$undef"
7965 : see if fgetpos exists
7966 set fgetpos d_fgetpos
7970 if $test X"$use64bits" = X"$define"; then
7971 : see if fgetpos64 exists
7972 set fgetpos64 d_fgetpos64
7975 : see if fopen64 exists
7976 set freopen64 d_fopen64
7979 : see if freopen64 exists
7980 set freopen64 d_freopen64
7983 : see if fseek64 exists
7984 set fseek64 d_fseek64
7987 : see if fseeko64 exists
7988 set fseeko64 d_fseeko64
7991 : see if fsetpos64 exists
7992 set fsetpos64 d_fsetpos64
7995 : see if ftell64 exists
7996 set ftell64 d_ftell64
7999 : see if ftello64 exists
8000 set ftello64 d_ftello64
8003 : see if tmpfile64 exists
8004 set tmpfile64 d_tmpfile64
8008 for xxx in d_fgetpos64 d_fopen64 d_freopen64 d_fseek64 d_fseeko64 d_fsetpos64 d_ftell64 d_ftello64 d_tmpfile64
8015 : see if flock exists
8019 : see if fork exists
8023 : see if pathconf exists
8024 set pathconf d_pathconf
8027 : see if fpathconf exists
8028 set fpathconf d_fpathconf
8031 : see if fseeko exists
8035 : see if fsetpos exists
8036 set fsetpos d_fsetpos
8039 : see if this is a sys/param system
8040 set sys/param.h i_sysparam
8043 : see if this is a sys/mount.h system
8044 set sys/mount.h i_sysmount
8048 : see if statfs exists
8052 : see if fstatfs exists
8053 set fstatfs d_fstatfs
8056 : see if statfs knows about mount flags
8057 set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
8061 : see if statvfs exists
8062 set statvfs d_statvfs
8065 : see if fstatvfs exists
8066 set fstatvfs d_fstatvfs
8070 : see if ftello exists
8074 : see if getgrent exists
8075 set getgrent d_getgrent
8078 : see if gethostbyaddr exists
8079 set gethostbyaddr d_gethbyaddr
8082 : see if gethostbyname exists
8083 set gethostbyname d_gethbyname
8086 : see if gethostent exists
8087 set gethostent d_gethent
8090 : see how we will look up host name
8093 if set gethostname val -f d_gethname; eval $csym; $val; then
8094 echo 'gethostname() found.' >&4
8095 d_gethname="$define"
8098 if set uname val -f d_uname; eval $csym; $val; then
8101 uname() was found, but you're running xenix, and older versions of xenix
8102 have a broken uname(). If you don't really know whether your xenix is old
8103 enough to have a broken system call, use the default answer.
8110 rp='Is your uname() broken?'
8113 n*) d_uname="$define"; call=uname;;
8116 echo 'uname() found.' >&4
8123 case "$d_gethname" in
8124 '') d_gethname="$undef";;
8127 '') d_uname="$undef";;
8129 case "$d_uname$d_gethname" in
8134 Every now and then someone has a $call() that lies about the hostname
8135 but can't be fixed for political or economic reasons. If you wish, I can
8136 pretend $call() isn't there and maybe compute hostname at run-time
8137 thanks to the '$phostname' command.
8140 rp="Shall I ignore $call() from now on?"
8143 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8146 case "$phostname" in
8148 *) case "$aphostname" in
8154 file=`./loc $file $file $pth`
8155 aphostname=`echo $file $*`
8160 case "$d_uname$d_gethname" in
8163 case "$phostname" in
8165 echo "There will be no way for $package to get your hostname." >&4;;
8167 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8171 case "$d_phostname" in
8172 '') d_phostname="$undef";;
8175 : see if this is a netdb.h system
8179 : see if prototypes for various gethostxxx netdb.h functions are available
8181 set d_gethostprotos gethostent $i_netdb netdb.h
8184 : see if getlogin exists
8185 set getlogin d_getlogin
8188 : see if getmntent exists
8189 set getmntent d_getmntent
8192 : see if getnetbyaddr exists
8193 set getnetbyaddr d_getnbyaddr
8196 : see if getnetbyname exists
8197 set getnetbyname d_getnbyname
8200 : see if getnetent exists
8201 set getnetent d_getnent
8204 : see if prototypes for various getnetxxx netdb.h functions are available
8206 set d_getnetprotos getnetent $i_netdb netdb.h
8210 : see if getprotobyname exists
8211 set getprotobyname d_getpbyname
8214 : see if getprotobynumber exists
8215 set getprotobynumber d_getpbynumber
8218 : see if getprotoent exists
8219 set getprotoent d_getpent
8222 : see if getpgid exists
8223 set getpgid d_getpgid
8226 : see if getpgrp2 exists
8227 set getpgrp2 d_getpgrp2
8230 : see if getppid exists
8231 set getppid d_getppid
8234 : see if getpriority exists
8235 set getpriority d_getprior
8238 : see if prototypes for various getprotoxxx netdb.h functions are available
8240 set d_getprotoprotos getprotoent $i_netdb netdb.h
8243 : see if getpwent exists
8244 set getpwent d_getpwent
8248 : see if getservbyname exists
8249 set getservbyname d_getsbyname
8252 : see if getservbyport exists
8253 set getservbyport d_getsbyport
8256 : see if getservent exists
8257 set getservent d_getsent
8260 : see if prototypes for various getservxxx netdb.h functions are available
8262 set d_getservprotos getservent $i_netdb netdb.h
8265 : see if gettimeofday or ftime exists
8266 set gettimeofday d_gettimeod
8268 case "$d_gettimeod" in
8274 val="$undef"; set d_ftime; eval $setvar
8277 case "$d_gettimeod$d_ftime" in
8280 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8284 : see if this is an grp system
8290 xxx=`./findhdr grp.h`
8291 $cppstdin $cppflags $cppminus < $xxx >$$.h
8293 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8305 set d_grpasswd; eval $setvar
8309 : see if hasmntopt exists
8310 set hasmntopt d_hasmntopt
8313 : see if this is a netinet/in.h or sys/in.h system
8314 set netinet/in.h i_niin sys/in.h i_sysin
8317 : see if arpa/inet.h has to be included
8318 set arpa/inet.h i_arpainet
8321 : see if htonl --and friends-- exists
8326 : Maybe they are macros.
8331 #include <sys/types.h>
8332 #$i_niin I_NETINET_IN
8334 #$i_arpainet I_ARPA_INET
8336 #include <netinet/in.h>
8342 #include <arpa/inet.h>
8345 printf("Defined as a macro.");
8348 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8349 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8351 echo "But it seems to be defined as a macro." >&4
8359 : see which of string.h or strings.h is needed
8361 strings=`./findhdr string.h`
8362 if $test "$strings" && $test -r "$strings"; then
8363 echo "Using <string.h> instead of <strings.h>." >&4
8367 strings=`./findhdr strings.h`
8368 if $test "$strings" && $test -r "$strings"; then
8369 echo "Using <strings.h> instead of <string.h>." >&4
8371 echo "No string header found -- You'll surely have problems." >&4
8377 "$undef") strings=`./findhdr strings.h`;;
8378 *) strings=`./findhdr string.h`;;
8383 if set index val -f; eval $csym; $val; then
8384 if set strchr val -f d_strchr; eval $csym; $val; then
8385 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8388 echo "strchr() found." >&4
8392 echo "index() found." >&4
8397 echo "index() found." >&4
8400 if set strchr val -f d_strchr; eval $csym; $val; then
8403 echo "strchr() found." >&4
8405 echo "No index() or strchr() found!" >&4
8410 set d_strchr; eval $setvar
8412 set d_index; eval $setvar
8414 : check whether inet_aton exists
8415 set inet_aton d_inetaton
8418 : see if inttypes.h is available
8419 : we want a real compile instead of Inhdr because some systems
8420 : have an inttypes.h which includes non-existent headers
8423 #include <inttypes.h>
8425 static int32_t foo32 = 0x12345678;
8429 if eval $compile; then
8430 echo "<inttypes.h> found." >&4
8433 echo "<inttypes.h> NOT found." >&4
8441 case "$use64bits" in
8444 echo $n "Checking to see if your system supports int64_t...$c" >&4
8446 #include <sys/types.h>
8447 #$i_inttypes I_INTTYPES
8449 #include <inttypes.h>
8451 int64_t foo() { int64_t x; x = 7; return x; }
8453 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8455 echo " Yup, it does." >&4
8458 echo " Nope, it doesn't." >&4
8471 $cat >isascii.c <<'EOCP'
8483 if eval $compile; then
8484 echo "isascii() found." >&4
8487 echo "isascii() NOT found." >&4
8494 : see if killpg exists
8498 : see if lchown exists
8500 $cat > try.c <<'EOCP'
8501 /* System header to define __stub macros and hopefully few prototypes,
8502 which can conflict with char lchown(); below. */
8504 /* Override any gcc2 internal prototype to avoid an error. */
8505 /* We use char because int might match the return type of a gcc2
8506 builtin and then its argument prototype would still apply. */
8509 /* The GNU C library defines this for functions which it implements
8510 to always fail with ENOSYS. Some functions are actually named
8511 something starting with __ and the normal name is an alias. */
8512 #if defined (__stub_lchown) || defined (__stub___lchown)
8520 if eval $compile; then
8521 $echo "lchown() found." >&4
8524 $echo "lchown() NOT found." >&4
8530 : see if link exists
8534 : see if localeconv exists
8535 set localeconv d_locconv
8538 : see if lockf exists
8542 : check for length of double
8544 case "$doublesize" in
8546 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
8547 $cat >try.c <<'EOCP'
8551 printf("%d\n", sizeof(double));
8555 if eval $compile_ok; then
8557 $echo " $doublesize bytes." >&4
8560 echo "(I can't seem to compile the test program. Guessing...)"
8561 rp="What is the size of a double precision number (in bytes)?"
8569 : check for long doubles
8571 echo $n "Checking to see if your system supports long doubles...$c" >&4
8572 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
8573 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8575 echo " Yup, it does." >&4
8578 echo " Nope, it doesn't." >&4
8584 : check for length of long double
8585 case "${d_longdbl}${longdblsize}" in
8588 $echo $n "Checking to see how big your long doubles are...$c" >&4
8589 $cat >try.c <<'EOCP'
8593 printf("%d\n", sizeof(long double));
8597 if eval $compile; then
8599 $echo " $longdblsize bytes." >&4
8603 echo "(I can't seem to compile the test program. Guessing...)" >&4
8604 rp="What is the size of a long double (in bytes)?"
8608 if $test "X$doublesize" = "X$longdblsize"; then
8609 echo "(That isn't any different from an ordinary double.)"
8615 : check for long long
8617 echo $n "Checking to see if your system supports long long...$c" >&4
8618 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
8619 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8621 echo " Yup, it does." >&4
8624 echo " Nope, it doesn't." >&4
8630 : check for length of long long
8631 case "${d_longlong}${longlongsize}" in
8634 $echo $n "Checking to see how big your long longs are...$c" >&4
8635 $cat >try.c <<'EOCP'
8639 printf("%d\n", sizeof(long long));
8643 if eval $compile_ok; then
8644 longlongsize=`./try`
8645 $echo " $longlongsize bytes." >&4
8649 echo "(I can't seem to compile the test program. Guessing...)"
8650 rp="What is the size of a long long (in bytes)?"
8654 if $test "X$longsize" = "X$longlongsize"; then
8655 echo "(That isn't any different from an ordinary long.)"
8661 : see if lstat exists
8665 : see if madvise exists
8666 set madvise d_madvise
8669 : see if mblen exists
8673 : see if mbstowcs exists
8674 set mbstowcs d_mbstowcs
8677 : see if mbtowc exists
8681 : see if memcmp exists
8685 : see if memcpy exists
8689 : see if memmove exists
8690 set memmove d_memmove
8693 : see if memset exists
8697 : see if mkdir exists
8701 : see if mkfifo exists
8705 : see if mktime exists
8709 : see if this is a sys/mman.h system
8710 set sys/mman.h i_sysmman
8713 : see if mmap exists
8716 : see what shmat returns
8717 : default to something harmless
8719 case "$i_sysmman$d_mmap" in
8721 $cat >mmap.c <<'END'
8722 #include <sys/mman.h>
8725 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
8730 echo "and it returns ($mmaptype)." >&4
8736 : see if mprotect exists
8737 set mprotect d_mprotect
8740 : see if msgctl exists
8744 : see if msgget exists
8748 : see if msgsnd exists
8752 : see if msgrcv exists
8756 : see how much of the 'msg*(2)' library is present.
8759 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
8760 *"$undef"*) h_msg=false;;
8764 case "`ipcs 2>&1`" in
8765 "SVID messages"*"not configured"*)
8766 echo "Your $osname does not have the msg*(2) configured." >&4
8781 : we could also check for sys/ipc.h ...
8782 if $h_msg && $test `./findhdr sys/msg.h`; then
8783 echo "You have the full msg*(2) library." >&4
8786 echo "You don't have the full msg*(2) library." >&4
8792 : see if msync exists
8796 : see if munmap exists
8800 : see if nice exists
8804 : see if POSIX threads are available
8805 if test "X$usethreads" = "X$define"; then
8806 set pthread.h i_pthread
8814 : how to create joinable pthreads
8815 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
8817 echo "Checking what constant to use for creating joinable pthreads..." >&4
8818 $cat >try.c <<'EOCP'
8819 #include <pthread.h>
8821 int detachstate = JOINABLE;
8824 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
8825 if eval $compile; then
8826 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
8827 val="$undef" # Yes, undef.
8828 set d_old_pthread_create_joinable
8831 set old_pthread_create_joinable
8834 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
8835 if eval $compile; then
8836 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
8838 set d_old_pthread_create_joinable
8840 val=PTHREAD_CREATE_UNDETACHED
8841 set old_pthread_create_joinable
8844 set try -DJOINABLE=__UNDETACHED
8845 if eval $compile; then
8846 echo "You seem to use __UNDETACHED." >&4
8848 set d_old_pthread_create_joinable
8851 set old_pthread_create_joinable
8854 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
8856 set d_old_pthread_create_joinable
8859 set old_pthread_create_joinable
8866 d_old_pthread_create_joinable="$undef"
8867 old_pthread_create_joinable=""
8870 : see if pause exists
8874 : see if pipe exists
8878 : see if poll exists
8883 : see whether the various POSIXish _yields exist
8885 #include <pthread.h>
8891 #ifdef PTHREAD_YIELD
8894 #ifdef PTHREAD_YIELD_NULL
8895 pthread_yield(NULL);
8901 : see if sched_yield exists
8902 set try -DSCHED_YIELD
8903 if eval $compile; then
8905 sched_yield='sched_yield()'
8909 case "$usethreads" in
8912 $define) echo 'sched_yield() found.' >&4 ;;
8913 *) echo 'sched_yield() NOT found.' >&4 ;;
8919 : see if pthread_yield exists
8920 set try -DPTHREAD_YIELD
8921 if eval $compile; then
8923 case "$sched_yield" in
8924 '') sched_yield='pthread_yield()' ;;
8927 set try -DPTHREAD_YIELD_NULL
8928 if eval $compile; then
8930 case "$sched_yield" in
8931 '') sched_yield='pthread_yield(NULL)' ;;
8937 case "$usethreads" in
8940 $define) echo 'pthread_yield() found.' >&4 ;;
8941 *) echo 'pthread_yield() NOT found.' >&4 ;;
8948 case "$sched_yield" in
8949 '') sched_yield=undef ;;
8954 : see if this is a pwd.h system
8960 xxx=`./findhdr pwd.h`
8961 $cppstdin $cppflags $cppminus < $xxx >$$.h
8963 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
8971 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
8979 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
8987 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
8995 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9003 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9011 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9019 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9031 set d_pwquota; eval $setvar
9032 set d_pwage; eval $setvar
9033 set d_pwchange; eval $setvar
9034 set d_pwclass; eval $setvar
9035 set d_pwexpire; eval $setvar
9036 set d_pwcomment; eval $setvar
9037 set d_pwgecos; eval $setvar
9038 set d_pwpasswd; eval $setvar
9042 : see if readdir and friends exist
9043 set readdir d_readdir
9045 set seekdir d_seekdir
9047 set telldir d_telldir
9049 set rewinddir d_rewinddir
9052 : see if readlink exists
9053 set readlink d_readlink
9056 : see if readv exists
9060 : see if rename exists
9064 : see if rmdir exists
9068 : see if memory.h is available.
9073 : See if it conflicts with string.h
9079 $cppstdin $cppflags $cppminus < $strings > mem.h
9080 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9082 echo "We won't be including <memory.h>."
9092 : can bcopy handle overlapping blocks?
9097 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9104 $cat >>try.c <<'EOCP'
9107 # include <memory.h>
9110 # include <stdlib.h>
9113 # include <string.h>
9115 # include <strings.h>
9118 # include <unistd.h> /* Needed for NetBSD */
9122 char buf[128], abc[128];
9128 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9130 for (align = 7; align >= 0; align--) {
9131 for (len = 36; len; len--) {
9134 for (off = 1; off <= len; off++) {
9135 bcopy(b, b+off, len);
9136 bcopy(b+off, b, len);
9137 if (bcmp(b, abc, len))
9146 if eval $compile_ok; then
9147 if ./try 2>/dev/null; then
9151 echo "It can't, sorry."
9152 case "$d_memmove" in
9153 "$define") echo "But that's Ok since you have memmove()." ;;
9157 echo "(I can't compile the test program, so we'll assume not...)"
9158 case "$d_memmove" in
9159 "$define") echo "But that's Ok since you have memmove()." ;;
9164 $rm -f try.* try core
9168 : can memcpy handle overlapping blocks?
9173 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9180 $cat >>try.c <<'EOCP'
9183 # include <memory.h>
9186 # include <stdlib.h>
9189 # include <string.h>
9191 # include <strings.h>
9194 # include <unistd.h> /* Needed for NetBSD */
9198 char buf[128], abc[128];
9204 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9205 try to store the string in read-only memory. */
9206 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9208 for (align = 7; align >= 0; align--) {
9209 for (len = 36; len; len--) {
9211 memcpy(b, abc, len);
9212 for (off = 1; off <= len; off++) {
9213 memcpy(b+off, b, len);
9214 memcpy(b, b+off, len);
9215 if (memcmp(b, abc, len))
9224 if eval $compile_ok; then
9225 if ./try 2>/dev/null; then
9229 echo "It can't, sorry."
9230 case "$d_memmove" in
9231 "$define") echo "But that's Ok since you have memmove()." ;;
9235 echo "(I can't compile the test program, so we'll assume not...)"
9236 case "$d_memmove" in
9237 "$define") echo "But that's Ok since you have memmove()." ;;
9242 $rm -f try.* try core
9246 : can memcmp be trusted to compare relative magnitude?
9251 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9258 $cat >>try.c <<'EOCP'
9261 # include <memory.h>
9264 # include <stdlib.h>
9267 # include <string.h>
9269 # include <strings.h>
9272 # include <unistd.h> /* Needed for NetBSD */
9278 if ((a < b) && memcmp(&a, &b, 1) < 0)
9284 if eval $compile_ok; then
9285 if ./try 2>/dev/null; then
9289 echo "No, it can't (it uses signed chars)."
9292 echo "(I can't compile the test program, so we'll assume not...)"
9296 $rm -f try.* try core
9300 : see if select exists
9304 : see if semctl exists
9308 : see if semget exists
9312 : see if semop exists
9316 : see how much of the 'sem*(2)' library is present.
9319 case "$d_semctl$d_semget$d_semop" in
9320 *"$undef"*) h_sem=false;;
9324 case "`ipcs 2>&1`" in
9325 "SVID messages"*"not configured"*)
9326 echo "Your $osname does not have the sem*(2) configured." >&4
9339 : we could also check for sys/ipc.h ...
9340 if $h_sem && $test `./findhdr sys/sem.h`; then
9341 echo "You have the full sem*(2) library." >&4
9344 echo "You don't have the full sem*(2) library." >&4
9350 : see whether sys/sem.h defines union semun
9352 $cat > try.c <<'END'
9353 #include <sys/types.h>
9354 #include <sys/ipc.h>
9355 #include <sys/sem.h>
9356 int main () { union semun semun; semun.buf = 0; }
9359 if eval $compile; then
9360 echo "You have union semun in <sys/sem.h>." >&4
9363 echo "You do not have union semun in <sys/sem.h>." >&4
9366 $rm -f try try.c try.h
9370 : see how to do semctl IPC_STAT
9373 : see whether semctl IPC_STAT can use union semun
9378 # define S_IRUSR S_IREAD
9379 # define S_IWUSR S_IWRITE
9380 # define S_IXUSR S_IEXEC
9382 # define S_IRUSR 0400
9383 # define S_IWUSR 0200
9384 # define S_IXUSR 0100
9386 # define S_IRGRP (S_IRUSR>>3)
9387 # define S_IWGRP (S_IWUSR>>3)
9388 # define S_IXGRP (S_IXUSR>>3)
9389 # define S_IROTH (S_IRUSR>>6)
9390 # define S_IWOTH (S_IWUSR>>6)
9391 # define S_IXOTH (S_IXUSR>>6)
9394 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9395 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9396 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9401 #include <sys/types.h>
9402 #include <sys/ipc.h>
9403 #include <sys/sem.h>
9404 #include <sys/stat.h>
9411 #$d_union_semun HAS_UNION_SEMUN
9414 #ifndef HAS_UNION_SEMUN
9417 struct semid_ds *buf;
9418 unsigned short *array;
9424 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9425 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9427 struct semid_ds argbuf;
9430 st = semctl(sem, 0, IPC_STAT, arg);
9434 # endif /* IPC_STAT */
9435 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9437 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9438 # endif /* IPC_RMID */
9439 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9441 #endif /* IPC_PRIVATE && ... */
9442 printf("semget failed: errno = %d\n", errno);
9448 if eval $compile; then
9451 semun) val="$define" ;;
9457 case "$d_semctl_semun" in
9459 echo "You can use union semun for semctl IPC_STAT." >&4
9462 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9467 : see whether semctl IPC_STAT can use struct semid_ds pointer
9468 $cat > try.c <<'END'
9469 #include <sys/types.h>
9470 #include <sys/ipc.h>
9471 #include <sys/sem.h>
9472 #include <sys/stat.h>
9480 struct semid_ds arg;
9483 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9484 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9487 st = semctl(sem, 0, IPC_STAT, &arg);
9489 printf("semid_ds\n");
9491 # endif /* IPC_STAT */
9492 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9494 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9495 # endif /* IPC_RMID */
9496 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9498 #endif /* IPC_PRIVATE && ... */
9499 printf("semget failed: errno = %d\n", errno);
9506 if eval $compile; then
9509 semid_ds) val="$define" ;;
9513 set d_semctl_semid_ds
9515 case "$d_semctl_semid_ds" in
9517 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
9519 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
9526 # We do not have the full sem*(2) library, so assume we can not
9532 set d_semctl_semid_ds
9537 : see if setegid exists
9538 set setegid d_setegid
9541 : see if seteuid exists
9542 set seteuid d_seteuid
9545 : see if setgrent exists
9546 set setgrent d_setgrent
9549 : see if sethostent exists
9550 set sethostent d_sethent
9553 : see if setlinebuf exists
9554 set setlinebuf d_setlinebuf
9557 : see if setlocale exists
9558 set setlocale d_setlocale
9561 : see if setnetent exists
9562 set setnetent d_setnent
9565 : see if setprotoent exists
9566 set setprotoent d_setpent
9569 : see if setpgid exists
9570 set setpgid d_setpgid
9573 : see if setpgrp2 exists
9574 set setpgrp2 d_setpgrp2
9577 : see if setpriority exists
9578 set setpriority d_setprior
9581 : see if setpwent exists
9582 set setpwent d_setpwent
9585 : see if setregid exists
9586 set setregid d_setregid
9588 set setresgid d_setresgid
9591 : see if setreuid exists
9592 set setreuid d_setreuid
9594 set setresuid d_setresuid
9597 : see if setrgid exists
9598 set setrgid d_setrgid
9601 : see if setruid exists
9602 set setruid d_setruid
9605 : see if setservent exists
9606 set setservent d_setsent
9609 : see if setsid exists
9613 : see if setvbuf exists
9614 set setvbuf d_setvbuf
9617 : see if sfio.h is available
9622 : see if sfio library is available
9633 : Ok, but do we want to use it.
9637 true|$define|[yY]*) dflt='y';;
9640 echo "$package can use the sfio library, but it is experimental."
9641 rp="You seem to have sfio available, do you want to try using it?"
9645 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
9647 : Remove sfio from list of libraries to use
9648 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
9651 echo "libs = $libs" >&4
9655 *) case "$usesfio" in
9657 echo "Sorry, cannot find sfio on this machine" >&4
9658 echo "Ignoring your setting of usesfio=$usesfio" >&4
9666 $define) usesfio='true';;
9667 *) usesfio='false';;
9670 : see if shmctl exists
9674 : see if shmget exists
9678 : see if shmat exists
9681 : see what shmat returns
9684 $cat >shmat.c <<'END'
9685 #include <sys/shm.h>
9688 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
9693 echo "and it returns ($shmattype)." >&4
9694 : see if a prototype for shmat is available
9695 xxx=`./findhdr sys/shm.h`
9696 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
9697 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
9708 set d_shmatprototype
9711 : see if shmdt exists
9715 : see how much of the 'shm*(2)' library is present.
9718 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
9719 *"$undef"*) h_shm=false;;
9723 case "`ipcs 2>&1`" in
9724 "SVID shared memory"*"not configured"*)
9725 echo "Your $osname does not have the shm*(2) configured." >&4
9740 : we could also check for sys/ipc.h ...
9741 if $h_shm && $test `./findhdr sys/shm.h`; then
9742 echo "You have the full shm*(2) library." >&4
9745 echo "You don't have the full shm*(2) library." >&4
9752 : see if we have sigaction
9753 if set sigaction val -f d_sigaction; eval $csym; $val; then
9754 echo 'sigaction() found.' >&4
9755 $cat > try.c <<'EOP'
9757 #include <sys/types.h>
9761 struct sigaction act, oact;
9765 if eval $compile_ok; then
9768 echo "But you don't seem to have a useable struct sigaction." >&4
9772 echo 'sigaction NOT found.' >&4
9775 set d_sigaction; eval $setvar
9776 $rm -f try try$_o try.c
9778 : see if sigsetjmp exists
9780 case "$d_sigsetjmp" in
9788 if (sigsetjmp(env,1))
9796 if eval $compile; then
9797 if ./try >/dev/null 2>&1; then
9798 echo "POSIX sigsetjmp found." >&4
9802 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
9808 echo "sigsetjmp not found." >&4
9812 *) val="$d_sigsetjmp"
9813 case "$d_sigsetjmp" in
9814 $define) echo "POSIX sigsetjmp found." >&4;;
9815 $undef) echo "sigsetjmp not found." >&4;;
9823 : see if stat knows about block sizes
9825 set d_statblks stat st_blocks $i_sysstat sys/stat.h
9828 : see if _ptr and _cnt from stdio act std
9830 if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
9831 echo "(Looks like you have stdio.h from Linux.)"
9832 case "$stdio_ptr" in
9833 '') stdio_ptr='((fp)->_IO_read_ptr)'
9836 *) ptr_lval=$d_stdio_ptr_lval;;
9838 case "$stdio_cnt" in
9839 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
9842 *) cnt_lval=$d_stdio_cnt_lval;;
9844 case "$stdio_base" in
9845 '') stdio_base='((fp)->_IO_read_base)';;
9847 case "$stdio_bufsiz" in
9848 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
9851 case "$stdio_ptr" in
9852 '') stdio_ptr='((fp)->_ptr)'
9855 *) ptr_lval=$d_stdio_ptr_lval;;
9857 case "$stdio_cnt" in
9858 '') stdio_cnt='((fp)->_cnt)'
9861 *) cnt_lval=$d_stdio_cnt_lval;;
9863 case "$stdio_base" in
9864 '') stdio_base='((fp)->_base)';;
9866 case "$stdio_bufsiz" in
9867 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
9870 : test whether _ptr and _cnt really work
9871 echo "Checking how std your stdio is..." >&4
9874 #define FILE_ptr(fp) $stdio_ptr
9875 #define FILE_cnt(fp) $stdio_cnt
9877 FILE *fp = fopen("try.c", "r");
9880 18 <= FILE_cnt(fp) &&
9881 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
9889 if eval $compile; then
9891 echo "Your stdio acts pretty std."
9894 echo "Your stdio isn't very std."
9897 echo "Your stdio doesn't appear very std."
9903 : Can _ptr be used as an lvalue?
9904 case "$d_stdstdio$ptr_lval" in
9905 $define$define) val=$define ;;
9908 set d_stdio_ptr_lval
9911 : Can _cnt be used as an lvalue?
9912 case "$d_stdstdio$cnt_lval" in
9913 $define$define) val=$define ;;
9916 set d_stdio_cnt_lval
9919 : see if _base is also standard
9921 case "$d_stdstdio" in
9925 #define FILE_base(fp) $stdio_base
9926 #define FILE_bufsiz(fp) $stdio_bufsiz
9928 FILE *fp = fopen("try.c", "r");
9931 19 <= FILE_bufsiz(fp) &&
9932 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
9939 if eval $compile; then
9941 echo "And its _base field acts std."
9944 echo "But its _base field isn't std."
9947 echo "However, it seems to be lacking the _base field."
9955 : see if strcoll exists
9956 set strcoll d_strcoll
9959 : check for structure copying
9961 echo "Checking to see if your C compiler can copy structs..." >&4
9962 $cat >try.c <<'EOCP'
9972 if $cc -c try.c >/dev/null 2>&1 ; then
9977 echo "Nope, it can't."
9983 : see if strerror and/or sys_errlist[] exist
9985 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
9986 if set strerror val -f d_strerror; eval $csym; $val; then
9987 echo 'strerror() found.' >&4
9988 d_strerror="$define"
9989 d_strerrm='strerror(e)'
9990 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
9991 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
9992 d_syserrlst="$define"
9994 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
9995 d_syserrlst="$undef"
9997 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
9998 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
9999 echo 'strerror() found in string header.' >&4
10000 d_strerror="$define"
10001 d_strerrm='strerror(e)'
10002 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10003 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10004 d_syserrlst="$define"
10006 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10007 d_syserrlst="$undef"
10009 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10010 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10011 d_strerror="$undef"
10012 d_syserrlst="$define"
10013 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10015 echo 'strerror() and sys_errlist[] NOT found.' >&4
10016 d_strerror="$undef"
10017 d_syserrlst="$undef"
10018 d_strerrm='"unknown"'
10022 : see if strtod exists
10023 set strtod d_strtod
10026 : see if strtol exists
10027 set strtol d_strtol
10030 : see if strtoul exists
10031 set strtoul d_strtoul
10034 : see if strxfrm exists
10035 set strxfrm d_strxfrm
10038 : see if symlink exists
10039 set symlink d_symlink
10042 : see if syscall exists
10043 set syscall d_syscall
10046 : see if sysconf exists
10047 set sysconf d_sysconf
10050 : see if system exists
10051 set system d_system
10054 : see if tcgetpgrp exists
10055 set tcgetpgrp d_tcgetpgrp
10058 : see if tcsetpgrp exists
10059 set tcsetpgrp d_tcsetpgrp
10062 : see if sys/types.h has to be included
10063 set sys/types.h i_systypes
10066 : see if prototype for telldir is available
10068 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10071 : define an is-a-typedef? function
10072 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10074 "") inclist="sys/types.h";;
10076 eval "varval=\$$var";
10080 for inc in $inclist; do
10081 echo "#include <$inc>" >>temp.c;
10083 echo "#ifdef $type" >> temp.c;
10084 echo "printf(\"We have $type\");" >> temp.c;
10085 echo "#endif" >> temp.c;
10086 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10087 if $contains $type temp.E >/dev/null 2>&1; then
10088 eval "$var=\$type";
10093 *) eval "$var=\$varval";;
10096 : define an is-a-typedef? function that prompts if the type is not available.
10097 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10099 "") inclist="sys/types.h";;
10101 eval "varval=\$$var";
10105 for inc in $inclist; do
10106 echo "#include <$inc>" >>temp.c;
10108 echo "#ifdef $type" >> temp.c;
10109 echo "printf(\"We have $type\");" >> temp.c;
10110 echo "#endif" >> temp.c;
10111 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10113 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10114 if $contains $type temp.E >/dev/null 2>&1; then
10115 echo "$type found." >&4;
10116 eval "$var=\$type";
10118 echo "$type NOT found." >&4;
10124 *) eval "$var=\$varval";;
10127 : see if this is a sys/times.h system
10128 set sys/times.h i_systimes
10131 : see if times exists
10133 if set times val -f d_times; eval $csym; $val; then
10134 echo 'times() found.' >&4
10137 case "$i_systimes" in
10138 "$define") inc='sys/times.h';;
10140 rp="What is the type returned by times() on this system?"
10141 set clock_t clocktype long stdio.h sys/types.h $inc
10144 echo 'times() NOT found, hope that will do.' >&4
10149 : see if truncate exists
10150 set truncate d_truncate
10153 : see if tzname[] exists
10155 if set tzname val -a d_tzname; eval $csym; $val; then
10157 echo 'tzname[] found.' >&4
10160 echo 'tzname[] NOT found.' >&4
10165 : see if umask exists
10169 : backward compatibility for d_hvfork
10170 if test X$d_hvfork != X; then
10171 d_vfork="$d_hvfork"
10174 : see if there is a vfork
10179 : Ok, but do we want to use it. vfork is reportedly unreliable in
10180 : perl on Solaris 2.x, and probably elsewhere.
10184 case "$usevfork" in
10190 Perl can only use a vfork() that doesn't suffer from strict
10191 restrictions on calling functions or modifying global data in
10192 the child. For example, glibc-2.1 contains such a vfork()
10193 that is unsuitable. If your system provides a proper fork()
10194 call, chances are that you do NOT want perl to use vfork().
10197 rp="Do you still want to use vfork()?"
10202 echo "Ok, we won't use vfork()."
10211 $define) usevfork='true';;
10212 *) usevfork='false';;
10215 : see if this is an sysdir system
10216 set sys/dir.h i_sysdir
10219 : see if this is an sysndir system
10220 set sys/ndir.h i_sysndir
10223 : see if closedir exists
10224 set closedir d_closedir
10227 case "$d_closedir" in
10230 echo "Checking whether closedir() returns a status..." >&4
10231 cat > closedir.c <<EOM
10232 #$i_dirent I_DIRENT /**/
10233 #$i_sysdir I_SYS_DIR /**/
10234 #$i_sysndir I_SYS_NDIR /**/
10235 #$i_systypes I_SYS_TYPES /**/
10237 #if defined(I_SYS_TYPES)
10238 #include <sys/types.h>
10240 #if defined(I_DIRENT)
10241 #include <dirent.h>
10242 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10243 #include <sys/dir.h>
10247 #include <sys/ndir.h>
10251 #include <ndir.h> /* may be wrong in the future */
10253 #include <sys/dir.h>
10258 int main() { return closedir(opendir(".")); }
10261 if eval $compile_ok; then
10262 if ./closedir > /dev/null 2>&1 ; then
10263 echo "Yes, it does."
10266 echo "No, it doesn't."
10270 echo "(I can't seem to compile the test program--assuming it doesn't)"
10278 set d_void_closedir
10281 : check for volatile keyword
10283 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10284 $cat >try.c <<'EOCP'
10287 typedef struct _goo_struct goo_struct;
10288 goo_struct * volatile goo = ((goo_struct *)0);
10289 struct _goo_struct {
10294 typedef unsigned short foo_t;
10295 char *volatile foo;
10297 volatile foo_t blech;
10301 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10303 echo "Yup, it does."
10306 echo "Nope, it doesn't."
10312 : see if there is a wait4
10316 : see if waitpid exists
10317 set waitpid d_waitpid
10320 : see if wcstombs exists
10321 set wcstombs d_wcstombs
10324 : see if wctomb exists
10325 set wctomb d_wctomb
10328 : see if writev exists
10329 set writev d_writev
10332 : preserve RCS keywords in files with variable substitution, grrr
10337 Revision='$Revision'
10339 case "$crosscompile" in
10340 ''|[nN]*) crosscompile="$undef" ;;
10344 next|rhapsody) multiarch="$define" ;;
10346 case "$multiarch" in
10347 ''|[nN]*) multiarch="$undef" ;;
10350 : check for alignment requirements
10352 case "$crosscompile$multiarch" in
10355 You seem to be either cross-compiling or doing a multiarchitecture build,
10356 skipping the memory alignment check.
10359 case "$alignbytes" in
10360 '') alignbytes=8 ;;
10364 case "$alignbytes" in
10365 '') echo "Checking alignment constraints..." >&4
10366 $cat >try.c <<'EOCP'
10373 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10377 if eval $compile_ok; then
10381 echo "(I can't seem to compile the test program...)"
10384 *) dflt="$alignbytes"
10387 rp="Doubles must be aligned on a how-many-byte boundary?"
10395 : check for ordering of bytes in a long
10397 case "$crosscompile$multiarch" in
10400 You seem to be either cross-compiling or doing a multiarchitecture build,
10401 skipping the byteorder check.
10407 case "$byteorder" in
10410 In the following, larger digits indicate more significance. A big-endian
10411 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10412 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10413 machines may have weird orders like 3412. A Cray will report 87654321. If
10414 the test program works the default is probably right.
10415 I'm now running the test program...
10417 $cat >try.c <<'EOCP'
10424 char c[sizeof(long)];
10427 if (sizeof(long) > 4)
10428 u.l = (0x08070605L << 32) | 0x04030201L;
10431 for (i = 0; i < sizeof(long); i++)
10432 printf("%c", u.c[i]+'0');
10439 if eval $compile && ./try > /dev/null; then
10442 [1-4][1-4][1-4][1-4]|12345678|87654321)
10443 echo "(The test program ran ok.)"
10444 echo "byteorder=$dflt"
10447 ????|????????) echo "(The test program ran ok.)" ;;
10448 *) echo "(The test program didn't run right for some reason.)" ;;
10453 (I can't seem to compile the test program. Guessing big-endian...)
10456 case "$xxx_prompt" in
10458 rp="What is the order of bytes in a long?"
10472 : how do we catenate cpp tokens here?
10474 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
10475 $cat >cpp_stuff.c <<'EOCP'
10476 #define RCAT(a,b)a/**/b
10477 #define ACAT(a,b)a ## b
10481 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
10482 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
10483 echo "Oh! Smells like ANSI's been here." >&4
10484 echo "We can catify or stringify, separately or together!"
10486 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
10487 echo "Ah, yes! The good old days!" >&4
10488 echo "However, in the good old days we don't know how to stringify and"
10489 echo "catify at the same time."
10493 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
10494 to have to edit the values of CAT[2-5] in config.h...
10496 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
10500 : see if this is a db.h system
10506 : Check db version.
10508 echo "Checking Berkeley DB version ..." >&4
10514 #include <sys/types.h>
10519 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
10520 int Major, Minor, Patch ;
10521 unsigned long Version ;
10522 (void)db_version(&Major, &Minor, &Patch) ;
10523 printf("You have Berkeley DB Version 2 or greater\n");
10525 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
10526 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
10527 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
10528 Major, Minor, Patch) ;
10530 /* check that db.h & libdb are compatible */
10531 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
10532 printf("db.h and libdb are incompatible\n") ;
10536 printf("db.h and libdb are compatible\n") ;
10538 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
10539 + DB_VERSION_PATCH ;
10541 /* needs to be >= 2.3.4 */
10542 if (Version < 2003004) {
10543 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
10544 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
10550 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
10551 printf("You have Berkeley DB Version 1\n");
10552 exit(0); /* DB version < 2: the coast is clear. */
10554 exit(1); /* <db.h> not Berkeley DB? */
10560 if eval $compile && ./try; then
10561 echo 'Looks OK.' >&4
10563 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
10567 : Remove db from list of libraries to use
10568 echo "Removing unusable -ldb from library list" >&4
10569 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
10572 echo "libs = $libs" >&4
10582 : Check the return type needed for hash
10584 echo "Checking return type needed for hash for Berkeley DB ..." >&4
10590 #include <sys/types.h>
10593 #ifndef DB_VERSION_MAJOR
10594 u_int32_t hash_cb (ptr, size)
10602 info.hash = hash_cb;
10606 if $cc $ccflags -c try.c >try.out 2>&1 ; then
10607 if $contains warning try.out >>/dev/null 2>&1 ; then
10610 db_hashtype='u_int32_t'
10613 : XXX Maybe we should just give up here.
10614 db_hashtype=u_int32_t
10616 echo "Help: I can't seem to compile the db test program." >&4
10617 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
10620 echo "Your version of Berkeley DB uses $db_hashtype for hash."
10622 *) db_hashtype=u_int32_t
10627 : Check the return type needed for prefix
10629 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
10635 #include <sys/types.h>
10638 #ifndef DB_VERSION_MAJOR
10639 size_t prefix_cb (key1, key2)
10647 info.prefix = prefix_cb;
10651 if $cc $ccflags -c try.c >try.out 2>&1 ; then
10652 if $contains warning try.out >>/dev/null 2>&1 ; then
10653 db_prefixtype='int'
10655 db_prefixtype='size_t'
10658 db_prefixtype='size_t'
10659 : XXX Maybe we should just give up here.
10661 echo "Help: I can't seem to compile the db test program." >&4
10662 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
10665 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
10667 *) db_prefixtype='size_t'
10671 : check for void type
10673 echo "Checking to see how well your C compiler groks the void type..." >&4
10674 case "$voidflags" in
10676 $cat >try.c <<'EOCP'
10682 extern void moo(); /* function returning void */
10683 void (*goo)(); /* ptr to func returning void */
10685 void *hue; /* generic ptr */
10698 int main() { sub(); }
10700 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
10701 voidflags=$defvoidused
10702 echo "Good. It appears to support void to the level $package wants.">&4
10703 if $contains warning .out >/dev/null 2>&1; then
10704 echo "However, you might get some warnings that look like this:"
10708 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
10709 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
10710 echo "It supports 1..."
10711 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
10712 echo "It also supports 2..."
10713 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
10715 echo "And it supports 4 but not 8 definitely."
10717 echo "It doesn't support 4..."
10718 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
10720 echo "But it supports 8."
10723 echo "Neither does it support 8."
10727 echo "It does not support 2..."
10728 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
10730 echo "But it supports 4 and 8."
10732 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
10734 echo "And it supports 4 but has not heard about 8."
10736 echo "However it supports 8 but not 4."
10741 echo "There is no support at all for void."
10746 case "$voidflags" in
10748 *) $cat >&4 <<'EOM'
10749 Support flag bits are:
10750 1: basic void declarations.
10751 2: arrays of pointers to functions returning void.
10752 4: operations between pointers to and addresses of void functions.
10753 8: generic void pointers.
10756 rp="Your void support flags add up to what?"
10764 : How can we generate normalized random numbers ?
10766 echo "Looking for a random number function..." >&4
10767 case "$randfunc" in
10769 if set drand48 val -f; eval $csym; $val; then
10771 echo "Good, found drand48()." >&4
10772 elif set random val -f; eval $csym; $val; then
10774 echo "OK, found random()." >&4
10777 echo "Yick, looks like I have to use rand()." >&4
10788 *-Dmy_rand=*|*-Dmy_srand=*)
10789 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
10790 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
10791 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
10792 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
10796 while $test "$cont"; do
10797 rp="Use which function to generate random numbers?"
10799 if $test "$ans" = "$dflt"; then
10805 if set $ans val -f; eval $csym; $val; then
10809 rp="I cannot find function $ans. Use that name anyway?"
10818 case "$randfunc" in
10820 drand01="drand48()"
10826 case "$randbits" in
10828 echo "Checking to see how many bits your $randfunc() function produces..." >&4
10830 #$i_unistd I_UNISTD
10831 #$i_stdlib I_STDLIB
10834 # include <unistd.h>
10837 # include <stdlib.h>
10842 register unsigned long tmp;
10843 register unsigned long max = 0L;
10845 for (i = 1000; i; i--) {
10846 tmp = (unsigned long) $randfunc();
10847 if (tmp > max) max = tmp;
10849 for (i = 0; max; i++)
10855 if eval $compile_ok; then
10859 echo "(I can't seem to compile the test program...)"
10866 rp="How many bits does your $randfunc() function produce?"
10870 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
10871 seedfunc="s$randfunc"
10872 randseedtype=unsigned
10876 rp="How many bits does your $randfunc() function produce?"
10879 seedfunc="s$randfunc"
10880 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
10881 if set $seedfunc val -f; eval $csym; $val; then
10882 echo "(Using $seedfunc() to seed random generator)"
10884 echo "(Warning: no $seedfunc() to seed random generator)"
10887 randseedtype=unsigned
10895 echo "Determining whether or not we are on an EBCDIC system..." >&4
10896 $cat >tebcdic.c <<'EOM'
10899 if ('M'==0xd4) return 0;
10906 if eval $compile_ok; then
10908 echo "You have EBCDIC." >&4
10911 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4
10914 echo "I'm unable to compile the test program." >&4
10915 echo "I'll assume ASCII or some ISO Latin." >&4
10917 $rm -f tebcdic.c tebcdic
10921 : check for fflush NULL behaviour
10922 case "$fflushNULL" in
10925 Checking to see whether fflush(NULL) flushes all pending stdio output...
10930 FILE* p = fopen("try.out", "w");
10938 if eval $compile_ok; then
10940 if $test -s try.out; then
10941 fflushNULL="`$cat try.out`"
10944 case "$fflushNULL" in
10946 Your fflush(NULL) works okay.
10951 Your fflush(NULL) isn't working (contrary to ANSI C).
10956 Cannot figure out whether your fflush(NULL) works or not.
10957 I'm assuming it doesn't (contrary to ANSI C).
10964 $define|true|[yY]*)
10972 : see what type file positions are declared as in the library
10973 rp="What is the type for file position used by fsetpos()?"
10974 set fpos_t fpostype long stdio.h sys/types.h
10977 : Store the full pathname to the ar program for use in the C program
10978 : Respect a hint or command line value for full_ar.
10983 : Store the full pathname to the sed program for use in the C program
10986 : see what type gids are declared as in the kernel
10988 echo "Looking for the type for group ids returned by getgid()."
10989 set gid_t gidtype xxx stdio.h sys/types.h
10993 xxx=`./findhdr sys/user.h`
10994 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
10996 unsigned) dflt="$1 $2" ;;
11000 *) dflt="$gidtype";;
11003 gid_t) echo "gid_t found." ;;
11004 *) rp="What is the type for group ids returned by getgid()?"
11010 : see if getgroups exists
11011 set getgroups d_getgrps
11014 : see if setgroups exists
11015 set setgroups d_setgrps
11019 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11021 case "$d_getgrps$d_setgrps" in
11023 case "$groupstype" in
11024 '') dflt="$gidtype" ;;
11025 *) dflt="$groupstype" ;;
11028 What type of pointer is the second argument to getgroups() and setgroups()?
11029 Usually this is the same as group ids, $gidtype, but not always.
11032 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11036 *) groupstype="$gidtype";;
11039 : see what type lseek is declared as in the kernel
11040 rp="What is the type used for lseek's offset on this system?"
11041 set off_t lseektype long stdio.h sys/types.h
11045 $echo $n "Checking to see how big your file offsets are...$c" >&4
11047 #include <sys/types.h>
11051 printf("%d\n", sizeof($lseektype));
11055 if eval $compile_ok; then
11057 $echo " $lseeksize bytes." >&4
11061 echo "(I can't seem to compile the test program. Guessing...)"
11062 rp="What is the size of your file offsets (in bytes)?"
11069 echo "Checking if your $make program sets \$(MAKE)..." >&4
11070 case "$make_set_make" in
11072 $sed 's/^X //' > testmake.mak << 'EOF'
11074 X @echo 'maketemp="$(MAKE)"'
11076 case "`$make -f testmake.mak 2>/dev/null`" in
11077 *maketemp=*) make_set_make='#' ;;
11078 *) make_set_make="MAKE=$make" ;;
11080 $rm -f testmake.mak
11083 case "$make_set_make" in
11084 '#') echo "Yup, it does.";;
11085 *) echo "Nope, it doesn't.";;
11088 : see what type is used for mode_t
11089 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11090 set mode_t modetype int stdio.h sys/types.h
11093 : define a fucntion to check prototypes
11094 $cat > protochk <<EOSH
11097 optimize="$optimize"
11099 prototype="$prototype"
11104 $cat >> protochk <<'EOSH'
11109 while test $# -ge 2; do
11111 $define) echo "#include <$2>" >> try.c ;;
11112 literal) echo "$2" >> try.c ;;
11116 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11117 cat >> try.c <<'EOCP'
11118 #ifdef CAN_PROTOTYPE
11119 #define _(args) args
11124 echo "$foo" >> try.c
11125 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11126 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11132 $eunicefix protochk
11134 : see what type is used for size_t
11135 rp="What is the type used for the length parameter for string functions?"
11136 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11139 : check for type of arguments to gethostbyaddr.
11140 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11141 case "$d_gethbyaddr" in
11145 Checking to see what type of arguments are accepted by gethostbyaddr().
11147 hdrs="$define sys/types.h
11148 $d_socket sys/socket.h
11149 $i_niin netinet/in.h
11151 $i_unistd unistd.h"
11152 : The first arg can 'char *' or 'void *'
11153 : The second arg is some of integral type
11154 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11155 for yyy in size_t long int; do
11156 case "$netdb_host_type" in
11157 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11158 if ./protochk "$try" $hdrs; then
11159 echo "Your system accepts $xxx for the first arg."
11160 echo "...and $yyy for the second arg."
11161 netdb_host_type="$xxx"
11162 netdb_hlen_type="$yyy"
11168 : In case none of those worked, prompt the user.
11169 case "$netdb_host_type" in
11170 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11173 netdb_host_type=$ans
11174 rp='What is the type for the 2nd argument to gethostbyaddr?'
11177 netdb_hlen_type=$ans
11181 *) : no gethostbyaddr, so pick harmless defaults
11182 netdb_host_type='char *'
11183 netdb_hlen_type="$sizetype"
11186 # Remove the "const" if needed. -- but then we'll have a
11188 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11191 : check for type of argument to gethostbyname.
11192 if test "X$netdb_name_type" = X ; then
11193 case "$d_gethbyname" in
11197 Checking to see what type of argument is accepted by gethostbyname().
11199 hdrs="$define sys/types.h
11200 $d_socket sys/socket.h
11201 $i_niin netinet/in.h
11203 $i_unistd unistd.h"
11204 for xxx in "const char *" "char *"; do
11205 case "$netdb_name_type" in
11206 '') try="extern struct hostent *gethostbyname($xxx);"
11207 if ./protochk "$try" $hdrs; then
11208 echo "Your system accepts $xxx."
11209 netdb_name_type="$xxx"
11214 : In case none of those worked, prompt the user.
11215 case "$netdb_name_type" in
11216 '') rp='What is the type for the 1st argument to gethostbyname?'
11219 netdb_name_type=$ans
11223 *) : no gethostbyname, so pick harmless default
11224 netdb_name_type='char *'
11229 : check for type of 1st argument to getnetbyaddr.
11230 if test "X$netdb_net_type" = X ; then
11231 case "$d_getnbyaddr" in
11235 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11237 hdrs="$define sys/types.h
11238 $d_socket sys/socket.h
11239 $i_niin netinet/in.h
11241 $i_unistd unistd.h"
11242 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11243 case "$netdb_net_type" in
11244 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11245 if ./protochk "$try" $hdrs; then
11246 echo "Your system accepts $xxx."
11247 netdb_net_type="$xxx"
11252 : In case none of those worked, prompt the user.
11253 case "$netdb_net_type" in
11254 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11257 netdb_net_type=$ans
11261 *) : no getnetbyaddr, so pick harmless default
11262 netdb_net_type='long'
11266 : locate the preferred pager for this system
11280 '') dflt=/usr/ucb/more;;
11287 rp='What pager is used on your system?'
11291 : see what type pids are declared as in the kernel
11292 rp="What is the type of process ids on this system?"
11293 set pid_t pidtype int stdio.h sys/types.h
11296 : check for length of pointer
11300 $echo $n "Checking to see how big your pointers are...$c" >&4
11301 if test "$voidflags" -gt 7; then
11302 echo '#define VOID_PTR char *' > try.c
11304 echo '#define VOID_PTR void *' > try.c
11306 $cat >>try.c <<'EOCP'
11310 printf("%d\n", sizeof(VOID_PTR));
11315 if eval $compile_ok; then
11317 $echo " $ptrsize bytes." >&4
11320 echo "(I can't seem to compile the test program. Guessing...)" >&4
11321 rp="What is the size of a pointer (in bytes)?"
11329 : see if ar generates random libraries by itself
11331 echo "Checking how to generate random libraries on your machine..." >&4
11332 echo 'int bar1() { return bar2(); }' > bar1.c
11333 echo 'int bar2() { return 2; }' > bar2.c
11334 $cat > foo.c <<'EOP'
11335 int main() { printf("%d\n", bar1()); exit(0); }
11337 $cc $ccflags -c bar1.c >/dev/null 2>&1
11338 $cc $ccflags -c bar2.c >/dev/null 2>&1
11339 $cc $ccflags -c foo.c >/dev/null 2>&1
11340 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
11341 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11342 ./foobar >/dev/null 2>&1; then
11343 echo "$ar appears to generate random libraries itself."
11346 elif $ar ts bar$_a >/dev/null 2>&1 &&
11347 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11348 ./foobar >/dev/null 2>&1; then
11349 echo "a table of contents needs to be added with '$ar ts'."
11356 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
11357 $test -f $ranlib || ranlib=''
11360 if $test -n "$ranlib"; then
11361 echo "your system has '$ranlib'; we'll use that."
11364 echo "your system doesn't seem to support random libraries"
11365 echo "so we'll use lorder and tsort to order the libraries."
11372 : check for type of arguments to select.
11373 case "$selecttype" in
11374 '') case "$d_select" in
11377 Checking to see what type of arguments are accepted by select().
11379 hdrs="$define sys/types.h
11380 $i_systime sys/time.h
11381 $i_sysselct sys/select.h
11382 $d_socket sys/socket.h"
11383 : The first arg can be int, unsigned, or size_t
11384 : The last arg may or may not be 'const'
11386 : void pointer has been seen but using that
11387 : breaks the selectminbits test
11388 for xxx in 'fd_set *' 'int *'; do
11389 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
11390 for tmo in 'struct timeval *' 'const struct timeval *'; do
11392 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
11393 if ./protochk "$try" $hdrs; then
11394 echo "Your system accepts $xxx."
11403 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
11404 case "$d_fd_set" in
11405 $define) dflt="fd_set *" ;;
11414 *) : no select, so pick a harmless default
11421 : check for the select 'width'
11422 case "$selectminbits" in
11423 '') case "$d_select" in
11427 Checking to see on how many bits at a time your select() operates...
11430 #include <sys/types.h>
11432 #$i_systime I_SYS_TIME
11433 #$i_systimek I_SYS_TIME_KERNEL
11438 # ifdef I_SYS_TIME_KERNEL
11441 # include <sys/time.h>
11442 # ifdef I_SYS_TIME_KERNEL
11446 #$i_sysselct I_SYS_SELECT
11447 #ifdef I_SYS_SELECT
11448 #include <sys/select.h>
11452 #define S sizeof(*(b))
11454 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
11455 #define NBITS (NBYTES * 8)
11464 fp = fopen("try.c", "r");
11470 b = ($selecttype)s;
11471 for (i = 0; i < NBITS; i++)
11475 select(fd + 1, b, 0, 0, &t);
11476 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
11477 printf("%d\n", i + 1);
11482 if eval $compile_ok; then
11483 selectminbits=`./try`
11484 case "$selectminbits" in
11486 Cannot figure out on how many bits at a time your select() operates.
11487 I'll play safe and guess it is 32 bits.
11493 *) bits="$selectminbits bits" ;;
11495 echo "Your select() operates on $bits at a time." >&4
11497 rp='What is the minimum number of bits your select() operates on?'
11498 case "$byteorder" in
11499 1234|12345678) dflt=32 ;;
11504 selectminbits="$val"
11508 *) : no select, so pick a harmless default
11515 : Trace out the files included by signal.h, then look for SIGxxx names.
11516 : Remove SIGARRAYSIZE used by HPUX.
11517 : Remove SIGSTKSIZE used by Linux.
11518 : Remove SIGSTKSZ used by Posix.
11519 : Remove SIGTYP void lines used by OS2.
11520 xxx=`echo '#include <signal.h>' |
11521 $cppstdin $cppminus $cppflags 2>/dev/null |
11522 $grep '^[ ]*#.*include' |
11523 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
11524 : Check this list of files to be sure we have parsed the cpp output ok.
11525 : This will also avoid potentially non-existent files, such
11528 for xx in $xxx /dev/null ; do
11529 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
11531 : If we have found no files, at least try signal.h
11532 case "$xxxfiles" in
11533 '') xxxfiles=`./findhdr signal.h` ;;
11536 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
11537 print substr($2, 4, 20)
11539 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
11540 print substr($3, 4, 20)
11542 : Append some common names just in case the awk scan failed.
11543 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
11544 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
11545 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
11546 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
11547 : generate a few handy files for later
11548 $cat > signal.c <<'EOCP'
11549 #include <sys/types.h>
11550 #include <signal.h>
11554 /* Strange style to avoid deeply-nested #if/#else/#endif */
11557 # define NSIG (_NSIG)
11563 # define NSIG (SIGMAX+1)
11569 # define NSIG (SIG_MAX+1)
11575 # define NSIG (MAXSIG+1)
11581 # define NSIG (MAX_SIG+1)
11586 # ifdef SIGARRAYSIZE
11587 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
11593 # define NSIG (_sys_nsig) /* Solaris 2.5 */
11597 /* Default to some arbitrary number that's big enough to get most
11598 of the common signals.
11604 printf("NSIG %d\n", NSIG);
11610 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
11612 printf "#ifdef SIG"; printf $1; printf "\n"
11613 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
11614 printf $1; printf ");\n"
11618 printf "#endif /* JUST_NSIG */\n";
11622 $cat >signal.awk <<'EOP'
11623 BEGIN { ndups = 0 }
11624 $1 ~ /^NSIG$/ { nsig = $2 }
11625 ($1 !~ /^NSIG$/) && (NF == 2) {
11626 if ($2 > maxsig) { maxsig = $2 }
11627 if (sig_name[$2]) {
11628 dup_name[ndups] = $1
11629 dup_num[ndups] = $2
11641 printf("NSIG %d\n", nsig);
11642 for (n = 1; n < nsig; n++) {
11644 printf("%s %d\n", sig_name[n], sig_num[n])
11647 printf("NUM%d %d\n", n, n)
11650 for (n = 0; n < ndups; n++) {
11651 printf("%s %d\n", dup_name[n], dup_num[n])
11655 $cat >signal_cmd <<EOS
11657 if $test -s signal.lst; then
11658 echo "Using your existing signal.lst file"
11663 $cat >>signal_cmd <<'EOS'
11666 if eval $compile_ok; then
11667 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
11669 echo "(I can't seem be able to compile the whole test program)" >&4
11670 echo "(I'll try it in little pieces.)" >&4
11671 set signal -DJUST_NSIG
11672 if eval $compile_ok; then
11673 ./signal$_exe > signal.nsg
11676 echo "I can't seem to figure out how many signals you have." >&4
11677 echo "Guessing 50." >&4
11678 echo 'NSIG 50' > signal.nsg
11680 : Now look at all the signal names, one at a time.
11681 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
11682 $cat > signal.c <<EOCP
11683 #include <sys/types.h>
11684 #include <signal.h>
11687 printf("$xx %d\n", SIG${xx});
11692 if eval $compile; then
11693 echo "SIG${xx} found."
11694 ./signal$_exe >> signal.ls1
11696 echo "SIG${xx} NOT found."
11699 if $test -s signal.ls1; then
11700 $cat signal.nsg signal.ls1 |
11701 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
11705 if $test -s signal.lst; then
11708 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
11709 echo 'kill -l' >signal
11710 set X `csh -f <signal`
11714 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
11716 echo $@ | $tr ' ' $trnl | \
11717 $awk '{ printf "%s %d\n", $1, ++s; }
11718 END { printf "NSIG %d\n", ++s }' >signal.lst
11720 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
11722 chmod a+x signal_cmd
11723 $eunicefix signal_cmd
11725 : generate list of signal names
11727 case "$sig_name_init" in
11729 *) case "$sig_num_init" in
11730 ''|*,*) doinit=yes ;;
11735 echo "Generating a list of signal names and numbers..." >&4
11737 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
11738 sig_name=`$awk 'BEGIN { printf "ZERO " }
11739 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
11740 sig_num=`$awk 'BEGIN { printf "0 " }
11741 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
11742 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
11743 !/^NSIG/ { printf "\"%s\", ", $1 }
11744 END { printf "0\n" }' signal.lst`
11745 sig_num_init=`$awk 'BEGIN { printf "0, " }
11746 !/^NSIG/ { printf "%d, ", $2}
11747 END { printf "0\n"}' signal.lst`
11750 echo "The following $sig_count signals are available:"
11752 echo $sig_name | $awk \
11753 'BEGIN { linelen = 0 }
11755 for (i = 1; i <= NF; i++) {
11756 name = "SIG" $i " "
11757 linelen = linelen + length(name)
11758 if (linelen > 70) {
11760 linelen = length(name)
11766 $rm -f signal signal.c signal.awk signal.lst signal_cmd
11768 : see what type is used for signed size_t
11769 set ssize_t ssizetype int stdio.h sys/types.h
11772 $cat > ssize.c <<EOM
11774 #include <sys/types.h>
11775 #define Size_t $sizetype
11776 #define SSize_t $dflt
11779 if (sizeof(Size_t) == sizeof(SSize_t))
11781 else if (sizeof(Size_t) == sizeof(int))
11790 if eval $compile_ok && ./ssize > /dev/null; then
11791 ssizetype=`./ssize`
11792 echo "I'll be using $ssizetype for functions returning a byte count." >&4
11795 Help! I can't compile and run the ssize_t test program: please enlighten me!
11796 (This is probably a misconfiguration in your system or libraries, and
11797 you really ought to fix it. Still, I'll try anyway.)
11799 I need a type that is the same size as $sizetype, but is guaranteed to
11800 be signed. Common values are ssize_t, int and long.
11803 rp="What signed type is the same size as $sizetype?"
11807 $rm -f ssize ssize.*
11809 : see what type of char stdio uses.
11811 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11812 echo "Your stdio uses unsigned chars." >&4
11813 stdchar="unsigned char"
11815 echo "Your stdio uses signed chars." >&4
11819 : see if time exists
11821 if test "X$d_time" = X -o X"$timetype" = X; then
11822 if set time val -f d_time; eval $csym; $val; then
11823 echo 'time() found.' >&4
11825 rp="What is the type returned by time() on this system?"
11826 set time_t timetype long stdio.h sys/types.h
11829 echo 'time() not found, hope that will do.' >&4
11837 : see what type uids are declared as in the kernel
11839 echo "Looking for the type for user ids returned by getuid()."
11840 set uid_t uidtype xxx stdio.h sys/types.h
11844 xxx=`./findhdr sys/user.h`
11845 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
11847 unsigned) dflt="$1 $2" ;;
11851 *) dflt="$uidtype";;
11854 uid_t) echo "uid_t found." ;;
11855 *) rp="What is the type for user ids returned by getuid()?"
11861 : see if dbm.h is available
11862 : see if dbmclose exists
11863 set dbmclose d_dbmclose
11866 case "$d_dbmclose" in
11876 *) set rpcsvc/dbm.h i_rpcsvcdbm
11881 *) echo "We won't be including <dbm.h>"
11891 : see if this is a sys/file.h system
11896 : do we need to include sys/file.h ?
11900 if $h_sysfile; then
11902 echo "We'll be including <sys/file.h>." >&4
11905 echo "We won't be including <sys/file.h>." >&4
11915 : see if fcntl.h is there
11920 : see if we can include fcntl.h
11926 echo "We'll be including <fcntl.h>." >&4
11929 if $h_sysfile; then
11930 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11932 echo "We won't be including <fcntl.h>." >&4
11944 : see if locale.h is available
11945 set locale.h i_locale
11948 : see if mach cthreads are available
11949 if test "X$usethreads" = "X$define"; then
11950 set mach/cthreads.h i_machcthr
11953 i_machcthr="$undef"
11958 : see if this is a math.h system
11962 : see if this is a mntent.h system
11963 set mntent.h i_mntent
11966 : see if ndbm.h is available
11971 : see if dbm_open exists
11972 set dbm_open d_dbm_open
11974 case "$d_dbm_open" in
11977 echo "We won't be including <ndbm.h>"
11986 : see if net/errno.h is available
11988 set net/errno.h val
11991 : Unfortunately, it causes problems on some systems. Arrgh.
11994 cat > try.c <<'EOM'
11997 #include <net/errno.h>
12003 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12004 echo "We'll be including <net/errno.h>." >&4
12006 echo "We won't be including <net/errno.h>." >&4
12015 : see if netinet/tcp.h is available
12016 set netinet/tcp.h i_netinettcp
12019 : see if this is a poll.h system
12023 : get C preprocessor symbols handy
12025 $echo $n "Hmm... $c"
12026 echo $al | $tr ' ' $trnl >Cppsym.know
12027 $cat <<EOSS >Cppsym
12035 case "\$list\$#" in
12038 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12040 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12043 unknown="\$unknown \$sym"
12053 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12055 exit 0; _ _ _ _\1\\ \1\\
12058 echo "exit 1; _ _ _" >>Cppsym\$\$
12059 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12061 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12067 $rm -f Cppsym\$\$ Cppsym2\$\$
12072 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12074 : now check the C compiler for additional symbols
12075 postprocess_cc_v=''
12077 aix) postprocess_cc_v="|$tr , ' '" ;;
12084 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12087 -D*) echo "\$i" | $sed 's/^-D//';;
12088 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12093 postprocess_cc_v=''
12096 ./ccsym > ccsym1.raw
12097 if $test -s ccsym1.raw; then
12098 $sort ccsym1.raw | $uniq >ccsym.raw
12100 mv ccsym1.raw ccsym.raw
12103 $awk '/\=/ { print $0; next }
12104 { print $0"=1" }' ccsym.raw >ccsym.list
12105 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12106 $comm -13 ccsym.true ccsym.list >ccsym.own
12107 $comm -12 ccsym.true ccsym.list >ccsym.com
12108 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12110 if $test -z ccsym.raw; then
12111 echo "Your C compiler doesn't seem to define any symbols!" >&4
12113 echo "However, your C preprocessor defines the following symbols:"
12116 cppsymbols=`$cat Cppsym.true`
12117 cppsymbols=`echo $cppsymbols`
12118 cppccsymbols="$cppsymbols"
12120 if $test -s ccsym.com; then
12121 echo "Your C compiler and pre-processor define these symbols:"
12122 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12125 cppccsymbols=`$cat ccsym.com`
12126 cppccsymbols=`echo $cppccsymbols`
12127 $test "$silent" || sleep 1
12129 if $test -s ccsym.cpp; then
12130 $test "$also" && echo " "
12131 echo "Your C pre-processor ${also}defines the following symbols:"
12132 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12134 cppsymbols=`$cat ccsym.cpp`
12135 cppsymbols=`echo $cppsymbols`
12136 $test "$silent" || sleep 1
12138 if $test -s ccsym.own; then
12139 $test "$also" && echo " "
12140 echo "Your C compiler ${also}defines the following cpp symbols:"
12141 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12142 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12143 ccsymbols=`$cat ccsym.own`
12144 ccsymbols=`echo $ccsymbols`
12145 $test "$silent" || sleep 1
12150 : see if this is a termio system
12154 if $test `./findhdr termios.h`; then
12155 set tcsetattr i_termios
12161 "$define") echo "You have POSIX termios.h... good!" >&4;;
12162 *) if ./Cppsym pyr; then
12163 case "`/bin/universe`" in
12164 ucb) if $test `./findhdr sgtty.h`; then
12166 echo "<sgtty.h> found." >&4
12168 echo "System is pyramid with BSD universe."
12169 echo "<sgtty.h> not found--you could have problems." >&4
12171 *) if $test `./findhdr termio.h`; then
12173 echo "<termio.h> found." >&4
12175 echo "System is pyramid with USG universe."
12176 echo "<termio.h> not found--you could have problems." >&4
12180 if $test `./findhdr termio.h`; then
12181 echo "<termio.h> found." >&4
12183 elif $test `./findhdr sgtty.h`; then
12184 echo "<sgtty.h> found." >&4
12187 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12190 if $test `./findhdr sgtty.h`; then
12191 echo "<sgtty.h> found." >&4
12193 elif $test `./findhdr termio.h`; then
12194 echo "<termio.h> found." >&4
12197 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12201 set i_termio; eval $setvar
12202 val=$val2; set i_sgtty; eval $setvar
12203 val=$val3; set i_termios; eval $setvar
12205 : see if stdarg is available
12207 if $test `./findhdr stdarg.h`; then
12208 echo "<stdarg.h> found." >&4
12211 echo "<stdarg.h> NOT found." >&4
12215 : see if varags is available
12217 if $test `./findhdr varargs.h`; then
12218 echo "<varargs.h> found." >&4
12220 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12223 : set up the varargs testing programs
12224 $cat > varargs.c <<EOP
12226 #include <stdarg.h>
12229 #include <varargs.h>
12233 int f(char *p, ...)
12247 p = va_arg(ap, char *);
12252 $cat > varargs <<EOP
12254 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
12263 : now check which varargs header should be included
12268 if `./varargs I_STDARG`; then
12270 elif `./varargs I_VARARGS`; then
12275 if `./varargs I_VARARGS`; then
12282 echo "I could not find the definition for va_dcl... You have problems..." >&4
12283 val="$undef"; set i_stdarg; eval $setvar
12284 val="$undef"; set i_varargs; eval $setvar
12289 case "$i_varhdr" in
12291 val="$define"; set i_stdarg; eval $setvar
12292 val="$undef"; set i_varargs; eval $setvar
12295 val="$undef"; set i_stdarg; eval $setvar
12296 val="$define"; set i_varargs; eval $setvar
12299 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
12303 : see if stddef is available
12304 set stddef.h i_stddef
12307 : see if sys/access.h is available
12308 set sys/access.h i_sysaccess
12311 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
12312 set sys/filio.h i_sysfilio
12315 if $test `./findhdr sys/ioctl.h`; then
12317 echo '<sys/ioctl.h> found.' >&4
12320 if $test $i_sysfilio = "$define"; then
12321 echo '<sys/ioctl.h> NOT found.' >&4
12323 $test $i_sgtty = "$define" && xxx="sgtty.h"
12324 $test $i_termio = "$define" && xxx="termio.h"
12325 $test $i_termios = "$define" && xxx="termios.h"
12326 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
12332 : see if sys/resource.h has to be included
12333 set sys/resource.h i_sysresrc
12336 : see if sys/security.h is available
12337 set sys/security.h i_syssecrt
12340 : see if this is a sys/statvfs.h system
12341 set sys/statvfs.h i_sysstatvfs
12344 : see if this is a sys/un.h system
12345 set sys/un.h i_sysun
12348 : see if this is a syswait system
12349 set sys/wait.h i_syswait
12352 : see if this is an utime system
12353 set utime.h i_utime
12356 : see if this is a values.h system
12357 set values.h i_values
12360 : see if this is a vfork system
12363 set vfork.h i_vfork
12371 : see if gdbm.h is available
12376 : see if gdbm_open exists
12377 set gdbm_open d_gdbm_open
12379 case "$d_gdbm_open" in
12382 echo "We won't be including <gdbm.h>"
12392 echo "Looking for extensions..." >&4
12395 : If we are using the old config.sh, known_extensions may contain
12396 : old or inaccurate or duplicate values.
12397 known_extensions=''
12398 nonxs_extensions=''
12399 : We do not use find because it might not be available.
12400 : We do not just use MANIFEST because the user may have dropped
12401 : some additional extensions into the source tree and expect them
12405 DynaLoader|dynaload) ;;
12406 *) if $test -f $xxx/$xxx.xs; then
12407 known_extensions="$known_extensions $xxx"
12408 elif $test -f $xxx/Makefile.PL; then
12409 nonxs_extensions="$nonxs_extensions $xxx"
12411 if $test -d $xxx; then
12412 # Look for nested extensions, eg. Devel/Dprof.
12415 if $test -f $yyy/$yyy.xs; then
12416 known_extensions="$known_extensions $xxx/$yyy"
12417 elif $test -f $yyy/Makefile.PL; then
12418 nonxs_extensions="$nonxs_extensions $xxx/$yyy"
12427 set X $nonxs_extensions
12429 nonxs_extensions="$*"
12430 set X $known_extensions
12432 known_extensions="$*"
12435 : Now see which are supported on this system.
12437 for xxx in $known_extensions ; do
12441 $define) avail_ext="$avail_ext $xxx" ;;
12444 GDBM_File|gdbm_fil)
12446 $define) avail_ext="$avail_ext $xxx" ;;
12449 NDBM_File|ndbm_fil)
12451 $define) avail_ext="$avail_ext $xxx" ;;
12454 ODBM_File|odbm_fil)
12455 case "${i_dbm}${i_rpcsvcdbm}" in
12456 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
12460 case "$useposix" in
12461 true|define|y) avail_ext="$avail_ext $xxx" ;;
12465 case "$useopcode" in
12466 true|define|y) avail_ext="$avail_ext $xxx" ;;
12470 case "$d_socket" in
12471 true|$define|y) avail_ext="$avail_ext $xxx" ;;
12475 case "$usethreads" in
12476 true|$define|y) avail_ext="$avail_ext $xxx" ;;
12480 : XXX Do we need a useipcsysv variable here
12481 case "${d_msg}${d_sem}${d_shm}" in
12482 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
12485 *) avail_ext="$avail_ext $xxx"
12494 : Now see which nonxs extensions are supported on this system.
12495 : For now assume all are.
12497 for xxx in $nonxs_extensions ; do
12499 *) nonxs_ext="$nonxs_ext $xxx"
12511 A number of extensions are supplied with $package. You may choose to
12512 compile these extensions for dynamic loading (the default), compile
12513 them into the $package executable (static loading), or not include
12514 them at all. Answer "none" to include no extensions.
12515 Note that DynaLoader is always built and need not be mentioned here.
12518 case "$dynamic_ext" in
12519 '') dflt="$avail_ext" ;;
12520 *) dflt="$dynamic_ext"
12521 # Perhaps we are reusing an old out-of-date config.sh.
12524 if test X"$dynamic_ext" != X"$avail_ext"; then
12526 NOTICE: Your previous config.sh list may be incorrect.
12527 The extensions now available to you are
12529 but the default list from your previous config.sh is
12541 rp="What extensions do you wish to load dynamically?"
12544 none) dynamic_ext=' ' ;;
12545 *) dynamic_ext="$ans" ;;
12548 case "$static_ext" in
12550 : Exclude those already listed in dynamic linking
12552 for xxx in $avail_ext; do
12553 case " $dynamic_ext " in
12555 *) dflt="$dflt $xxx" ;;
12562 *) dflt="$static_ext"
12569 rp="What extensions do you wish to load statically?"
12572 none) static_ext=' ' ;;
12573 *) static_ext="$ans" ;;
12578 A number of extensions are supplied with $package. Answer "none"
12579 to include no extensions.
12580 Note that DynaLoader is always built and need not be mentioned here.
12583 case "$static_ext" in
12584 '') dflt="$avail_ext" ;;
12585 *) dflt="$static_ext"
12586 # Perhaps we are reusing an old out-of-date config.sh.
12589 if test X"$static_ext" != X"$avail_ext"; then
12591 NOTICE: Your previous config.sh list may be incorrect.
12592 The extensions now available to you are
12594 but the default list from your previous config.sh is
12603 : Exclude those that are not xs extensions
12607 rp="What extensions do you wish to include?"
12610 none) static_ext=' ' ;;
12611 *) static_ext="$ans" ;;
12616 set X $dynamic_ext $static_ext $nonxs_ext
12620 : Remove build directory name from cppstdin so it can be used from
12621 : either the present location or the final installed location.
12623 : Get out of the UU directory to get correct path name.
12625 case "$cppstdin" in
12627 echo "Stripping down cppstdin path name"
12633 : end of configuration questions
12635 echo "End of configuration questions."
12638 : back to where it started
12639 if test -d ../UU; then
12643 : configuration may be patched via a 'config.over' file
12644 if $test -f config.over; then
12647 rp='I see a config.over file. Do you wish to load it?'
12650 n*) echo "OK, I'll ignore it.";;
12652 echo "Configuration override changes have been loaded."
12657 : in case they want portability, strip down executable paths
12658 case "$d_portable" in
12661 echo "Stripping down executable paths..." >&4
12662 for file in $loclist $trylist; do
12663 if test X$file != Xln -a X$file != Xar -o X$osname != Xos2; then
12664 eval $file="\$file"
12670 : create config.sh file
12672 echo "Creating config.sh..." >&4
12673 $spitshell <<EOT >config.sh
12676 # This file was produced by running the Configure script. It holds all the
12677 # definitions figured out by Configure. Should you modify one of these values,
12678 # do not forget to propagate your changes by running "Configure -der". You may
12679 # instead choose to run each of the .SH files by yourself, or "Configure -S".
12682 # Package name : $package
12683 # Source directory : $src
12684 # Configuration time: $cf_time
12685 # Configured by : $cf_by
12686 # Target system : $myuname
12696 Revision='$Revision'
12703 alignbytes='$alignbytes'
12704 ansi2knr='$ansi2knr'
12705 aphostname='$aphostname'
12706 apiversion='$apiversion'
12709 archlibexp='$archlibexp'
12710 archname64='$archname64'
12711 archname='$archname'
12712 archobjs='$archobjs'
12720 byteorder='$byteorder'
12722 castflags='$castflags'
12725 cccdlflags='$cccdlflags'
12726 ccdlflags='$ccdlflags'
12728 ccsymbols='$ccsymbols'
12730 cf_email='$cf_email'
12735 clocktype='$clocktype'
12737 compress='$compress'
12738 contains='$contains'
12742 cpp_stuff='$cpp_stuff'
12743 cppccsymbols='$cppccsymbols'
12744 cppflags='$cppflags'
12746 cppminus='$cppminus'
12748 cppstdin='$cppstdin'
12749 cppsymbols='$cppsymbols'
12750 crosscompile='$crosscompile'
12751 cryptlib='$cryptlib'
12753 d_Gconvert='$d_Gconvert'
12754 d_access='$d_access'
12755 d_accessx='$d_accessx'
12757 d_archlib='$d_archlib'
12758 d_attribut='$d_attribut'
12762 d_bsdgetpgrp='$d_bsdgetpgrp'
12763 d_bsdsetpgrp='$d_bsdsetpgrp'
12765 d_casti32='$d_casti32'
12766 d_castneg='$d_castneg'
12767 d_charvspr='$d_charvspr'
12769 d_chroot='$d_chroot'
12770 d_chsize='$d_chsize'
12771 d_closedir='$d_closedir'
12772 d_cmsghdr_s='$d_cmsghdr_s'
12776 d_cuserid='$d_cuserid'
12777 d_dbl_dig='$d_dbl_dig'
12778 d_dbmclose64='$d_dbmclose64'
12779 d_dbminit64='$d_dbminit64'
12780 d_delete64='$d_delete64'
12781 d_difftime='$d_difftime'
12782 d_dirent64_s='$d_dirent64_s'
12783 d_dirnamlen='$d_dirnamlen'
12784 d_dlerror='$d_dlerror'
12785 d_dlopen='$d_dlopen'
12786 d_dlsymun='$d_dlsymun'
12787 d_dosuid='$d_dosuid'
12788 d_drand48proto='$d_drand48proto'
12790 d_eaccess='$d_eaccess'
12791 d_endgrent='$d_endgrent'
12792 d_endhent='$d_endhent'
12793 d_endnent='$d_endnent'
12794 d_endpent='$d_endpent'
12795 d_endpwent='$d_endpwent'
12796 d_endsent='$d_endsent'
12797 d_eofnblk='$d_eofnblk'
12798 d_eunice='$d_eunice'
12799 d_fchmod='$d_fchmod'
12800 d_fchown='$d_fchown'
12802 d_fd_macros='$d_fd_macros'
12803 d_fd_set='$d_fd_set'
12804 d_fds_bits='$d_fds_bits'
12805 d_fetch64='$d_fetch64'
12806 d_fgetpos64='$d_fgetpos64'
12807 d_fgetpos='$d_fgetpos'
12808 d_firstkey64='$d_firstkey64'
12809 d_flexfnam='$d_flexfnam'
12810 d_flock64_s='$d_flock64_s'
12812 d_fopen64='$d_fopen64'
12814 d_fpathconf='$d_fpathconf'
12815 d_freopen64='$d_freopen64'
12816 d_fseek64='$d_fseek64'
12817 d_fseeko64='$d_fseeko64'
12818 d_fseeko='$d_fseeko'
12819 d_fsetpos64='$d_fsetpos64'
12820 d_fsetpos='$d_fsetpos'
12821 d_fstat64='$d_fstat64'
12822 d_fstatfs='$d_fstatfs'
12823 d_fstatvfs='$d_fstatvfs'
12824 d_ftell64='$d_ftell64'
12825 d_ftello64='$d_ftello64'
12826 d_ftello='$d_ftello'
12828 d_ftruncate64='$d_ftruncate64'
12829 d_getgrent='$d_getgrent'
12830 d_getgrps='$d_getgrps'
12831 d_gethbyaddr='$d_gethbyaddr'
12832 d_gethbyname='$d_gethbyname'
12833 d_gethent='$d_gethent'
12834 d_gethname='$d_gethname'
12835 d_gethostprotos='$d_gethostprotos'
12836 d_getlogin='$d_getlogin'
12837 d_getmntent='$d_getmntent'
12838 d_getnbyaddr='$d_getnbyaddr'
12839 d_getnbyname='$d_getnbyname'
12840 d_getnent='$d_getnent'
12841 d_getnetprotos='$d_getnetprotos'
12842 d_getpbyname='$d_getpbyname'
12843 d_getpbynumber='$d_getpbynumber'
12844 d_getpent='$d_getpent'
12845 d_getpgid='$d_getpgid'
12846 d_getpgrp2='$d_getpgrp2'
12847 d_getpgrp='$d_getpgrp'
12848 d_getppid='$d_getppid'
12849 d_getprior='$d_getprior'
12850 d_getprotoprotos='$d_getprotoprotos'
12851 d_getpwent='$d_getpwent'
12852 d_getsbyname='$d_getsbyname'
12853 d_getsbyport='$d_getsbyport'
12854 d_getsent='$d_getsent'
12855 d_getservprotos='$d_getservprotos'
12856 d_gettimeod='$d_gettimeod'
12857 d_gnulibc='$d_gnulibc'
12858 d_grpasswd='$d_grpasswd'
12859 d_hasmntopt='$d_hasmntopt'
12862 d_inetaton='$d_inetaton'
12863 d_ino64_t='$d_ino64_t'
12864 d_int64t='$d_int64t'
12865 d_iovec_s='$d_iovec_s'
12866 d_isascii='$d_isascii'
12867 d_killpg='$d_killpg'
12868 d_lchown='$d_lchown'
12870 d_llseek='$d_llseek'
12871 d_locconv='$d_locconv'
12872 d_lockf64='$d_lockf64'
12874 d_longdbl='$d_longdbl'
12875 d_longlong='$d_longlong'
12876 d_lseek64='$d_lseek64'
12877 d_lstat64='$d_lstat64'
12879 d_madvise='$d_madvise'
12881 d_mbstowcs='$d_mbstowcs'
12882 d_mbtowc='$d_mbtowc'
12883 d_memcmp='$d_memcmp'
12884 d_memcpy='$d_memcpy'
12885 d_memmove='$d_memmove'
12886 d_memset='$d_memset'
12888 d_mkfifo='$d_mkfifo'
12889 d_mktime='$d_mktime'
12891 d_mprotect='$d_mprotect'
12893 d_msg_ctrunc='$d_msg_ctrunc'
12894 d_msg_dontroute='$d_msg_dontroute'
12895 d_msg_oob='$d_msg_oob'
12896 d_msg_peek='$d_msg_peek'
12897 d_msg_proxy='$d_msg_proxy'
12898 d_msgctl='$d_msgctl'
12899 d_msgget='$d_msgget'
12900 d_msghdr_s='$d_msghdr_s'
12901 d_msgrcv='$d_msgrcv'
12902 d_msgsnd='$d_msgsnd'
12904 d_munmap='$d_munmap'
12905 d_mymalloc='$d_mymalloc'
12906 d_nextkey64='$d_nextkey64'
12908 d_off64_t='$d_off64_t'
12909 d_offset_t='$d_offset_t'
12910 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
12911 d_oldpthreads='$d_oldpthreads'
12912 d_oldsock='$d_oldsock'
12914 d_open64='$d_open64'
12915 d_opendir64='$d_opendir64'
12916 d_pathconf='$d_pathconf'
12918 d_phostname='$d_phostname'
12921 d_portable='$d_portable'
12922 d_pthread_yield='$d_pthread_yield'
12924 d_pwchange='$d_pwchange'
12925 d_pwclass='$d_pwclass'
12926 d_pwcomment='$d_pwcomment'
12927 d_pwexpire='$d_pwexpire'
12928 d_pwgecos='$d_pwgecos'
12929 d_pwpasswd='$d_pwpasswd'
12930 d_pwquota='$d_pwquota'
12931 d_readdir64='$d_readdir64'
12932 d_readdir='$d_readdir'
12933 d_readlink='$d_readlink'
12935 d_recvmsg='$d_recvmsg'
12936 d_rename='$d_rename'
12937 d_rewinddir='$d_rewinddir'
12939 d_safebcpy='$d_safebcpy'
12940 d_safemcpy='$d_safemcpy'
12941 d_sanemcmp='$d_sanemcmp'
12942 d_sched_yield='$d_sched_yield'
12943 d_scm_rights='$d_scm_rights'
12944 d_seekdir64='$d_seekdir64'
12945 d_seekdir='$d_seekdir'
12946 d_select='$d_select'
12948 d_semctl='$d_semctl'
12949 d_semctl_semid_ds='$d_semctl_semid_ds'
12950 d_semctl_semun='$d_semctl_semun'
12951 d_semget='$d_semget'
12953 d_sendmsg='$d_sendmsg'
12954 d_setegid='$d_setegid'
12955 d_seteuid='$d_seteuid'
12956 d_setgrent='$d_setgrent'
12957 d_setgrps='$d_setgrps'
12958 d_sethent='$d_sethent'
12959 d_setlinebuf='$d_setlinebuf'
12960 d_setlocale='$d_setlocale'
12961 d_setnent='$d_setnent'
12962 d_setpent='$d_setpent'
12963 d_setpgid='$d_setpgid'
12964 d_setpgrp2='$d_setpgrp2'
12965 d_setpgrp='$d_setpgrp'
12966 d_setprior='$d_setprior'
12967 d_setpwent='$d_setpwent'
12968 d_setregid='$d_setregid'
12969 d_setresgid='$d_setresgid'
12970 d_setresuid='$d_setresuid'
12971 d_setreuid='$d_setreuid'
12972 d_setrgid='$d_setrgid'
12973 d_setruid='$d_setruid'
12974 d_setsent='$d_setsent'
12975 d_setsid='$d_setsid'
12976 d_setvbuf='$d_setvbuf'
12980 d_shmatprototype='$d_shmatprototype'
12981 d_shmctl='$d_shmctl'
12983 d_shmget='$d_shmget'
12984 d_sigaction='$d_sigaction'
12985 d_sigsetjmp='$d_sigsetjmp'
12986 d_socket='$d_socket'
12987 d_sockpair='$d_sockpair'
12988 d_stat64='$d_stat64'
12989 d_statblks='$d_statblks'
12990 d_statfs='$d_statfs'
12991 d_statfsflags='$d_statfsflags'
12992 d_statvfs='$d_statvfs'
12993 d_stdio_cnt_lval='$d_stdio_cnt_lval'
12994 d_stdio_ptr_lval='$d_stdio_ptr_lval'
12995 d_stdiobase='$d_stdiobase'
12996 d_stdstdio='$d_stdstdio'
12997 d_store64='$d_store64'
12998 d_strchr='$d_strchr'
12999 d_strcoll='$d_strcoll'
13000 d_strctcpy='$d_strctcpy'
13001 d_strerrm='$d_strerrm'
13002 d_strerror='$d_strerror'
13003 d_strtod='$d_strtod'
13004 d_strtol='$d_strtol'
13005 d_strtoul='$d_strtoul'
13006 d_strxfrm='$d_strxfrm'
13007 d_suidsafe='$d_suidsafe'
13008 d_symlink='$d_symlink'
13009 d_syscall='$d_syscall'
13010 d_sysconf='$d_sysconf'
13011 d_sysernlst='$d_sysernlst'
13012 d_syserrlst='$d_syserrlst'
13013 d_system='$d_system'
13014 d_tcgetpgrp='$d_tcgetpgrp'
13015 d_tcsetpgrp='$d_tcsetpgrp'
13016 d_telldir64='$d_telldir64'
13017 d_telldir='$d_telldir'
13018 d_telldirproto='$d_telldirproto'
13021 d_tmpfile64='$d_tmpfile64'
13022 d_truncate64='$d_truncate64'
13023 d_truncate='$d_truncate'
13024 d_tzname='$d_tzname'
13027 d_union_semun='$d_union_semun'
13029 d_void_closedir='$d_void_closedir'
13030 d_voidsig='$d_voidsig'
13031 d_voidtty='$d_voidtty'
13032 d_volatile='$d_volatile'
13033 d_vprintf='$d_vprintf'
13035 d_waitpid='$d_waitpid'
13036 d_wcstombs='$d_wcstombs'
13037 d_wctomb='$d_wctomb'
13038 d_writev='$d_writev'
13041 db_hashtype='$db_hashtype'
13042 db_prefixtype='$db_prefixtype'
13043 defvoidused='$defvoidused'
13044 direntrytype='$direntrytype'
13047 doublesize='$doublesize'
13049 dynamic_ext='$dynamic_ext'
13055 eunicefix='$eunicefix'
13058 extensions='$extensions'
13059 fflushNULL='$fflushNULL'
13061 firstmakefile='$firstmakefile'
13063 fpostype='$fpostype'
13064 freetype='$freetype'
13066 full_csh='$full_csh'
13067 full_sed='$full_sed'
13068 gccversion='$gccversion'
13072 groupcat='$groupcat'
13073 groupstype='$groupstype'
13076 h_sysfile='$h_sysfile'
13080 i_arpainet='$i_arpainet'
13081 i_bsdioctl='$i_bsdioctl'
13084 i_dirent='$i_dirent'
13091 i_inttypes='$i_inttypes'
13092 i_limits='$i_limits'
13093 i_locale='$i_locale'
13094 i_machcthr='$i_machcthr'
13095 i_malloc='$i_malloc'
13097 i_memory='$i_memory'
13098 i_mntent='$i_mntent'
13101 i_neterrno='$i_neterrno'
13102 i_netinettcp='$i_netinettcp'
13105 i_pthread='$i_pthread'
13107 i_rpcsvcdbm='$i_rpcsvcdbm'
13110 i_stdarg='$i_stdarg'
13111 i_stddef='$i_stddef'
13112 i_stdlib='$i_stdlib'
13113 i_string='$i_string'
13114 i_sysaccess='$i_sysaccess'
13115 i_sysdir='$i_sysdir'
13116 i_sysfile='$i_sysfile'
13117 i_sysfilio='$i_sysfilio'
13119 i_sysioctl='$i_sysioctl'
13120 i_sysmman='$i_sysmman'
13121 i_sysmount='$i_sysmount'
13122 i_sysndir='$i_sysndir'
13123 i_sysparam='$i_sysparam'
13124 i_sysresrc='$i_sysresrc'
13125 i_syssecrt='$i_syssecrt'
13126 i_sysselct='$i_sysselct'
13127 i_syssockio='$i_syssockio'
13128 i_sysstat='$i_sysstat'
13129 i_sysstatvfs='$i_sysstatvfs'
13130 i_systime='$i_systime'
13131 i_systimek='$i_systimek'
13132 i_systimes='$i_systimes'
13133 i_systypes='$i_systypes'
13134 i_sysuio='$i_sysuio'
13136 i_syswait='$i_syswait'
13137 i_termio='$i_termio'
13138 i_termios='$i_termios'
13140 i_unistd='$i_unistd'
13142 i_values='$i_values'
13143 i_varargs='$i_varargs'
13144 i_varhdr='$i_varhdr'
13146 ignore_versioned_solibs='$ignore_versioned_solibs'
13149 installarchlib='$installarchlib'
13150 installbin='$installbin'
13151 installman1dir='$installman1dir'
13152 installman3dir='$installman3dir'
13153 installprivlib='$installprivlib'
13154 installscript='$installscript'
13155 installsitearch='$installsitearch'
13156 installsitelib='$installsitelib'
13157 installusrbinperl='$installusrbinperl'
13159 known_extensions='$known_extensions'
13163 lddlflags='$lddlflags'
13171 libswanted='$libswanted'
13177 locincpth='$locincpth'
13178 loclibpth='$loclibpth'
13179 longdblsize='$longdblsize'
13180 longlongsize='$longlongsize'
13181 longsize='$longsize'
13185 lseeksize='$lseeksize'
13186 lseektype='$lseektype'
13190 make_set_make='$make_set_make'
13191 mallocobj='$mallocobj'
13192 mallocsrc='$mallocsrc'
13193 malloctype='$malloctype'
13195 man1direxp='$man1direxp'
13198 man3direxp='$man3direxp'
13202 mips_type='$mips_type'
13204 mmaptype='$mmaptype'
13206 modetype='$modetype'
13208 multiarch='$multiarch'
13210 myarchname='$myarchname'
13211 mydomain='$mydomain'
13212 myhostname='$myhostname'
13215 netdb_hlen_type='$netdb_hlen_type'
13216 netdb_host_type='$netdb_host_type'
13217 netdb_name_type='$netdb_name_type'
13218 netdb_net_type='$netdb_net_type'
13221 nm_so_opt='$nm_so_opt'
13222 nonxs_ext='$nonxs_ext'
13224 o_nonblock='$o_nonblock'
13226 old_pthread_create_joinable='$old_pthread_create_joinable'
13227 optimize='$optimize'
13228 orderlib='$orderlib'
13234 patchlevel='$patchlevel'
13235 path_sep='$path_sep'
13237 perladmin='$perladmin'
13238 perlpath='$perlpath'
13240 phostname='$phostname'
13246 prefixexp='$prefixexp'
13248 privlibexp='$privlibexp'
13249 prototype='$prototype'
13251 randbits='$randbits'
13252 randfunc='$randfunc'
13253 randseedtype='$randseedtype'
13255 rd_nodata='$rd_nodata'
13259 sched_yield='$sched_yield'
13260 scriptdir='$scriptdir'
13261 scriptdirexp='$scriptdirexp'
13263 seedfunc='$seedfunc'
13264 selectminbits='$selectminbits'
13265 selecttype='$selecttype'
13266 sendmail='$sendmail'
13269 sharpbang='$sharpbang'
13270 shmattype='$shmattype'
13271 shortsize='$shortsize'
13274 sig_count='$sig_count'
13275 sig_name='$sig_name'
13276 sig_name_init='$sig_name_init'
13278 sig_num_init='$sig_num_init'
13279 signal_t='$signal_t'
13280 sitearch='$sitearch'
13281 sitearchexp='$sitearchexp'
13283 sitelibexp='$sitelibexp'
13284 sizetype='$sizetype'
13289 sockethdr='$sockethdr'
13290 socketlib='$socketlib'
13292 spackage='$spackage'
13293 spitshell='$spitshell'
13296 ssizetype='$ssizetype'
13297 startperl='$startperl'
13299 static_ext='$static_ext'
13301 stdio_base='$stdio_base'
13302 stdio_bufsiz='$stdio_bufsiz'
13303 stdio_cnt='$stdio_cnt'
13304 stdio_filbuf='$stdio_filbuf'
13305 stdio_ptr='$stdio_ptr'
13308 subversion='$subversion'
13315 timeincl='$timeincl'
13316 timetype='$timetype'
13324 use64bits='$use64bits'
13326 usemultiplicity='$usemultiplicity'
13327 usemymalloc='$usemymalloc'
13329 useopcode='$useopcode'
13330 useperlio='$useperlio'
13331 useposix='$useposix'
13333 useshrplib='$useshrplib'
13334 usethreads='$usethreads'
13335 usevfork='$usevfork'
13340 voidflags='$voidflags'
13346 : Add in command line options if available
13347 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
13349 : add special variables
13350 $test -f $src/patchlevel.h && \
13351 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
13352 echo "CONFIGDOTSH=true" >>config.sh
13354 : propagate old symbols
13355 if $test -f UU/config.sh; then
13356 <UU/config.sh sort | uniq >UU/oldconfig.sh
13357 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
13358 sort | uniq -u >UU/oldsyms
13359 set X `cat UU/oldsyms`
13365 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
13367 echo "# Variables propagated from previous config.sh file." >>config.sh
13368 for sym in `cat UU/oldsyms`; do
13369 echo " Propagating $hint variable "'$'"$sym..."
13370 eval 'tmp="$'"${sym}"'"'
13372 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
13378 : Finish up by extracting the .SH files
13392 If you'd like to make any changes to the config.sh file before I begin
13393 to configure things, do it as a shell escape now (e.g. !vi config.sh).
13396 rp="Press return or use a shell escape to edit config.sh:"
13401 *) : in case they cannot read
13402 sh 1>&4 -c "$ans";;
13407 : if this fails, just run all the .SH files by hand
13414 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
13421 Now you need to generate make dependencies by running "$make depend".
13422 You might prefer to run it in background: "$make depend > makedepend.out &"
13423 It can take a while, so you might not want to run it right now.
13428 rp="Run $make depend now?"
13432 $make depend && echo "Now you must run a $make."
13435 echo "You must run '$make depend' then '$make'."
13438 elif test -f [Mm]akefile; then
13440 echo "Now you must run a $make."
13445 if $test -f Policy.sh; then
13448 If you compile $package on a different machine or from a different object
13449 directory, copy the Policy.sh file from this object directory to the
13450 new one before you run Configure -- this will help you with most of
13451 the policy defaults.
13455 if $test -f config.msg; then
13456 echo "Hmm. I also noted the following information while running:"
13458 $cat config.msg >&4
13461 $rm -f kit*isdone ark*isdone