3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Thu Sep 30 19:41:54 EET DST 1999 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
441 d_old_pthread_create_joinable=''
442 old_pthread_create_joinable=''
691 ignore_versioned_solibs=''
812 d_stdio_stream_array=''
813 stdio_stream_array=''
849 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
852 : We must find out about Eunice early
854 if test -f /etc/unixtovms; then
855 eunicefix=/etc/unixtovms
857 if test -f /etc/unixtovms.exe; then
858 eunicefix=/etc/unixtovms.exe
862 : Possible local include directories to search.
863 : Set locincpth to "" in a hint file to defeat local include searches.
864 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
865 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
867 : no include file wanted by default
870 : list of known cpp symbols, sorted alphabetically
871 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
872 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
873 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
874 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
875 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
876 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
877 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
878 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
879 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
880 al="$al VMS Xenix286"
881 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
882 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
883 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
884 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
885 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
886 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
887 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
888 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
889 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
890 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
891 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
892 al="$al __SVR4_2__ __UMAXV__"
893 al="$al ____386BSD____ __alpha __alpha__ __amiga"
894 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
895 al="$al __host_mips__"
896 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
897 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
898 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
899 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
900 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
901 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
902 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
903 al="$al __mc88100 __mc88100__ __mips __mips__"
904 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
905 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
906 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
907 al="$al _host_mips _mips _unix"
908 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
909 al="$al apollo ardent att386 att3b"
910 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
911 al="$al cadmus clipper concurrent convex cray ctix"
912 al="$al dmert encore gcos gcx gimpel gould"
913 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
914 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
915 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
916 al="$al i186 i286 i386 i486 i8086"
917 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
918 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
919 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
920 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
921 al="$al mc88000 mc88100 merlin mert mips mvs n16"
922 al="$al ncl_el ncl_mr"
923 al="$al news1500 news1700 news1800 news1900 news3700"
924 al="$al news700 news800 news900 ns16000 ns32000"
925 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
926 al="$al parisc pc532 pdp11 plexus posix pyr"
927 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
928 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
929 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
930 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
931 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
932 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
935 : Trailing extension. Override this in a hint file, if needed.
937 : Extra object files, if any, needed on this platform.
940 : change the next line if compiling for Xenix/286 on Xenix/386
941 xlibpth='/usr/lib/386 /lib/386'
943 : Possible local library directories to search.
944 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
945 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
947 : general looking path for locating libraries
948 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
949 glibpth="$glibpth /lib /usr/lib $xlibpth"
950 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
951 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
953 : Private path used by Configure to find libraries. Its value
954 : is prepended to libpth. This variable takes care of special
955 : machines, like the mips. Usually, it should be empty.
958 : default library list
960 : some systems want to use only the non-versioned libso:s
961 ignore_versioned_solibs=''
962 : full support for void wanted by default
965 : set useposix=false in your hint file to disable the POSIX extension.
967 : set useopcode=false in your hint file to disable the Opcode extension.
969 : set usemultiplicity on the Configure command line to enable multiplicity.
970 : set usesocks on the Configure command line to enable socks.
971 : set usethreads on the Configure command line to enable threads.
972 : List of libraries we want.
973 : If anyone needs -lnet, put it in a hint file.
974 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
975 libswanted="$libswanted dld ld sun m c cposix posix"
976 libswanted="$libswanted ndir dir crypt sec"
977 libswanted="$libswanted ucb bsd BSD PW x"
978 : We probably want to search /usr/shlib before most other libraries.
979 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
980 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
981 glibpth="/usr/shlib $glibpth"
982 : Do not use vfork unless overridden by a hint file.
985 : Find the basic shell for Bourne shell scripts
989 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
992 if test -f "$xxx"; then
995 : Build up a list and do a single loop so we can 'break' out.
996 pth=`echo $PATH | sed -e "s/$p_/ /g"`
997 for xxx in sh bash ksh pdksh ash; do
999 try="$try ${p}/${xxx}"
1003 if test -f "$xxx"; then
1006 elif test -f "$xxx.exe"; then
1017 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1019 Usually it's in /bin/sh. How did you even get this far?
1020 Please contact me (Perl Maintainers) at perlbug@perl.com and
1021 we'll try to straighten this all out.
1027 : see if sh knows # comments
1028 if `$sh -c '#' >/dev/null 2>&1`; then
1032 test -f $xcat || xcat=/usr/bin/cat
1037 if test -s today; then
1040 echo "#! $xcat" > try
1044 if test -s today; then
1052 echo "Your $sh doesn't grok # comments--I will strip them later on."
1055 echo "exec grep -v '^[ ]*#'" >spitshell
1057 $eunicefix spitshell
1058 spitshell=`pwd`/spitshell
1060 echo "I presume that if # doesn't work, #! won't work either!"
1065 : figure out how to guarantee sh startup
1067 '') startsh=${sharpbang}${sh} ;;
1079 : echo "Yup, it does."
1081 echo "Hmm... '$startsh' does not guarantee sh startup..."
1082 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1087 : Save command line options in file UU/cmdline.opt for later use in
1088 : generating config.sh.
1089 cat > cmdline.opt <<EOSH
1090 # Configure command line arguments.
1097 cat >>cmdline.opt <<EOSH
1098 config_arg$argn='$arg'
1100 argn=`expr $argn + 1`
1103 : produce awk script to parse command line options
1104 cat >options.awk <<'EOF'
1106 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1108 len = length(optstr);
1109 for (i = 1; i <= len; i++) {
1110 c = substr(optstr, i, 1);
1111 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1122 if (substr(str, 1, 1) != "-") {
1123 printf("'%s'\n", str);
1127 for (i = 2; i <= len; i++) {
1128 c = substr(str, i, 1);
1130 printf("-%s\n", substr(str, i));
1136 printf("'%s'\n", substr(str, i + 1));
1149 : process the command line options
1150 set X `for arg in "$@"; do echo "X$arg"; done |
1151 sed -e s/X// | awk -f options.awk`
1156 : set up default values
1166 rm -f optdef.sh posthint.sh
1167 cat >optdef.sh <<EOS
1173 while test $# -gt 0; do
1175 -d) shift; fastread=yes;;
1176 -e) shift; alldone=cont;;
1180 if test -r "$1"; then
1183 echo "$me: cannot read config file $1." >&2
1188 -h) shift; error=true;;
1189 -r) shift; reuseval=true;;
1190 -s) shift; silent=true; realsilent=true;;
1191 -E) shift; alldone=exit;;
1192 -K) shift; knowitall=true;;
1193 -O) shift; override=true;;
1194 -S) shift; silent=true; extractsh=true;;
1199 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1200 echo "$me: ignoring -D $1" >&2
1203 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1204 *) echo "$1='define'" >> optdef.sh;;
1211 *=) echo "$1" >> optdef.sh;;
1213 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1214 echo "$me: ignoring -U $1" >&2
1216 *) echo "$1='undef'" >> optdef.sh;;
1227 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1231 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1232 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1238 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1239 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1240 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1241 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1242 *) xxx=`echo $yyy|sed 's!:.*!!'`
1243 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1249 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1251 echo "$yyy=''" >> posthint.sh ;;
1256 echo "$yyy='$zzz'" >> posthint.sh ;;
1258 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1260 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1265 echo "$yyy=$zzz" >> posthint.sh ;;
1266 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1269 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1272 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1280 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1281 [-U symbol] [-U symbol=] [-A command:symbol...]
1282 -d : use defaults for all answers.
1283 -e : go on without questioning past the production of config.sh.
1284 -f : specify an alternate default configuration file.
1285 -h : print this help message and exit (with an error status).
1286 -r : reuse C symbols value if possible (skips costly nm extraction).
1287 -s : silent mode, only echoes questions and essential information.
1288 -D : define symbol to have some value:
1289 -D symbol symbol gets the value 'define'
1290 -D symbol=value symbol gets the value 'value'
1291 -E : stop at the end of questions, after having produced config.sh.
1292 -K : do not use unless you know what you are doing.
1293 -O : let -D and -U override definitions from loaded configuration file.
1294 -S : perform variable substitutions on all .SH files (can mix with -f)
1295 -U : undefine symbol:
1296 -U symbol symbol gets the value 'undef'
1297 -U symbol= symbol gets completely empty
1298 -A : manipulate symbol after the platform specific hints have been applied:
1299 -A symbol=value append " "value to symbol
1300 -A append:symbol=value append value to symbol
1301 -A define:symbol=value define symbol to have value
1302 -A clear:symbol define symbol to be ''
1303 -A define:symbol define symbol to be 'define'
1304 -A eval:symbol=value define symbol to be eval of value
1305 -A prepend:symbol=value prepend value to symbol
1306 -A undef:symbol define symbol to be 'undef'
1307 -A undef:symbol= define symbol to be ''
1308 -V : print version number and exit (with a zero status).
1315 case "$fastread$alldone" in
1318 if test ! -t 0; then
1319 echo "Say 'sh Configure', not 'sh <Configure'"
1327 true) exec 1>/dev/null;;
1330 : run the defines and the undefines, if any, but leave the file out there...
1333 : create the posthint manipulation script and leave the file out there...
1338 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1339 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1340 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1341 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1342 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1345 : Some greps do not return status, grrr.
1346 echo "grimblepritz" >grimble
1347 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1349 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1355 : the following should work in any shell
1359 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1360 cat >contains <<'EOSS'
1361 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1366 : Find the path to the source tree
1369 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1372 *) src=`cd ../$src && pwd` ;;
1385 if test -f $rsrc/Configure && \
1386 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1388 : found it, so we are ok.
1391 for src in . .. ../.. ../../.. ../../../..; do
1392 if test -f ../$src/Configure && \
1393 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1404 Sorry, I can't seem to locate the source dir for $package. Please start
1405 Configure with an explicit path -- i.e. /some/path/Configure.
1413 echo "Sources for $package found in \"$src\"." >&4
1417 : script used to extract .SH files with variable substitutions
1418 cat >extract <<'EOS'
1420 echo "Doing variable substitutions on .SH files..."
1421 if test -f $src/MANIFEST; then
1422 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1424 echo "(Looking for .SH files under the source directory.)"
1425 set x `(cd $src; find . -name "*.SH" -print)`
1429 0) set x `(cd $src; echo *.SH)`; shift;;
1431 if test ! -f $src/$1; then
1437 while test $name; do
1438 if test ! -d "$name"; then
1439 create="$name $create";
1440 name=`echo $name | sed -e "s|^[^/]*$||"`;
1441 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1446 for file in $create; do
1455 dir=`expr X$file : 'X\(.*\)/'`
1456 file=`expr X$file : 'X.*/\(.*\)'`
1457 (cd $dir && . ./$file)
1467 dir=`expr X$file : 'X\(.*\)/'`
1468 file=`expr X$file : 'X.*/\(.*\)'`
1469 (set x $dir; shift; eval $mkdir_p)
1479 if test -f $src/config_h.SH; then
1480 if test ! -f config.h; then
1481 : oops, they left it out of MANIFEST, probably, so do it anyway.
1487 : extract files and exit if asked to do so
1488 case "$extractsh" in
1490 case "$realsilent" in
1494 case "$config_sh" in
1495 '') config_sh='config.sh';;
1498 echo "Fetching answers from $config_sh..."
1501 test "$override" && . ./optdef.sh
1510 : Eunice requires " " instead of "", can you believe it
1513 echo "Beginning of configuration questions for $package."
1515 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1517 : first determine how to suppress newline on echo command
1519 echo "Checking echo to see how to suppress newlines..."
1520 (echo "hi there\c" ; echo " ") >.echotmp
1521 if $contains c .echotmp >/dev/null 2>&1 ; then
1532 echo $n "The star should be here-->$c"
1536 : Now test for existence of everything in MANIFEST
1538 if test -f $rsrc/MANIFEST; then
1539 echo "First let's make sure your kit is complete. Checking..." >&4
1540 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1543 for filelist in x??; do
1544 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1546 if test -s missing; then
1550 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1552 You have the option of continuing the configuration process, despite the
1553 distinct possibility that your kit is damaged, by typing 'y'es. If you
1554 do, don't blame me if something goes wrong. I advise you to type 'n'o
1555 and contact the author (perlbug@perl.com).
1558 echo $n "Continue? [n] $c" >&4
1562 echo "Continuing..." >&4
1566 echo "ABORTING..." >&4
1571 echo "Looks good..."
1574 echo "There is no MANIFEST file. I hope your kit is complete !"
1579 : Find the appropriate value for a newline for tr
1580 if test -n "$DJGPP"; then
1583 if test X"$trnl" = X; then
1584 case "`echo foo|tr '\n' x 2>/dev/null`" in
1588 if test X"$trnl" = X; then
1589 case "`echo foo|tr '\012' x 2>/dev/null`" in
1590 foox) trnl='\012' ;;
1593 if test X"$trnl" = X; then
1596 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1602 : compute the number of columns on the terminal for proper question formatting
1607 : set up the echo used in my read
1608 myecho="case \"\$xxxm\" in
1609 '') echo $n \"\$rp $c\" >&4;;
1611 '') echo $n \"[\$xxxm] $c\";;
1613 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1615 echo $n \"[\$xxxm] $c\" >&4
1617 echo $n \"\$rp [\$xxxm] $c\" >&4
1623 : now set up to do reads with possible shell escape and default assignment
1629 case "\$fastread" in
1630 yes) case "\$dflt" in
1633 case "\$silent-\$rp" in
1638 *) case "\$silent" in
1639 true) case "\$rp" in
1644 while expr "X\$ans" : "X!" >/dev/null; do
1648 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1656 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1665 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1670 echo "(OK, I'll run with -d after this question.)" >&4
1673 echo "*** Sorry, \$1 not supported yet." >&4
1683 echo "*** Substitution done -- please confirm."
1685 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1690 echo "*** Error -- try again."
1697 case "\$ans\$xxxm\$nostick" in
1709 : create .config dir to save info across Configure sessions
1710 test -d ../.config || mkdir ../.config
1711 cat >../.config/README <<EOF
1712 This directory created by Configure to save information that should
1713 persist across sessions for $package.
1715 You may safely delete it if you wish.
1718 : general instructions
1721 user=`(logname) 2>/dev/null`
1723 '') user=`whoami 2>&1`;;
1725 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1728 rp='Would you like to see the instructions?'
1739 This installation shell script will examine your system and ask you questions
1740 to determine how the perl5 package should be installed. If you get
1741 stuck on a question, you may use a ! shell escape to start a subshell or
1742 execute a command. Many of the questions will have default answers in square
1743 brackets; typing carriage return will give you the default.
1745 On some of the questions which ask for file or directory names you are allowed
1746 to use the ~name construct to specify the login directory belonging to "name",
1747 even if you don't have a shell which knows about that. Questions where this is
1748 allowed will be marked "(~name ok)".
1752 dflt='Type carriage return to continue'
1756 The prompter used in this script allows you to use shell variables and
1757 backticks in your answers. You may use $1, $2, etc... to refer to the words
1758 in the default answer, as if the default line was a set of arguments given to a
1759 script shell. This means you may also use $* to repeat the whole default line,
1760 so you do not have to re-type everything to add something to the default.
1762 Everytime there is a substitution, you will have to confirm. If there is an
1763 error (e.g. an unmatched backtick), the default answer will remain unchanged
1764 and you will be prompted again.
1766 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1767 the questions and use the computed defaults (or the previous answers if there
1768 was already a config.sh file). Type 'Configure -h' for a list of options.
1769 You may also start interactively and then answer '& -d' at any prompt to turn
1770 on the non-interactive behaviour for the remainder of the execution.
1776 Much effort has been expended to ensure that this shell script will run on any
1777 Unix system. If despite that it blows up on yours, your best bet is to edit
1778 Configure and run it again. If you can't run Configure for some reason,
1779 you'll have to generate a config.sh file by hand. Whatever problems you
1780 have, let me (perlbug@perl.com) know how I blew it.
1782 This installation script affects things in two ways:
1784 1) it may do direct variable substitutions on some of the files included
1786 2) it builds a config.h file for inclusion in C programs. You may edit
1787 any of these files as the need arises after running this script.
1789 If you make a mistake on a question, there is no easy way to back up to it
1790 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1791 files. Configure will offer to let you do this before it runs the SH files.
1794 dflt='Type carriage return to continue'
1796 case "$firsttime" in
1797 true) echo $user >>../.config/instruct;;
1801 : find out where common programs are
1803 echo "Locating common programs..." >&4
1816 if test -d \$dir/\$thing; then
1822 for thisthing in \$dir/\$thing; do
1823 : just loop through to pick last item
1825 if test -f \$thisthing; then
1828 elif test -f \$dir/\$thing.exe; then
1829 if test -n "$DJGPP"; then
1830 echo \$dir/\$thing.exe
1832 : on Eunice apparently
1882 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1883 pth="$pth /lib /usr/lib"
1884 for file in $loclist; do
1888 if test -f "$xxx"; then
1891 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1892 xxx=`./loc $file $file $pth`
1895 '') xxx=`./loc $file $file $pth`;;
1896 *) xxx=`./loc $xxx $xxx $pth`;;
1902 echo $file is in $xxx.
1905 echo $file is in $xxx.
1908 echo "I don't know where '$file' is, and my life depends on it." >&4
1909 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1915 echo "Don't worry if any of the following aren't found..."
1917 for file in $trylist; do
1921 if test -f "$xxx"; then
1924 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1925 xxx=`./loc $file $file $pth`
1928 '') xxx=`./loc $file $file $pth`;;
1929 *) xxx=`./loc $xxx $xxx $pth`;;
1935 echo $file is in $xxx.
1938 echo $file is in $xxx.
1941 echo "I don't see $file out there, $say."
1948 echo "Substituting grep for egrep."
1954 echo "Substituting cp for ln."
1960 echo "Hopefully test is built into your sh."
1963 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1964 echo "Using the test built into your sh."
1972 echo "Hopefully echo is built into your sh."
1977 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1978 $echo $n "hi there$c" >foo1
1979 echo $n "hi there$c" >foo2
1980 if cmp foo1 foo2 >/dev/null 2>&1; then
1981 echo "They are compatible. In fact, they may be identical."
1988 They are not compatible! You are probably running ksh on a non-USG system.
1989 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1990 have echo built in and we may have to run some Bourne shell scripts. That
1991 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1994 $echo $n "The star should be here-->$c"
2001 : determine whether symbolic links are supported
2004 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2005 echo "Symbolic links are supported." >&4
2008 echo "Symbolic links are NOT supported." >&4
2013 : see whether [:lower:] and [:upper:] are supported character classes
2015 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2017 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2021 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2022 # (0xc9 and 0xd1), therefore that is a nice testing point.
2023 if test "X$up" = X -o "X$low" = X; then
2024 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2030 if test "X$up" = X -o "X$low" = X; then
2031 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2037 if test "X$up" = X -o "X$low" = X; then
2038 case "`echo IJ | od -x 2>/dev/null`" in
2040 echo "Hey, this might be EBCDIC." >&4
2041 if test "X$up" = X -o "X$low" = X; then
2042 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2043 ij) up='[A-IJ-RS-Z]'
2048 if test "X$up" = X -o "X$low" = X; then
2049 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2059 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2061 echo "Using $up and $low to convert case." >&4
2064 echo "I don't know how to translate letters from upper to lower case." >&4
2065 echo "Your tr is not acting any way I know of." >&4
2069 : set up the translation script tr, must be called with ./tr of course
2073 '[A-Z][a-z]') exec $tr '$up' '$low';;
2074 '[a-z][A-Z]') exec $tr '$low' '$up';;
2081 : Try to determine whether config.sh was made on this system
2082 case "$config_sh" in
2084 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2085 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2086 # because the A-Z/a-z are not consecutive.
2087 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2088 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2089 newmyuname="$myuname"
2091 case "$knowitall" in
2093 if test -f ../config.sh; then
2094 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2095 eval "`grep myuname= ../config.sh`"
2097 if test "X$myuname" = "X$newmyuname"; then
2105 : Get old answers from old config file if Configure was run on the
2106 : same system, otherwise use the hints.
2109 if test -f config.sh; then
2111 rp="I see a config.sh file. Shall I use it to set the defaults?"
2114 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2115 *) echo "Fetching default answers from your old config.sh file..." >&4
2123 : Older versions did not always set $sh. Catch re-use of such
2132 if test ! -f config.sh; then
2135 First time through, eh? I have some defaults handy for some systems
2136 that need some extra help getting the Configure answers right:
2139 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2141 : Half the following guesses are probably wrong... If you have better
2142 : tests or hints, please send them to perlbug@perl.com
2143 : The metaconfig authors would also appreciate a copy...
2144 $test -f /irix && osname=irix
2145 $test -f /xenix && osname=sco_xenix
2146 $test -f /dynix && osname=dynix
2147 $test -f /dnix && osname=dnix
2148 $test -f /lynx.os && osname=lynxos
2149 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2150 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2151 $test -f /bin/mips && /bin/mips && osname=mips
2152 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2153 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2154 $test -d /usr/apollo/bin && osname=apollo
2155 $test -f /etc/saf/_sactab && osname=svr4
2156 $test -d /usr/include/minix && osname=minix
2157 if $test -d /MachTen -o -d /MachTen_Folder; then
2159 if $test -x /sbin/version; then
2160 osvers=`/sbin/version | $awk '{print $2}' |
2161 $sed -e 's/[A-Za-z]$//'`
2162 elif $test -x /usr/etc/version; then
2163 osvers=`/usr/etc/version | $awk '{print $2}' |
2164 $sed -e 's/[A-Za-z]$//'`
2169 $test -f /sys/posix.dll &&
2170 $test -f /usr/bin/what &&
2171 set X `/usr/bin/what /sys/posix.dll` &&
2172 $test "$3" = UWIN &&
2175 if $test -f $uname; then
2183 umips) osname=umips ;;
2186 [23]100) osname=mips ;;
2187 next*) osname=next ;;
2189 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2190 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2193 elif $test -f /etc/kconfig; then
2195 if test "$lns" = "$ln -s"; then
2197 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2199 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2206 if test -n "$DJGPP"; then
2215 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2217 'not found') osvers="$4"."$3" ;;
2218 '<3240'|'<>3240') osvers=3.2.0 ;;
2219 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2220 '=3250'|'>3250') osvers=3.2.5 ;;
2224 *dc.osx) osname=dcosx
2230 domainos) osname=apollo
2236 dynixptx*) osname=dynixptx
2237 osvers=`echo "$4"|sed 's/^v//'`
2239 freebsd) osname=freebsd
2241 genix) osname=genix ;;
2243 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2259 netbsd*) osname=netbsd
2262 news-os) osvers="$3"
2264 4*) osname=newsos4 ;;
2268 bsd386) osname=bsd386
2271 POSIX-BC | posix-bc ) osname=posix-bc
2274 powerux | power_ux | powermax_os | powermaxos | \
2275 powerunix | power_unix) osname=powerux
2278 next*) osname=next ;;
2279 solaris) osname=solaris
2281 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2288 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2292 titanos) osname=titanos
2301 ultrix) osname=ultrix
2304 osf1|mls+) case "$5" in
2307 osvers=`echo "$3" | sed 's/^[xvt]//'`
2309 hp*) osname=hp_osf1 ;;
2310 mips) osname=mips_osf1 ;;
2313 unixware) osname=svr5
2322 $2) case "$osname" in
2326 : svr4.x or possibly later
2336 if test -f /stand/boot ; then
2337 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2338 if test -n "$INITPROG" -a -f "$INITPROG"; then
2339 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2340 if test -n "$isesix"; then
2348 *) if test -f /etc/systemid; then
2350 set `echo $3 | $sed 's/\./ /g'` $4
2351 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2353 elif $test -f $src/hints/sco_$1_$2.sh; then
2355 elif $test -f $src/hints/sco_$1.sh; then
2360 '') : Still unknown. Probably a generic Sys V.
2369 *) case "$osname" in
2370 '') : Still unknown. Probably a generic BSD.
2378 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2379 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2380 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2383 $rm -f UU/kernel.what
2384 elif test -d c:/.; then
2391 : Now look for a hint file osname_osvers, unless one has been
2392 : specified already.
2395 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2396 : Also try without trailing minor version numbers.
2397 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2398 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2399 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2400 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2403 *) case "$osvers" in
2406 *) if $test -f $src/hints/$file.sh ; then
2408 elif $test -f $src/hints/$xfile.sh ; then
2410 elif $test -f $src/hints/$xxfile.sh ; then
2412 elif $test -f $src/hints/$xxxfile.sh ; then
2414 elif $test -f $src/hints/$xxxxfile.sh ; then
2416 elif $test -f "$src/hints/${osname}.sh" ; then
2425 if $test -f Policy.sh ; then
2428 none) dflt="Policy" ;;
2429 *) dflt="Policy $dflt" ;;
2434 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2438 if $test -f Policy.sh ; then
2441 There's also a Policy hint file available, which should make the
2442 site-specific (policy) questions easier to answer.
2449 You may give one or more space-separated answers, or "none" if appropriate.
2450 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2451 is a good thing. DO NOT give a wrong version or a wrong OS.
2455 rp="Which of these apply, if any?"
2458 for file in $tans; do
2459 if $test X$file = XPolicy -a -f Policy.sh; then
2461 $cat Policy.sh >> UU/config.sh
2462 elif $test -f $src/hints/$file.sh; then
2463 . $src/hints/$file.sh
2464 $cat $src/hints/$file.sh >> UU/config.sh
2465 elif $test X$tans = X -o X$tans = Xnone ; then
2468 : Give one chance to correct a possible typo.
2469 echo "$file.sh does not exist"
2471 rp="hint to use instead?"
2473 for file in $ans; do
2474 if $test -f "$src/hints/$file.sh"; then
2475 . $src/hints/$file.sh
2476 $cat $src/hints/$file.sh >> UU/config.sh
2477 elif $test X$ans = X -o X$ans = Xnone ; then
2480 echo "$file.sh does not exist -- ignored."
2487 : Remember our hint file for later.
2488 if $test -f "$src/hints/$file.sh" ; then
2498 echo "Fetching default answers from $config_sh..." >&4
2502 cp $config_sh config.sh 2>/dev/null
2512 test "$override" && . ./optdef.sh
2513 myuname="$newmyuname"
2515 : Restore computed paths
2516 for file in $loclist $trylist; do
2517 eval $file="\$_$file"
2522 Configure uses the operating system name and version to set some defaults.
2523 The default value is probably right if the name rings a bell. Otherwise,
2524 since spelling matters for me, either accept the default or answer "none"
2531 ''|' '|none) dflt=none ;;
2532 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2535 *) dflt="$osname" ;;
2537 rp="Operating system name?"
2541 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2547 ''|' '|none) dflt=none ;;
2548 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2549 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2551 ''|' ') dflt=none ;;
2556 *) dflt="$osvers" ;;
2558 rp="Operating system version?"
2568 : who configured the system
2569 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2570 cf_by=`(logname) 2>/dev/null`
2573 cf_by=`(whoami) 2>/dev/null`
2575 "") cf_by=unknown ;;
2579 : set up the script used to warn in case of inconsistency
2586 echo "*** WHOA THERE!!! ***" >&4
2587 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2588 rp=" Keep the $hint value?"
2591 y) td=$was; tu=$was;;
2595 : function used to set $1 to $val
2596 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2598 $define$undef) . ./whoa; eval "$var=\$td";;
2599 $undef$define) . ./whoa; eval "$var=\$tu";;
2600 *) eval "$var=$val";;
2605 Perl can be built to take advantage of threads, on some systems.
2606 To do so, Configure must be run with -Dusethreads.
2608 Note that threading is a highly experimental feature, and
2609 some known race conditions still remain. If you choose to try
2610 it, be very sure to not actually deploy it for production
2611 purposes. README.threads has more details, and is required
2612 reading if you enable threads.
2614 case "$usethreads" in
2615 $define|true|[yY]*) dflt='y';;
2618 rp='Build a threading Perl?'
2621 y|Y) val="$define" ;;
2627 case "$d_oldpthreads" in
2628 '') : Configure tests would be welcome here. For now, assume undef.
2630 *) val="$d_oldpthreads" ;;
2636 case "$usethreads" in
2637 "$define"|true|[yY]*)
2638 : Look for a hint-file generated 'call-back-unit'. If the
2639 : user has specified that a threading perl is to be built,
2640 : we may need to set or change some other defaults.
2641 if $test -f usethreads.cbu; then
2642 echo "Your platform has some specific hints for threaded builds, using them..."
2646 (Your platform doesn't have any specific hints for threaded builds.
2647 Assuming POSIX threads, then.)
2655 Perl can be built so that multiple Perl interpreters can coexist
2656 within the same Perl executable. To do so, Configure must be run with
2659 Normally you do not need this and you should answer no.
2662 case "$usemultiplicity" in
2663 $define|true|[yY]*) dflt='y';;
2666 rp='Build Perl for multiplicity?'
2669 y|Y) val="$define" ;;
2675 : determine where manual pages are on this system
2679 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2680 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2681 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2682 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2683 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2684 sysman=`./loc . /usr/man/man1 $syspath`
2687 if $test -d "$sysman"; then
2688 echo "System manual is in $sysman." >&4
2690 echo "Could not find manual pages in source form." >&4
2693 : see what memory models we can support
2696 $cat >pdp11.c <<'EOP'
2705 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2706 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2707 dflt='unsplit split'
2709 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2712 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2717 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2720 if $test -d /lib/large || $test -d /usr/lib/large; then
2723 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2732 Some systems have different model sizes. On most systems they are called
2733 small, medium, large, and huge. On the PDP11 they are called unsplit and
2734 split. If your system doesn't support different memory models, say "none".
2735 If you wish to force everything to one memory model, say "none" here and
2736 put the appropriate flags later when it asks you for other cc and ld flags.
2737 Venix systems may wish to put "none" and let the compiler figure things out.
2738 (In the following question multiple model names should be space separated.)
2740 The default for most systems is "none".
2743 rp="Which memory models are supported?"
2758 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2759 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2766 rp="What flag indicates separate I and D space?"
2774 *large*|*small*|*medium*|*huge*)
2781 rp="What flag indicates large model?"
2791 *huge*) case "$huge" in
2795 rp="What flag indicates huge model?"
2805 *medium*) case "$medium" in
2809 rp="What flag indicates medium model?"
2816 *) medium="$large";;
2819 *small*) case "$small" in
2823 rp="What flag indicates small model?"
2834 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2837 $rm -f pdp11.* pdp11
2839 : make some quick guesses about what we are up against
2841 $echo $n "Hmm... $c"
2851 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2852 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2854 echo "Looks kind of like an OSF/1 system, but we'll see..."
2856 elif test `echo abc | tr a-z A-Z` = Abc ; then
2857 xxx=`./loc addbib blurfl $pth`
2858 if $test -f $xxx; then
2859 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2863 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2864 echo "Looks kind of like an extended USG system, but we'll see..."
2866 echo "Looks kind of like a USG system, but we'll see..."
2870 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2871 echo "Looks kind of like a BSD system, but we'll see..."
2875 echo "Looks kind of like a Version 7 system, but we'll see..."
2878 case "$eunicefix" in
2881 There is, however, a strange, musty smell in the air that reminds me of
2882 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2886 : it so happens the Eunice I know will not run shell scripts in Unix format
2890 echo "Congratulations. You aren't running Eunice."
2894 : Detect OS2. The p_ variable is set above in the Head.U unit.
2899 I have the feeling something is not exactly right, however...don't tell me...
2900 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2905 if test -f /xenix; then
2906 echo "Actually, this looks more like a XENIX system..."
2911 echo "It's not Xenix..."
2916 if test -f /venix; then
2917 echo "Actually, this looks more like a VENIX system..."
2924 echo "Nor is it Venix..."
2927 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2928 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2931 : see if we need a special compiler
2939 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2940 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2954 On some older systems the default C compiler will not resolve multiple global
2955 references that happen to have the same name. On some such systems the "Mcc"
2956 command may be used to force these to be resolved. On other systems a "cc -M"
2957 command is required. (Note that the -M flag on other systems indicates a
2958 memory model to use!) If you have the Gnu C compiler, you might wish to use
2964 rp="Use which C compiler?"
2972 rp="Use which C compiler?"
2976 : Look for a hint-file generated 'call-back-unit'. Now that the
2977 : user has specified the compiler, we may need to set or change some
2979 if $test -f cc.cbu; then
2983 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2984 $cat >gccvers.c <<EOM
2989 printf("%s\n", __VERSION__);
2991 printf("%s\n", "1");
2997 if $cc -o gccvers gccvers.c; then
2998 gccversion=`./gccvers`
2999 case "$gccversion" in
3000 '') echo "You are not using GNU cc." ;;
3001 *) echo "You are using GNU cc $gccversion." ;;
3005 echo "*** WHOA THERE!!! ***" >&4
3006 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3007 case "$knowitall" in
3009 echo " You'd better start hunting for one and let me know about it." >&4
3015 case "$gccversion" in
3016 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3020 case "$usemorebits" in
3021 "$define"|true|[yY]*)
3023 uselongdouble="$define"
3024 usemorebits="$define"
3026 *) usemorebits="$undef"
3033 Perl can be built to understand large files (files larger than 2 gigabytes)
3034 on some systems. To do so, Configure must be run with -Duselargefiles.
3036 If this doesn't make any sense to you, just accept the default.
3038 case "$uselargefiles" in
3039 "$define"|true|[yY]*) dflt='y' ;;
3042 rp='Try to understand large files?'
3045 y|Y) val="$define" ;;
3050 case "$uselargefiles" in
3051 "$define") use64bits="$define" ;;
3056 Perl can be built to take advantage of explicit 64-bit interfaces,
3057 on some systems. To do so, Configure must be run with -Duse64bits.
3059 If this doesn't make any sense to you, just accept the default.
3061 case "$use64bits" in
3062 $define|true|[yY]*) dflt='y';;
3065 rp='Try to use explicit 64-bit interfaces, if available?'
3078 case "$archname64" in
3079 '') archname64='' ;; # not a typo
3082 case "$use64bits" in
3083 "$define"|true|[yY]*)
3084 : Look for a hint-file generated 'call-back-unit'. If the
3085 : user has specified that a 64 bit perl is to be built,
3086 : we may need to set or change some other defaults.
3087 if $test -f use64bits.cbu; then
3088 echo "Your platform has some specific hints for 64-bit builds, using them..."
3092 (Your platform doesn't have any specific hints for 64-bit builds.
3093 This is probably okay, especially if your system is a true 64-bit system.)
3095 case "$gccversion" in
3098 But since you seem to be using gcc,
3099 I will now add -DUSE_LONG_LONG to the compilation flags.
3101 ccflags="$ccflags -DUSE_LONG_LONG"
3108 : determine the architecture name
3110 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3111 tarch=`arch`"-$osname"
3112 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3113 if uname -m > tmparch 2>&1 ; then
3114 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3115 -e 's/$/'"-$osname/" tmparch`
3123 case "$myarchname" in
3126 echo "(Your architecture name used to be $myarchname.)"
3133 *) dflt="$archname";;
3135 rp='What is your architecture name'
3138 case "$usethreads" in
3140 echo "Threads selected." >&4
3142 *-thread*) echo "...and architecture name already has -thread." >&4
3144 *) archname="$archname-thread"
3145 echo "...setting architecture name to $archname." >&4
3150 case "$usemultiplicity" in
3152 echo "Multiplicity selected." >&4
3154 *-multi*) echo "...and architecture name already has -multi." >&4
3156 *) archname="$archname-multi"
3157 echo "...setting architecture name to $archname." >&4
3162 case "$use64bits" in
3164 echo "Explicit 64-bitness selected." >&4
3165 case "$archname64" in
3170 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3172 *) archname="$archname-$archname64"
3173 echo "...setting architecture name to $archname." >&4
3180 : decide how portable to be. Allow command line overrides.
3181 case "$d_portable" in
3183 *) d_portable="$define" ;;
3186 : set up shell script to do ~ expansion
3192 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3195 if $test -f /bin/csh; then
3196 /bin/csh -f -c "glob \$1"
3201 name=\`$expr x\$1 : '..\([^/]*\)'\`
3202 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3203 if $test ! -d "\$dir"; then
3205 echo "\$me: can't locate home directory for: \$name" >&2
3210 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3226 : now set up to get a file name
3230 cat <<'EOSC' >>getfile
3246 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3247 fn=`echo $fn | sed 's/(.*)//'`
3253 loc_file=`expr $fn : '.*:\(.*\)'`
3254 fn=`expr $fn : '\(.*\):.*'`
3262 */*) fullpath=true;;
3271 *e*) exp_file=true;;
3274 *p*) nopath_ok=true;;
3279 *d*) type='Directory';;
3280 *l*) type='Locate';;
3285 Locate) what='File';;
3290 case "$d_portable" in
3298 while test "$type"; do
3303 true) rp="$rp (~name ok)";;
3306 if test -f UU/getfile.ok && \
3307 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3326 value=`UU/filexp $ans`
3329 if test "$ans" != "$value"; then
3330 echo "(That expands to $value on this system.)"
3344 /*) value="$ansexp" ;;
3349 echo "I shall only accept a full path name, as in /bin/ls." >&4
3350 echo "Use a ! shell escape if you wish to check pathnames." >&4
3353 echo "Please give a full path name, starting with slash." >&4
3356 echo "Note that using ~name is ok provided it expands well." >&4
3369 for fp in $gfpth; do
3370 if test "X$fp" = X.; then
3375 if test -f "$pf"; then
3377 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3379 echo "($value is not a plain file, but that's ok.)"
3382 if test X"$type" = X; then
3389 for fp in $gfpth; do
3390 if test "X$fp" = X.; then
3395 if test -d "$pf"; then
3403 if test -d "$ansexp"; then
3404 echo "(Looking for $loc_file in directory $value.)"
3405 value="$value/$loc_file"
3406 ansexp="$ansexp/$loc_file"
3408 if test -f "$ansexp"; then
3411 case "$nopath_ok" in
3412 true) case "$value" in
3414 *) echo "Assuming $value will be in people's path."
3430 if test "$fastread" = yes; then
3435 rp="$what $value doesn't exist. Use that name anyway?"
3454 test "X$gfpthkeep" != Xy && gfpth=""
3457 : determine root of directory hierarchy where package will be installed.
3460 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3468 By default, $package will be installed in $dflt/bin, manual pages
3469 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3470 installation directories. Typically this is something like /usr/local.
3471 If you wish to have binaries under /usr/bin but other parts of the
3472 installation under /usr/local, that's ok: you will be prompted
3473 separately for each of the installation directories, the prefix being
3474 only used to set the defaults.
3478 rp='Installation prefix to use?'
3486 *) oldprefix="$prefix";;
3496 $define|true) afs=true ;;
3497 $undef|false) afs=false ;;
3498 *) if test -d /afs; then
3506 echo "AFS may be running... I'll be extra cautious then..." >&4
3508 echo "AFS does not seem to be running..." >&4
3511 : determine installation prefix for where package is to be installed.
3515 Since you are running AFS, I need to distinguish the directory in which
3516 files will reside from the directory in which they are installed (and from
3517 which they are presumably copied to the former directory by occult means).
3520 case "$installprefix" in
3521 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3522 *) dflt="$installprefix";;
3527 In some special cases, particularly when building $package for distribution,
3528 it is convenient to distinguish between the directory in which files should
3529 be installed from the directory ($prefix) in which they
3530 will eventually reside. For most users, these two directories are the same.
3533 case "$installprefix" in
3535 *) dflt=$installprefix;;
3539 rp='What installation prefix should I use for installing files?'
3541 installprefix="$ans"
3542 installprefixexp="$ansexp"
3544 : set the prefixit variable, to compute a suitable default value
3545 prefixit='case "$3" in
3547 case "$oldprefix" in
3548 "") eval "$1=\"\$$2\"";;
3555 ""|" ") eval "$1=\"\$$2\"";;
3561 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3563 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3564 /*-$oldprefix/*|\~*-$oldprefix/*)
3565 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3566 *) eval "$1=\"\$$2\"";;
3570 : set the base revision
3573 : get the patchlevel
3575 echo "Getting the current patchlevel..." >&4
3576 if $test -r $rsrc/patchlevel.h;then
3577 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3578 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3579 apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
3585 $echo $n "(You have $package" $c
3588 *) $echo $n " $baserev" $c ;;
3590 $echo $n " patchlevel $patchlevel" $c
3591 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3594 if test 0 -eq "$subversion"; then
3595 version=`LC_ALL=C; export LC_ALL; \
3596 echo $baserev $patchlevel | \
3597 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3599 version=`LC_ALL=C; export LC_ALL; \
3600 echo $baserev $patchlevel $subversion | \
3601 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3604 : determine installation style
3605 : For now, try to deduce it from prefix unless it is already set.
3606 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3607 case "$installstyle" in
3608 '') case "$prefix" in
3609 *perl*) dflt='lib';;
3610 *) dflt='lib/perl5' ;;
3613 *) dflt='lib/perl5' ;;
3615 : Probably not worth prompting for this since we prompt for all
3616 : the directories individually, and the prompt would be too long and
3620 : determine where private library files go
3621 : Usual default is /usr/local/lib/perl5/$version.
3622 : Also allow things like /opt/perl/lib/$version, since
3623 : /opt/perl/lib/perl5... would be redundant.
3624 : The default "style" setting is made in installstyle.U
3625 case "$installstyle" in
3626 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3627 *) set dflt privlib lib/$version ;;
3632 There are some auxiliary files for $package that need to be put into a
3633 private library directory that is accessible by everyone.
3637 rp='Pathname where the private library files will reside?'
3640 privlibexp="$ansexp"
3641 : Change installation prefix, if necessary.
3642 if $test X"$prefix" != X"$installprefix"; then
3643 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
3645 installprivlib="$privlibexp"
3648 : set the prefixup variable, to restore leading tilda escape
3649 prefixup='case "$prefixexp" in
3651 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3654 : determine where public architecture dependent libraries go
3657 : privlib default is /usr/local/lib/$package/$version
3658 : archlib default is /usr/local/lib/$package/$version/$archname
3659 : privlib may have an optional trailing /share.
3660 tdflt=`echo $privlib | $sed 's,/share$,,'`
3661 tdflt=$tdflt/$archname
3670 $spackage contains architecture-dependent library files. If you are
3671 sharing libraries in a heterogeneous environment, you might store
3672 these files in a separate location. Otherwise, you can just include
3673 them with the rest of the public library files.
3677 rp='Where do you want to put the public architecture-dependent libraries?'
3680 archlibexp="$ansexp"
3681 if $test X"$archlib" = X"$privlib"; then
3686 : Change installation prefix, if necessary.
3687 if $test X"$prefix" != X"$installprefix"; then
3688 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
3690 installarchlib="$archlibexp"
3694 : Binary compatibility with 5.005 is not possible for builds
3695 : with advanced features
3696 case "$usethreads$usemultiplicity" in
3698 bincompat5005="$undef"
3699 d_bincompat5005="$undef"
3703 Perl 5.006 can be compiled for binary compatibility with 5.005.
3704 If you decide to do so, you will be able to continue using most
3705 of the extensions that were compiled for Perl 5.005.
3708 case "$bincompat5005$d_bincompat5005" in
3709 *"$undef"*) dflt=n ;;
3712 rp='Binary compatibility with Perl 5.005?'
3715 y*) val="$define" ;;
3720 case "$d_bincompat5005" in
3722 bincompat5005="$define"
3724 *) bincompat5005="$undef"
3725 d_bincompat5005="$undef"
3732 : see if setuid scripts can be secure
3735 Some kernels have a bug that prevents setuid #! scripts from being
3736 secure. Some sites have disabled setuid #! scripts because of this.
3738 First let's decide if your kernel supports secure setuid #! scripts.
3739 (If setuid #! scripts would be secure but have been disabled anyway,
3740 don't say that they are secure if asked.)
3745 if $test -d /dev/fd; then
3746 echo "#!$ls" >reflect
3747 chmod +x,u+s reflect
3748 ./reflect >flect 2>&1
3749 if $contains "/dev/fd" flect >/dev/null; then
3750 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3754 If you are not sure if they are secure, I can check but I'll need a
3755 username and password different from the one you are using right now.
3756 If you don't have such a username or don't want me to test, simply
3760 rp='Other username to test security of setuid scripts with?'
3765 case "$d_suidsafe" in
3766 '') echo "I'll assume setuid scripts are *not* secure." >&4
3769 echo "Well, the $hint value is *not* secure." >&4
3771 *) echo "Well, the $hint value *is* secure." >&4
3776 $rm -f reflect flect
3777 echo "#!$ls" >reflect
3778 chmod +x,u+s reflect
3781 echo '"su" will (probably) prompt you for '"$ans's password."
3782 su $ans -c './reflect >flect'
3783 if $contains "/dev/fd" flect >/dev/null; then
3784 echo "Okay, it looks like setuid scripts are secure." >&4
3787 echo "I don't think setuid scripts are secure." >&4
3792 rp='Does your kernel have *secure* setuid scripts?'
3795 [yY]*) val="$define";;
3800 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3801 echo "(That's for file descriptors, not floppy disks.)"
3807 $rm -f reflect flect
3809 : now see if they want to do setuid emulation
3812 case "$d_suidsafe" in
3815 echo "No need to emulate SUID scripts since they are secure here." >& 4
3819 Some systems have disabled setuid scripts, especially systems where
3820 setuid scripts cannot be secure. On systems where setuid scripts have
3821 been disabled, the setuid/setgid bits on scripts are currently
3822 useless. It is possible for $package to detect those bits and emulate
3823 setuid/setgid in a secure fashion. This emulation will only work if
3824 setuid scripts have been disabled in your kernel.
3828 "$define") dflt=y ;;
3831 rp="Do you want to do setuid/setgid emulation?"
3834 [yY]*) val="$define";;
3842 : What should the include directory be ?
3844 $echo $n "Hmm... $c"
3848 if $test -f /bin/mips && /bin/mips; then
3849 echo "Looks like a MIPS system..."
3850 $cat >usr.c <<'EOCP'
3851 #ifdef SYSTYPE_BSD43
3855 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3856 dflt='/bsd43/usr/include'
3860 mips_type='System V'
3862 $rm -f usr.c usr.out
3863 echo "and you're compiling with the $mips_type compiler and libraries."
3867 echo "Doesn't look like a MIPS system."
3877 case "$xxx_prompt" in
3880 rp='Where are the include files you want to use?'
3888 : see how we invoke the C preprocessor
3890 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3891 cat <<'EOT' >testcpp.c
3897 if test ! -f cppstdin; then
3898 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3899 # AIX cc -E doesn't show the absolute headerfile
3900 # locations but we'll cheat by using the -M flag.
3901 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
3903 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3906 echo "Keeping your $hint cppstdin wrapper."
3909 wrapper=`pwd`/cppstdin
3913 if $test "X$cppstdin" != "X" && \
3914 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3915 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3917 echo "You used to use $cppstdin $cppminus so we'll use that again."
3919 '') echo "But let's see if we can live without a wrapper..." ;;
3921 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3922 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3924 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3927 echo "(However, $cpprun $cpplast does not work, let's see...)"
3935 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3942 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3943 $cc -E <testcpp.c >testcpp.out 2>&1; \
3944 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3945 echo "Yup, it does."
3948 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3949 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3950 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3951 echo "Yup, it does."
3954 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3955 $cc -P <testcpp.c >testcpp.out 2>&1; \
3956 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3957 echo "Yipee, that works!"
3960 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3961 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3962 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3963 echo "At long last!"
3966 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3967 $cpp <testcpp.c >testcpp.out 2>&1; \
3968 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3972 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3973 $cpp - <testcpp.c >testcpp.out 2>&1; \
3974 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3975 echo "Hooray, it works! I was beginning to wonder."
3978 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3979 $wrapper <testcpp.c >testcpp.out 2>&1; \
3980 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3986 rp="No dice. I can't find a C preprocessor. Name one:"
3990 $x_cpp <testcpp.c >testcpp.out 2>&1
3991 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3992 echo "OK, that will do." >&4
3994 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4009 echo "Perhaps can we force $cc -E using a wrapper..."
4010 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4011 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4017 echo "Nope, we'll have to live without it..."
4031 "$wrapper"|'cppstdin') ;;
4032 *) $rm -f $wrapper;;
4034 $rm -f testcpp.c testcpp.out
4036 : Set private lib path
4039 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4044 '') dlist="$loclibpth $plibpth $glibpth";;
4045 *) dlist="$libpth";;
4048 : Now check and see which directories actually exist, avoiding duplicates
4052 if $test -d $xxx; then
4055 *) libpth="$libpth $xxx";;
4061 Some systems have incompatible or broken versions of libraries. Among
4062 the directories listed in the question below, please remove any you
4063 know not to be holding relevant libraries, and add any that are needed.
4064 Say "none" for none.
4075 rp="Directories to use for library searches?"
4082 : compute shared library extension
4085 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4095 On some systems, shared libraries may be available. Answer 'none' if
4096 you want to suppress searching of shared libraries for the remaining
4097 of this configuration.
4100 rp='What is the file extension used for shared libraries?'
4104 : Define several unixisms.
4105 : Hints files or command line option can be used to override them.
4106 : The convoluted testing is in case hints files set either the old
4109 '') case "$exe_ext" in
4111 *) _exe="$exe_ext" ;;
4116 '') case "$lib_ext" in
4123 '') case "$obj_ext" in
4130 '') case "$path_sep" in
4141 : Which makefile gets called first. This is used by make depend.
4142 case "$firstmakefile" in
4143 '') firstmakefile='makefile';;
4148 Perl can be built to use the SOCKS proxy protocol library. To do so,
4149 Configure must be run with -Dusesocks.
4151 Normally you do not need this and you should answer no.
4155 $define|true|[yY]*) dflt='y';;
4158 rp='Build Perl for SOCKS?'
4161 y|Y) val="$define" ;;
4167 : Looking for optional libraries
4169 echo "Checking for optional libraries..." >&4
4174 case "$libswanted" in
4175 '') libswanted='c_s';;
4179 libswanted="$libswanted socks5 socks5_sh"
4182 for thislib in $libswanted; do
4184 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4185 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4186 echo "Found -l$thislib (shared)."
4189 *) dflt="$dflt -l$thislib";;
4191 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4192 echo "Found -l$thislib (shared)."
4195 *) dflt="$dflt -l$thislib";;
4197 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4198 echo "Found -l$thislib."
4201 *) dflt="$dflt -l$thislib";;
4203 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4204 echo "Found -l$thislib."
4207 *) dflt="$dflt -l$thislib";;
4209 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4210 echo "Found -l${thislib}_s."
4213 *) dflt="$dflt -l${thislib}_s";;
4215 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4216 echo "Found -l$thislib."
4219 *) dflt="$dflt -l$thislib";;
4222 echo "No -l$thislib."
4233 ' '|'') dflt='none';;
4238 In order to compile $package on your machine, a number of libraries
4239 are usually needed. Include any other special libraries here as well.
4240 Say "none" for none. The default list is almost always right.
4244 rp="What libraries to use?"
4251 : determine optimization, if desired, or use for debug flag also
4253 ' '|$undef) dflt='none';;
4255 *) dflt="$optimize";;
4259 By default, $package compiles with the -O flag to use the optimizer.
4260 Alternately, you might want to use the symbolic debugger, which uses
4261 the -g flag (on traditional Unix systems). Either flag can be
4262 specified here. To use neither flag, specify the word "none".
4265 rp="What optimizer/debugger flag should be used?"
4269 'none') optimize=" ";;
4273 : We will not override a previous value, but we might want to
4274 : augment a hint file
4276 default|recommended)
4277 case "$gccversion" in
4278 1*) dflt='-fpcc-struct-return' ;;
4281 *-g*) dflt="$dflt -DDEBUGGING";;
4283 case "$gccversion" in
4284 2*) if test -d /etc/conf/kconfig.d &&
4285 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4291 case "$gccversion" in
4295 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4296 echo 'int main(void) { return 0; }' > gcctest.c
4297 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4298 echo "Yes, it does." 2>&1
4301 echo "Leaving current flags $ccflags alone." 2>&1
4303 *) dflt="$dflt -fno-strict-aliasing" ;;
4306 echo "Nope, it doesn't, but that's ok." 2>&1
4313 case "$mips_type" in
4314 *BSD*|'') inclwanted="$locincpth $usrinc";;
4315 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4317 for thisincl in $inclwanted; do
4318 if $test -d $thisincl; then
4319 if $test x$thisincl != x$usrinc; then
4322 *) dflt="$dflt -I$thisincl";;
4328 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4330 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4338 *) dflt="$dflt -D$2";;
4342 set signal.h LANGUAGE_C; eval $inctest
4346 ccflags="$ccflags -DSOCKS"
4351 default|recommended) dflt="$ccflags $dflt" ;;
4352 *) dflt="$ccflags";;
4360 Your C compiler may want other flags. For this question you should include
4361 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4362 but you should NOT include libraries or ld flags like -lwhatever. If you
4363 want $package to honor its debug switch, you should include -DDEBUGGING here.
4364 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4366 To use no flags, specify the word "none".
4372 rp="Any additional cc flags?"
4379 : the following weeds options from ccflags that are of no interest to cpp
4381 case "$gccversion" in
4382 1*) cppflags="$cppflags -D__GNUC__"
4384 case "$mips_type" in
4386 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4392 echo "Let me guess what the preprocessor flags are..." >&4
4406 *) ftry="$previous $flag";;
4408 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4409 >cpp1.out 2>/dev/null && \
4410 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4411 >cpp2.out 2>/dev/null && \
4412 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4413 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4415 cppflags="$cppflags $ftry"
4425 *-*) echo "They appear to be: $cppflags";;
4427 $rm -f cpp.c cpp?.out
4431 : flags used in final linking phase
4433 '') if ./venix; then
4439 *-posix*) dflt="$dflt -posix" ;;
4442 *) dflt="$ldflags";;
4445 : Try to guess additional flags to pick up local libraries.
4446 for thislibdir in $libpth; do
4447 case " $loclibpth " in
4450 *"-L$thislibdir "*) ;;
4451 *) dflt="$dflt -L$thislibdir" ;;
4463 Your C linker may need flags. For this question you should
4464 include -L/whatever and any other flags used by the C linker, but you
4465 should NOT include libraries like -lwhatever.
4467 Make sure you include the appropriate -L/path flags if your C linker
4468 does not normally search all of the directories you specified above,
4471 To use no flags, specify the word "none".
4475 rp="Any additional ld flags (NOT including libraries)?"
4481 rmlist="$rmlist pdp11"
4485 echo "Checking your choice of C compiler and flags for coherency..." >&4
4486 $cat > try.c <<'EOF'
4488 int main() { printf("Ok\n"); exit(0); }
4490 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4492 $cat >try.msg <<'EOM'
4493 I've tried to compile and run the following simple program:
4496 $cat try.c >> try.msg
4498 $cat >> try.msg <<EOM
4505 and I got the following output:
4509 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4510 if sh -c './try' >>try.msg 2>&1; then
4514 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4517 cat >> try.msg <<'EOQS'
4518 If $libs contains -lsfio, and sfio is mis-configured, then it
4519 sometimes (apparently) runs and exits with a 0 status, but with no
4520 output! It may have to do with sfio's use of _exit vs. exit.
4523 rp="You have a big problem. Shall I abort Configure"
4530 echo "The program compiled OK, but exited with status $?." >>try.msg
4531 rp="You have a problem. Shall I abort Configure"
4535 echo "I can't compile the test program." >>try.msg
4536 rp="You have a BIG problem. Shall I abort Configure"
4542 case "$knowitall" in
4544 echo "(The supplied flags or libraries might be incorrect.)"
4552 *) echo "Ok. Stopping Configure." >&4
4557 n) echo "OK, that should do.";;
4559 $rm -f try try.* core
4561 : determine filename position in cpp output
4563 echo "Computing filename position in cpp output for #include directives..." >&4
4564 echo '#include <stdio.h>' > foo.c
4567 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4568 $grep '^[ ]*#.*stdio\.h' | \
4569 while read cline; do
4572 while $test \$# -gt 0; do
4573 if $test -r \`echo \$1 | $tr -d '"'\`; then
4578 pos=\`expr \$pos + 1\`
4590 *) pos="${fieldn}th";;
4592 echo "Your cpp writes the filename in the $pos field of the line."
4594 : locate header file
4599 for usrincdir in $usrinc
4601 if test -f \$usrincdir/\$wanted; then
4602 echo "\$usrincdir/\$wanted"
4606 awkprg='{ print \$$fieldn }'
4607 echo "#include <\$wanted>" > foo\$\$.c
4608 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4609 $grep "^[ ]*#.*\$wanted" | \
4610 while read cline; do
4611 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4613 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4614 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4619 # status = 0: grep returned 0 lines, case statement not executed
4620 # status = 1: headerfile found
4621 # status = 2: while loop executed, no headerfile found
4625 if test \$status -eq 1; then
4632 : define an alternate in-header-list? function
4633 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4634 cont=true; xxf="echo \"<\$1> found.\" >&4";
4635 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4636 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4638 case $# in 4) instead=instead;; *) instead="at last";; esac;
4639 while $test "$cont"; do
4641 var=$2; eval "was=\$$2";
4642 if $test "$xxx" && $test -r "$xxx";
4644 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4647 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4648 set $yyy; shift; shift; yyy=$@;
4649 case $# in 0) cont="";;
4650 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4651 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4652 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4653 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4657 do set $yyy; var=$2; eval "was=\$$2";
4658 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4659 set $yyy; shift; shift; yyy=$@;
4662 : see if this is a malloc.h system
4663 set malloc.h i_malloc
4666 : see if stdlib is available
4667 set stdlib.h i_stdlib
4670 : determine which malloc to compile in
4672 case "$usemymalloc" in
4673 ''|[yY]*|true|$define) dflt='y' ;;
4676 rp="Do you wish to attempt to use the malloc that comes with $package?"
4682 mallocsrc='malloc.c'
4683 mallocobj="malloc$_o"
4684 d_mymalloc="$define"
4687 : Remove malloc from list of libraries to use
4688 echo "Removing unneeded -lmalloc from library list" >&4
4689 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4692 echo "libs = $libs" >&4
4704 : compute the return types of malloc and free
4706 $cat >malloc.c <<END
4710 #include <sys/types.h>
4724 case "$malloctype" in
4726 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4733 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4737 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4744 echo "Your system uses $freetype free(), it would seem." >&4
4748 The installation process will also create a directory for
4749 vendor-supplied add-ons. Vendors who supply perl with their system
4750 may find it convenient to place all vendor-supplied files in this
4751 directory rather than in the main distribution directory. This will
4752 ease upgrades between binary-compatible maintenance versions of perl.
4754 Of course you may also use these directories in whatever way you see
4755 fit. For example, you might use them to access modules shared over a
4756 company-wide network.
4758 The default answer should be fine for most people.
4759 This causes further questions about vendor add-ons to be skipped
4760 and no vendor-specific directories will be configured for perl.
4763 rp='Do you want to configure vendor-specific add-on directories?'
4764 case "$usevendorprefix" in
4765 define|true|[yY]*) dflt=y ;;
4771 rp='Installation prefix to use for vendor-supplied add-ons?'
4772 case "$vendorprefix" in
4774 *) dflt=$vendorprefix ;;
4778 case "$vendorprefix" in
4782 *) oldvendorprefix="$prefix";;
4786 usevendorprefix="$define"
4788 vendorprefixexp="$ansexp"
4790 *) usevendorprefix="$undef"
4796 case "$vendorprefix" in
4797 '') d_vendorlib="$undef"
4801 *) d_vendorlib="$define"
4802 : determine where vendor-supplied modules go.
4803 : Usual default is /usr/local/lib/perl5/vendor_perl
4804 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4805 case "$installstyle" in
4806 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4807 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4810 rp='Pathname for the vendor-supplied library files?'
4813 vendorlibexp="$ansexp"
4814 : Change installation prefix, if necessary.
4815 if $test X"$prefix" != X"$installprefix"; then
4816 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
4818 installvendorlib="$vendorlibexp"
4823 : Cruising for prototypes
4825 echo "Checking out function prototypes..." >&4
4826 $cat >prototype.c <<'EOCP'
4827 int main(int argc, char *argv[]) {
4830 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4831 echo "Your C compiler appears to support function prototypes."
4834 echo "Your C compiler doesn't seem to understand function prototypes."
4841 case "$prototype" in
4843 *) ansi2knr='ansi2knr'
4848 This version of $package can only be compiled by a compiler that
4849 understands function prototypes. Unfortunately, your C compiler
4851 doesn't seem to understand them. Sorry about that.
4853 If GNU cc is available for your system, perhaps you could try that instead.
4855 Eventually, we hope to support building Perl with pre-ANSI compilers.
4856 If you would like to help in that effort, please contact <perlbug@perl.org>.
4858 Aborting Configure now.
4864 : determine where public executables go
4869 rp='Pathname where the public executables will reside?'
4871 if $test "X$ansexp" != "X$binexp"; then
4876 : Change installation prefix, if necessary.
4877 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4878 if $test X"$prefix" != X"$installprefix"; then
4879 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
4881 installbin="$binexp"
4884 : determine whether to install perl also as /usr/bin/perl
4887 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4889 Many scripts expect to perl to be installed as /usr/bin/perl.
4890 I can install the perl you are about to compile also as /usr/bin/perl
4891 (in addition to $installbin/perl).
4893 case "$installusrbinperl" in
4894 "$undef"|[nN]*) dflt='n';;
4897 rp="Do you want to install perl as /usr/bin/perl?"
4900 [yY]*) val="$define";;
4906 set installusrbinperl
4909 : define a shorthand compile call
4913 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4914 : define a shorthand compile call for compilations that should be ok.
4918 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4921 echo "Checking for GNU C Library..." >&4
4922 cat >gnulibc.c <<EOM
4934 if eval $compile_ok && ./gnulibc; then
4936 echo "You are using the GNU C Library"
4939 echo "You are not using the GNU C Library"
4945 : see if nm is to be used to determine whether a symbol is defined or not
4949 case "$d_gnulibc" in
4952 echo "nm probably won't work on the GNU C Library." >&4
4958 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4960 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4961 echo "'nm' won't be sufficient on this sytem." >&4
4967 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4968 if $test $dflt -gt 20; then
4978 true|$define) dflt=y;;
4985 I can use $nm to extract the symbols from your C libraries. This
4986 is a time consuming task which may generate huge output on the disk (up
4987 to 3 megabytes) but that should make the symbols extraction faster. The
4988 alternative is to skip the 'nm' extraction part and to compile a small
4989 test program instead to determine whether each symbol is present. If
4990 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4991 this may be the best solution.
4993 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4996 rp="Shall I use $nm to extract C symbols from the libraries?"
4999 [Nn]*) usenm=false;;
5008 : nm options which may be necessary
5010 '') if $test -f /mach_boot; then
5012 elif $test -d /usr/ccs/lib; then
5013 nm_opt='-p' # Solaris (and SunOS?)
5014 elif $test -f /dgux; then
5016 elif $test -f /lib64/rld; then
5017 nm_opt='-p' # 64-bit Irix
5023 : nm options which may be necessary for shared libraries but illegal
5024 : for archive libraries. Thank you, Linux.
5025 case "$nm_so_opt" in
5026 '') case "$myuname" in
5028 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5029 nm_so_opt='--dynamic'
5038 : get list of predefined functions in a handy place
5043 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5050 *) for thislib in $libs; do
5053 : Handle C library specially below.
5056 thislib=`echo $thislib | $sed -e 's/^-l//'`
5057 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5059 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5061 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5063 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5065 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5067 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5069 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5074 libnames="$libnames $try"
5076 *) libnames="$libnames $thislib" ;;
5085 for xxx in $libpth; do
5086 $test -r $1 || set $xxx/libc.$so
5087 : The messy sed command sorts on library version numbers.
5089 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5090 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5092 s/[0-9][0-9]*/0000&/g
5093 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5096 sort | $sed -e 's/^.* //'`
5099 $test -r $1 || set /usr/ccs/lib/libc.$so
5100 $test -r $1 || set /lib/libsys_s$_a
5106 if $test -r "$1"; then
5107 echo "Your (shared) C library seems to be in $1."
5109 elif $test -r /lib/libc && $test -r /lib/clib; then
5110 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5112 libc='/lib/clib /lib/libc'
5113 if $test -r /lib/syslib; then
5114 echo "(Your math library is in /lib/syslib.)"
5115 libc="$libc /lib/syslib"
5117 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5118 echo "Your C library seems to be in $libc, as you said before."
5119 elif $test -r $incpath/usr/lib/libc$_a; then
5120 libc=$incpath/usr/lib/libc$_a;
5121 echo "Your C library seems to be in $libc. That's fine."
5122 elif $test -r /lib/libc$_a; then
5124 echo "Your C library seems to be in $libc. You're normal."
5126 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5128 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5129 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5130 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5132 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5134 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5137 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5139 if $test -r "$tans"; then
5140 echo "Your C library seems to be in $tans, of all places."
5146 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5150 If the guess above is wrong (which it might be if you're using a strange
5151 compiler, or your machine supports multiple models), you can override it here.
5156 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5158 I can't seem to find your C library. I've looked in the following places:
5161 $sed 's/^/ /' libpath
5164 None of these seems to contain your C library. I need to get its name...
5169 rp='Where is your C library?'
5174 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5175 set X `cat libnames`
5178 case $# in 1) xxx=file; esac
5179 echo "Extracting names from the following $xxx for later perusal:" >&4
5181 $sed 's/^/ /' libnames >&4
5183 $echo $n "This may take a while...$c" >&4
5187 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5188 *) $nm $nm_opt $file 2>/dev/null;;
5193 $grep fprintf libc.tmp > libc.ptf
5194 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5195 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5197 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5199 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5201 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5203 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5205 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5207 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5209 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5211 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5213 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5215 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5217 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5219 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5221 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5222 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5224 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5226 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5228 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5230 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5232 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5234 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5236 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5238 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5240 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5242 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5244 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5246 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5248 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5250 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5252 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5255 $nm -p $* 2>/dev/null >libc.tmp
5256 $grep fprintf libc.tmp > libc.ptf
5257 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5258 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5264 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5266 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5267 for thisname in $libnames $libc; do
5268 $ar t $thisname >>libc.tmp
5270 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5272 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5273 # Repeat libc to extract forwarders to DLL entries too
5274 for thisname in $libnames $libc; do
5275 $ar tv $thisname >>libc.tmp
5276 # Revision 50 of EMX has bug in $ar.
5277 # it will not extract forwarders to DLL entries
5278 # Use emximp which will extract exactly them.
5279 emximp -o tmp.imp $thisname \
5281 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5282 < tmp.imp >>libc.tmp
5285 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5288 echo "$ar didn't seem to work right." >&4
5289 echo "Maybe this is a Cray...trying bld instead..." >&4
5290 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5292 for thisname in $libnames; do
5294 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5295 $ar t $thisname >>libc.tmp
5299 echo "That didn't work either. Giving up." >&4
5306 if $test -f /lib/syscalls.exp; then
5308 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5309 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5313 $rm -f libnames libpath
5315 : see if dld is available
5319 : is a C symbol defined?
5322 -v) tf=libc.tmp; tc=""; tdc="";;
5323 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5324 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5327 case "$reuseval-$4" in
5329 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5335 if $contains $tlook $tf >/dev/null 2>&1;
5340 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5341 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5349 $define) tval=true;;
5355 : define an is-in-libc? function
5356 inlibc='echo " "; td=$define; tu=$undef;
5357 sym=$1; var=$2; eval "was=\$$2";
5359 case "$reuseval$was" in
5369 echo "$sym() found." >&4;
5370 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5372 echo "$sym() NOT found." >&4;
5373 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5377 $define) echo "$sym() found." >&4;;
5378 *) echo "$sym() NOT found." >&4;;
5382 : see if dlopen exists
5389 : determine which dynamic loading, if any, to compile in
5391 dldir="ext/DynaLoader"
5404 $define) dflt='y' ;;
5407 $define) dflt='y' ;;
5409 : Does a dl_xxx.xs file exist for this operating system
5410 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5413 rp="Do you wish to use dynamic loading?"
5420 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5421 dflt="$dldir/dl_${osname}.xs"
5422 elif $test "$d_dlopen" = "$define" ; then
5423 dflt="$dldir/dl_dlopen.xs"
5424 elif $test "$i_dld" = "$define" ; then
5425 dflt="$dldir/dl_dld.xs"
5430 *) dflt="$dldir/$dlsrc"
5433 echo "The following dynamic loading files are available:"
5434 : Can not go over to $dldir because getfile has path hard-coded in.
5435 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5436 rp="Source file to use for dynamic loading"
5442 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5446 Some systems may require passing special flags to $cc -c to
5447 compile modules that will be used to create a shared library.
5448 To use no flags, say "none".
5451 case "$cccdlflags" in
5452 '') case "$gccversion" in
5453 '') case "$osname" in
5455 next) dflt='none' ;;
5456 irix*) dflt='-KPIC' ;;
5457 svr4*|esix*|solaris) dflt='-KPIC' ;;
5458 sunos) dflt='-pic' ;;
5462 *) case "$osname" in
5463 svr4*|esix*|solaris) dflt='-fPIC' ;;
5468 *) dflt="$cccdlflags" ;;
5470 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5473 none) cccdlflags=' ' ;;
5474 *) cccdlflags="$ans" ;;
5479 Some systems use ld to create libraries that can be dynamically loaded,
5480 while other systems (such as those using ELF) use $cc.
5484 '') $cat >try.c <<'EOM'
5485 /* Test for whether ELF binaries are produced */
5490 int i = open("a.out",O_RDONLY);
5493 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5494 exit(0); /* succeed (yes, it's ELF) */
5499 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5501 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5505 echo "I'll use ld to build dynamic libraries."
5514 rp="What command should be used to create dynamic libraries?"
5520 Some systems may require passing special flags to $ld to create a
5521 library that can be dynamically loaded. If your ld flags include
5522 -L/other/path options to locate libraries outside your loader's normal
5523 search path, you may need to specify those -L options here as well. To
5524 use no flags, say "none".
5527 case "$lddlflags" in
5528 '') case "$osname" in
5529 beos) dflt='-nostart' ;;
5531 linux|irix*) dflt='-shared' ;;
5532 next) dflt='none' ;;
5533 solaris) dflt='-G' ;;
5534 sunos) dflt='-assert nodefinitions' ;;
5535 svr4*|esix*) dflt="-G $ldflags" ;;
5539 *) dflt="$lddlflags" ;;
5542 : Try to guess additional flags to pick up local libraries.
5543 : Be careful not to append to a plain 'none'
5547 for thisflag in $ldflags; do
5552 *) dflt="$dflt $thisflag" ;;
5559 ''|' ') dflt='none' ;;
5562 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5565 none) lddlflags=' ' ;;
5566 *) lddlflags="$ans" ;;
5571 Some systems may require passing special flags to $cc to indicate that
5572 the resulting executable will use dynamic linking. To use no flags,
5576 case "$ccdlflags" in
5577 '') case "$osname" in
5578 hpux) dflt='-Wl,-E' ;;
5579 linux) dflt='-rdynamic' ;;
5580 next) dflt='none' ;;
5581 sunos) dflt='none' ;;
5585 *) dflt="$ccdlflags" ;;
5587 rp="Any special flags to pass to $cc to use dynamic loading?"
5590 none) ccdlflags=' ' ;;
5591 *) ccdlflags="$ans" ;;
5605 # No dynamic loading being used, so don't bother even to prompt.
5608 *) case "$useshrplib" in
5609 '') case "$osname" in
5610 svr4*|dgux|dynixptx|esix|powerux|beos)
5612 also='Building a shared libperl is required for dynamic loading to work on your system.'
5617 also='Building a shared libperl is needed for MAB support.'
5635 The perl executable is normally obtained by linking perlmain.c with
5636 libperl${_a}, any static extensions (usually just DynaLoader), and
5637 any other libraries needed on this system (such as -lm, etc.). Since
5638 your system supports dynamic loading, it is probably possible to build
5639 a shared libperl.$so. If you will have more than one executable linked
5640 to libperl.$so, this will significantly reduce the size of each
5641 executable, but it may have a noticeable affect on performance. The
5642 default is probably sensible for your system.
5646 rp="Build a shared libperl.$so (y/n)"
5650 useshrplib='true' ;;
5651 *) useshrplib='false' ;;
5656 case "$useshrplib" in
5660 # Figure out a good name for libperl.so. Since it gets stored in
5661 # a version-specific architecture-dependent library, the version
5662 # number isn't really that important, except for making cc/ld happy.
5664 # A name such as libperl.so.3.1
5665 majmin="libperl.$so.$patchlevel.$subversion"
5666 # A name such as libperl.so.301
5667 majonly=`echo $patchlevel $subversion |
5668 $awk '{printf "%d%02d", $1, $2}'`
5669 majonly=libperl.$so.$majonly
5670 # I'd prefer to keep the os-specific stuff here to a minimum, and
5671 # rely on figuring it out from the naming of libc.
5672 case "${osname}${osvers}" in
5675 # XXX How handle the --version stuff for MAB?
5677 linux*) # ld won't link with a bare -lperl otherwise.
5680 *) # Try to guess based on whether libc has major.minor.
5682 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5683 *libc.$so.[0-9]*) dflt=$majonly ;;
5684 *) dflt=libperl.$so ;;
5694 I need to select a good name for the shared libperl. If your system uses
5695 library names with major and minor numbers, then you might want something
5696 like $majmin. Alternatively, if your system uses a single version
5697 number for shared libraries, then you might want to use $majonly.
5698 Or, your system might be quite happy with a simple libperl.$so.
5700 Since the shared libperl will get installed into a version-specific
5701 architecture-dependent directory, the version number of the shared perl
5702 library probably isn't important, so the default should be o.k.
5705 rp='What name do you want to give to the shared libperl?'
5708 echo "Ok, I'll use $libperl"
5711 libperl="libperl${_a}"
5715 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5719 WARNING: Use of the shrpdir variable for the installation location of
5720 the shared $libperl is not supported. It was never documented and
5721 will not work in this version. Let me (perlbug@perl.com)
5722 know of any problems this may cause.
5728 But your current setting of $shrpdir is
5729 the default anyway, so it's harmless.
5734 Further, your current attempted setting of $shrpdir
5735 conflicts with the value of $archlibexp/CORE
5736 that installperl will use.
5743 # How will the perl executable find the installed shared $libperl?
5744 # Add $xxx to ccdlflags.
5745 # If we can't figure out a command-line option, use $shrpenv to
5746 # set env LD_RUN_PATH. The main perl makefile uses this.
5747 shrpdir=$archlibexp/CORE
5750 if "$useshrplib"; then
5753 # We'll set it in Makefile.SH...
5759 xxx="-Wl,-R$shrpdir"
5761 linux|irix*|dec_osf)
5762 xxx="-Wl,-rpath,$shrpdir"
5765 # next doesn't like the default...
5768 # beos doesn't like the default, either.
5771 # hpux doesn't like the default, either.
5772 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5775 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5781 # Only add $xxx if it isn't already in ccdlflags.
5782 case " $ccdlflags " in
5784 *) ccdlflags="$ccdlflags $xxx"
5787 Adding $xxx to the flags
5788 passed to $ld so that the perl executable will find the
5789 installed shared $libperl.
5797 # Fix ccdlflags in AIX for building external extensions.
5798 # (For building Perl itself bare -bE:perl.exp is needed,
5799 # Makefile.SH takes care of this.)
5801 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5803 # Respect a hint or command-line value.
5805 '') shrpenv="$tmp_shrpenv" ;;
5807 case "$ldlibpthname" in
5808 '') ldlibpthname=LD_LIBRARY_PATH ;;
5809 none) ldlibpthname='' ;;
5812 : determine where manual pages go
5813 set man1dir man1dir none
5817 $spackage has manual pages available in source form.
5821 echo "However, you don't have nroff, so they're probably useless to you."
5823 '') man1dir="none";;
5826 echo "If you don't want the manual sources installed, answer 'none'."
5831 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5832 lookpath="$lookpath $prefixexp/man/p_man/man1"
5833 lookpath="$lookpath $prefixexp/man/u_man/man1"
5834 lookpath="$lookpath $prefixexp/man/man.1"
5836 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5837 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5847 rp="Where do the main $spackage manual pages (source) go?"
5849 if $test "X$man1direxp" != "X$ansexp"; then
5853 man1direxp="$ansexp"
5859 : Change installation prefix, if necessary.
5860 if $test X"$prefix" != X"$installprefix"; then
5861 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
5863 installman1dir="$man1direxp"
5866 : What suffix to use on installed man pages
5873 rp="What suffix should be used for the main $spackage man pages?"
5875 '') case "$man1dir" in
5889 *) dflt="$man1ext";;
5896 : see if we can have long filenames
5898 rmlist="$rmlist /tmp/cf$$"
5899 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5900 first=123456789abcdef
5901 second=/tmp/cf$$/$first
5902 $rm -f $first $second
5903 if (echo hi >$first) 2>/dev/null; then
5904 if $test -f 123456789abcde; then
5905 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5908 if (echo hi >$second) 2>/dev/null; then
5909 if $test -f /tmp/cf$$/123456789abcde; then
5911 That's peculiar... You can have filenames longer than 14 characters, but only
5912 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5913 I shall consider your system cannot support long filenames at all.
5917 echo 'You can have filenames longer than 14 characters.' >&4
5922 How confusing! Some of your filesystems are sane enough to allow filenames
5923 longer than 14 characters but some others like /tmp can't even think about them.
5924 So, for now on, I shall assume your kernel does not allow them at all.
5931 You can't have filenames longer than 14 chars. You can't even think about them!
5937 $rm -rf /tmp/cf$$ 123456789abcde*
5939 : determine where library module manual pages go
5940 set man3dir man3dir none
5944 $spackage has manual pages for many of the library modules.
5950 However, you don't have nroff, so they're probably useless to you.
5953 '') man3dir="none";;
5957 case "$d_flexfnam" in
5960 However, your system can't handle the long file names like File::Basename.3.
5963 '') man3dir="none";;
5967 echo "If you don't want the manual sources installed, answer 'none'."
5968 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5970 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
5971 if $test -d "$privlib/man/man3"; then
5974 WARNING: Previous versions of perl installed man3 pages into
5975 $privlib/man/man3. This version will suggest a
5976 new default of $dflt.
5980 rp='Do you wish to preserve the old behavior?(y/n)'
5983 y*) dflt="$privlib/man/man3" ;;
5989 *) dflt="$man3dir" ;;
5993 rp="Where do the $package library man pages (source) go?"
5996 man3direxp="$ansexp"
6002 : Change installation prefix, if necessary.
6003 if $test X"$prefix" != X"$installprefix"; then
6004 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6006 installman3dir="$man3direxp"
6009 : What suffix to use on installed man pages
6015 rp="What suffix should be used for the $package library man pages?"
6017 '') case "$man3dir" in
6031 *) dflt="$man3ext";;
6038 : see if we have to deal with yellow pages, now NIS.
6039 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6040 if $test -f /usr/etc/nibindd; then
6042 echo "I'm fairly confident you're on a NeXT."
6044 rp='Do you get the hosts file via NetInfo?'
6053 y*) hostcat='nidump hosts .';;
6054 *) case "$hostcat" in
6055 nidump*) hostcat='';;
6065 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6073 rp='Are you getting the hosts file via yellow pages?'
6076 y*) hostcat='ypcat hosts';;
6077 *) hostcat='cat /etc/hosts';;
6083 '') hostcat='cat /etc/hosts';;
6086 '') groupcat='cat /etc/group';;
6089 '') passcat='cat /etc/passwd';;
6092 : now get the host name
6094 echo "Figuring out host name..." >&4
6095 case "$myhostname" in
6097 echo 'Maybe "hostname" will work...'
6098 if tans=`sh -c hostname 2>&1` ; then
6106 if $test "$cont"; then
6108 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6109 if tans=`cat /etc/systemid 2>&1` ; then
6111 phostname='cat /etc/systemid'
6112 echo "Whadyaknow. Xenix always was a bit strange..."
6115 elif $test -r /etc/systemid; then
6116 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6119 if $test "$cont"; then
6120 echo 'No, maybe "uuname -l" will work...'
6121 if tans=`sh -c 'uuname -l' 2>&1` ; then
6123 phostname='uuname -l'
6125 echo 'Strange. Maybe "uname -n" will work...'
6126 if tans=`sh -c 'uname -n' 2>&1` ; then
6128 phostname='uname -n'
6130 echo 'Oh well, maybe I can mine it out of whoami.h...'
6131 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6132 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6133 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6135 case "$myhostname" in
6136 '') echo "Does this machine have an identity crisis or something?"
6139 echo "Well, you said $myhostname before..."
6140 phostname='echo $myhostname';;
6146 : you do not want to know about this
6151 if $test "$myhostname" ; then
6153 rp='Your host name appears to be "'$myhostname'".'" Right?"
6161 : bad guess or no guess
6162 while $test "X$myhostname" = X ; do
6164 rp="Please type the (one word) name of your host:"
6169 : translate upper to lower if necessary
6170 case "$myhostname" in
6172 echo "(Normalizing case in your host name)"
6173 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6177 case "$myhostname" in
6179 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6180 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6181 echo "(Trimming domain name from host name--host name is now $myhostname)"
6183 *) case "$mydomain" in
6186 test "X$hostcat" = "Xypcat hosts" &&
6187 ypmatch "$myhostname" hosts 2>/dev/null |\
6188 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6191 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6192 /[ ]$myhostname[ . ]/p" > hosts
6195 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6196 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6197 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6198 hosts | $sort | $uniq | \
6199 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6200 case `$echo X$dflt` in
6201 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6204 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6209 tans=`./loc resolv.conf X /etc /usr/etc`
6210 if $test -f "$tans"; then
6211 echo "(Attempting domain name extraction from $tans)"
6212 dflt=.`$sed -n -e 's/ / /g' \
6213 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6214 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6216 .) dflt=.`$sed -n -e 's/ / /g' \
6217 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6218 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6225 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6226 dflt=.`sh -c domainname 2>/dev/null`
6229 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6234 .) echo "(Lost all hope -- silly guess then)"
6240 *) dflt="$mydomain";;
6244 rp="What is your domain name?"
6254 : translate upper to lower if necessary
6257 echo "(Normalizing case in your domain name)"
6258 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6262 : a little sanity check here
6263 case "$phostname" in
6266 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6267 $myhostname$mydomain|$myhostname) ;;
6269 case "$phostname" in
6271 echo "(That doesn't agree with your whoami.h file, by the way.)"
6274 echo "(That doesn't agree with your $phostname command, by the way.)"
6284 I need to get your e-mail address in Internet format if possible, i.e.
6285 something like user@host.domain. Please answer accurately since I have
6286 no easy means to double check it. The default value provided below
6287 is most probably close to the reality but may not be valid from outside
6288 your organization...
6292 while test "$cont"; do
6294 '') dflt="$cf_by@$myhostname$mydomain";;
6295 *) dflt="$cf_email";;
6297 rp='What is your e-mail address?'
6303 rp='Address does not look like an Internet one. Use it anyway?'
6319 If you or somebody else will be maintaining perl at your site, please
6320 fill in the correct e-mail address here so that they may be contacted
6321 if necessary. Currently, the "perlbug" program included with perl
6322 will send mail to this address in addition to perlbug@perl.com. You may
6323 enter "none" for no administrator.
6326 case "$perladmin" in
6327 '') dflt="$cf_email";;
6328 *) dflt="$perladmin";;
6330 rp='Perl administrator e-mail address'
6334 : figure out how to guarantee perl startup
6335 case "$startperl" in
6337 case "$sharpbang" in
6341 I can use the #! construct to start perl on your system. This will
6342 make startup of perl scripts faster, but may cause problems if you
6343 want to share those scripts and perl is not in a standard place
6344 ($binexp/perl) on all your platforms. The alternative is to force
6345 a shell by starting the script with a single ':' character.
6349 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6352 none) startperl=": # use perl";;
6353 *) startperl="#!$ans"
6354 if $test 30 -lt `echo "$ans" | wc -c`; then
6357 WARNING: Some systems limit the #! command to 32 characters.
6358 If you experience difficulty running Perl scripts with #!, try
6359 installing Perl in a directory with a shorter pathname.
6365 *) startperl=": # use perl"
6370 echo "I'll use $startperl to start perl scripts."
6372 : figure best path for perl in scripts
6375 perlpath="$binexp/perl"
6376 case "$startperl" in
6381 I will use the "eval 'exec'" idiom to start Perl on your system.
6382 I can use the full path of your Perl binary for this purpose, but
6383 doing so may cause problems if you want to share those scripts and
6384 Perl is not always in a standard place ($binexp/perl).
6388 rp="What path shall I use in \"eval 'exec'\"?"
6395 case "$startperl" in
6397 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6400 : determine where public executable scripts go
6401 set scriptdir scriptdir
6403 case "$scriptdir" in
6406 : guess some guesses
6407 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6408 $test -d /usr/share/bin && dflt=/usr/share/bin
6409 $test -d /usr/local/script && dflt=/usr/local/script
6410 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6411 $test -d $prefixexp/script && dflt=$prefixexp/script
6415 *) dflt="$scriptdir"
6420 Some installations have a separate directory just for executable scripts so
6421 that they can mount it across multiple architectures but keep the scripts in
6422 one spot. You might, for example, have a subdirectory of /usr/share for this.
6423 Or you might just lump your scripts in with all your other executables.
6427 rp='Where do you keep publicly executable scripts?'
6429 if $test "X$ansexp" != "X$scriptdirexp"; then
6433 scriptdirexp="$ansexp"
6434 : Change installation prefix, if necessary.
6435 if $test X"$prefix" != X"$installprefix"; then
6436 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6438 installscript="$scriptdirexp"
6443 After $package is installed, you may wish to install various
6444 add-on modules and utilities. Typically, these add-ons will
6445 be installed under $prefix with the rest
6446 of this package. However, you may wish to install such add-ons
6447 elsewhere under a different prefix.
6449 If you do not wish to put everything under a single prefix, that's
6450 ok. You will be prompted for the individual locations; this siteprefix
6451 is only used to suggest the defaults.
6453 The default should be fine for most people.
6457 rp='Installation prefix to use for add-on modules and utilities?'
6458 : XXX Here might be another good place for an installstyle setting.
6459 case "$siteprefix" in
6461 *) dflt=$siteprefix ;;
6465 case "$siteprefix" in
6470 *) oldsiteprefix="$prefix";;
6475 siteprefixexp="$ansexp"
6477 : determine where site specific libraries go.
6478 : Usual default is /usr/local/lib/perl5/site_perl
6479 : The default "style" setting is made in installstyle.U
6480 : XXX No longer works with Prefixit stuff.
6481 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6482 case "$installstyle" in
6483 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6484 *) dflt=$siteprefix/lib/site_$prog ;;
6488 The installation process will create a directory for
6489 site-specific extensions and modules. Most users find it convenient
6490 to place all site-specific files in this directory rather than in the
6491 main distribution directory.
6495 rp='Pathname for the site-specific library files?'
6498 sitelibexp="$ansexp"
6499 : Change installation prefix, if necessary.
6500 if $test X"$prefix" != X"$installprefix"; then
6501 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6503 installsitelib="$sitelibexp"
6506 : determine where site specific architecture-dependent libraries go.
6507 : sitelib default is /usr/local/lib/perl5/site_perl/
6508 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6509 : sitelib may have an optional trailing /share.
6510 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6511 tdflt="$tdflt/$apiversion/$archname"
6512 set sitearch sitearch none
6515 '') dflt="$tdflt" ;;
6516 *) dflt="$sitearch" ;;
6520 The installation process will also create a directory for
6521 architecture-dependent site-specific extensions and modules.
6525 rp='Pathname for the site-specific architecture-dependent library files?'
6528 sitearchexp="$ansexp"
6529 : Change installation prefix, if necessary.
6530 if $test X"$prefix" != X"$installprefix"; then
6531 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6533 installsitearch="$sitearchexp"
6538 Perl can be built to take advantage of long doubles which
6539 (if available) may give more accuracy and range for floating point
6540 numbers. To do so, Configure must be run with -Duselongdouble.
6542 If this doesn't make any sense to you, just accept the default 'n'.
6544 case "$uselongdouble" in
6545 $define|true|[yY]*) dflt='y';;
6548 rp='Try to use long doubles if available?'
6551 y|Y) val="$define" ;;
6557 case "$uselongdouble" in
6558 "$define"|true|[yY]*)
6559 : Look for a hint-file generated 'call-back-unit'. If the
6560 : user has specified that long doubles should be used,
6561 : we may need to set or change some other defaults.
6562 if $test -f uselongdouble.cbu; then
6563 echo "Your platform has some specific hints for long doubles, using them..."
6564 . ./uselongdouble.cbu
6567 (Your platform doesn't have any specific hints for long doubles.)
6575 Previous version of $package used the standard IO mechanisms as defined
6576 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6577 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6578 the default. This abstraction layer can use AT&T's sfio (if you already
6579 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6580 problems with some extension modules. Using PerlIO with stdio is safe,
6581 but it is slower than plain stdio and therefore is not the default.
6583 If this doesn't make any sense to you, just accept the default 'n'.
6585 case "$useperlio" in
6586 $define|true|[yY]*) dflt='y';;
6589 rp='Use the experimental PerlIO abstraction layer?'
6596 echo "Ok, doing things the stdio way"
6603 : Check how to convert floats to strings.
6604 if test "X$d_Gconvert" = X; then
6606 echo "Checking for an efficient way to convert floats to strings."
6609 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6610 char *myname = "gconvert";
6613 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6614 char *myname = "gcvt";
6617 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6618 char *myname = "sprintf";
6624 checkit(expect, got)
6628 if (strcmp(expect, got)) {
6629 printf("%s oddity: Expected %s, got %s\n",
6630 myname, expect, got);
6640 /* This must be 1st test on (which?) platform */
6641 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6642 Gconvert(0.1, 8, 0, buf);
6643 checkit("0.1", buf);
6645 Gconvert(1.0, 8, 0, buf);
6648 Gconvert(0.0, 8, 0, buf);
6651 Gconvert(-1.0, 8, 0, buf);
6654 /* Some Linux gcvt's give 1.e+5 here. */
6655 Gconvert(100000.0, 8, 0, buf);
6656 checkit("100000", buf);
6658 /* Some Linux gcvt's give -1.e+5 here. */
6659 Gconvert(-100000.0, 8, 0, buf);
6660 checkit("-100000", buf);
6665 case "$d_Gconvert" in
6666 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6667 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6668 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6669 *) xxx_list='gconvert gcvt sprintf' ;;
6672 for xxx_convert in $xxx_list; do
6673 echo "Trying $xxx_convert"
6675 set try -DTRY_$xxx_convert
6676 if eval $compile; then
6677 echo "$xxx_convert" found. >&4
6679 echo "I'll use $xxx_convert to convert floats into a string." >&4
6682 echo "...But $xxx_convert didn't work as I expected."
6685 echo "$xxx_convert NOT found." >&4
6689 case "$xxx_convert" in
6690 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6691 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6692 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6696 : see if inttypes.h is available
6697 : we want a real compile instead of Inhdr because some systems
6698 : have an inttypes.h which includes non-existent headers
6701 #include <inttypes.h>
6703 static int32_t foo32 = 0x12345678;
6707 if eval $compile; then
6708 echo "<inttypes.h> found." >&4
6711 echo "<inttypes.h> NOT found." >&4
6719 case "$use64bits" in
6722 echo $n "Checking to see if your system supports int64_t...$c" >&4
6724 #include <sys/types.h>
6725 #$i_inttypes I_INTTYPES
6727 #include <inttypes.h>
6729 int64_t foo() { int64_t x; x = 7; return x; }
6731 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6733 echo " Yup, it does." >&4
6736 echo " Nope, it doesn't." >&4
6747 : check for lengths of integral types
6751 echo "Checking to see how big your integers are..." >&4
6752 $cat >intsize.c <<'EOCP'
6756 printf("intsize=%d;\n", sizeof(int));
6757 printf("longsize=%d;\n", sizeof(long));
6758 printf("shortsize=%d;\n", sizeof(short));
6763 if eval $compile_ok && ./intsize > /dev/null; then
6765 echo "Your integers are $intsize bytes long."
6766 echo "Your long integers are $longsize bytes long."
6767 echo "Your short integers are $shortsize bytes long."
6771 Help! I can't compile and run the intsize test program: please enlighten me!
6772 (This is probably a misconfiguration in your system or libraries, and
6773 you really ought to fix it. Still, I'll try anyway.)
6777 rp="What is the size of an integer (in bytes)?"
6781 rp="What is the size of a long integer (in bytes)?"
6785 rp="What is the size of a short integer (in bytes)?"
6791 $rm -f intsize intsize.*
6793 : check for long long
6795 echo $n "Checking to see if your system supports long long...$c" >&4
6796 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6797 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6799 echo " Yup, it does." >&4
6802 echo " Nope, it doesn't." >&4
6808 : check for length of long long
6809 case "${d_longlong}${longlongsize}" in
6812 $echo $n "Checking to see how big your long longs are...$c" >&4
6813 $cat >try.c <<'EOCP'
6817 printf("%d\n", sizeof(long long));
6821 if eval $compile_ok; then
6822 longlongsize=`./try`
6823 $echo " $longlongsize bytes." >&4
6827 echo "(I can't seem to compile the test program. Guessing...)"
6828 rp="What is the size of a long long (in bytes)?"
6832 if $test "X$longsize" = "X$longlongsize"; then
6833 echo "(That isn't any different from an ordinary long.)"
6841 if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
6843 echo "Checking how to print 64-bit integers..." >&4
6845 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6847 $cat >try.c <<'EOCP'
6848 #include <sys/types.h>
6851 int q = 12345678901;
6856 if eval $compile; then
6860 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6861 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6862 echo "We will use %d."
6868 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6870 $cat >try.c <<'EOCP'
6871 #include <sys/types.h>
6874 long q = 12345678901;
6879 if eval $compile; then
6883 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6884 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6885 echo "We will use %ld."
6891 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6893 $cat >try.c <<'EOCP'
6894 #include <sys/types.h>
6895 #include <inttypes.h>
6898 int64_t q = 12345678901;
6899 printf("%" PRId64 "\n", q);
6903 if eval $compile; then
6907 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6908 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6909 echo "We will use the C9X style."
6915 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6917 $cat >try.c <<'EOCP'
6918 #include <sys/types.h>
6921 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
6922 printf("%lld\n", q);
6926 if eval $compile; then
6930 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6931 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6932 echo "We will use the %lld style."
6938 if $test X"$sPRId64" = X -a X"$quad" != X; then
6940 #include <sys/types.h>
6943 $quad q = 12345678901;
6948 if eval $compile; then
6952 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
6953 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
6954 echo "We will use %lld."
6960 if $test X"$sPRId64" = X -a X"$quad" != X; then
6962 #include <sys/types.h>
6965 $quad q = 12345678901;
6970 if eval $compile; then
6974 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
6975 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
6976 echo "We will use %qd."
6982 if $test X"$sPRId64" = X; then
6983 echo "Cannot figure out how to print 64-bit integers." >&4
6988 fi # intsize -o longsize -o d_int64t -o d_longlong
6991 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
6992 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
6994 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
6995 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
6999 : check for length of double
7001 case "$doublesize" in
7003 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7004 $cat >try.c <<'EOCP'
7008 printf("%d\n", sizeof(double));
7012 if eval $compile_ok; then
7014 $echo " $doublesize bytes." >&4
7017 echo "(I can't seem to compile the test program. Guessing...)"
7018 rp="What is the size of a double precision number (in bytes)?"
7026 : check for long doubles
7028 echo $n "Checking to see if your system supports long double...$c" >&4
7029 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7030 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7032 echo " Yup, it does." >&4
7035 echo " Nope, it doesn't." >&4
7041 : check for length of long double
7042 case "${d_longdbl}${longdblsize}" in
7045 $echo $n "Checking to see how big your long doubles are...$c" >&4
7046 $cat >try.c <<'EOCP'
7050 printf("%d\n", sizeof(long double));
7054 if eval $compile; then
7056 $echo " $longdblsize bytes." >&4
7060 echo "(I can't seem to compile the test program. Guessing...)" >&4
7061 rp="What is the size of a long double (in bytes)?"
7065 if $test "X$doublesize" = "X$longdblsize"; then
7066 echo "(That isn't any different from an ordinary double.)"
7074 if $test X"$d_longdbl" = X"$define"; then
7076 echo "Checking how to print long doubles..." >&4
7078 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7079 $cat >try.c <<'EOCP'
7080 #include <sys/types.h>
7084 printf("%.3f\n", d);
7088 if eval $compile; then
7092 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7093 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7094 echo "We will use %f."
7100 if $test X"$sPRIfldbl" = X; then
7101 $cat >try.c <<'EOCP'
7102 #include <sys/types.h>
7105 long double d = 123.456;
7106 printf("%.3llf\n", d);
7110 if eval $compile; then
7114 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7115 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7116 echo "We will use %llf."
7122 if $test X"$sPRIfldbl" = X; then
7123 $cat >try.c <<'EOCP'
7124 #include <sys/types.h>
7127 long double d = 123.456;
7128 printf("%.3Lf\n", d);
7132 if eval $compile; then
7136 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7137 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7138 echo "We will use %Lf."
7144 if $test X"$sPRIfldbl" = X; then
7145 $cat >try.c <<'EOCP'
7146 #include <sys/types.h>
7149 long double d = 123.456;
7150 printf("%.3lf\n", d);
7154 if eval $compile; then
7158 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7159 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7160 echo "We will use %lf."
7166 if $test X"$sPRIfldbl" = X; then
7167 echo "Cannot figure out how to print long doubles." >&4
7174 case "$sPRIfldbl" in
7175 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7176 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7178 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7179 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7183 : Initialize h_fcntl
7186 : Initialize h_sysfile
7189 : access call always available on UNIX
7193 : locate the flags for 'access()'
7197 $cat >access.c <<'EOCP'
7198 #include <sys/types.h>
7203 #include <sys/file.h>
7212 : check sys/file.h first, no particular reason here
7213 if $test `./findhdr sys/file.h` && \
7214 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7216 echo "<sys/file.h> defines the *_OK access constants." >&4
7217 elif $test `./findhdr fcntl.h` && \
7218 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7220 echo "<fcntl.h> defines the *_OK access constants." >&4
7221 elif $test `./findhdr unistd.h` && \
7222 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7223 echo "<unistd.h> defines the *_OK access constants." >&4
7225 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7231 : see if accessx exists
7232 set accessx d_accessx
7235 : see if alarm exists
7239 : see if atolf exists
7243 : see if atoll exists
7247 : Look for GNU-cc style attribute checking
7249 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7250 $cat >attrib.c <<'EOCP'
7252 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7254 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7255 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7256 echo "Your C compiler doesn't fully support __attribute__."
7259 echo "Your C compiler supports __attribute__."
7263 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7270 : see if bcmp exists
7274 : see if bcopy exists
7278 : see if this is a unistd.h system
7279 set unistd.h i_unistd
7282 : see if getpgrp exists
7283 set getpgrp d_getpgrp
7286 case "$d_getpgrp" in
7289 echo "Checking to see which flavor of getpgrp is in use..."
7292 #include <sys/types.h>
7294 # include <unistd.h>
7298 if (getuid() == 0) {
7299 printf("(I see you are running Configure as super-user...)\n");
7303 if (getpgrp(1) == 0)
7312 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7313 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7315 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7316 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7319 echo "I can't seem to compile and run the test program."
7321 xxx="a USG one, i.e. you use getpgrp()."
7323 # SVR4 systems can appear rather BSD-ish.
7326 xxx="a BSD one, i.e. you use getpgrp(pid)."
7330 xxx="probably a USG one, i.e. you use getpgrp()."
7335 echo "Assuming your getpgrp is $xxx" >&4
7344 : see if setpgrp exists
7345 set setpgrp d_setpgrp
7348 case "$d_setpgrp" in
7351 echo "Checking to see which flavor of setpgrp is in use..."
7354 #include <sys/types.h>
7356 # include <unistd.h>
7360 if (getuid() == 0) {
7361 printf("(I see you are running Configure as super-user...)\n");
7365 if (-1 == setpgrp(1, 1))
7368 if (setpgrp() != -1)
7374 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7375 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7377 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7378 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7381 echo "(I can't seem to compile and run the test program.)"
7383 xxx="a USG one, i.e. you use setpgrp()."
7385 # SVR4 systems can appear rather BSD-ish.
7388 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7392 xxx="probably a USG one, i.e. you use setpgrp()."
7397 echo "Assuming your setpgrp is $xxx" >&4
7405 : see if bzero exists
7409 : see if signal is declared as pointer to function returning int or void
7411 xxx=`./findhdr signal.h`
7412 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7413 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7414 echo "You have int (*signal())() instead of void." >&4
7416 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7417 echo "You have void (*signal())()." >&4
7419 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7420 echo "You have int (*signal())() instead of void." >&4
7422 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7423 echo "You have void (*signal())()." >&4
7426 case "$d_voidsig" in
7428 echo "I can't determine whether signal handler returns void or int..." >&4
7430 rp="What type does your signal handler return?"
7437 echo "As you already told me, signal handler returns void." >&4
7440 *) echo "As you already told me, signal handler returns int." >&4
7447 case "$d_voidsig" in
7448 "$define") signal_t="void";;
7453 : check for ability to cast large floats to 32-bit ints.
7455 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7456 if $test "$intsize" -ge 4; then
7463 #include <sys/types.h>
7465 $signal_t blech(s) int s; { exit(3); }
7472 signal(SIGFPE, blech);
7474 /* Don't let compiler optimize the test away. Store the number
7475 in a writable string for gcc to pass to sscanf under HP/UX.
7477 sprintf(str, "2147483647");
7478 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7482 /* x86 processors will probably give 0x8000 0000, which is a
7483 sign change. We don't want that. We want to mimic SPARC
7484 behavior here, which is to preserve the sign and give
7487 if (i32 != ($xxx) f)
7493 if eval $compile_ok; then
7497 echo "(I can't seem to compile the test program--assuming it can't)"
7505 echo "Nope, it can't."
7512 : check for ability to cast negative floats to unsigned
7514 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7517 #include <sys/types.h>
7519 $signal_t blech(s) int s; { exit(7); }
7520 $signal_t blech_in_list(s) int s; { exit(4); }
7521 unsigned long dummy_long(p) unsigned long p; { return p; }
7522 unsigned int dummy_int(p) unsigned int p; { return p; }
7523 unsigned short dummy_short(p) unsigned short p; { return p; }
7527 unsigned long along;
7529 unsigned short ashort;
7533 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7534 a direct f = -123. assignment. gcc-2.8.0 reportedly
7535 optimized the whole file away
7537 /* Store the number in a writable string for gcc to pass to
7540 sprintf(str, "-123");
7541 sscanf(str, "%lf", &f); /* f = -123.; */
7543 signal(SIGFPE, blech);
7544 along = (unsigned long)f;
7545 aint = (unsigned int)f;
7546 ashort = (unsigned short)f;
7547 if (along != (unsigned long)-123)
7549 if (aint != (unsigned int)-123)
7551 if (ashort != (unsigned short)-123)
7553 sprintf(str, "1073741824.");
7554 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7557 along = (unsigned long)f;
7558 if (along != 0x80000000)
7562 along = (unsigned long)f;
7563 if (along != 0x7fffffff)
7567 along = (unsigned long)f;
7568 if (along != 0x80000001)
7572 signal(SIGFPE, blech_in_list);
7573 sprintf(str, "123.");
7574 sscanf(str, "%lf", &f); /* f = 123.; */
7575 along = dummy_long((unsigned long)f);
7576 aint = dummy_int((unsigned int)f);
7577 ashort = dummy_short((unsigned short)f);
7578 if (along != (unsigned long)123)
7580 if (aint != (unsigned int)123)
7582 if (ashort != (unsigned short)123)
7589 if eval $compile_ok; then
7593 echo "(I can't seem to compile the test program--assuming it can't)"
7596 case "$castflags" in
7601 echo "Nope, it can't."
7608 : see if vprintf exists
7610 if set vprintf val -f d_vprintf; eval $csym; $val; then
7611 echo 'vprintf() found.' >&4
7613 $cat >vprintf.c <<'EOF'
7614 #include <varargs.h>
7616 int main() { xxx("foo"); }
7625 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7629 if eval $compile && ./vprintf; then
7630 echo "Your vsprintf() returns (int)." >&4
7633 echo "Your vsprintf() returns (char*)." >&4
7637 echo 'vprintf() NOT found.' >&4
7647 : see if chown exists
7651 : see if chroot exists
7655 : see if chsize exists
7659 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
7660 while $test $# -ge 2; do
7662 $define) echo "#include <$2>";;
7666 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
7667 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7676 : see if this is a sys/uio.h system
7677 set sys/uio.h i_sysuio
7680 echo "Checking to see if your system supports struct iovec..." >&4
7681 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
7683 case "$d_iovec_s" in
7684 "$define") echo "Yup, it does." >&4
7686 *) echo "Nope, it doesn't." >&4
7692 : see whether socket exists
7694 $echo $n "Hmm... $c" >&4
7695 if set socket val -f d_socket; eval $csym; $val; then
7696 echo "Looks like you have Berkeley networking support." >&4
7698 if set setsockopt val -f; eval $csym; $val; then
7701 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
7705 if $contains socklib libc.list >/dev/null 2>&1; then
7706 echo "Looks like you have Berkeley networking support." >&4
7708 : we will have to assume that it supports the 4.2 BSD interface
7711 echo "You don't have Berkeley networking in libc$_a..." >&4
7712 if test "X$d_socket" = "X$define"; then
7713 echo "...but you seem to believe that you have sockets." >&4
7715 for net in net socket
7717 if test -f /usr/lib/lib$net$_a; then
7718 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
7719 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
7720 if $contains socket libc.list >/dev/null 2>&1; then
7725 echo "...but the Wollongong group seems to have hacked it in." >&4
7726 sockethdr="-I/usr/netinclude"
7729 echo "Found Berkeley sockets interface in lib$net." >& 4
7730 if $contains setsockopt libc.list >/dev/null 2>&1; then
7733 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7740 if test "X$d_socket" != "X$define"; then
7741 echo "or anywhere else I see." >&4
7749 : see if socketpair exists
7750 set socketpair d_sockpair
7755 echo "Checking the availability of certain socket constants..." >& 4
7756 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
7757 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
7759 #include <sys/types.h>
7760 #include <sys/socket.h>
7766 set try; if eval $compile; then
7769 set d_${enum}; eval $setvar
7773 set sendmsg d_sendmsg
7776 set recvmsg d_recvmsg
7780 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
7781 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7783 case "$d_msghdr_s" in
7784 "$define") echo "Yup, it does." >&4
7786 *) echo "Nope, it doesn't." >&4
7790 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7791 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7793 case "$d_cmsghdr_s" in
7794 "$define") echo "Yup, it does." >&4
7796 *) echo "Nope, it doesn't." >&4
7800 : check for const keyword
7802 echo 'Checking to see if your C compiler knows about "const"...' >&4
7803 $cat >const.c <<'EOCP'
7804 typedef struct spug { int drokk; } spug;
7811 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7813 echo "Yup, it does."
7816 echo "Nope, it doesn't."
7821 : see if crypt exists
7823 if set crypt val -f d_crypt; eval $csym; $val; then
7824 echo 'crypt() found.' >&4
7828 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7829 if $test -z "$cryptlib"; then
7830 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7834 if $test -z "$cryptlib"; then
7835 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7839 if $test -z "$cryptlib"; then
7840 cryptlib=`./loc libcrypt$_a "" $libpth`
7844 if $test -z "$cryptlib"; then
7845 echo 'crypt() NOT found.' >&4
7854 : get csh whereabouts
7856 'csh') val="$undef" ;;
7861 : Respect a hint or command line value for full_csh.
7863 '') full_csh=$csh ;;
7866 : see if cuserid exists
7867 set cuserid d_cuserid
7870 : see if this is a limits.h system
7871 set limits.h i_limits
7874 : see if this is a float.h system
7878 : See if number of significant digits in a double precision number is known
7880 $cat >dbl_dig.c <<EOM
7890 printf("Contains DBL_DIG");
7893 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7894 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7895 echo "DBL_DIG found." >&4
7898 echo "DBL_DIG NOT found." >&4
7905 : see if difftime exists
7906 set difftime d_difftime
7909 : see if this is a dirent system
7911 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7913 echo "<dirent.h> found." >&4
7916 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7917 echo "<sys/dir.h> found." >&4
7920 xinc=`./findhdr sys/ndir.h`
7922 echo "<dirent.h> NOT found." >&4
7927 : Look for type of directory structure.
7929 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7931 case "$direntrytype" in
7934 $define) guess1='struct dirent' ;;
7935 *) guess1='struct direct' ;;
7938 *) guess1="$direntrytype"
7943 'struct dirent') guess2='struct direct' ;;
7944 *) guess2='struct dirent' ;;
7947 if $contains "$guess1" try.c >/dev/null 2>&1; then
7948 direntrytype="$guess1"
7949 echo "Your directory entries are $direntrytype." >&4
7950 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7951 direntrytype="$guess2"
7952 echo "Your directory entries seem to be $direntrytype." >&4
7954 echo "I don't recognize your system's directory entries." >&4
7955 rp="What type is used for directory entries on this system?"
7963 : see if the directory entry stores field length
7965 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7966 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7967 echo "Good, your directory entry keeps length information in d_namlen." >&4
7970 echo "Your directory entry does not know about the d_namlen field." >&4
7977 : see if dlerror exists
7980 set dlerror d_dlerror
7984 : see if dlfcn is available
7992 On a few systems, the dynamically loaded modules that perl generates and uses
7993 will need a different extension than shared libs. The default will probably
8001 rp='What is the extension of dynamically loaded modules'
8010 : Check if dlsym need a leading underscore
8016 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8017 $cat >dyna.c <<'EOM'
8026 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8028 #include <sys/types.h>
8042 int mode = RTLD_LAZY ;
8044 handle = dlopen("./dyna.$dlext", mode) ;
8045 if (handle == NULL) {
8050 symbol = dlsym(handle, "fred") ;
8051 if (symbol == NULL) {
8052 /* try putting a leading underscore */
8053 symbol = dlsym(handle, "_fred") ;
8054 if (symbol == NULL) {
8067 : Call the object file tmp-dyna.o in case dlext=o.
8068 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8069 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8070 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8071 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8074 1) echo "Test program failed using dlopen." >&4
8075 echo "Perhaps you should not use dynamic loading." >&4;;
8076 2) echo "Test program failed using dlsym." >&4
8077 echo "Perhaps you should not use dynamic loading." >&4;;
8078 3) echo "dlsym needs a leading underscore" >&4
8080 4) echo "dlsym doesn't need a leading underscore." >&4;;
8083 echo "I can't compile and run the test program." >&4
8084 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8089 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8094 hasproto='varname=$1; func=$2; shift; shift;
8095 while $test $# -ge 2; do
8097 $define) echo "#include <$2>";;
8101 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8102 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8103 echo "$func() prototype found.";
8106 echo "$func() prototype NOT found.";
8111 $rm -f try.c tryout.c'
8113 : see if prototype for drand48 is available
8115 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8118 : see if dup2 exists
8122 : see if eaccess exists
8123 set eaccess d_eaccess
8126 : see if endgrent exists
8127 set endgrent d_endgrent
8130 : see if endhostent exists
8131 set endhostent d_endhent
8134 : see if endnetent exists
8135 set endnetent d_endnent
8138 : see if endprotoent exists
8139 set endprotoent d_endpent
8142 : see if endpwent exists
8143 set endpwent d_endpwent
8146 : see if endservent exists
8147 set endservent d_endsent
8150 : see if endspent exists
8151 set endspent d_endspent
8154 : Locate the flags for 'open()'
8156 $cat >open3.c <<'EOCP'
8157 #include <sys/types.h>
8162 #include <sys/file.h>
8173 : check sys/file.h first to get FREAD on Sun
8174 if $test `./findhdr sys/file.h` && \
8175 set open3 -DI_SYS_FILE && eval $compile; then
8177 echo "<sys/file.h> defines the O_* constants..." >&4
8179 echo "and you have the 3 argument form of open()." >&4
8182 echo "but not the 3 argument form of open(). Oh, well." >&4
8185 elif $test `./findhdr fcntl.h` && \
8186 set open3 -DI_FCNTL && eval $compile; then
8188 echo "<fcntl.h> defines the O_* constants..." >&4
8190 echo "and you have the 3 argument form of open()." >&4
8193 echo "but not the 3 argument form of open(). Oh, well." >&4
8198 echo "I can't find the O_* constant definitions! You got problems." >&4
8204 : check for non-blocking I/O stuff
8205 case "$h_sysfile" in
8206 true) echo "#include <sys/file.h>" > head.c;;
8209 true) echo "#include <fcntl.h>" > head.c;;
8210 *) echo "#include <sys/fcntl.h>" > head.c;;
8215 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8216 case "$o_nonblock" in
8219 $cat >>try.c <<'EOCP'
8222 printf("O_NONBLOCK\n");
8226 printf("O_NDELAY\n");
8230 printf("FNDELAY\n");
8237 if eval $compile_ok; then
8239 case "$o_nonblock" in
8240 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8241 *) echo "Seems like we can use $o_nonblock.";;
8244 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8247 *) echo "Using $hint value $o_nonblock.";;
8249 $rm -f try try.* .out core
8252 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8258 #include <sys/types.h>
8260 #define MY_O_NONBLOCK $o_nonblock
8261 #ifndef errno /* XXX need better Configure test */
8264 $signal_t blech(x) int x; { exit(3); }
8266 $cat >> try.c <<'EOCP'
8274 pipe(pd); /* Down: child -> parent */
8275 pipe(pu); /* Up: parent -> child */
8278 close(pd[1]); /* Parent reads from pd[0] */
8279 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8280 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8282 signal(SIGALRM, blech);
8284 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8286 sprintf(string, "%d\n", ret);
8287 write(2, string, strlen(string));
8290 if (errno == EAGAIN) {
8296 if (errno == EWOULDBLOCK)
8297 printf("EWOULDBLOCK\n");
8300 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8301 sleep(2); /* Give it time to close our pipe */
8303 ret = read(pd[0], buf, 1); /* Should read EOF */
8305 sprintf(string, "%d\n", ret);
8306 write(3, string, strlen(string));
8310 close(pd[0]); /* We write to pd[1] */
8311 close(pu[1]); /* We read from pu[0] */
8312 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8313 close(pd[1]); /* Pipe pd is now fully closed! */
8314 exit(0); /* Bye bye, thank you for playing! */
8318 if eval $compile_ok; then
8319 echo "$startsh" >mtry
8320 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8322 ./mtry >/dev/null 2>&1
8324 0) eagain=`$cat try.out`;;
8325 1) echo "Could not perform non-blocking setting!";;
8326 2) echo "I did a successful read() for something that was not there!";;
8327 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8328 *) echo "Something terribly wrong happened during testing.";;
8330 rd_nodata=`$cat try.ret`
8331 echo "A read() system call with no data present returns $rd_nodata."
8332 case "$rd_nodata" in
8335 echo "(That's peculiar, fixing that to be -1.)"
8341 echo "Forcing errno EAGAIN on read() with no data available."
8345 echo "Your read() sets errno to $eagain when no data is available."
8348 status=`$cat try.err`
8350 0) echo "And it correctly returns 0 to signal EOF.";;
8351 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8352 *) echo "However, your read() returns '$status' on EOF??";;
8355 if test "$status" = "$rd_nodata"; then
8356 echo "WARNING: you can't distinguish between EOF and no data!"
8360 echo "I can't compile the test program--assuming errno EAGAIN will do."
8367 echo "Using $hint value $eagain."
8368 echo "Your read() returns $rd_nodata when no data is present."
8369 case "$d_eofnblk" in
8370 "$define") echo "And you can see EOF because read() returns 0.";;
8371 "$undef") echo "But you can't see EOF status from read() returned value.";;
8373 echo "(Assuming you can't see EOF status from read anyway.)"
8379 $rm -f try try.* .out core head.c mtry
8381 : see if fchmod exists
8385 : see if fchown exists
8389 : see if this is an fcntl system
8393 : see if sys/select.h has to be included
8394 set sys/select.h i_sysselct
8397 : see if we should include time.h, sys/time.h, or both
8399 if test "X$timeincl" = X; then
8400 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8401 $echo $n "I'm now running the test program...$c"
8402 $cat >try.c <<'EOCP'
8403 #include <sys/types.h>
8408 #ifdef SYSTIMEKERNEL
8411 #include <sys/time.h>
8414 #include <sys/select.h>
8423 struct timezone tzp;
8425 if (foo.tm_sec == foo.tm_sec)
8428 if (bar.tv_sec == bar.tv_sec)
8435 for s_timezone in '-DS_TIMEZONE' ''; do
8437 for s_timeval in '-DS_TIMEVAL' ''; do
8438 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8439 for i_time in '' '-DI_TIME'; do
8440 for i_systime in '-DI_SYSTIME' ''; do
8443 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8444 if eval $compile; then
8445 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8449 $echo $n "Succeeded with $flags$c"
8461 *SYSTIMEKERNEL*) i_systimek="$define"
8462 timeincl=`./findhdr sys/time.h`
8463 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8464 *) i_systimek="$undef";;
8467 *I_TIME*) i_time="$define"
8468 timeincl=`./findhdr time.h`" $timeincl"
8469 echo "We'll include <time.h>." >&4;;
8470 *) i_time="$undef";;
8473 *I_SYSTIME*) i_systime="$define"
8474 timeincl=`./findhdr sys/time.h`" $timeincl"
8475 echo "We'll include <sys/time.h>." >&4;;
8476 *) i_systime="$undef";;
8481 : check for fd_set items
8484 Checking to see how well your C compiler handles fd_set and friends ...
8486 $cat >fd_set.c <<EOCP
8487 #$i_systime I_SYS_TIME
8488 #$i_sysselct I_SYS_SELECT
8489 #$d_socket HAS_SOCKET
8490 #include <sys/types.h>
8492 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8495 #include <sys/time.h>
8498 #include <sys/select.h>
8507 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8514 set fd_set -DTRYBITS
8515 if eval $compile; then
8516 d_fds_bits="$define"
8518 echo "Well, your system knows about the normal fd_set typedef..." >&4
8520 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8521 d_fd_macros="$define"
8524 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8526 d_fd_macros="$undef"
8530 Hmm, your compiler has some difficulty with fd_set. Checking further...
8533 if eval $compile; then
8536 echo "Well, your system has some sort of fd_set available..." >&4
8538 echo "and you have the normal fd_set macros." >&4
8539 d_fd_macros="$define"
8542 but not the normal fd_set macros! Gross! More work for me...
8544 d_fd_macros="$undef"
8547 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8550 d_fd_macros="$undef"
8555 : see if fgetpos exists
8556 set fgetpos d_fgetpos
8559 : see if flock exists
8563 : see if fork exists
8567 : see if pathconf exists
8568 set pathconf d_pathconf
8571 : see if fpathconf exists
8572 set fpathconf d_fpathconf
8576 : see if llseek exists
8582 echo $n "Checking to see if your system supports off64_t...$c" >&4
8584 #include <sys/types.h>
8586 off64_t foo() { off64_t x; x = 7; return x; }'
8588 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8590 echo " Yup, it does." >&4
8593 echo " Nope, it doesn't." >&4
8599 : check for fpos64_t
8601 echo $n "Checking to see if your system supports fpos64_t...$c" >&4
8603 #include <sys/stdio.h>
8604 fpos64_t foo() { fpos64_t x; x = 7; return x; }'
8606 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8608 echo " Yup, it does." >&4
8611 echo " Nope, it doesn't." >&4
8617 : see if fseeko exists
8621 : see if fsetpos exists
8622 set fsetpos d_fsetpos
8625 : see if this is a sys/param system
8626 set sys/param.h i_sysparam
8629 : see if this is a sys/mount.h system
8630 set sys/mount.h i_sysmount
8634 : see if statfs exists
8638 : see if fstatfs exists
8639 set fstatfs d_fstatfs
8642 : see if statfs knows about mount flags
8643 set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
8647 : see if statvfs exists
8648 set statvfs d_statvfs
8651 : see if fstatvfs exists
8652 set fstatvfs d_fstatvfs
8656 : see if ftello exists
8660 : see if getgrent exists
8661 set getgrent d_getgrent
8664 : see if gethostbyaddr exists
8665 set gethostbyaddr d_gethbyaddr
8668 : see if gethostbyname exists
8669 set gethostbyname d_gethbyname
8672 : see if gethostent exists
8673 set gethostent d_gethent
8676 : see how we will look up host name
8679 if set gethostname val -f d_gethname; eval $csym; $val; then
8680 echo 'gethostname() found.' >&4
8681 d_gethname="$define"
8684 if set uname val -f d_uname; eval $csym; $val; then
8687 uname() was found, but you're running xenix, and older versions of xenix
8688 have a broken uname(). If you don't really know whether your xenix is old
8689 enough to have a broken system call, use the default answer.
8696 rp='Is your uname() broken?'
8699 n*) d_uname="$define"; call=uname;;
8702 echo 'uname() found.' >&4
8709 case "$d_gethname" in
8710 '') d_gethname="$undef";;
8713 '') d_uname="$undef";;
8715 case "$d_uname$d_gethname" in
8720 Every now and then someone has a $call() that lies about the hostname
8721 but can't be fixed for political or economic reasons. If you wish, I can
8722 pretend $call() isn't there and maybe compute hostname at run-time
8723 thanks to the '$phostname' command.
8726 rp="Shall I ignore $call() from now on?"
8729 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8732 case "$phostname" in
8734 *) case "$aphostname" in
8740 file=`./loc $file $file $pth`
8741 aphostname=`echo $file $*`
8746 case "$d_uname$d_gethname" in
8749 case "$phostname" in
8751 echo "There will be no way for $package to get your hostname." >&4;;
8753 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8757 case "$d_phostname" in
8758 '') d_phostname="$undef";;
8761 : see if this is a netdb.h system
8765 : see if prototypes for various gethostxxx netdb.h functions are available
8767 set d_gethostprotos gethostent $i_netdb netdb.h
8770 : see if getlogin exists
8771 set getlogin d_getlogin
8774 : see if getmntent exists
8775 set getmntent d_getmntent
8778 : see if getnetbyaddr exists
8779 set getnetbyaddr d_getnbyaddr
8782 : see if getnetbyname exists
8783 set getnetbyname d_getnbyname
8786 : see if getnetent exists
8787 set getnetent d_getnent
8790 : see if prototypes for various getnetxxx netdb.h functions are available
8792 set d_getnetprotos getnetent $i_netdb netdb.h
8796 : see if getprotobyname exists
8797 set getprotobyname d_getpbyname
8800 : see if getprotobynumber exists
8801 set getprotobynumber d_getpbynumber
8804 : see if getprotoent exists
8805 set getprotoent d_getpent
8808 : see if getpgid exists
8809 set getpgid d_getpgid
8812 : see if getpgrp2 exists
8813 set getpgrp2 d_getpgrp2
8816 : see if getppid exists
8817 set getppid d_getppid
8820 : see if getpriority exists
8821 set getpriority d_getprior
8824 : see if prototypes for various getprotoxxx netdb.h functions are available
8826 set d_getprotoprotos getprotoent $i_netdb netdb.h
8829 : see if getpwent exists
8830 set getpwent d_getpwent
8834 : see if getservbyname exists
8835 set getservbyname d_getsbyname
8838 : see if getservbyport exists
8839 set getservbyport d_getsbyport
8842 : see if getservent exists
8843 set getservent d_getsent
8846 : see if prototypes for various getservxxx netdb.h functions are available
8848 set d_getservprotos getservent $i_netdb netdb.h
8851 : see if getspent exists
8852 set getspent d_getspent
8855 : see if getspnam exists
8856 set getspnam d_getspnam
8859 : see if gettimeofday or ftime exists
8860 set gettimeofday d_gettimeod
8862 case "$d_gettimeod" in
8868 val="$undef"; set d_ftime; eval $setvar
8871 case "$d_gettimeod$d_ftime" in
8874 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8878 : see if this is an grp system
8884 xxx=`./findhdr grp.h`
8885 $cppstdin $cppflags $cppminus < $xxx >$$.h
8887 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8899 set d_grpasswd; eval $setvar
8903 : see if hasmntopt exists
8904 set hasmntopt d_hasmntopt
8907 : see if this is a netinet/in.h or sys/in.h system
8908 set netinet/in.h i_niin sys/in.h i_sysin
8911 : see if arpa/inet.h has to be included
8912 set arpa/inet.h i_arpainet
8915 : see if htonl --and friends-- exists
8920 : Maybe they are macros.
8925 #include <sys/types.h>
8926 #$i_niin I_NETINET_IN
8928 #$i_arpainet I_ARPA_INET
8930 #include <netinet/in.h>
8936 #include <arpa/inet.h>
8939 printf("Defined as a macro.");
8942 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8943 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8945 echo "But it seems to be defined as a macro." >&4
8953 : see which of string.h or strings.h is needed
8955 strings=`./findhdr string.h`
8956 if $test "$strings" && $test -r "$strings"; then
8957 echo "Using <string.h> instead of <strings.h>." >&4
8961 strings=`./findhdr strings.h`
8962 if $test "$strings" && $test -r "$strings"; then
8963 echo "Using <strings.h> instead of <string.h>." >&4
8965 echo "No string header found -- You'll surely have problems." >&4
8971 "$undef") strings=`./findhdr strings.h`;;
8972 *) strings=`./findhdr string.h`;;
8977 if set index val -f; eval $csym; $val; then
8978 if set strchr val -f d_strchr; eval $csym; $val; then
8979 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8982 echo "strchr() found." >&4
8986 echo "index() found." >&4
8991 echo "index() found." >&4
8994 if set strchr val -f d_strchr; eval $csym; $val; then
8997 echo "strchr() found." >&4
8999 echo "No index() or strchr() found!" >&4
9004 set d_strchr; eval $setvar
9006 set d_index; eval $setvar
9008 : check whether inet_aton exists
9009 set inet_aton d_inetaton
9014 $cat >isascii.c <<'EOCP'
9026 if eval $compile; then
9027 echo "isascii() found." >&4
9030 echo "isascii() NOT found." >&4
9037 : see if killpg exists
9041 : see if lchown exists
9043 $cat > try.c <<'EOCP'
9044 /* System header to define __stub macros and hopefully few prototypes,
9045 which can conflict with char lchown(); below. */
9047 /* Override any gcc2 internal prototype to avoid an error. */
9048 /* We use char because int might match the return type of a gcc2
9049 builtin and then its argument prototype would still apply. */
9052 /* The GNU C library defines this for functions which it implements
9053 to always fail with ENOSYS. Some functions are actually named
9054 something starting with __ and the normal name is an alias. */
9055 #if defined (__stub_lchown) || defined (__stub___lchown)
9063 if eval $compile; then
9064 $echo "lchown() found." >&4
9067 $echo "lchown() NOT found." >&4
9073 : See if number of significant digits in a double precision number is known
9075 $cat >ldbl_dig.c <<EOM
9085 printf("Contains LDBL_DIG");
9088 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9089 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9090 echo "LDBL_DIG found." >&4
9093 echo "LDBL_DIG NOT found." >&4
9100 : see if link exists
9104 : see if localeconv exists
9105 set localeconv d_locconv
9108 : see if lockf exists
9112 : see if lstat exists
9116 : see if madvise exists
9117 set madvise d_madvise
9120 : see if mblen exists
9124 : see if mbstowcs exists
9125 set mbstowcs d_mbstowcs
9128 : see if mbtowc exists
9132 : see if memchr exists
9136 : see if memcmp exists
9140 : see if memcpy exists
9144 : see if memmove exists
9145 set memmove d_memmove
9148 : see if memset exists
9152 : see if mkdir exists
9156 : see if mkfifo exists
9160 : see if mktime exists
9164 : see if this is a sys/mman.h system
9165 set sys/mman.h i_sysmman
9168 : see if mmap exists
9171 : see what shmat returns
9172 : default to something harmless
9174 case "$i_sysmman$d_mmap" in
9176 $cat >mmap.c <<'END'
9177 #include <sys/mman.h>
9180 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9185 echo "and it returns ($mmaptype)." >&4
9191 : see if mprotect exists
9192 set mprotect d_mprotect
9195 : see if msgctl exists
9199 : see if msgget exists
9203 : see if msgsnd exists
9207 : see if msgrcv exists
9211 : see how much of the 'msg*(2)' library is present.
9214 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9215 *"$undef"*) h_msg=false;;
9219 case "`ipcs 2>&1`" in
9220 "SVID messages"*"not configured"*)
9221 echo "Your $osname does not have the msg*(2) configured." >&4
9236 : we could also check for sys/ipc.h ...
9237 if $h_msg && $test `./findhdr sys/msg.h`; then
9238 echo "You have the full msg*(2) library." >&4
9241 echo "You don't have the full msg*(2) library." >&4
9247 : see if msync exists
9251 : see if munmap exists
9255 : see if nice exists
9259 : see if POSIX threads are available
9260 set pthread.h i_pthread
9266 : how to create joinable pthreads
9267 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9269 echo "Checking what constant to use for creating joinable pthreads..." >&4
9270 $cat >try.c <<'EOCP'
9271 #include <pthread.h>
9273 int detachstate = JOINABLE;
9276 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9277 if eval $compile; then
9278 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9279 val="$undef" # Yes, undef.
9280 set d_old_pthread_create_joinable
9283 set old_pthread_create_joinable
9286 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9287 if eval $compile; then
9288 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9290 set d_old_pthread_create_joinable
9292 val=PTHREAD_CREATE_UNDETACHED
9293 set old_pthread_create_joinable
9296 set try -DJOINABLE=__UNDETACHED
9297 if eval $compile; then
9298 echo "You seem to use __UNDETACHED." >&4
9300 set d_old_pthread_create_joinable
9303 set old_pthread_create_joinable
9306 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9308 set d_old_pthread_create_joinable
9311 set old_pthread_create_joinable
9318 d_old_pthread_create_joinable="$undef"
9319 old_pthread_create_joinable=""
9322 : see if pause exists
9326 : see if pipe exists
9330 : see if poll exists
9335 : see whether the various POSIXish _yields exist
9337 #include <pthread.h>
9343 #ifdef PTHREAD_YIELD
9346 #ifdef PTHREAD_YIELD_NULL
9347 pthread_yield(NULL);
9353 : see if sched_yield exists
9354 set try -DSCHED_YIELD
9355 if eval $compile; then
9357 sched_yield='sched_yield()'
9361 case "$usethreads" in
9364 $define) echo 'sched_yield() found.' >&4 ;;
9365 *) echo 'sched_yield() NOT found.' >&4 ;;
9371 : see if pthread_yield exists
9372 set try -DPTHREAD_YIELD
9373 if eval $compile; then
9375 case "$sched_yield" in
9376 '') sched_yield='pthread_yield()' ;;
9379 set try -DPTHREAD_YIELD_NULL
9380 if eval $compile; then
9382 case "$sched_yield" in
9383 '') sched_yield='pthread_yield(NULL)' ;;
9389 case "$usethreads" in
9392 $define) echo 'pthread_yield() found.' >&4 ;;
9393 *) echo 'pthread_yield() NOT found.' >&4 ;;
9400 case "$sched_yield" in
9401 '') sched_yield=undef ;;
9406 : see if this is a pwd.h system
9412 xxx=`./findhdr pwd.h`
9413 $cppstdin $cppflags $cppminus < $xxx >$$.h
9415 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9423 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9431 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9439 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9447 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9455 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9463 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9471 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9483 set d_pwquota; eval $setvar
9484 set d_pwage; eval $setvar
9485 set d_pwchange; eval $setvar
9486 set d_pwclass; eval $setvar
9487 set d_pwexpire; eval $setvar
9488 set d_pwcomment; eval $setvar
9489 set d_pwgecos; eval $setvar
9490 set d_pwpasswd; eval $setvar
9494 : see if readdir and friends exist
9495 set readdir d_readdir
9497 set seekdir d_seekdir
9499 set telldir d_telldir
9501 set rewinddir d_rewinddir
9504 : see if readlink exists
9505 set readlink d_readlink
9508 : see if readv exists
9512 : see if rename exists
9516 : see if rmdir exists
9520 : see if memory.h is available.
9525 : See if it conflicts with string.h
9531 $cppstdin $cppflags $cppminus < $strings > mem.h
9532 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9534 echo "We won't be including <memory.h>."
9544 : can bcopy handle overlapping blocks?
9549 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9556 $cat >>try.c <<'EOCP'
9559 # include <memory.h>
9562 # include <stdlib.h>
9565 # include <string.h>
9567 # include <strings.h>
9570 # include <unistd.h> /* Needed for NetBSD */
9574 char buf[128], abc[128];
9580 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9582 for (align = 7; align >= 0; align--) {
9583 for (len = 36; len; len--) {
9586 for (off = 1; off <= len; off++) {
9587 bcopy(b, b+off, len);
9588 bcopy(b+off, b, len);
9589 if (bcmp(b, abc, len))
9598 if eval $compile_ok; then
9599 if ./try 2>/dev/null; then
9603 echo "It can't, sorry."
9604 case "$d_memmove" in
9605 "$define") echo "But that's Ok since you have memmove()." ;;
9609 echo "(I can't compile the test program, so we'll assume not...)"
9610 case "$d_memmove" in
9611 "$define") echo "But that's Ok since you have memmove()." ;;
9616 $rm -f try.* try core
9620 : can memcpy handle overlapping blocks?
9625 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9632 $cat >>try.c <<'EOCP'
9635 # include <memory.h>
9638 # include <stdlib.h>
9641 # include <string.h>
9643 # include <strings.h>
9646 # include <unistd.h> /* Needed for NetBSD */
9650 char buf[128], abc[128];
9656 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9657 try to store the string in read-only memory. */
9658 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9660 for (align = 7; align >= 0; align--) {
9661 for (len = 36; len; len--) {
9663 memcpy(b, abc, len);
9664 for (off = 1; off <= len; off++) {
9665 memcpy(b+off, b, len);
9666 memcpy(b, b+off, len);
9667 if (memcmp(b, abc, len))
9676 if eval $compile_ok; then
9677 if ./try 2>/dev/null; then
9681 echo "It can't, sorry."
9682 case "$d_memmove" in
9683 "$define") echo "But that's Ok since you have memmove()." ;;
9687 echo "(I can't compile the test program, so we'll assume not...)"
9688 case "$d_memmove" in
9689 "$define") echo "But that's Ok since you have memmove()." ;;
9694 $rm -f try.* try core
9698 : can memcmp be trusted to compare relative magnitude?
9703 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9710 $cat >>try.c <<'EOCP'
9713 # include <memory.h>
9716 # include <stdlib.h>
9719 # include <string.h>
9721 # include <strings.h>
9724 # include <unistd.h> /* Needed for NetBSD */
9730 if ((a < b) && memcmp(&a, &b, 1) < 0)
9736 if eval $compile_ok; then
9737 if ./try 2>/dev/null; then
9741 echo "No, it can't (it uses signed chars)."
9744 echo "(I can't compile the test program, so we'll assume not...)"
9748 $rm -f try.* try core
9752 : see if select exists
9756 : see if semctl exists
9760 : see if semget exists
9764 : see if semop exists
9768 : see how much of the 'sem*(2)' library is present.
9771 case "$d_semctl$d_semget$d_semop" in
9772 *"$undef"*) h_sem=false;;
9776 case "`ipcs 2>&1`" in
9777 "SVID messages"*"not configured"*)
9778 echo "Your $osname does not have the sem*(2) configured." >&4
9791 : we could also check for sys/ipc.h ...
9792 if $h_sem && $test `./findhdr sys/sem.h`; then
9793 echo "You have the full sem*(2) library." >&4
9796 echo "You don't have the full sem*(2) library." >&4
9802 : see whether sys/sem.h defines union semun
9804 $cat > try.c <<'END'
9805 #include <sys/types.h>
9806 #include <sys/ipc.h>
9807 #include <sys/sem.h>
9808 int main () { union semun semun; semun.buf = 0; }
9811 if eval $compile; then
9812 echo "You have union semun in <sys/sem.h>." >&4
9815 echo "You do not have union semun in <sys/sem.h>." >&4
9818 $rm -f try try.c try.h
9822 : see how to do semctl IPC_STAT
9825 : see whether semctl IPC_STAT can use union semun
9830 # define S_IRUSR S_IREAD
9831 # define S_IWUSR S_IWRITE
9832 # define S_IXUSR S_IEXEC
9834 # define S_IRUSR 0400
9835 # define S_IWUSR 0200
9836 # define S_IXUSR 0100
9838 # define S_IRGRP (S_IRUSR>>3)
9839 # define S_IWGRP (S_IWUSR>>3)
9840 # define S_IXGRP (S_IXUSR>>3)
9841 # define S_IROTH (S_IRUSR>>6)
9842 # define S_IWOTH (S_IWUSR>>6)
9843 # define S_IXOTH (S_IXUSR>>6)
9846 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9847 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9848 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9853 #include <sys/types.h>
9854 #include <sys/ipc.h>
9855 #include <sys/sem.h>
9856 #include <sys/stat.h>
9863 #$d_union_semun HAS_UNION_SEMUN
9866 #ifndef HAS_UNION_SEMUN
9869 struct semid_ds *buf;
9870 unsigned short *array;
9876 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9877 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9879 struct semid_ds argbuf;
9882 st = semctl(sem, 0, IPC_STAT, arg);
9886 # endif /* IPC_STAT */
9887 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9889 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9890 # endif /* IPC_RMID */
9891 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9893 #endif /* IPC_PRIVATE && ... */
9894 printf("semget failed: errno = %d\n", errno);
9900 if eval $compile; then
9903 semun) val="$define" ;;
9909 case "$d_semctl_semun" in
9911 echo "You can use union semun for semctl IPC_STAT." >&4
9914 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9919 : see whether semctl IPC_STAT can use struct semid_ds pointer
9920 $cat > try.c <<'END'
9921 #include <sys/types.h>
9922 #include <sys/ipc.h>
9923 #include <sys/sem.h>
9924 #include <sys/stat.h>
9932 struct semid_ds arg;
9935 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9936 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9939 st = semctl(sem, 0, IPC_STAT, &arg);
9941 printf("semid_ds\n");
9943 # endif /* IPC_STAT */
9944 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9946 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9947 # endif /* IPC_RMID */
9948 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9950 #endif /* IPC_PRIVATE && ... */
9951 printf("semget failed: errno = %d\n", errno);
9958 if eval $compile; then
9961 semid_ds) val="$define" ;;
9965 set d_semctl_semid_ds
9967 case "$d_semctl_semid_ds" in
9969 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
9971 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
9978 # We do not have the full sem*(2) library, so assume we can not
9984 set d_semctl_semid_ds
9989 : see if setegid exists
9990 set setegid d_setegid
9993 : see if seteuid exists
9994 set seteuid d_seteuid
9997 : see if setgrent exists
9998 set setgrent d_setgrent
10001 : see if sethostent exists
10002 set sethostent d_sethent
10005 : see if setlinebuf exists
10006 set setlinebuf d_setlinebuf
10009 : see if setlocale exists
10010 set setlocale d_setlocale
10013 : see if setnetent exists
10014 set setnetent d_setnent
10017 : see if setprotoent exists
10018 set setprotoent d_setpent
10021 : see if setpgid exists
10022 set setpgid d_setpgid
10025 : see if setpgrp2 exists
10026 set setpgrp2 d_setpgrp2
10029 : see if setpriority exists
10030 set setpriority d_setprior
10033 : see if setpwent exists
10034 set setpwent d_setpwent
10037 : see if setregid exists
10038 set setregid d_setregid
10040 set setresgid d_setresgid
10043 : see if setreuid exists
10044 set setreuid d_setreuid
10046 set setresuid d_setresuid
10049 : see if setrgid exists
10050 set setrgid d_setrgid
10053 : see if setruid exists
10054 set setruid d_setruid
10057 : see if setservent exists
10058 set setservent d_setsent
10061 : see if setsid exists
10062 set setsid d_setsid
10065 : see if setspent exists
10066 set setspent d_setspent
10069 : see if setvbuf exists
10070 set setvbuf d_setvbuf
10073 : see if sfio.h is available
10078 : see if sfio library is available
10089 : Ok, but do we want to use it.
10093 true|$define|[yY]*) dflt='y';;
10096 echo "$package can use the sfio library, but it is experimental."
10097 rp="You seem to have sfio available, do you want to try using it?"
10101 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10103 : Remove sfio from list of libraries to use
10104 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10107 echo "libs = $libs" >&4
10111 *) case "$usesfio" in
10112 true|$define|[yY]*)
10113 echo "Sorry, cannot find sfio on this machine" >&4
10114 echo "Ignoring your setting of usesfio=$usesfio" >&4
10122 $define) usesfio='true';;
10123 *) usesfio='false';;
10126 : see if shmctl exists
10127 set shmctl d_shmctl
10130 : see if shmget exists
10131 set shmget d_shmget
10134 : see if shmat exists
10137 : see what shmat returns
10140 $cat >shmat.c <<'END'
10141 #include <sys/shm.h>
10144 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10149 echo "and it returns ($shmattype)." >&4
10150 : see if a prototype for shmat is available
10151 xxx=`./findhdr sys/shm.h`
10152 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10153 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10164 set d_shmatprototype
10167 : see if shmdt exists
10171 : see how much of the 'shm*(2)' library is present.
10174 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10175 *"$undef"*) h_shm=false;;
10179 case "`ipcs 2>&1`" in
10180 "SVID shared memory"*"not configured"*)
10181 echo "Your $osname does not have the shm*(2) configured." >&4
10184 set shmctl d_shmctl
10186 set shmget d_shmget
10196 : we could also check for sys/ipc.h ...
10197 if $h_shm && $test `./findhdr sys/shm.h`; then
10198 echo "You have the full shm*(2) library." >&4
10201 echo "You don't have the full shm*(2) library." >&4
10208 : see if we have sigaction
10209 if set sigaction val -f d_sigaction; eval $csym; $val; then
10210 echo 'sigaction() found.' >&4
10211 $cat > try.c <<'EOP'
10213 #include <sys/types.h>
10214 #include <signal.h>
10217 struct sigaction act, oact;
10219 oact.sa_handler = 0;
10223 if eval $compile_ok; then
10226 echo "But you don't seem to have a useable struct sigaction." >&4
10230 echo 'sigaction NOT found.' >&4
10233 set d_sigaction; eval $setvar
10234 $rm -f try try$_o try.c
10236 : see if sigsetjmp exists
10238 case "$d_sigsetjmp" in
10240 $cat >try.c <<'EOP'
10241 #include <setjmp.h>
10246 if (sigsetjmp(env,1))
10249 siglongjmp(env, 1);
10254 if eval $compile; then
10255 if ./try >/dev/null 2>&1; then
10256 echo "POSIX sigsetjmp found." >&4
10260 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10266 echo "sigsetjmp not found." >&4
10270 *) val="$d_sigsetjmp"
10271 case "$d_sigsetjmp" in
10272 $define) echo "POSIX sigsetjmp found." >&4;;
10273 $undef) echo "sigsetjmp not found." >&4;;
10281 : see if sys/stat.h is available
10282 set sys/stat.h i_sysstat
10285 : see if stat knows about block sizes
10287 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10290 : see if _ptr and _cnt from stdio act std
10292 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10293 echo "(Looks like you have stdio.h from Linux.)"
10294 case "$stdio_ptr" in
10295 '') stdio_ptr='((fp)->_IO_read_ptr)'
10298 *) ptr_lval=$d_stdio_ptr_lval;;
10300 case "$stdio_cnt" in
10301 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10304 *) cnt_lval=$d_stdio_cnt_lval;;
10306 case "$stdio_base" in
10307 '') stdio_base='((fp)->_IO_read_base)';;
10309 case "$stdio_bufsiz" in
10310 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10313 case "$stdio_ptr" in
10314 '') stdio_ptr='((fp)->_ptr)'
10317 *) ptr_lval=$d_stdio_ptr_lval;;
10319 case "$stdio_cnt" in
10320 '') stdio_cnt='((fp)->_cnt)'
10323 *) cnt_lval=$d_stdio_cnt_lval;;
10325 case "$stdio_base" in
10326 '') stdio_base='((fp)->_base)';;
10328 case "$stdio_bufsiz" in
10329 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10332 : test whether _ptr and _cnt really work
10333 echo "Checking how std your stdio is..." >&4
10336 #define FILE_ptr(fp) $stdio_ptr
10337 #define FILE_cnt(fp) $stdio_cnt
10339 FILE *fp = fopen("try.c", "r");
10342 18 <= FILE_cnt(fp) &&
10343 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10351 if eval $compile; then
10353 echo "Your stdio acts pretty std."
10356 echo "Your stdio isn't very std."
10359 echo "Your stdio doesn't appear very std."
10365 : Can _ptr be used as an lvalue?
10366 case "$d_stdstdio$ptr_lval" in
10367 $define$define) val=$define ;;
10370 set d_stdio_ptr_lval
10373 : Can _cnt be used as an lvalue?
10374 case "$d_stdstdio$cnt_lval" in
10375 $define$define) val=$define ;;
10378 set d_stdio_cnt_lval
10381 : see if _base is also standard
10383 case "$d_stdstdio" in
10387 #define FILE_base(fp) $stdio_base
10388 #define FILE_bufsiz(fp) $stdio_bufsiz
10390 FILE *fp = fopen("try.c", "r");
10393 19 <= FILE_bufsiz(fp) &&
10394 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10401 if eval $compile; then
10403 echo "And its _base field acts std."
10406 echo "But its _base field isn't std."
10409 echo "However, it seems to be lacking the _base field."
10418 Checking how to access stdio streams by file descriptor number...
10420 case "$stdio_stream_array" in
10421 '') $cat >try.c <<EOCP
10424 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10428 for s in _iob __iob __sF
10430 set try -DSTDIO_STREAM_ARRAY=$s
10431 if eval $compile; then
10432 case "`./try$exe_ext`" in
10433 yes) stdio_stream_array=$s; break ;;
10437 $rm -f try.* try$exe_ext
10439 case "$stdio_stream_array" in
10441 I can't figure out how to access stdio streams by file descriptor number.
10443 d_stdio_stream_array="$undef"
10446 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10448 d_stdio_stream_array="$define"
10452 : see if strcoll exists
10453 set strcoll d_strcoll
10456 : check for structure copying
10458 echo "Checking to see if your C compiler can copy structs..." >&4
10459 $cat >try.c <<'EOCP'
10469 if $cc -c try.c >/dev/null 2>&1 ; then
10471 echo "Yup, it can."
10474 echo "Nope, it can't."
10480 : see if strerror and/or sys_errlist[] exist
10482 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10483 if set strerror val -f d_strerror; eval $csym; $val; then
10484 echo 'strerror() found.' >&4
10485 d_strerror="$define"
10486 d_strerrm='strerror(e)'
10487 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10488 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10489 d_syserrlst="$define"
10491 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10492 d_syserrlst="$undef"
10494 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10495 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10496 echo 'strerror() found in string header.' >&4
10497 d_strerror="$define"
10498 d_strerrm='strerror(e)'
10499 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10500 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10501 d_syserrlst="$define"
10503 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10504 d_syserrlst="$undef"
10506 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10507 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10508 d_strerror="$undef"
10509 d_syserrlst="$define"
10510 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10512 echo 'strerror() and sys_errlist[] NOT found.' >&4
10513 d_strerror="$undef"
10514 d_syserrlst="$undef"
10515 d_strerrm='"unknown"'
10519 : see if strtod exists
10520 set strtod d_strtod
10523 : see if strtol exists
10524 set strtol d_strtol
10527 : see if strtoul exists
10528 set strtoul d_strtoul
10531 : see if strtoull exists
10532 set strtoull d_strtoull
10535 : see if strxfrm exists
10536 set strxfrm d_strxfrm
10539 : see if symlink exists
10540 set symlink d_symlink
10543 : see if syscall exists
10544 set syscall d_syscall
10547 : see if sysconf exists
10548 set sysconf d_sysconf
10551 : see if system exists
10552 set system d_system
10555 : see if tcgetpgrp exists
10556 set tcgetpgrp d_tcgetpgrp
10559 : see if tcsetpgrp exists
10560 set tcsetpgrp d_tcsetpgrp
10563 : see if sys/types.h has to be included
10564 set sys/types.h i_systypes
10567 : see if prototype for telldir is available
10569 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10572 : define an is-a-typedef? function
10573 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10575 "") inclist="sys/types.h";;
10577 eval "varval=\$$var";
10581 for inc in $inclist; do
10582 echo "#include <$inc>" >>temp.c;
10584 echo "#ifdef $type" >> temp.c;
10585 echo "printf(\"We have $type\");" >> temp.c;
10586 echo "#endif" >> temp.c;
10587 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10588 if $contains $type temp.E >/dev/null 2>&1; then
10589 eval "$var=\$type";
10594 *) eval "$var=\$varval";;
10597 : define an is-a-typedef? function that prompts if the type is not available.
10598 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10600 "") inclist="sys/types.h";;
10602 eval "varval=\$$var";
10606 for inc in $inclist; do
10607 echo "#include <$inc>" >>temp.c;
10609 echo "#ifdef $type" >> temp.c;
10610 echo "printf(\"We have $type\");" >> temp.c;
10611 echo "#endif" >> temp.c;
10612 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10614 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10615 if $contains $type temp.E >/dev/null 2>&1; then
10616 echo "$type found." >&4;
10617 eval "$var=\$type";
10619 echo "$type NOT found." >&4;
10625 *) eval "$var=\$varval";;
10628 : see if this is a sys/times.h system
10629 set sys/times.h i_systimes
10632 : see if times exists
10634 if set times val -f d_times; eval $csym; $val; then
10635 echo 'times() found.' >&4
10638 case "$i_systimes" in
10639 "$define") inc='sys/times.h';;
10641 rp="What is the type returned by times() on this system?"
10642 set clock_t clocktype long stdio.h sys/types.h $inc
10645 echo 'times() NOT found, hope that will do.' >&4
10650 : see if truncate exists
10651 set truncate d_truncate
10654 : see if tzname[] exists
10656 if set tzname val -a d_tzname; eval $csym; $val; then
10658 echo 'tzname[] found.' >&4
10661 echo 'tzname[] NOT found.' >&4
10666 : see if umask exists
10670 : backward compatibility for d_hvfork
10671 if test X$d_hvfork != X; then
10672 d_vfork="$d_hvfork"
10675 : see if there is a vfork
10680 : Ok, but do we want to use it. vfork is reportedly unreliable in
10681 : perl on Solaris 2.x, and probably elsewhere.
10685 case "$usevfork" in
10691 Perl can only use a vfork() that doesn't suffer from strict
10692 restrictions on calling functions or modifying global data in
10693 the child. For example, glibc-2.1 contains such a vfork()
10694 that is unsuitable. If your system provides a proper fork()
10695 call, chances are that you do NOT want perl to use vfork().
10698 rp="Do you still want to use vfork()?"
10703 echo "Ok, we won't use vfork()."
10712 $define) usevfork='true';;
10713 *) usevfork='false';;
10716 : see if this is an sysdir system
10717 set sys/dir.h i_sysdir
10720 : see if this is an sysndir system
10721 set sys/ndir.h i_sysndir
10724 : see if closedir exists
10725 set closedir d_closedir
10728 case "$d_closedir" in
10731 echo "Checking whether closedir() returns a status..." >&4
10732 cat > closedir.c <<EOM
10733 #$i_dirent I_DIRENT /**/
10734 #$i_sysdir I_SYS_DIR /**/
10735 #$i_sysndir I_SYS_NDIR /**/
10736 #$i_systypes I_SYS_TYPES /**/
10738 #if defined(I_SYS_TYPES)
10739 #include <sys/types.h>
10741 #if defined(I_DIRENT)
10742 #include <dirent.h>
10743 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10744 #include <sys/dir.h>
10748 #include <sys/ndir.h>
10752 #include <ndir.h> /* may be wrong in the future */
10754 #include <sys/dir.h>
10759 int main() { return closedir(opendir(".")); }
10762 if eval $compile_ok; then
10763 if ./closedir > /dev/null 2>&1 ; then
10764 echo "Yes, it does."
10767 echo "No, it doesn't."
10771 echo "(I can't seem to compile the test program--assuming it doesn't)"
10779 set d_void_closedir
10782 : check for volatile keyword
10784 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10785 $cat >try.c <<'EOCP'
10788 typedef struct _goo_struct goo_struct;
10789 goo_struct * volatile goo = ((goo_struct *)0);
10790 struct _goo_struct {
10795 typedef unsigned short foo_t;
10796 char *volatile foo;
10798 volatile foo_t blech;
10802 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10804 echo "Yup, it does."
10807 echo "Nope, it doesn't."
10813 : see if there is a wait4
10817 : see if waitpid exists
10818 set waitpid d_waitpid
10821 : see if wcstombs exists
10822 set wcstombs d_wcstombs
10825 : see if wctomb exists
10826 set wctomb d_wctomb
10829 : see if writev exists
10830 set writev d_writev
10833 : preserve RCS keywords in files with variable substitution, grrr
10838 Revision='$Revision'
10840 case "$crosscompile" in
10841 ''|[nN]*) crosscompile="$undef" ;;
10845 next|rhapsody) multiarch="$define" ;;
10847 case "$multiarch" in
10848 ''|[nN]*) multiarch="$undef" ;;
10851 : check for alignment requirements
10853 case "$crosscompile$multiarch" in
10856 You seem to be either cross-compiling or doing a multiarchitecture build,
10857 skipping the memory alignment check.
10860 case "$alignbytes" in
10861 '') alignbytes=8 ;;
10865 case "$alignbytes" in
10866 '') echo "Checking alignment constraints..." >&4
10867 $cat >try.c <<'EOCP'
10874 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10878 if eval $compile_ok; then
10882 echo "(I can't seem to compile the test program...)"
10885 *) dflt="$alignbytes"
10888 rp="Doubles must be aligned on a how-many-byte boundary?"
10896 : check for ordering of bytes in a long
10898 case "$crosscompile$multiarch" in
10901 You seem to be either cross-compiling or doing a multiarchitecture build,
10902 skipping the byteorder check.
10908 case "$byteorder" in
10911 In the following, larger digits indicate more significance. A big-endian
10912 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10913 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10914 machines may have weird orders like 3412. A Cray will report 87654321,
10915 an Alpha will report 12345678. If the test program works the default is
10917 I'm now running the test program...
10919 $cat >try.c <<'EOCP'
10926 char c[sizeof(long)];
10929 if (sizeof(long) > 4)
10930 u.l = (0x08070605L << 32) | 0x04030201L;
10933 for (i = 0; i < sizeof(long); i++)
10934 printf("%c", u.c[i]+'0');
10941 if eval $compile && ./try > /dev/null; then
10944 [1-4][1-4][1-4][1-4]|12345678|87654321)
10945 echo "(The test program ran ok.)"
10946 echo "byteorder=$dflt"
10949 ????|????????) echo "(The test program ran ok.)" ;;
10950 *) echo "(The test program didn't run right for some reason.)" ;;
10955 (I can't seem to compile the test program. Guessing big-endian...)
10958 case "$xxx_prompt" in
10960 rp="What is the order of bytes in a long?"
10974 : how do we catenate cpp tokens here?
10976 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
10977 $cat >cpp_stuff.c <<'EOCP'
10978 #define RCAT(a,b)a/**/b
10979 #define ACAT(a,b)a ## b
10983 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
10984 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
10985 echo "Oh! Smells like ANSI's been here." >&4
10986 echo "We can catify or stringify, separately or together!"
10988 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
10989 echo "Ah, yes! The good old days!" >&4
10990 echo "However, in the good old days we don't know how to stringify and"
10991 echo "catify at the same time."
10995 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
10996 to have to edit the values of CAT[2-5] in config.h...
10998 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11002 : see if this is a db.h system
11008 : Check db version.
11010 echo "Checking Berkeley DB version ..." >&4
11016 #include <sys/types.h>
11021 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11022 int Major, Minor, Patch ;
11023 unsigned long Version ;
11024 (void)db_version(&Major, &Minor, &Patch) ;
11025 printf("You have Berkeley DB Version 2 or greater\n");
11027 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11028 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11029 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11030 Major, Minor, Patch) ;
11032 /* check that db.h & libdb are compatible */
11033 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11034 printf("db.h and libdb are incompatible\n") ;
11038 printf("db.h and libdb are compatible\n") ;
11040 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11041 + DB_VERSION_PATCH ;
11043 /* needs to be >= 2.3.4 */
11044 if (Version < 2003004) {
11045 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11046 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11052 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11053 printf("You have Berkeley DB Version 1\n");
11054 exit(0); /* DB version < 2: the coast is clear. */
11056 exit(1); /* <db.h> not Berkeley DB? */
11062 if eval $compile && ./try; then
11063 echo 'Looks OK.' >&4
11065 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11069 : Remove db from list of libraries to use
11070 echo "Removing unusable -ldb from library list" >&4
11071 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11074 echo "libs = $libs" >&4
11084 : Check the return type needed for hash
11086 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11092 #include <sys/types.h>
11095 #ifndef DB_VERSION_MAJOR
11096 u_int32_t hash_cb (ptr, size)
11104 info.hash = hash_cb;
11108 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11109 if $contains warning try.out >>/dev/null 2>&1 ; then
11112 db_hashtype='u_int32_t'
11115 : XXX Maybe we should just give up here.
11116 db_hashtype=u_int32_t
11118 echo "Help: I can't seem to compile the db test program." >&4
11119 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11122 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11124 *) db_hashtype=u_int32_t
11129 : Check the return type needed for prefix
11131 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11137 #include <sys/types.h>
11140 #ifndef DB_VERSION_MAJOR
11141 size_t prefix_cb (key1, key2)
11149 info.prefix = prefix_cb;
11153 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11154 if $contains warning try.out >>/dev/null 2>&1 ; then
11155 db_prefixtype='int'
11157 db_prefixtype='size_t'
11160 db_prefixtype='size_t'
11161 : XXX Maybe we should just give up here.
11163 echo "Help: I can't seem to compile the db test program." >&4
11164 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11167 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11169 *) db_prefixtype='size_t'
11173 : check for void type
11175 echo "Checking to see how well your C compiler groks the void type..." >&4
11176 case "$voidflags" in
11178 $cat >try.c <<'EOCP'
11184 extern void moo(); /* function returning void */
11185 void (*goo)(); /* ptr to func returning void */
11187 void *hue; /* generic ptr */
11200 int main() { sub(); }
11202 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11203 voidflags=$defvoidused
11204 echo "Good. It appears to support void to the level $package wants.">&4
11205 if $contains warning .out >/dev/null 2>&1; then
11206 echo "However, you might get some warnings that look like this:"
11210 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11211 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11212 echo "It supports 1..."
11213 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11214 echo "It also supports 2..."
11215 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11217 echo "And it supports 4 but not 8 definitely."
11219 echo "It doesn't support 4..."
11220 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11222 echo "But it supports 8."
11225 echo "Neither does it support 8."
11229 echo "It does not support 2..."
11230 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11232 echo "But it supports 4 and 8."
11234 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11236 echo "And it supports 4 but has not heard about 8."
11238 echo "However it supports 8 but not 4."
11243 echo "There is no support at all for void."
11248 case "$voidflags" in
11250 *) $cat >&4 <<'EOM'
11251 Support flag bits are:
11252 1: basic void declarations.
11253 2: arrays of pointers to functions returning void.
11254 4: operations between pointers to and addresses of void functions.
11255 8: generic void pointers.
11258 rp="Your void support flags add up to what?"
11266 : How can we generate normalized random numbers ?
11268 echo "Looking for a random number function..." >&4
11269 case "$randfunc" in
11271 if set drand48 val -f; eval $csym; $val; then
11273 echo "Good, found drand48()." >&4
11274 elif set random val -f; eval $csym; $val; then
11276 echo "OK, found random()." >&4
11279 echo "Yick, looks like I have to use rand()." >&4
11290 *-Dmy_rand=*|*-Dmy_srand=*)
11291 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11292 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11293 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11294 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11298 while $test "$cont"; do
11299 rp="Use which function to generate random numbers?"
11301 if $test "$ans" = "$dflt"; then
11307 if set $ans val -f; eval $csym; $val; then
11311 rp="I cannot find function $ans. Use that name anyway?"
11320 case "$randfunc" in
11322 drand01="drand48()"
11328 case "$randbits" in
11330 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11332 #$i_unistd I_UNISTD
11333 #$i_stdlib I_STDLIB
11336 # include <unistd.h>
11339 # include <stdlib.h>
11344 register unsigned long tmp;
11345 register unsigned long max = 0L;
11347 for (i = 1000; i; i--) {
11348 tmp = (unsigned long) $randfunc();
11349 if (tmp > max) max = tmp;
11351 for (i = 0; max; i++)
11357 if eval $compile_ok; then
11361 echo "(I can't seem to compile the test program...)"
11368 rp="How many bits does your $randfunc() function produce?"
11372 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11373 seedfunc="s$randfunc"
11374 randseedtype=unsigned
11378 rp="How many bits does your $randfunc() function produce?"
11381 seedfunc="s$randfunc"
11382 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11383 if set $seedfunc val -f; eval $csym; $val; then
11384 echo "(Using $seedfunc() to seed random generator)"
11386 echo "(Warning: no $seedfunc() to seed random generator)"
11389 randseedtype=unsigned
11397 echo "Determining whether or not we are on an EBCDIC system..." >&4
11398 $cat >tebcdic.c <<'EOM'
11401 if ('M'==0xd4) return 0;
11408 if eval $compile_ok; then
11410 echo "You have EBCDIC." >&4
11413 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin, or UTF." >&4
11416 echo "I'm unable to compile the test program." >&4
11417 echo "I'll assume ASCII or some ISO Latin." >&4
11419 $rm -f tebcdic.c tebcdic
11425 Checking how to flush all pending stdio output...
11427 # I only know how to find the first 32 possibly open files on SunOS.
11428 # See also hints/sunos_4_1.sh and util.c --AD
11430 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11432 $cat >>try.c <<EOCP
11434 #$i_unistd I_UNISTD
11436 # include <unistd.h>
11438 #$d_sysconf HAS_SYSCONF
11439 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11440 #ifdef HAS_STDIO_STREAM_ARRAY
11441 # define STDIO_STREAM_ARRAY $stdio_stream_array
11444 FILE* p = fopen("try.out", "w");
11448 # ifdef TRY_FPRINTF
11452 #ifdef TRY_FFLUSH_NULL
11455 #ifdef TRY_FFLUSH_ALL
11457 long open_max = -1;
11458 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11459 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11461 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11462 open_max = sysconf(_SC_OPEN_MAX);
11465 open_max = FOPEN_MAX;
11468 open_max = OPEN_MAX;
11477 # ifdef HAS_STDIO_STREAM_ARRAY
11478 if (open_max > 0) {
11480 for (i = 0; i < open_max; i++)
11481 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11482 STDIO_STREAM_ARRAY[i]._file < open_max &&
11483 STDIO_STREAM_ARRAY[i]._flag)
11484 fflush(&STDIO_STREAM_ARRAY[i]);
11492 : first we have to find out how _not_ to flush
11493 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11495 set try -DTRY_FPUTC
11496 if eval $compile; then
11498 ./try$exe_ext 2>/dev/null
11499 if $test ! -s try.out -a "X$?" = X42; then
11505 set try -DTRY_FPRINTF
11507 if eval $compile; then
11509 ./try$exe_ext 2>/dev/null
11510 if $test ! -s try.out -a "X$?" = X42; then
11511 output=-DTRY_FPRINTF
11517 : check for fflush NULL behaviour
11518 case "$fflushNULL" in
11519 '') set try -DTRY_FFLUSH_NULL $output
11520 if eval $compile; then
11522 ./try$exe_ext 2>/dev/null
11524 if $test -s try.out -a "X$code" = X42; then
11525 fflushNULL="`$cat try.out`"
11527 if $test "X$code" != X42; then
11529 (If this test failed, don't worry, we'll try another method shortly.)
11534 $rm -f core try.core core.try.*
11535 case "$fflushNULL" in
11537 Your fflush(NULL) works okay.
11539 fflushNULL="$define"
11542 Your fflush(NULL) isn't working (contrary to ANSI C).
11544 fflushNULL="$undef"
11547 Cannot figure out whether your fflush(NULL) works or not.
11548 I'm assuming it doesn't (contrary to ANSI C).
11550 fflushNULL="$undef"
11554 $define|true|[yY]*)
11555 fflushNULL="$define"
11558 fflushNULL="$undef"
11561 : check explicit looping only if NULL did not work
11562 case "$fflushNULL" in
11564 : check for fflush all behaviour
11565 case "$fflushall" in
11566 '') set try -DTRY_FFLUSH_ALL $output
11567 if eval $compile; then
11569 (Now testing the other method--but note that also this may fail.)
11572 ./try$exe_ext 2>/dev/null
11573 if $test -s try.out -a "X$?" = X42; then
11574 fflushall="`$cat try.out`"
11577 $rm -f core try.core core.try.*
11578 case "$fflushall" in
11580 Whew. Flushing explicitly all the stdio streams works.
11582 fflushall="$define"
11585 Sigh. Flushing explicitly all the stdio streams doesn't work.
11590 Cannot figure out whether flushing stdio streams explicitly works or not.
11591 I'm assuming it doesn't.
11597 "$define"|true|[yY]*)
11598 fflushall="$define"
11605 *) fflushall="$undef"
11608 case "$fflushNULL$fflushall" in
11611 I cannot figure out how to flush pending stdio output.
11615 $rm -f try.* try$exe_ext
11617 : see what type file positions are declared as in the library
11618 rp="What is the type for file position used by fsetpos()?"
11619 set fpos_t fpostype long stdio.h sys/types.h
11622 : Store the full pathname to the ar program for use in the C program
11623 : Respect a hint or command line value for full_ar.
11628 : Store the full pathname to the sed program for use in the C program
11631 : see what type gids are declared as in the kernel
11633 echo "Looking for the type for group ids returned by getgid()."
11634 set gid_t gidtype xxx stdio.h sys/types.h
11638 xxx=`./findhdr sys/user.h`
11639 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11641 unsigned) dflt="$1 $2" ;;
11645 *) dflt="$gidtype";;
11648 gid_t) echo "gid_t found." ;;
11649 *) rp="What is the type for group ids returned by getgid()?"
11655 : see if getgroups exists
11656 set getgroups d_getgrps
11659 : see if setgroups exists
11660 set setgroups d_setgrps
11664 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11666 case "$d_getgrps$d_setgrps" in
11668 case "$groupstype" in
11669 '') dflt="$gidtype" ;;
11670 *) dflt="$groupstype" ;;
11673 What type of pointer is the second argument to getgroups() and setgroups()?
11674 Usually this is the same as group ids, $gidtype, but not always.
11677 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11681 *) groupstype="$gidtype";;
11684 : see what type lseek is declared as in the kernel
11685 rp="What is the type used for lseek's offset on this system?"
11686 set off_t lseektype long stdio.h sys/types.h
11690 $echo $n "Checking to see how big your file offsets are...$c" >&4
11692 #include <sys/types.h>
11696 printf("%d\n", sizeof($lseektype));
11700 if eval $compile_ok; then
11702 $echo " $lseeksize bytes." >&4
11706 echo "(I can't seem to compile the test program. Guessing...)"
11707 rp="What is the size of your file offsets (in bytes)?"
11714 echo "Checking if your $make program sets \$(MAKE)..." >&4
11715 case "$make_set_make" in
11717 $sed 's/^X //' > testmake.mak << 'EOF'
11719 X @echo 'maketemp="$(MAKE)"'
11721 case "`$make -f testmake.mak 2>/dev/null`" in
11722 *maketemp=*) make_set_make='#' ;;
11723 *) make_set_make="MAKE=$make" ;;
11725 $rm -f testmake.mak
11728 case "$make_set_make" in
11729 '#') echo "Yup, it does.";;
11730 *) echo "Nope, it doesn't.";;
11733 : see what type is used for mode_t
11734 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11735 set mode_t modetype int stdio.h sys/types.h
11738 : define a fucntion to check prototypes
11739 $cat > protochk <<EOSH
11742 optimize="$optimize"
11744 prototype="$prototype"
11749 $cat >> protochk <<'EOSH'
11754 while test $# -ge 2; do
11756 $define) echo "#include <$2>" >> try.c ;;
11757 literal) echo "$2" >> try.c ;;
11761 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11762 cat >> try.c <<'EOCP'
11763 #ifdef CAN_PROTOTYPE
11764 #define _(args) args
11769 echo "$foo" >> try.c
11770 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11771 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11777 $eunicefix protochk
11779 : see what type is used for size_t
11780 rp="What is the type used for the length parameter for string functions?"
11781 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11784 : check for type of arguments to gethostbyaddr.
11785 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11786 case "$d_gethbyaddr" in
11790 Checking to see what type of arguments are accepted by gethostbyaddr().
11792 hdrs="$define sys/types.h
11793 $d_socket sys/socket.h
11794 $i_niin netinet/in.h
11796 $i_unistd unistd.h"
11797 : The first arg can 'char *' or 'void *'
11798 : The second arg is some of integral type
11799 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11800 for yyy in size_t long int; do
11801 case "$netdb_host_type" in
11802 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11803 if ./protochk "$try" $hdrs; then
11804 echo "Your system accepts $xxx for the first arg."
11805 echo "...and $yyy for the second arg."
11806 netdb_host_type="$xxx"
11807 netdb_hlen_type="$yyy"
11813 : In case none of those worked, prompt the user.
11814 case "$netdb_host_type" in
11815 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11818 netdb_host_type=$ans
11819 rp='What is the type for the 2nd argument to gethostbyaddr?'
11822 netdb_hlen_type=$ans
11826 *) : no gethostbyaddr, so pick harmless defaults
11827 netdb_host_type='char *'
11828 netdb_hlen_type="$sizetype"
11831 # Remove the "const" if needed. -- but then we'll have a
11833 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11836 : check for type of argument to gethostbyname.
11837 if test "X$netdb_name_type" = X ; then
11838 case "$d_gethbyname" in
11842 Checking to see what type of argument is accepted by gethostbyname().
11844 hdrs="$define sys/types.h
11845 $d_socket sys/socket.h
11846 $i_niin netinet/in.h
11848 $i_unistd unistd.h"
11849 for xxx in "const char *" "char *"; do
11850 case "$netdb_name_type" in
11851 '') try="extern struct hostent *gethostbyname($xxx);"
11852 if ./protochk "$try" $hdrs; then
11853 echo "Your system accepts $xxx."
11854 netdb_name_type="$xxx"
11859 : In case none of those worked, prompt the user.
11860 case "$netdb_name_type" in
11861 '') rp='What is the type for the 1st argument to gethostbyname?'
11864 netdb_name_type=$ans
11868 *) : no gethostbyname, so pick harmless default
11869 netdb_name_type='char *'
11874 : check for type of 1st argument to getnetbyaddr.
11875 if test "X$netdb_net_type" = X ; then
11876 case "$d_getnbyaddr" in
11880 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11882 hdrs="$define sys/types.h
11883 $d_socket sys/socket.h
11884 $i_niin netinet/in.h
11886 $i_unistd unistd.h"
11887 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11888 case "$netdb_net_type" in
11889 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11890 if ./protochk "$try" $hdrs; then
11891 echo "Your system accepts $xxx."
11892 netdb_net_type="$xxx"
11897 : In case none of those worked, prompt the user.
11898 case "$netdb_net_type" in
11899 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11902 netdb_net_type=$ans
11906 *) : no getnetbyaddr, so pick harmless default
11907 netdb_net_type='long'
11911 : locate the preferred pager for this system
11925 '') dflt=/usr/ucb/more;;
11932 rp='What pager is used on your system?'
11936 : see what type pids are declared as in the kernel
11937 rp="What is the type of process ids on this system?"
11938 set pid_t pidtype int stdio.h sys/types.h
11941 : check for length of pointer
11945 $echo $n "Checking to see how big your pointers are...$c" >&4
11946 if test "$voidflags" -gt 7; then
11947 echo '#define VOID_PTR char *' > try.c
11949 echo '#define VOID_PTR void *' > try.c
11951 $cat >>try.c <<'EOCP'
11955 printf("%d\n", sizeof(VOID_PTR));
11960 if eval $compile_ok; then
11962 $echo " $ptrsize bytes." >&4
11965 echo "(I can't seem to compile the test program. Guessing...)" >&4
11966 rp="What is the size of a pointer (in bytes)?"
11974 : see if ar generates random libraries by itself
11976 echo "Checking how to generate random libraries on your machine..." >&4
11977 echo 'int bar1() { return bar2(); }' > bar1.c
11978 echo 'int bar2() { return 2; }' > bar2.c
11979 $cat > foo.c <<'EOP'
11980 int main() { printf("%d\n", bar1()); exit(0); }
11982 $cc $ccflags -c bar1.c >/dev/null 2>&1
11983 $cc $ccflags -c bar2.c >/dev/null 2>&1
11984 $cc $ccflags -c foo.c >/dev/null 2>&1
11985 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
11986 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11987 ./foobar >/dev/null 2>&1; then
11988 echo "$ar appears to generate random libraries itself."
11991 elif $ar ts bar$_a >/dev/null 2>&1 &&
11992 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11993 ./foobar >/dev/null 2>&1; then
11994 echo "a table of contents needs to be added with '$ar ts'."
12001 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12002 $test -f $ranlib || ranlib=''
12005 if $test -n "$ranlib"; then
12006 echo "your system has '$ranlib'; we'll use that."
12009 echo "your system doesn't seem to support random libraries"
12010 echo "so we'll use lorder and tsort to order the libraries."
12017 : check for type of arguments to select.
12018 case "$selecttype" in
12019 '') case "$d_select" in
12022 Checking to see what type of arguments are accepted by select().
12024 hdrs="$define sys/types.h
12025 $i_systime sys/time.h
12026 $i_sysselct sys/select.h
12027 $d_socket sys/socket.h"
12028 : The first arg can be int, unsigned, or size_t
12029 : The last arg may or may not be 'const'
12031 : void pointer has been seen but using that
12032 : breaks the selectminbits test
12033 for xxx in 'fd_set *' 'int *'; do
12034 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12035 for tmo in 'struct timeval *' 'const struct timeval *'; do
12037 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12038 if ./protochk "$try" $hdrs; then
12039 echo "Your system accepts $xxx."
12048 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12049 case "$d_fd_set" in
12050 $define) dflt="fd_set *" ;;
12059 *) : no select, so pick a harmless default
12066 : check for the select 'width'
12067 case "$selectminbits" in
12068 '') case "$d_select" in
12072 Checking to see on how many bits at a time your select() operates...
12075 #include <sys/types.h>
12077 #$i_systime I_SYS_TIME
12078 #$i_systimek I_SYS_TIME_KERNEL
12083 # ifdef I_SYS_TIME_KERNEL
12086 # include <sys/time.h>
12087 # ifdef I_SYS_TIME_KERNEL
12091 #$i_sysselct I_SYS_SELECT
12092 #ifdef I_SYS_SELECT
12093 #include <sys/select.h>
12095 #$d_socket HAS_SOCKET
12097 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12101 #define S sizeof(*(b))
12103 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12104 #define NBITS (NBYTES * 8)
12113 fp = fopen("try.c", "r");
12119 b = ($selecttype)s;
12120 for (i = 0; i < NBITS; i++)
12124 select(fd + 1, b, 0, 0, &t);
12125 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12126 printf("%d\n", i + 1);
12131 if eval $compile_ok; then
12132 selectminbits=`./try`
12133 case "$selectminbits" in
12135 Cannot figure out on how many bits at a time your select() operates.
12136 I'll play safe and guess it is 32 bits.
12142 *) bits="$selectminbits bits" ;;
12144 echo "Your select() operates on $bits at a time." >&4
12146 rp='What is the minimum number of bits your select() operates on?'
12147 case "$byteorder" in
12148 1234|12345678) dflt=32 ;;
12153 selectminbits="$val"
12157 *) : no select, so pick a harmless default
12164 : Trace out the files included by signal.h, then look for SIGxxx names.
12165 : Remove SIGARRAYSIZE used by HPUX.
12166 : Remove SIGSTKSIZE used by Linux.
12167 : Remove SIGSTKSZ used by Posix.
12168 : Remove SIGTYP void lines used by OS2.
12169 xxx=`echo '#include <signal.h>' |
12170 $cppstdin $cppminus $cppflags 2>/dev/null |
12171 $grep '^[ ]*#.*include' |
12172 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12173 : Check this list of files to be sure we have parsed the cpp output ok.
12174 : This will also avoid potentially non-existent files, such
12177 for xx in $xxx /dev/null ; do
12178 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12180 : If we have found no files, at least try signal.h
12181 case "$xxxfiles" in
12182 '') xxxfiles=`./findhdr signal.h` ;;
12185 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12186 print substr($2, 4, 20)
12188 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12189 print substr($3, 4, 20)
12191 : Append some common names just in case the awk scan failed.
12192 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12193 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12194 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12195 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12196 : generate a few handy files for later
12197 $cat > signal.c <<'EOCP'
12198 #include <sys/types.h>
12199 #include <signal.h>
12203 /* Strange style to avoid deeply-nested #if/#else/#endif */
12206 # define NSIG (_NSIG)
12212 # define NSIG (SIGMAX+1)
12218 # define NSIG (SIG_MAX+1)
12224 # define NSIG (MAXSIG+1)
12230 # define NSIG (MAX_SIG+1)
12235 # ifdef SIGARRAYSIZE
12236 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12242 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12246 /* Default to some arbitrary number that's big enough to get most
12247 of the common signals.
12253 printf("NSIG %d\n", NSIG);
12259 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12261 printf "#ifdef SIG"; printf $1; printf "\n"
12262 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12263 printf $1; printf ");\n"
12267 printf "#endif /* JUST_NSIG */\n";
12271 $cat >signal.awk <<'EOP'
12272 BEGIN { ndups = 0 }
12273 $1 ~ /^NSIG$/ { nsig = $2 }
12274 ($1 !~ /^NSIG$/) && (NF == 2) {
12275 if ($2 > maxsig) { maxsig = $2 }
12276 if (sig_name[$2]) {
12277 dup_name[ndups] = $1
12278 dup_num[ndups] = $2
12290 printf("NSIG %d\n", nsig);
12291 for (n = 1; n < nsig; n++) {
12293 printf("%s %d\n", sig_name[n], sig_num[n])
12296 printf("NUM%d %d\n", n, n)
12299 for (n = 0; n < ndups; n++) {
12300 printf("%s %d\n", dup_name[n], dup_num[n])
12304 $cat >signal_cmd <<EOS
12306 if $test -s signal.lst; then
12307 echo "Using your existing signal.lst file"
12312 $cat >>signal_cmd <<'EOS'
12315 if eval $compile_ok; then
12316 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12318 echo "(I can't seem be able to compile the whole test program)" >&4
12319 echo "(I'll try it in little pieces.)" >&4
12320 set signal -DJUST_NSIG
12321 if eval $compile_ok; then
12322 ./signal$_exe > signal.nsg
12325 echo "I can't seem to figure out how many signals you have." >&4
12326 echo "Guessing 50." >&4
12327 echo 'NSIG 50' > signal.nsg
12329 : Now look at all the signal names, one at a time.
12330 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12331 $cat > signal.c <<EOCP
12332 #include <sys/types.h>
12333 #include <signal.h>
12336 printf("$xx %d\n", SIG${xx});
12341 if eval $compile; then
12342 echo "SIG${xx} found."
12343 ./signal$_exe >> signal.ls1
12345 echo "SIG${xx} NOT found."
12348 if $test -s signal.ls1; then
12349 $cat signal.nsg signal.ls1 |
12350 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12354 if $test -s signal.lst; then
12357 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12358 echo 'kill -l' >signal
12359 set X `csh -f <signal`
12363 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12365 echo $@ | $tr ' ' $trnl | \
12366 $awk '{ printf "%s %d\n", $1, ++s; }
12367 END { printf "NSIG %d\n", ++s }' >signal.lst
12369 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12371 chmod a+x signal_cmd
12372 $eunicefix signal_cmd
12374 : generate list of signal names
12376 case "$sig_name_init" in
12378 *) case "$sig_num_init" in
12379 ''|*,*) doinit=yes ;;
12384 echo "Generating a list of signal names and numbers..." >&4
12386 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12387 sig_name=`$awk 'BEGIN { printf "ZERO " }
12388 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12389 sig_num=`$awk 'BEGIN { printf "0 " }
12390 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12391 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12392 !/^NSIG/ { printf "\"%s\", ", $1 }
12393 END { printf "0\n" }' signal.lst`
12394 sig_num_init=`$awk 'BEGIN { printf "0, " }
12395 !/^NSIG/ { printf "%d, ", $2}
12396 END { printf "0\n"}' signal.lst`
12399 echo "The following $sig_count signals are available:"
12401 echo $sig_name | $awk \
12402 'BEGIN { linelen = 0 }
12404 for (i = 1; i <= NF; i++) {
12405 name = "SIG" $i " "
12406 linelen = linelen + length(name)
12407 if (linelen > 70) {
12409 linelen = length(name)
12415 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12417 : see what type is used for signed size_t
12418 set ssize_t ssizetype int stdio.h sys/types.h
12421 $cat > ssize.c <<EOM
12423 #include <sys/types.h>
12424 #define Size_t $sizetype
12425 #define SSize_t $dflt
12428 if (sizeof(Size_t) == sizeof(SSize_t))
12430 else if (sizeof(Size_t) == sizeof(int))
12439 if eval $compile_ok && ./ssize > /dev/null; then
12440 ssizetype=`./ssize`
12441 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12444 Help! I can't compile and run the ssize_t test program: please enlighten me!
12445 (This is probably a misconfiguration in your system or libraries, and
12446 you really ought to fix it. Still, I'll try anyway.)
12448 I need a type that is the same size as $sizetype, but is guaranteed to
12449 be signed. Common values are ssize_t, int and long.
12452 rp="What signed type is the same size as $sizetype?"
12456 $rm -f ssize ssize.*
12458 : see what type of char stdio uses.
12460 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12461 echo "Your stdio uses unsigned chars." >&4
12462 stdchar="unsigned char"
12464 echo "Your stdio uses signed chars." >&4
12468 : see if time exists
12470 if test "X$d_time" = X -o X"$timetype" = X; then
12471 if set time val -f d_time; eval $csym; $val; then
12472 echo 'time() found.' >&4
12474 rp="What is the type returned by time() on this system?"
12475 set time_t timetype long stdio.h sys/types.h
12478 echo 'time() not found, hope that will do.' >&4
12486 : see what type uids are declared as in the kernel
12488 echo "Looking for the type for user ids returned by getuid()."
12489 set uid_t uidtype xxx stdio.h sys/types.h
12493 xxx=`./findhdr sys/user.h`
12494 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12496 unsigned) dflt="$1 $2" ;;
12500 *) dflt="$uidtype";;
12503 uid_t) echo "uid_t found." ;;
12504 *) rp="What is the type for user ids returned by getuid()?"
12510 : see if dbm.h is available
12511 : see if dbmclose exists
12512 set dbmclose d_dbmclose
12515 case "$d_dbmclose" in
12525 *) set rpcsvc/dbm.h i_rpcsvcdbm
12530 *) echo "We won't be including <dbm.h>"
12540 : see if this is a sys/file.h system
12545 : do we need to include sys/file.h ?
12549 if $h_sysfile; then
12551 echo "We'll be including <sys/file.h>." >&4
12554 echo "We won't be including <sys/file.h>." >&4
12564 : see if fcntl.h is there
12569 : see if we can include fcntl.h
12575 echo "We'll be including <fcntl.h>." >&4
12578 if $h_sysfile; then
12579 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12581 echo "We won't be including <fcntl.h>." >&4
12593 : see if locale.h is available
12594 set locale.h i_locale
12597 : see if mach cthreads are available
12598 if test "X$usethreads" = "X$define"; then
12599 set mach/cthreads.h i_machcthr
12602 i_machcthr="$undef"
12607 : see if this is a math.h system
12611 : see if this is a mntent.h system
12612 set mntent.h i_mntent
12615 : see if ndbm.h is available
12620 : see if dbm_open exists
12621 set dbm_open d_dbm_open
12623 case "$d_dbm_open" in
12626 echo "We won't be including <ndbm.h>"
12635 : see if net/errno.h is available
12637 set net/errno.h val
12640 : Unfortunately, it causes problems on some systems. Arrgh.
12643 cat > try.c <<'EOM'
12646 #include <net/errno.h>
12652 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12653 echo "We'll be including <net/errno.h>." >&4
12655 echo "We won't be including <net/errno.h>." >&4
12664 : see if netinet/tcp.h is available
12665 set netinet/tcp.h i_netinettcp
12668 : see if this is a poll.h system
12672 : get C preprocessor symbols handy
12674 $echo $n "Hmm... $c"
12675 echo $al | $tr ' ' $trnl >Cppsym.know
12676 $cat <<EOSS >Cppsym
12684 case "\$list\$#" in
12687 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12689 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12692 unknown="\$unknown \$sym"
12702 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12704 exit 0; _ _ _ _\1\\ \1\\
12707 echo "exit 1; _ _ _" >>Cppsym\$\$
12708 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12710 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12716 $rm -f Cppsym\$\$ Cppsym2\$\$
12721 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12723 : now check the C compiler for additional symbols
12724 postprocess_cc_v=''
12726 aix) postprocess_cc_v="|$tr , ' '" ;;
12733 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12736 -D*) echo "\$i" | $sed 's/^-D//';;
12737 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12742 postprocess_cc_v=''
12745 ./ccsym > ccsym1.raw
12746 if $test -s ccsym1.raw; then
12747 $sort ccsym1.raw | $uniq >ccsym.raw
12749 mv ccsym1.raw ccsym.raw
12752 $awk '/\=/ { print $0; next }
12753 { print $0"=1" }' ccsym.raw >ccsym.list
12754 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12755 $comm -13 ccsym.true ccsym.list >ccsym.own
12756 $comm -12 ccsym.true ccsym.list >ccsym.com
12757 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12759 if $test -z ccsym.raw; then
12760 echo "Your C compiler doesn't seem to define any symbols!" >&4
12762 echo "However, your C preprocessor defines the following symbols:"
12765 cppsymbols=`$cat Cppsym.true`
12766 cppsymbols=`echo $cppsymbols`
12767 cppccsymbols="$cppsymbols"
12769 if $test -s ccsym.com; then
12770 echo "Your C compiler and pre-processor define these symbols:"
12771 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12774 cppccsymbols=`$cat ccsym.com`
12775 cppccsymbols=`echo $cppccsymbols`
12776 $test "$silent" || sleep 1
12778 if $test -s ccsym.cpp; then
12779 $test "$also" && echo " "
12780 echo "Your C pre-processor ${also}defines the following symbols:"
12781 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12783 cppsymbols=`$cat ccsym.cpp`
12784 cppsymbols=`echo $cppsymbols`
12785 $test "$silent" || sleep 1
12787 if $test -s ccsym.own; then
12788 $test "$also" && echo " "
12789 echo "Your C compiler ${also}defines the following cpp symbols:"
12790 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12791 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12792 ccsymbols=`$cat ccsym.own`
12793 ccsymbols=`echo $ccsymbols`
12794 $test "$silent" || sleep 1
12799 : see if this is a termio system
12803 if $test `./findhdr termios.h`; then
12804 set tcsetattr i_termios
12810 "$define") echo "You have POSIX termios.h... good!" >&4;;
12811 *) if ./Cppsym pyr; then
12812 case "`/bin/universe`" in
12813 ucb) if $test `./findhdr sgtty.h`; then
12815 echo "<sgtty.h> found." >&4
12817 echo "System is pyramid with BSD universe."
12818 echo "<sgtty.h> not found--you could have problems." >&4
12820 *) if $test `./findhdr termio.h`; then
12822 echo "<termio.h> found." >&4
12824 echo "System is pyramid with USG universe."
12825 echo "<termio.h> not found--you could have problems." >&4
12829 if $test `./findhdr termio.h`; then
12830 echo "<termio.h> found." >&4
12832 elif $test `./findhdr sgtty.h`; then
12833 echo "<sgtty.h> found." >&4
12836 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12839 if $test `./findhdr sgtty.h`; then
12840 echo "<sgtty.h> found." >&4
12842 elif $test `./findhdr termio.h`; then
12843 echo "<termio.h> found." >&4
12846 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12850 set i_termio; eval $setvar
12851 val=$val2; set i_sgtty; eval $setvar
12852 val=$val3; set i_termios; eval $setvar
12854 : see if this is a shadow.h system
12855 set shadow.h i_shadow
12858 : see if this is a socks.h system
12859 set socks.h i_socks
12862 : see if stdarg is available
12864 if $test `./findhdr stdarg.h`; then
12865 echo "<stdarg.h> found." >&4
12868 echo "<stdarg.h> NOT found." >&4
12872 : see if varags is available
12874 if $test `./findhdr varargs.h`; then
12875 echo "<varargs.h> found." >&4
12877 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12880 : set up the varargs testing programs
12881 $cat > varargs.c <<EOP
12883 #include <stdarg.h>
12886 #include <varargs.h>
12890 int f(char *p, ...)
12904 p = va_arg(ap, char *);
12909 $cat > varargs <<EOP
12911 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
12920 : now check which varargs header should be included
12925 if `./varargs I_STDARG`; then
12927 elif `./varargs I_VARARGS`; then
12932 if `./varargs I_VARARGS`; then
12939 echo "I could not find the definition for va_dcl... You have problems..." >&4
12940 val="$undef"; set i_stdarg; eval $setvar
12941 val="$undef"; set i_varargs; eval $setvar
12946 case "$i_varhdr" in
12948 val="$define"; set i_stdarg; eval $setvar
12949 val="$undef"; set i_varargs; eval $setvar
12952 val="$undef"; set i_stdarg; eval $setvar
12953 val="$define"; set i_varargs; eval $setvar
12956 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
12960 : see if stddef is available
12961 set stddef.h i_stddef
12964 : see if sys/access.h is available
12965 set sys/access.h i_sysaccess
12968 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
12969 set sys/filio.h i_sysfilio
12972 if $test `./findhdr sys/ioctl.h`; then
12974 echo '<sys/ioctl.h> found.' >&4
12977 if $test $i_sysfilio = "$define"; then
12978 echo '<sys/ioctl.h> NOT found.' >&4
12980 $test $i_sgtty = "$define" && xxx="sgtty.h"
12981 $test $i_termio = "$define" && xxx="termio.h"
12982 $test $i_termios = "$define" && xxx="termios.h"
12983 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
12989 : see if sys/resource.h has to be included
12990 set sys/resource.h i_sysresrc
12993 : see if sys/security.h is available
12994 set sys/security.h i_syssecrt
12997 : see if this is a sys/statvfs.h system
12998 set sys/statvfs.h i_sysstatvfs
13001 : see if this is a sys/un.h system
13002 set sys/un.h i_sysun
13005 : see if this is a syswait system
13006 set sys/wait.h i_syswait
13009 : see if this is an utime system
13010 set utime.h i_utime
13013 : see if this is a values.h system
13014 set values.h i_values
13017 : see if this is a vfork system
13020 set vfork.h i_vfork
13028 : see if gdbm.h is available
13033 : see if gdbm_open exists
13034 set gdbm_open d_gdbm_open
13036 case "$d_gdbm_open" in
13039 echo "We won't be including <gdbm.h>"
13049 echo "Looking for extensions..." >&4
13050 : If we are using the old config.sh, known_extensions may contain
13051 : old or inaccurate or duplicate values.
13052 known_extensions=''
13053 nonxs_extensions=''
13054 : We do not use find because it might not be available.
13055 : We do not just use MANIFEST because the user may have dropped
13056 : some additional extensions into the source tree and expect them
13059 : Function to recursively find available extensions, ignoring DynaLoader
13060 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13064 DynaLoader|dynaload) ;;
13066 if $test -f $xxx/$xxx.xs; then
13067 known_extensions="$known_extensions $1$xxx";
13068 elif $test -f $xxx/Makefile.PL; then
13069 nonxs_extensions="$nonxs_extensions $1$xxx";
13071 if $test -d $xxx -a $# -lt 10; then
13074 eval $find_extensions;
13086 eval $find_extensions
13087 set X $nonxs_extensions
13089 nonxs_extensions="$*"
13090 set X $known_extensions
13092 known_extensions="$*"
13095 : Now see which are supported on this system.
13097 for xxx in $known_extensions ; do
13101 $define) avail_ext="$avail_ext $xxx" ;;
13104 GDBM_File|gdbm_fil)
13106 $define) avail_ext="$avail_ext $xxx" ;;
13109 NDBM_File|ndbm_fil)
13111 $define) avail_ext="$avail_ext $xxx" ;;
13114 ODBM_File|odbm_fil)
13115 case "${i_dbm}${i_rpcsvcdbm}" in
13116 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13120 case "$useposix" in
13121 true|define|y) avail_ext="$avail_ext $xxx" ;;
13125 case "$useopcode" in
13126 true|define|y) avail_ext="$avail_ext $xxx" ;;
13130 case "$d_socket" in
13131 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13135 case "$usethreads" in
13136 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13140 : XXX Do we need a useipcsysv variable here
13141 case "${d_msg}${d_sem}${d_shm}" in
13142 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13145 *) avail_ext="$avail_ext $xxx"
13154 : Now see which nonxs extensions are supported on this system.
13155 : For now assume all are.
13157 for xxx in $nonxs_extensions ; do
13159 *) nonxs_ext="$nonxs_ext $xxx"
13171 A number of extensions are supplied with $package. You may choose to
13172 compile these extensions for dynamic loading (the default), compile
13173 them into the $package executable (static loading), or not include
13174 them at all. Answer "none" to include no extensions.
13175 Note that DynaLoader is always built and need not be mentioned here.
13178 case "$dynamic_ext" in
13179 '') dflt="$avail_ext" ;;
13180 *) dflt="$dynamic_ext"
13181 # Perhaps we are reusing an old out-of-date config.sh.
13184 if test X"$dynamic_ext" != X"$avail_ext"; then
13186 NOTICE: Your previous config.sh list may be incorrect.
13187 The extensions now available to you are
13189 but the default list from your previous config.sh is
13201 rp="What extensions do you wish to load dynamically?"
13204 none) dynamic_ext=' ' ;;
13205 *) dynamic_ext="$ans" ;;
13208 case "$static_ext" in
13210 : Exclude those already listed in dynamic linking
13212 for xxx in $avail_ext; do
13213 case " $dynamic_ext " in
13215 *) dflt="$dflt $xxx" ;;
13222 *) dflt="$static_ext"
13229 rp="What extensions do you wish to load statically?"
13232 none) static_ext=' ' ;;
13233 *) static_ext="$ans" ;;
13238 A number of extensions are supplied with $package. Answer "none"
13239 to include no extensions.
13240 Note that DynaLoader is always built and need not be mentioned here.
13243 case "$static_ext" in
13244 '') dflt="$avail_ext" ;;
13245 *) dflt="$static_ext"
13246 # Perhaps we are reusing an old out-of-date config.sh.
13249 if test X"$static_ext" != X"$avail_ext"; then
13251 NOTICE: Your previous config.sh list may be incorrect.
13252 The extensions now available to you are
13254 but the default list from your previous config.sh is
13263 : Exclude those that are not xs extensions
13267 rp="What extensions do you wish to include?"
13270 none) static_ext=' ' ;;
13271 *) static_ext="$ans" ;;
13276 set X $dynamic_ext $static_ext $nonxs_ext
13280 : Remove build directory name from cppstdin so it can be used from
13281 : either the present location or the final installed location.
13283 : Get out of the UU directory to get correct path name.
13285 case "$cppstdin" in
13287 echo "Stripping down cppstdin path name"
13293 : end of configuration questions
13295 echo "End of configuration questions."
13298 : back to where it started
13299 if test -d ../UU; then
13303 : configuration may be patched via a 'config.over' file
13304 if $test -f config.over; then
13307 rp='I see a config.over file. Do you wish to load it?'
13310 n*) echo "OK, I'll ignore it.";;
13312 echo "Configuration override changes have been loaded."
13317 : in case they want portability, strip down executable paths
13318 case "$d_portable" in
13321 echo "Stripping down executable paths..." >&4
13322 for file in $loclist $trylist; do
13324 eval $file=`basename $temp`
13329 : create config.sh file
13331 echo "Creating config.sh..." >&4
13332 $spitshell <<EOT >config.sh
13335 # This file was produced by running the Configure script. It holds all the
13336 # definitions figured out by Configure. Should you modify one of these values,
13337 # do not forget to propagate your changes by running "Configure -der". You may
13338 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13341 # Package name : $package
13342 # Source directory : $src
13343 # Configuration time: $cf_time
13344 # Configured by : $cf_by
13345 # Target system : $myuname
13355 Revision='$Revision'
13362 alignbytes='$alignbytes'
13363 ansi2knr='$ansi2knr'
13364 aphostname='$aphostname'
13365 apiversion='$apiversion'
13368 archlibexp='$archlibexp'
13369 archname64='$archname64'
13370 archname='$archname'
13371 archobjs='$archobjs'
13376 bincompat5005='$bincompat5005'
13380 byteorder='$byteorder'
13382 castflags='$castflags'
13385 cccdlflags='$cccdlflags'
13386 ccdlflags='$ccdlflags'
13388 ccsymbols='$ccsymbols'
13390 cf_email='$cf_email'
13395 clocktype='$clocktype'
13397 compress='$compress'
13398 contains='$contains'
13402 cpp_stuff='$cpp_stuff'
13403 cppccsymbols='$cppccsymbols'
13404 cppflags='$cppflags'
13406 cppminus='$cppminus'
13408 cppstdin='$cppstdin'
13409 cppsymbols='$cppsymbols'
13410 crosscompile='$crosscompile'
13411 cryptlib='$cryptlib'
13413 d_Gconvert='$d_Gconvert'
13414 d_PRIEldbl='$d_PRIEldbl'
13415 d_PRIFldbl='$d_PRIFldbl'
13416 d_PRIGldbl='$d_PRIGldbl'
13417 d_PRIX64='$d_PRIX64'
13418 d_PRId64='$d_PRId64'
13419 d_PRIeldbl='$d_PRIeldbl'
13420 d_PRIfldbl='$d_PRIfldbl'
13421 d_PRIgldbl='$d_PRIgldbl'
13422 d_PRIi64='$d_PRIi64'
13423 d_PRIo64='$d_PRIo64'
13424 d_PRIu64='$d_PRIu64'
13425 d_PRIx64='$d_PRIx64'
13426 d_access='$d_access'
13427 d_accessx='$d_accessx'
13429 d_archlib='$d_archlib'
13432 d_attribut='$d_attribut'
13435 d_bincompat5005='$d_bincompat5005'
13437 d_bsdgetpgrp='$d_bsdgetpgrp'
13438 d_bsdsetpgrp='$d_bsdsetpgrp'
13440 d_casti32='$d_casti32'
13441 d_castneg='$d_castneg'
13442 d_charvspr='$d_charvspr'
13444 d_chroot='$d_chroot'
13445 d_chsize='$d_chsize'
13446 d_closedir='$d_closedir'
13447 d_cmsghdr_s='$d_cmsghdr_s'
13451 d_cuserid='$d_cuserid'
13452 d_dbl_dig='$d_dbl_dig'
13453 d_difftime='$d_difftime'
13454 d_dirnamlen='$d_dirnamlen'
13455 d_dlerror='$d_dlerror'
13456 d_dlopen='$d_dlopen'
13457 d_dlsymun='$d_dlsymun'
13458 d_dosuid='$d_dosuid'
13459 d_drand48proto='$d_drand48proto'
13461 d_eaccess='$d_eaccess'
13462 d_endgrent='$d_endgrent'
13463 d_endhent='$d_endhent'
13464 d_endnent='$d_endnent'
13465 d_endpent='$d_endpent'
13466 d_endpwent='$d_endpwent'
13467 d_endsent='$d_endsent'
13468 d_endspent='$d_endspent'
13469 d_eofnblk='$d_eofnblk'
13470 d_eunice='$d_eunice'
13471 d_fchmod='$d_fchmod'
13472 d_fchown='$d_fchown'
13474 d_fd_macros='$d_fd_macros'
13475 d_fd_set='$d_fd_set'
13476 d_fds_bits='$d_fds_bits'
13477 d_fgetpos='$d_fgetpos'
13478 d_flexfnam='$d_flexfnam'
13481 d_fpathconf='$d_fpathconf'
13482 d_fpos64_t='$d_fpos64_t'
13483 d_fseeko='$d_fseeko'
13484 d_fsetpos='$d_fsetpos'
13485 d_fstatfs='$d_fstatfs'
13486 d_fstatvfs='$d_fstatvfs'
13487 d_ftello='$d_ftello'
13489 d_getgrent='$d_getgrent'
13490 d_getgrps='$d_getgrps'
13491 d_gethbyaddr='$d_gethbyaddr'
13492 d_gethbyname='$d_gethbyname'
13493 d_gethent='$d_gethent'
13494 d_gethname='$d_gethname'
13495 d_gethostprotos='$d_gethostprotos'
13496 d_getlogin='$d_getlogin'
13497 d_getmntent='$d_getmntent'
13498 d_getnbyaddr='$d_getnbyaddr'
13499 d_getnbyname='$d_getnbyname'
13500 d_getnent='$d_getnent'
13501 d_getnetprotos='$d_getnetprotos'
13502 d_getpbyname='$d_getpbyname'
13503 d_getpbynumber='$d_getpbynumber'
13504 d_getpent='$d_getpent'
13505 d_getpgid='$d_getpgid'
13506 d_getpgrp2='$d_getpgrp2'
13507 d_getpgrp='$d_getpgrp'
13508 d_getppid='$d_getppid'
13509 d_getprior='$d_getprior'
13510 d_getprotoprotos='$d_getprotoprotos'
13511 d_getpwent='$d_getpwent'
13512 d_getsbyname='$d_getsbyname'
13513 d_getsbyport='$d_getsbyport'
13514 d_getsent='$d_getsent'
13515 d_getservprotos='$d_getservprotos'
13516 d_getspent='$d_getspent'
13517 d_getspnam='$d_getspnam'
13518 d_gettimeod='$d_gettimeod'
13519 d_gnulibc='$d_gnulibc'
13520 d_grpasswd='$d_grpasswd'
13521 d_hasmntopt='$d_hasmntopt'
13524 d_inetaton='$d_inetaton'
13525 d_int64t='$d_int64t'
13526 d_iovec_s='$d_iovec_s'
13527 d_isascii='$d_isascii'
13528 d_killpg='$d_killpg'
13529 d_lchown='$d_lchown'
13530 d_ldbl_dig='$d_ldbl_dig'
13532 d_llseek='$d_llseek'
13533 d_locconv='$d_locconv'
13535 d_longdbl='$d_longdbl'
13536 d_longlong='$d_longlong'
13538 d_madvise='$d_madvise'
13540 d_mbstowcs='$d_mbstowcs'
13541 d_mbtowc='$d_mbtowc'
13542 d_memchr='$d_memchr'
13543 d_memcmp='$d_memcmp'
13544 d_memcpy='$d_memcpy'
13545 d_memmove='$d_memmove'
13546 d_memset='$d_memset'
13548 d_mkfifo='$d_mkfifo'
13549 d_mktime='$d_mktime'
13551 d_mprotect='$d_mprotect'
13553 d_msg_ctrunc='$d_msg_ctrunc'
13554 d_msg_dontroute='$d_msg_dontroute'
13555 d_msg_oob='$d_msg_oob'
13556 d_msg_peek='$d_msg_peek'
13557 d_msg_proxy='$d_msg_proxy'
13558 d_msgctl='$d_msgctl'
13559 d_msgget='$d_msgget'
13560 d_msghdr_s='$d_msghdr_s'
13561 d_msgrcv='$d_msgrcv'
13562 d_msgsnd='$d_msgsnd'
13564 d_munmap='$d_munmap'
13565 d_mymalloc='$d_mymalloc'
13567 d_off64_t='$d_off64_t'
13568 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13569 d_oldpthreads='$d_oldpthreads'
13570 d_oldsock='$d_oldsock'
13572 d_pathconf='$d_pathconf'
13574 d_phostname='$d_phostname'
13577 d_portable='$d_portable'
13578 d_pthread_yield='$d_pthread_yield'
13580 d_pwchange='$d_pwchange'
13581 d_pwclass='$d_pwclass'
13582 d_pwcomment='$d_pwcomment'
13583 d_pwexpire='$d_pwexpire'
13584 d_pwgecos='$d_pwgecos'
13585 d_pwpasswd='$d_pwpasswd'
13586 d_pwquota='$d_pwquota'
13587 d_readdir='$d_readdir'
13588 d_readlink='$d_readlink'
13590 d_recvmsg='$d_recvmsg'
13591 d_rename='$d_rename'
13592 d_rewinddir='$d_rewinddir'
13594 d_safebcpy='$d_safebcpy'
13595 d_safemcpy='$d_safemcpy'
13596 d_sanemcmp='$d_sanemcmp'
13597 d_sched_yield='$d_sched_yield'
13598 d_scm_rights='$d_scm_rights'
13599 d_seekdir='$d_seekdir'
13600 d_select='$d_select'
13602 d_semctl='$d_semctl'
13603 d_semctl_semid_ds='$d_semctl_semid_ds'
13604 d_semctl_semun='$d_semctl_semun'
13605 d_semget='$d_semget'
13607 d_sendmsg='$d_sendmsg'
13608 d_setegid='$d_setegid'
13609 d_seteuid='$d_seteuid'
13610 d_setgrent='$d_setgrent'
13611 d_setgrps='$d_setgrps'
13612 d_sethent='$d_sethent'
13613 d_setlinebuf='$d_setlinebuf'
13614 d_setlocale='$d_setlocale'
13615 d_setnent='$d_setnent'
13616 d_setpent='$d_setpent'
13617 d_setpgid='$d_setpgid'
13618 d_setpgrp2='$d_setpgrp2'
13619 d_setpgrp='$d_setpgrp'
13620 d_setprior='$d_setprior'
13621 d_setpwent='$d_setpwent'
13622 d_setregid='$d_setregid'
13623 d_setresgid='$d_setresgid'
13624 d_setresuid='$d_setresuid'
13625 d_setreuid='$d_setreuid'
13626 d_setrgid='$d_setrgid'
13627 d_setruid='$d_setruid'
13628 d_setsent='$d_setsent'
13629 d_setsid='$d_setsid'
13630 d_setspent='$d_setspent'
13631 d_setvbuf='$d_setvbuf'
13635 d_shmatprototype='$d_shmatprototype'
13636 d_shmctl='$d_shmctl'
13638 d_shmget='$d_shmget'
13639 d_sigaction='$d_sigaction'
13640 d_sigsetjmp='$d_sigsetjmp'
13641 d_socket='$d_socket'
13642 d_sockpair='$d_sockpair'
13643 d_statblks='$d_statblks'
13644 d_statfs='$d_statfs'
13645 d_statfsflags='$d_statfsflags'
13646 d_statvfs='$d_statvfs'
13647 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13648 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13649 d_stdio_stream_array='$d_stdio_stream_array'
13650 d_stdiobase='$d_stdiobase'
13651 d_stdstdio='$d_stdstdio'
13652 d_strchr='$d_strchr'
13653 d_strcoll='$d_strcoll'
13654 d_strctcpy='$d_strctcpy'
13655 d_strerrm='$d_strerrm'
13656 d_strerror='$d_strerror'
13657 d_strtod='$d_strtod'
13658 d_strtol='$d_strtol'
13659 d_strtoul='$d_strtoul'
13660 d_strtoull='$d_strtoull'
13661 d_strxfrm='$d_strxfrm'
13662 d_suidsafe='$d_suidsafe'
13663 d_symlink='$d_symlink'
13664 d_syscall='$d_syscall'
13665 d_sysconf='$d_sysconf'
13666 d_sysernlst='$d_sysernlst'
13667 d_syserrlst='$d_syserrlst'
13668 d_system='$d_system'
13669 d_tcgetpgrp='$d_tcgetpgrp'
13670 d_tcsetpgrp='$d_tcsetpgrp'
13671 d_telldir='$d_telldir'
13672 d_telldirproto='$d_telldirproto'
13675 d_truncate='$d_truncate'
13676 d_tzname='$d_tzname'
13679 d_union_semun='$d_union_semun'
13680 d_vendorlib='$d_vendorlib'
13682 d_void_closedir='$d_void_closedir'
13683 d_voidsig='$d_voidsig'
13684 d_voidtty='$d_voidtty'
13685 d_volatile='$d_volatile'
13686 d_vprintf='$d_vprintf'
13688 d_waitpid='$d_waitpid'
13689 d_wcstombs='$d_wcstombs'
13690 d_wctomb='$d_wctomb'
13691 d_writev='$d_writev'
13694 db_hashtype='$db_hashtype'
13695 db_prefixtype='$db_prefixtype'
13696 defvoidused='$defvoidused'
13697 direntrytype='$direntrytype'
13700 doublesize='$doublesize'
13702 dynamic_ext='$dynamic_ext'
13708 eunicefix='$eunicefix'
13711 extensions='$extensions'
13712 fflushNULL='$fflushNULL'
13713 fflushall='$fflushall'
13715 firstmakefile='$firstmakefile'
13717 fpostype='$fpostype'
13718 freetype='$freetype'
13720 full_csh='$full_csh'
13721 full_sed='$full_sed'
13722 gccversion='$gccversion'
13726 groupcat='$groupcat'
13727 groupstype='$groupstype'
13730 h_sysfile='$h_sysfile'
13734 i_arpainet='$i_arpainet'
13735 i_bsdioctl='$i_bsdioctl'
13738 i_dirent='$i_dirent'
13745 i_inttypes='$i_inttypes'
13746 i_limits='$i_limits'
13747 i_locale='$i_locale'
13748 i_machcthr='$i_machcthr'
13749 i_malloc='$i_malloc'
13751 i_memory='$i_memory'
13752 i_mntent='$i_mntent'
13755 i_neterrno='$i_neterrno'
13756 i_netinettcp='$i_netinettcp'
13759 i_pthread='$i_pthread'
13761 i_rpcsvcdbm='$i_rpcsvcdbm'
13764 i_shadow='$i_shadow'
13766 i_stdarg='$i_stdarg'
13767 i_stddef='$i_stddef'
13768 i_stdlib='$i_stdlib'
13769 i_string='$i_string'
13770 i_sysaccess='$i_sysaccess'
13771 i_sysdir='$i_sysdir'
13772 i_sysfile='$i_sysfile'
13773 i_sysfilio='$i_sysfilio'
13775 i_sysioctl='$i_sysioctl'
13776 i_sysmman='$i_sysmman'
13777 i_sysmount='$i_sysmount'
13778 i_sysndir='$i_sysndir'
13779 i_sysparam='$i_sysparam'
13780 i_sysresrc='$i_sysresrc'
13781 i_syssecrt='$i_syssecrt'
13782 i_sysselct='$i_sysselct'
13783 i_syssockio='$i_syssockio'
13784 i_sysstat='$i_sysstat'
13785 i_sysstatvfs='$i_sysstatvfs'
13786 i_systime='$i_systime'
13787 i_systimek='$i_systimek'
13788 i_systimes='$i_systimes'
13789 i_systypes='$i_systypes'
13790 i_sysuio='$i_sysuio'
13792 i_syswait='$i_syswait'
13793 i_termio='$i_termio'
13794 i_termios='$i_termios'
13796 i_unistd='$i_unistd'
13798 i_values='$i_values'
13799 i_varargs='$i_varargs'
13800 i_varhdr='$i_varhdr'
13802 ignore_versioned_solibs='$ignore_versioned_solibs'
13805 installarchlib='$installarchlib'
13806 installbin='$installbin'
13807 installman1dir='$installman1dir'
13808 installman3dir='$installman3dir'
13809 installprefix='$installprefix'
13810 installprefixexp='$installprefixexp'
13811 installprivlib='$installprivlib'
13812 installscript='$installscript'
13813 installsitearch='$installsitearch'
13814 installsitelib='$installsitelib'
13815 installstyle='$installstyle'
13816 installusrbinperl='$installusrbinperl'
13817 installvendorlib='$installvendorlib'
13819 known_extensions='$known_extensions'
13823 lddlflags='$lddlflags'
13825 ldlibpthname='$ldlibpthname'
13832 libswanted='$libswanted'
13838 locincpth='$locincpth'
13839 loclibpth='$loclibpth'
13840 longdblsize='$longdblsize'
13841 longlongsize='$longlongsize'
13842 longsize='$longsize'
13846 lseeksize='$lseeksize'
13847 lseektype='$lseektype'
13851 make_set_make='$make_set_make'
13852 mallocobj='$mallocobj'
13853 mallocsrc='$mallocsrc'
13854 malloctype='$malloctype'
13856 man1direxp='$man1direxp'
13859 man3direxp='$man3direxp'
13863 mips_type='$mips_type'
13865 mmaptype='$mmaptype'
13867 modetype='$modetype'
13869 multiarch='$multiarch'
13871 myarchname='$myarchname'
13872 mydomain='$mydomain'
13873 myhostname='$myhostname'
13876 netdb_hlen_type='$netdb_hlen_type'
13877 netdb_host_type='$netdb_host_type'
13878 netdb_name_type='$netdb_name_type'
13879 netdb_net_type='$netdb_net_type'
13882 nm_so_opt='$nm_so_opt'
13883 nonxs_ext='$nonxs_ext'
13885 o_nonblock='$o_nonblock'
13887 old_pthread_create_joinable='$old_pthread_create_joinable'
13888 optimize='$optimize'
13889 orderlib='$orderlib'
13895 patchlevel='$patchlevel'
13896 path_sep='$path_sep'
13898 perladmin='$perladmin'
13899 perlpath='$perlpath'
13901 phostname='$phostname'
13907 prefixexp='$prefixexp'
13909 privlibexp='$privlibexp'
13910 prototype='$prototype'
13912 randbits='$randbits'
13913 randfunc='$randfunc'
13914 randseedtype='$randseedtype'
13916 rd_nodata='$rd_nodata'
13920 sPRIEldbl='$sPRIEldbl'
13921 sPRIFldbl='$sPRIFldbl'
13922 sPRIGldbl='$sPRIGldbl'
13925 sPRIeldbl='$sPRIeldbl'
13926 sPRIfldbl='$sPRIfldbl'
13927 sPRIgldbl='$sPRIgldbl'
13932 sched_yield='$sched_yield'
13933 scriptdir='$scriptdir'
13934 scriptdirexp='$scriptdirexp'
13936 seedfunc='$seedfunc'
13937 selectminbits='$selectminbits'
13938 selecttype='$selecttype'
13939 sendmail='$sendmail'
13942 sharpbang='$sharpbang'
13943 shmattype='$shmattype'
13944 shortsize='$shortsize'
13947 sig_count='$sig_count'
13948 sig_name='$sig_name'
13949 sig_name_init='$sig_name_init'
13951 sig_num_init='$sig_num_init'
13952 signal_t='$signal_t'
13953 sitearch='$sitearch'
13954 sitearchexp='$sitearchexp'
13956 sitelibexp='$sitelibexp'
13957 siteprefix='$siteprefix'
13958 siteprefixexp='$siteprefixexp'
13959 sizetype='$sizetype'
13964 sockethdr='$sockethdr'
13965 socketlib='$socketlib'
13967 spackage='$spackage'
13968 spitshell='$spitshell'
13971 ssizetype='$ssizetype'
13972 startperl='$startperl'
13974 static_ext='$static_ext'
13976 stdio_base='$stdio_base'
13977 stdio_bufsiz='$stdio_bufsiz'
13978 stdio_cnt='$stdio_cnt'
13979 stdio_filbuf='$stdio_filbuf'
13980 stdio_ptr='$stdio_ptr'
13981 stdio_stream_array='$stdio_stream_array'
13984 subversion='$subversion'
13991 timeincl='$timeincl'
13992 timetype='$timetype'
14000 use64bits='$use64bits'
14002 uselargefiles='$uselargefiles'
14003 uselongdouble='$uselongdouble'
14004 usemorebits='$usemorebits'
14005 usemultiplicity='$usemultiplicity'
14006 usemymalloc='$usemymalloc'
14008 useopcode='$useopcode'
14009 useperlio='$useperlio'
14010 useposix='$useposix'
14012 useshrplib='$useshrplib'
14013 usesocks='$usesocks'
14014 usethreads='$usethreads'
14015 usevendorprefix='$usevendorprefix'
14016 usevfork='$usevfork'
14019 vendorlib='$vendorlib'
14020 vendorlibexp='$vendorlibexp'
14021 vendorprefix='$vendorprefix'
14022 vendorprefixexp='$vendorprefixexp'
14025 voidflags='$voidflags'
14031 : Add in command line options if available
14032 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14034 : add special variables
14035 $test -f $src/patchlevel.h && \
14036 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14037 echo "CONFIGDOTSH=true" >>config.sh
14039 : propagate old symbols
14040 if $test -f UU/config.sh; then
14041 <UU/config.sh sort | uniq >UU/oldconfig.sh
14042 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14043 sort | uniq -u >UU/oldsyms
14044 set X `cat UU/oldsyms`
14050 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14052 echo "# Variables propagated from previous config.sh file." >>config.sh
14053 for sym in `cat UU/oldsyms`; do
14054 echo " Propagating $hint variable "'$'"$sym..."
14055 eval 'tmp="$'"${sym}"'"'
14057 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14063 : Finish up by extracting the .SH files
14077 If you'd like to make any changes to the config.sh file before I begin
14078 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14081 rp="Press return or use a shell escape to edit config.sh:"
14086 *) : in case they cannot read
14087 sh 1>&4 -c "$ans";;
14092 : if this fails, just run all the .SH files by hand
14099 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14106 Now you need to generate make dependencies by running "$make depend".
14107 You might prefer to run it in background: "$make depend > makedepend.out &"
14108 It can take a while, so you might not want to run it right now.
14113 rp="Run $make depend now?"
14117 $make depend && echo "Now you must run a $make."
14120 echo "You must run '$make depend' then '$make'."
14123 elif test -f [Mm]akefile; then
14125 echo "Now you must run a $make."
14130 if $test -f Policy.sh; then
14133 If you compile $package on a different machine or from a different object
14134 directory, copy the Policy.sh file from this object directory to the
14135 new one before you run Configure -- this will help you with most of
14136 the policy defaults.
14140 if $test -f config.msg; then
14141 echo "Hmm. I also noted the following information while running:"
14143 $cat config.msg >&4
14146 $rm -f kit*isdone ark*isdone