3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Sat Jan 15 23:59:51 EET 2000 [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
440 d_old_pthread_create_joinable=''
441 old_pthread_create_joinable=''
693 ignore_versioned_solibs=''
850 d_stdio_stream_array=''
851 stdio_stream_array=''
895 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
898 : We must find out about Eunice early
900 if test -f /etc/unixtovms; then
901 eunicefix=/etc/unixtovms
903 if test -f /etc/unixtovms.exe; then
904 eunicefix=/etc/unixtovms.exe
908 : list of known cpp symbols, sorted alphabetically
909 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
910 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
911 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
912 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
913 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
914 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
915 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
916 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
917 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
918 al="$al VMS Xenix286"
919 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
920 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
921 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
922 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
923 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
924 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
925 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
926 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
927 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
928 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
929 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
930 al="$al __SVR4_2__ __UMAXV__"
931 al="$al ____386BSD____ __alpha __alpha__ __amiga"
932 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
933 al="$al __host_mips__"
934 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
935 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
936 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
937 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
938 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
939 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
940 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
941 al="$al __mc88100 __mc88100__ __mips __mips__"
942 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
943 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
944 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
945 al="$al _host_mips _mips _unix"
946 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
947 al="$al apollo ardent att386 att3b"
948 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
949 al="$al cadmus clipper concurrent convex cray ctix"
950 al="$al dmert encore gcos gcx gimpel gould"
951 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
952 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
953 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
954 al="$al i186 i286 i386 i486 i8086"
955 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
956 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
957 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
958 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
959 al="$al mc88000 mc88100 merlin mert mips mvs n16"
960 al="$al ncl_el ncl_mr"
961 al="$al news1500 news1700 news1800 news1900 news3700"
962 al="$al news700 news800 news900 ns16000 ns32000"
963 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
964 al="$al parisc pc532 pdp11 plexus posix pyr"
965 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
966 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
967 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
968 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
969 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
970 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
973 : set useposix=false in your hint file to disable the POSIX extension.
975 : set useopcode=false in your hint file to disable the Opcode extension.
977 : Trailing extension. Override this in a hint file, if needed.
979 : Extra object files, if any, needed on this platform.
981 : Possible local include directories to search.
982 : Set locincpth to "" in a hint file to defeat local include searches.
983 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
984 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
986 : no include file wanted by default
990 : change the next line if compiling for Xenix/286 on Xenix/386
991 xlibpth='/usr/lib/386 /lib/386'
993 : Possible local library directories to search.
994 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
995 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
997 : general looking path for locating libraries
998 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
999 glibpth="$glibpth /lib /usr/lib $xlibpth"
1000 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
1001 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1003 : Private path used by Configure to find libraries. Its value
1004 : is prepended to libpth. This variable takes care of special
1005 : machines, like the mips. Usually, it should be empty.
1008 : default library list
1010 : some systems want to use only the non-versioned libso:s
1011 ignore_versioned_solibs=''
1012 : set usemultiplicity on the Configure command line to enable multiplicity.
1013 : set usesocks on the Configure command line to enable socks.
1014 : set usethreads on the Configure command line to enable threads.
1015 : full support for void wanted by default
1018 : List of libraries we want.
1019 : If anyone needs -lnet, put it in a hint file.
1020 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
1021 libswanted="$libswanted dld ld sun m c cposix posix"
1022 libswanted="$libswanted ndir dir crypt sec"
1023 libswanted="$libswanted ucb bsd BSD PW x"
1024 : We probably want to search /usr/shlib before most other libraries.
1025 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1026 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1027 glibpth="/usr/shlib $glibpth"
1028 : Do not use vfork unless overridden by a hint file.
1031 : Find the basic shell for Bourne shell scripts
1035 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1038 if test -f "$xxx"; then
1041 : Build up a list and do a single loop so we can 'break' out.
1042 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1043 for xxx in sh bash ksh pdksh ash; do
1045 try="$try ${p}/${xxx}"
1049 if test -f "$xxx"; then
1052 elif test -f "$xxx.exe"; then
1063 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1065 Usually it's in /bin/sh. How did you even get this far?
1066 Please contact me (Perl Maintainers) at perlbug@perl.com and
1067 we'll try to straighten this all out.
1073 : see if sh knows # comments
1074 if `$sh -c '#' >/dev/null 2>&1`; then
1078 test -f $xcat || xcat=/usr/bin/cat
1083 if test -s today; then
1086 echo "#! $xcat" > try
1090 if test -s today; then
1098 echo "Your $sh doesn't grok # comments--I will strip them later on."
1101 echo "exec grep -v '^[ ]*#'" >spitshell
1103 $eunicefix spitshell
1104 spitshell=`pwd`/spitshell
1106 echo "I presume that if # doesn't work, #! won't work either!"
1111 : figure out how to guarantee sh startup
1113 '') startsh=${sharpbang}${sh} ;;
1125 : echo "Yup, it does."
1127 echo "Hmm... '$startsh' does not guarantee sh startup..."
1128 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1133 : Save command line options in file UU/cmdline.opt for later use in
1134 : generating config.sh.
1135 cat > cmdline.opt <<EOSH
1136 # Configure command line arguments.
1143 cat >>cmdline.opt <<EOSH
1144 config_arg$argn='$arg'
1146 argn=`expr $argn + 1`
1149 : produce awk script to parse command line options
1150 cat >options.awk <<'EOF'
1152 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1154 len = length(optstr);
1155 for (i = 1; i <= len; i++) {
1156 c = substr(optstr, i, 1);
1157 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1168 if (substr(str, 1, 1) != "-") {
1169 printf("'%s'\n", str);
1173 for (i = 2; i <= len; i++) {
1174 c = substr(str, i, 1);
1176 printf("-%s\n", substr(str, i));
1182 printf("'%s'\n", substr(str, i + 1));
1195 : process the command line options
1196 set X `for arg in "$@"; do echo "X$arg"; done |
1197 sed -e s/X// | awk -f options.awk`
1202 : set up default values
1212 rm -f optdef.sh posthint.sh
1213 cat >optdef.sh <<EOS
1219 while test $# -gt 0; do
1221 -d) shift; fastread=yes;;
1222 -e) shift; alldone=cont;;
1226 if test -r "$1"; then
1229 echo "$me: cannot read config file $1." >&2
1234 -h) shift; error=true;;
1235 -r) shift; reuseval=true;;
1236 -s) shift; silent=true; realsilent=true;;
1237 -E) shift; alldone=exit;;
1238 -K) shift; knowitall=true;;
1239 -O) shift; override=true;;
1240 -S) shift; silent=true; extractsh=true;;
1245 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1246 echo "$me: ignoring -D $1" >&2
1249 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1250 *) echo "$1='define'" >> optdef.sh;;
1257 *=) echo "$1" >> optdef.sh;;
1259 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1260 echo "$me: ignoring -U $1" >&2
1262 *) echo "$1='undef'" >> optdef.sh;;
1273 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1277 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1278 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1284 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1285 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1286 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1287 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1288 *) xxx=`echo $yyy|sed 's!:.*!!'`
1289 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1295 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1297 echo "$yyy=''" >> posthint.sh ;;
1302 echo "$yyy='$zzz'" >> posthint.sh ;;
1304 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1306 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1311 echo "$yyy=$zzz" >> posthint.sh ;;
1312 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1315 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1318 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1326 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1327 [-U symbol] [-U symbol=] [-A command:symbol...]
1328 -d : use defaults for all answers.
1329 -e : go on without questioning past the production of config.sh.
1330 -f : specify an alternate default configuration file.
1331 -h : print this help message and exit (with an error status).
1332 -r : reuse C symbols value if possible (skips costly nm extraction).
1333 -s : silent mode, only echoes questions and essential information.
1334 -D : define symbol to have some value:
1335 -D symbol symbol gets the value 'define'
1336 -D symbol=value symbol gets the value 'value'
1337 -E : stop at the end of questions, after having produced config.sh.
1338 -K : do not use unless you know what you are doing.
1339 -O : let -D and -U override definitions from loaded configuration file.
1340 -S : perform variable substitutions on all .SH files (can mix with -f)
1341 -U : undefine symbol:
1342 -U symbol symbol gets the value 'undef'
1343 -U symbol= symbol gets completely empty
1344 -A : manipulate symbol after the platform specific hints have been applied:
1345 -A symbol=value append " "value to symbol
1346 -A append:symbol=value append value to symbol
1347 -A define:symbol=value define symbol to have value
1348 -A clear:symbol define symbol to be ''
1349 -A define:symbol define symbol to be 'define'
1350 -A eval:symbol=value define symbol to be eval of value
1351 -A prepend:symbol=value prepend value to symbol
1352 -A undef:symbol define symbol to be 'undef'
1353 -A undef:symbol= define symbol to be ''
1354 -V : print version number and exit (with a zero status).
1361 case "$fastread$alldone" in
1364 if test ! -t 0; then
1365 echo "Say 'sh Configure', not 'sh <Configure'"
1373 true) exec 1>/dev/null;;
1376 : run the defines and the undefines, if any, but leave the file out there...
1379 : create the posthint manipulation script and leave the file out there...
1384 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1385 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1386 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1387 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1388 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1391 : Some greps do not return status, grrr.
1392 echo "grimblepritz" >grimble
1393 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1395 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1401 : the following should work in any shell
1405 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1406 cat >contains <<'EOSS'
1407 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1412 : Find the path to the source tree
1415 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1418 *) src=`cd ../$src && pwd` ;;
1431 if test -f $rsrc/Configure && \
1432 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1434 : found it, so we are ok.
1437 for src in . .. ../.. ../../.. ../../../..; do
1438 if test -f ../$src/Configure && \
1439 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1450 Sorry, I can't seem to locate the source dir for $package. Please start
1451 Configure with an explicit path -- i.e. /some/path/Configure.
1459 echo "Sources for $package found in \"$src\"." >&4
1463 : script used to extract .SH files with variable substitutions
1464 cat >extract <<'EOS'
1466 echo "Doing variable substitutions on .SH files..."
1467 if test -f $src/MANIFEST; then
1468 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1470 echo "(Looking for .SH files under the source directory.)"
1471 set x `(cd $src; find . -name "*.SH" -print)`
1475 0) set x `(cd $src; echo *.SH)`; shift;;
1477 if test ! -f $src/$1; then
1483 while test $name; do
1484 if test ! -d "$name"; then
1485 create="$name $create";
1486 name=`echo $name | sed -e "s|^[^/]*$||"`;
1487 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1492 for file in $create; do
1501 dir=`expr X$file : 'X\(.*\)/'`
1502 file=`expr X$file : 'X.*/\(.*\)'`
1503 (cd $dir && . ./$file)
1513 dir=`expr X$file : 'X\(.*\)/'`
1514 file=`expr X$file : 'X.*/\(.*\)'`
1515 (set x $dir; shift; eval $mkdir_p)
1525 if test -f $src/config_h.SH; then
1526 if test ! -f config.h; then
1527 : oops, they left it out of MANIFEST, probably, so do it anyway.
1533 : extract files and exit if asked to do so
1534 case "$extractsh" in
1536 case "$realsilent" in
1540 case "$config_sh" in
1541 '') config_sh='config.sh';;
1544 echo "Fetching answers from $config_sh..."
1547 test "$override" && . ./optdef.sh
1556 : Eunice requires " " instead of "", can you believe it
1559 echo "Beginning of configuration questions for $package."
1561 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1563 : first determine how to suppress newline on echo command
1565 echo "Checking echo to see how to suppress newlines..."
1566 (echo "hi there\c" ; echo " ") >.echotmp
1567 if $contains c .echotmp >/dev/null 2>&1 ; then
1578 echo $n "The star should be here-->$c"
1582 : Now test for existence of everything in MANIFEST
1584 if test -f $rsrc/MANIFEST; then
1585 echo "First let's make sure your kit is complete. Checking..." >&4
1586 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1589 for filelist in x??; do
1590 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1592 if test -s missing; then
1596 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1598 You have the option of continuing the configuration process, despite the
1599 distinct possibility that your kit is damaged, by typing 'y'es. If you
1600 do, don't blame me if something goes wrong. I advise you to type 'n'o
1601 and contact the author (perlbug@perl.com).
1604 echo $n "Continue? [n] $c" >&4
1608 echo "Continuing..." >&4
1612 echo "ABORTING..." >&4
1617 echo "Looks good..."
1620 echo "There is no MANIFEST file. I hope your kit is complete !"
1625 : Find the appropriate value for a newline for tr
1626 if test -n "$DJGPP"; then
1629 if test X"$trnl" = X; then
1630 case "`echo foo|tr '\n' x 2>/dev/null`" in
1634 if test X"$trnl" = X; then
1635 case "`echo foo|tr '\012' x 2>/dev/null`" in
1636 foox) trnl='\012' ;;
1639 if test X"$trnl" = X; then
1642 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1648 : compute the number of columns on the terminal for proper question formatting
1653 : set up the echo used in my read
1654 myecho="case \"\$xxxm\" in
1655 '') echo $n \"\$rp $c\" >&4;;
1657 '') echo $n \"[\$xxxm] $c\";;
1659 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1661 echo $n \"[\$xxxm] $c\" >&4
1663 echo $n \"\$rp [\$xxxm] $c\" >&4
1669 : now set up to do reads with possible shell escape and default assignment
1675 case "\$fastread" in
1676 yes) case "\$dflt" in
1679 case "\$silent-\$rp" in
1684 *) case "\$silent" in
1685 true) case "\$rp" in
1690 while expr "X\$ans" : "X!" >/dev/null; do
1694 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1702 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1711 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1716 echo "(OK, I'll run with -d after this question.)" >&4
1719 echo "*** Sorry, \$1 not supported yet." >&4
1729 echo "*** Substitution done -- please confirm."
1731 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1736 echo "*** Error -- try again."
1743 case "\$ans\$xxxm\$nostick" in
1755 : create .config dir to save info across Configure sessions
1756 test -d ../.config || mkdir ../.config
1757 cat >../.config/README <<EOF
1758 This directory created by Configure to save information that should
1759 persist across sessions for $package.
1761 You may safely delete it if you wish.
1764 : general instructions
1767 user=`(logname) 2>/dev/null`
1769 '') user=`whoami 2>&1`;;
1771 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1774 rp='Would you like to see the instructions?'
1785 This installation shell script will examine your system and ask you questions
1786 to determine how the perl5 package should be installed. If you get
1787 stuck on a question, you may use a ! shell escape to start a subshell or
1788 execute a command. Many of the questions will have default answers in square
1789 brackets; typing carriage return will give you the default.
1791 On some of the questions which ask for file or directory names you are allowed
1792 to use the ~name construct to specify the login directory belonging to "name",
1793 even if you don't have a shell which knows about that. Questions where this is
1794 allowed will be marked "(~name ok)".
1798 dflt='Type carriage return to continue'
1802 The prompter used in this script allows you to use shell variables and
1803 backticks in your answers. You may use $1, $2, etc... to refer to the words
1804 in the default answer, as if the default line was a set of arguments given to a
1805 script shell. This means you may also use $* to repeat the whole default line,
1806 so you do not have to re-type everything to add something to the default.
1808 Everytime there is a substitution, you will have to confirm. If there is an
1809 error (e.g. an unmatched backtick), the default answer will remain unchanged
1810 and you will be prompted again.
1812 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1813 the questions and use the computed defaults (or the previous answers if there
1814 was already a config.sh file). Type 'Configure -h' for a list of options.
1815 You may also start interactively and then answer '& -d' at any prompt to turn
1816 on the non-interactive behaviour for the remainder of the execution.
1822 Much effort has been expended to ensure that this shell script will run on any
1823 Unix system. If despite that it blows up on yours, your best bet is to edit
1824 Configure and run it again. If you can't run Configure for some reason,
1825 you'll have to generate a config.sh file by hand. Whatever problems you
1826 have, let me (perlbug@perl.com) know how I blew it.
1828 This installation script affects things in two ways:
1830 1) it may do direct variable substitutions on some of the files included
1832 2) it builds a config.h file for inclusion in C programs. You may edit
1833 any of these files as the need arises after running this script.
1835 If you make a mistake on a question, there is no easy way to back up to it
1836 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1837 files. Configure will offer to let you do this before it runs the SH files.
1840 dflt='Type carriage return to continue'
1842 case "$firsttime" in
1843 true) echo $user >>../.config/instruct;;
1847 : find out where common programs are
1849 echo "Locating common programs..." >&4
1862 if test -d \$dir/\$thing; then
1868 for thisthing in \$dir/\$thing; do
1869 : just loop through to pick last item
1871 if test -f \$thisthing; then
1874 elif test -f \$dir/\$thing.exe; then
1875 if test -n "$DJGPP"; then
1876 echo \$dir/\$thing.exe
1878 : on Eunice apparently
1929 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1930 pth="$pth /lib /usr/lib"
1931 for file in $loclist; do
1935 if test -f "$xxx"; then
1938 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1939 xxx=`./loc $file $file $pth`
1942 '') xxx=`./loc $file $file $pth`;;
1943 *) xxx=`./loc $xxx $xxx $pth`;;
1949 echo $file is in $xxx.
1952 echo $file is in $xxx.
1955 echo "I don't know where '$file' is, and my life depends on it." >&4
1956 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1962 echo "Don't worry if any of the following aren't found..."
1964 for file in $trylist; do
1968 if test -f "$xxx"; then
1971 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1972 xxx=`./loc $file $file $pth`
1975 '') xxx=`./loc $file $file $pth`;;
1976 *) xxx=`./loc $xxx $xxx $pth`;;
1982 echo $file is in $xxx.
1985 echo $file is in $xxx.
1988 echo "I don't see $file out there, $say."
1995 echo "Substituting grep for egrep."
2001 echo "Substituting cp for ln."
2007 echo "Hopefully test is built into your sh."
2010 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2011 echo "Using the test built into your sh."
2019 echo "Hopefully echo is built into your sh."
2024 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2025 $echo $n "hi there$c" >foo1
2026 echo $n "hi there$c" >foo2
2027 if cmp foo1 foo2 >/dev/null 2>&1; then
2028 echo "They are compatible. In fact, they may be identical."
2035 They are not compatible! You are probably running ksh on a non-USG system.
2036 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2037 have echo built in and we may have to run some Bourne shell scripts. That
2038 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2041 $echo $n "The star should be here-->$c"
2048 : determine whether symbolic links are supported
2051 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2052 echo "Symbolic links are supported." >&4
2055 echo "Symbolic links are NOT supported." >&4
2060 : see whether [:lower:] and [:upper:] are supported character classes
2062 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2064 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2068 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2069 # (0xc9 and 0xd1), therefore that is a nice testing point.
2070 if test "X$up" = X -o "X$low" = X; then
2071 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2077 if test "X$up" = X -o "X$low" = X; then
2078 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2084 if test "X$up" = X -o "X$low" = X; then
2085 case "`echo IJ | od -x 2>/dev/null`" in
2087 echo "Hey, this might be EBCDIC." >&4
2088 if test "X$up" = X -o "X$low" = X; then
2089 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2090 ij) up='[A-IJ-RS-Z]'
2095 if test "X$up" = X -o "X$low" = X; then
2096 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2106 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2108 echo "Using $up and $low to convert case." >&4
2111 echo "I don't know how to translate letters from upper to lower case." >&4
2112 echo "Your tr is not acting any way I know of." >&4
2116 : set up the translation script tr, must be called with ./tr of course
2120 '[A-Z][a-z]') exec $tr '$up' '$low';;
2121 '[a-z][A-Z]') exec $tr '$low' '$up';;
2128 : Try to determine whether config.sh was made on this system
2129 case "$config_sh" in
2131 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2132 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2133 # because the A-Z/a-z are not consecutive.
2134 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2135 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2136 newmyuname="$myuname"
2138 case "$knowitall" in
2140 if test -f ../config.sh; then
2141 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2142 eval "`grep myuname= ../config.sh`"
2144 if test "X$myuname" = "X$newmyuname"; then
2152 : Get old answers from old config file if Configure was run on the
2153 : same system, otherwise use the hints.
2156 if test -f config.sh; then
2158 rp="I see a config.sh file. Shall I use it to set the defaults?"
2161 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2162 *) echo "Fetching default answers from your old config.sh file..." >&4
2170 : Older versions did not always set $sh. Catch re-use of such
2179 if test ! -f config.sh; then
2182 First time through, eh? I have some defaults handy for some systems
2183 that need some extra help getting the Configure answers right:
2186 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2188 : Half the following guesses are probably wrong... If you have better
2189 : tests or hints, please send them to perlbug@perl.com
2190 : The metaconfig authors would also appreciate a copy...
2191 $test -f /irix && osname=irix
2192 $test -f /xenix && osname=sco_xenix
2193 $test -f /dynix && osname=dynix
2194 $test -f /dnix && osname=dnix
2195 $test -f /lynx.os && osname=lynxos
2196 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2197 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2198 $test -f /bin/mips && /bin/mips && osname=mips
2199 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2200 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2201 $test -d /usr/apollo/bin && osname=apollo
2202 $test -f /etc/saf/_sactab && osname=svr4
2203 $test -d /usr/include/minix && osname=minix
2204 if $test -d /MachTen -o -d /MachTen_Folder; then
2206 if $test -x /sbin/version; then
2207 osvers=`/sbin/version | $awk '{print $2}' |
2208 $sed -e 's/[A-Za-z]$//'`
2209 elif $test -x /usr/etc/version; then
2210 osvers=`/usr/etc/version | $awk '{print $2}' |
2211 $sed -e 's/[A-Za-z]$//'`
2217 $test -f /sys/posix.dll &&
2218 $test -f /usr/bin/what &&
2219 set X `/usr/bin/what /sys/posix.dll` &&
2220 $test "$3" = UWIN &&
2224 if $test -f $uname; then
2232 umips) osname=umips ;;
2235 [23]100) osname=mips ;;
2236 next*) osname=next ;;
2238 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2239 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2242 elif $test -f /etc/kconfig; then
2244 if test "$lns" = "$ln -s"; then
2246 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2248 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2255 if test -n "$DJGPP"; then
2264 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2266 'not found') osvers="$4"."$3" ;;
2267 '<3240'|'<>3240') osvers=3.2.0 ;;
2268 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2269 '=3250'|'>3250') osvers=3.2.5 ;;
2273 bsd386) osname=bsd386
2276 cygwin*) osname=cygwin
2279 *dc.osx) osname=dcosx
2285 domainos) osname=apollo
2291 dynixptx*) osname=dynixptx
2292 osvers=`echo "$4"|sed 's/^v//'`
2294 freebsd) osname=freebsd
2296 genix) osname=genix ;;
2298 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2314 netbsd*) osname=netbsd
2317 news-os) osvers="$3"
2319 4*) osname=newsos4 ;;
2323 next*) osname=next ;;
2324 POSIX-BC | posix-bc ) osname=posix-bc
2327 powerux | power_ux | powermax_os | powermaxos | \
2328 powerunix | power_unix) osname=powerux
2334 solaris) osname=solaris
2336 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2343 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2347 titanos) osname=titanos
2356 ultrix) osname=ultrix
2359 osf1|mls+) case "$5" in
2362 osvers=`echo "$3" | sed 's/^[xvt]//'`
2364 hp*) osname=hp_osf1 ;;
2365 mips) osname=mips_osf1 ;;
2368 unixware) osname=svr5
2374 $2) case "$osname" in
2378 : svr4.x or possibly later
2388 if test -f /stand/boot ; then
2389 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2390 if test -n "$INITPROG" -a -f "$INITPROG"; then
2391 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2392 if test -n "$isesix"; then
2400 *) if test -f /etc/systemid; then
2402 set `echo $3 | $sed 's/\./ /g'` $4
2403 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2405 elif $test -f $src/hints/sco_$1_$2.sh; then
2407 elif $test -f $src/hints/sco_$1.sh; then
2412 '') : Still unknown. Probably a generic Sys V.
2421 *) case "$osname" in
2422 '') : Still unknown. Probably a generic BSD.
2430 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2431 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2432 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2435 $rm -f UU/kernel.what
2436 elif test -d c:/.; then
2443 : Now look for a hint file osname_osvers, unless one has been
2444 : specified already.
2447 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2448 : Also try without trailing minor version numbers.
2449 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2450 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2451 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2452 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2455 *) case "$osvers" in
2458 *) if $test -f $src/hints/$file.sh ; then
2460 elif $test -f $src/hints/$xfile.sh ; then
2462 elif $test -f $src/hints/$xxfile.sh ; then
2464 elif $test -f $src/hints/$xxxfile.sh ; then
2466 elif $test -f $src/hints/$xxxxfile.sh ; then
2468 elif $test -f "$src/hints/${osname}.sh" ; then
2477 if $test -f Policy.sh ; then
2480 none) dflt="Policy" ;;
2481 *) dflt="Policy $dflt" ;;
2486 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2490 if $test -f Policy.sh ; then
2493 There's also a Policy hint file available, which should make the
2494 site-specific (policy) questions easier to answer.
2501 You may give one or more space-separated answers, or "none" if appropriate.
2502 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2503 is a good thing. DO NOT give a wrong version or a wrong OS.
2507 rp="Which of these apply, if any?"
2510 for file in $tans; do
2511 if $test X$file = XPolicy -a -f Policy.sh; then
2513 $cat Policy.sh >> UU/config.sh
2514 elif $test -f $src/hints/$file.sh; then
2515 . $src/hints/$file.sh
2516 $cat $src/hints/$file.sh >> UU/config.sh
2517 elif $test X$tans = X -o X$tans = Xnone ; then
2520 : Give one chance to correct a possible typo.
2521 echo "$file.sh does not exist"
2523 rp="hint to use instead?"
2525 for file in $ans; do
2526 if $test -f "$src/hints/$file.sh"; then
2527 . $src/hints/$file.sh
2528 $cat $src/hints/$file.sh >> UU/config.sh
2529 elif $test X$ans = X -o X$ans = Xnone ; then
2532 echo "$file.sh does not exist -- ignored."
2539 : Remember our hint file for later.
2540 if $test -f "$src/hints/$file.sh" ; then
2550 echo "Fetching default answers from $config_sh..." >&4
2554 cp $config_sh config.sh 2>/dev/null
2564 test "$override" && . ./optdef.sh
2565 myuname="$newmyuname"
2567 : Restore computed paths
2568 for file in $loclist $trylist; do
2569 eval $file="\$_$file"
2574 Configure uses the operating system name and version to set some defaults.
2575 The default value is probably right if the name rings a bell. Otherwise,
2576 since spelling matters for me, either accept the default or answer "none"
2583 ''|' '|none) dflt=none ;;
2584 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2587 *) dflt="$osname" ;;
2589 rp="Operating system name?"
2593 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2599 ''|' '|none) dflt=none ;;
2600 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2601 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2603 ''|' ') dflt=none ;;
2608 *) dflt="$osvers" ;;
2610 rp="Operating system version?"
2620 : who configured the system
2621 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2622 cf_by=`(logname) 2>/dev/null`
2625 cf_by=`(whoami) 2>/dev/null`
2627 "") cf_by=unknown ;;
2631 : set up the script used to warn in case of inconsistency
2638 echo "*** WHOA THERE!!! ***" >&4
2639 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2640 rp=" Keep the $hint value?"
2643 y) td=$was; tu=$was;;
2647 : function used to set $1 to $val
2648 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2650 $define$undef) . ./whoa; eval "$var=\$td";;
2651 $undef$define) . ./whoa; eval "$var=\$tu";;
2652 *) eval "$var=$val";;
2657 Perl can be built to take advantage of threads, on some systems.
2658 To do so, Configure must be run with -Dusethreads.
2660 Note that threading is a highly experimental feature, and
2661 some known race conditions still remain. If you choose to try
2662 it, be very sure to not actually deploy it for production
2663 purposes. README.threads has more details, and is required
2664 reading if you enable threads.
2666 case "$usethreads" in
2667 $define|true|[yY]*) dflt='y';;
2670 rp='Build a threading Perl?'
2673 y|Y) val="$define" ;;
2679 case "$usethreads" in
2683 As of 5.5.640, Perl has two different internal threading implementations,
2684 the 5.005 version (5005threads) and an interpreter-based version
2685 (ithreads) that has one interpreter per thread. Both are very
2686 experimental. This arrangement exists to help developers work out
2687 which one is better.
2689 : Default to ithreads unless overridden on command line or with
2692 case "$use5005threads" in
2693 $define|true|[yY]*) dflt='n';;
2695 case "$useithreads" in
2696 $undef|false|[nN]*) dflt='n';;
2698 rp='Use interpreter-based ithreads?'
2701 y|Y) val="$define" ;;
2706 : Now set use5005threads to the opposite value.
2707 case "$useithreads" in
2708 $define) val="$undef" ;;
2715 useithreads="$undef"
2716 use5005threads="$undef"
2720 case "$d_oldpthreads" in
2721 '') : Configure tests would be welcome here. For now, assume undef.
2723 *) val="$d_oldpthreads" ;;
2729 case "$usethreads" in
2730 "$define"|true|[yY]*)
2731 : Look for a hint-file generated 'call-back-unit'. If the
2732 : user has specified that a threading perl is to be built,
2733 : we may need to set or change some other defaults.
2734 if $test -f usethreads.cbu; then
2735 echo "Your platform has some specific hints for threaded builds, using them..."
2739 (Your platform doesn't have any specific hints for threaded builds.
2740 Assuming POSIX threads, then.)
2748 Perl can be built so that multiple Perl interpreters can coexist
2749 within the same Perl executable.
2752 case "$useithreads" in
2755 This multiple interpreter support is required for interpreter-based threads.
2760 echo 'Normally you do not need this and you should answer no.'
2761 case "$usemultiplicity" in
2762 $define|true|[yY]*) dflt='y';;
2765 rp='Build Perl for multiplicity?'
2768 y|Y) val="$define" ;;
2776 : determine where manual pages are on this system
2780 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2781 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2782 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2783 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2784 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2785 sysman=`./loc . /usr/man/man1 $syspath`
2788 if $test -d "$sysman"; then
2789 echo "System manual is in $sysman." >&4
2791 echo "Could not find manual pages in source form." >&4
2794 : see what memory models we can support
2797 $cat >pdp11.c <<'EOP'
2806 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2807 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2808 dflt='unsplit split'
2810 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2813 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2818 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2821 if $test -d /lib/large || $test -d /usr/lib/large; then
2824 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2833 Some systems have different model sizes. On most systems they are called
2834 small, medium, large, and huge. On the PDP11 they are called unsplit and
2835 split. If your system doesn't support different memory models, say "none".
2836 If you wish to force everything to one memory model, say "none" here and
2837 put the appropriate flags later when it asks you for other cc and ld flags.
2838 Venix systems may wish to put "none" and let the compiler figure things out.
2839 (In the following question multiple model names should be space separated.)
2841 The default for most systems is "none".
2844 rp="Which memory models are supported?"
2859 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2860 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2867 rp="What flag indicates separate I and D space?"
2875 *large*|*small*|*medium*|*huge*)
2882 rp="What flag indicates large model?"
2892 *huge*) case "$huge" in
2896 rp="What flag indicates huge model?"
2906 *medium*) case "$medium" in
2910 rp="What flag indicates medium model?"
2917 *) medium="$large";;
2920 *small*) case "$small" in
2924 rp="What flag indicates small model?"
2935 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2938 $rm -f pdp11.* pdp11
2940 : make some quick guesses about what we are up against
2942 $echo $n "Hmm... $c"
2952 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2953 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2955 echo "Looks kind of like an OSF/1 system, but we'll see..."
2957 elif test `echo abc | tr a-z A-Z` = Abc ; then
2958 xxx=`./loc addbib blurfl $pth`
2959 if $test -f $xxx; then
2960 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2964 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2965 echo "Looks kind of like an extended USG system, but we'll see..."
2967 echo "Looks kind of like a USG system, but we'll see..."
2971 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2972 echo "Looks kind of like a BSD system, but we'll see..."
2976 echo "Looks kind of like a Version 7 system, but we'll see..."
2979 case "$eunicefix" in
2982 There is, however, a strange, musty smell in the air that reminds me of
2983 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2987 : it so happens the Eunice I know will not run shell scripts in Unix format
2991 echo "Congratulations. You aren't running Eunice."
2995 : Detect OS2. The p_ variable is set above in the Head.U unit.
3000 I have the feeling something is not exactly right, however...don't tell me...
3001 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3006 if test -f /xenix; then
3007 echo "Actually, this looks more like a XENIX system..."
3012 echo "It's not Xenix..."
3017 if test -f /venix; then
3018 echo "Actually, this looks more like a VENIX system..."
3025 echo "Nor is it Venix..."
3028 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3029 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3032 : see if we need a special compiler
3040 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3041 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3055 On some older systems the default C compiler will not resolve multiple global
3056 references that happen to have the same name. On some such systems the "Mcc"
3057 command may be used to force these to be resolved. On other systems a "cc -M"
3058 command is required. (Note that the -M flag on other systems indicates a
3059 memory model to use!) If you have the Gnu C compiler, you might wish to use
3065 rp="Use which C compiler?"
3073 rp="Use which C compiler?"
3077 : Look for a hint-file generated 'call-back-unit'. Now that the
3078 : user has specified the compiler, we may need to set or change some
3080 if $test -f cc.cbu; then
3084 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3085 $cat >gccvers.c <<EOM
3090 printf("%s\n", __VERSION__);
3092 printf("%s\n", "1");
3098 if $cc -o gccvers gccvers.c; then
3099 gccversion=`./gccvers`
3100 case "$gccversion" in
3101 '') echo "You are not using GNU cc." ;;
3102 *) echo "You are using GNU cc $gccversion." ;;
3106 echo "*** WHOA THERE!!! ***" >&4
3107 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3108 case "$knowitall" in
3110 echo " You'd better start hunting for one and let me know about it." >&4
3116 case "$gccversion" in
3117 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3120 : see how we invoke the C preprocessor
3122 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3123 cat <<'EOT' >testcpp.c
3129 if test ! -f cppstdin; then
3130 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3131 # AIX cc -E doesn't show the absolute headerfile
3132 # locations but we'll cheat by using the -M flag.
3133 echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
3135 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3138 echo "Keeping your $hint cppstdin wrapper."
3141 wrapper=`pwd`/cppstdin
3145 if $test "X$cppstdin" != "X" && \
3146 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3147 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3149 echo "You used to use $cppstdin $cppminus so we'll use that again."
3151 '') echo "But let's see if we can live without a wrapper..." ;;
3153 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3154 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3156 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3159 echo "(However, $cpprun $cpplast does not work, let's see...)"
3167 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3174 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3175 $cc -E <testcpp.c >testcpp.out 2>&1; \
3176 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3177 echo "Yup, it does."
3180 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3181 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3182 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3183 echo "Yup, it does."
3186 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3187 $cc -P <testcpp.c >testcpp.out 2>&1; \
3188 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3189 echo "Yipee, that works!"
3192 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3193 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3194 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3195 echo "At long last!"
3198 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3199 $cpp <testcpp.c >testcpp.out 2>&1; \
3200 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3204 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3205 $cpp - <testcpp.c >testcpp.out 2>&1; \
3206 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3207 echo "Hooray, it works! I was beginning to wonder."
3210 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3211 $wrapper <testcpp.c >testcpp.out 2>&1; \
3212 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3218 rp="No dice. I can't find a C preprocessor. Name one:"
3222 $x_cpp <testcpp.c >testcpp.out 2>&1
3223 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3224 echo "OK, that will do." >&4
3226 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3241 echo "Perhaps can we force $cc -E using a wrapper..."
3242 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3243 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3249 echo "Nope, we'll have to live without it..."
3263 "$wrapper"|'cppstdin') ;;
3264 *) $rm -f $wrapper;;
3266 $rm -f testcpp.c testcpp.out
3268 : decide how portable to be. Allow command line overrides.
3269 case "$d_portable" in
3271 *) d_portable="$define" ;;
3274 : set up shell script to do ~ expansion
3280 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3283 if $test -f /bin/csh; then
3284 /bin/csh -f -c "glob \$1"
3289 name=\`$expr x\$1 : '..\([^/]*\)'\`
3290 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3291 if $test ! -d "\$dir"; then
3293 echo "\$me: can't locate home directory for: \$name" >&2
3298 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3314 : now set up to get a file name
3318 cat <<'EOSC' >>getfile
3334 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3335 fn=`echo $fn | sed 's/(.*)//'`
3341 loc_file=`expr $fn : '.*:\(.*\)'`
3342 fn=`expr $fn : '\(.*\):.*'`
3350 */*) fullpath=true;;
3359 *e*) exp_file=true;;
3362 *p*) nopath_ok=true;;
3367 *d*) type='Directory';;
3368 *l*) type='Locate';;
3373 Locate) what='File';;
3378 case "$d_portable" in
3386 while test "$type"; do
3391 true) rp="$rp (~name ok)";;
3394 if test -f UU/getfile.ok && \
3395 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3414 value=`UU/filexp $ans`
3417 if test "$ans" != "$value"; then
3418 echo "(That expands to $value on this system.)"
3432 /*) value="$ansexp" ;;
3437 echo "I shall only accept a full path name, as in /bin/ls." >&4
3438 echo "Use a ! shell escape if you wish to check pathnames." >&4
3441 echo "Please give a full path name, starting with slash." >&4
3444 echo "Note that using ~name is ok provided it expands well." >&4
3457 for fp in $gfpth; do
3458 if test "X$fp" = X.; then
3463 if test -f "$pf"; then
3465 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3467 echo "($value is not a plain file, but that's ok.)"
3470 if test X"$type" = X; then
3477 for fp in $gfpth; do
3478 if test "X$fp" = X.; then
3483 if test -d "$pf"; then
3491 if test -d "$ansexp"; then
3492 echo "(Looking for $loc_file in directory $value.)"
3493 value="$value/$loc_file"
3494 ansexp="$ansexp/$loc_file"
3496 if test -f "$ansexp"; then
3499 case "$nopath_ok" in
3500 true) case "$value" in
3502 *) echo "Assuming $value will be in people's path."
3518 if test "$fastread" = yes; then
3523 rp="$what $value doesn't exist. Use that name anyway?"
3542 test "X$gfpthkeep" != Xy && gfpth=""
3545 : What should the include directory be ?
3547 $echo $n "Hmm... $c"
3551 if $test -f /bin/mips && /bin/mips; then
3552 echo "Looks like a MIPS system..."
3553 $cat >usr.c <<'EOCP'
3554 #ifdef SYSTYPE_BSD43
3558 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3559 dflt='/bsd43/usr/include'
3563 mips_type='System V'
3565 $rm -f usr.c usr.out
3566 echo "and you're compiling with the $mips_type compiler and libraries."
3570 echo "Doesn't look like a MIPS system."
3580 case "$xxx_prompt" in
3583 rp='Where are the include files you want to use?'
3591 : Set private lib path
3594 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3599 '') dlist="$loclibpth $plibpth $glibpth";;
3600 *) dlist="$libpth";;
3603 : Now check and see which directories actually exist, avoiding duplicates
3607 if $test -d $xxx; then
3610 *) libpth="$libpth $xxx";;
3616 Some systems have incompatible or broken versions of libraries. Among
3617 the directories listed in the question below, please remove any you
3618 know not to be holding relevant libraries, and add any that are needed.
3619 Say "none" for none.
3630 rp="Directories to use for library searches?"
3637 : compute shared library extension
3640 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3650 On some systems, shared libraries may be available. Answer 'none' if
3651 you want to suppress searching of shared libraries for the remaining
3652 of this configuration.
3655 rp='What is the file extension used for shared libraries?'
3659 : Define several unixisms.
3660 : Hints files or command line option can be used to override them.
3661 : The convoluted testing is in case hints files set either the old
3664 '') case "$exe_ext" in
3666 *) _exe="$exe_ext" ;;
3671 '') case "$lib_ext" in
3678 '') case "$obj_ext" in
3685 '') case "$path_sep" in
3696 : Which makefile gets called first. This is used by make depend.
3697 case "$firstmakefile" in
3698 '') firstmakefile='makefile';;
3703 Perl can be built to use the SOCKS proxy protocol library. To do so,
3704 Configure must be run with -Dusesocks.
3706 Normally you do not need this and you should answer no.
3710 $define|true|[yY]*) dflt='y';;
3713 rp='Build Perl for SOCKS?'
3716 y|Y) val="$define" ;;
3722 : Looking for optional libraries
3724 echo "Checking for optional libraries..." >&4
3729 case "$libswanted" in
3730 '') libswanted='c_s';;
3734 libswanted="$libswanted socks5 socks5_sh"
3737 for thislib in $libswanted; do
3739 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3740 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3741 echo "Found -l$thislib (shared)."
3744 *) dflt="$dflt -l$thislib";;
3746 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3747 echo "Found -l$thislib (shared)."
3750 *) dflt="$dflt -l$thislib";;
3752 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3753 echo "Found -l$thislib."
3756 *) dflt="$dflt -l$thislib";;
3758 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3759 echo "Found -l$thislib."
3762 *) dflt="$dflt -l$thislib";;
3764 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3765 echo "Found -l${thislib}_s."
3768 *) dflt="$dflt -l${thislib}_s";;
3770 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3771 echo "Found -l$thislib."
3774 *) dflt="$dflt -l$thislib";;
3777 echo "No -l$thislib."
3788 ' '|'') dflt='none';;
3793 In order to compile $package on your machine, a number of libraries
3794 are usually needed. Include any other special libraries here as well.
3795 Say "none" for none. The default list is almost always right.
3799 rp="What libraries to use?"
3806 : determine optimization, if desired, or use for debug flag also
3808 ' '|$undef) dflt='none';;
3810 *) dflt="$optimize";;
3814 By default, $package compiles with the -O flag to use the optimizer.
3815 Alternately, you might want to use the symbolic debugger, which uses
3816 the -g flag (on traditional Unix systems). Either flag can be
3817 specified here. To use neither flag, specify the word "none".
3820 rp="What optimizer/debugger flag should be used?"
3824 'none') optimize=" ";;
3828 : We will not override a previous value, but we might want to
3829 : augment a hint file
3831 default|recommended)
3832 case "$gccversion" in
3833 1*) dflt='-fpcc-struct-return' ;;
3836 *-g*) dflt="$dflt -DDEBUGGING";;
3838 case "$gccversion" in
3839 2*) if test -d /etc/conf/kconfig.d &&
3840 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3846 case "$gccversion" in
3850 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3851 echo 'int main(void) { return 0; }' > gcctest.c
3852 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3853 echo "Yes, it does." 2>&1
3856 echo "Leaving current flags $ccflags alone." 2>&1
3858 *) dflt="$dflt -fno-strict-aliasing" ;;
3861 echo "Nope, it doesn't, but that's ok." 2>&1
3868 case "$mips_type" in
3869 *BSD*|'') inclwanted="$locincpth $usrinc";;
3870 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3872 for thisincl in $inclwanted; do
3873 if $test -d $thisincl; then
3874 if $test x$thisincl != x$usrinc; then
3877 *) dflt="$dflt -I$thisincl";;
3883 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3885 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3893 *) dflt="$dflt -D$2";;
3897 set signal.h LANGUAGE_C; eval $inctest
3901 ccflags="$ccflags -DSOCKS"
3906 default|recommended) dflt="$ccflags $dflt" ;;
3907 *) dflt="$ccflags";;
3915 Your C compiler may want other flags. For this question you should include
3916 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3917 but you should NOT include libraries or ld flags like -lwhatever. If you
3918 want $package to honor its debug switch, you should include -DDEBUGGING here.
3919 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3921 To use no flags, specify the word "none".
3927 rp="Any additional cc flags?"
3934 : the following weeds options from ccflags that are of no interest to cpp
3936 case "$gccversion" in
3937 1*) cppflags="$cppflags -D__GNUC__"
3939 case "$mips_type" in
3941 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3947 echo "Let me guess what the preprocessor flags are..." >&4
3961 *) ftry="$previous $flag";;
3963 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3964 >cpp1.out 2>/dev/null && \
3965 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3966 >cpp2.out 2>/dev/null && \
3967 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3968 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3970 cppflags="$cppflags $ftry"
3980 *-*) echo "They appear to be: $cppflags";;
3982 $rm -f cpp.c cpp?.out
3986 : flags used in final linking phase
3988 '') if ./venix; then
3994 *-posix*) dflt="$dflt -posix" ;;
3997 *) dflt="$ldflags";;
4000 : Try to guess additional flags to pick up local libraries.
4001 for thislibdir in $libpth; do
4002 case " $loclibpth " in
4005 *"-L$thislibdir "*) ;;
4006 *) dflt="$dflt -L$thislibdir" ;;
4018 Your C linker may need flags. For this question you should
4019 include -L/whatever and any other flags used by the C linker, but you
4020 should NOT include libraries like -lwhatever.
4022 Make sure you include the appropriate -L/path flags if your C linker
4023 does not normally search all of the directories you specified above,
4026 To use no flags, specify the word "none".
4030 rp="Any additional ld flags (NOT including libraries)?"
4036 rmlist="$rmlist pdp11"
4040 echo "Checking your choice of C compiler and flags for coherency..." >&4
4041 $cat > try.c <<'EOF'
4043 int main() { printf("Ok\n"); exit(0); }
4045 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4047 $cat >try.msg <<'EOM'
4048 I've tried to compile and run the following simple program:
4051 $cat try.c >> try.msg
4053 $cat >> try.msg <<EOM
4060 and I got the following output:
4064 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4065 if sh -c './try' >>try.msg 2>&1; then
4069 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4072 cat >> try.msg <<'EOQS'
4073 If $libs contains -lsfio, and sfio is mis-configured, then it
4074 sometimes (apparently) runs and exits with a 0 status, but with no
4075 output! It may have to do with sfio's use of _exit vs. exit.
4078 rp="You have a big problem. Shall I abort Configure"
4085 echo "The program compiled OK, but exited with status $?." >>try.msg
4086 rp="You have a problem. Shall I abort Configure"
4090 echo "I can't compile the test program." >>try.msg
4091 rp="You have a BIG problem. Shall I abort Configure"
4097 case "$knowitall" in
4099 echo "(The supplied flags or libraries might be incorrect.)"
4107 *) echo "Ok. Stopping Configure." >&4
4112 n) echo "OK, that should do.";;
4114 $rm -f try try.* core
4116 : define an is-a-typedef? function
4117 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4119 "") inclist="sys/types.h";;
4121 eval "varval=\$$var";
4125 for inc in $inclist; do
4126 echo "#include <$inc>" >>temp.c;
4128 echo "#ifdef $type" >> temp.c;
4129 echo "printf(\"We have $type\");" >> temp.c;
4130 echo "#endif" >> temp.c;
4131 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4132 if $contains $type temp.E >/dev/null 2>&1; then
4138 *) eval "$var=\$varval";;
4141 : define an is-a-typedef? function that prompts if the type is not available.
4142 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4144 "") inclist="sys/types.h";;
4146 eval "varval=\$$var";
4150 for inc in $inclist; do
4151 echo "#include <$inc>" >>temp.c;
4153 echo "#ifdef $type" >> temp.c;
4154 echo "printf(\"We have $type\");" >> temp.c;
4155 echo "#endif" >> temp.c;
4156 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4158 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4159 if $contains $type temp.E >/dev/null 2>&1; then
4160 echo "$type found." >&4;
4163 echo "$type NOT found." >&4;
4169 *) eval "$var=\$varval";;
4172 : define a shorthand compile call
4176 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4177 : define a shorthand compile call for compilations that should be ok.
4181 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4183 : check for lengths of integral types
4187 echo "Checking to see how big your integers are..." >&4
4188 $cat >intsize.c <<'EOCP'
4192 printf("intsize=%d;\n", (int)sizeof(int));
4193 printf("longsize=%d;\n", (int)sizeof(long));
4194 printf("shortsize=%d;\n", (int)sizeof(short));
4199 if eval $compile_ok && ./intsize > /dev/null; then
4201 echo "Your integers are $intsize bytes long."
4202 echo "Your long integers are $longsize bytes long."
4203 echo "Your short integers are $shortsize bytes long."
4207 Help! I can't compile and run the intsize test program: please enlighten me!
4208 (This is probably a misconfiguration in your system or libraries, and
4209 you really ought to fix it. Still, I'll try anyway.)
4213 rp="What is the size of an integer (in bytes)?"
4217 rp="What is the size of a long integer (in bytes)?"
4221 rp="What is the size of a short integer (in bytes)?"
4227 $rm -f intsize intsize.*
4229 : see what type lseek is declared as in the kernel
4230 rp="What is the type used for lseek's offset on this system?"
4231 set off_t lseektype long stdio.h sys/types.h
4235 $echo $n "Checking to see how big your file offsets are...$c" >&4
4237 #include <sys/types.h>
4241 printf("%d\n", (int)sizeof($lseektype));
4246 if eval $compile_ok; then
4248 $echo " $lseeksize bytes." >&4
4252 echo "(I can't seem to compile the test program. Guessing...)"
4253 rp="What is the size of your file offsets (in bytes)?"
4259 : see what type file positions are declared as in the library
4260 rp="What is the type for file position used by fsetpos()?"
4261 set fpos_t fpostype long stdio.h sys/types.h
4266 *_t) zzz="$fpostype" ;;
4269 $echo $n "Checking the size of $zzz...$c" >&4
4271 #include <sys/types.h>
4274 printf("%d\n", (int)sizeof($fpostype));
4279 if eval $compile_ok; then
4284 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4287 echo " $fpossize bytes."
4293 echo "(I can't compile the test program. Guessing...)" >&4
4294 rp="What is the size of your file positions (in bytes)?"
4301 case "$lseeksize:$fpossize" in
4304 You can have files larger than 2 gigabytes.
4309 Perl can be built to understand large files (files larger than 2 gigabytes)
4310 on some systems. To do so, Configure must be run with -Duselargefiles.
4312 If this doesn't make any sense to you, just accept the default 'y'.
4314 case "$uselargefiles" in
4315 "$undef"|false|[nN]*) dflt='n' ;;
4318 rp='Try to understand large files, if available?'
4321 y|Y) val="$define" ;;
4328 case "$uselargefiles" in
4330 : Look for a hint-file generated 'call-back-unit'. If the
4331 : user has specified that a large files perl is to be built,
4332 : we may need to set or change some other defaults.
4333 if $test -f uselfs.cbu; then
4334 echo "Your platform has some specific hints for large file builds, using them..."
4337 $echo $n "Rechecking to see how big your file offsets are...$c" >&4
4339 #include <sys/types.h>
4343 printf("%d\n", (int)sizeof($lseektype));
4348 if eval $compile_ok; then
4350 $echo " $lseeksize bytes." >&4
4354 echo "(I can't seem to compile the test program. Guessing...)"
4355 rp="What is the size of your file offsets (in bytes)?"
4360 *_t) zzz="$fpostype" ;;
4363 $echo $n "Rechecking the size of $zzz...$c" >&4
4365 #include <sys/types.h>
4368 printf("%d\n", (int)sizeof($fpostype));
4373 if eval $compile_ok; then
4378 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4381 echo " $fpossize bytes."
4387 echo "(I can't compile the test program. Guessing...)" >&4
4388 rp="What is the size of your file positions (in bytes)?"
4398 case "$usemorebits" in
4399 "$define"|true|[yY]*)
4401 uselongdouble="$define"
4402 usemorebits="$define"
4404 *) usemorebits="$undef"
4409 case "$intsize:$longsize" in
4412 You have natively 64-bit integers.
4417 Perl can be built to take advantage of 64-bit integer types
4418 on some systems. To do so, Configure must be run with -Duse64bits.
4420 If this doesn't make any sense to you, just accept the default.
4422 case "$use64bits" in
4423 $define|true|[yY]*) dflt='y';;
4426 rp='Try to use 64-bit integers, if available?'
4429 y|Y) val="$define" ;;
4437 case "$archname64" in
4438 '') archname64='' ;; # not a typo
4441 case "$use64bits" in
4442 "$define"|true|[yY]*)
4443 : Look for a hint-file generated 'call-back-unit'. If the
4444 : user has specified that a 64-bit perl is to be built,
4445 : we may need to set or change some other defaults.
4446 if $test -f use64bits.cbu; then
4447 echo "Your platform has some specific hints for 64-bit builds, using them..."
4451 (Your platform doesn't have any specific hints for 64-bit builds.)
4453 case "$intsize:$longsize" in
4455 (This is probably okay, as your system is a natively 64-bit system.)
4459 case "$gccversion" in
4461 *) case "$ccflags" in
4462 *-DUSE_LONG_LONG*) ;;
4464 But since you seem to be using gcc, I will now add -DUSE_LONG_LONG
4465 to the compilation flags.
4467 ccflags="$ccflags -DUSE_LONG_LONG"
4476 : determine the architecture name
4478 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4479 tarch=`arch`"-$osname"
4480 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4481 if uname -m > tmparch 2>&1 ; then
4482 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4483 -e 's/$/'"-$osname/" tmparch`
4491 case "$myarchname" in
4494 echo "(Your architecture name used to be $myarchname.)"
4501 *) dflt="$archname";;
4503 rp='What is your architecture name'
4506 case "$usethreads" in
4508 echo "Threads selected." >&4
4510 *-thread*) echo "...and architecture name already has -thread." >&4
4512 *) archname="$archname-thread"
4513 echo "...setting architecture name to $archname." >&4
4518 case "$usemultiplicity" in
4520 echo "Multiplicity selected." >&4
4522 *-multi*) echo "...and architecture name already has -multi." >&4
4524 *) archname="$archname-multi"
4525 echo "...setting architecture name to $archname." >&4
4530 case "$use64bits" in
4532 case "$archname64" in
4537 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4539 *) archname="$archname-$archname64"
4540 echo "...setting architecture name to $archname." >&4
4547 : determine root of directory hierarchy where package will be installed.
4550 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4558 By default, $package will be installed in $dflt/bin, manual pages
4559 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4560 installation directories. Typically this is something like /usr/local.
4561 If you wish to have binaries under /usr/bin but other parts of the
4562 installation under /usr/local, that's ok: you will be prompted
4563 separately for each of the installation directories, the prefix being
4564 only used to set the defaults.
4568 rp='Installation prefix to use?'
4576 *) oldprefix="$prefix";;
4586 $define|true) afs=true ;;
4587 $undef|false) afs=false ;;
4588 *) if test -d /afs; then
4596 echo "AFS may be running... I'll be extra cautious then..." >&4
4598 echo "AFS does not seem to be running..." >&4
4601 : determine installation prefix for where package is to be installed.
4605 Since you are running AFS, I need to distinguish the directory in which
4606 files will reside from the directory in which they are installed (and from
4607 which they are presumably copied to the former directory by occult means).
4610 case "$installprefix" in
4611 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4612 *) dflt="$installprefix";;
4617 In some special cases, particularly when building $package for distribution,
4618 it is convenient to distinguish between the directory in which files should
4619 be installed from the directory ($prefix) in which they
4620 will eventually reside. For most users, these two directories are the same.
4623 case "$installprefix" in
4625 *) dflt=$installprefix;;
4629 rp='What installation prefix should I use for installing files?'
4631 installprefix="$ans"
4632 installprefixexp="$ansexp"
4634 : set the prefixit variable, to compute a suitable default value
4635 prefixit='case "$3" in
4637 case "$oldprefix" in
4638 "") eval "$1=\"\$$2\"";;
4645 ""|" ") eval "$1=\"\$$2\"";;
4651 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4653 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4654 /*-$oldprefix/*|\~*-$oldprefix/*)
4655 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4656 *) eval "$1=\"\$$2\"";;
4660 : set the base revision
4664 : get the patchlevel
4666 echo "Getting the current patchlevel..." >&4
4667 if $test -r $rsrc/patchlevel.h;then
4668 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4669 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4670 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4671 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4672 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4680 $echo $n "(You have $package" $c
4683 *) $echo $n " $baserev" $c ;;
4685 $echo $n " patchlevel $patchlevel" $c
4686 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4689 dos|cygwin|vms|win32)
4690 : XXX Should be a Configure test for double-dots in filenames.
4691 version=`echo $baserev $patchlevel $subversion | \
4692 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4693 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4694 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4697 version=`echo $baserev $patchlevel $subversion | \
4698 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4699 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4700 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4703 : Special case the 5.005_xx maintenance series, which used 5.005
4704 : without any subversion label as a subdirectory in $sitelib
4705 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4706 api_versionstring='5.005'
4709 : determine installation style
4710 : For now, try to deduce it from prefix unless it is already set.
4711 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4712 case "$installstyle" in
4713 '') case "$prefix" in
4714 *perl*) dflt='lib';;
4715 *) dflt='lib/perl5' ;;
4718 *) dflt='lib/perl5' ;;
4720 : Probably not worth prompting for this since we prompt for all
4721 : the directories individually, and the prompt would be too long and
4725 : determine where private library files go
4726 : Usual default is /usr/local/lib/perl5/$version.
4727 : Also allow things like /opt/perl/lib/$version, since
4728 : /opt/perl/lib/perl5... would be redundant.
4729 : The default "style" setting is made in installstyle.U
4730 case "$installstyle" in
4731 *lib/perl5*) set dflt privlib lib/$package/$version ;;
4732 *) set dflt privlib lib/$version ;;
4737 There are some auxiliary files for $package that need to be put into a
4738 private library directory that is accessible by everyone.
4742 rp='Pathname where the private library files will reside?'
4745 privlibexp="$ansexp"
4746 : Change installation prefix, if necessary.
4747 if $test X"$prefix" != X"$installprefix"; then
4748 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
4750 installprivlib="$privlibexp"
4753 : set the prefixup variable, to restore leading tilda escape
4754 prefixup='case "$prefixexp" in
4756 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
4759 : determine where public architecture dependent libraries go
4762 : privlib default is /usr/local/lib/$package/$version
4763 : archlib default is /usr/local/lib/$package/$version/$archname
4764 : privlib may have an optional trailing /share.
4765 tdflt=`echo $privlib | $sed 's,/share$,,'`
4766 tdflt=$tdflt/$archname
4775 $spackage contains architecture-dependent library files. If you are
4776 sharing libraries in a heterogeneous environment, you might store
4777 these files in a separate location. Otherwise, you can just include
4778 them with the rest of the public library files.
4782 rp='Where do you want to put the public architecture-dependent libraries?'
4785 archlibexp="$ansexp"
4786 if $test X"$archlib" = X"$privlib"; then
4791 : Change installation prefix, if necessary.
4792 if $test X"$prefix" != X"$installprefix"; then
4793 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
4795 installarchlib="$archlibexp"
4799 : Binary compatibility with 5.005 is not possible for builds
4800 : with advanced features
4801 case "$usethreads$usemultiplicity" in
4803 bincompat5005="$undef"
4804 d_bincompat5005="$undef"
4808 Perl 5.006 can be compiled for binary compatibility with 5.005.
4809 If you decide to do so, you will be able to continue using most
4810 of the extensions that were compiled for Perl 5.005.
4813 case "$bincompat5005$d_bincompat5005" in
4814 *"$undef"*) dflt=n ;;
4817 rp='Binary compatibility with Perl 5.005?'
4820 y*) val="$define" ;;
4825 case "$d_bincompat5005" in
4827 bincompat5005="$define"
4829 *) bincompat5005="$undef"
4830 d_bincompat5005="$undef"
4837 : see if setuid scripts can be secure
4840 Some kernels have a bug that prevents setuid #! scripts from being
4841 secure. Some sites have disabled setuid #! scripts because of this.
4843 First let's decide if your kernel supports secure setuid #! scripts.
4844 (If setuid #! scripts would be secure but have been disabled anyway,
4845 don't say that they are secure if asked.)
4850 if $test -d /dev/fd; then
4851 echo "#!$ls" >reflect
4852 chmod +x,u+s reflect
4853 ./reflect >flect 2>&1
4854 if $contains "/dev/fd" flect >/dev/null; then
4855 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4859 If you are not sure if they are secure, I can check but I'll need a
4860 username and password different from the one you are using right now.
4861 If you don't have such a username or don't want me to test, simply
4865 rp='Other username to test security of setuid scripts with?'
4870 case "$d_suidsafe" in
4871 '') echo "I'll assume setuid scripts are *not* secure." >&4
4874 echo "Well, the $hint value is *not* secure." >&4
4876 *) echo "Well, the $hint value *is* secure." >&4
4881 $rm -f reflect flect
4882 echo "#!$ls" >reflect
4883 chmod +x,u+s reflect
4886 echo '"su" will (probably) prompt you for '"$ans's password."
4887 su $ans -c './reflect >flect'
4888 if $contains "/dev/fd" flect >/dev/null; then
4889 echo "Okay, it looks like setuid scripts are secure." >&4
4892 echo "I don't think setuid scripts are secure." >&4
4897 rp='Does your kernel have *secure* setuid scripts?'
4900 [yY]*) val="$define";;
4905 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4906 echo "(That's for file descriptors, not floppy disks.)"
4912 $rm -f reflect flect
4914 : now see if they want to do setuid emulation
4917 case "$d_suidsafe" in
4920 echo "No need to emulate SUID scripts since they are secure here." >& 4
4924 Some systems have disabled setuid scripts, especially systems where
4925 setuid scripts cannot be secure. On systems where setuid scripts have
4926 been disabled, the setuid/setgid bits on scripts are currently
4927 useless. It is possible for $package to detect those bits and emulate
4928 setuid/setgid in a secure fashion. This emulation will only work if
4929 setuid scripts have been disabled in your kernel.
4933 "$define") dflt=y ;;
4936 rp="Do you want to do setuid/setgid emulation?"
4939 [yY]*) val="$define";;
4947 : determine filename position in cpp output
4949 echo "Computing filename position in cpp output for #include directives..." >&4
4950 echo '#include <stdio.h>' > foo.c
4953 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4954 $grep '^[ ]*#.*stdio\.h' | \
4955 while read cline; do
4958 while $test \$# -gt 0; do
4959 if $test -r \`echo \$1 | $tr -d '"'\`; then
4964 pos=\`expr \$pos + 1\`
4976 *) pos="${fieldn}th";;
4978 echo "Your cpp writes the filename in the $pos field of the line."
4980 : locate header file
4985 for usrincdir in $usrinc
4987 if test -f \$usrincdir/\$wanted; then
4988 echo "\$usrincdir/\$wanted"
4992 awkprg='{ print \$$fieldn }'
4993 echo "#include <\$wanted>" > foo\$\$.c
4994 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4995 $grep "^[ ]*#.*\$wanted" | \
4996 while read cline; do
4997 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4999 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5000 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5005 # status = 0: grep returned 0 lines, case statement not executed
5006 # status = 1: headerfile found
5007 # status = 2: while loop executed, no headerfile found
5011 if test \$status -eq 1; then
5018 : define an alternate in-header-list? function
5019 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5020 cont=true; xxf="echo \"<\$1> found.\" >&4";
5021 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5022 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5024 case $# in 4) instead=instead;; *) instead="at last";; esac;
5025 while $test "$cont"; do
5027 var=$2; eval "was=\$$2";
5028 if $test "$xxx" && $test -r "$xxx";
5030 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5033 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5034 set $yyy; shift; shift; yyy=$@;
5035 case $# in 0) cont="";;
5036 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5037 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5038 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5039 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5043 do set $yyy; var=$2; eval "was=\$$2";
5044 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5045 set $yyy; shift; shift; yyy=$@;
5048 : see if this is a malloc.h system
5049 set malloc.h i_malloc
5052 : see if stdlib is available
5053 set stdlib.h i_stdlib
5056 : determine which malloc to compile in
5058 case "$usemymalloc" in
5059 ''|[yY]*|true|$define) dflt='y' ;;
5062 rp="Do you wish to attempt to use the malloc that comes with $package?"
5068 mallocsrc='malloc.c'
5069 mallocobj="malloc$_o"
5070 d_mymalloc="$define"
5073 : Remove malloc from list of libraries to use
5074 echo "Removing unneeded -lmalloc from library list" >&4
5075 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5078 echo "libs = $libs" >&4
5090 : compute the return types of malloc and free
5092 $cat >malloc.c <<END
5096 #include <sys/types.h>
5110 case "$malloctype" in
5112 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5119 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5123 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5130 echo "Your system uses $freetype free(), it would seem." >&4
5134 The installation process will also create a directory for
5135 vendor-supplied add-ons. Vendors who supply perl with their system
5136 may find it convenient to place all vendor-supplied files in this
5137 directory rather than in the main distribution directory. This will
5138 ease upgrades between binary-compatible maintenance versions of perl.
5140 Of course you may also use these directories in whatever way you see
5141 fit. For example, you might use them to access modules shared over a
5142 company-wide network.
5144 The default answer should be fine for most people.
5145 This causes further questions about vendor add-ons to be skipped
5146 and no vendor-specific directories will be configured for perl.
5149 rp='Do you want to configure vendor-specific add-on directories?'
5150 case "$usevendorprefix" in
5151 define|true|[yY]*) dflt=y ;;
5157 rp='Installation prefix to use for vendor-supplied add-ons?'
5158 case "$vendorprefix" in
5160 *) dflt=$vendorprefix ;;
5164 case "$vendorprefix" in
5168 *) oldvendorprefix="$prefix";;
5172 usevendorprefix="$define"
5174 vendorprefixexp="$ansexp"
5176 *) usevendorprefix="$undef"
5182 case "$vendorprefix" in
5183 '') d_vendorlib="$undef"
5187 *) d_vendorlib="$define"
5188 : determine where vendor-supplied modules go.
5189 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
5190 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5191 case "$installstyle" in
5192 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
5193 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
5196 rp='Pathname for the vendor-supplied library files?'
5199 vendorlibexp="$ansexp"
5200 : Change installation prefix, if necessary.
5201 if $test X"$prefix" != X"$installprefix"; then
5202 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5204 installvendorlib="$vendorlibexp"
5209 : Cruising for prototypes
5211 echo "Checking out function prototypes..." >&4
5212 $cat >prototype.c <<'EOCP'
5213 int main(int argc, char *argv[]) {
5216 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5217 echo "Your C compiler appears to support function prototypes."
5220 echo "Your C compiler doesn't seem to understand function prototypes."
5227 case "$prototype" in
5229 *) ansi2knr='ansi2knr'
5234 This version of $package can only be compiled by a compiler that
5235 understands function prototypes. Unfortunately, your C compiler
5237 doesn't seem to understand them. Sorry about that.
5239 If GNU cc is available for your system, perhaps you could try that instead.
5241 Eventually, we hope to support building Perl with pre-ANSI compilers.
5242 If you would like to help in that effort, please contact <perlbug@perl.org>.
5244 Aborting Configure now.
5250 : determine where public executables go
5255 rp='Pathname where the public executables will reside?'
5257 if $test "X$ansexp" != "X$binexp"; then
5262 : Change installation prefix, if necessary.
5263 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5264 if $test X"$prefix" != X"$installprefix"; then
5265 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5267 installbin="$binexp"
5272 After $package is installed, you may wish to install various
5273 add-on modules and utilities. Typically, these add-ons will
5274 be installed under $prefix with the rest
5275 of this package. However, you may wish to install such add-ons
5276 elsewhere under a different prefix.
5278 If you do not wish to put everything under a single prefix, that's
5279 ok. You will be prompted for the individual locations; this siteprefix
5280 is only used to suggest the defaults.
5282 The default should be fine for most people.
5286 rp='Installation prefix to use for add-on modules and utilities?'
5287 : XXX Here might be another good place for an installstyle setting.
5288 case "$siteprefix" in
5290 *) dflt=$siteprefix ;;
5294 case "$siteprefix" in
5299 *) oldsiteprefix="$prefix";;
5304 siteprefixexp="$ansexp"
5306 : determine where site specific libraries go.
5307 : Usual default is /usr/local/lib/perl5/site_perl/$version
5308 : The default "style" setting is made in installstyle.U
5309 : XXX No longer works with Prefixit stuff.
5310 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5311 case "$installstyle" in
5312 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5313 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5317 The installation process will create a directory for
5318 site-specific extensions and modules. Most users find it convenient
5319 to place all site-specific files in this directory rather than in the
5320 main distribution directory.
5324 rp='Pathname for the site-specific library files?'
5327 sitelibexp="$ansexp"
5328 : Change installation prefix, if necessary.
5329 if $test X"$prefix" != X"$installprefix"; then
5330 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
5332 installsitelib="$sitelibexp"
5335 : Determine list of previous versions to include in @INC
5336 $cat > getverlist <<EOPL
5339 \$api_versionstring = "$api_versionstring";
5340 \$version = "$version";
5341 \$sitelib = "$sitelib";
5342 \$archname = "$archname";
5344 $cat >> getverlist <<'EOPL'
5345 # Can't have leading @ because metaconfig interprets it as a command!
5346 ;@inc_version_list=();
5347 $stem=dirname($sitelib);
5348 # Redo to do opendir/readdir?
5351 ;@candidates = glob("5.*");
5357 foreach $d (@candidates) {
5358 if ($d lt $version) {
5359 if ($d ge $api_versionstring) {
5360 unshift(@inc_version_list, "$d/$archname", $d);
5362 elsif ($d ge "5.005") {
5363 unshift(@inc_version_list, $d);
5367 # Skip newer version. I.e. don't look in
5368 # 5.7.0 if we're installing 5.6.1.
5372 if (@inc_version_list) {
5374 print join('", "', @inc_version_list);
5378 # Blank space to preserve value for next Configure run.
5383 case "$inc_version_list" in
5384 '') if test -x $perl; then
5385 dflt=`$perl getverlist`
5390 *) dflt="$inc_version_list" ;;
5394 In order to ease the process of upgrading, this version of perl
5395 can be configured to use modules built and installed with earlier
5396 versions of perl that were installed under $prefix. Specify here
5397 the list of earlier versions that this version of perl should check.
5398 If Configure detected no earlier versions of perl installed under
5399 $prefix, then the list will be empty.
5401 The default should almost always be sensible, so if you're not sure,
5402 just accept the default.
5405 rp='list of earlier versions to include in @INC?'
5407 inc_version_list="$ans"
5410 : determine whether to install perl also as /usr/bin/perl
5413 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5415 Many scripts expect to perl to be installed as /usr/bin/perl.
5416 I can install the perl you are about to compile also as /usr/bin/perl
5417 (in addition to $installbin/perl).
5419 case "$installusrbinperl" in
5420 "$undef"|[nN]*) dflt='n';;
5423 rp="Do you want to install perl as /usr/bin/perl?"
5426 [yY]*) val="$define";;
5432 set installusrbinperl
5436 echo "Checking for GNU C Library..." >&4
5437 cat >gnulibc.c <<EOM
5449 if eval $compile_ok && ./gnulibc; then
5451 echo "You are using the GNU C Library"
5454 echo "You are not using the GNU C Library"
5460 : see if nm is to be used to determine whether a symbol is defined or not
5464 case "$d_gnulibc" in
5467 echo "nm probably won't work on the GNU C Library." >&4
5473 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5475 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5476 echo "'nm' won't be sufficient on this sytem." >&4
5482 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5483 if $test $dflt -gt 20; then
5493 true|$define) dflt=y;;
5500 I can use $nm to extract the symbols from your C libraries. This
5501 is a time consuming task which may generate huge output on the disk (up
5502 to 3 megabytes) but that should make the symbols extraction faster. The
5503 alternative is to skip the 'nm' extraction part and to compile a small
5504 test program instead to determine whether each symbol is present. If
5505 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5506 this may be the best solution.
5508 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5511 rp="Shall I use $nm to extract C symbols from the libraries?"
5514 [Nn]*) usenm=false;;
5523 : nm options which may be necessary
5525 '') if $test -f /mach_boot; then
5527 elif $test -d /usr/ccs/lib; then
5528 nm_opt='-p' # Solaris (and SunOS?)
5529 elif $test -f /dgux; then
5531 elif $test -f /lib64/rld; then
5532 nm_opt='-p' # 64-bit Irix
5538 : nm options which may be necessary for shared libraries but illegal
5539 : for archive libraries. Thank you, Linux.
5540 case "$nm_so_opt" in
5541 '') case "$myuname" in
5543 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5544 nm_so_opt='--dynamic'
5553 : get list of predefined functions in a handy place
5558 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5565 *) for thislib in $libs; do
5568 : Handle C library specially below.
5571 thislib=`echo $thislib | $sed -e 's/^-l//'`
5572 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5574 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5576 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5578 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5580 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5582 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5584 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5589 libnames="$libnames $try"
5591 *) libnames="$libnames $thislib" ;;
5600 for xxx in $libpth; do
5601 $test -r $1 || set $xxx/libc.$so
5602 : The messy sed command sorts on library version numbers.
5604 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5605 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5607 s/[0-9][0-9]*/0000&/g
5608 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5611 sort | $sed -e 's/^.* //'`
5614 $test -r $1 || set /usr/ccs/lib/libc.$so
5615 $test -r $1 || set /lib/libsys_s$_a
5621 if $test -r "$1"; then
5622 echo "Your (shared) C library seems to be in $1."
5624 elif $test -r /lib/libc && $test -r /lib/clib; then
5625 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5627 libc='/lib/clib /lib/libc'
5628 if $test -r /lib/syslib; then
5629 echo "(Your math library is in /lib/syslib.)"
5630 libc="$libc /lib/syslib"
5632 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5633 echo "Your C library seems to be in $libc, as you said before."
5634 elif $test -r $incpath/usr/lib/libc$_a; then
5635 libc=$incpath/usr/lib/libc$_a;
5636 echo "Your C library seems to be in $libc. That's fine."
5637 elif $test -r /lib/libc$_a; then
5639 echo "Your C library seems to be in $libc. You're normal."
5641 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5643 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5644 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5645 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5647 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5649 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5652 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5654 if $test -r "$tans"; then
5655 echo "Your C library seems to be in $tans, of all places."
5661 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5665 If the guess above is wrong (which it might be if you're using a strange
5666 compiler, or your machine supports multiple models), you can override it here.
5671 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5673 I can't seem to find your C library. I've looked in the following places:
5676 $sed 's/^/ /' libpath
5679 None of these seems to contain your C library. I need to get its name...
5684 rp='Where is your C library?'
5689 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5690 set X `cat libnames`
5693 case $# in 1) xxx=file; esac
5694 echo "Extracting names from the following $xxx for later perusal:" >&4
5696 $sed 's/^/ /' libnames >&4
5698 $echo $n "This may take a while...$c" >&4
5702 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5703 *) $nm $nm_opt $file 2>/dev/null;;
5708 $grep fprintf libc.tmp > libc.ptf
5709 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5710 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5712 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5714 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5716 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5718 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5720 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5722 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5724 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5726 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5728 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5730 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5732 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5734 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5736 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5737 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5739 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5741 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5743 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5745 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5747 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5749 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5751 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5753 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5755 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5757 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5759 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5761 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5763 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5765 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5767 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5770 $nm -p $* 2>/dev/null >libc.tmp
5771 $grep fprintf libc.tmp > libc.ptf
5772 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5773 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5779 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5781 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5782 for thisname in $libnames $libc; do
5783 $ar t $thisname >>libc.tmp
5785 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5787 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5788 # Repeat libc to extract forwarders to DLL entries too
5789 for thisname in $libnames $libc; do
5790 $ar tv $thisname >>libc.tmp
5791 # Revision 50 of EMX has bug in $ar.
5792 # it will not extract forwarders to DLL entries
5793 # Use emximp which will extract exactly them.
5794 emximp -o tmp.imp $thisname \
5796 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5797 < tmp.imp >>libc.tmp
5800 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5803 echo "$ar didn't seem to work right." >&4
5804 echo "Maybe this is a Cray...trying bld instead..." >&4
5805 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5807 for thisname in $libnames; do
5809 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5810 $ar t $thisname >>libc.tmp
5814 echo "That didn't work either. Giving up." >&4
5821 if $test -f /lib/syscalls.exp; then
5823 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5824 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5828 $rm -f libnames libpath
5830 : see if dld is available
5834 : is a C symbol defined?
5837 -v) tf=libc.tmp; tc=""; tdc="";;
5838 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5839 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5842 case "$reuseval-$4" in
5844 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5850 if $contains $tlook $tf >/dev/null 2>&1;
5855 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5856 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5864 $define) tval=true;;
5870 : define an is-in-libc? function
5871 inlibc='echo " "; td=$define; tu=$undef;
5872 sym=$1; var=$2; eval "was=\$$2";
5874 case "$reuseval$was" in
5884 echo "$sym() found." >&4;
5885 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5887 echo "$sym() NOT found." >&4;
5888 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5892 $define) echo "$sym() found." >&4;;
5893 *) echo "$sym() NOT found." >&4;;
5897 : see if dlopen exists
5904 : determine which dynamic loading, if any, to compile in
5906 dldir="ext/DynaLoader"
5919 $define) dflt='y' ;;
5922 $define) dflt='y' ;;
5924 : Does a dl_xxx.xs file exist for this operating system
5925 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5928 rp="Do you wish to use dynamic loading?"
5935 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5936 dflt="$dldir/dl_${osname}.xs"
5937 elif $test "$d_dlopen" = "$define" ; then
5938 dflt="$dldir/dl_dlopen.xs"
5939 elif $test "$i_dld" = "$define" ; then
5940 dflt="$dldir/dl_dld.xs"
5945 *) dflt="$dldir/$dlsrc"
5948 echo "The following dynamic loading files are available:"
5949 : Can not go over to $dldir because getfile has path hard-coded in.
5950 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5951 rp="Source file to use for dynamic loading"
5957 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5961 Some systems may require passing special flags to $cc -c to
5962 compile modules that will be used to create a shared library.
5963 To use no flags, say "none".
5966 case "$cccdlflags" in
5967 '') case "$gccversion" in
5968 '') case "$osname" in
5970 next) dflt='none' ;;
5971 irix*) dflt='-KPIC' ;;
5972 svr4*|esix*|solaris) dflt='-KPIC' ;;
5973 sunos) dflt='-pic' ;;
5977 *) case "$osname" in
5978 svr4*|esix*|solaris) dflt='-fPIC' ;;
5983 *) dflt="$cccdlflags" ;;
5985 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5988 none) cccdlflags=' ' ;;
5989 *) cccdlflags="$ans" ;;
5994 Some systems use ld to create libraries that can be dynamically loaded,
5995 while other systems (such as those using ELF) use $cc.
5999 '') $cat >try.c <<'EOM'
6000 /* Test for whether ELF binaries are produced */
6005 int i = open("a.out",O_RDONLY);
6008 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6009 exit(0); /* succeed (yes, it's ELF) */
6014 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6016 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6020 echo "I'll use ld to build dynamic libraries."
6029 rp="What command should be used to create dynamic libraries?"
6035 Some systems may require passing special flags to $ld to create a
6036 library that can be dynamically loaded. If your ld flags include
6037 -L/other/path options to locate libraries outside your loader's normal
6038 search path, you may need to specify those -L options here as well. To
6039 use no flags, say "none".
6042 case "$lddlflags" in
6043 '') case "$osname" in
6044 beos) dflt='-nostart' ;;
6046 linux|irix*) dflt='-shared' ;;
6047 next) dflt='none' ;;
6048 solaris) dflt='-G' ;;
6049 sunos) dflt='-assert nodefinitions' ;;
6050 svr4*|esix*) dflt="-G $ldflags" ;;
6054 *) dflt="$lddlflags" ;;
6057 : Try to guess additional flags to pick up local libraries.
6058 : Be careful not to append to a plain 'none'
6062 for thisflag in $ldflags; do
6067 *) dflt="$dflt $thisflag" ;;
6074 ''|' ') dflt='none' ;;
6077 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6080 none) lddlflags=' ' ;;
6081 *) lddlflags="$ans" ;;
6086 Some systems may require passing special flags to $cc to indicate that
6087 the resulting executable will use dynamic linking. To use no flags,
6091 case "$ccdlflags" in
6092 '') case "$osname" in
6093 hpux) dflt='-Wl,-E' ;;
6094 linux) dflt='-rdynamic' ;;
6095 next) dflt='none' ;;
6096 sunos) dflt='none' ;;
6100 *) dflt="$ccdlflags" ;;
6102 rp="Any special flags to pass to $cc to use dynamic loading?"
6105 none) ccdlflags=' ' ;;
6106 *) ccdlflags="$ans" ;;
6120 # No dynamic loading being used, so don't bother even to prompt.
6123 *) case "$useshrplib" in
6124 '') case "$osname" in
6125 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
6127 also='Building a shared libperl is required for dynamic loading to work on your system.'
6132 also='Building a shared libperl is needed for MAB support.'
6150 The perl executable is normally obtained by linking perlmain.c with
6151 libperl${_a}, any static extensions (usually just DynaLoader), and
6152 any other libraries needed on this system (such as -lm, etc.). Since
6153 your system supports dynamic loading, it is probably possible to build
6154 a shared libperl.$so. If you will have more than one executable linked
6155 to libperl.$so, this will significantly reduce the size of each
6156 executable, but it may have a noticeable affect on performance. The
6157 default is probably sensible for your system.
6161 rp="Build a shared libperl.$so (y/n)"
6165 useshrplib='true' ;;
6166 *) useshrplib='false' ;;
6171 case "$useshrplib" in
6175 # Figure out a good name for libperl.so. Since it gets stored in
6176 # a version-specific architecture-dependent library, the version
6177 # number isn't really that important, except for making cc/ld happy.
6179 # A name such as libperl.so.3.1
6180 majmin="libperl.$so.$patchlevel.$subversion"
6181 # A name such as libperl.so.301
6182 majonly=`echo $patchlevel $subversion |
6183 $awk '{printf "%d%02d", $1, $2}'`
6184 majonly=libperl.$so.$majonly
6185 # I'd prefer to keep the os-specific stuff here to a minimum, and
6186 # rely on figuring it out from the naming of libc.
6187 case "${osname}${osvers}" in
6190 # XXX How handle the --version stuff for MAB?
6192 linux*) # ld won't link with a bare -lperl otherwise.
6195 cygwin*) # include version
6196 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6198 *) # Try to guess based on whether libc has major.minor.
6200 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6201 *libc.$so.[0-9]*) dflt=$majonly ;;
6202 *) dflt=libperl.$so ;;
6212 I need to select a good name for the shared libperl. If your system uses
6213 library names with major and minor numbers, then you might want something
6214 like $majmin. Alternatively, if your system uses a single version
6215 number for shared libraries, then you might want to use $majonly.
6216 Or, your system might be quite happy with a simple libperl.$so.
6218 Since the shared libperl will get installed into a version-specific
6219 architecture-dependent directory, the version number of the shared perl
6220 library probably isn't important, so the default should be o.k.
6223 rp='What name do you want to give to the shared libperl?'
6226 echo "Ok, I'll use $libperl"
6229 libperl="libperl${_a}"
6233 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6237 WARNING: Use of the shrpdir variable for the installation location of
6238 the shared $libperl is not supported. It was never documented and
6239 will not work in this version. Let me (perlbug@perl.com)
6240 know of any problems this may cause.
6246 But your current setting of $shrpdir is
6247 the default anyway, so it's harmless.
6252 Further, your current attempted setting of $shrpdir
6253 conflicts with the value of $archlibexp/CORE
6254 that installperl will use.
6261 # How will the perl executable find the installed shared $libperl?
6262 # Add $xxx to ccdlflags.
6263 # If we can't figure out a command-line option, use $shrpenv to
6264 # set env LD_RUN_PATH. The main perl makefile uses this.
6265 shrpdir=$archlibexp/CORE
6268 if "$useshrplib"; then
6271 # We'll set it in Makefile.SH...
6277 xxx="-Wl,-R$shrpdir"
6279 linux|irix*|dec_osf)
6280 xxx="-Wl,-rpath,$shrpdir"
6283 # next doesn't like the default...
6286 # beos doesn't like the default, either.
6289 # hpux doesn't like the default, either.
6290 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6293 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6299 # Only add $xxx if it isn't already in ccdlflags.
6300 case " $ccdlflags " in
6302 *) ccdlflags="$ccdlflags $xxx"
6305 Adding $xxx to the flags
6306 passed to $ld so that the perl executable will find the
6307 installed shared $libperl.
6315 # Fix ccdlflags in AIX for building external extensions.
6316 # (For building Perl itself bare -bE:perl.exp is needed,
6317 # Makefile.SH takes care of this.)
6319 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6321 # Respect a hint or command-line value.
6323 '') shrpenv="$tmp_shrpenv" ;;
6325 case "$ldlibpthname" in
6326 '') ldlibpthname=LD_LIBRARY_PATH ;;
6327 none) ldlibpthname='' ;;
6330 : determine where manual pages go
6331 set man1dir man1dir none
6335 $spackage has manual pages available in source form.
6339 echo "However, you don't have nroff, so they're probably useless to you."
6341 '') man1dir="none";;
6344 echo "If you don't want the manual sources installed, answer 'none'."
6349 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6350 lookpath="$lookpath $prefixexp/man/p_man/man1"
6351 lookpath="$lookpath $prefixexp/man/u_man/man1"
6352 lookpath="$lookpath $prefixexp/man/man.1"
6354 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6355 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6365 rp="Where do the main $spackage manual pages (source) go?"
6367 if $test "X$man1direxp" != "X$ansexp"; then
6371 man1direxp="$ansexp"
6377 : Change installation prefix, if necessary.
6378 if $test X"$prefix" != X"$installprefix"; then
6379 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6381 installman1dir="$man1direxp"
6384 : What suffix to use on installed man pages
6391 rp="What suffix should be used for the main $spackage man pages?"
6393 '') case "$man1dir" in
6407 *) dflt="$man1ext";;
6414 : see if we can have long filenames
6416 rmlist="$rmlist /tmp/cf$$"
6417 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
6418 first=123456789abcdef
6419 second=/tmp/cf$$/$first
6420 $rm -f $first $second
6421 if (echo hi >$first) 2>/dev/null; then
6422 if $test -f 123456789abcde; then
6423 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6426 if (echo hi >$second) 2>/dev/null; then
6427 if $test -f /tmp/cf$$/123456789abcde; then
6429 That's peculiar... You can have filenames longer than 14 characters, but only
6430 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
6431 I shall consider your system cannot support long filenames at all.
6435 echo 'You can have filenames longer than 14 characters.' >&4
6440 How confusing! Some of your filesystems are sane enough to allow filenames
6441 longer than 14 characters but some others like /tmp can't even think about them.
6442 So, for now on, I shall assume your kernel does not allow them at all.
6449 You can't have filenames longer than 14 chars. You can't even think about them!
6455 $rm -rf /tmp/cf$$ 123456789abcde*
6457 : determine where library module manual pages go
6458 set man3dir man3dir none
6462 $spackage has manual pages for many of the library modules.
6468 However, you don't have nroff, so they're probably useless to you.
6471 '') man3dir="none";;
6475 case "$d_flexfnam" in
6478 However, your system can't handle the long file names like File::Basename.3.
6481 '') man3dir="none";;
6485 echo "If you don't want the manual sources installed, answer 'none'."
6486 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6488 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6489 if $test -d "$privlib/man/man3"; then
6492 WARNING: Previous versions of perl installed man3 pages into
6493 $privlib/man/man3. This version will suggest a
6494 new default of $dflt.
6498 rp='Do you wish to preserve the old behavior?(y/n)'
6501 y*) dflt="$privlib/man/man3" ;;
6507 *) dflt="$man3dir" ;;
6511 rp="Where do the $package library man pages (source) go?"
6514 man3direxp="$ansexp"
6520 : Change installation prefix, if necessary.
6521 if $test X"$prefix" != X"$installprefix"; then
6522 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6524 installman3dir="$man3direxp"
6527 : What suffix to use on installed man pages
6533 rp="What suffix should be used for the $package library man pages?"
6535 '') case "$man3dir" in
6549 *) dflt="$man3ext";;
6556 : see if we have to deal with yellow pages, now NIS.
6557 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6558 if $test -f /usr/etc/nibindd; then
6560 echo "I'm fairly confident you're on a NeXT."
6562 rp='Do you get the hosts file via NetInfo?'
6571 y*) hostcat='nidump hosts .';;
6572 *) case "$hostcat" in
6573 nidump*) hostcat='';;
6583 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6591 rp='Are you getting the hosts file via yellow pages?'
6594 y*) hostcat='ypcat hosts';;
6595 *) hostcat='cat /etc/hosts';;
6601 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
6604 '') test -f /etc/group && groupcat='cat /etc/group';;
6607 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
6610 : now get the host name
6612 echo "Figuring out host name..." >&4
6613 case "$myhostname" in
6615 echo 'Maybe "hostname" will work...'
6616 if tans=`sh -c hostname 2>&1` ; then
6624 if $test "$cont"; then
6626 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6627 if tans=`cat /etc/systemid 2>&1` ; then
6629 phostname='cat /etc/systemid'
6630 echo "Whadyaknow. Xenix always was a bit strange..."
6633 elif $test -r /etc/systemid; then
6634 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6637 if $test "$cont"; then
6638 echo 'No, maybe "uuname -l" will work...'
6639 if tans=`sh -c 'uuname -l' 2>&1` ; then
6641 phostname='uuname -l'
6643 echo 'Strange. Maybe "uname -n" will work...'
6644 if tans=`sh -c 'uname -n' 2>&1` ; then
6646 phostname='uname -n'
6648 echo 'Oh well, maybe I can mine it out of whoami.h...'
6649 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6650 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6651 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6653 case "$myhostname" in
6654 '') echo "Does this machine have an identity crisis or something?"
6657 echo "Well, you said $myhostname before..."
6658 phostname='echo $myhostname';;
6664 : you do not want to know about this
6669 if $test "$myhostname" ; then
6671 rp='Your host name appears to be "'$myhostname'".'" Right?"
6679 : bad guess or no guess
6680 while $test "X$myhostname" = X ; do
6682 rp="Please type the (one word) name of your host:"
6687 : translate upper to lower if necessary
6688 case "$myhostname" in
6690 echo "(Normalizing case in your host name)"
6691 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6695 case "$myhostname" in
6697 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6698 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6699 echo "(Trimming domain name from host name--host name is now $myhostname)"
6701 *) case "$mydomain" in
6704 test "X$hostcat" = "Xypcat hosts" &&
6705 ypmatch "$myhostname" hosts 2>/dev/null |\
6706 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6709 test "X$hostcat" != "X" &&
6710 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6711 /[ ]$myhostname[ . ]/p" > hosts
6714 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6715 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6716 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6717 hosts | $sort | $uniq | \
6718 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6719 case `$echo X$dflt` in
6720 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6723 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6728 tans=`./loc resolv.conf X /etc /usr/etc`
6729 if $test -f "$tans"; then
6730 echo "(Attempting domain name extraction from $tans)"
6731 dflt=.`$sed -n -e 's/ / /g' \
6732 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6733 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6735 .) dflt=.`$sed -n -e 's/ / /g' \
6736 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6737 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6744 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6745 dflt=.`sh -c domainname 2>/dev/null`
6748 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6753 .) echo "(Lost all hope -- silly guess then)"
6759 *) dflt="$mydomain";;
6763 rp="What is your domain name?"
6773 : translate upper to lower if necessary
6776 echo "(Normalizing case in your domain name)"
6777 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6781 : a little sanity check here
6782 case "$phostname" in
6785 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6786 $myhostname$mydomain|$myhostname) ;;
6788 case "$phostname" in
6790 echo "(That doesn't agree with your whoami.h file, by the way.)"
6793 echo "(That doesn't agree with your $phostname command, by the way.)"
6803 I need to get your e-mail address in Internet format if possible, i.e.
6804 something like user@host.domain. Please answer accurately since I have
6805 no easy means to double check it. The default value provided below
6806 is most probably close to the reality but may not be valid from outside
6807 your organization...
6811 while test "$cont"; do
6813 '') dflt="$cf_by@$myhostname$mydomain";;
6814 *) dflt="$cf_email";;
6816 rp='What is your e-mail address?'
6822 rp='Address does not look like an Internet one. Use it anyway?'
6838 If you or somebody else will be maintaining perl at your site, please
6839 fill in the correct e-mail address here so that they may be contacted
6840 if necessary. Currently, the "perlbug" program included with perl
6841 will send mail to this address in addition to perlbug@perl.com. You may
6842 enter "none" for no administrator.
6845 case "$perladmin" in
6846 '') dflt="$cf_email";;
6847 *) dflt="$perladmin";;
6849 rp='Perl administrator e-mail address'
6853 : figure out how to guarantee perl startup
6854 case "$startperl" in
6856 case "$sharpbang" in
6860 I can use the #! construct to start perl on your system. This will
6861 make startup of perl scripts faster, but may cause problems if you
6862 want to share those scripts and perl is not in a standard place
6863 ($binexp/perl) on all your platforms. The alternative is to force
6864 a shell by starting the script with a single ':' character.
6868 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6871 none) startperl=": # use perl";;
6872 *) startperl="#!$ans"
6873 if $test 30 -lt `echo "$ans" | wc -c`; then
6876 WARNING: Some systems limit the #! command to 32 characters.
6877 If you experience difficulty running Perl scripts with #!, try
6878 installing Perl in a directory with a shorter pathname.
6884 *) startperl=": # use perl"
6889 echo "I'll use $startperl to start perl scripts."
6891 : figure best path for perl in scripts
6894 perlpath="$binexp/perl"
6895 case "$startperl" in
6900 I will use the "eval 'exec'" idiom to start Perl on your system.
6901 I can use the full path of your Perl binary for this purpose, but
6902 doing so may cause problems if you want to share those scripts and
6903 Perl is not always in a standard place ($binexp/perl).
6907 rp="What path shall I use in \"eval 'exec'\"?"
6914 case "$startperl" in
6916 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6919 : determine where public executable scripts go
6920 set scriptdir scriptdir
6922 case "$scriptdir" in
6925 : guess some guesses
6926 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6927 $test -d /usr/share/bin && dflt=/usr/share/bin
6928 $test -d /usr/local/script && dflt=/usr/local/script
6929 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6930 $test -d $prefixexp/script && dflt=$prefixexp/script
6934 *) dflt="$scriptdir"
6939 Some installations have a separate directory just for executable scripts so
6940 that they can mount it across multiple architectures but keep the scripts in
6941 one spot. You might, for example, have a subdirectory of /usr/share for this.
6942 Or you might just lump your scripts in with all your other executables.
6946 rp='Where do you keep publicly executable scripts?'
6948 if $test "X$ansexp" != "X$scriptdirexp"; then
6952 scriptdirexp="$ansexp"
6953 : Change installation prefix, if necessary.
6954 if $test X"$prefix" != X"$installprefix"; then
6955 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6957 installscript="$scriptdirexp"
6960 : determine where site specific architecture-dependent libraries go.
6961 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6962 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6963 : sitelib may have an optional trailing /share.
6964 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6965 tdflt="$tdflt/$archname"
6966 set sitearch sitearch none
6969 '') dflt="$tdflt" ;;
6970 *) dflt="$sitearch" ;;
6974 The installation process will also create a directory for
6975 architecture-dependent site-specific extensions and modules.
6979 rp='Pathname for the site-specific architecture-dependent library files?'
6982 sitearchexp="$ansexp"
6983 : Change installation prefix, if necessary.
6984 if $test X"$prefix" != X"$installprefix"; then
6985 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6987 installsitearch="$sitearchexp"
6990 : determine where add-on public executables go
6992 '') dflt=$siteprefix/bin ;;
6996 rp='Pathname where the add-on public executables should be installed?'
6999 sitebinexp="$ansexp"
7000 : Change installation prefix, if necessary.
7001 if $test X"$prefix" != X"$installprefix"; then
7002 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7004 installsitebin="$sitebinexp"
7009 Perl can be built to take advantage of long doubles which
7010 (if available) may give more accuracy and range for floating point numbers.
7012 If this doesn't make any sense to you, just accept the default 'n'.
7016 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
7019 case "$uselongdouble" in
7020 $define|true|[yY]*) dflt='y';;
7023 rp='Try to use long doubles if available?'
7026 y|Y) val="$define" ;;
7032 case "$uselongdouble" in
7033 true|[yY]*) uselongdouble="$define" ;;
7036 case "$uselongdouble" in
7038 : Look for a hint-file generated 'call-back-unit'. If the
7039 : user has specified that long doubles should be used,
7040 : we may need to set or change some other defaults.
7041 if $test -f uselongdouble.cbu; then
7042 echo "Your platform has some specific hints for long doubles, using them..."
7043 . ./uselongdouble.cbu
7046 (Your platform doesn't have any specific hints for long doubles.)
7054 Perl can be built to take advantage of long longs which
7055 (if available) may give more range for integer numbers.
7057 If this doesn't make any sense to you, just accept the default 'n'.
7061 *-DUSE_LONG_LONG*) uselonglong="$define" ;;
7064 case "$uselonglong" in
7065 $define|true|[yY]*) dflt='y';;
7068 rp='Try to use long longs if available?'
7071 y|Y) val="$define" ;;
7077 case "$uselonglong" in
7078 true|[yY]*) uselonglong="$define" ;;
7081 case "$uselonglong" in
7083 : Look for a hint-file generated 'call-back-unit'. If the
7084 : user has specified that long longs should be used,
7085 : we may need to set or change some other defaults.
7086 if $test -f uselonglong.cbu; then
7087 echo "Your platform has some specific hints for long longs, using them..."
7091 (Your platform doesn't have any specific hints for long longs.)
7099 Previous version of $package used the standard IO mechanisms as defined
7100 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7101 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7102 the default. This abstraction layer can use AT&T's sfio (if you already
7103 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7104 problems with some extension modules. Using PerlIO with stdio is safe,
7105 but it is slower than plain stdio and therefore is not the default.
7107 If this doesn't make any sense to you, just accept the default 'n'.
7109 case "$useperlio" in
7110 $define|true|[yY]*) dflt='y';;
7113 rp='Use the experimental PerlIO abstraction layer?'
7120 echo "Ok, doing things the stdio way"
7127 case "$vendorprefix" in
7128 '') d_vendorbin="$undef"
7132 *) d_vendorbin="$define"
7133 : determine where vendor-supplied executables go.
7134 dflt=$vendorprefix/bin
7136 rp='Pathname for the vendor-supplied executables directory?'
7139 vendorbinexp="$ansexp"
7140 : Change installation prefix, if necessary.
7141 if $test X"$prefix" != X"$installprefix"; then
7142 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7144 installvendorbin="$vendorbinexp"
7149 : see if qgcvt exists
7153 : Check how to convert floats to strings.
7154 if test "X$d_Gconvert" = X; then
7156 echo "Checking for an efficient way to convert floats to strings."
7159 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7160 char *myname = "gconvert";
7163 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7164 char *myname = "gcvt";
7167 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7168 char *myname = "qgcvt";
7171 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7172 char *myname = "sprintf";
7178 checkit(expect, got)
7182 if (strcmp(expect, got)) {
7183 printf("%s oddity: Expected %s, got %s\n",
7184 myname, expect, got);
7194 /* This must be 1st test on (which?) platform */
7195 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7196 Gconvert(0.1, 8, 0, buf);
7197 checkit("0.1", buf);
7199 Gconvert(1.0, 8, 0, buf);
7202 Gconvert(0.0, 8, 0, buf);
7205 Gconvert(-1.0, 8, 0, buf);
7208 /* Some Linux gcvt's give 1.e+5 here. */
7209 Gconvert(100000.0, 8, 0, buf);
7210 checkit("100000", buf);
7212 /* Some Linux gcvt's give -1.e+5 here. */
7213 Gconvert(-100000.0, 8, 0, buf);
7214 checkit("-100000", buf);
7219 case "$d_Gconvert" in
7220 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7221 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7222 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7223 *) xxx_list='gconvert gcvt sprintf' ;;
7226 case "$uselongdouble$d_qgcvt" in
7227 definedefine) xxx_list="`echo $xxx_list|sed s/gcvt/qgcvt/`" ;;
7230 for xxx_convert in $xxx_list; do
7231 echo "Trying $xxx_convert..."
7233 set try -DTRY_$xxx_convert
7234 if eval $compile; then
7235 echo "$xxx_convert" found. >&4
7237 echo "I'll use $xxx_convert to convert floats into a string." >&4
7240 echo "...But $xxx_convert didn't work as I expected."
7243 echo "$xxx_convert NOT found." >&4
7247 case "$xxx_convert" in
7248 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7249 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7250 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7251 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7255 : check for length of double
7257 case "$doublesize" in
7259 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7260 $cat >try.c <<'EOCP'
7264 printf("%d\n", (int)sizeof(double));
7269 if eval $compile_ok; then
7271 $echo " $doublesize bytes." >&4
7274 echo "(I can't seem to compile the test program. Guessing...)"
7275 rp="What is the size of a double precision number (in bytes)?"
7283 : check for long doubles
7285 $echo $n "Checking to see if your system supports long double..." $c >&4
7286 echo 'int main() { long double x = 7.0; }' > try.c
7288 if eval $compile; then
7290 echo " Yes, it does." >&4
7293 echo " No, it doesn't." >&4
7299 : check for length of long double
7300 case "${d_longdbl}${longdblsize}" in
7303 $echo $n "Checking to see how big your long doubles are..." $c >&4
7304 $cat >try.c <<'EOCP'
7308 printf("%d\n", sizeof(long double));
7313 if eval $compile; then
7314 longdblsize=`./try$exe_ext`
7315 $echo " $longdblsize bytes." >&4
7319 echo "(I can't seem to compile the test program. Guessing...)" >&4
7320 rp="What is the size of a long double (in bytes)?"
7324 if $test "X$doublesize" = "X$longdblsize"; then
7325 echo "(That isn't any different from an ordinary double.)"
7333 if $test X"$d_longdbl" = X"$define"; then
7335 echo "Checking how to print long doubles..." >&4
7337 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7338 $cat >try.c <<'EOCP'
7339 #include <sys/types.h>
7343 printf("%.3f\n", d);
7347 if eval $compile; then
7351 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7352 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7353 echo "We will use %f."
7359 if $test X"$sPRIfldbl" = X; then
7360 $cat >try.c <<'EOCP'
7361 #include <sys/types.h>
7364 long double d = 123.456;
7365 printf("%.3llf\n", d);
7369 if eval $compile; then
7373 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7374 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7375 echo "We will use %llf."
7381 if $test X"$sPRIfldbl" = X; then
7382 $cat >try.c <<'EOCP'
7383 #include <sys/types.h>
7386 long double d = 123.456;
7387 printf("%.3Lf\n", d);
7391 if eval $compile; then
7395 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7396 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7397 echo "We will use %Lf."
7403 if $test X"$sPRIfldbl" = X; then
7404 $cat >try.c <<'EOCP'
7405 #include <sys/types.h>
7408 long double d = 123.456;
7409 printf("%.3lf\n", d);
7413 if eval $compile; then
7417 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7418 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7419 echo "We will use %lf."
7425 if $test X"$sPRIfldbl" = X; then
7426 echo "Cannot figure out how to print long doubles." >&4
7433 case "$sPRIfldbl" in
7434 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7435 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7437 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7438 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7442 : Initialize h_fcntl
7445 : Initialize h_sysfile
7448 : access call always available on UNIX
7452 : locate the flags for 'access()'
7456 $cat >access.c <<'EOCP'
7457 #include <sys/types.h>
7462 #include <sys/file.h>
7471 : check sys/file.h first, no particular reason here
7472 if $test `./findhdr sys/file.h` && \
7473 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7475 echo "<sys/file.h> defines the *_OK access constants." >&4
7476 elif $test `./findhdr fcntl.h` && \
7477 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7479 echo "<fcntl.h> defines the *_OK access constants." >&4
7480 elif $test `./findhdr unistd.h` && \
7481 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7482 echo "<unistd.h> defines the *_OK access constants." >&4
7484 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7490 : see if accessx exists
7491 set accessx d_accessx
7494 : see if alarm exists
7498 : see if atolf exists
7502 : see if atoll exists
7506 : Look for GNU-cc style attribute checking
7508 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7509 $cat >attrib.c <<'EOCP'
7511 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7513 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7514 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7515 echo "Your C compiler doesn't fully support __attribute__."
7518 echo "Your C compiler supports __attribute__."
7522 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7529 : see if bcmp exists
7533 : see if bcopy exists
7537 : see if this is a unistd.h system
7538 set unistd.h i_unistd
7541 : see if getpgrp exists
7542 set getpgrp d_getpgrp
7545 case "$d_getpgrp" in
7548 echo "Checking to see which flavor of getpgrp is in use..."
7551 #include <sys/types.h>
7553 # include <unistd.h>
7557 if (getuid() == 0) {
7558 printf("(I see you are running Configure as super-user...)\n");
7562 if (getpgrp(1) == 0)
7571 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7572 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7574 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7575 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7578 echo "I can't seem to compile and run the test program."
7580 xxx="a USG one, i.e. you use getpgrp()."
7582 # SVR4 systems can appear rather BSD-ish.
7585 xxx="a BSD one, i.e. you use getpgrp(pid)."
7589 xxx="probably a USG one, i.e. you use getpgrp()."
7594 echo "Assuming your getpgrp is $xxx" >&4
7603 : see if setpgrp exists
7604 set setpgrp d_setpgrp
7607 case "$d_setpgrp" in
7610 echo "Checking to see which flavor of setpgrp is in use..."
7613 #include <sys/types.h>
7615 # include <unistd.h>
7619 if (getuid() == 0) {
7620 printf("(I see you are running Configure as super-user...)\n");
7624 if (-1 == setpgrp(1, 1))
7627 if (setpgrp() != -1)
7633 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7634 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7636 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7637 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7640 echo "(I can't seem to compile and run the test program.)"
7642 xxx="a USG one, i.e. you use setpgrp()."
7644 # SVR4 systems can appear rather BSD-ish.
7647 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7651 xxx="probably a USG one, i.e. you use setpgrp()."
7656 echo "Assuming your setpgrp is $xxx" >&4
7664 : see if bzero exists
7668 : see if signal is declared as pointer to function returning int or void
7670 xxx=`./findhdr signal.h`
7671 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7672 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7673 echo "You have int (*signal())() instead of void." >&4
7675 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7676 echo "You have void (*signal())()." >&4
7678 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7679 echo "You have int (*signal())() instead of void." >&4
7681 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7682 echo "You have void (*signal())()." >&4
7685 case "$d_voidsig" in
7687 echo "I can't determine whether signal handler returns void or int..." >&4
7689 rp="What type does your signal handler return?"
7696 echo "As you already told me, signal handler returns void." >&4
7699 *) echo "As you already told me, signal handler returns int." >&4
7706 case "$d_voidsig" in
7707 "$define") signal_t="void";;
7712 : check for ability to cast large floats to 32-bit ints.
7714 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7715 if $test "$intsize" -ge 4; then
7722 #include <sys/types.h>
7724 $signal_t blech(s) int s; { exit(3); }
7731 signal(SIGFPE, blech);
7733 /* Don't let compiler optimize the test away. Store the number
7734 in a writable string for gcc to pass to sscanf under HP/UX.
7736 sprintf(str, "2147483647");
7737 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7741 /* x86 processors will probably give 0x8000 0000, which is a
7742 sign change. We don't want that. We want to mimic SPARC
7743 behavior here, which is to preserve the sign and give
7746 if (i32 != ($xxx) f)
7752 if eval $compile_ok; then
7756 echo "(I can't seem to compile the test program--assuming it can't)"
7764 echo "Nope, it can't."
7771 : check for ability to cast negative floats to unsigned
7773 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7776 #include <sys/types.h>
7778 $signal_t blech(s) int s; { exit(7); }
7779 $signal_t blech_in_list(s) int s; { exit(4); }
7780 unsigned long dummy_long(p) unsigned long p; { return p; }
7781 unsigned int dummy_int(p) unsigned int p; { return p; }
7782 unsigned short dummy_short(p) unsigned short p; { return p; }
7786 unsigned long along;
7788 unsigned short ashort;
7792 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7793 a direct f = -123. assignment. gcc-2.8.0 reportedly
7794 optimized the whole file away
7796 /* Store the number in a writable string for gcc to pass to
7799 sprintf(str, "-123");
7800 sscanf(str, "%lf", &f); /* f = -123.; */
7802 signal(SIGFPE, blech);
7803 along = (unsigned long)f;
7804 aint = (unsigned int)f;
7805 ashort = (unsigned short)f;
7806 if (along != (unsigned long)-123)
7808 if (aint != (unsigned int)-123)
7810 if (ashort != (unsigned short)-123)
7812 sprintf(str, "1073741824.");
7813 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7816 along = (unsigned long)f;
7817 if (along != 0x80000000)
7821 along = (unsigned long)f;
7822 if (along != 0x7fffffff)
7826 along = (unsigned long)f;
7827 if (along != 0x80000001)
7831 signal(SIGFPE, blech_in_list);
7832 sprintf(str, "123.");
7833 sscanf(str, "%lf", &f); /* f = 123.; */
7834 along = dummy_long((unsigned long)f);
7835 aint = dummy_int((unsigned int)f);
7836 ashort = dummy_short((unsigned short)f);
7837 if (along != (unsigned long)123)
7839 if (aint != (unsigned int)123)
7841 if (ashort != (unsigned short)123)
7848 if eval $compile_ok; then
7852 echo "(I can't seem to compile the test program--assuming it can't)"
7855 case "$castflags" in
7860 echo "Nope, it can't."
7867 : see if vprintf exists
7869 if set vprintf val -f d_vprintf; eval $csym; $val; then
7870 echo 'vprintf() found.' >&4
7872 $cat >vprintf.c <<'EOF'
7873 #include <varargs.h>
7875 int main() { xxx("foo"); }
7884 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7888 if eval $compile && ./vprintf; then
7889 echo "Your vsprintf() returns (int)." >&4
7892 echo "Your vsprintf() returns (char*)." >&4
7896 echo 'vprintf() NOT found.' >&4
7906 : see if chown exists
7910 : see if chroot exists
7914 : see if chsize exists
7918 : check for const keyword
7920 echo 'Checking to see if your C compiler knows about "const"...' >&4
7921 $cat >const.c <<'EOCP'
7922 typedef struct spug { int drokk; } spug;
7929 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7931 echo "Yup, it does."
7934 echo "Nope, it doesn't."
7939 : see if crypt exists
7941 if set crypt val -f d_crypt; eval $csym; $val; then
7942 echo 'crypt() found.' >&4
7946 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7947 if $test -z "$cryptlib"; then
7948 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7952 if $test -z "$cryptlib"; then
7953 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7957 if $test -z "$cryptlib"; then
7958 cryptlib=`./loc libcrypt$_a "" $libpth`
7962 if $test -z "$cryptlib"; then
7963 echo 'crypt() NOT found.' >&4
7972 : get csh whereabouts
7974 'csh') val="$undef" ;;
7979 : Respect a hint or command line value for full_csh.
7981 '') full_csh=$csh ;;
7984 : see if cuserid exists
7985 set cuserid d_cuserid
7988 : see if this is a limits.h system
7989 set limits.h i_limits
7992 : see if this is a float.h system
7996 : See if number of significant digits in a double precision number is known
7998 $cat >dbl_dig.c <<EOM
8008 printf("Contains DBL_DIG");
8011 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8012 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8013 echo "DBL_DIG found." >&4
8016 echo "DBL_DIG NOT found." >&4
8023 : see if difftime exists
8024 set difftime d_difftime
8027 : see if this is a dirent system
8029 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8031 echo "<dirent.h> found." >&4
8034 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8035 echo "<sys/dir.h> found." >&4
8038 xinc=`./findhdr sys/ndir.h`
8040 echo "<dirent.h> NOT found." >&4
8045 : Look for type of directory structure.
8047 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8049 case "$direntrytype" in
8052 $define) guess1='struct dirent' ;;
8053 *) guess1='struct direct' ;;
8056 *) guess1="$direntrytype"
8061 'struct dirent') guess2='struct direct' ;;
8062 *) guess2='struct dirent' ;;
8065 if $contains "$guess1" try.c >/dev/null 2>&1; then
8066 direntrytype="$guess1"
8067 echo "Your directory entries are $direntrytype." >&4
8068 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8069 direntrytype="$guess2"
8070 echo "Your directory entries seem to be $direntrytype." >&4
8072 echo "I don't recognize your system's directory entries." >&4
8073 rp="What type is used for directory entries on this system?"
8081 : see if the directory entry stores field length
8083 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8084 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8085 echo "Good, your directory entry keeps length information in d_namlen." >&4
8088 echo "Your directory entry does not know about the d_namlen field." >&4
8095 : see if dlerror exists
8098 set dlerror d_dlerror
8102 : see if dlfcn is available
8110 On a few systems, the dynamically loaded modules that perl generates and uses
8111 will need a different extension than shared libs. The default will probably
8119 rp='What is the extension of dynamically loaded modules'
8128 : Check if dlsym need a leading underscore
8134 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8135 $cat >dyna.c <<'EOM'
8144 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8146 #include <sys/types.h>
8160 int mode = RTLD_LAZY ;
8162 handle = dlopen("./dyna.$dlext", mode) ;
8163 if (handle == NULL) {
8168 symbol = dlsym(handle, "fred") ;
8169 if (symbol == NULL) {
8170 /* try putting a leading underscore */
8171 symbol = dlsym(handle, "_fred") ;
8172 if (symbol == NULL) {
8185 : Call the object file tmp-dyna.o in case dlext=o.
8186 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8187 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8188 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8189 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8192 1) echo "Test program failed using dlopen." >&4
8193 echo "Perhaps you should not use dynamic loading." >&4;;
8194 2) echo "Test program failed using dlsym." >&4
8195 echo "Perhaps you should not use dynamic loading." >&4;;
8196 3) echo "dlsym needs a leading underscore" >&4
8198 4) echo "dlsym doesn't need a leading underscore." >&4;;
8201 echo "I can't compile and run the test program." >&4
8202 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8207 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8212 hasproto='varname=$1; func=$2; shift; shift;
8213 while $test $# -ge 2; do
8215 $define) echo "#include <$2>";;
8219 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8220 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8221 echo "$func() prototype found.";
8224 echo "$func() prototype NOT found.";
8229 $rm -f try.c tryout.c'
8231 : see if prototype for drand48 is available
8233 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8236 : see if dup2 exists
8240 : see if eaccess exists
8241 set eaccess d_eaccess
8244 : see if endgrent exists
8245 set endgrent d_endgrent
8248 : see if endhostent exists
8249 set endhostent d_endhent
8252 : see if endnetent exists
8253 set endnetent d_endnent
8256 : see if endprotoent exists
8257 set endprotoent d_endpent
8260 : see if endpwent exists
8261 set endpwent d_endpwent
8264 : see if endservent exists
8265 set endservent d_endsent
8268 : see if endspent exists
8269 set endspent d_endspent
8272 : Locate the flags for 'open()'
8274 $cat >open3.c <<'EOCP'
8275 #include <sys/types.h>
8280 #include <sys/file.h>
8291 : check sys/file.h first to get FREAD on Sun
8292 if $test `./findhdr sys/file.h` && \
8293 set open3 -DI_SYS_FILE && eval $compile; then
8295 echo "<sys/file.h> defines the O_* constants..." >&4
8297 echo "and you have the 3 argument form of open()." >&4
8300 echo "but not the 3 argument form of open(). Oh, well." >&4
8303 elif $test `./findhdr fcntl.h` && \
8304 set open3 -DI_FCNTL && eval $compile; then
8306 echo "<fcntl.h> defines the O_* constants..." >&4
8308 echo "and you have the 3 argument form of open()." >&4
8311 echo "but not the 3 argument form of open(). Oh, well." >&4
8316 echo "I can't find the O_* constant definitions! You got problems." >&4
8322 : see which of string.h or strings.h is needed
8324 strings=`./findhdr string.h`
8325 if $test "$strings" && $test -r "$strings"; then
8326 echo "Using <string.h> instead of <strings.h>." >&4
8330 strings=`./findhdr strings.h`
8331 if $test "$strings" && $test -r "$strings"; then
8332 echo "Using <strings.h> instead of <string.h>." >&4
8334 echo "No string header found -- You'll surely have problems." >&4
8340 "$undef") strings=`./findhdr strings.h`;;
8341 *) strings=`./findhdr string.h`;;
8344 : check for non-blocking I/O stuff
8345 case "$h_sysfile" in
8346 true) echo "#include <sys/file.h>" > head.c;;
8349 true) echo "#include <fcntl.h>" > head.c;;
8350 *) echo "#include <sys/fcntl.h>" > head.c;;
8355 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8356 case "$o_nonblock" in
8359 $cat >>try.c <<'EOCP'
8363 printf("O_NONBLOCK\n");
8367 printf("O_NDELAY\n");
8371 printf("FNDELAY\n");
8378 if eval $compile_ok; then
8380 case "$o_nonblock" in
8381 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8382 *) echo "Seems like we can use $o_nonblock.";;
8385 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8388 *) echo "Using $hint value $o_nonblock.";;
8390 $rm -f try try.* .out core
8393 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8399 #include <sys/types.h>
8402 #define MY_O_NONBLOCK $o_nonblock
8403 #ifndef errno /* XXX need better Configure test */
8413 #include <strings.h>
8415 $signal_t blech(x) int x; { exit(3); }
8417 $cat >> try.c <<'EOCP'
8425 pipe(pd); /* Down: child -> parent */
8426 pipe(pu); /* Up: parent -> child */
8429 close(pd[1]); /* Parent reads from pd[0] */
8430 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8431 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8433 signal(SIGALRM, blech);
8435 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8437 sprintf(string, "%d\n", ret);
8438 write(2, string, strlen(string));
8441 if (errno == EAGAIN) {
8447 if (errno == EWOULDBLOCK)
8448 printf("EWOULDBLOCK\n");
8451 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8452 sleep(2); /* Give it time to close our pipe */
8454 ret = read(pd[0], buf, 1); /* Should read EOF */
8456 sprintf(string, "%d\n", ret);
8457 write(3, string, strlen(string));
8461 close(pd[0]); /* We write to pd[1] */
8462 close(pu[1]); /* We read from pu[0] */
8463 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8464 close(pd[1]); /* Pipe pd is now fully closed! */
8465 exit(0); /* Bye bye, thank you for playing! */
8469 if eval $compile_ok; then
8470 echo "$startsh" >mtry
8471 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8473 ./mtry >/dev/null 2>&1
8475 0) eagain=`$cat try.out`;;
8476 1) echo "Could not perform non-blocking setting!";;
8477 2) echo "I did a successful read() for something that was not there!";;
8478 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8479 *) echo "Something terribly wrong happened during testing.";;
8481 rd_nodata=`$cat try.ret`
8482 echo "A read() system call with no data present returns $rd_nodata."
8483 case "$rd_nodata" in
8486 echo "(That's peculiar, fixing that to be -1.)"
8492 echo "Forcing errno EAGAIN on read() with no data available."
8496 echo "Your read() sets errno to $eagain when no data is available."
8499 status=`$cat try.err`
8501 0) echo "And it correctly returns 0 to signal EOF.";;
8502 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8503 *) echo "However, your read() returns '$status' on EOF??";;
8506 if test "$status" = "$rd_nodata"; then
8507 echo "WARNING: you can't distinguish between EOF and no data!"
8511 echo "I can't compile the test program--assuming errno EAGAIN will do."
8518 echo "Using $hint value $eagain."
8519 echo "Your read() returns $rd_nodata when no data is present."
8520 case "$d_eofnblk" in
8521 "$define") echo "And you can see EOF because read() returns 0.";;
8522 "$undef") echo "But you can't see EOF status from read() returned value.";;
8524 echo "(Assuming you can't see EOF status from read anyway.)"
8530 $rm -f try try.* .out core head.c mtry
8532 : see if fchmod exists
8536 : see if fchown exists
8540 : see if this is an fcntl system
8544 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8545 while $test $# -ge 2; do
8547 $define) echo "#include <$2>";;
8551 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8553 if eval $compile; then
8564 : see whether socket exists
8566 $echo $n "Hmm... $c" >&4
8567 if set socket val -f d_socket; eval $csym; $val; then
8568 echo "Looks like you have Berkeley networking support." >&4
8570 if set setsockopt val -f; eval $csym; $val; then
8573 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8577 if $contains socklib libc.list >/dev/null 2>&1; then
8578 echo "Looks like you have Berkeley networking support." >&4
8580 : we will have to assume that it supports the 4.2 BSD interface
8583 echo "You don't have Berkeley networking in libc$_a..." >&4
8584 if test "X$d_socket" = "X$define"; then
8585 echo "...but you seem to believe that you have sockets." >&4
8587 for net in net socket
8589 if test -f /usr/lib/lib$net$_a; then
8590 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8591 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8592 if $contains socket libc.list >/dev/null 2>&1; then
8597 echo "...but the Wollongong group seems to have hacked it in." >&4
8598 sockethdr="-I/usr/netinclude"
8601 echo "Found Berkeley sockets interface in lib$net." >& 4
8602 if $contains setsockopt libc.list >/dev/null 2>&1; then
8605 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8612 if test "X$d_socket" != "X$define"; then
8613 echo "or anywhere else I see." >&4
8621 : see if socketpair exists
8622 set socketpair d_sockpair
8627 echo "Checking the availability of certain socket constants..." >& 4
8628 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8629 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8631 #include <sys/types.h>
8632 #include <sys/socket.h>
8638 set try; if eval $compile; then
8641 set d_${enum}; eval $setvar
8645 : see if sys/select.h has to be included
8646 set sys/select.h i_sysselct
8649 : see if we should include time.h, sys/time.h, or both
8651 if test "X$timeincl" = X; then
8652 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8653 $echo $n "I'm now running the test program...$c"
8654 $cat >try.c <<'EOCP'
8655 #include <sys/types.h>
8660 #ifdef SYSTIMEKERNEL
8663 #include <sys/time.h>
8666 #include <sys/select.h>
8675 struct timezone tzp;
8677 if (foo.tm_sec == foo.tm_sec)
8680 if (bar.tv_sec == bar.tv_sec)
8687 for s_timezone in '-DS_TIMEZONE' ''; do
8689 for s_timeval in '-DS_TIMEVAL' ''; do
8690 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8691 for i_time in '' '-DI_TIME'; do
8692 for i_systime in '-DI_SYSTIME' ''; do
8695 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8696 if eval $compile; then
8697 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8701 $echo $n "Succeeded with $flags$c"
8713 *SYSTIMEKERNEL*) i_systimek="$define"
8714 timeincl=`./findhdr sys/time.h`
8715 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8716 *) i_systimek="$undef";;
8719 *I_TIME*) i_time="$define"
8720 timeincl=`./findhdr time.h`" $timeincl"
8721 echo "We'll include <time.h>." >&4;;
8722 *) i_time="$undef";;
8725 *I_SYSTIME*) i_systime="$define"
8726 timeincl=`./findhdr sys/time.h`" $timeincl"
8727 echo "We'll include <sys/time.h>." >&4;;
8728 *) i_systime="$undef";;
8733 : check for fd_set items
8736 Checking to see how well your C compiler handles fd_set and friends ...
8738 $cat >fd_set.c <<EOCP
8739 #$i_systime I_SYS_TIME
8740 #$i_sysselct I_SYS_SELECT
8741 #$d_socket HAS_SOCKET
8742 #include <sys/types.h>
8744 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8747 #include <sys/time.h>
8750 #include <sys/select.h>
8759 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8766 set fd_set -DTRYBITS
8767 if eval $compile; then
8768 d_fds_bits="$define"
8770 echo "Well, your system knows about the normal fd_set typedef..." >&4
8772 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8773 d_fd_macros="$define"
8776 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8778 d_fd_macros="$undef"
8782 Hmm, your compiler has some difficulty with fd_set. Checking further...
8785 if eval $compile; then
8788 echo "Well, your system has some sort of fd_set available..." >&4
8790 echo "and you have the normal fd_set macros." >&4
8791 d_fd_macros="$define"
8794 but not the normal fd_set macros! Gross! More work for me...
8796 d_fd_macros="$undef"
8799 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8802 d_fd_macros="$undef"
8807 : see if fgetpos exists
8808 set fgetpos d_fgetpos
8811 : see if flock exists
8815 : see if fork exists
8819 : see if pathconf exists
8820 set pathconf d_pathconf
8823 : see if fpathconf exists
8824 set fpathconf d_fpathconf
8830 echo "Checking to see if your system supports off64_t..." >&4
8832 #include <sys/types.h>
8834 int main() { off64_t x = 7; }'
8837 if eval $compile; then
8839 echo "Yes, it does."
8842 echo "No, it doesn't."
8843 case "$lseeksize" in
8844 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
8851 : check for fpos64_t
8853 echo "Checking to see if your system supports fpos64_t..." >&4
8855 #include <sys/stdio.h>
8856 int main() { fpos64_t x x = 7; }'
8859 if eval $compile; then
8861 echo "Yes, it does."
8864 echo "No, it doesn't."
8866 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
8873 hasstruct='varname=$1; struct=$2; shift; shift;
8874 while $test $# -ge 2; do
8876 $define) echo "#include <$2>";;
8880 echo "int main () { struct $struct foo; }" >> try.c;
8882 if eval $compile; then
8891 : see if this is a sys/param system
8892 set sys/param.h i_sysparam
8895 : see if this is a sys/mount.h system
8896 set sys/mount.h i_sysmount
8899 : see if sys/types.h has to be included
8900 set sys/types.h i_systypes
8905 echo "Checking to see if your system supports struct fs_data..." >&4
8906 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8908 case "$d_fs_data_s" in
8909 "$define") echo "Yes, it does." ;;
8910 *) echo "No, it doesn't." ;;
8913 : see if fseeko exists
8917 8) echo "(Your long is 64 bits, so in a pinch you could use fseek.)" ;;
8920 : see if fsetpos exists
8921 set fsetpos d_fsetpos
8925 : see if fstatfs exists
8926 set fstatfs d_fstatfs
8930 : see if statvfs exists
8931 set statvfs d_statvfs
8934 : see if fstatvfs exists
8935 set fstatvfs d_fstatvfs
8939 : see if ftello exists
8943 8) echo "(Your long is 64 bits, so in a pinch you could use ftell.)" ;;
8946 : see if getgrent exists
8947 set getgrent d_getgrent
8950 : see if gethostbyaddr exists
8951 set gethostbyaddr d_gethbyaddr
8954 : see if gethostbyname exists
8955 set gethostbyname d_gethbyname
8958 : see if gethostent exists
8959 set gethostent d_gethent
8962 : see how we will look up host name
8965 if set gethostname val -f d_gethname; eval $csym; $val; then
8966 echo 'gethostname() found.' >&4
8967 d_gethname="$define"
8970 if set uname val -f d_uname; eval $csym; $val; then
8973 uname() was found, but you're running xenix, and older versions of xenix
8974 have a broken uname(). If you don't really know whether your xenix is old
8975 enough to have a broken system call, use the default answer.
8982 rp='Is your uname() broken?'
8985 n*) d_uname="$define"; call=uname;;
8988 echo 'uname() found.' >&4
8995 case "$d_gethname" in
8996 '') d_gethname="$undef";;
8999 '') d_uname="$undef";;
9001 case "$d_uname$d_gethname" in
9006 Every now and then someone has a $call() that lies about the hostname
9007 but can't be fixed for political or economic reasons. If you wish, I can
9008 pretend $call() isn't there and maybe compute hostname at run-time
9009 thanks to the '$phostname' command.
9012 rp="Shall I ignore $call() from now on?"
9015 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9018 case "$phostname" in
9020 *) case "$aphostname" in
9026 file=`./loc $file $file $pth`
9027 aphostname=`echo $file $*`
9032 case "$d_uname$d_gethname" in
9035 case "$phostname" in
9037 echo "There will be no way for $package to get your hostname." >&4;;
9039 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9043 case "$d_phostname" in
9044 '') d_phostname="$undef";;
9047 : see if this is a netdb.h system
9051 : see if prototypes for various gethostxxx netdb.h functions are available
9053 set d_gethostprotos gethostent $i_netdb netdb.h
9056 : see if getlogin exists
9057 set getlogin d_getlogin
9060 : see if getmnt exists
9064 : see if getmntent exists
9065 set getmntent d_getmntent
9068 : see if getnetbyaddr exists
9069 set getnetbyaddr d_getnbyaddr
9072 : see if getnetbyname exists
9073 set getnetbyname d_getnbyname
9076 : see if getnetent exists
9077 set getnetent d_getnent
9080 : see if prototypes for various getnetxxx netdb.h functions are available
9082 set d_getnetprotos getnetent $i_netdb netdb.h
9086 : see if getprotobyname exists
9087 set getprotobyname d_getpbyname
9090 : see if getprotobynumber exists
9091 set getprotobynumber d_getpbynumber
9094 : see if getprotoent exists
9095 set getprotoent d_getpent
9098 : see if getpgid exists
9099 set getpgid d_getpgid
9102 : see if getpgrp2 exists
9103 set getpgrp2 d_getpgrp2
9106 : see if getppid exists
9107 set getppid d_getppid
9110 : see if getpriority exists
9111 set getpriority d_getprior
9114 : see if prototypes for various getprotoxxx netdb.h functions are available
9116 set d_getprotoprotos getprotoent $i_netdb netdb.h
9119 : see if getpwent exists
9120 set getpwent d_getpwent
9124 : see if getservbyname exists
9125 set getservbyname d_getsbyname
9128 : see if getservbyport exists
9129 set getservbyport d_getsbyport
9132 : see if getservent exists
9133 set getservent d_getsent
9136 : see if prototypes for various getservxxx netdb.h functions are available
9138 set d_getservprotos getservent $i_netdb netdb.h
9141 : see if getspent exists
9142 set getspent d_getspent
9145 : see if getspnam exists
9146 set getspnam d_getspnam
9149 : see if gettimeofday or ftime exists
9150 set gettimeofday d_gettimeod
9152 case "$d_gettimeod" in
9158 val="$undef"; set d_ftime; eval $setvar
9161 case "$d_gettimeod$d_ftime" in
9164 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9168 : see if this is an grp system
9174 xxx=`./findhdr grp.h`
9175 $cppstdin $cppflags $cppminus < $xxx >$$.h
9177 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9189 set d_grpasswd; eval $setvar
9193 : see if hasmntopt exists
9194 set hasmntopt d_hasmntopt
9197 : see if this is a netinet/in.h or sys/in.h system
9198 set netinet/in.h i_niin sys/in.h i_sysin
9201 : see if arpa/inet.h has to be included
9202 set arpa/inet.h i_arpainet
9205 : see if htonl --and friends-- exists
9210 : Maybe they are macros.
9215 #include <sys/types.h>
9216 #$i_niin I_NETINET_IN
9218 #$i_arpainet I_ARPA_INET
9220 #include <netinet/in.h>
9226 #include <arpa/inet.h>
9229 printf("Defined as a macro.");
9232 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9233 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9235 echo "But it seems to be defined as a macro." >&4
9245 if set index val -f; eval $csym; $val; then
9246 if set strchr val -f d_strchr; eval $csym; $val; then
9247 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9250 echo "strchr() found." >&4
9254 echo "index() found." >&4
9259 echo "index() found." >&4
9262 if set strchr val -f d_strchr; eval $csym; $val; then
9265 echo "strchr() found." >&4
9267 echo "No index() or strchr() found!" >&4
9272 set d_strchr; eval $setvar
9274 set d_index; eval $setvar
9276 : check whether inet_aton exists
9277 set inet_aton d_inetaton
9282 $cat >isascii.c <<'EOCP'
9294 if eval $compile; then
9295 echo "isascii() found." >&4
9298 echo "isascii() NOT found." >&4
9305 : see if killpg exists
9309 : see if lchown exists
9311 $cat > try.c <<'EOCP'
9312 /* System header to define __stub macros and hopefully few prototypes,
9313 which can conflict with char lchown(); below. */
9315 /* Override any gcc2 internal prototype to avoid an error. */
9316 /* We use char because int might match the return type of a gcc2
9317 builtin and then its argument prototype would still apply. */
9320 /* The GNU C library defines this for functions which it implements
9321 to always fail with ENOSYS. Some functions are actually named
9322 something starting with __ and the normal name is an alias. */
9323 #if defined (__stub_lchown) || defined (__stub___lchown)
9331 if eval $compile; then
9332 $echo "lchown() found." >&4
9335 $echo "lchown() NOT found." >&4
9341 : See if number of significant digits in a double precision number is known
9343 $cat >ldbl_dig.c <<EOM
9353 printf("Contains LDBL_DIG");
9356 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9357 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9358 echo "LDBL_DIG found." >&4
9361 echo "LDBL_DIG NOT found." >&4
9368 : see if link exists
9372 : see if localeconv exists
9373 set localeconv d_locconv
9376 : see if lockf exists
9380 : check for long long
9382 $echo $n "Checking to see if your system supports long long..." $c >&4
9383 echo 'int main() { long long x = 7; return 0; }' > try.c
9385 if eval $compile; then
9387 echo " Yes, it does." >&4
9390 echo " No, it doesn't." >&4
9396 : check for length of long long
9397 case "${d_longlong}${longlongsize}" in
9400 $echo $n "Checking to see how big your long longs are..." $c >&4
9401 $cat >try.c <<'EOCP'
9405 printf("%d\n", (int)sizeof(long long));
9410 if eval $compile_ok; then
9411 longlongsize=`./try$exe_ext`
9412 $echo " $longlongsize bytes." >&4
9416 echo "(I can't seem to compile the test program. Guessing...)"
9417 rp="What is the size of a long long (in bytes)?"
9421 if $test "X$longsize" = "X$longlongsize"; then
9422 echo "(That isn't any different from an ordinary long.)"
9428 : see if lstat exists
9432 : see if mblen exists
9436 : see if mbstowcs exists
9437 set mbstowcs d_mbstowcs
9440 : see if mbtowc exists
9444 : see if memchr exists
9448 : see if memcmp exists
9452 : see if memcpy exists
9456 : see if memmove exists
9457 set memmove d_memmove
9460 : see if memset exists
9464 : see if mkdir exists
9468 : see if mkfifo exists
9472 : see if mktime exists
9476 : see if msgctl exists
9480 : see if msgget exists
9484 : see if msgsnd exists
9488 : see if msgrcv exists
9492 : see how much of the 'msg*(2)' library is present.
9495 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9496 *"$undef"*) h_msg=false;;
9500 case "`ipcs 2>&1`" in
9501 "SVID messages"*"not configured"*)
9502 echo "Your $osname does not have the msg*(2) configured." >&4
9517 : we could also check for sys/ipc.h ...
9518 if $h_msg && $test `./findhdr sys/msg.h`; then
9519 echo "You have the full msg*(2) library." >&4
9522 echo "You don't have the full msg*(2) library." >&4
9528 : see if nice exists
9532 : see if POSIX threads are available
9533 set pthread.h i_pthread
9539 : how to create joinable pthreads
9540 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9542 echo "Checking what constant to use for creating joinable pthreads..." >&4
9543 $cat >try.c <<'EOCP'
9544 #include <pthread.h>
9546 int detachstate = JOINABLE;
9549 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9550 if eval $compile; then
9551 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9552 val="$undef" # Yes, undef.
9553 set d_old_pthread_create_joinable
9556 set old_pthread_create_joinable
9559 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9560 if eval $compile; then
9561 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9563 set d_old_pthread_create_joinable
9565 val=PTHREAD_CREATE_UNDETACHED
9566 set old_pthread_create_joinable
9569 set try -DJOINABLE=__UNDETACHED
9570 if eval $compile; then
9571 echo "You seem to use __UNDETACHED." >&4
9573 set d_old_pthread_create_joinable
9576 set old_pthread_create_joinable
9579 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9581 set d_old_pthread_create_joinable
9584 set old_pthread_create_joinable
9591 d_old_pthread_create_joinable="$undef"
9592 old_pthread_create_joinable=""
9595 : see if pause exists
9599 : see if pipe exists
9603 : see if poll exists
9608 : see whether the various POSIXish _yields exist
9610 #include <pthread.h>
9616 #ifdef PTHREAD_YIELD
9619 #ifdef PTHREAD_YIELD_NULL
9620 pthread_yield(NULL);
9626 : see if sched_yield exists
9627 set try -DSCHED_YIELD
9628 if eval $compile; then
9630 sched_yield='sched_yield()'
9634 case "$usethreads" in
9637 $define) echo 'sched_yield() found.' >&4 ;;
9638 *) echo 'sched_yield() NOT found.' >&4 ;;
9644 : see if pthread_yield exists
9645 set try -DPTHREAD_YIELD
9646 if eval $compile; then
9648 case "$sched_yield" in
9649 '') sched_yield='pthread_yield()' ;;
9652 set try -DPTHREAD_YIELD_NULL
9653 if eval $compile; then
9655 case "$sched_yield" in
9656 '') sched_yield='pthread_yield(NULL)' ;;
9662 case "$usethreads" in
9665 $define) echo 'pthread_yield() found.' >&4 ;;
9666 *) echo 'pthread_yield() NOT found.' >&4 ;;
9673 case "$sched_yield" in
9674 '') sched_yield=undef ;;
9679 : see if this is a pwd.h system
9685 xxx=`./findhdr pwd.h`
9686 $cppstdin $cppflags $cppminus < $xxx >$$.h
9688 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9696 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9704 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9712 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9720 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9728 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9736 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9744 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9756 set d_pwquota; eval $setvar
9757 set d_pwage; eval $setvar
9758 set d_pwchange; eval $setvar
9759 set d_pwclass; eval $setvar
9760 set d_pwexpire; eval $setvar
9761 set d_pwcomment; eval $setvar
9762 set d_pwgecos; eval $setvar
9763 set d_pwpasswd; eval $setvar
9767 : see if inttypes.h is available
9768 : we want a real compile instead of Inhdr because some systems
9769 : have an inttypes.h which includes non-existent headers
9772 #include <inttypes.h>
9774 static int32_t foo32 = 0x12345678;
9778 if eval $compile; then
9779 echo "<inttypes.h> found." >&4
9782 echo "<inttypes.h> NOT found." >&4
9791 $echo $n "Checking to see if your system supports int64_t...$c" >&4
9793 #include <sys/types.h>
9794 #$i_inttypes I_INTTYPES
9796 #include <inttypes.h>
9798 int main() { int64_t x = 7; }
9801 if eval $compile; then
9803 echo " Yes, it does." >&4
9806 echo " No, it doesn't." >&4
9814 echo "Checking which 64-bit integer type we could use..." >&4
9820 val='"unsigned int"'
9825 *) case "$longsize" in
9829 val='"unsigned long"'
9834 *) case "$uselonglong:$d_longlong:$longlongsize" in
9839 val='"unsigned long long"'
9844 *) case "$d_int64t" in
9863 '') case "$uselonglong:$d_longlong:$longlongsize" in
9865 echo "(You would have 'long long', but you are not using it.)" >&4 ;;
9866 *) echo "Alas, no 64-bit integer types in sight." >&4 ;;
9870 *) if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then
9875 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9880 : see if readdir and friends exist
9881 set readdir d_readdir
9883 set seekdir d_seekdir
9885 set telldir d_telldir
9887 set rewinddir d_rewinddir
9890 : see if readlink exists
9891 set readlink d_readlink
9894 : see if rename exists
9898 : see if rmdir exists
9902 : see if memory.h is available.
9907 : See if it conflicts with string.h
9913 $cppstdin $cppflags $cppminus < $strings > mem.h
9914 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9916 echo "We won't be including <memory.h>."
9926 : can bcopy handle overlapping blocks?
9931 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9938 $cat >>try.c <<'EOCP'
9941 # include <memory.h>
9944 # include <stdlib.h>
9947 # include <string.h>
9949 # include <strings.h>
9952 # include <unistd.h> /* Needed for NetBSD */
9956 char buf[128], abc[128];
9962 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9964 for (align = 7; align >= 0; align--) {
9965 for (len = 36; len; len--) {
9968 for (off = 1; off <= len; off++) {
9969 bcopy(b, b+off, len);
9970 bcopy(b+off, b, len);
9971 if (bcmp(b, abc, len))
9980 if eval $compile_ok; then
9981 if ./try 2>/dev/null; then
9985 echo "It can't, sorry."
9986 case "$d_memmove" in
9987 "$define") echo "But that's Ok since you have memmove()." ;;
9991 echo "(I can't compile the test program, so we'll assume not...)"
9992 case "$d_memmove" in
9993 "$define") echo "But that's Ok since you have memmove()." ;;
9998 $rm -f try.* try core
10002 : can memcpy handle overlapping blocks?
10004 case "$d_memcpy" in
10007 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10009 #$i_memory I_MEMORY
10010 #$i_stdlib I_STDLIB
10011 #$i_string I_STRING
10012 #$i_unistd I_UNISTD
10014 $cat >>try.c <<'EOCP'
10017 # include <memory.h>
10020 # include <stdlib.h>
10023 # include <string.h>
10025 # include <strings.h>
10028 # include <unistd.h> /* Needed for NetBSD */
10032 char buf[128], abc[128];
10038 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10039 try to store the string in read-only memory. */
10040 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10042 for (align = 7; align >= 0; align--) {
10043 for (len = 36; len; len--) {
10045 memcpy(b, abc, len);
10046 for (off = 1; off <= len; off++) {
10047 memcpy(b+off, b, len);
10048 memcpy(b, b+off, len);
10049 if (memcmp(b, abc, len))
10058 if eval $compile_ok; then
10059 if ./try 2>/dev/null; then
10060 echo "Yes, it can."
10063 echo "It can't, sorry."
10064 case "$d_memmove" in
10065 "$define") echo "But that's Ok since you have memmove()." ;;
10069 echo "(I can't compile the test program, so we'll assume not...)"
10070 case "$d_memmove" in
10071 "$define") echo "But that's Ok since you have memmove()." ;;
10076 $rm -f try.* try core
10080 : can memcmp be trusted to compare relative magnitude?
10082 case "$d_memcmp" in
10085 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10087 #$i_memory I_MEMORY
10088 #$i_stdlib I_STDLIB
10089 #$i_string I_STRING
10090 #$i_unistd I_UNISTD
10092 $cat >>try.c <<'EOCP'
10095 # include <memory.h>
10098 # include <stdlib.h>
10101 # include <string.h>
10103 # include <strings.h>
10106 # include <unistd.h> /* Needed for NetBSD */
10112 if ((a < b) && memcmp(&a, &b, 1) < 0)
10118 if eval $compile_ok; then
10119 if ./try 2>/dev/null; then
10120 echo "Yes, it can."
10123 echo "No, it can't (it uses signed chars)."
10126 echo "(I can't compile the test program, so we'll assume not...)"
10130 $rm -f try.* try core
10134 : see if select exists
10135 set select d_select
10138 : see if semctl exists
10139 set semctl d_semctl
10142 : see if semget exists
10143 set semget d_semget
10146 : see if semop exists
10150 : see how much of the 'sem*(2)' library is present.
10153 case "$d_semctl$d_semget$d_semop" in
10154 *"$undef"*) h_sem=false;;
10158 case "`ipcs 2>&1`" in
10159 "SVID messages"*"not configured"*)
10160 echo "Your $osname does not have the sem*(2) configured." >&4
10163 set semctl d_semctl
10165 set semget d_semget
10173 : we could also check for sys/ipc.h ...
10174 if $h_sem && $test `./findhdr sys/sem.h`; then
10175 echo "You have the full sem*(2) library." >&4
10178 echo "You don't have the full sem*(2) library." >&4
10184 : see whether sys/sem.h defines union semun
10186 $cat > try.c <<'END'
10187 #include <sys/types.h>
10188 #include <sys/ipc.h>
10189 #include <sys/sem.h>
10190 int main () { union semun semun; semun.buf = 0; }
10193 if eval $compile; then
10194 echo "You have union semun in <sys/sem.h>." >&4
10197 echo "You do not have union semun in <sys/sem.h>." >&4
10200 $rm -f try try.c try.h
10204 : see how to do semctl IPC_STAT
10207 : see whether semctl IPC_STAT can use union semun
10212 # define S_IRUSR S_IREAD
10213 # define S_IWUSR S_IWRITE
10214 # define S_IXUSR S_IEXEC
10216 # define S_IRUSR 0400
10217 # define S_IWUSR 0200
10218 # define S_IXUSR 0100
10220 # define S_IRGRP (S_IRUSR>>3)
10221 # define S_IWGRP (S_IWUSR>>3)
10222 # define S_IXGRP (S_IXUSR>>3)
10223 # define S_IROTH (S_IRUSR>>6)
10224 # define S_IWOTH (S_IWUSR>>6)
10225 # define S_IXOTH (S_IXUSR>>6)
10228 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10229 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10230 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10235 #include <sys/types.h>
10236 #include <sys/ipc.h>
10237 #include <sys/sem.h>
10238 #include <sys/stat.h>
10245 #$d_union_semun HAS_UNION_SEMUN
10248 #ifndef HAS_UNION_SEMUN
10251 struct semid_ds *buf;
10252 unsigned short *array;
10258 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10259 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10261 struct semid_ds argbuf;
10264 st = semctl(sem, 0, IPC_STAT, arg);
10268 # endif /* IPC_STAT */
10269 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10271 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10272 # endif /* IPC_RMID */
10273 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10275 #endif /* IPC_PRIVATE && ... */
10276 printf("semget failed: errno = %d\n", errno);
10282 if eval $compile; then
10285 semun) val="$define" ;;
10291 case "$d_semctl_semun" in
10293 echo "You can use union semun for semctl IPC_STAT." >&4
10296 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10301 : see whether semctl IPC_STAT can use struct semid_ds pointer
10302 $cat > try.c <<'END'
10303 #include <sys/types.h>
10304 #include <sys/ipc.h>
10305 #include <sys/sem.h>
10306 #include <sys/stat.h>
10314 struct semid_ds arg;
10317 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10318 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10321 st = semctl(sem, 0, IPC_STAT, &arg);
10323 printf("semid_ds\n");
10325 # endif /* IPC_STAT */
10326 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10328 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10329 # endif /* IPC_RMID */
10330 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10332 #endif /* IPC_PRIVATE && ... */
10333 printf("semget failed: errno = %d\n", errno);
10340 if eval $compile; then
10343 semid_ds) val="$define" ;;
10347 set d_semctl_semid_ds
10349 case "$d_semctl_semid_ds" in
10351 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10353 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10360 # We do not have the full sem*(2) library, so assume we can not
10366 set d_semctl_semid_ds
10371 : see if setegid exists
10372 set setegid d_setegid
10375 : see if seteuid exists
10376 set seteuid d_seteuid
10379 : see if setgrent exists
10380 set setgrent d_setgrent
10383 : see if sethostent exists
10384 set sethostent d_sethent
10387 : see if setlinebuf exists
10388 set setlinebuf d_setlinebuf
10391 : see if setlocale exists
10392 set setlocale d_setlocale
10395 : see if setnetent exists
10396 set setnetent d_setnent
10399 : see if setprotoent exists
10400 set setprotoent d_setpent
10403 : see if setpgid exists
10404 set setpgid d_setpgid
10407 : see if setpgrp2 exists
10408 set setpgrp2 d_setpgrp2
10411 : see if setpriority exists
10412 set setpriority d_setprior
10415 : see if setpwent exists
10416 set setpwent d_setpwent
10419 : see if setregid exists
10420 set setregid d_setregid
10422 set setresgid d_setresgid
10425 : see if setreuid exists
10426 set setreuid d_setreuid
10428 set setresuid d_setresuid
10431 : see if setrgid exists
10432 set setrgid d_setrgid
10435 : see if setruid exists
10436 set setruid d_setruid
10439 : see if setservent exists
10440 set setservent d_setsent
10443 : see if setsid exists
10444 set setsid d_setsid
10447 : see if setspent exists
10448 set setspent d_setspent
10451 : see if setvbuf exists
10452 set setvbuf d_setvbuf
10455 : see if sfio.h is available
10460 : see if sfio library is available
10471 : Ok, but do we want to use it.
10475 true|$define|[yY]*) dflt='y';;
10478 echo "$package can use the sfio library, but it is experimental."
10479 rp="You seem to have sfio available, do you want to try using it?"
10483 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10485 : Remove sfio from list of libraries to use
10486 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10489 echo "libs = $libs" >&4
10493 *) case "$usesfio" in
10494 true|$define|[yY]*)
10495 echo "Sorry, cannot find sfio on this machine" >&4
10496 echo "Ignoring your setting of usesfio=$usesfio" >&4
10504 $define) usesfio='true';;
10505 *) usesfio='false';;
10508 : see if shmctl exists
10509 set shmctl d_shmctl
10512 : see if shmget exists
10513 set shmget d_shmget
10516 : see if shmat exists
10519 : see what shmat returns
10522 $cat >shmat.c <<'END'
10523 #include <sys/shm.h>
10526 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10531 echo "and it returns ($shmattype)." >&4
10532 : see if a prototype for shmat is available
10533 xxx=`./findhdr sys/shm.h`
10534 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10535 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10546 set d_shmatprototype
10549 : see if shmdt exists
10553 : see how much of the 'shm*(2)' library is present.
10556 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10557 *"$undef"*) h_shm=false;;
10561 case "`ipcs 2>&1`" in
10562 "SVID shared memory"*"not configured"*)
10563 echo "Your $osname does not have the shm*(2) configured." >&4
10566 set shmctl d_shmctl
10568 set shmget d_shmget
10578 : we could also check for sys/ipc.h ...
10579 if $h_shm && $test `./findhdr sys/shm.h`; then
10580 echo "You have the full shm*(2) library." >&4
10583 echo "You don't have the full shm*(2) library." >&4
10590 : see if we have sigaction
10591 if set sigaction val -f d_sigaction; eval $csym; $val; then
10592 echo 'sigaction() found.' >&4
10593 $cat > try.c <<'EOP'
10595 #include <sys/types.h>
10596 #include <signal.h>
10599 struct sigaction act, oact;
10601 oact.sa_handler = 0;
10602 /* so that act and oact are used */
10603 exit(act.sa_flags == 0 && oact.sa_handler == 0);
10607 if eval $compile_ok; then
10610 echo "But you don't seem to have a useable struct sigaction." >&4
10614 echo 'sigaction NOT found.' >&4
10617 set d_sigaction; eval $setvar
10618 $rm -f try try$_o try.c
10620 : see if sigsetjmp exists
10622 case "$d_sigsetjmp" in
10624 $cat >try.c <<'EOP'
10625 #include <setjmp.h>
10630 if (sigsetjmp(env,1))
10633 siglongjmp(env, 1);
10638 if eval $compile; then
10639 if ./try >/dev/null 2>&1; then
10640 echo "POSIX sigsetjmp found." >&4
10644 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10650 echo "sigsetjmp not found." >&4
10654 *) val="$d_sigsetjmp"
10655 case "$d_sigsetjmp" in
10656 $define) echo "POSIX sigsetjmp found." >&4;;
10657 $undef) echo "sigsetjmp not found." >&4;;
10665 : see if sqrtl exists
10669 : see if sys/stat.h is available
10670 set sys/stat.h i_sysstat
10674 : see if stat knows about block sizes
10676 echo "Checking to see if your struct stat has st_blocks field..." >&4
10677 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10681 : see if this is a sys/vfs.h system
10682 set sys/vfs.h i_sysvfs
10686 : see if this is a sys/statfs.h system
10687 set sys/statfs.h i_sysstatfs
10692 echo "Checking to see if your system supports struct statfs..." >&4
10693 set d_statfs_s statfs $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
10695 case "$d_statfs_s" in
10696 "$define") echo "Yes, it does." ;;
10697 *) echo "No, it doesn't." ;;
10702 : see if struct statfs knows about f_flags
10703 case "$d_statfs_s" in
10706 echo "Checking to see if your struct statfs has f_flags field..." >&4
10707 set d_statfs_f_flags statfs f_flags $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
10711 set d_statfs_f_flags
10715 case "$d_statfs_f_flags" in
10716 "$define") echo "Yes, it does." ;;
10717 *) echo "No, it doesn't." ;;
10720 : see if _ptr and _cnt from stdio act std
10722 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10723 echo "(Looks like you have stdio.h from Linux.)"
10724 case "$stdio_ptr" in
10725 '') stdio_ptr='((fp)->_IO_read_ptr)'
10728 *) ptr_lval=$d_stdio_ptr_lval;;
10730 case "$stdio_cnt" in
10731 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10734 *) cnt_lval=$d_stdio_cnt_lval;;
10736 case "$stdio_base" in
10737 '') stdio_base='((fp)->_IO_read_base)';;
10739 case "$stdio_bufsiz" in
10740 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10743 case "$stdio_ptr" in
10744 '') stdio_ptr='((fp)->_ptr)'
10747 *) ptr_lval=$d_stdio_ptr_lval;;
10749 case "$stdio_cnt" in
10750 '') stdio_cnt='((fp)->_cnt)'
10753 *) cnt_lval=$d_stdio_cnt_lval;;
10755 case "$stdio_base" in
10756 '') stdio_base='((fp)->_base)';;
10758 case "$stdio_bufsiz" in
10759 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10762 : test whether _ptr and _cnt really work
10763 echo "Checking how std your stdio is..." >&4
10766 #define FILE_ptr(fp) $stdio_ptr
10767 #define FILE_cnt(fp) $stdio_cnt
10769 FILE *fp = fopen("try.c", "r");
10772 18 <= FILE_cnt(fp) &&
10773 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10781 if eval $compile; then
10783 echo "Your stdio acts pretty std."
10786 echo "Your stdio isn't very std."
10789 echo "Your stdio doesn't appear very std."
10795 : Can _ptr be used as an lvalue?
10796 case "$d_stdstdio$ptr_lval" in
10797 $define$define) val=$define ;;
10800 set d_stdio_ptr_lval
10803 : Can _cnt be used as an lvalue?
10804 case "$d_stdstdio$cnt_lval" in
10805 $define$define) val=$define ;;
10808 set d_stdio_cnt_lval
10811 : see if _base is also standard
10813 case "$d_stdstdio" in
10817 #define FILE_base(fp) $stdio_base
10818 #define FILE_bufsiz(fp) $stdio_bufsiz
10820 FILE *fp = fopen("try.c", "r");
10823 19 <= FILE_bufsiz(fp) &&
10824 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10831 if eval $compile; then
10833 echo "And its _base field acts std."
10836 echo "But its _base field isn't std."
10839 echo "However, it seems to be lacking the _base field."
10848 Checking how to access stdio streams by file descriptor number...
10850 case "$stdio_stream_array" in
10851 '') $cat >try.c <<EOCP
10854 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10858 for s in _iob __iob __sF
10860 set try -DSTDIO_STREAM_ARRAY=$s
10861 if eval $compile; then
10862 case "`./try$exe_ext`" in
10863 yes) stdio_stream_array=$s; break ;;
10867 $rm -f try.* try$exe_ext
10869 case "$stdio_stream_array" in
10871 I can't figure out how to access stdio streams by file descriptor number.
10873 d_stdio_stream_array="$undef"
10876 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10878 d_stdio_stream_array="$define"
10882 : see if strcoll exists
10883 set strcoll d_strcoll
10886 : check for structure copying
10888 echo "Checking to see if your C compiler can copy structs..." >&4
10889 $cat >try.c <<'EOCP'
10899 if $cc -c try.c >/dev/null 2>&1 ; then
10901 echo "Yup, it can."
10904 echo "Nope, it can't."
10910 : see if strerror and/or sys_errlist[] exist
10912 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10913 if set strerror val -f d_strerror; eval $csym; $val; then
10914 echo 'strerror() found.' >&4
10915 d_strerror="$define"
10916 d_strerrm='strerror(e)'
10917 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10918 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10919 d_syserrlst="$define"
10921 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10922 d_syserrlst="$undef"
10924 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10925 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10926 echo 'strerror() found in string header.' >&4
10927 d_strerror="$define"
10928 d_strerrm='strerror(e)'
10929 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10930 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10931 d_syserrlst="$define"
10933 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10934 d_syserrlst="$undef"
10936 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10937 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10938 d_strerror="$undef"
10939 d_syserrlst="$define"
10940 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10942 echo 'strerror() and sys_errlist[] NOT found.' >&4
10943 d_strerror="$undef"
10944 d_syserrlst="$undef"
10945 d_strerrm='"unknown"'
10949 : see if strtod exists
10950 set strtod d_strtod
10953 : see if strtol exists
10954 set strtol d_strtol
10957 : see if strtold exists
10958 set strtold d_strtold
10961 : see if strtoul exists
10962 set strtoul d_strtoul
10965 : see if strtoull exists
10966 set strtoull d_strtoull
10969 : see if strtouq exists
10970 set strtouq d_strtouq
10973 : see if strxfrm exists
10974 set strxfrm d_strxfrm
10977 : see if symlink exists
10978 set symlink d_symlink
10981 : see if syscall exists
10982 set syscall d_syscall
10985 : see if sysconf exists
10986 set sysconf d_sysconf
10989 : see if system exists
10990 set system d_system
10993 : see if tcgetpgrp exists
10994 set tcgetpgrp d_tcgetpgrp
10997 : see if tcsetpgrp exists
10998 set tcsetpgrp d_tcsetpgrp
11001 : see if prototype for telldir is available
11003 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11006 : see if this is a sys/times.h system
11007 set sys/times.h i_systimes
11010 : see if times exists
11012 if set times val -f d_times; eval $csym; $val; then
11013 echo 'times() found.' >&4
11016 case "$i_systimes" in
11017 "$define") inc='sys/times.h';;
11019 rp="What is the type returned by times() on this system?"
11020 set clock_t clocktype long stdio.h sys/types.h $inc
11023 echo 'times() NOT found, hope that will do.' >&4
11028 : see if truncate exists
11029 set truncate d_truncate
11032 : see if tzname[] exists
11034 if set tzname val -a d_tzname; eval $csym; $val; then
11036 echo 'tzname[] found.' >&4
11039 echo 'tzname[] NOT found.' >&4
11044 : see if umask exists
11048 : see if ustat exists
11052 : backward compatibility for d_hvfork
11053 if test X$d_hvfork != X; then
11054 d_vfork="$d_hvfork"
11057 : see if there is a vfork
11062 : Ok, but do we want to use it. vfork is reportedly unreliable in
11063 : perl on Solaris 2.x, and probably elsewhere.
11067 case "$usevfork" in
11073 Perl can only use a vfork() that doesn't suffer from strict
11074 restrictions on calling functions or modifying global data in
11075 the child. For example, glibc-2.1 contains such a vfork()
11076 that is unsuitable. If your system provides a proper fork()
11077 call, chances are that you do NOT want perl to use vfork().
11080 rp="Do you still want to use vfork()?"
11085 echo "Ok, we won't use vfork()."
11094 $define) usevfork='true';;
11095 *) usevfork='false';;
11098 : see if this is an sysdir system
11099 set sys/dir.h i_sysdir
11102 : see if this is an sysndir system
11103 set sys/ndir.h i_sysndir
11106 : see if closedir exists
11107 set closedir d_closedir
11110 case "$d_closedir" in
11113 echo "Checking whether closedir() returns a status..." >&4
11114 cat > closedir.c <<EOM
11115 #$i_dirent I_DIRENT /**/
11116 #$i_sysdir I_SYS_DIR /**/
11117 #$i_sysndir I_SYS_NDIR /**/
11118 #$i_systypes I_SYS_TYPES /**/
11120 #if defined(I_SYS_TYPES)
11121 #include <sys/types.h>
11123 #if defined(I_DIRENT)
11124 #include <dirent.h>
11125 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11126 #include <sys/dir.h>
11130 #include <sys/ndir.h>
11134 #include <ndir.h> /* may be wrong in the future */
11136 #include <sys/dir.h>
11141 int main() { return closedir(opendir(".")); }
11144 if eval $compile_ok; then
11145 if ./closedir > /dev/null 2>&1 ; then
11146 echo "Yes, it does."
11149 echo "No, it doesn't."
11153 echo "(I can't seem to compile the test program--assuming it doesn't)"
11161 set d_void_closedir
11164 : check for volatile keyword
11166 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11167 $cat >try.c <<'EOCP'
11170 typedef struct _goo_struct goo_struct;
11171 goo_struct * volatile goo = ((goo_struct *)0);
11172 struct _goo_struct {
11177 typedef unsigned short foo_t;
11178 char *volatile foo;
11180 volatile foo_t blech;
11184 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11186 echo "Yup, it does."
11189 echo "Nope, it doesn't."
11195 : see if there is a wait4
11199 : see if waitpid exists
11200 set waitpid d_waitpid
11203 : see if wcstombs exists
11204 set wcstombs d_wcstombs
11207 : see if wctomb exists
11208 set wctomb d_wctomb
11211 : preserve RCS keywords in files with variable substitution, grrr
11216 Revision='$Revision'
11218 case "$crosscompile" in
11219 ''|[nN]*) crosscompile="$undef" ;;
11223 next|rhapsody) multiarch="$define" ;;
11225 case "$multiarch" in
11226 ''|[nN]*) multiarch="$undef" ;;
11229 : check for alignment requirements
11231 case "$crosscompile$multiarch" in
11234 You seem to be either cross-compiling or doing a multiarchitecture build,
11235 skipping the memory alignment check.
11238 case "$alignbytes" in
11239 '') alignbytes=8 ;;
11243 case "$alignbytes" in
11244 '') echo "Checking alignment constraints..." >&4
11245 $cat >try.c <<'EOCP'
11253 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
11258 if eval $compile_ok; then
11262 echo "(I can't seem to compile the test program...)"
11265 *) dflt="$alignbytes"
11268 rp="Doubles must be aligned on a how-many-byte boundary?"
11276 : check for ordering of bytes in a long
11278 case "$crosscompile$multiarch" in
11281 You seem to be either cross-compiling or doing a multiarchitecture build,
11282 skipping the byteorder check.
11288 case "$byteorder" in
11291 In the following, larger digits indicate more significance. A big-endian
11292 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11293 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11294 machines may have weird orders like 3412. A Cray will report 87654321,
11295 an Alpha will report 12345678. If the test program works the default is
11297 I'm now running the test program...
11299 $cat >try.c <<'EOCP'
11306 char c[sizeof(long)];
11309 if (sizeof(long) > 4)
11310 u.l = (0x08070605L << 32) | 0x04030201L;
11313 for (i = 0; i < sizeof(long); i++)
11314 printf("%c", u.c[i]+'0');
11321 if eval $compile && ./try > /dev/null; then
11324 [1-4][1-4][1-4][1-4]|12345678|87654321)
11325 echo "(The test program ran ok.)"
11326 echo "byteorder=$dflt"
11329 ????|????????) echo "(The test program ran ok.)" ;;
11330 *) echo "(The test program didn't run right for some reason.)" ;;
11335 (I can't seem to compile the test program. Guessing big-endian...)
11338 case "$xxx_prompt" in
11340 rp="What is the order of bytes in a long?"
11354 : how do we catenate cpp tokens here?
11356 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11357 $cat >cpp_stuff.c <<'EOCP'
11358 #define RCAT(a,b)a/**/b
11359 #define ACAT(a,b)a ## b
11363 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11364 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11365 echo "Oh! Smells like ANSI's been here." >&4
11366 echo "We can catify or stringify, separately or together!"
11368 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11369 echo "Ah, yes! The good old days!" >&4
11370 echo "However, in the good old days we don't know how to stringify and"
11371 echo "catify at the same time."
11375 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11376 to have to edit the values of CAT[2-5] in config.h...
11378 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11382 : see if this is a db.h system
11388 : Check db version.
11390 echo "Checking Berkeley DB version ..." >&4
11396 #include <sys/types.h>
11401 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11402 int Major, Minor, Patch ;
11403 unsigned long Version ;
11404 (void)db_version(&Major, &Minor, &Patch) ;
11405 printf("You have Berkeley DB Version 2 or greater\n");
11407 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11408 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11409 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11410 Major, Minor, Patch) ;
11412 /* check that db.h & libdb are compatible */
11413 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11414 printf("db.h and libdb are incompatible\n") ;
11418 printf("db.h and libdb are compatible\n") ;
11420 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11421 + DB_VERSION_PATCH ;
11423 /* needs to be >= 2.3.4 */
11424 if (Version < 2003004) {
11425 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11426 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11432 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11433 printf("You have Berkeley DB Version 1\n");
11434 exit(0); /* DB version < 2: the coast is clear. */
11436 exit(1); /* <db.h> not Berkeley DB? */
11442 if eval $compile_ok && ./try; then
11443 echo 'Looks OK.' >&4
11445 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11449 : Remove db from list of libraries to use
11450 echo "Removing unusable -ldb from library list" >&4
11451 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11454 echo "libs = $libs" >&4
11464 : Check the return type needed for hash
11466 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11472 #include <sys/types.h>
11475 #ifndef DB_VERSION_MAJOR
11476 u_int32_t hash_cb (ptr, size)
11484 info.hash = hash_cb;
11488 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11489 if $contains warning try.out >>/dev/null 2>&1 ; then
11492 db_hashtype='u_int32_t'
11495 : XXX Maybe we should just give up here.
11496 db_hashtype=u_int32_t
11498 echo "Help: I can't seem to compile the db test program." >&4
11499 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11502 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11504 *) db_hashtype=u_int32_t
11509 : Check the return type needed for prefix
11511 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11517 #include <sys/types.h>
11520 #ifndef DB_VERSION_MAJOR
11521 size_t prefix_cb (key1, key2)
11529 info.prefix = prefix_cb;
11533 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11534 if $contains warning try.out >>/dev/null 2>&1 ; then
11535 db_prefixtype='int'
11537 db_prefixtype='size_t'
11540 db_prefixtype='size_t'
11541 : XXX Maybe we should just give up here.
11543 echo "Help: I can't seem to compile the db test program." >&4
11544 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11547 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11549 *) db_prefixtype='size_t'
11553 : check for void type
11555 echo "Checking to see how well your C compiler groks the void type..." >&4
11556 case "$voidflags" in
11558 $cat >try.c <<'EOCP'
11564 extern void moo(); /* function returning void */
11565 void (*goo)(); /* ptr to func returning void */
11567 void *hue; /* generic ptr */
11580 int main() { sub(); }
11582 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11583 voidflags=$defvoidused
11584 echo "Good. It appears to support void to the level $package wants.">&4
11585 if $contains warning .out >/dev/null 2>&1; then
11586 echo "However, you might get some warnings that look like this:"
11590 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11591 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11592 echo "It supports 1..."
11593 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11594 echo "It also supports 2..."
11595 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11597 echo "And it supports 4 but not 8 definitely."
11599 echo "It doesn't support 4..."
11600 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11602 echo "But it supports 8."
11605 echo "Neither does it support 8."
11609 echo "It does not support 2..."
11610 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11612 echo "But it supports 4 and 8."
11614 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11616 echo "And it supports 4 but has not heard about 8."
11618 echo "However it supports 8 but not 4."
11623 echo "There is no support at all for void."
11628 case "$voidflags" in
11630 *) $cat >&4 <<'EOM'
11631 Support flag bits are:
11632 1: basic void declarations.
11633 2: arrays of pointers to functions returning void.
11634 4: operations between pointers to and addresses of void functions.
11635 8: generic void pointers.
11638 rp="Your void support flags add up to what?"
11646 : How can we generate normalized random numbers ?
11648 echo "Looking for a random number function..." >&4
11649 case "$randfunc" in
11651 if set drand48 val -f; eval $csym; $val; then
11653 echo "Good, found drand48()." >&4
11654 elif set random val -f; eval $csym; $val; then
11656 echo "OK, found random()." >&4
11659 echo "Yick, looks like I have to use rand()." >&4
11670 *-Dmy_rand=*|*-Dmy_srand=*)
11671 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11672 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11673 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11674 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11678 while $test "$cont"; do
11679 rp="Use which function to generate random numbers?"
11681 if $test "$ans" = "$dflt"; then
11687 if set $ans val -f; eval $csym; $val; then
11691 rp="I cannot find function $ans. Use that name anyway?"
11700 case "$randfunc" in
11702 drand01="drand48()"
11708 case "$randbits" in
11710 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11712 #$i_unistd I_UNISTD
11713 #$i_stdlib I_STDLIB
11716 # include <unistd.h>
11719 # include <stdlib.h>
11724 register unsigned long tmp;
11725 register unsigned long max = 0L;
11727 for (i = 1000; i; i--) {
11728 tmp = (unsigned long) $randfunc();
11729 if (tmp > max) max = tmp;
11731 for (i = 0; max; i++)
11737 if eval $compile_ok; then
11741 echo "(I can't seem to compile the test program...)"
11748 rp="How many bits does your $randfunc() function produce?"
11752 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11753 seedfunc="s$randfunc"
11754 randseedtype=unsigned
11758 rp="How many bits does your $randfunc() function produce?"
11761 seedfunc="s$randfunc"
11762 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11763 if set $seedfunc val -f; eval $csym; $val; then
11764 echo "(Using $seedfunc() to seed random generator)"
11766 echo "(Warning: no $seedfunc() to seed random generator)"
11769 randseedtype=unsigned
11777 echo "Determining whether or not we are on an EBCDIC system..." >&4
11778 $cat >tebcdic.c <<'EOM'
11781 if ('M'==0xd4) return 0;
11788 if eval $compile_ok; then
11790 echo "You have EBCDIC." >&4
11793 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
11796 echo "I'm unable to compile the test program." >&4
11797 echo "I'll assume ASCII or some ISO Latin." >&4
11799 $rm -f tebcdic.c tebcdic
11805 Checking how to flush all pending stdio output...
11807 # I only know how to find the first 32 possibly open files on SunOS.
11808 # See also hints/sunos_4_1.sh and util.c --AD
11810 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11812 $cat >>try.c <<EOCP
11814 #$i_unistd I_UNISTD
11816 # include <unistd.h>
11818 #$d_sysconf HAS_SYSCONF
11819 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11820 #ifdef HAS_STDIO_STREAM_ARRAY
11821 # define STDIO_STREAM_ARRAY $stdio_stream_array
11824 FILE* p = fopen("try.out", "w");
11828 # ifdef TRY_FPRINTF
11832 #ifdef TRY_FFLUSH_NULL
11835 #ifdef TRY_FFLUSH_ALL
11837 long open_max = -1;
11838 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11839 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11841 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11842 open_max = sysconf(_SC_OPEN_MAX);
11845 open_max = FOPEN_MAX;
11848 open_max = OPEN_MAX;
11857 # ifdef HAS_STDIO_STREAM_ARRAY
11858 if (open_max > 0) {
11860 for (i = 0; i < open_max; i++)
11861 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11862 STDIO_STREAM_ARRAY[i]._file < open_max &&
11863 STDIO_STREAM_ARRAY[i]._flag)
11864 fflush(&STDIO_STREAM_ARRAY[i]);
11872 : first we have to find out how _not_ to flush
11873 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11875 set try -DTRY_FPUTC
11876 if eval $compile; then
11878 ./try$exe_ext 2>/dev/null
11879 if $test ! -s try.out -a "X$?" = X42; then
11885 set try -DTRY_FPRINTF
11887 if eval $compile; then
11889 ./try$exe_ext 2>/dev/null
11890 if $test ! -s try.out -a "X$?" = X42; then
11891 output=-DTRY_FPRINTF
11897 : check for fflush NULL behaviour
11898 case "$fflushNULL" in
11899 '') set try -DTRY_FFLUSH_NULL $output
11900 if eval $compile; then
11902 ./try$exe_ext 2>/dev/null
11904 if $test -s try.out -a "X$code" = X42; then
11905 fflushNULL="`$cat try.out`"
11907 if $test "X$code" != X42; then
11909 (If this test failed, don't worry, we'll try another method shortly.)
11914 $rm -f core try.core core.try.*
11915 case "$fflushNULL" in
11917 Your fflush(NULL) works okay.
11919 fflushNULL="$define"
11922 Your fflush(NULL) isn't working (contrary to ANSI C).
11924 fflushNULL="$undef"
11927 Cannot figure out whether your fflush(NULL) works or not.
11928 I'm assuming it doesn't (contrary to ANSI C).
11930 fflushNULL="$undef"
11934 $define|true|[yY]*)
11935 fflushNULL="$define"
11938 fflushNULL="$undef"
11941 : check explicit looping only if NULL did not work
11942 case "$fflushNULL" in
11944 : check for fflush all behaviour
11945 case "$fflushall" in
11946 '') set try -DTRY_FFLUSH_ALL $output
11947 if eval $compile; then
11949 (Now testing the other method--but note that also this may fail.)
11952 ./try$exe_ext 2>/dev/null
11953 if $test -s try.out -a "X$?" = X42; then
11954 fflushall="`$cat try.out`"
11957 $rm -f core try.core core.try.*
11958 case "$fflushall" in
11960 Whew. Flushing explicitly all the stdio streams works.
11962 fflushall="$define"
11965 Sigh. Flushing explicitly all the stdio streams doesn't work.
11970 Cannot figure out whether flushing stdio streams explicitly works or not.
11971 I'm assuming it doesn't.
11977 "$define"|true|[yY]*)
11978 fflushall="$define"
11985 *) fflushall="$undef"
11988 case "$fflushNULL$fflushall" in
11991 I cannot figure out how to flush pending stdio output.
11995 $rm -f try.* try$exe_ext
11997 : Store the full pathname to the ar program for use in the C program
11998 : Respect a hint or command line value for full_ar.
12003 : Store the full pathname to the sed program for use in the C program
12006 : see what type gids are declared as in the kernel
12008 echo "Looking for the type for group ids returned by getgid()."
12009 set gid_t gidtype xxx stdio.h sys/types.h
12013 xxx=`./findhdr sys/user.h`
12014 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
12016 unsigned) dflt="$1 $2" ;;
12020 *) dflt="$gidtype";;
12023 gid_t) echo "gid_t found." ;;
12024 *) rp="What is the type for group ids returned by getgid()?"
12032 *_t) zzz="$gidtype" ;;
12035 echo "Checking the size of $zzz..." >&4
12037 #include <sys/types.h>
12040 printf("%d\n", (int)sizeof($gidtype));
12045 if eval $compile_ok; then
12049 echo "(I can't execute the test program--guessing $gidsize.)" >&4
12052 echo "Your $zzz size is $gidsize bytes."
12057 echo "(I can't compile the test program--guessing $gidsize.)" >&4
12063 *_t) zzz="$gidtype" ;;
12066 echo "Checking the sign of $zzz..." >&4
12068 #include <sys/types.h>
12079 if eval $compile; then
12083 echo "(I can't execute the test program--guessing unsigned.)" >&4
12087 1) echo "Your $zzz is unsigned." ;;
12088 -1) echo "Your $zzz is signed." ;;
12094 echo "(I can't compile the test program--guessing unsigned.)" >&4
12098 : check for length of character
12100 case "$charsize" in
12102 echo "Checking to see how big your characters are (hey, you never know)..." >&4
12103 $cat >try.c <<'EOCP'
12107 printf("%d\n", (int)sizeof(char));
12112 if eval $compile_ok; then
12116 echo "(I can't seem to compile the test program. Guessing...)"
12123 rp="What is the size of a character (in bytes)?"
12130 $echo "Choosing the C types to be used for Perl's internal types..." >&4
12132 case "$use64bits:$d_quad:$quadtype" in
12135 uvtype="$uquadtype"
12140 uvtype="unsigned long"
12146 case "$uselongdouble:$d_longdbl" in
12148 nvtype="long double"
12149 nvsize=$longdblsize
12156 echo "(IV will be "$ivtype", $ivsize bytes)"
12157 echo "(UV will be "$uvtype", $uvsize bytes)"
12158 echo "(NV will be "$nvtype", $nvsize bytes)"
12161 #$i_inttypes I_INTTYPES
12163 #include <inttypes.h>
12168 int8_t i = INT8_MAX;
12169 uint8_t u = UINT8_MAX;
12170 printf("int8_t\n");
12173 int16_t i = INT16_MAX;
12174 uint16_t i = UINT16_MAX;
12175 printf("int16_t\n");
12178 int32_t i = INT32_MAX;
12179 uint32_t u = UINT32_MAX;
12180 printf("int32_t\n");
12186 '') case "$charsize" in
12188 u8type="unsigned char"
12197 if eval $compile; then
12198 case "`./try$exe_ext`" in
12199 int8_t) i8type=int8_t
12209 '') if $test $charsize -ge 1; then
12211 u8type="unsigned char"
12219 '') case "$shortsize" in
12221 u16type="unsigned short"
12229 '') set try -DINT16
12230 if eval $compile; then
12231 case "`./try$exe_ext`" in
12243 '') if $test $shortsize -ge 2; then
12245 u16type="unsigned short"
12253 '') case "$longsize" in
12255 u32type="unsigned long"
12259 *) case "$intsize" in
12261 u32type="unsigned int"
12271 '') set try -DINT32
12272 if eval $compile; then
12273 case "`./try$exe_ext`" in
12285 '') if $test $intsize -ge 4; then
12287 u32type="unsigned int"
12295 '') case "$d_quad:$quadtype" in
12297 i64type="$quadtype"
12298 u64type="$uquadtype"
12310 if $test X"$quadtype" != X; then
12312 echo "Checking how to print 64-bit integers..." >&4
12314 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12315 $cat >try.c <<'EOCP'
12316 #include <sys/types.h>
12319 int q = 12345678901;
12320 printf("%ld\n", q);
12324 if eval $compile; then
12325 yyy=`./try$exe_ext`
12328 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12329 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12330 echo "We will use %d."
12336 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12337 $cat >try.c <<'EOCP'
12338 #include <sys/types.h>
12341 long q = 12345678901;
12342 printf("%ld\n", q);
12346 if eval $compile; then
12347 yyy=`./try$exe_ext`
12350 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12351 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12352 echo "We will use %ld."
12358 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then
12359 $cat >try.c <<'EOCP'
12360 #include <sys/types.h>
12361 #include <inttypes.h>
12364 int64_t q = 12345678901;
12365 printf("%" PRId64 "\n", q);
12369 if eval $compile; then
12370 yyy=`./try$exe_ext`
12373 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12374 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12375 echo "We will use the C9X style."
12381 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12382 $cat >try.c <<'EOCP'
12383 #include <sys/types.h>
12386 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12387 printf("%lld\n", q);
12391 if eval $compile; then
12392 yyy=`./try$exe_ext`
12395 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12396 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12397 echo "We will use the %lld style."
12403 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12405 #include <sys/types.h>
12408 $quadtype q = 12345678901;
12409 printf("%Ld\n", q);
12413 if eval $compile; then
12414 yyy=`./try$exe_ext`
12417 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12418 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12419 echo "We will use %Ld."
12425 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12427 #include <sys/types.h>
12430 $quadtype q = 12345678901;
12431 printf("%qd\n", q);
12435 if eval $compile; then
12436 yyy=`./try$exe_ext`
12439 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12440 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12441 echo "We will use %qd."
12447 if $test X"$sPRId64" = X; then
12448 echo "Cannot figure out how to print 64-bit integers." >&4
12456 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12457 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12459 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12460 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12466 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12468 if $test X"$ivsize" = X8; then
12469 ivdformat="$sPRId64"
12470 uvuformat="$sPRIu64"
12471 uvoformat="$sPRIo64"
12472 uvxformat="$sPRIx64"
12474 if $test X"$ivsize" = X"$longsize"; then
12480 if $test X"$ivsize" = X"$intsize"; then
12487 if $test X"$ivsize" = X"$shortsize"; then
12497 case "$ivdformat" in
12498 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
12505 $echo "Checking the format string to be used for gids..." >&4
12508 -1) if $test X"$gidsize" = X"$ivsize"; then
12509 gidformat="$ivdformat"
12511 if $test X"$gidsize" = X"$longsize"; then
12514 if $test X"$gidsize" = X"$intsize"; then
12517 if $test X"$gidsize" = X"$shortsize"; then
12524 *) if $test X"$gidsize" = X"$uvsize"; then
12525 gidformat="$uvuformat"
12527 if $test X"$gidsize" = X"$longsize"; then
12530 if $test X"$gidsize" = X"$intsize"; then
12533 if $test X"$gidsize" = X"$shortsize"; then
12542 : see if getgroups exists
12543 set getgroups d_getgrps
12546 : see if setgroups exists
12547 set setgroups d_setgrps
12551 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
12553 case "$d_getgrps$d_setgrps" in
12555 case "$groupstype" in
12556 '') dflt="$gidtype" ;;
12557 *) dflt="$groupstype" ;;
12560 What type of pointer is the second argument to getgroups() and setgroups()?
12561 Usually this is the same as group ids, $gidtype, but not always.
12564 rp='What type pointer is the second argument to getgroups() and setgroups()?'
12568 *) groupstype="$gidtype";;
12572 echo "Checking if your $make program sets \$(MAKE)..." >&4
12573 case "$make_set_make" in
12575 $sed 's/^X //' > testmake.mak << 'EOF'
12577 X @echo 'maketemp="$(MAKE)"'
12579 case "`$make -f testmake.mak 2>/dev/null`" in
12580 *maketemp=*) make_set_make='#' ;;
12581 *) make_set_make="MAKE=$make" ;;
12583 $rm -f testmake.mak
12586 case "$make_set_make" in
12587 '#') echo "Yup, it does.";;
12588 *) echo "Nope, it doesn't.";;
12591 : see what type is used for mode_t
12592 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
12593 set mode_t modetype int stdio.h sys/types.h
12596 : define a fucntion to check prototypes
12597 $cat > protochk <<EOSH
12600 optimize="$optimize"
12602 prototype="$prototype"
12607 $cat >> protochk <<'EOSH'
12612 while test $# -ge 2; do
12614 $define) echo "#include <$2>" >> try.c ;;
12615 literal) echo "$2" >> try.c ;;
12619 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
12620 cat >> try.c <<'EOCP'
12621 #ifdef CAN_PROTOTYPE
12622 #define _(args) args
12627 echo "$foo" >> try.c
12628 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
12629 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
12635 $eunicefix protochk
12637 : see what type is used for size_t
12638 rp="What is the type used for the length parameter for string functions?"
12639 set size_t sizetype 'unsigned int' stdio.h sys/types.h
12642 : check for type of arguments to gethostbyaddr.
12643 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
12644 case "$d_gethbyaddr" in
12648 Checking to see what type of arguments are accepted by gethostbyaddr().
12650 hdrs="$define sys/types.h
12651 $d_socket sys/socket.h
12652 $i_niin netinet/in.h
12654 $i_unistd unistd.h"
12655 : The first arg can 'char *' or 'void *'
12656 : The second arg is some of integral type
12657 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
12658 for yyy in size_t long int; do
12659 case "$netdb_host_type" in
12660 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
12661 if ./protochk "$try" $hdrs; then
12662 echo "Your system accepts $xxx for the first arg."
12663 echo "...and $yyy for the second arg."
12664 netdb_host_type="$xxx"
12665 netdb_hlen_type="$yyy"
12671 : In case none of those worked, prompt the user.
12672 case "$netdb_host_type" in
12673 '') rp='What is the type for the 1st argument to gethostbyaddr?'
12676 netdb_host_type=$ans
12677 rp='What is the type for the 2nd argument to gethostbyaddr?'
12680 netdb_hlen_type=$ans
12684 *) : no gethostbyaddr, so pick harmless defaults
12685 netdb_host_type='char *'
12686 netdb_hlen_type="$sizetype"
12689 # Remove the "const" if needed. -- but then we'll have a
12691 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
12694 : check for type of argument to gethostbyname.
12695 if test "X$netdb_name_type" = X ; then
12696 case "$d_gethbyname" in
12700 Checking to see what type of argument is accepted by gethostbyname().
12702 hdrs="$define sys/types.h
12703 $d_socket sys/socket.h
12704 $i_niin netinet/in.h
12706 $i_unistd unistd.h"
12707 for xxx in "const char *" "char *"; do
12708 case "$netdb_name_type" in
12709 '') try="extern struct hostent *gethostbyname($xxx);"
12710 if ./protochk "$try" $hdrs; then
12711 echo "Your system accepts $xxx."
12712 netdb_name_type="$xxx"
12717 : In case none of those worked, prompt the user.
12718 case "$netdb_name_type" in
12719 '') rp='What is the type for the 1st argument to gethostbyname?'
12722 netdb_name_type=$ans
12726 *) : no gethostbyname, so pick harmless default
12727 netdb_name_type='char *'
12732 : check for type of 1st argument to getnetbyaddr.
12733 if test "X$netdb_net_type" = X ; then
12734 case "$d_getnbyaddr" in
12738 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12740 hdrs="$define sys/types.h
12741 $d_socket sys/socket.h
12742 $i_niin netinet/in.h
12744 $i_unistd unistd.h"
12745 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12746 case "$netdb_net_type" in
12747 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12748 if ./protochk "$try" $hdrs; then
12749 echo "Your system accepts $xxx."
12750 netdb_net_type="$xxx"
12755 : In case none of those worked, prompt the user.
12756 case "$netdb_net_type" in
12757 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12760 netdb_net_type=$ans
12764 *) : no getnetbyaddr, so pick harmless default
12765 netdb_net_type='long'
12769 : locate the preferred pager for this system
12783 '') dflt=/usr/ucb/more;;
12790 rp='What pager is used on your system?'
12794 : see what type pids are declared as in the kernel
12795 rp="What is the type of process ids on this system?"
12796 set pid_t pidtype int stdio.h sys/types.h
12799 : check for length of pointer
12803 $echo $n "Checking to see how big your pointers are...$c" >&4
12804 if test "$voidflags" -gt 7; then
12805 echo '#define VOID_PTR char *' > try.c
12807 echo '#define VOID_PTR void *' > try.c
12809 $cat >>try.c <<'EOCP'
12813 printf("%d\n", (int)sizeof(VOID_PTR));
12818 if eval $compile_ok; then
12820 $echo " $ptrsize bytes." >&4
12823 echo "(I can't seem to compile the test program. Guessing...)" >&4
12824 rp="What is the size of a pointer (in bytes)?"
12832 : see if ar generates random libraries by itself
12834 echo "Checking how to generate random libraries on your machine..." >&4
12835 echo 'int bar1() { return bar2(); }' > bar1.c
12836 echo 'int bar2() { return 2; }' > bar2.c
12837 $cat > foo.c <<'EOP'
12838 int main() { printf("%d\n", bar1()); exit(0); }
12840 $cc $ccflags -c bar1.c >/dev/null 2>&1
12841 $cc $ccflags -c bar2.c >/dev/null 2>&1
12842 $cc $ccflags -c foo.c >/dev/null 2>&1
12843 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12844 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12845 ./foobar >/dev/null 2>&1; then
12846 echo "$ar appears to generate random libraries itself."
12849 elif $ar ts bar$_a >/dev/null 2>&1 &&
12850 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12851 ./foobar >/dev/null 2>&1; then
12852 echo "a table of contents needs to be added with '$ar ts'."
12859 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12860 $test -f $ranlib || ranlib=''
12863 if $test -n "$ranlib"; then
12864 echo "your system has '$ranlib'; we'll use that."
12867 echo "your system doesn't seem to support random libraries"
12868 echo "so we'll use lorder and tsort to order the libraries."
12875 : check for type of arguments to select.
12876 case "$selecttype" in
12877 '') case "$d_select" in
12880 Checking to see what type of arguments are accepted by select().
12882 hdrs="$define sys/types.h
12883 $i_systime sys/time.h
12884 $i_sysselct sys/select.h
12885 $d_socket sys/socket.h"
12886 : The first arg can be int, unsigned, or size_t
12887 : The last arg may or may not be 'const'
12889 : void pointer has been seen but using that
12890 : breaks the selectminbits test
12891 for xxx in 'fd_set *' 'int *'; do
12892 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12893 for tmo in 'struct timeval *' 'const struct timeval *'; do
12895 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12896 if ./protochk "$try" $hdrs; then
12897 echo "Your system accepts $xxx."
12906 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12907 case "$d_fd_set" in
12908 $define) dflt="fd_set *" ;;
12917 *) : no select, so pick a harmless default
12924 : check for the select 'width'
12925 case "$selectminbits" in
12926 '') case "$d_select" in
12930 Checking to see on how many bits at a time your select() operates...
12933 #include <sys/types.h>
12935 #$i_systime I_SYS_TIME
12936 #$i_systimek I_SYS_TIME_KERNEL
12941 # ifdef I_SYS_TIME_KERNEL
12944 # include <sys/time.h>
12945 # ifdef I_SYS_TIME_KERNEL
12949 #$i_sysselct I_SYS_SELECT
12950 #ifdef I_SYS_SELECT
12951 #include <sys/select.h>
12953 #$d_socket HAS_SOCKET
12955 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12959 #define S sizeof(*(b))
12961 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12962 #define NBITS (NBYTES * 8)
12971 fp = fopen("try.c", "r");
12977 b = ($selecttype)s;
12978 for (i = 0; i < NBITS; i++)
12982 select(fd + 1, b, 0, 0, &t);
12983 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12984 printf("%d\n", i + 1);
12989 if eval $compile_ok; then
12990 selectminbits=`./try`
12991 case "$selectminbits" in
12993 Cannot figure out on how many bits at a time your select() operates.
12994 I'll play safe and guess it is 32 bits.
13000 *) bits="$selectminbits bits" ;;
13002 echo "Your select() operates on $bits at a time." >&4
13004 rp='What is the minimum number of bits your select() operates on?'
13005 case "$byteorder" in
13006 1234|12345678) dflt=32 ;;
13011 selectminbits="$val"
13015 *) : no select, so pick a harmless default
13022 : Trace out the files included by signal.h, then look for SIGxxx names.
13023 : Remove SIGARRAYSIZE used by HPUX.
13024 : Remove SIGSTKSIZE used by Linux.
13025 : Remove SIGSTKSZ used by Posix.
13026 : Remove SIGTYP void lines used by OS2.
13027 : Some cpps, like os390, dont give the file name anywhere
13028 if [ "X$fieldn" = X ]; then
13029 : Just make some guesses. We check them later.
13030 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13032 xxx=`echo '#include <signal.h>' |
13033 $cppstdin $cppminus $cppflags 2>/dev/null |
13034 $grep '^[ ]*#.*include' |
13035 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13037 : Check this list of files to be sure we have parsed the cpp output ok.
13038 : This will also avoid potentially non-existent files, such
13041 for xx in $xxx /dev/null ; do
13042 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13044 : If we have found no files, at least try signal.h
13045 case "$xxxfiles" in
13046 '') xxxfiles=`./findhdr signal.h` ;;
13049 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13050 print substr($2, 4, 20)
13052 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13053 print substr($3, 4, 20)
13055 : Append some common names just in case the awk scan failed.
13056 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13057 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13058 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13059 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13060 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13062 : generate a few handy files for later
13063 $cat > signal.c <<'EOCP'
13064 #include <sys/types.h>
13065 #include <signal.h>
13069 /* Strange style to avoid deeply-nested #if/#else/#endif */
13072 # define NSIG (_NSIG)
13078 # define NSIG (SIGMAX+1)
13084 # define NSIG (SIG_MAX+1)
13090 # define NSIG (MAXSIG+1)
13096 # define NSIG (MAX_SIG+1)
13101 # ifdef SIGARRAYSIZE
13102 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13108 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13112 /* Default to some arbitrary number that's big enough to get most
13113 of the common signals.
13119 printf("NSIG %d\n", NSIG);
13125 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13127 printf "#ifdef SIG"; printf $1; printf "\n"
13128 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13129 printf $1; printf ");\n"
13133 printf "#endif /* JUST_NSIG */\n";
13134 printf "exit(0);\n}\n";
13137 $cat >signal.awk <<'EOP'
13138 BEGIN { ndups = 0 }
13139 $1 ~ /^NSIG$/ { nsig = $2 }
13140 ($1 !~ /^NSIG$/) && (NF == 2) {
13141 if ($2 > maxsig) { maxsig = $2 }
13142 if (sig_name[$2]) {
13143 dup_name[ndups] = $1
13144 dup_num[ndups] = $2
13156 printf("NSIG %d\n", nsig);
13157 for (n = 1; n < nsig; n++) {
13159 printf("%s %d\n", sig_name[n], sig_num[n])
13162 printf("NUM%d %d\n", n, n)
13165 for (n = 0; n < ndups; n++) {
13166 printf("%s %d\n", dup_name[n], dup_num[n])
13170 $cat >signal_cmd <<EOS
13172 if $test -s signal.lst; then
13173 echo "Using your existing signal.lst file"
13178 $cat >>signal_cmd <<'EOS'
13181 if eval $compile_ok; then
13182 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13184 echo "(I can't seem be able to compile the whole test program)" >&4
13185 echo "(I'll try it in little pieces.)" >&4
13186 set signal -DJUST_NSIG
13187 if eval $compile_ok; then
13188 ./signal$_exe > signal.nsg
13191 echo "I can't seem to figure out how many signals you have." >&4
13192 echo "Guessing 50." >&4
13193 echo 'NSIG 50' > signal.nsg
13195 : Now look at all the signal names, one at a time.
13196 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13197 $cat > signal.c <<EOCP
13198 #include <sys/types.h>
13199 #include <signal.h>
13202 printf("$xx %d\n", SIG${xx});
13207 if eval $compile; then
13208 echo "SIG${xx} found."
13209 ./signal$_exe >> signal.ls1
13211 echo "SIG${xx} NOT found."
13214 if $test -s signal.ls1; then
13215 $cat signal.nsg signal.ls1 |
13216 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13220 if $test -s signal.lst; then
13223 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13224 echo 'kill -l' >signal
13225 set X `csh -f <signal`
13229 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13231 echo $@ | $tr ' ' $trnl | \
13232 $awk '{ printf "%s %d\n", $1, ++s; }
13233 END { printf "NSIG %d\n", ++s }' >signal.lst
13235 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13237 chmod a+x signal_cmd
13238 $eunicefix signal_cmd
13240 : generate list of signal names
13242 case "$sig_name_init" in
13244 *) case "$sig_num_init" in
13245 ''|*,*) doinit=yes ;;
13250 echo "Generating a list of signal names and numbers..." >&4
13252 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13253 sig_name=`$awk 'BEGIN { printf "ZERO " }
13254 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13255 sig_num=`$awk 'BEGIN { printf "0 " }
13256 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13257 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13258 !/^NSIG/ { printf "\"%s\", ", $1 }
13259 END { printf "0\n" }' signal.lst`
13260 sig_num_init=`$awk 'BEGIN { printf "0, " }
13261 !/^NSIG/ { printf "%d, ", $2}
13262 END { printf "0\n"}' signal.lst`
13265 echo "The following $sig_count signals are available:"
13267 echo $sig_name | $awk \
13268 'BEGIN { linelen = 0 }
13270 for (i = 1; i <= NF; i++) {
13271 name = "SIG" $i " "
13272 linelen = linelen + length(name)
13273 if (linelen > 70) {
13275 linelen = length(name)
13281 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13283 : see what type is used for signed size_t
13284 set ssize_t ssizetype int stdio.h sys/types.h
13287 $cat > ssize.c <<EOM
13289 #include <sys/types.h>
13290 #define Size_t $sizetype
13291 #define SSize_t $dflt
13294 if (sizeof(Size_t) == sizeof(SSize_t))
13296 else if (sizeof(Size_t) == sizeof(int))
13305 if eval $compile_ok && ./ssize > /dev/null; then
13306 ssizetype=`./ssize`
13307 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13310 Help! I can't compile and run the ssize_t test program: please enlighten me!
13311 (This is probably a misconfiguration in your system or libraries, and
13312 you really ought to fix it. Still, I'll try anyway.)
13314 I need a type that is the same size as $sizetype, but is guaranteed to
13315 be signed. Common values are ssize_t, int and long.
13318 rp="What signed type is the same size as $sizetype?"
13322 $rm -f ssize ssize.*
13324 : see what type of char stdio uses.
13326 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13327 echo "Your stdio uses unsigned chars." >&4
13328 stdchar="unsigned char"
13330 echo "Your stdio uses signed chars." >&4
13334 : see if time exists
13336 if test "X$d_time" = X -o X"$timetype" = X; then
13337 if set time val -f d_time; eval $csym; $val; then
13338 echo 'time() found.' >&4
13340 rp="What is the type returned by time() on this system?"
13341 set time_t timetype long stdio.h sys/types.h
13344 echo 'time() not found, hope that will do.' >&4
13352 : see what type uids are declared as in the kernel
13354 echo "Looking for the type for user ids returned by getuid()."
13355 set uid_t uidtype xxx stdio.h sys/types.h
13359 xxx=`./findhdr sys/user.h`
13360 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13362 unsigned) dflt="$1 $2" ;;
13366 *) dflt="$uidtype";;
13369 uid_t) echo "uid_t found." ;;
13370 *) rp="What is the type for user ids returned by getuid()?"
13378 *_t) zzz="$uidtype" ;;
13381 echo "Checking the size of $zzz..." >&4
13383 #include <sys/types.h>
13386 printf("%d\n", (int)sizeof($uidtype));
13391 if eval $compile_ok; then
13395 echo "(I can't execute the test program--guessing $uidsize.)" >&4
13398 echo "Your $zzz size is $uidsize bytes."
13403 echo "(I can't compile the test program--guessing $uidsize.)" >&4
13408 *_t) zzz="$uidtype" ;;
13411 echo "Checking the sign of $zzz..." >&4
13413 #include <sys/types.h>
13424 if eval $compile; then
13428 echo "(I can't execute the test program--guessing unsigned.)" >&4
13432 1) echo "Your $zzz is unsigned." ;;
13433 -1) echo "Your $zzz is signed." ;;
13439 echo "(I can't compile the test program--guessing unsigned.)" >&4
13445 $echo "Checking the format string to be used for uids..." >&4
13448 -1) if $test X"$uidsize" = X"$ivsize"; then
13449 uidformat="$ivdformat"
13451 if $test X"$uidsize" = X"$longsize"; then
13454 if $test X"$uidsize" = X"$intsize"; then
13457 if $test X"$uidsize" = X"$shortsize"; then
13464 *) if $test X"$uidsize" = X"$uvsize"; then
13465 uidformat="$uvuformat"
13467 if $test X"$uidsize" = X"$longsize"; then
13470 if $test X"$uidsize" = X"$intsize"; then
13473 if $test X"$uidsize" = X"$shortsize"; then
13482 : see if dbm.h is available
13483 : see if dbmclose exists
13484 set dbmclose d_dbmclose
13487 case "$d_dbmclose" in
13497 *) set rpcsvc/dbm.h i_rpcsvcdbm
13502 *) echo "We won't be including <dbm.h>"
13512 : see if this is a sys/file.h system
13517 : do we need to include sys/file.h ?
13521 if $h_sysfile; then
13523 echo "We'll be including <sys/file.h>." >&4
13526 echo "We won't be including <sys/file.h>." >&4
13536 : see if fcntl.h is there
13541 : see if we can include fcntl.h
13547 echo "We'll be including <fcntl.h>." >&4
13550 if $h_sysfile; then
13551 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13553 echo "We won't be including <fcntl.h>." >&4
13565 : see if locale.h is available
13566 set locale.h i_locale
13569 : see if mach cthreads are available
13570 if test "X$usethreads" = "X$define"; then
13571 set mach/cthreads.h i_machcthr
13574 i_machcthr="$undef"
13579 : see if this is a math.h system
13583 : see if this is a mntent.h system
13584 set mntent.h i_mntent
13587 : see if ndbm.h is available
13592 : see if dbm_open exists
13593 set dbm_open d_dbm_open
13595 case "$d_dbm_open" in
13598 echo "We won't be including <ndbm.h>"
13607 : see if net/errno.h is available
13609 set net/errno.h val
13612 : Unfortunately, it causes problems on some systems. Arrgh.
13615 cat > try.c <<'EOM'
13618 #include <net/errno.h>
13624 if $cc $ccflags -c try.c >/dev/null 2>&1; then
13625 echo "We'll be including <net/errno.h>." >&4
13627 echo "We won't be including <net/errno.h>." >&4
13636 : see if netinet/tcp.h is available
13637 set netinet/tcp.h i_netinettcp
13640 : see if this is a poll.h system
13644 : get C preprocessor symbols handy
13646 $echo $n "Hmm... $c"
13647 echo $al | $tr ' ' $trnl >Cppsym.know
13648 $cat <<EOSS >Cppsym
13656 case "\$list\$#" in
13659 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
13661 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
13664 unknown="\$unknown \$sym"
13674 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
13676 exit 0; _ _ _ _\1\\ \1\\
13679 echo "exit 1; _ _ _" >>Cppsym\$\$
13680 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
13682 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
13688 $rm -f Cppsym\$\$ Cppsym2\$\$
13693 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
13695 : now check the C compiler for additional symbols
13696 postprocess_cc_v=''
13698 aix) postprocess_cc_v="|$tr , ' '" ;;
13705 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
13708 -D*) echo "\$i" | $sed 's/^-D//';;
13709 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
13714 postprocess_cc_v=''
13717 ./ccsym > ccsym1.raw
13718 if $test -s ccsym1.raw; then
13719 $sort ccsym1.raw | $uniq >ccsym.raw
13721 mv ccsym1.raw ccsym.raw
13724 $awk '/\=/ { print $0; next }
13725 { print $0"=1" }' ccsym.raw >ccsym.list
13726 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
13727 $comm -13 ccsym.true ccsym.list >ccsym.own
13728 $comm -12 ccsym.true ccsym.list >ccsym.com
13729 $comm -23 ccsym.true ccsym.list >ccsym.cpp
13731 if $test -z ccsym.raw; then
13732 echo "Your C compiler doesn't seem to define any symbols!" >&4
13734 echo "However, your C preprocessor defines the following symbols:"
13737 cppsymbols=`$cat Cppsym.true`
13738 cppsymbols=`echo $cppsymbols`
13739 cppccsymbols="$cppsymbols"
13741 if $test -s ccsym.com; then
13742 echo "Your C compiler and pre-processor define these symbols:"
13743 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
13746 cppccsymbols=`$cat ccsym.com`
13747 cppccsymbols=`echo $cppccsymbols`
13748 $test "$silent" || sleep 1
13750 if $test -s ccsym.cpp; then
13751 $test "$also" && echo " "
13752 echo "Your C pre-processor ${also}defines the following symbols:"
13753 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
13755 cppsymbols=`$cat ccsym.cpp`
13756 cppsymbols=`echo $cppsymbols`
13757 $test "$silent" || sleep 1
13759 if $test -s ccsym.own; then
13760 $test "$also" && echo " "
13761 echo "Your C compiler ${also}defines the following cpp symbols:"
13762 $sed -e 's/\(.*\)=1/\1/' ccsym.own
13763 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
13764 ccsymbols=`$cat ccsym.own`
13765 ccsymbols=`echo $ccsymbols`
13766 $test "$silent" || sleep 1
13771 : see if this is a termio system
13775 if $test `./findhdr termios.h`; then
13776 set tcsetattr i_termios
13782 "$define") echo "You have POSIX termios.h... good!" >&4;;
13783 *) if ./Cppsym pyr; then
13784 case "`/bin/universe`" in
13785 ucb) if $test `./findhdr sgtty.h`; then
13787 echo "<sgtty.h> found." >&4
13789 echo "System is pyramid with BSD universe."
13790 echo "<sgtty.h> not found--you could have problems." >&4
13792 *) if $test `./findhdr termio.h`; then
13794 echo "<termio.h> found." >&4
13796 echo "System is pyramid with USG universe."
13797 echo "<termio.h> not found--you could have problems." >&4
13801 if $test `./findhdr termio.h`; then
13802 echo "<termio.h> found." >&4
13804 elif $test `./findhdr sgtty.h`; then
13805 echo "<sgtty.h> found." >&4
13808 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13811 if $test `./findhdr sgtty.h`; then
13812 echo "<sgtty.h> found." >&4
13814 elif $test `./findhdr termio.h`; then
13815 echo "<termio.h> found." >&4
13818 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13822 set i_termio; eval $setvar
13823 val=$val2; set i_sgtty; eval $setvar
13824 val=$val3; set i_termios; eval $setvar
13826 : see if this is a shadow.h system
13827 set shadow.h i_shadow
13830 : see if this is a socks.h system
13831 set socks.h i_socks
13834 : see if stdarg is available
13836 if $test `./findhdr stdarg.h`; then
13837 echo "<stdarg.h> found." >&4
13840 echo "<stdarg.h> NOT found." >&4
13844 : see if varags is available
13846 if $test `./findhdr varargs.h`; then
13847 echo "<varargs.h> found." >&4
13849 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13852 : set up the varargs testing programs
13853 $cat > varargs.c <<EOP
13855 #include <stdarg.h>
13858 #include <varargs.h>
13862 int f(char *p, ...)
13876 p = va_arg(ap, char *);
13881 $cat > varargs <<EOP
13883 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13892 : now check which varargs header should be included
13897 if `./varargs I_STDARG`; then
13899 elif `./varargs I_VARARGS`; then
13904 if `./varargs I_VARARGS`; then
13911 echo "I could not find the definition for va_dcl... You have problems..." >&4
13912 val="$undef"; set i_stdarg; eval $setvar
13913 val="$undef"; set i_varargs; eval $setvar
13918 case "$i_varhdr" in
13920 val="$define"; set i_stdarg; eval $setvar
13921 val="$undef"; set i_varargs; eval $setvar
13924 val="$undef"; set i_stdarg; eval $setvar
13925 val="$define"; set i_varargs; eval $setvar
13928 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13932 : see if stddef is available
13933 set stddef.h i_stddef
13936 : see if sys/access.h is available
13937 set sys/access.h i_sysaccess
13940 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13941 set sys/filio.h i_sysfilio
13944 if $test `./findhdr sys/ioctl.h`; then
13946 echo '<sys/ioctl.h> found.' >&4
13949 if $test $i_sysfilio = "$define"; then
13950 echo '<sys/ioctl.h> NOT found.' >&4
13952 $test $i_sgtty = "$define" && xxx="sgtty.h"
13953 $test $i_termio = "$define" && xxx="termio.h"
13954 $test $i_termios = "$define" && xxx="termios.h"
13955 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13961 : see if sys/resource.h has to be included
13962 set sys/resource.h i_sysresrc
13965 : see if sys/security.h is available
13966 set sys/security.h i_syssecrt
13969 : see if this is a sys/statvfs.h system
13970 set sys/statvfs.h i_sysstatvfs
13973 : see if this is a sys/uio.h system
13974 set sys/uio.h i_sysuio
13977 : see if this is a sys/un.h system
13978 set sys/un.h i_sysun
13981 : see if this is a syswait system
13982 set sys/wait.h i_syswait
13985 : see if this is a ustat.h system
13986 set ustat.h i_ustat
13989 : see if this is an utime system
13990 set utime.h i_utime
13993 : see if this is a values.h system
13994 set values.h i_values
13997 : see if this is a vfork system
14000 set vfork.h i_vfork
14008 : see if gdbm.h is available
14013 : see if gdbm_open exists
14014 set gdbm_open d_gdbm_open
14016 case "$d_gdbm_open" in
14019 echo "We won't be including <gdbm.h>"
14029 echo "Looking for extensions..." >&4
14030 : If we are using the old config.sh, known_extensions may contain
14031 : old or inaccurate or duplicate values.
14032 known_extensions=''
14033 nonxs_extensions=''
14034 : We do not use find because it might not be available.
14035 : We do not just use MANIFEST because the user may have dropped
14036 : some additional extensions into the source tree and expect them
14039 : Function to recursively find available extensions, ignoring DynaLoader
14040 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
14044 DynaLoader|dynaload) ;;
14046 if $test -f $xxx/$xxx.xs; then
14047 known_extensions="$known_extensions $1$xxx";
14048 elif $test -f $xxx/Makefile.PL; then
14049 nonxs_extensions="$nonxs_extensions $1$xxx";
14051 if $test -d $xxx -a $# -lt 10; then
14054 eval $find_extensions;
14066 eval $find_extensions
14067 set X $nonxs_extensions
14069 nonxs_extensions="$*"
14070 set X $known_extensions
14072 known_extensions="$*"
14075 : Now see which are supported on this system.
14077 for xxx in $known_extensions ; do
14081 $define) avail_ext="$avail_ext $xxx" ;;
14084 GDBM_File|gdbm_fil)
14086 $define) avail_ext="$avail_ext $xxx" ;;
14089 NDBM_File|ndbm_fil)
14091 $define) avail_ext="$avail_ext $xxx" ;;
14094 ODBM_File|odbm_fil)
14095 case "${i_dbm}${i_rpcsvcdbm}" in
14096 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14100 case "$useposix" in
14101 true|define|y) avail_ext="$avail_ext $xxx" ;;
14105 case "$useopcode" in
14106 true|define|y) avail_ext="$avail_ext $xxx" ;;
14110 case "$d_socket" in
14111 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14115 case "$usethreads" in
14116 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14120 : XXX Do we need a useipcsysv variable here
14121 case "${d_msg}${d_sem}${d_shm}" in
14122 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14125 *) avail_ext="$avail_ext $xxx"
14134 : Now see which nonxs extensions are supported on this system.
14135 : For now assume all are.
14137 for xxx in $nonxs_extensions ; do
14139 *) nonxs_ext="$nonxs_ext $xxx"
14151 A number of extensions are supplied with $package. You may choose to
14152 compile these extensions for dynamic loading (the default), compile
14153 them into the $package executable (static loading), or not include
14154 them at all. Answer "none" to include no extensions.
14155 Note that DynaLoader is always built and need not be mentioned here.
14158 case "$dynamic_ext" in
14159 '') dflt="$avail_ext" ;;
14160 *) dflt="$dynamic_ext"
14161 # Perhaps we are reusing an old out-of-date config.sh.
14164 if test X"$dynamic_ext" != X"$avail_ext"; then
14166 NOTICE: Your previous config.sh list may be incorrect.
14167 The extensions now available to you are
14169 but the default list from your previous config.sh is
14181 rp="What extensions do you wish to load dynamically?"
14184 none) dynamic_ext=' ' ;;
14185 *) dynamic_ext="$ans" ;;
14188 case "$static_ext" in
14190 : Exclude those already listed in dynamic linking
14192 for xxx in $avail_ext; do
14193 case " $dynamic_ext " in
14195 *) dflt="$dflt $xxx" ;;
14202 *) dflt="$static_ext"
14209 rp="What extensions do you wish to load statically?"
14212 none) static_ext=' ' ;;
14213 *) static_ext="$ans" ;;
14218 A number of extensions are supplied with $package. Answer "none"
14219 to include no extensions.
14220 Note that DynaLoader is always built and need not be mentioned here.
14223 case "$static_ext" in
14224 '') dflt="$avail_ext" ;;
14225 *) dflt="$static_ext"
14226 # Perhaps we are reusing an old out-of-date config.sh.
14229 if test X"$static_ext" != X"$avail_ext"; then
14231 NOTICE: Your previous config.sh list may be incorrect.
14232 The extensions now available to you are
14234 but the default list from your previous config.sh is
14243 : Exclude those that are not xs extensions
14247 rp="What extensions do you wish to include?"
14250 none) static_ext=' ' ;;
14251 *) static_ext="$ans" ;;
14256 set X $dynamic_ext $static_ext $nonxs_ext
14260 : Remove build directory name from cppstdin so it can be used from
14261 : either the present location or the final installed location.
14263 : Get out of the UU directory to get correct path name.
14265 case "$cppstdin" in
14267 echo "Stripping down cppstdin path name"
14273 : end of configuration questions
14275 echo "End of configuration questions."
14278 : back to where it started
14279 if test -d ../UU; then
14283 : configuration may be patched via a 'config.over' file
14284 if $test -f config.over; then
14287 rp='I see a config.over file. Do you wish to load it?'
14290 n*) echo "OK, I'll ignore it.";;
14292 echo "Configuration override changes have been loaded."
14297 : in case they want portability, strip down executable paths
14298 case "$d_portable" in
14301 echo "Stripping down executable paths..." >&4
14302 for file in $loclist $trylist; do
14304 eval $file=`basename $temp`
14309 : create config.sh file
14311 echo "Creating config.sh..." >&4
14312 $spitshell <<EOT >config.sh
14315 # This file was produced by running the Configure script. It holds all the
14316 # definitions figured out by Configure. Should you modify one of these values,
14317 # do not forget to propagate your changes by running "Configure -der". You may
14318 # instead choose to run each of the .SH files by yourself, or "Configure -S".
14321 # Package name : $package
14322 # Source directory : $src
14323 # Configuration time: $cf_time
14324 # Configured by : $cf_by
14325 # Target system : $myuname
14335 Revision='$Revision'
14342 alignbytes='$alignbytes'
14343 ansi2knr='$ansi2knr'
14344 aphostname='$aphostname'
14345 api_revision='$api_revision'
14346 api_subversion='$api_subversion'
14347 api_version='$api_version'
14348 api_versionstring='$api_versionstring'
14351 archlibexp='$archlibexp'
14352 archname64='$archname64'
14353 archname='$archname'
14354 archobjs='$archobjs'
14359 bincompat5005='$bincompat5005'
14363 byteorder='$byteorder'
14365 castflags='$castflags'
14368 cccdlflags='$cccdlflags'
14369 ccdlflags='$ccdlflags'
14371 ccsymbols='$ccsymbols'
14373 cf_email='$cf_email'
14375 charsize='$charsize'
14379 clocktype='$clocktype'
14381 compress='$compress'
14382 contains='$contains'
14386 cpp_stuff='$cpp_stuff'
14387 cppccsymbols='$cppccsymbols'
14388 cppflags='$cppflags'
14390 cppminus='$cppminus'
14392 cppstdin='$cppstdin'
14393 cppsymbols='$cppsymbols'
14394 crosscompile='$crosscompile'
14395 cryptlib='$cryptlib'
14397 d_Gconvert='$d_Gconvert'
14398 d_PRIEldbl='$d_PRIEldbl'
14399 d_PRIFldbl='$d_PRIFldbl'
14400 d_PRIGldbl='$d_PRIGldbl'
14401 d_PRIX64='$d_PRIX64'
14402 d_PRId64='$d_PRId64'
14403 d_PRIeldbl='$d_PRIeldbl'
14404 d_PRIfldbl='$d_PRIfldbl'
14405 d_PRIgldbl='$d_PRIgldbl'
14406 d_PRIi64='$d_PRIi64'
14407 d_PRIo64='$d_PRIo64'
14408 d_PRIu64='$d_PRIu64'
14409 d_PRIx64='$d_PRIx64'
14410 d_access='$d_access'
14411 d_accessx='$d_accessx'
14413 d_archlib='$d_archlib'
14416 d_attribut='$d_attribut'
14419 d_bincompat5005='$d_bincompat5005'
14421 d_bsdgetpgrp='$d_bsdgetpgrp'
14422 d_bsdsetpgrp='$d_bsdsetpgrp'
14424 d_casti32='$d_casti32'
14425 d_castneg='$d_castneg'
14426 d_charvspr='$d_charvspr'
14428 d_chroot='$d_chroot'
14429 d_chsize='$d_chsize'
14430 d_closedir='$d_closedir'
14434 d_cuserid='$d_cuserid'
14435 d_dbl_dig='$d_dbl_dig'
14436 d_difftime='$d_difftime'
14437 d_dirnamlen='$d_dirnamlen'
14438 d_dlerror='$d_dlerror'
14439 d_dlopen='$d_dlopen'
14440 d_dlsymun='$d_dlsymun'
14441 d_dosuid='$d_dosuid'
14442 d_drand48proto='$d_drand48proto'
14444 d_eaccess='$d_eaccess'
14445 d_endgrent='$d_endgrent'
14446 d_endhent='$d_endhent'
14447 d_endnent='$d_endnent'
14448 d_endpent='$d_endpent'
14449 d_endpwent='$d_endpwent'
14450 d_endsent='$d_endsent'
14451 d_endspent='$d_endspent'
14452 d_eofnblk='$d_eofnblk'
14453 d_eunice='$d_eunice'
14454 d_fchmod='$d_fchmod'
14455 d_fchown='$d_fchown'
14457 d_fd_macros='$d_fd_macros'
14458 d_fd_set='$d_fd_set'
14459 d_fds_bits='$d_fds_bits'
14460 d_fgetpos='$d_fgetpos'
14461 d_flexfnam='$d_flexfnam'
14464 d_fpathconf='$d_fpathconf'
14465 d_fpos64_t='$d_fpos64_t'
14466 d_fs_data_s='$d_fs_data_s'
14467 d_fseeko='$d_fseeko'
14468 d_fsetpos='$d_fsetpos'
14469 d_fstatfs='$d_fstatfs'
14470 d_fstatvfs='$d_fstatvfs'
14471 d_ftello='$d_ftello'
14473 d_getgrent='$d_getgrent'
14474 d_getgrps='$d_getgrps'
14475 d_gethbyaddr='$d_gethbyaddr'
14476 d_gethbyname='$d_gethbyname'
14477 d_gethent='$d_gethent'
14478 d_gethname='$d_gethname'
14479 d_gethostprotos='$d_gethostprotos'
14480 d_getlogin='$d_getlogin'
14481 d_getmnt='$d_getmnt'
14482 d_getmntent='$d_getmntent'
14483 d_getnbyaddr='$d_getnbyaddr'
14484 d_getnbyname='$d_getnbyname'
14485 d_getnent='$d_getnent'
14486 d_getnetprotos='$d_getnetprotos'
14487 d_getpbyname='$d_getpbyname'
14488 d_getpbynumber='$d_getpbynumber'
14489 d_getpent='$d_getpent'
14490 d_getpgid='$d_getpgid'
14491 d_getpgrp2='$d_getpgrp2'
14492 d_getpgrp='$d_getpgrp'
14493 d_getppid='$d_getppid'
14494 d_getprior='$d_getprior'
14495 d_getprotoprotos='$d_getprotoprotos'
14496 d_getpwent='$d_getpwent'
14497 d_getsbyname='$d_getsbyname'
14498 d_getsbyport='$d_getsbyport'
14499 d_getsent='$d_getsent'
14500 d_getservprotos='$d_getservprotos'
14501 d_getspent='$d_getspent'
14502 d_getspnam='$d_getspnam'
14503 d_gettimeod='$d_gettimeod'
14504 d_gnulibc='$d_gnulibc'
14505 d_grpasswd='$d_grpasswd'
14506 d_hasmntopt='$d_hasmntopt'
14509 d_inetaton='$d_inetaton'
14510 d_int64t='$d_int64t'
14511 d_isascii='$d_isascii'
14512 d_killpg='$d_killpg'
14513 d_lchown='$d_lchown'
14514 d_ldbl_dig='$d_ldbl_dig'
14516 d_locconv='$d_locconv'
14518 d_longdbl='$d_longdbl'
14519 d_longlong='$d_longlong'
14522 d_mbstowcs='$d_mbstowcs'
14523 d_mbtowc='$d_mbtowc'
14524 d_memchr='$d_memchr'
14525 d_memcmp='$d_memcmp'
14526 d_memcpy='$d_memcpy'
14527 d_memmove='$d_memmove'
14528 d_memset='$d_memset'
14530 d_mkfifo='$d_mkfifo'
14531 d_mktime='$d_mktime'
14533 d_msg_ctrunc='$d_msg_ctrunc'
14534 d_msg_dontroute='$d_msg_dontroute'
14535 d_msg_oob='$d_msg_oob'
14536 d_msg_peek='$d_msg_peek'
14537 d_msg_proxy='$d_msg_proxy'
14538 d_msgctl='$d_msgctl'
14539 d_msgget='$d_msgget'
14540 d_msgrcv='$d_msgrcv'
14541 d_msgsnd='$d_msgsnd'
14542 d_mymalloc='$d_mymalloc'
14544 d_off64_t='$d_off64_t'
14545 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
14546 d_oldpthreads='$d_oldpthreads'
14547 d_oldsock='$d_oldsock'
14549 d_pathconf='$d_pathconf'
14551 d_phostname='$d_phostname'
14554 d_portable='$d_portable'
14555 d_pthread_yield='$d_pthread_yield'
14557 d_pwchange='$d_pwchange'
14558 d_pwclass='$d_pwclass'
14559 d_pwcomment='$d_pwcomment'
14560 d_pwexpire='$d_pwexpire'
14561 d_pwgecos='$d_pwgecos'
14562 d_pwpasswd='$d_pwpasswd'
14563 d_pwquota='$d_pwquota'
14566 d_readdir='$d_readdir'
14567 d_readlink='$d_readlink'
14568 d_rename='$d_rename'
14569 d_rewinddir='$d_rewinddir'
14571 d_safebcpy='$d_safebcpy'
14572 d_safemcpy='$d_safemcpy'
14573 d_sanemcmp='$d_sanemcmp'
14574 d_sched_yield='$d_sched_yield'
14575 d_scm_rights='$d_scm_rights'
14576 d_seekdir='$d_seekdir'
14577 d_select='$d_select'
14579 d_semctl='$d_semctl'
14580 d_semctl_semid_ds='$d_semctl_semid_ds'
14581 d_semctl_semun='$d_semctl_semun'
14582 d_semget='$d_semget'
14584 d_setegid='$d_setegid'
14585 d_seteuid='$d_seteuid'
14586 d_setgrent='$d_setgrent'
14587 d_setgrps='$d_setgrps'
14588 d_sethent='$d_sethent'
14589 d_setlinebuf='$d_setlinebuf'
14590 d_setlocale='$d_setlocale'
14591 d_setnent='$d_setnent'
14592 d_setpent='$d_setpent'
14593 d_setpgid='$d_setpgid'
14594 d_setpgrp2='$d_setpgrp2'
14595 d_setpgrp='$d_setpgrp'
14596 d_setprior='$d_setprior'
14597 d_setpwent='$d_setpwent'
14598 d_setregid='$d_setregid'
14599 d_setresgid='$d_setresgid'
14600 d_setresuid='$d_setresuid'
14601 d_setreuid='$d_setreuid'
14602 d_setrgid='$d_setrgid'
14603 d_setruid='$d_setruid'
14604 d_setsent='$d_setsent'
14605 d_setsid='$d_setsid'
14606 d_setspent='$d_setspent'
14607 d_setvbuf='$d_setvbuf'
14611 d_shmatprototype='$d_shmatprototype'
14612 d_shmctl='$d_shmctl'
14614 d_shmget='$d_shmget'
14615 d_sigaction='$d_sigaction'
14616 d_sigsetjmp='$d_sigsetjmp'
14617 d_socket='$d_socket'
14618 d_sockpair='$d_sockpair'
14620 d_statblks='$d_statblks'
14621 d_statfs_f_flags='$d_statfs_f_flags'
14622 d_statfs_s='$d_statfs_s'
14623 d_statvfs='$d_statvfs'
14624 d_stdio_cnt_lval='$d_stdio_cnt_lval'
14625 d_stdio_ptr_lval='$d_stdio_ptr_lval'
14626 d_stdio_stream_array='$d_stdio_stream_array'
14627 d_stdiobase='$d_stdiobase'
14628 d_stdstdio='$d_stdstdio'
14629 d_strchr='$d_strchr'
14630 d_strcoll='$d_strcoll'
14631 d_strctcpy='$d_strctcpy'
14632 d_strerrm='$d_strerrm'
14633 d_strerror='$d_strerror'
14634 d_strtod='$d_strtod'
14635 d_strtol='$d_strtol'
14636 d_strtold='$d_strtold'
14637 d_strtoul='$d_strtoul'
14638 d_strtoull='$d_strtoull'
14639 d_strtouq='$d_strtouq'
14640 d_strxfrm='$d_strxfrm'
14641 d_suidsafe='$d_suidsafe'
14642 d_symlink='$d_symlink'
14643 d_syscall='$d_syscall'
14644 d_sysconf='$d_sysconf'
14645 d_sysernlst='$d_sysernlst'
14646 d_syserrlst='$d_syserrlst'
14647 d_system='$d_system'
14648 d_tcgetpgrp='$d_tcgetpgrp'
14649 d_tcsetpgrp='$d_tcsetpgrp'
14650 d_telldir='$d_telldir'
14651 d_telldirproto='$d_telldirproto'
14654 d_truncate='$d_truncate'
14655 d_tzname='$d_tzname'
14658 d_union_semun='$d_union_semun'
14660 d_vendorbin='$d_vendorbin'
14661 d_vendorlib='$d_vendorlib'
14663 d_void_closedir='$d_void_closedir'
14664 d_voidsig='$d_voidsig'
14665 d_voidtty='$d_voidtty'
14666 d_volatile='$d_volatile'
14667 d_vprintf='$d_vprintf'
14669 d_waitpid='$d_waitpid'
14670 d_wcstombs='$d_wcstombs'
14671 d_wctomb='$d_wctomb'
14674 db_hashtype='$db_hashtype'
14675 db_prefixtype='$db_prefixtype'
14676 defvoidused='$defvoidused'
14677 direntrytype='$direntrytype'
14680 doublesize='$doublesize'
14682 dynamic_ext='$dynamic_ext'
14688 eunicefix='$eunicefix'
14691 extensions='$extensions'
14692 fflushNULL='$fflushNULL'
14693 fflushall='$fflushall'
14695 firstmakefile='$firstmakefile'
14697 fpossize='$fpossize'
14698 fpostype='$fpostype'
14699 freetype='$freetype'
14701 full_csh='$full_csh'
14702 full_sed='$full_sed'
14703 gccversion='$gccversion'
14704 gidformat='$gidformat'
14710 groupcat='$groupcat'
14711 groupstype='$groupstype'
14714 h_sysfile='$h_sysfile'
14726 i_arpainet='$i_arpainet'
14727 i_bsdioctl='$i_bsdioctl'
14730 i_dirent='$i_dirent'
14737 i_inttypes='$i_inttypes'
14738 i_limits='$i_limits'
14739 i_locale='$i_locale'
14740 i_machcthr='$i_machcthr'
14741 i_malloc='$i_malloc'
14743 i_memory='$i_memory'
14744 i_mntent='$i_mntent'
14747 i_neterrno='$i_neterrno'
14748 i_netinettcp='$i_netinettcp'
14751 i_pthread='$i_pthread'
14753 i_rpcsvcdbm='$i_rpcsvcdbm'
14756 i_shadow='$i_shadow'
14758 i_stdarg='$i_stdarg'
14759 i_stddef='$i_stddef'
14760 i_stdlib='$i_stdlib'
14761 i_string='$i_string'
14762 i_sysaccess='$i_sysaccess'
14763 i_sysdir='$i_sysdir'
14764 i_sysfile='$i_sysfile'
14765 i_sysfilio='$i_sysfilio'
14767 i_sysioctl='$i_sysioctl'
14768 i_sysmount='$i_sysmount'
14769 i_sysndir='$i_sysndir'
14770 i_sysparam='$i_sysparam'
14771 i_sysresrc='$i_sysresrc'
14772 i_syssecrt='$i_syssecrt'
14773 i_sysselct='$i_sysselct'
14774 i_syssockio='$i_syssockio'
14775 i_sysstat='$i_sysstat'
14776 i_sysstatfs='$i_sysstatfs'
14777 i_sysstatvfs='$i_sysstatvfs'
14778 i_systime='$i_systime'
14779 i_systimek='$i_systimek'
14780 i_systimes='$i_systimes'
14781 i_systypes='$i_systypes'
14782 i_sysuio='$i_sysuio'
14784 i_sysvfs='$i_sysvfs'
14785 i_syswait='$i_syswait'
14786 i_termio='$i_termio'
14787 i_termios='$i_termios'
14789 i_unistd='$i_unistd'
14792 i_values='$i_values'
14793 i_varargs='$i_varargs'
14794 i_varhdr='$i_varhdr'
14796 ignore_versioned_solibs='$ignore_versioned_solibs'
14797 inc_version_list='$inc_version_list'
14800 installarchlib='$installarchlib'
14801 installbin='$installbin'
14802 installman1dir='$installman1dir'
14803 installman3dir='$installman3dir'
14804 installprefix='$installprefix'
14805 installprefixexp='$installprefixexp'
14806 installprivlib='$installprivlib'
14807 installscript='$installscript'
14808 installsitearch='$installsitearch'
14809 installsitebin='$installsitebin'
14810 installsitelib='$installsitelib'
14811 installstyle='$installstyle'
14812 installusrbinperl='$installusrbinperl'
14813 installvendorbin='$installvendorbin'
14814 installvendorlib='$installvendorlib'
14816 ivdformat='$ivdformat'
14819 known_extensions='$known_extensions'
14823 lddlflags='$lddlflags'
14825 ldlibpthname='$ldlibpthname'
14832 libswanted='$libswanted'
14838 locincpth='$locincpth'
14839 loclibpth='$loclibpth'
14840 longdblsize='$longdblsize'
14841 longlongsize='$longlongsize'
14842 longsize='$longsize'
14846 lseeksize='$lseeksize'
14847 lseektype='$lseektype'
14851 make_set_make='$make_set_make'
14852 mallocobj='$mallocobj'
14853 mallocsrc='$mallocsrc'
14854 malloctype='$malloctype'
14856 man1direxp='$man1direxp'
14859 man3direxp='$man3direxp'
14862 mips_type='$mips_type'
14865 modetype='$modetype'
14867 multiarch='$multiarch'
14869 myarchname='$myarchname'
14870 mydomain='$mydomain'
14871 myhostname='$myhostname'
14874 netdb_hlen_type='$netdb_hlen_type'
14875 netdb_host_type='$netdb_host_type'
14876 netdb_name_type='$netdb_name_type'
14877 netdb_net_type='$netdb_net_type'
14880 nm_so_opt='$nm_so_opt'
14881 nonxs_ext='$nonxs_ext'
14885 o_nonblock='$o_nonblock'
14887 old_pthread_create_joinable='$old_pthread_create_joinable'
14888 optimize='$optimize'
14889 orderlib='$orderlib'
14895 patchlevel='$patchlevel'
14896 path_sep='$path_sep'
14898 perladmin='$perladmin'
14899 perlpath='$perlpath'
14901 phostname='$phostname'
14907 prefixexp='$prefixexp'
14909 privlibexp='$privlibexp'
14910 prototype='$prototype'
14912 quadkind='$quadkind'
14913 quadtype='$quadtype'
14914 randbits='$randbits'
14915 randfunc='$randfunc'
14916 randseedtype='$randseedtype'
14918 rd_nodata='$rd_nodata'
14922 sPRIEldbl='$sPRIEldbl'
14923 sPRIFldbl='$sPRIFldbl'
14924 sPRIGldbl='$sPRIGldbl'
14927 sPRIeldbl='$sPRIeldbl'
14928 sPRIfldbl='$sPRIfldbl'
14929 sPRIgldbl='$sPRIgldbl'
14934 sched_yield='$sched_yield'
14935 scriptdir='$scriptdir'
14936 scriptdirexp='$scriptdirexp'
14938 seedfunc='$seedfunc'
14939 selectminbits='$selectminbits'
14940 selecttype='$selecttype'
14941 sendmail='$sendmail'
14944 sharpbang='$sharpbang'
14945 shmattype='$shmattype'
14946 shortsize='$shortsize'
14949 sig_count='$sig_count'
14950 sig_name='$sig_name'
14951 sig_name_init='$sig_name_init'
14953 sig_num_init='$sig_num_init'
14954 signal_t='$signal_t'
14955 sitearch='$sitearch'
14956 sitearchexp='$sitearchexp'
14958 sitebinexp='$sitebinexp'
14960 sitelibexp='$sitelibexp'
14961 siteprefix='$siteprefix'
14962 siteprefixexp='$siteprefixexp'
14963 sizetype='$sizetype'
14968 sockethdr='$sockethdr'
14969 socketlib='$socketlib'
14971 spackage='$spackage'
14972 spitshell='$spitshell'
14975 ssizetype='$ssizetype'
14976 startperl='$startperl'
14978 static_ext='$static_ext'
14980 stdio_base='$stdio_base'
14981 stdio_bufsiz='$stdio_bufsiz'
14982 stdio_cnt='$stdio_cnt'
14983 stdio_filbuf='$stdio_filbuf'
14984 stdio_ptr='$stdio_ptr'
14985 stdio_stream_array='$stdio_stream_array'
14988 subversion='$subversion'
14995 timeincl='$timeincl'
14996 timetype='$timetype'
15009 uidformat='$uidformat'
15015 uquadtype='$uquadtype'
15016 use5005threads='$use5005threads'
15017 use64bits='$use64bits'
15019 useithreads='$useithreads'
15020 uselargefiles='$uselargefiles'
15021 uselongdouble='$uselongdouble'
15022 uselonglong='$uselonglong'
15023 usemorebits='$usemorebits'
15024 usemultiplicity='$usemultiplicity'
15025 usemymalloc='$usemymalloc'
15027 useopcode='$useopcode'
15028 useperlio='$useperlio'
15029 useposix='$useposix'
15031 useshrplib='$useshrplib'
15032 usesocks='$usesocks'
15033 usethreads='$usethreads'
15034 usevendorprefix='$usevendorprefix'
15035 usevfork='$usevfork'
15038 uvoformat='$uvoformat'
15041 uvuformat='$uvuformat'
15042 uvxformat='$uvxformat'
15043 vendorbin='$vendorbin'
15044 vendorbinexp='$vendorbinexp'
15045 vendorlib='$vendorlib'
15046 vendorlibexp='$vendorlibexp'
15047 vendorprefix='$vendorprefix'
15048 vendorprefixexp='$vendorprefixexp'
15051 voidflags='$voidflags'
15057 : Add in command line options if available
15058 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
15060 : add special variables
15061 $test -f $src/patchlevel.h && \
15062 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
15063 echo "CONFIGDOTSH=true" >>config.sh
15065 : propagate old symbols
15066 if $test -f UU/config.sh; then
15067 <UU/config.sh sort | uniq >UU/oldconfig.sh
15068 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
15069 sort | uniq -u >UU/oldsyms
15070 set X `cat UU/oldsyms`
15076 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
15078 echo "# Variables propagated from previous config.sh file." >>config.sh
15079 for sym in `cat UU/oldsyms`; do
15080 echo " Propagating $hint variable "'$'"$sym..."
15081 eval 'tmp="$'"${sym}"'"'
15083 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
15089 : Finish up by extracting the .SH files
15103 If you'd like to make any changes to the config.sh file before I begin
15104 to configure things, do it as a shell escape now (e.g. !vi config.sh).
15107 rp="Press return or use a shell escape to edit config.sh:"
15112 *) : in case they cannot read
15113 sh 1>&4 -c "$ans";;
15118 : if this fails, just run all the .SH files by hand
15125 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
15132 Now you need to generate make dependencies by running "$make depend".
15133 You might prefer to run it in background: "$make depend > makedepend.out &"
15134 It can take a while, so you might not want to run it right now.
15139 rp="Run $make depend now?"
15143 $make depend && echo "Now you must run a $make."
15146 echo "You must run '$make depend' then '$make'."
15149 elif test -f [Mm]akefile; then
15151 echo "Now you must run a $make."
15156 if $test -f Policy.sh; then
15159 If you compile $package on a different machine or from a different object
15160 directory, copy the Policy.sh file from this object directory to the
15161 new one before you run Configure -- this will help you with most of
15162 the policy defaults.
15166 if $test -f config.msg; then
15167 echo "Hmm. I also noted the following information while running:"
15169 $cat config.msg >&4
15172 $rm -f kit*isdone ark*isdone