3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Sat Oct 2 13:06:57 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=''
851 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
854 : We must find out about Eunice early
856 if test -f /etc/unixtovms; then
857 eunicefix=/etc/unixtovms
859 if test -f /etc/unixtovms.exe; then
860 eunicefix=/etc/unixtovms.exe
864 : Possible local include directories to search.
865 : Set locincpth to "" in a hint file to defeat local include searches.
866 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
867 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
869 : no include file wanted by default
872 : list of known cpp symbols, sorted alphabetically
873 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
874 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
875 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
876 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
877 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
878 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
879 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
880 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
881 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
882 al="$al VMS Xenix286"
883 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
884 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
885 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
886 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
887 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
888 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
889 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
890 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
891 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
892 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
893 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
894 al="$al __SVR4_2__ __UMAXV__"
895 al="$al ____386BSD____ __alpha __alpha__ __amiga"
896 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
897 al="$al __host_mips__"
898 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
899 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
900 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
901 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
902 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
903 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
904 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
905 al="$al __mc88100 __mc88100__ __mips __mips__"
906 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
907 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
908 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
909 al="$al _host_mips _mips _unix"
910 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
911 al="$al apollo ardent att386 att3b"
912 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
913 al="$al cadmus clipper concurrent convex cray ctix"
914 al="$al dmert encore gcos gcx gimpel gould"
915 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
916 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
917 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
918 al="$al i186 i286 i386 i486 i8086"
919 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
920 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
921 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
922 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
923 al="$al mc88000 mc88100 merlin mert mips mvs n16"
924 al="$al ncl_el ncl_mr"
925 al="$al news1500 news1700 news1800 news1900 news3700"
926 al="$al news700 news800 news900 ns16000 ns32000"
927 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
928 al="$al parisc pc532 pdp11 plexus posix pyr"
929 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
930 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
931 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
932 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
933 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
934 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
937 : Trailing extension. Override this in a hint file, if needed.
939 : Extra object files, if any, needed on this platform.
942 : change the next line if compiling for Xenix/286 on Xenix/386
943 xlibpth='/usr/lib/386 /lib/386'
945 : Possible local library directories to search.
946 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
947 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
949 : general looking path for locating libraries
950 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
951 glibpth="$glibpth /lib /usr/lib $xlibpth"
952 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
953 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
955 : Private path used by Configure to find libraries. Its value
956 : is prepended to libpth. This variable takes care of special
957 : machines, like the mips. Usually, it should be empty.
960 : default library list
962 : some systems want to use only the non-versioned libso:s
963 ignore_versioned_solibs=''
964 : full support for void wanted by default
967 : set useposix=false in your hint file to disable the POSIX extension.
969 : set useopcode=false in your hint file to disable the Opcode extension.
971 : set usemultiplicity on the Configure command line to enable multiplicity.
972 : set usesocks on the Configure command line to enable socks.
973 : set usethreads on the Configure command line to enable threads.
974 : List of libraries we want.
975 : If anyone needs -lnet, put it in a hint file.
976 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
977 libswanted="$libswanted dld ld sun m c cposix posix"
978 libswanted="$libswanted ndir dir crypt sec"
979 libswanted="$libswanted ucb bsd BSD PW x"
980 : We probably want to search /usr/shlib before most other libraries.
981 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
982 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
983 glibpth="/usr/shlib $glibpth"
984 : Do not use vfork unless overridden by a hint file.
987 : Find the basic shell for Bourne shell scripts
991 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
994 if test -f "$xxx"; then
997 : Build up a list and do a single loop so we can 'break' out.
998 pth=`echo $PATH | sed -e "s/$p_/ /g"`
999 for xxx in sh bash ksh pdksh ash; do
1001 try="$try ${p}/${xxx}"
1005 if test -f "$xxx"; then
1008 elif test -f "$xxx.exe"; then
1019 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1021 Usually it's in /bin/sh. How did you even get this far?
1022 Please contact me (Perl Maintainers) at perlbug@perl.com and
1023 we'll try to straighten this all out.
1029 : see if sh knows # comments
1030 if `$sh -c '#' >/dev/null 2>&1`; then
1034 test -f $xcat || xcat=/usr/bin/cat
1039 if test -s today; then
1042 echo "#! $xcat" > try
1046 if test -s today; then
1054 echo "Your $sh doesn't grok # comments--I will strip them later on."
1057 echo "exec grep -v '^[ ]*#'" >spitshell
1059 $eunicefix spitshell
1060 spitshell=`pwd`/spitshell
1062 echo "I presume that if # doesn't work, #! won't work either!"
1067 : figure out how to guarantee sh startup
1069 '') startsh=${sharpbang}${sh} ;;
1081 : echo "Yup, it does."
1083 echo "Hmm... '$startsh' does not guarantee sh startup..."
1084 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1089 : Save command line options in file UU/cmdline.opt for later use in
1090 : generating config.sh.
1091 cat > cmdline.opt <<EOSH
1092 # Configure command line arguments.
1099 cat >>cmdline.opt <<EOSH
1100 config_arg$argn='$arg'
1102 argn=`expr $argn + 1`
1105 : produce awk script to parse command line options
1106 cat >options.awk <<'EOF'
1108 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1110 len = length(optstr);
1111 for (i = 1; i <= len; i++) {
1112 c = substr(optstr, i, 1);
1113 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1124 if (substr(str, 1, 1) != "-") {
1125 printf("'%s'\n", str);
1129 for (i = 2; i <= len; i++) {
1130 c = substr(str, i, 1);
1132 printf("-%s\n", substr(str, i));
1138 printf("'%s'\n", substr(str, i + 1));
1151 : process the command line options
1152 set X `for arg in "$@"; do echo "X$arg"; done |
1153 sed -e s/X// | awk -f options.awk`
1158 : set up default values
1168 rm -f optdef.sh posthint.sh
1169 cat >optdef.sh <<EOS
1175 while test $# -gt 0; do
1177 -d) shift; fastread=yes;;
1178 -e) shift; alldone=cont;;
1182 if test -r "$1"; then
1185 echo "$me: cannot read config file $1." >&2
1190 -h) shift; error=true;;
1191 -r) shift; reuseval=true;;
1192 -s) shift; silent=true; realsilent=true;;
1193 -E) shift; alldone=exit;;
1194 -K) shift; knowitall=true;;
1195 -O) shift; override=true;;
1196 -S) shift; silent=true; extractsh=true;;
1201 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1202 echo "$me: ignoring -D $1" >&2
1205 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1206 *) echo "$1='define'" >> optdef.sh;;
1213 *=) echo "$1" >> optdef.sh;;
1215 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1216 echo "$me: ignoring -U $1" >&2
1218 *) echo "$1='undef'" >> optdef.sh;;
1229 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1233 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1234 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1240 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1241 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1242 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1243 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1244 *) xxx=`echo $yyy|sed 's!:.*!!'`
1245 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1251 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1253 echo "$yyy=''" >> posthint.sh ;;
1258 echo "$yyy='$zzz'" >> posthint.sh ;;
1260 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1262 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1267 echo "$yyy=$zzz" >> posthint.sh ;;
1268 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1271 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1274 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1282 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1283 [-U symbol] [-U symbol=] [-A command:symbol...]
1284 -d : use defaults for all answers.
1285 -e : go on without questioning past the production of config.sh.
1286 -f : specify an alternate default configuration file.
1287 -h : print this help message and exit (with an error status).
1288 -r : reuse C symbols value if possible (skips costly nm extraction).
1289 -s : silent mode, only echoes questions and essential information.
1290 -D : define symbol to have some value:
1291 -D symbol symbol gets the value 'define'
1292 -D symbol=value symbol gets the value 'value'
1293 -E : stop at the end of questions, after having produced config.sh.
1294 -K : do not use unless you know what you are doing.
1295 -O : let -D and -U override definitions from loaded configuration file.
1296 -S : perform variable substitutions on all .SH files (can mix with -f)
1297 -U : undefine symbol:
1298 -U symbol symbol gets the value 'undef'
1299 -U symbol= symbol gets completely empty
1300 -A : manipulate symbol after the platform specific hints have been applied:
1301 -A symbol=value append " "value to symbol
1302 -A append:symbol=value append value to symbol
1303 -A define:symbol=value define symbol to have value
1304 -A clear:symbol define symbol to be ''
1305 -A define:symbol define symbol to be 'define'
1306 -A eval:symbol=value define symbol to be eval of value
1307 -A prepend:symbol=value prepend value to symbol
1308 -A undef:symbol define symbol to be 'undef'
1309 -A undef:symbol= define symbol to be ''
1310 -V : print version number and exit (with a zero status).
1317 case "$fastread$alldone" in
1320 if test ! -t 0; then
1321 echo "Say 'sh Configure', not 'sh <Configure'"
1329 true) exec 1>/dev/null;;
1332 : run the defines and the undefines, if any, but leave the file out there...
1335 : create the posthint manipulation script and leave the file out there...
1340 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1341 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1342 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1343 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1344 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1347 : Some greps do not return status, grrr.
1348 echo "grimblepritz" >grimble
1349 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1351 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1357 : the following should work in any shell
1361 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1362 cat >contains <<'EOSS'
1363 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1368 : Find the path to the source tree
1371 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1374 *) src=`cd ../$src && pwd` ;;
1387 if test -f $rsrc/Configure && \
1388 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1390 : found it, so we are ok.
1393 for src in . .. ../.. ../../.. ../../../..; do
1394 if test -f ../$src/Configure && \
1395 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1406 Sorry, I can't seem to locate the source dir for $package. Please start
1407 Configure with an explicit path -- i.e. /some/path/Configure.
1415 echo "Sources for $package found in \"$src\"." >&4
1419 : script used to extract .SH files with variable substitutions
1420 cat >extract <<'EOS'
1422 echo "Doing variable substitutions on .SH files..."
1423 if test -f $src/MANIFEST; then
1424 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1426 echo "(Looking for .SH files under the source directory.)"
1427 set x `(cd $src; find . -name "*.SH" -print)`
1431 0) set x `(cd $src; echo *.SH)`; shift;;
1433 if test ! -f $src/$1; then
1439 while test $name; do
1440 if test ! -d "$name"; then
1441 create="$name $create";
1442 name=`echo $name | sed -e "s|^[^/]*$||"`;
1443 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1448 for file in $create; do
1457 dir=`expr X$file : 'X\(.*\)/'`
1458 file=`expr X$file : 'X.*/\(.*\)'`
1459 (cd $dir && . ./$file)
1469 dir=`expr X$file : 'X\(.*\)/'`
1470 file=`expr X$file : 'X.*/\(.*\)'`
1471 (set x $dir; shift; eval $mkdir_p)
1481 if test -f $src/config_h.SH; then
1482 if test ! -f config.h; then
1483 : oops, they left it out of MANIFEST, probably, so do it anyway.
1489 : extract files and exit if asked to do so
1490 case "$extractsh" in
1492 case "$realsilent" in
1496 case "$config_sh" in
1497 '') config_sh='config.sh';;
1500 echo "Fetching answers from $config_sh..."
1503 test "$override" && . ./optdef.sh
1512 : Eunice requires " " instead of "", can you believe it
1515 echo "Beginning of configuration questions for $package."
1517 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1519 : first determine how to suppress newline on echo command
1521 echo "Checking echo to see how to suppress newlines..."
1522 (echo "hi there\c" ; echo " ") >.echotmp
1523 if $contains c .echotmp >/dev/null 2>&1 ; then
1534 echo $n "The star should be here-->$c"
1538 : Now test for existence of everything in MANIFEST
1540 if test -f $rsrc/MANIFEST; then
1541 echo "First let's make sure your kit is complete. Checking..." >&4
1542 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1545 for filelist in x??; do
1546 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1548 if test -s missing; then
1552 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1554 You have the option of continuing the configuration process, despite the
1555 distinct possibility that your kit is damaged, by typing 'y'es. If you
1556 do, don't blame me if something goes wrong. I advise you to type 'n'o
1557 and contact the author (perlbug@perl.com).
1560 echo $n "Continue? [n] $c" >&4
1564 echo "Continuing..." >&4
1568 echo "ABORTING..." >&4
1573 echo "Looks good..."
1576 echo "There is no MANIFEST file. I hope your kit is complete !"
1581 : Find the appropriate value for a newline for tr
1582 if test -n "$DJGPP"; then
1585 if test X"$trnl" = X; then
1586 case "`echo foo|tr '\n' x 2>/dev/null`" in
1590 if test X"$trnl" = X; then
1591 case "`echo foo|tr '\012' x 2>/dev/null`" in
1592 foox) trnl='\012' ;;
1595 if test X"$trnl" = X; then
1598 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1604 : compute the number of columns on the terminal for proper question formatting
1609 : set up the echo used in my read
1610 myecho="case \"\$xxxm\" in
1611 '') echo $n \"\$rp $c\" >&4;;
1613 '') echo $n \"[\$xxxm] $c\";;
1615 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1617 echo $n \"[\$xxxm] $c\" >&4
1619 echo $n \"\$rp [\$xxxm] $c\" >&4
1625 : now set up to do reads with possible shell escape and default assignment
1631 case "\$fastread" in
1632 yes) case "\$dflt" in
1635 case "\$silent-\$rp" in
1640 *) case "\$silent" in
1641 true) case "\$rp" in
1646 while expr "X\$ans" : "X!" >/dev/null; do
1650 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1658 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1667 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1672 echo "(OK, I'll run with -d after this question.)" >&4
1675 echo "*** Sorry, \$1 not supported yet." >&4
1685 echo "*** Substitution done -- please confirm."
1687 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1692 echo "*** Error -- try again."
1699 case "\$ans\$xxxm\$nostick" in
1711 : create .config dir to save info across Configure sessions
1712 test -d ../.config || mkdir ../.config
1713 cat >../.config/README <<EOF
1714 This directory created by Configure to save information that should
1715 persist across sessions for $package.
1717 You may safely delete it if you wish.
1720 : general instructions
1723 user=`(logname) 2>/dev/null`
1725 '') user=`whoami 2>&1`;;
1727 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1730 rp='Would you like to see the instructions?'
1741 This installation shell script will examine your system and ask you questions
1742 to determine how the perl5 package should be installed. If you get
1743 stuck on a question, you may use a ! shell escape to start a subshell or
1744 execute a command. Many of the questions will have default answers in square
1745 brackets; typing carriage return will give you the default.
1747 On some of the questions which ask for file or directory names you are allowed
1748 to use the ~name construct to specify the login directory belonging to "name",
1749 even if you don't have a shell which knows about that. Questions where this is
1750 allowed will be marked "(~name ok)".
1754 dflt='Type carriage return to continue'
1758 The prompter used in this script allows you to use shell variables and
1759 backticks in your answers. You may use $1, $2, etc... to refer to the words
1760 in the default answer, as if the default line was a set of arguments given to a
1761 script shell. This means you may also use $* to repeat the whole default line,
1762 so you do not have to re-type everything to add something to the default.
1764 Everytime there is a substitution, you will have to confirm. If there is an
1765 error (e.g. an unmatched backtick), the default answer will remain unchanged
1766 and you will be prompted again.
1768 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1769 the questions and use the computed defaults (or the previous answers if there
1770 was already a config.sh file). Type 'Configure -h' for a list of options.
1771 You may also start interactively and then answer '& -d' at any prompt to turn
1772 on the non-interactive behaviour for the remainder of the execution.
1778 Much effort has been expended to ensure that this shell script will run on any
1779 Unix system. If despite that it blows up on yours, your best bet is to edit
1780 Configure and run it again. If you can't run Configure for some reason,
1781 you'll have to generate a config.sh file by hand. Whatever problems you
1782 have, let me (perlbug@perl.com) know how I blew it.
1784 This installation script affects things in two ways:
1786 1) it may do direct variable substitutions on some of the files included
1788 2) it builds a config.h file for inclusion in C programs. You may edit
1789 any of these files as the need arises after running this script.
1791 If you make a mistake on a question, there is no easy way to back up to it
1792 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1793 files. Configure will offer to let you do this before it runs the SH files.
1796 dflt='Type carriage return to continue'
1798 case "$firsttime" in
1799 true) echo $user >>../.config/instruct;;
1803 : find out where common programs are
1805 echo "Locating common programs..." >&4
1818 if test -d \$dir/\$thing; then
1824 for thisthing in \$dir/\$thing; do
1825 : just loop through to pick last item
1827 if test -f \$thisthing; then
1830 elif test -f \$dir/\$thing.exe; then
1831 if test -n "$DJGPP"; then
1832 echo \$dir/\$thing.exe
1834 : on Eunice apparently
1884 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1885 pth="$pth /lib /usr/lib"
1886 for file in $loclist; do
1890 if test -f "$xxx"; then
1893 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1894 xxx=`./loc $file $file $pth`
1897 '') xxx=`./loc $file $file $pth`;;
1898 *) xxx=`./loc $xxx $xxx $pth`;;
1904 echo $file is in $xxx.
1907 echo $file is in $xxx.
1910 echo "I don't know where '$file' is, and my life depends on it." >&4
1911 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1917 echo "Don't worry if any of the following aren't found..."
1919 for file in $trylist; do
1923 if test -f "$xxx"; then
1926 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1927 xxx=`./loc $file $file $pth`
1930 '') xxx=`./loc $file $file $pth`;;
1931 *) xxx=`./loc $xxx $xxx $pth`;;
1937 echo $file is in $xxx.
1940 echo $file is in $xxx.
1943 echo "I don't see $file out there, $say."
1950 echo "Substituting grep for egrep."
1956 echo "Substituting cp for ln."
1962 echo "Hopefully test is built into your sh."
1965 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1966 echo "Using the test built into your sh."
1974 echo "Hopefully echo is built into your sh."
1979 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1980 $echo $n "hi there$c" >foo1
1981 echo $n "hi there$c" >foo2
1982 if cmp foo1 foo2 >/dev/null 2>&1; then
1983 echo "They are compatible. In fact, they may be identical."
1990 They are not compatible! You are probably running ksh on a non-USG system.
1991 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1992 have echo built in and we may have to run some Bourne shell scripts. That
1993 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1996 $echo $n "The star should be here-->$c"
2003 : determine whether symbolic links are supported
2006 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2007 echo "Symbolic links are supported." >&4
2010 echo "Symbolic links are NOT supported." >&4
2015 : see whether [:lower:] and [:upper:] are supported character classes
2017 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2019 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2023 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2024 # (0xc9 and 0xd1), therefore that is a nice testing point.
2025 if test "X$up" = X -o "X$low" = X; then
2026 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2032 if test "X$up" = X -o "X$low" = X; then
2033 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2039 if test "X$up" = X -o "X$low" = X; then
2040 case "`echo IJ | od -x 2>/dev/null`" in
2042 echo "Hey, this might be EBCDIC." >&4
2043 if test "X$up" = X -o "X$low" = X; then
2044 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2045 ij) up='[A-IJ-RS-Z]'
2050 if test "X$up" = X -o "X$low" = X; then
2051 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2061 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2063 echo "Using $up and $low to convert case." >&4
2066 echo "I don't know how to translate letters from upper to lower case." >&4
2067 echo "Your tr is not acting any way I know of." >&4
2071 : set up the translation script tr, must be called with ./tr of course
2075 '[A-Z][a-z]') exec $tr '$up' '$low';;
2076 '[a-z][A-Z]') exec $tr '$low' '$up';;
2083 : Try to determine whether config.sh was made on this system
2084 case "$config_sh" in
2086 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2087 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2088 # because the A-Z/a-z are not consecutive.
2089 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2090 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2091 newmyuname="$myuname"
2093 case "$knowitall" in
2095 if test -f ../config.sh; then
2096 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2097 eval "`grep myuname= ../config.sh`"
2099 if test "X$myuname" = "X$newmyuname"; then
2107 : Get old answers from old config file if Configure was run on the
2108 : same system, otherwise use the hints.
2111 if test -f config.sh; then
2113 rp="I see a config.sh file. Shall I use it to set the defaults?"
2116 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2117 *) echo "Fetching default answers from your old config.sh file..." >&4
2125 : Older versions did not always set $sh. Catch re-use of such
2134 if test ! -f config.sh; then
2137 First time through, eh? I have some defaults handy for some systems
2138 that need some extra help getting the Configure answers right:
2141 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2143 : Half the following guesses are probably wrong... If you have better
2144 : tests or hints, please send them to perlbug@perl.com
2145 : The metaconfig authors would also appreciate a copy...
2146 $test -f /irix && osname=irix
2147 $test -f /xenix && osname=sco_xenix
2148 $test -f /dynix && osname=dynix
2149 $test -f /dnix && osname=dnix
2150 $test -f /lynx.os && osname=lynxos
2151 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2152 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2153 $test -f /bin/mips && /bin/mips && osname=mips
2154 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2155 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2156 $test -d /usr/apollo/bin && osname=apollo
2157 $test -f /etc/saf/_sactab && osname=svr4
2158 $test -d /usr/include/minix && osname=minix
2159 if $test -d /MachTen -o -d /MachTen_Folder; then
2161 if $test -x /sbin/version; then
2162 osvers=`/sbin/version | $awk '{print $2}' |
2163 $sed -e 's/[A-Za-z]$//'`
2164 elif $test -x /usr/etc/version; then
2165 osvers=`/usr/etc/version | $awk '{print $2}' |
2166 $sed -e 's/[A-Za-z]$//'`
2171 $test -f /sys/posix.dll &&
2172 $test -f /usr/bin/what &&
2173 set X `/usr/bin/what /sys/posix.dll` &&
2174 $test "$3" = UWIN &&
2177 if $test -f $uname; then
2185 umips) osname=umips ;;
2188 [23]100) osname=mips ;;
2189 next*) osname=next ;;
2191 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2192 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2195 elif $test -f /etc/kconfig; then
2197 if test "$lns" = "$ln -s"; then
2199 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2201 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2208 if test -n "$DJGPP"; then
2217 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2219 'not found') osvers="$4"."$3" ;;
2220 '<3240'|'<>3240') osvers=3.2.0 ;;
2221 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2222 '=3250'|'>3250') osvers=3.2.5 ;;
2226 *dc.osx) osname=dcosx
2232 domainos) osname=apollo
2238 dynixptx*) osname=dynixptx
2239 osvers=`echo "$4"|sed 's/^v//'`
2241 freebsd) osname=freebsd
2243 genix) osname=genix ;;
2245 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2261 netbsd*) osname=netbsd
2264 news-os) osvers="$3"
2266 4*) osname=newsos4 ;;
2270 bsd386) osname=bsd386
2273 POSIX-BC | posix-bc ) osname=posix-bc
2276 powerux | power_ux | powermax_os | powermaxos | \
2277 powerunix | power_unix) osname=powerux
2280 next*) osname=next ;;
2281 solaris) osname=solaris
2283 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2290 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2294 titanos) osname=titanos
2303 ultrix) osname=ultrix
2306 osf1|mls+) case "$5" in
2309 osvers=`echo "$3" | sed 's/^[xvt]//'`
2311 hp*) osname=hp_osf1 ;;
2312 mips) osname=mips_osf1 ;;
2315 unixware) osname=svr5
2324 $2) case "$osname" in
2328 : svr4.x or possibly later
2338 if test -f /stand/boot ; then
2339 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2340 if test -n "$INITPROG" -a -f "$INITPROG"; then
2341 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2342 if test -n "$isesix"; then
2350 *) if test -f /etc/systemid; then
2352 set `echo $3 | $sed 's/\./ /g'` $4
2353 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2355 elif $test -f $src/hints/sco_$1_$2.sh; then
2357 elif $test -f $src/hints/sco_$1.sh; then
2362 '') : Still unknown. Probably a generic Sys V.
2371 *) case "$osname" in
2372 '') : Still unknown. Probably a generic BSD.
2380 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2381 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2382 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2385 $rm -f UU/kernel.what
2386 elif test -d c:/.; then
2393 : Now look for a hint file osname_osvers, unless one has been
2394 : specified already.
2397 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2398 : Also try without trailing minor version numbers.
2399 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2400 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2401 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2402 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2405 *) case "$osvers" in
2408 *) if $test -f $src/hints/$file.sh ; then
2410 elif $test -f $src/hints/$xfile.sh ; then
2412 elif $test -f $src/hints/$xxfile.sh ; then
2414 elif $test -f $src/hints/$xxxfile.sh ; then
2416 elif $test -f $src/hints/$xxxxfile.sh ; then
2418 elif $test -f "$src/hints/${osname}.sh" ; then
2427 if $test -f Policy.sh ; then
2430 none) dflt="Policy" ;;
2431 *) dflt="Policy $dflt" ;;
2436 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2440 if $test -f Policy.sh ; then
2443 There's also a Policy hint file available, which should make the
2444 site-specific (policy) questions easier to answer.
2451 You may give one or more space-separated answers, or "none" if appropriate.
2452 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2453 is a good thing. DO NOT give a wrong version or a wrong OS.
2457 rp="Which of these apply, if any?"
2460 for file in $tans; do
2461 if $test X$file = XPolicy -a -f Policy.sh; then
2463 $cat Policy.sh >> UU/config.sh
2464 elif $test -f $src/hints/$file.sh; then
2465 . $src/hints/$file.sh
2466 $cat $src/hints/$file.sh >> UU/config.sh
2467 elif $test X$tans = X -o X$tans = Xnone ; then
2470 : Give one chance to correct a possible typo.
2471 echo "$file.sh does not exist"
2473 rp="hint to use instead?"
2475 for file in $ans; do
2476 if $test -f "$src/hints/$file.sh"; then
2477 . $src/hints/$file.sh
2478 $cat $src/hints/$file.sh >> UU/config.sh
2479 elif $test X$ans = X -o X$ans = Xnone ; then
2482 echo "$file.sh does not exist -- ignored."
2489 : Remember our hint file for later.
2490 if $test -f "$src/hints/$file.sh" ; then
2500 echo "Fetching default answers from $config_sh..." >&4
2504 cp $config_sh config.sh 2>/dev/null
2514 test "$override" && . ./optdef.sh
2515 myuname="$newmyuname"
2517 : Restore computed paths
2518 for file in $loclist $trylist; do
2519 eval $file="\$_$file"
2524 Configure uses the operating system name and version to set some defaults.
2525 The default value is probably right if the name rings a bell. Otherwise,
2526 since spelling matters for me, either accept the default or answer "none"
2533 ''|' '|none) dflt=none ;;
2534 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2537 *) dflt="$osname" ;;
2539 rp="Operating system name?"
2543 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2549 ''|' '|none) dflt=none ;;
2550 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2551 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2553 ''|' ') dflt=none ;;
2558 *) dflt="$osvers" ;;
2560 rp="Operating system version?"
2570 : who configured the system
2571 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2572 cf_by=`(logname) 2>/dev/null`
2575 cf_by=`(whoami) 2>/dev/null`
2577 "") cf_by=unknown ;;
2581 : set up the script used to warn in case of inconsistency
2588 echo "*** WHOA THERE!!! ***" >&4
2589 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2590 rp=" Keep the $hint value?"
2593 y) td=$was; tu=$was;;
2597 : function used to set $1 to $val
2598 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2600 $define$undef) . ./whoa; eval "$var=\$td";;
2601 $undef$define) . ./whoa; eval "$var=\$tu";;
2602 *) eval "$var=$val";;
2607 Perl can be built to take advantage of threads, on some systems.
2608 To do so, Configure must be run with -Dusethreads.
2610 Note that threading is a highly experimental feature, and
2611 some known race conditions still remain. If you choose to try
2612 it, be very sure to not actually deploy it for production
2613 purposes. README.threads has more details, and is required
2614 reading if you enable threads.
2616 case "$usethreads" in
2617 $define|true|[yY]*) dflt='y';;
2620 rp='Build a threading Perl?'
2623 y|Y) val="$define" ;;
2629 case "$d_oldpthreads" in
2630 '') : Configure tests would be welcome here. For now, assume undef.
2632 *) val="$d_oldpthreads" ;;
2638 case "$usethreads" in
2639 "$define"|true|[yY]*)
2640 : Look for a hint-file generated 'call-back-unit'. If the
2641 : user has specified that a threading perl is to be built,
2642 : we may need to set or change some other defaults.
2643 if $test -f usethreads.cbu; then
2644 echo "Your platform has some specific hints for threaded builds, using them..."
2648 (Your platform doesn't have any specific hints for threaded builds.
2649 Assuming POSIX threads, then.)
2657 Perl can be built so that multiple Perl interpreters can coexist
2658 within the same Perl executable. To do so, Configure must be run with
2661 Normally you do not need this and you should answer no.
2664 case "$usemultiplicity" in
2665 $define|true|[yY]*) dflt='y';;
2668 rp='Build Perl for multiplicity?'
2671 y|Y) val="$define" ;;
2677 : determine where manual pages are on this system
2681 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2682 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2683 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2684 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2685 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2686 sysman=`./loc . /usr/man/man1 $syspath`
2689 if $test -d "$sysman"; then
2690 echo "System manual is in $sysman." >&4
2692 echo "Could not find manual pages in source form." >&4
2695 : see what memory models we can support
2698 $cat >pdp11.c <<'EOP'
2707 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2708 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2709 dflt='unsplit split'
2711 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2714 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2719 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2722 if $test -d /lib/large || $test -d /usr/lib/large; then
2725 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2734 Some systems have different model sizes. On most systems they are called
2735 small, medium, large, and huge. On the PDP11 they are called unsplit and
2736 split. If your system doesn't support different memory models, say "none".
2737 If you wish to force everything to one memory model, say "none" here and
2738 put the appropriate flags later when it asks you for other cc and ld flags.
2739 Venix systems may wish to put "none" and let the compiler figure things out.
2740 (In the following question multiple model names should be space separated.)
2742 The default for most systems is "none".
2745 rp="Which memory models are supported?"
2760 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2761 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2768 rp="What flag indicates separate I and D space?"
2776 *large*|*small*|*medium*|*huge*)
2783 rp="What flag indicates large model?"
2793 *huge*) case "$huge" in
2797 rp="What flag indicates huge model?"
2807 *medium*) case "$medium" in
2811 rp="What flag indicates medium model?"
2818 *) medium="$large";;
2821 *small*) case "$small" in
2825 rp="What flag indicates small model?"
2836 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2839 $rm -f pdp11.* pdp11
2841 : make some quick guesses about what we are up against
2843 $echo $n "Hmm... $c"
2853 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2854 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2856 echo "Looks kind of like an OSF/1 system, but we'll see..."
2858 elif test `echo abc | tr a-z A-Z` = Abc ; then
2859 xxx=`./loc addbib blurfl $pth`
2860 if $test -f $xxx; then
2861 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2865 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2866 echo "Looks kind of like an extended USG system, but we'll see..."
2868 echo "Looks kind of like a USG system, but we'll see..."
2872 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2873 echo "Looks kind of like a BSD system, but we'll see..."
2877 echo "Looks kind of like a Version 7 system, but we'll see..."
2880 case "$eunicefix" in
2883 There is, however, a strange, musty smell in the air that reminds me of
2884 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2888 : it so happens the Eunice I know will not run shell scripts in Unix format
2892 echo "Congratulations. You aren't running Eunice."
2896 : Detect OS2. The p_ variable is set above in the Head.U unit.
2901 I have the feeling something is not exactly right, however...don't tell me...
2902 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2907 if test -f /xenix; then
2908 echo "Actually, this looks more like a XENIX system..."
2913 echo "It's not Xenix..."
2918 if test -f /venix; then
2919 echo "Actually, this looks more like a VENIX system..."
2926 echo "Nor is it Venix..."
2929 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2930 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2933 : see if we need a special compiler
2941 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2942 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2956 On some older systems the default C compiler will not resolve multiple global
2957 references that happen to have the same name. On some such systems the "Mcc"
2958 command may be used to force these to be resolved. On other systems a "cc -M"
2959 command is required. (Note that the -M flag on other systems indicates a
2960 memory model to use!) If you have the Gnu C compiler, you might wish to use
2966 rp="Use which C compiler?"
2974 rp="Use which C compiler?"
2978 : Look for a hint-file generated 'call-back-unit'. Now that the
2979 : user has specified the compiler, we may need to set or change some
2981 if $test -f cc.cbu; then
2985 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2986 $cat >gccvers.c <<EOM
2991 printf("%s\n", __VERSION__);
2993 printf("%s\n", "1");
2999 if $cc -o gccvers gccvers.c; then
3000 gccversion=`./gccvers`
3001 case "$gccversion" in
3002 '') echo "You are not using GNU cc." ;;
3003 *) echo "You are using GNU cc $gccversion." ;;
3007 echo "*** WHOA THERE!!! ***" >&4
3008 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3009 case "$knowitall" in
3011 echo " You'd better start hunting for one and let me know about it." >&4
3017 case "$gccversion" in
3018 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3022 case "$usemorebits" in
3023 "$define"|true|[yY]*)
3025 uselongdouble="$define"
3026 usemorebits="$define"
3028 *) usemorebits="$undef"
3035 Perl can be built to understand large files (files larger than 2 gigabytes)
3036 on some systems. To do so, Configure must be run with -Duselargefiles.
3038 If this doesn't make any sense to you, just accept the default.
3040 case "$uselargefiles" in
3041 "$define"|true|[yY]*) dflt='y' ;;
3044 rp='Try to understand large files?'
3047 y|Y) val="$define" ;;
3052 case "$uselargefiles" in
3053 "$define") use64bits="$define" ;;
3058 Perl can be built to take advantage of explicit 64-bit interfaces,
3059 on some systems. To do so, Configure must be run with -Duse64bits.
3061 If this doesn't make any sense to you, just accept the default.
3063 case "$use64bits" in
3064 $define|true|[yY]*) dflt='y';;
3067 rp='Try to use explicit 64-bit interfaces, if available?'
3080 case "$archname64" in
3081 '') archname64='' ;; # not a typo
3084 case "$use64bits" in
3085 "$define"|true|[yY]*)
3086 : Look for a hint-file generated 'call-back-unit'. If the
3087 : user has specified that a 64 bit perl is to be built,
3088 : we may need to set or change some other defaults.
3089 if $test -f use64bits.cbu; then
3090 echo "Your platform has some specific hints for 64-bit builds, using them..."
3094 (Your platform doesn't have any specific hints for 64-bit builds.
3095 This is probably okay, especially if your system is a true 64-bit system.)
3097 case "$gccversion" in
3100 But since you seem to be using gcc,
3101 I will now add -DUSE_LONG_LONG to the compilation flags.
3103 ccflags="$ccflags -DUSE_LONG_LONG"
3110 : determine the architecture name
3112 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3113 tarch=`arch`"-$osname"
3114 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3115 if uname -m > tmparch 2>&1 ; then
3116 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3117 -e 's/$/'"-$osname/" tmparch`
3125 case "$myarchname" in
3128 echo "(Your architecture name used to be $myarchname.)"
3135 *) dflt="$archname";;
3137 rp='What is your architecture name'
3140 case "$usethreads" in
3142 echo "Threads selected." >&4
3144 *-thread*) echo "...and architecture name already has -thread." >&4
3146 *) archname="$archname-thread"
3147 echo "...setting architecture name to $archname." >&4
3152 case "$usemultiplicity" in
3154 echo "Multiplicity selected." >&4
3156 *-multi*) echo "...and architecture name already has -multi." >&4
3158 *) archname="$archname-multi"
3159 echo "...setting architecture name to $archname." >&4
3164 case "$use64bits" in
3166 echo "Explicit 64-bitness selected." >&4
3167 case "$archname64" in
3172 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3174 *) archname="$archname-$archname64"
3175 echo "...setting architecture name to $archname." >&4
3182 : decide how portable to be. Allow command line overrides.
3183 case "$d_portable" in
3185 *) d_portable="$define" ;;
3188 : set up shell script to do ~ expansion
3194 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3197 if $test -f /bin/csh; then
3198 /bin/csh -f -c "glob \$1"
3203 name=\`$expr x\$1 : '..\([^/]*\)'\`
3204 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3205 if $test ! -d "\$dir"; then
3207 echo "\$me: can't locate home directory for: \$name" >&2
3212 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3228 : now set up to get a file name
3232 cat <<'EOSC' >>getfile
3248 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3249 fn=`echo $fn | sed 's/(.*)//'`
3255 loc_file=`expr $fn : '.*:\(.*\)'`
3256 fn=`expr $fn : '\(.*\):.*'`
3264 */*) fullpath=true;;
3273 *e*) exp_file=true;;
3276 *p*) nopath_ok=true;;
3281 *d*) type='Directory';;
3282 *l*) type='Locate';;
3287 Locate) what='File';;
3292 case "$d_portable" in
3300 while test "$type"; do
3305 true) rp="$rp (~name ok)";;
3308 if test -f UU/getfile.ok && \
3309 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3328 value=`UU/filexp $ans`
3331 if test "$ans" != "$value"; then
3332 echo "(That expands to $value on this system.)"
3346 /*) value="$ansexp" ;;
3351 echo "I shall only accept a full path name, as in /bin/ls." >&4
3352 echo "Use a ! shell escape if you wish to check pathnames." >&4
3355 echo "Please give a full path name, starting with slash." >&4
3358 echo "Note that using ~name is ok provided it expands well." >&4
3371 for fp in $gfpth; do
3372 if test "X$fp" = X.; then
3377 if test -f "$pf"; then
3379 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3381 echo "($value is not a plain file, but that's ok.)"
3384 if test X"$type" = X; then
3391 for fp in $gfpth; do
3392 if test "X$fp" = X.; then
3397 if test -d "$pf"; then
3405 if test -d "$ansexp"; then
3406 echo "(Looking for $loc_file in directory $value.)"
3407 value="$value/$loc_file"
3408 ansexp="$ansexp/$loc_file"
3410 if test -f "$ansexp"; then
3413 case "$nopath_ok" in
3414 true) case "$value" in
3416 *) echo "Assuming $value will be in people's path."
3432 if test "$fastread" = yes; then
3437 rp="$what $value doesn't exist. Use that name anyway?"
3456 test "X$gfpthkeep" != Xy && gfpth=""
3459 : determine root of directory hierarchy where package will be installed.
3462 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3470 By default, $package will be installed in $dflt/bin, manual pages
3471 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3472 installation directories. Typically this is something like /usr/local.
3473 If you wish to have binaries under /usr/bin but other parts of the
3474 installation under /usr/local, that's ok: you will be prompted
3475 separately for each of the installation directories, the prefix being
3476 only used to set the defaults.
3480 rp='Installation prefix to use?'
3488 *) oldprefix="$prefix";;
3498 $define|true) afs=true ;;
3499 $undef|false) afs=false ;;
3500 *) if test -d /afs; then
3508 echo "AFS may be running... I'll be extra cautious then..." >&4
3510 echo "AFS does not seem to be running..." >&4
3513 : determine installation prefix for where package is to be installed.
3517 Since you are running AFS, I need to distinguish the directory in which
3518 files will reside from the directory in which they are installed (and from
3519 which they are presumably copied to the former directory by occult means).
3522 case "$installprefix" in
3523 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3524 *) dflt="$installprefix";;
3529 In some special cases, particularly when building $package for distribution,
3530 it is convenient to distinguish between the directory in which files should
3531 be installed from the directory ($prefix) in which they
3532 will eventually reside. For most users, these two directories are the same.
3535 case "$installprefix" in
3537 *) dflt=$installprefix;;
3541 rp='What installation prefix should I use for installing files?'
3543 installprefix="$ans"
3544 installprefixexp="$ansexp"
3546 : set the prefixit variable, to compute a suitable default value
3547 prefixit='case "$3" in
3549 case "$oldprefix" in
3550 "") eval "$1=\"\$$2\"";;
3557 ""|" ") eval "$1=\"\$$2\"";;
3563 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3565 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3566 /*-$oldprefix/*|\~*-$oldprefix/*)
3567 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3568 *) eval "$1=\"\$$2\"";;
3572 : set the base revision
3575 : get the patchlevel
3577 echo "Getting the current patchlevel..." >&4
3578 if $test -r $rsrc/patchlevel.h;then
3579 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3580 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3581 apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
3587 $echo $n "(You have $package" $c
3590 *) $echo $n " $baserev" $c ;;
3592 $echo $n " patchlevel $patchlevel" $c
3593 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3596 if test 0 -eq "$subversion"; then
3597 version=`LC_ALL=C; export LC_ALL; \
3598 echo $baserev $patchlevel | \
3599 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3601 version=`LC_ALL=C; export LC_ALL; \
3602 echo $baserev $patchlevel $subversion | \
3603 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3606 : determine installation style
3607 : For now, try to deduce it from prefix unless it is already set.
3608 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3609 case "$installstyle" in
3610 '') case "$prefix" in
3611 *perl*) dflt='lib';;
3612 *) dflt='lib/perl5' ;;
3615 *) dflt='lib/perl5' ;;
3617 : Probably not worth prompting for this since we prompt for all
3618 : the directories individually, and the prompt would be too long and
3622 : determine where private library files go
3623 : Usual default is /usr/local/lib/perl5/$version.
3624 : Also allow things like /opt/perl/lib/$version, since
3625 : /opt/perl/lib/perl5... would be redundant.
3626 : The default "style" setting is made in installstyle.U
3627 case "$installstyle" in
3628 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3629 *) set dflt privlib lib/$version ;;
3634 There are some auxiliary files for $package that need to be put into a
3635 private library directory that is accessible by everyone.
3639 rp='Pathname where the private library files will reside?'
3642 privlibexp="$ansexp"
3643 : Change installation prefix, if necessary.
3644 if $test X"$prefix" != X"$installprefix"; then
3645 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
3647 installprivlib="$privlibexp"
3650 : set the prefixup variable, to restore leading tilda escape
3651 prefixup='case "$prefixexp" in
3653 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3656 : determine where public architecture dependent libraries go
3659 : privlib default is /usr/local/lib/$package/$version
3660 : archlib default is /usr/local/lib/$package/$version/$archname
3661 : privlib may have an optional trailing /share.
3662 tdflt=`echo $privlib | $sed 's,/share$,,'`
3663 tdflt=$tdflt/$archname
3672 $spackage contains architecture-dependent library files. If you are
3673 sharing libraries in a heterogeneous environment, you might store
3674 these files in a separate location. Otherwise, you can just include
3675 them with the rest of the public library files.
3679 rp='Where do you want to put the public architecture-dependent libraries?'
3682 archlibexp="$ansexp"
3683 if $test X"$archlib" = X"$privlib"; then
3688 : Change installation prefix, if necessary.
3689 if $test X"$prefix" != X"$installprefix"; then
3690 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
3692 installarchlib="$archlibexp"
3696 : Binary compatibility with 5.005 is not possible for builds
3697 : with advanced features
3698 case "$usethreads$usemultiplicity" in
3700 bincompat5005="$undef"
3701 d_bincompat5005="$undef"
3705 Perl 5.006 can be compiled for binary compatibility with 5.005.
3706 If you decide to do so, you will be able to continue using most
3707 of the extensions that were compiled for Perl 5.005.
3710 case "$bincompat5005$d_bincompat5005" in
3711 *"$undef"*) dflt=n ;;
3714 rp='Binary compatibility with Perl 5.005?'
3717 y*) val="$define" ;;
3722 case "$d_bincompat5005" in
3724 bincompat5005="$define"
3726 *) bincompat5005="$undef"
3727 d_bincompat5005="$undef"
3734 : see if setuid scripts can be secure
3737 Some kernels have a bug that prevents setuid #! scripts from being
3738 secure. Some sites have disabled setuid #! scripts because of this.
3740 First let's decide if your kernel supports secure setuid #! scripts.
3741 (If setuid #! scripts would be secure but have been disabled anyway,
3742 don't say that they are secure if asked.)
3747 if $test -d /dev/fd; then
3748 echo "#!$ls" >reflect
3749 chmod +x,u+s reflect
3750 ./reflect >flect 2>&1
3751 if $contains "/dev/fd" flect >/dev/null; then
3752 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3756 If you are not sure if they are secure, I can check but I'll need a
3757 username and password different from the one you are using right now.
3758 If you don't have such a username or don't want me to test, simply
3762 rp='Other username to test security of setuid scripts with?'
3767 case "$d_suidsafe" in
3768 '') echo "I'll assume setuid scripts are *not* secure." >&4
3771 echo "Well, the $hint value is *not* secure." >&4
3773 *) echo "Well, the $hint value *is* secure." >&4
3778 $rm -f reflect flect
3779 echo "#!$ls" >reflect
3780 chmod +x,u+s reflect
3783 echo '"su" will (probably) prompt you for '"$ans's password."
3784 su $ans -c './reflect >flect'
3785 if $contains "/dev/fd" flect >/dev/null; then
3786 echo "Okay, it looks like setuid scripts are secure." >&4
3789 echo "I don't think setuid scripts are secure." >&4
3794 rp='Does your kernel have *secure* setuid scripts?'
3797 [yY]*) val="$define";;
3802 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3803 echo "(That's for file descriptors, not floppy disks.)"
3809 $rm -f reflect flect
3811 : now see if they want to do setuid emulation
3814 case "$d_suidsafe" in
3817 echo "No need to emulate SUID scripts since they are secure here." >& 4
3821 Some systems have disabled setuid scripts, especially systems where
3822 setuid scripts cannot be secure. On systems where setuid scripts have
3823 been disabled, the setuid/setgid bits on scripts are currently
3824 useless. It is possible for $package to detect those bits and emulate
3825 setuid/setgid in a secure fashion. This emulation will only work if
3826 setuid scripts have been disabled in your kernel.
3830 "$define") dflt=y ;;
3833 rp="Do you want to do setuid/setgid emulation?"
3836 [yY]*) val="$define";;
3844 : What should the include directory be ?
3846 $echo $n "Hmm... $c"
3850 if $test -f /bin/mips && /bin/mips; then
3851 echo "Looks like a MIPS system..."
3852 $cat >usr.c <<'EOCP'
3853 #ifdef SYSTYPE_BSD43
3857 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3858 dflt='/bsd43/usr/include'
3862 mips_type='System V'
3864 $rm -f usr.c usr.out
3865 echo "and you're compiling with the $mips_type compiler and libraries."
3869 echo "Doesn't look like a MIPS system."
3879 case "$xxx_prompt" in
3882 rp='Where are the include files you want to use?'
3890 : see how we invoke the C preprocessor
3892 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3893 cat <<'EOT' >testcpp.c
3899 if test ! -f cppstdin; then
3900 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3901 # AIX cc -E doesn't show the absolute headerfile
3902 # locations but we'll cheat by using the -M flag.
3903 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
3905 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3908 echo "Keeping your $hint cppstdin wrapper."
3911 wrapper=`pwd`/cppstdin
3915 if $test "X$cppstdin" != "X" && \
3916 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3917 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3919 echo "You used to use $cppstdin $cppminus so we'll use that again."
3921 '') echo "But let's see if we can live without a wrapper..." ;;
3923 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3924 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3926 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3929 echo "(However, $cpprun $cpplast does not work, let's see...)"
3937 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3944 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3945 $cc -E <testcpp.c >testcpp.out 2>&1; \
3946 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3947 echo "Yup, it does."
3950 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3951 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3952 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3953 echo "Yup, it does."
3956 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3957 $cc -P <testcpp.c >testcpp.out 2>&1; \
3958 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3959 echo "Yipee, that works!"
3962 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3963 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3964 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3965 echo "At long last!"
3968 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3969 $cpp <testcpp.c >testcpp.out 2>&1; \
3970 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3974 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3975 $cpp - <testcpp.c >testcpp.out 2>&1; \
3976 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3977 echo "Hooray, it works! I was beginning to wonder."
3980 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3981 $wrapper <testcpp.c >testcpp.out 2>&1; \
3982 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3988 rp="No dice. I can't find a C preprocessor. Name one:"
3992 $x_cpp <testcpp.c >testcpp.out 2>&1
3993 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3994 echo "OK, that will do." >&4
3996 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4011 echo "Perhaps can we force $cc -E using a wrapper..."
4012 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4013 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4019 echo "Nope, we'll have to live without it..."
4033 "$wrapper"|'cppstdin') ;;
4034 *) $rm -f $wrapper;;
4036 $rm -f testcpp.c testcpp.out
4038 : Set private lib path
4041 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4046 '') dlist="$loclibpth $plibpth $glibpth";;
4047 *) dlist="$libpth";;
4050 : Now check and see which directories actually exist, avoiding duplicates
4054 if $test -d $xxx; then
4057 *) libpth="$libpth $xxx";;
4063 Some systems have incompatible or broken versions of libraries. Among
4064 the directories listed in the question below, please remove any you
4065 know not to be holding relevant libraries, and add any that are needed.
4066 Say "none" for none.
4077 rp="Directories to use for library searches?"
4084 : compute shared library extension
4087 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4097 On some systems, shared libraries may be available. Answer 'none' if
4098 you want to suppress searching of shared libraries for the remaining
4099 of this configuration.
4102 rp='What is the file extension used for shared libraries?'
4106 : Define several unixisms.
4107 : Hints files or command line option can be used to override them.
4108 : The convoluted testing is in case hints files set either the old
4111 '') case "$exe_ext" in
4113 *) _exe="$exe_ext" ;;
4118 '') case "$lib_ext" in
4125 '') case "$obj_ext" in
4132 '') case "$path_sep" in
4143 : Which makefile gets called first. This is used by make depend.
4144 case "$firstmakefile" in
4145 '') firstmakefile='makefile';;
4150 Perl can be built to use the SOCKS proxy protocol library. To do so,
4151 Configure must be run with -Dusesocks.
4153 Normally you do not need this and you should answer no.
4157 $define|true|[yY]*) dflt='y';;
4160 rp='Build Perl for SOCKS?'
4163 y|Y) val="$define" ;;
4169 : Looking for optional libraries
4171 echo "Checking for optional libraries..." >&4
4176 case "$libswanted" in
4177 '') libswanted='c_s';;
4181 libswanted="$libswanted socks5 socks5_sh"
4184 for thislib in $libswanted; do
4186 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4187 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4188 echo "Found -l$thislib (shared)."
4191 *) dflt="$dflt -l$thislib";;
4193 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4194 echo "Found -l$thislib (shared)."
4197 *) dflt="$dflt -l$thislib";;
4199 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4200 echo "Found -l$thislib."
4203 *) dflt="$dflt -l$thislib";;
4205 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4206 echo "Found -l$thislib."
4209 *) dflt="$dflt -l$thislib";;
4211 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4212 echo "Found -l${thislib}_s."
4215 *) dflt="$dflt -l${thislib}_s";;
4217 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4218 echo "Found -l$thislib."
4221 *) dflt="$dflt -l$thislib";;
4224 echo "No -l$thislib."
4235 ' '|'') dflt='none';;
4240 In order to compile $package on your machine, a number of libraries
4241 are usually needed. Include any other special libraries here as well.
4242 Say "none" for none. The default list is almost always right.
4246 rp="What libraries to use?"
4253 : determine optimization, if desired, or use for debug flag also
4255 ' '|$undef) dflt='none';;
4257 *) dflt="$optimize";;
4261 By default, $package compiles with the -O flag to use the optimizer.
4262 Alternately, you might want to use the symbolic debugger, which uses
4263 the -g flag (on traditional Unix systems). Either flag can be
4264 specified here. To use neither flag, specify the word "none".
4267 rp="What optimizer/debugger flag should be used?"
4271 'none') optimize=" ";;
4275 : We will not override a previous value, but we might want to
4276 : augment a hint file
4278 default|recommended)
4279 case "$gccversion" in
4280 1*) dflt='-fpcc-struct-return' ;;
4283 *-g*) dflt="$dflt -DDEBUGGING";;
4285 case "$gccversion" in
4286 2*) if test -d /etc/conf/kconfig.d &&
4287 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4293 case "$gccversion" in
4297 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4298 echo 'int main(void) { return 0; }' > gcctest.c
4299 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4300 echo "Yes, it does." 2>&1
4303 echo "Leaving current flags $ccflags alone." 2>&1
4305 *) dflt="$dflt -fno-strict-aliasing" ;;
4308 echo "Nope, it doesn't, but that's ok." 2>&1
4315 case "$mips_type" in
4316 *BSD*|'') inclwanted="$locincpth $usrinc";;
4317 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4319 for thisincl in $inclwanted; do
4320 if $test -d $thisincl; then
4321 if $test x$thisincl != x$usrinc; then
4324 *) dflt="$dflt -I$thisincl";;
4330 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4332 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4340 *) dflt="$dflt -D$2";;
4344 set signal.h LANGUAGE_C; eval $inctest
4348 ccflags="$ccflags -DSOCKS"
4353 default|recommended) dflt="$ccflags $dflt" ;;
4354 *) dflt="$ccflags";;
4362 Your C compiler may want other flags. For this question you should include
4363 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4364 but you should NOT include libraries or ld flags like -lwhatever. If you
4365 want $package to honor its debug switch, you should include -DDEBUGGING here.
4366 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4368 To use no flags, specify the word "none".
4374 rp="Any additional cc flags?"
4381 : the following weeds options from ccflags that are of no interest to cpp
4383 case "$gccversion" in
4384 1*) cppflags="$cppflags -D__GNUC__"
4386 case "$mips_type" in
4388 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4394 echo "Let me guess what the preprocessor flags are..." >&4
4408 *) ftry="$previous $flag";;
4410 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4411 >cpp1.out 2>/dev/null && \
4412 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4413 >cpp2.out 2>/dev/null && \
4414 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4415 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4417 cppflags="$cppflags $ftry"
4427 *-*) echo "They appear to be: $cppflags";;
4429 $rm -f cpp.c cpp?.out
4433 : flags used in final linking phase
4435 '') if ./venix; then
4441 *-posix*) dflt="$dflt -posix" ;;
4444 *) dflt="$ldflags";;
4447 : Try to guess additional flags to pick up local libraries.
4448 for thislibdir in $libpth; do
4449 case " $loclibpth " in
4452 *"-L$thislibdir "*) ;;
4453 *) dflt="$dflt -L$thislibdir" ;;
4465 Your C linker may need flags. For this question you should
4466 include -L/whatever and any other flags used by the C linker, but you
4467 should NOT include libraries like -lwhatever.
4469 Make sure you include the appropriate -L/path flags if your C linker
4470 does not normally search all of the directories you specified above,
4473 To use no flags, specify the word "none".
4477 rp="Any additional ld flags (NOT including libraries)?"
4483 rmlist="$rmlist pdp11"
4487 echo "Checking your choice of C compiler and flags for coherency..." >&4
4488 $cat > try.c <<'EOF'
4490 int main() { printf("Ok\n"); exit(0); }
4492 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4494 $cat >try.msg <<'EOM'
4495 I've tried to compile and run the following simple program:
4498 $cat try.c >> try.msg
4500 $cat >> try.msg <<EOM
4507 and I got the following output:
4511 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4512 if sh -c './try' >>try.msg 2>&1; then
4516 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4519 cat >> try.msg <<'EOQS'
4520 If $libs contains -lsfio, and sfio is mis-configured, then it
4521 sometimes (apparently) runs and exits with a 0 status, but with no
4522 output! It may have to do with sfio's use of _exit vs. exit.
4525 rp="You have a big problem. Shall I abort Configure"
4532 echo "The program compiled OK, but exited with status $?." >>try.msg
4533 rp="You have a problem. Shall I abort Configure"
4537 echo "I can't compile the test program." >>try.msg
4538 rp="You have a BIG problem. Shall I abort Configure"
4544 case "$knowitall" in
4546 echo "(The supplied flags or libraries might be incorrect.)"
4554 *) echo "Ok. Stopping Configure." >&4
4559 n) echo "OK, that should do.";;
4561 $rm -f try try.* core
4563 : determine filename position in cpp output
4565 echo "Computing filename position in cpp output for #include directives..." >&4
4566 echo '#include <stdio.h>' > foo.c
4569 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4570 $grep '^[ ]*#.*stdio\.h' | \
4571 while read cline; do
4574 while $test \$# -gt 0; do
4575 if $test -r \`echo \$1 | $tr -d '"'\`; then
4580 pos=\`expr \$pos + 1\`
4592 *) pos="${fieldn}th";;
4594 echo "Your cpp writes the filename in the $pos field of the line."
4596 : locate header file
4601 for usrincdir in $usrinc
4603 if test -f \$usrincdir/\$wanted; then
4604 echo "\$usrincdir/\$wanted"
4608 awkprg='{ print \$$fieldn }'
4609 echo "#include <\$wanted>" > foo\$\$.c
4610 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4611 $grep "^[ ]*#.*\$wanted" | \
4612 while read cline; do
4613 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4615 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4616 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4621 # status = 0: grep returned 0 lines, case statement not executed
4622 # status = 1: headerfile found
4623 # status = 2: while loop executed, no headerfile found
4627 if test \$status -eq 1; then
4634 : define an alternate in-header-list? function
4635 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4636 cont=true; xxf="echo \"<\$1> found.\" >&4";
4637 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4638 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4640 case $# in 4) instead=instead;; *) instead="at last";; esac;
4641 while $test "$cont"; do
4643 var=$2; eval "was=\$$2";
4644 if $test "$xxx" && $test -r "$xxx";
4646 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4649 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4650 set $yyy; shift; shift; yyy=$@;
4651 case $# in 0) cont="";;
4652 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4653 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4654 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4655 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4659 do set $yyy; var=$2; eval "was=\$$2";
4660 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4661 set $yyy; shift; shift; yyy=$@;
4664 : see if this is a malloc.h system
4665 set malloc.h i_malloc
4668 : see if stdlib is available
4669 set stdlib.h i_stdlib
4672 : determine which malloc to compile in
4674 case "$usemymalloc" in
4675 ''|[yY]*|true|$define) dflt='y' ;;
4678 rp="Do you wish to attempt to use the malloc that comes with $package?"
4684 mallocsrc='malloc.c'
4685 mallocobj="malloc$_o"
4686 d_mymalloc="$define"
4689 : Remove malloc from list of libraries to use
4690 echo "Removing unneeded -lmalloc from library list" >&4
4691 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4694 echo "libs = $libs" >&4
4706 : compute the return types of malloc and free
4708 $cat >malloc.c <<END
4712 #include <sys/types.h>
4726 case "$malloctype" in
4728 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4735 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4739 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4746 echo "Your system uses $freetype free(), it would seem." >&4
4750 The installation process will also create a directory for
4751 vendor-supplied add-ons. Vendors who supply perl with their system
4752 may find it convenient to place all vendor-supplied files in this
4753 directory rather than in the main distribution directory. This will
4754 ease upgrades between binary-compatible maintenance versions of perl.
4756 Of course you may also use these directories in whatever way you see
4757 fit. For example, you might use them to access modules shared over a
4758 company-wide network.
4760 The default answer should be fine for most people.
4761 This causes further questions about vendor add-ons to be skipped
4762 and no vendor-specific directories will be configured for perl.
4765 rp='Do you want to configure vendor-specific add-on directories?'
4766 case "$usevendorprefix" in
4767 define|true|[yY]*) dflt=y ;;
4773 rp='Installation prefix to use for vendor-supplied add-ons?'
4774 case "$vendorprefix" in
4776 *) dflt=$vendorprefix ;;
4780 case "$vendorprefix" in
4784 *) oldvendorprefix="$prefix";;
4788 usevendorprefix="$define"
4790 vendorprefixexp="$ansexp"
4792 *) usevendorprefix="$undef"
4798 case "$vendorprefix" in
4799 '') d_vendorlib="$undef"
4803 *) d_vendorlib="$define"
4804 : determine where vendor-supplied modules go.
4805 : Usual default is /usr/local/lib/perl5/vendor_perl
4806 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4807 case "$installstyle" in
4808 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4809 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4812 rp='Pathname for the vendor-supplied library files?'
4815 vendorlibexp="$ansexp"
4816 : Change installation prefix, if necessary.
4817 if $test X"$prefix" != X"$installprefix"; then
4818 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
4820 installvendorlib="$vendorlibexp"
4825 : Cruising for prototypes
4827 echo "Checking out function prototypes..." >&4
4828 $cat >prototype.c <<'EOCP'
4829 int main(int argc, char *argv[]) {
4832 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4833 echo "Your C compiler appears to support function prototypes."
4836 echo "Your C compiler doesn't seem to understand function prototypes."
4843 case "$prototype" in
4845 *) ansi2knr='ansi2knr'
4850 This version of $package can only be compiled by a compiler that
4851 understands function prototypes. Unfortunately, your C compiler
4853 doesn't seem to understand them. Sorry about that.
4855 If GNU cc is available for your system, perhaps you could try that instead.
4857 Eventually, we hope to support building Perl with pre-ANSI compilers.
4858 If you would like to help in that effort, please contact <perlbug@perl.org>.
4860 Aborting Configure now.
4866 : determine where public executables go
4871 rp='Pathname where the public executables will reside?'
4873 if $test "X$ansexp" != "X$binexp"; then
4878 : Change installation prefix, if necessary.
4879 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4880 if $test X"$prefix" != X"$installprefix"; then
4881 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
4883 installbin="$binexp"
4886 : determine whether to install perl also as /usr/bin/perl
4889 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4891 Many scripts expect to perl to be installed as /usr/bin/perl.
4892 I can install the perl you are about to compile also as /usr/bin/perl
4893 (in addition to $installbin/perl).
4895 case "$installusrbinperl" in
4896 "$undef"|[nN]*) dflt='n';;
4899 rp="Do you want to install perl as /usr/bin/perl?"
4902 [yY]*) val="$define";;
4908 set installusrbinperl
4911 : define a shorthand compile call
4915 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4916 : define a shorthand compile call for compilations that should be ok.
4920 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4923 echo "Checking for GNU C Library..." >&4
4924 cat >gnulibc.c <<EOM
4936 if eval $compile_ok && ./gnulibc; then
4938 echo "You are using the GNU C Library"
4941 echo "You are not using the GNU C Library"
4947 : see if nm is to be used to determine whether a symbol is defined or not
4951 case "$d_gnulibc" in
4954 echo "nm probably won't work on the GNU C Library." >&4
4960 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4962 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4963 echo "'nm' won't be sufficient on this sytem." >&4
4969 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4970 if $test $dflt -gt 20; then
4980 true|$define) dflt=y;;
4987 I can use $nm to extract the symbols from your C libraries. This
4988 is a time consuming task which may generate huge output on the disk (up
4989 to 3 megabytes) but that should make the symbols extraction faster. The
4990 alternative is to skip the 'nm' extraction part and to compile a small
4991 test program instead to determine whether each symbol is present. If
4992 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4993 this may be the best solution.
4995 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4998 rp="Shall I use $nm to extract C symbols from the libraries?"
5001 [Nn]*) usenm=false;;
5010 : nm options which may be necessary
5012 '') if $test -f /mach_boot; then
5014 elif $test -d /usr/ccs/lib; then
5015 nm_opt='-p' # Solaris (and SunOS?)
5016 elif $test -f /dgux; then
5018 elif $test -f /lib64/rld; then
5019 nm_opt='-p' # 64-bit Irix
5025 : nm options which may be necessary for shared libraries but illegal
5026 : for archive libraries. Thank you, Linux.
5027 case "$nm_so_opt" in
5028 '') case "$myuname" in
5030 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5031 nm_so_opt='--dynamic'
5040 : get list of predefined functions in a handy place
5045 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5052 *) for thislib in $libs; do
5055 : Handle C library specially below.
5058 thislib=`echo $thislib | $sed -e 's/^-l//'`
5059 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5061 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5063 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5065 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5067 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5069 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5071 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5076 libnames="$libnames $try"
5078 *) libnames="$libnames $thislib" ;;
5087 for xxx in $libpth; do
5088 $test -r $1 || set $xxx/libc.$so
5089 : The messy sed command sorts on library version numbers.
5091 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5092 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5094 s/[0-9][0-9]*/0000&/g
5095 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5098 sort | $sed -e 's/^.* //'`
5101 $test -r $1 || set /usr/ccs/lib/libc.$so
5102 $test -r $1 || set /lib/libsys_s$_a
5108 if $test -r "$1"; then
5109 echo "Your (shared) C library seems to be in $1."
5111 elif $test -r /lib/libc && $test -r /lib/clib; then
5112 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5114 libc='/lib/clib /lib/libc'
5115 if $test -r /lib/syslib; then
5116 echo "(Your math library is in /lib/syslib.)"
5117 libc="$libc /lib/syslib"
5119 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5120 echo "Your C library seems to be in $libc, as you said before."
5121 elif $test -r $incpath/usr/lib/libc$_a; then
5122 libc=$incpath/usr/lib/libc$_a;
5123 echo "Your C library seems to be in $libc. That's fine."
5124 elif $test -r /lib/libc$_a; then
5126 echo "Your C library seems to be in $libc. You're normal."
5128 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5130 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5131 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5132 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5134 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5136 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5139 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5141 if $test -r "$tans"; then
5142 echo "Your C library seems to be in $tans, of all places."
5148 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5152 If the guess above is wrong (which it might be if you're using a strange
5153 compiler, or your machine supports multiple models), you can override it here.
5158 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5160 I can't seem to find your C library. I've looked in the following places:
5163 $sed 's/^/ /' libpath
5166 None of these seems to contain your C library. I need to get its name...
5171 rp='Where is your C library?'
5176 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5177 set X `cat libnames`
5180 case $# in 1) xxx=file; esac
5181 echo "Extracting names from the following $xxx for later perusal:" >&4
5183 $sed 's/^/ /' libnames >&4
5185 $echo $n "This may take a while...$c" >&4
5189 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5190 *) $nm $nm_opt $file 2>/dev/null;;
5195 $grep fprintf libc.tmp > libc.ptf
5196 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5197 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5199 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5201 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5203 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5205 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5207 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5209 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5211 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5213 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5215 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5217 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5219 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5221 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5223 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5224 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5226 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5228 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5230 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5232 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5234 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5236 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5238 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5240 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5242 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5244 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5246 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5248 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5250 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5252 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5254 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5257 $nm -p $* 2>/dev/null >libc.tmp
5258 $grep fprintf libc.tmp > libc.ptf
5259 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5260 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5266 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5268 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5269 for thisname in $libnames $libc; do
5270 $ar t $thisname >>libc.tmp
5272 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5274 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5275 # Repeat libc to extract forwarders to DLL entries too
5276 for thisname in $libnames $libc; do
5277 $ar tv $thisname >>libc.tmp
5278 # Revision 50 of EMX has bug in $ar.
5279 # it will not extract forwarders to DLL entries
5280 # Use emximp which will extract exactly them.
5281 emximp -o tmp.imp $thisname \
5283 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5284 < tmp.imp >>libc.tmp
5287 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5290 echo "$ar didn't seem to work right." >&4
5291 echo "Maybe this is a Cray...trying bld instead..." >&4
5292 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5294 for thisname in $libnames; do
5296 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5297 $ar t $thisname >>libc.tmp
5301 echo "That didn't work either. Giving up." >&4
5308 if $test -f /lib/syscalls.exp; then
5310 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5311 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5315 $rm -f libnames libpath
5317 : see if dld is available
5321 : is a C symbol defined?
5324 -v) tf=libc.tmp; tc=""; tdc="";;
5325 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5326 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5329 case "$reuseval-$4" in
5331 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5337 if $contains $tlook $tf >/dev/null 2>&1;
5342 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5343 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5351 $define) tval=true;;
5357 : define an is-in-libc? function
5358 inlibc='echo " "; td=$define; tu=$undef;
5359 sym=$1; var=$2; eval "was=\$$2";
5361 case "$reuseval$was" in
5371 echo "$sym() found." >&4;
5372 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5374 echo "$sym() NOT found." >&4;
5375 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5379 $define) echo "$sym() found." >&4;;
5380 *) echo "$sym() NOT found." >&4;;
5384 : see if dlopen exists
5391 : determine which dynamic loading, if any, to compile in
5393 dldir="ext/DynaLoader"
5406 $define) dflt='y' ;;
5409 $define) dflt='y' ;;
5411 : Does a dl_xxx.xs file exist for this operating system
5412 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5415 rp="Do you wish to use dynamic loading?"
5422 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5423 dflt="$dldir/dl_${osname}.xs"
5424 elif $test "$d_dlopen" = "$define" ; then
5425 dflt="$dldir/dl_dlopen.xs"
5426 elif $test "$i_dld" = "$define" ; then
5427 dflt="$dldir/dl_dld.xs"
5432 *) dflt="$dldir/$dlsrc"
5435 echo "The following dynamic loading files are available:"
5436 : Can not go over to $dldir because getfile has path hard-coded in.
5437 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5438 rp="Source file to use for dynamic loading"
5444 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5448 Some systems may require passing special flags to $cc -c to
5449 compile modules that will be used to create a shared library.
5450 To use no flags, say "none".
5453 case "$cccdlflags" in
5454 '') case "$gccversion" in
5455 '') case "$osname" in
5457 next) dflt='none' ;;
5458 irix*) dflt='-KPIC' ;;
5459 svr4*|esix*|solaris) dflt='-KPIC' ;;
5460 sunos) dflt='-pic' ;;
5464 *) case "$osname" in
5465 svr4*|esix*|solaris) dflt='-fPIC' ;;
5470 *) dflt="$cccdlflags" ;;
5472 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5475 none) cccdlflags=' ' ;;
5476 *) cccdlflags="$ans" ;;
5481 Some systems use ld to create libraries that can be dynamically loaded,
5482 while other systems (such as those using ELF) use $cc.
5486 '') $cat >try.c <<'EOM'
5487 /* Test for whether ELF binaries are produced */
5492 int i = open("a.out",O_RDONLY);
5495 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5496 exit(0); /* succeed (yes, it's ELF) */
5501 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5503 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5507 echo "I'll use ld to build dynamic libraries."
5516 rp="What command should be used to create dynamic libraries?"
5522 Some systems may require passing special flags to $ld to create a
5523 library that can be dynamically loaded. If your ld flags include
5524 -L/other/path options to locate libraries outside your loader's normal
5525 search path, you may need to specify those -L options here as well. To
5526 use no flags, say "none".
5529 case "$lddlflags" in
5530 '') case "$osname" in
5531 beos) dflt='-nostart' ;;
5533 linux|irix*) dflt='-shared' ;;
5534 next) dflt='none' ;;
5535 solaris) dflt='-G' ;;
5536 sunos) dflt='-assert nodefinitions' ;;
5537 svr4*|esix*) dflt="-G $ldflags" ;;
5541 *) dflt="$lddlflags" ;;
5544 : Try to guess additional flags to pick up local libraries.
5545 : Be careful not to append to a plain 'none'
5549 for thisflag in $ldflags; do
5554 *) dflt="$dflt $thisflag" ;;
5561 ''|' ') dflt='none' ;;
5564 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5567 none) lddlflags=' ' ;;
5568 *) lddlflags="$ans" ;;
5573 Some systems may require passing special flags to $cc to indicate that
5574 the resulting executable will use dynamic linking. To use no flags,
5578 case "$ccdlflags" in
5579 '') case "$osname" in
5580 hpux) dflt='-Wl,-E' ;;
5581 linux) dflt='-rdynamic' ;;
5582 next) dflt='none' ;;
5583 sunos) dflt='none' ;;
5587 *) dflt="$ccdlflags" ;;
5589 rp="Any special flags to pass to $cc to use dynamic loading?"
5592 none) ccdlflags=' ' ;;
5593 *) ccdlflags="$ans" ;;
5607 # No dynamic loading being used, so don't bother even to prompt.
5610 *) case "$useshrplib" in
5611 '') case "$osname" in
5612 svr4*|dgux|dynixptx|esix|powerux|beos)
5614 also='Building a shared libperl is required for dynamic loading to work on your system.'
5619 also='Building a shared libperl is needed for MAB support.'
5637 The perl executable is normally obtained by linking perlmain.c with
5638 libperl${_a}, any static extensions (usually just DynaLoader), and
5639 any other libraries needed on this system (such as -lm, etc.). Since
5640 your system supports dynamic loading, it is probably possible to build
5641 a shared libperl.$so. If you will have more than one executable linked
5642 to libperl.$so, this will significantly reduce the size of each
5643 executable, but it may have a noticeable affect on performance. The
5644 default is probably sensible for your system.
5648 rp="Build a shared libperl.$so (y/n)"
5652 useshrplib='true' ;;
5653 *) useshrplib='false' ;;
5658 case "$useshrplib" in
5662 # Figure out a good name for libperl.so. Since it gets stored in
5663 # a version-specific architecture-dependent library, the version
5664 # number isn't really that important, except for making cc/ld happy.
5666 # A name such as libperl.so.3.1
5667 majmin="libperl.$so.$patchlevel.$subversion"
5668 # A name such as libperl.so.301
5669 majonly=`echo $patchlevel $subversion |
5670 $awk '{printf "%d%02d", $1, $2}'`
5671 majonly=libperl.$so.$majonly
5672 # I'd prefer to keep the os-specific stuff here to a minimum, and
5673 # rely on figuring it out from the naming of libc.
5674 case "${osname}${osvers}" in
5677 # XXX How handle the --version stuff for MAB?
5679 linux*) # ld won't link with a bare -lperl otherwise.
5682 *) # Try to guess based on whether libc has major.minor.
5684 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5685 *libc.$so.[0-9]*) dflt=$majonly ;;
5686 *) dflt=libperl.$so ;;
5696 I need to select a good name for the shared libperl. If your system uses
5697 library names with major and minor numbers, then you might want something
5698 like $majmin. Alternatively, if your system uses a single version
5699 number for shared libraries, then you might want to use $majonly.
5700 Or, your system might be quite happy with a simple libperl.$so.
5702 Since the shared libperl will get installed into a version-specific
5703 architecture-dependent directory, the version number of the shared perl
5704 library probably isn't important, so the default should be o.k.
5707 rp='What name do you want to give to the shared libperl?'
5710 echo "Ok, I'll use $libperl"
5713 libperl="libperl${_a}"
5717 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5721 WARNING: Use of the shrpdir variable for the installation location of
5722 the shared $libperl is not supported. It was never documented and
5723 will not work in this version. Let me (perlbug@perl.com)
5724 know of any problems this may cause.
5730 But your current setting of $shrpdir is
5731 the default anyway, so it's harmless.
5736 Further, your current attempted setting of $shrpdir
5737 conflicts with the value of $archlibexp/CORE
5738 that installperl will use.
5745 # How will the perl executable find the installed shared $libperl?
5746 # Add $xxx to ccdlflags.
5747 # If we can't figure out a command-line option, use $shrpenv to
5748 # set env LD_RUN_PATH. The main perl makefile uses this.
5749 shrpdir=$archlibexp/CORE
5752 if "$useshrplib"; then
5755 # We'll set it in Makefile.SH...
5761 xxx="-Wl,-R$shrpdir"
5763 linux|irix*|dec_osf)
5764 xxx="-Wl,-rpath,$shrpdir"
5767 # next doesn't like the default...
5770 # beos doesn't like the default, either.
5773 # hpux doesn't like the default, either.
5774 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5777 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5783 # Only add $xxx if it isn't already in ccdlflags.
5784 case " $ccdlflags " in
5786 *) ccdlflags="$ccdlflags $xxx"
5789 Adding $xxx to the flags
5790 passed to $ld so that the perl executable will find the
5791 installed shared $libperl.
5799 # Fix ccdlflags in AIX for building external extensions.
5800 # (For building Perl itself bare -bE:perl.exp is needed,
5801 # Makefile.SH takes care of this.)
5803 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5805 # Respect a hint or command-line value.
5807 '') shrpenv="$tmp_shrpenv" ;;
5809 case "$ldlibpthname" in
5810 '') ldlibpthname=LD_LIBRARY_PATH ;;
5811 none) ldlibpthname='' ;;
5814 : determine where manual pages go
5815 set man1dir man1dir none
5819 $spackage has manual pages available in source form.
5823 echo "However, you don't have nroff, so they're probably useless to you."
5825 '') man1dir="none";;
5828 echo "If you don't want the manual sources installed, answer 'none'."
5833 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5834 lookpath="$lookpath $prefixexp/man/p_man/man1"
5835 lookpath="$lookpath $prefixexp/man/u_man/man1"
5836 lookpath="$lookpath $prefixexp/man/man.1"
5838 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5839 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5849 rp="Where do the main $spackage manual pages (source) go?"
5851 if $test "X$man1direxp" != "X$ansexp"; then
5855 man1direxp="$ansexp"
5861 : Change installation prefix, if necessary.
5862 if $test X"$prefix" != X"$installprefix"; then
5863 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
5865 installman1dir="$man1direxp"
5868 : What suffix to use on installed man pages
5875 rp="What suffix should be used for the main $spackage man pages?"
5877 '') case "$man1dir" in
5891 *) dflt="$man1ext";;
5898 : see if we can have long filenames
5900 rmlist="$rmlist /tmp/cf$$"
5901 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5902 first=123456789abcdef
5903 second=/tmp/cf$$/$first
5904 $rm -f $first $second
5905 if (echo hi >$first) 2>/dev/null; then
5906 if $test -f 123456789abcde; then
5907 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5910 if (echo hi >$second) 2>/dev/null; then
5911 if $test -f /tmp/cf$$/123456789abcde; then
5913 That's peculiar... You can have filenames longer than 14 characters, but only
5914 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5915 I shall consider your system cannot support long filenames at all.
5919 echo 'You can have filenames longer than 14 characters.' >&4
5924 How confusing! Some of your filesystems are sane enough to allow filenames
5925 longer than 14 characters but some others like /tmp can't even think about them.
5926 So, for now on, I shall assume your kernel does not allow them at all.
5933 You can't have filenames longer than 14 chars. You can't even think about them!
5939 $rm -rf /tmp/cf$$ 123456789abcde*
5941 : determine where library module manual pages go
5942 set man3dir man3dir none
5946 $spackage has manual pages for many of the library modules.
5952 However, you don't have nroff, so they're probably useless to you.
5955 '') man3dir="none";;
5959 case "$d_flexfnam" in
5962 However, your system can't handle the long file names like File::Basename.3.
5965 '') man3dir="none";;
5969 echo "If you don't want the manual sources installed, answer 'none'."
5970 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5972 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
5973 if $test -d "$privlib/man/man3"; then
5976 WARNING: Previous versions of perl installed man3 pages into
5977 $privlib/man/man3. This version will suggest a
5978 new default of $dflt.
5982 rp='Do you wish to preserve the old behavior?(y/n)'
5985 y*) dflt="$privlib/man/man3" ;;
5991 *) dflt="$man3dir" ;;
5995 rp="Where do the $package library man pages (source) go?"
5998 man3direxp="$ansexp"
6004 : Change installation prefix, if necessary.
6005 if $test X"$prefix" != X"$installprefix"; then
6006 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6008 installman3dir="$man3direxp"
6011 : What suffix to use on installed man pages
6017 rp="What suffix should be used for the $package library man pages?"
6019 '') case "$man3dir" in
6033 *) dflt="$man3ext";;
6040 : see if we have to deal with yellow pages, now NIS.
6041 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6042 if $test -f /usr/etc/nibindd; then
6044 echo "I'm fairly confident you're on a NeXT."
6046 rp='Do you get the hosts file via NetInfo?'
6055 y*) hostcat='nidump hosts .';;
6056 *) case "$hostcat" in
6057 nidump*) hostcat='';;
6067 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6075 rp='Are you getting the hosts file via yellow pages?'
6078 y*) hostcat='ypcat hosts';;
6079 *) hostcat='cat /etc/hosts';;
6085 '') hostcat='cat /etc/hosts';;
6088 '') groupcat='cat /etc/group';;
6091 '') passcat='cat /etc/passwd';;
6094 : now get the host name
6096 echo "Figuring out host name..." >&4
6097 case "$myhostname" in
6099 echo 'Maybe "hostname" will work...'
6100 if tans=`sh -c hostname 2>&1` ; then
6108 if $test "$cont"; then
6110 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6111 if tans=`cat /etc/systemid 2>&1` ; then
6113 phostname='cat /etc/systemid'
6114 echo "Whadyaknow. Xenix always was a bit strange..."
6117 elif $test -r /etc/systemid; then
6118 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6121 if $test "$cont"; then
6122 echo 'No, maybe "uuname -l" will work...'
6123 if tans=`sh -c 'uuname -l' 2>&1` ; then
6125 phostname='uuname -l'
6127 echo 'Strange. Maybe "uname -n" will work...'
6128 if tans=`sh -c 'uname -n' 2>&1` ; then
6130 phostname='uname -n'
6132 echo 'Oh well, maybe I can mine it out of whoami.h...'
6133 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6134 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6135 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6137 case "$myhostname" in
6138 '') echo "Does this machine have an identity crisis or something?"
6141 echo "Well, you said $myhostname before..."
6142 phostname='echo $myhostname';;
6148 : you do not want to know about this
6153 if $test "$myhostname" ; then
6155 rp='Your host name appears to be "'$myhostname'".'" Right?"
6163 : bad guess or no guess
6164 while $test "X$myhostname" = X ; do
6166 rp="Please type the (one word) name of your host:"
6171 : translate upper to lower if necessary
6172 case "$myhostname" in
6174 echo "(Normalizing case in your host name)"
6175 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6179 case "$myhostname" in
6181 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6182 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6183 echo "(Trimming domain name from host name--host name is now $myhostname)"
6185 *) case "$mydomain" in
6188 test "X$hostcat" = "Xypcat hosts" &&
6189 ypmatch "$myhostname" hosts 2>/dev/null |\
6190 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6193 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6194 /[ ]$myhostname[ . ]/p" > hosts
6197 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6198 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6199 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6200 hosts | $sort | $uniq | \
6201 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6202 case `$echo X$dflt` in
6203 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6206 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6211 tans=`./loc resolv.conf X /etc /usr/etc`
6212 if $test -f "$tans"; then
6213 echo "(Attempting domain name extraction from $tans)"
6214 dflt=.`$sed -n -e 's/ / /g' \
6215 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6216 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6218 .) dflt=.`$sed -n -e 's/ / /g' \
6219 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6220 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6227 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6228 dflt=.`sh -c domainname 2>/dev/null`
6231 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6236 .) echo "(Lost all hope -- silly guess then)"
6242 *) dflt="$mydomain";;
6246 rp="What is your domain name?"
6256 : translate upper to lower if necessary
6259 echo "(Normalizing case in your domain name)"
6260 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6264 : a little sanity check here
6265 case "$phostname" in
6268 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6269 $myhostname$mydomain|$myhostname) ;;
6271 case "$phostname" in
6273 echo "(That doesn't agree with your whoami.h file, by the way.)"
6276 echo "(That doesn't agree with your $phostname command, by the way.)"
6286 I need to get your e-mail address in Internet format if possible, i.e.
6287 something like user@host.domain. Please answer accurately since I have
6288 no easy means to double check it. The default value provided below
6289 is most probably close to the reality but may not be valid from outside
6290 your organization...
6294 while test "$cont"; do
6296 '') dflt="$cf_by@$myhostname$mydomain";;
6297 *) dflt="$cf_email";;
6299 rp='What is your e-mail address?'
6305 rp='Address does not look like an Internet one. Use it anyway?'
6321 If you or somebody else will be maintaining perl at your site, please
6322 fill in the correct e-mail address here so that they may be contacted
6323 if necessary. Currently, the "perlbug" program included with perl
6324 will send mail to this address in addition to perlbug@perl.com. You may
6325 enter "none" for no administrator.
6328 case "$perladmin" in
6329 '') dflt="$cf_email";;
6330 *) dflt="$perladmin";;
6332 rp='Perl administrator e-mail address'
6336 : figure out how to guarantee perl startup
6337 case "$startperl" in
6339 case "$sharpbang" in
6343 I can use the #! construct to start perl on your system. This will
6344 make startup of perl scripts faster, but may cause problems if you
6345 want to share those scripts and perl is not in a standard place
6346 ($binexp/perl) on all your platforms. The alternative is to force
6347 a shell by starting the script with a single ':' character.
6351 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6354 none) startperl=": # use perl";;
6355 *) startperl="#!$ans"
6356 if $test 30 -lt `echo "$ans" | wc -c`; then
6359 WARNING: Some systems limit the #! command to 32 characters.
6360 If you experience difficulty running Perl scripts with #!, try
6361 installing Perl in a directory with a shorter pathname.
6367 *) startperl=": # use perl"
6372 echo "I'll use $startperl to start perl scripts."
6374 : figure best path for perl in scripts
6377 perlpath="$binexp/perl"
6378 case "$startperl" in
6383 I will use the "eval 'exec'" idiom to start Perl on your system.
6384 I can use the full path of your Perl binary for this purpose, but
6385 doing so may cause problems if you want to share those scripts and
6386 Perl is not always in a standard place ($binexp/perl).
6390 rp="What path shall I use in \"eval 'exec'\"?"
6397 case "$startperl" in
6399 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6402 : determine where public executable scripts go
6403 set scriptdir scriptdir
6405 case "$scriptdir" in
6408 : guess some guesses
6409 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6410 $test -d /usr/share/bin && dflt=/usr/share/bin
6411 $test -d /usr/local/script && dflt=/usr/local/script
6412 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6413 $test -d $prefixexp/script && dflt=$prefixexp/script
6417 *) dflt="$scriptdir"
6422 Some installations have a separate directory just for executable scripts so
6423 that they can mount it across multiple architectures but keep the scripts in
6424 one spot. You might, for example, have a subdirectory of /usr/share for this.
6425 Or you might just lump your scripts in with all your other executables.
6429 rp='Where do you keep publicly executable scripts?'
6431 if $test "X$ansexp" != "X$scriptdirexp"; then
6435 scriptdirexp="$ansexp"
6436 : Change installation prefix, if necessary.
6437 if $test X"$prefix" != X"$installprefix"; then
6438 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6440 installscript="$scriptdirexp"
6445 After $package is installed, you may wish to install various
6446 add-on modules and utilities. Typically, these add-ons will
6447 be installed under $prefix with the rest
6448 of this package. However, you may wish to install such add-ons
6449 elsewhere under a different prefix.
6451 If you do not wish to put everything under a single prefix, that's
6452 ok. You will be prompted for the individual locations; this siteprefix
6453 is only used to suggest the defaults.
6455 The default should be fine for most people.
6459 rp='Installation prefix to use for add-on modules and utilities?'
6460 : XXX Here might be another good place for an installstyle setting.
6461 case "$siteprefix" in
6463 *) dflt=$siteprefix ;;
6467 case "$siteprefix" in
6472 *) oldsiteprefix="$prefix";;
6477 siteprefixexp="$ansexp"
6479 : determine where site specific libraries go.
6480 : Usual default is /usr/local/lib/perl5/site_perl
6481 : The default "style" setting is made in installstyle.U
6482 : XXX No longer works with Prefixit stuff.
6483 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6484 case "$installstyle" in
6485 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6486 *) dflt=$siteprefix/lib/site_$prog ;;
6490 The installation process will create a directory for
6491 site-specific extensions and modules. Most users find it convenient
6492 to place all site-specific files in this directory rather than in the
6493 main distribution directory.
6497 rp='Pathname for the site-specific library files?'
6500 sitelibexp="$ansexp"
6501 : Change installation prefix, if necessary.
6502 if $test X"$prefix" != X"$installprefix"; then
6503 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6505 installsitelib="$sitelibexp"
6508 : determine where site specific architecture-dependent libraries go.
6509 : sitelib default is /usr/local/lib/perl5/site_perl/
6510 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6511 : sitelib may have an optional trailing /share.
6512 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6513 tdflt="$tdflt/$apiversion/$archname"
6514 set sitearch sitearch none
6517 '') dflt="$tdflt" ;;
6518 *) dflt="$sitearch" ;;
6522 The installation process will also create a directory for
6523 architecture-dependent site-specific extensions and modules.
6527 rp='Pathname for the site-specific architecture-dependent library files?'
6530 sitearchexp="$ansexp"
6531 : Change installation prefix, if necessary.
6532 if $test X"$prefix" != X"$installprefix"; then
6533 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6535 installsitearch="$sitearchexp"
6540 Perl can be built to take advantage of long doubles which
6541 (if available) may give more accuracy and range for floating point
6542 numbers. To do so, Configure must be run with -Duselongdouble.
6544 If this doesn't make any sense to you, just accept the default 'n'.
6546 case "$uselongdouble" in
6547 $define|true|[yY]*) dflt='y';;
6550 rp='Try to use long doubles if available?'
6553 y|Y) val="$define" ;;
6559 case "$uselongdouble" in
6560 "$define"|true|[yY]*)
6561 : Look for a hint-file generated 'call-back-unit'. If the
6562 : user has specified that long doubles should be used,
6563 : we may need to set or change some other defaults.
6564 if $test -f uselongdouble.cbu; then
6565 echo "Your platform has some specific hints for long doubles, using them..."
6566 . ./uselongdouble.cbu
6569 (Your platform doesn't have any specific hints for long doubles.)
6577 Previous version of $package used the standard IO mechanisms as defined
6578 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6579 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6580 the default. This abstraction layer can use AT&T's sfio (if you already
6581 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6582 problems with some extension modules. Using PerlIO with stdio is safe,
6583 but it is slower than plain stdio and therefore is not the default.
6585 If this doesn't make any sense to you, just accept the default 'n'.
6587 case "$useperlio" in
6588 $define|true|[yY]*) dflt='y';;
6591 rp='Use the experimental PerlIO abstraction layer?'
6598 echo "Ok, doing things the stdio way"
6605 : Check how to convert floats to strings.
6606 if test "X$d_Gconvert" = X; then
6608 echo "Checking for an efficient way to convert floats to strings."
6611 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6612 char *myname = "gconvert";
6615 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6616 char *myname = "gcvt";
6619 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6620 char *myname = "sprintf";
6626 checkit(expect, got)
6630 if (strcmp(expect, got)) {
6631 printf("%s oddity: Expected %s, got %s\n",
6632 myname, expect, got);
6642 /* This must be 1st test on (which?) platform */
6643 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6644 Gconvert(0.1, 8, 0, buf);
6645 checkit("0.1", buf);
6647 Gconvert(1.0, 8, 0, buf);
6650 Gconvert(0.0, 8, 0, buf);
6653 Gconvert(-1.0, 8, 0, buf);
6656 /* Some Linux gcvt's give 1.e+5 here. */
6657 Gconvert(100000.0, 8, 0, buf);
6658 checkit("100000", buf);
6660 /* Some Linux gcvt's give -1.e+5 here. */
6661 Gconvert(-100000.0, 8, 0, buf);
6662 checkit("-100000", buf);
6667 case "$d_Gconvert" in
6668 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6669 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6670 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6671 *) xxx_list='gconvert gcvt sprintf' ;;
6674 for xxx_convert in $xxx_list; do
6675 echo "Trying $xxx_convert"
6677 set try -DTRY_$xxx_convert
6678 if eval $compile; then
6679 echo "$xxx_convert" found. >&4
6681 echo "I'll use $xxx_convert to convert floats into a string." >&4
6684 echo "...But $xxx_convert didn't work as I expected."
6687 echo "$xxx_convert NOT found." >&4
6691 case "$xxx_convert" in
6692 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6693 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6694 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6698 : see if inttypes.h is available
6699 : we want a real compile instead of Inhdr because some systems
6700 : have an inttypes.h which includes non-existent headers
6703 #include <inttypes.h>
6705 static int32_t foo32 = 0x12345678;
6709 if eval $compile; then
6710 echo "<inttypes.h> found." >&4
6713 echo "<inttypes.h> NOT found." >&4
6721 case "$use64bits" in
6724 echo $n "Checking to see if your system supports int64_t...$c" >&4
6726 #include <sys/types.h>
6727 #$i_inttypes I_INTTYPES
6729 #include <inttypes.h>
6731 int64_t foo() { int64_t x; x = 7; return x; }
6733 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6735 echo " Yup, it does." >&4
6738 echo " Nope, it doesn't." >&4
6749 : check for lengths of integral types
6753 echo "Checking to see how big your integers are..." >&4
6754 $cat >intsize.c <<'EOCP'
6758 printf("intsize=%d;\n", sizeof(int));
6759 printf("longsize=%d;\n", sizeof(long));
6760 printf("shortsize=%d;\n", sizeof(short));
6765 if eval $compile_ok && ./intsize > /dev/null; then
6767 echo "Your integers are $intsize bytes long."
6768 echo "Your long integers are $longsize bytes long."
6769 echo "Your short integers are $shortsize bytes long."
6773 Help! I can't compile and run the intsize test program: please enlighten me!
6774 (This is probably a misconfiguration in your system or libraries, and
6775 you really ought to fix it. Still, I'll try anyway.)
6779 rp="What is the size of an integer (in bytes)?"
6783 rp="What is the size of a long integer (in bytes)?"
6787 rp="What is the size of a short integer (in bytes)?"
6793 $rm -f intsize intsize.*
6795 : check for long long
6797 echo $n "Checking to see if your system supports long long...$c" >&4
6798 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6799 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6801 echo " Yup, it does." >&4
6804 echo " Nope, it doesn't." >&4
6810 : check for length of long long
6811 case "${d_longlong}${longlongsize}" in
6814 $echo $n "Checking to see how big your long longs are...$c" >&4
6815 $cat >try.c <<'EOCP'
6819 printf("%d\n", sizeof(long long));
6823 if eval $compile_ok; then
6824 longlongsize=`./try`
6825 $echo " $longlongsize bytes." >&4
6829 echo "(I can't seem to compile the test program. Guessing...)"
6830 rp="What is the size of a long long (in bytes)?"
6834 if $test "X$longsize" = "X$longlongsize"; then
6835 echo "(That isn't any different from an ordinary long.)"
6843 if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
6845 echo "Checking how to print 64-bit integers..." >&4
6847 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6849 $cat >try.c <<'EOCP'
6850 #include <sys/types.h>
6853 int q = 12345678901;
6858 if eval $compile; then
6862 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6863 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6864 echo "We will use %d."
6870 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6872 $cat >try.c <<'EOCP'
6873 #include <sys/types.h>
6876 long q = 12345678901;
6881 if eval $compile; then
6885 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6886 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6887 echo "We will use %ld."
6893 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6895 $cat >try.c <<'EOCP'
6896 #include <sys/types.h>
6897 #include <inttypes.h>
6900 int64_t q = 12345678901;
6901 printf("%" PRId64 "\n", q);
6905 if eval $compile; then
6909 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6910 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6911 echo "We will use the C9X style."
6917 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6919 $cat >try.c <<'EOCP'
6920 #include <sys/types.h>
6923 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
6924 printf("%lld\n", q);
6928 if eval $compile; then
6932 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6933 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6934 echo "We will use the %lld style."
6940 if $test X"$sPRId64" = X -a X"$quad" != X; then
6942 #include <sys/types.h>
6945 $quad q = 12345678901;
6950 if eval $compile; then
6954 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
6955 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
6956 echo "We will use %lld."
6962 if $test X"$sPRId64" = X -a X"$quad" != X; then
6964 #include <sys/types.h>
6967 $quad q = 12345678901;
6972 if eval $compile; then
6976 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
6977 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
6978 echo "We will use %qd."
6984 if $test X"$sPRId64" = X; then
6985 echo "Cannot figure out how to print 64-bit integers." >&4
6990 fi # intsize -o longsize -o d_int64t -o d_longlong
6993 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
6994 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
6996 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
6997 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
7001 : check for length of double
7003 case "$doublesize" in
7005 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7006 $cat >try.c <<'EOCP'
7010 printf("%d\n", sizeof(double));
7014 if eval $compile_ok; then
7016 $echo " $doublesize bytes." >&4
7019 echo "(I can't seem to compile the test program. Guessing...)"
7020 rp="What is the size of a double precision number (in bytes)?"
7028 : check for long doubles
7030 echo $n "Checking to see if your system supports long double...$c" >&4
7031 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7032 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7034 echo " Yup, it does." >&4
7037 echo " Nope, it doesn't." >&4
7043 : check for length of long double
7044 case "${d_longdbl}${longdblsize}" in
7047 $echo $n "Checking to see how big your long doubles are...$c" >&4
7048 $cat >try.c <<'EOCP'
7052 printf("%d\n", sizeof(long double));
7056 if eval $compile; then
7058 $echo " $longdblsize bytes." >&4
7062 echo "(I can't seem to compile the test program. Guessing...)" >&4
7063 rp="What is the size of a long double (in bytes)?"
7067 if $test "X$doublesize" = "X$longdblsize"; then
7068 echo "(That isn't any different from an ordinary double.)"
7076 if $test X"$d_longdbl" = X"$define"; then
7078 echo "Checking how to print long doubles..." >&4
7080 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7081 $cat >try.c <<'EOCP'
7082 #include <sys/types.h>
7086 printf("%.3f\n", d);
7090 if eval $compile; then
7094 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7095 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7096 echo "We will use %f."
7102 if $test X"$sPRIfldbl" = X; then
7103 $cat >try.c <<'EOCP'
7104 #include <sys/types.h>
7107 long double d = 123.456;
7108 printf("%.3llf\n", d);
7112 if eval $compile; then
7116 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7117 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7118 echo "We will use %llf."
7124 if $test X"$sPRIfldbl" = X; then
7125 $cat >try.c <<'EOCP'
7126 #include <sys/types.h>
7129 long double d = 123.456;
7130 printf("%.3Lf\n", d);
7134 if eval $compile; then
7138 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7139 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7140 echo "We will use %Lf."
7146 if $test X"$sPRIfldbl" = X; then
7147 $cat >try.c <<'EOCP'
7148 #include <sys/types.h>
7151 long double d = 123.456;
7152 printf("%.3lf\n", d);
7156 if eval $compile; then
7160 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7161 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7162 echo "We will use %lf."
7168 if $test X"$sPRIfldbl" = X; then
7169 echo "Cannot figure out how to print long doubles." >&4
7176 case "$sPRIfldbl" in
7177 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7178 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7180 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7181 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7185 : Initialize h_fcntl
7188 : Initialize h_sysfile
7191 : access call always available on UNIX
7195 : locate the flags for 'access()'
7199 $cat >access.c <<'EOCP'
7200 #include <sys/types.h>
7205 #include <sys/file.h>
7214 : check sys/file.h first, no particular reason here
7215 if $test `./findhdr sys/file.h` && \
7216 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7218 echo "<sys/file.h> defines the *_OK access constants." >&4
7219 elif $test `./findhdr fcntl.h` && \
7220 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7222 echo "<fcntl.h> defines the *_OK access constants." >&4
7223 elif $test `./findhdr unistd.h` && \
7224 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7225 echo "<unistd.h> defines the *_OK access constants." >&4
7227 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7233 : see if accessx exists
7234 set accessx d_accessx
7237 : see if alarm exists
7241 : see if atolf exists
7245 : see if atoll exists
7249 : Look for GNU-cc style attribute checking
7251 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7252 $cat >attrib.c <<'EOCP'
7254 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7256 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7257 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7258 echo "Your C compiler doesn't fully support __attribute__."
7261 echo "Your C compiler supports __attribute__."
7265 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7272 : see if bcmp exists
7276 : see if bcopy exists
7280 : see if this is a unistd.h system
7281 set unistd.h i_unistd
7284 : see if getpgrp exists
7285 set getpgrp d_getpgrp
7288 case "$d_getpgrp" in
7291 echo "Checking to see which flavor of getpgrp is in use..."
7294 #include <sys/types.h>
7296 # include <unistd.h>
7300 if (getuid() == 0) {
7301 printf("(I see you are running Configure as super-user...)\n");
7305 if (getpgrp(1) == 0)
7314 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7315 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7317 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7318 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7321 echo "I can't seem to compile and run the test program."
7323 xxx="a USG one, i.e. you use getpgrp()."
7325 # SVR4 systems can appear rather BSD-ish.
7328 xxx="a BSD one, i.e. you use getpgrp(pid)."
7332 xxx="probably a USG one, i.e. you use getpgrp()."
7337 echo "Assuming your getpgrp is $xxx" >&4
7346 : see if setpgrp exists
7347 set setpgrp d_setpgrp
7350 case "$d_setpgrp" in
7353 echo "Checking to see which flavor of setpgrp is in use..."
7356 #include <sys/types.h>
7358 # include <unistd.h>
7362 if (getuid() == 0) {
7363 printf("(I see you are running Configure as super-user...)\n");
7367 if (-1 == setpgrp(1, 1))
7370 if (setpgrp() != -1)
7376 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7377 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7379 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7380 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7383 echo "(I can't seem to compile and run the test program.)"
7385 xxx="a USG one, i.e. you use setpgrp()."
7387 # SVR4 systems can appear rather BSD-ish.
7390 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7394 xxx="probably a USG one, i.e. you use setpgrp()."
7399 echo "Assuming your setpgrp is $xxx" >&4
7407 : see if bzero exists
7411 : see if signal is declared as pointer to function returning int or void
7413 xxx=`./findhdr signal.h`
7414 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7415 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7416 echo "You have int (*signal())() instead of void." >&4
7418 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7419 echo "You have void (*signal())()." >&4
7421 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7422 echo "You have int (*signal())() instead of void." >&4
7424 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7425 echo "You have void (*signal())()." >&4
7428 case "$d_voidsig" in
7430 echo "I can't determine whether signal handler returns void or int..." >&4
7432 rp="What type does your signal handler return?"
7439 echo "As you already told me, signal handler returns void." >&4
7442 *) echo "As you already told me, signal handler returns int." >&4
7449 case "$d_voidsig" in
7450 "$define") signal_t="void";;
7455 : check for ability to cast large floats to 32-bit ints.
7457 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7458 if $test "$intsize" -ge 4; then
7465 #include <sys/types.h>
7467 $signal_t blech(s) int s; { exit(3); }
7474 signal(SIGFPE, blech);
7476 /* Don't let compiler optimize the test away. Store the number
7477 in a writable string for gcc to pass to sscanf under HP/UX.
7479 sprintf(str, "2147483647");
7480 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7484 /* x86 processors will probably give 0x8000 0000, which is a
7485 sign change. We don't want that. We want to mimic SPARC
7486 behavior here, which is to preserve the sign and give
7489 if (i32 != ($xxx) f)
7495 if eval $compile_ok; then
7499 echo "(I can't seem to compile the test program--assuming it can't)"
7507 echo "Nope, it can't."
7514 : check for ability to cast negative floats to unsigned
7516 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7519 #include <sys/types.h>
7521 $signal_t blech(s) int s; { exit(7); }
7522 $signal_t blech_in_list(s) int s; { exit(4); }
7523 unsigned long dummy_long(p) unsigned long p; { return p; }
7524 unsigned int dummy_int(p) unsigned int p; { return p; }
7525 unsigned short dummy_short(p) unsigned short p; { return p; }
7529 unsigned long along;
7531 unsigned short ashort;
7535 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7536 a direct f = -123. assignment. gcc-2.8.0 reportedly
7537 optimized the whole file away
7539 /* Store the number in a writable string for gcc to pass to
7542 sprintf(str, "-123");
7543 sscanf(str, "%lf", &f); /* f = -123.; */
7545 signal(SIGFPE, blech);
7546 along = (unsigned long)f;
7547 aint = (unsigned int)f;
7548 ashort = (unsigned short)f;
7549 if (along != (unsigned long)-123)
7551 if (aint != (unsigned int)-123)
7553 if (ashort != (unsigned short)-123)
7555 sprintf(str, "1073741824.");
7556 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7559 along = (unsigned long)f;
7560 if (along != 0x80000000)
7564 along = (unsigned long)f;
7565 if (along != 0x7fffffff)
7569 along = (unsigned long)f;
7570 if (along != 0x80000001)
7574 signal(SIGFPE, blech_in_list);
7575 sprintf(str, "123.");
7576 sscanf(str, "%lf", &f); /* f = 123.; */
7577 along = dummy_long((unsigned long)f);
7578 aint = dummy_int((unsigned int)f);
7579 ashort = dummy_short((unsigned short)f);
7580 if (along != (unsigned long)123)
7582 if (aint != (unsigned int)123)
7584 if (ashort != (unsigned short)123)
7591 if eval $compile_ok; then
7595 echo "(I can't seem to compile the test program--assuming it can't)"
7598 case "$castflags" in
7603 echo "Nope, it can't."
7610 : see if vprintf exists
7612 if set vprintf val -f d_vprintf; eval $csym; $val; then
7613 echo 'vprintf() found.' >&4
7615 $cat >vprintf.c <<'EOF'
7616 #include <varargs.h>
7618 int main() { xxx("foo"); }
7627 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7631 if eval $compile && ./vprintf; then
7632 echo "Your vsprintf() returns (int)." >&4
7635 echo "Your vsprintf() returns (char*)." >&4
7639 echo 'vprintf() NOT found.' >&4
7649 : see if chown exists
7653 : see if chroot exists
7657 : see if chsize exists
7661 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
7662 while $test $# -ge 2; do
7664 $define) echo "#include <$2>";;
7668 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
7669 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7678 : see if this is a sys/uio.h system
7679 set sys/uio.h i_sysuio
7682 echo "Checking to see if your system supports struct iovec..." >&4
7683 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
7685 case "$d_iovec_s" in
7686 "$define") echo "Yup, it does." >&4
7688 *) echo "Nope, it doesn't." >&4
7694 : see whether socket exists
7696 $echo $n "Hmm... $c" >&4
7697 if set socket val -f d_socket; eval $csym; $val; then
7698 echo "Looks like you have Berkeley networking support." >&4
7700 if set setsockopt val -f; eval $csym; $val; then
7703 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
7707 if $contains socklib libc.list >/dev/null 2>&1; then
7708 echo "Looks like you have Berkeley networking support." >&4
7710 : we will have to assume that it supports the 4.2 BSD interface
7713 echo "You don't have Berkeley networking in libc$_a..." >&4
7714 if test "X$d_socket" = "X$define"; then
7715 echo "...but you seem to believe that you have sockets." >&4
7717 for net in net socket
7719 if test -f /usr/lib/lib$net$_a; then
7720 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
7721 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
7722 if $contains socket libc.list >/dev/null 2>&1; then
7727 echo "...but the Wollongong group seems to have hacked it in." >&4
7728 sockethdr="-I/usr/netinclude"
7731 echo "Found Berkeley sockets interface in lib$net." >& 4
7732 if $contains setsockopt libc.list >/dev/null 2>&1; then
7735 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7742 if test "X$d_socket" != "X$define"; then
7743 echo "or anywhere else I see." >&4
7751 : see if socketpair exists
7752 set socketpair d_sockpair
7757 echo "Checking the availability of certain socket constants..." >& 4
7758 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
7759 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
7761 #include <sys/types.h>
7762 #include <sys/socket.h>
7768 set try; if eval $compile; then
7771 set d_${enum}; eval $setvar
7775 set sendmsg d_sendmsg
7778 set recvmsg d_recvmsg
7782 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
7783 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7785 case "$d_msghdr_s" in
7786 "$define") echo "Yup, it does." >&4
7788 *) echo "Nope, it doesn't." >&4
7792 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7793 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7795 case "$d_cmsghdr_s" in
7796 "$define") echo "Yup, it does." >&4
7798 *) echo "Nope, it doesn't." >&4
7802 : check for const keyword
7804 echo 'Checking to see if your C compiler knows about "const"...' >&4
7805 $cat >const.c <<'EOCP'
7806 typedef struct spug { int drokk; } spug;
7813 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7815 echo "Yup, it does."
7818 echo "Nope, it doesn't."
7823 : see if crypt exists
7825 if set crypt val -f d_crypt; eval $csym; $val; then
7826 echo 'crypt() found.' >&4
7830 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7831 if $test -z "$cryptlib"; then
7832 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7836 if $test -z "$cryptlib"; then
7837 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7841 if $test -z "$cryptlib"; then
7842 cryptlib=`./loc libcrypt$_a "" $libpth`
7846 if $test -z "$cryptlib"; then
7847 echo 'crypt() NOT found.' >&4
7856 : get csh whereabouts
7858 'csh') val="$undef" ;;
7863 : Respect a hint or command line value for full_csh.
7865 '') full_csh=$csh ;;
7868 : see if cuserid exists
7869 set cuserid d_cuserid
7872 : see if this is a limits.h system
7873 set limits.h i_limits
7876 : see if this is a float.h system
7880 : See if number of significant digits in a double precision number is known
7882 $cat >dbl_dig.c <<EOM
7892 printf("Contains DBL_DIG");
7895 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7896 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7897 echo "DBL_DIG found." >&4
7900 echo "DBL_DIG NOT found." >&4
7907 : see if difftime exists
7908 set difftime d_difftime
7911 : see if this is a dirent system
7913 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7915 echo "<dirent.h> found." >&4
7918 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7919 echo "<sys/dir.h> found." >&4
7922 xinc=`./findhdr sys/ndir.h`
7924 echo "<dirent.h> NOT found." >&4
7929 : Look for type of directory structure.
7931 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7933 case "$direntrytype" in
7936 $define) guess1='struct dirent' ;;
7937 *) guess1='struct direct' ;;
7940 *) guess1="$direntrytype"
7945 'struct dirent') guess2='struct direct' ;;
7946 *) guess2='struct dirent' ;;
7949 if $contains "$guess1" try.c >/dev/null 2>&1; then
7950 direntrytype="$guess1"
7951 echo "Your directory entries are $direntrytype." >&4
7952 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7953 direntrytype="$guess2"
7954 echo "Your directory entries seem to be $direntrytype." >&4
7956 echo "I don't recognize your system's directory entries." >&4
7957 rp="What type is used for directory entries on this system?"
7965 : see if the directory entry stores field length
7967 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7968 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7969 echo "Good, your directory entry keeps length information in d_namlen." >&4
7972 echo "Your directory entry does not know about the d_namlen field." >&4
7979 : see if dlerror exists
7982 set dlerror d_dlerror
7986 : see if dlfcn is available
7994 On a few systems, the dynamically loaded modules that perl generates and uses
7995 will need a different extension than shared libs. The default will probably
8003 rp='What is the extension of dynamically loaded modules'
8012 : Check if dlsym need a leading underscore
8018 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8019 $cat >dyna.c <<'EOM'
8028 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8030 #include <sys/types.h>
8044 int mode = RTLD_LAZY ;
8046 handle = dlopen("./dyna.$dlext", mode) ;
8047 if (handle == NULL) {
8052 symbol = dlsym(handle, "fred") ;
8053 if (symbol == NULL) {
8054 /* try putting a leading underscore */
8055 symbol = dlsym(handle, "_fred") ;
8056 if (symbol == NULL) {
8069 : Call the object file tmp-dyna.o in case dlext=o.
8070 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8071 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8072 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8073 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8076 1) echo "Test program failed using dlopen." >&4
8077 echo "Perhaps you should not use dynamic loading." >&4;;
8078 2) echo "Test program failed using dlsym." >&4
8079 echo "Perhaps you should not use dynamic loading." >&4;;
8080 3) echo "dlsym needs a leading underscore" >&4
8082 4) echo "dlsym doesn't need a leading underscore." >&4;;
8085 echo "I can't compile and run the test program." >&4
8086 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8091 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8096 hasproto='varname=$1; func=$2; shift; shift;
8097 while $test $# -ge 2; do
8099 $define) echo "#include <$2>";;
8103 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8104 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8105 echo "$func() prototype found.";
8108 echo "$func() prototype NOT found.";
8113 $rm -f try.c tryout.c'
8115 : see if prototype for drand48 is available
8117 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8120 : see if dup2 exists
8124 : see if eaccess exists
8125 set eaccess d_eaccess
8128 : see if endgrent exists
8129 set endgrent d_endgrent
8132 : see if endhostent exists
8133 set endhostent d_endhent
8136 : see if endnetent exists
8137 set endnetent d_endnent
8140 : see if endprotoent exists
8141 set endprotoent d_endpent
8144 : see if endpwent exists
8145 set endpwent d_endpwent
8148 : see if endservent exists
8149 set endservent d_endsent
8152 : see if endspent exists
8153 set endspent d_endspent
8156 : Locate the flags for 'open()'
8158 $cat >open3.c <<'EOCP'
8159 #include <sys/types.h>
8164 #include <sys/file.h>
8175 : check sys/file.h first to get FREAD on Sun
8176 if $test `./findhdr sys/file.h` && \
8177 set open3 -DI_SYS_FILE && eval $compile; then
8179 echo "<sys/file.h> defines the O_* constants..." >&4
8181 echo "and you have the 3 argument form of open()." >&4
8184 echo "but not the 3 argument form of open(). Oh, well." >&4
8187 elif $test `./findhdr fcntl.h` && \
8188 set open3 -DI_FCNTL && eval $compile; then
8190 echo "<fcntl.h> defines the O_* constants..." >&4
8192 echo "and you have the 3 argument form of open()." >&4
8195 echo "but not the 3 argument form of open(). Oh, well." >&4
8200 echo "I can't find the O_* constant definitions! You got problems." >&4
8206 : check for non-blocking I/O stuff
8207 case "$h_sysfile" in
8208 true) echo "#include <sys/file.h>" > head.c;;
8211 true) echo "#include <fcntl.h>" > head.c;;
8212 *) echo "#include <sys/fcntl.h>" > head.c;;
8217 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8218 case "$o_nonblock" in
8221 $cat >>try.c <<'EOCP'
8224 printf("O_NONBLOCK\n");
8228 printf("O_NDELAY\n");
8232 printf("FNDELAY\n");
8239 if eval $compile_ok; then
8241 case "$o_nonblock" in
8242 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8243 *) echo "Seems like we can use $o_nonblock.";;
8246 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8249 *) echo "Using $hint value $o_nonblock.";;
8251 $rm -f try try.* .out core
8254 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8260 #include <sys/types.h>
8262 #define MY_O_NONBLOCK $o_nonblock
8263 #ifndef errno /* XXX need better Configure test */
8266 $signal_t blech(x) int x; { exit(3); }
8268 $cat >> try.c <<'EOCP'
8276 pipe(pd); /* Down: child -> parent */
8277 pipe(pu); /* Up: parent -> child */
8280 close(pd[1]); /* Parent reads from pd[0] */
8281 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8282 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8284 signal(SIGALRM, blech);
8286 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8288 sprintf(string, "%d\n", ret);
8289 write(2, string, strlen(string));
8292 if (errno == EAGAIN) {
8298 if (errno == EWOULDBLOCK)
8299 printf("EWOULDBLOCK\n");
8302 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8303 sleep(2); /* Give it time to close our pipe */
8305 ret = read(pd[0], buf, 1); /* Should read EOF */
8307 sprintf(string, "%d\n", ret);
8308 write(3, string, strlen(string));
8312 close(pd[0]); /* We write to pd[1] */
8313 close(pu[1]); /* We read from pu[0] */
8314 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8315 close(pd[1]); /* Pipe pd is now fully closed! */
8316 exit(0); /* Bye bye, thank you for playing! */
8320 if eval $compile_ok; then
8321 echo "$startsh" >mtry
8322 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8324 ./mtry >/dev/null 2>&1
8326 0) eagain=`$cat try.out`;;
8327 1) echo "Could not perform non-blocking setting!";;
8328 2) echo "I did a successful read() for something that was not there!";;
8329 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8330 *) echo "Something terribly wrong happened during testing.";;
8332 rd_nodata=`$cat try.ret`
8333 echo "A read() system call with no data present returns $rd_nodata."
8334 case "$rd_nodata" in
8337 echo "(That's peculiar, fixing that to be -1.)"
8343 echo "Forcing errno EAGAIN on read() with no data available."
8347 echo "Your read() sets errno to $eagain when no data is available."
8350 status=`$cat try.err`
8352 0) echo "And it correctly returns 0 to signal EOF.";;
8353 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8354 *) echo "However, your read() returns '$status' on EOF??";;
8357 if test "$status" = "$rd_nodata"; then
8358 echo "WARNING: you can't distinguish between EOF and no data!"
8362 echo "I can't compile the test program--assuming errno EAGAIN will do."
8369 echo "Using $hint value $eagain."
8370 echo "Your read() returns $rd_nodata when no data is present."
8371 case "$d_eofnblk" in
8372 "$define") echo "And you can see EOF because read() returns 0.";;
8373 "$undef") echo "But you can't see EOF status from read() returned value.";;
8375 echo "(Assuming you can't see EOF status from read anyway.)"
8381 $rm -f try try.* .out core head.c mtry
8383 : see if fchmod exists
8387 : see if fchown exists
8391 : see if this is an fcntl system
8395 : see if sys/select.h has to be included
8396 set sys/select.h i_sysselct
8399 : see if we should include time.h, sys/time.h, or both
8401 if test "X$timeincl" = X; then
8402 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8403 $echo $n "I'm now running the test program...$c"
8404 $cat >try.c <<'EOCP'
8405 #include <sys/types.h>
8410 #ifdef SYSTIMEKERNEL
8413 #include <sys/time.h>
8416 #include <sys/select.h>
8425 struct timezone tzp;
8427 if (foo.tm_sec == foo.tm_sec)
8430 if (bar.tv_sec == bar.tv_sec)
8437 for s_timezone in '-DS_TIMEZONE' ''; do
8439 for s_timeval in '-DS_TIMEVAL' ''; do
8440 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8441 for i_time in '' '-DI_TIME'; do
8442 for i_systime in '-DI_SYSTIME' ''; do
8445 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8446 if eval $compile; then
8447 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8451 $echo $n "Succeeded with $flags$c"
8463 *SYSTIMEKERNEL*) i_systimek="$define"
8464 timeincl=`./findhdr sys/time.h`
8465 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8466 *) i_systimek="$undef";;
8469 *I_TIME*) i_time="$define"
8470 timeincl=`./findhdr time.h`" $timeincl"
8471 echo "We'll include <time.h>." >&4;;
8472 *) i_time="$undef";;
8475 *I_SYSTIME*) i_systime="$define"
8476 timeincl=`./findhdr sys/time.h`" $timeincl"
8477 echo "We'll include <sys/time.h>." >&4;;
8478 *) i_systime="$undef";;
8483 : check for fd_set items
8486 Checking to see how well your C compiler handles fd_set and friends ...
8488 $cat >fd_set.c <<EOCP
8489 #$i_systime I_SYS_TIME
8490 #$i_sysselct I_SYS_SELECT
8491 #$d_socket HAS_SOCKET
8492 #include <sys/types.h>
8494 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8497 #include <sys/time.h>
8500 #include <sys/select.h>
8509 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8516 set fd_set -DTRYBITS
8517 if eval $compile; then
8518 d_fds_bits="$define"
8520 echo "Well, your system knows about the normal fd_set typedef..." >&4
8522 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8523 d_fd_macros="$define"
8526 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8528 d_fd_macros="$undef"
8532 Hmm, your compiler has some difficulty with fd_set. Checking further...
8535 if eval $compile; then
8538 echo "Well, your system has some sort of fd_set available..." >&4
8540 echo "and you have the normal fd_set macros." >&4
8541 d_fd_macros="$define"
8544 but not the normal fd_set macros! Gross! More work for me...
8546 d_fd_macros="$undef"
8549 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8552 d_fd_macros="$undef"
8557 : see if fgetpos exists
8558 set fgetpos d_fgetpos
8561 : see if flock exists
8565 : see if fork exists
8569 : see if pathconf exists
8570 set pathconf d_pathconf
8573 : see if fpathconf exists
8574 set fpathconf d_fpathconf
8578 : see if llseek exists
8584 echo $n "Checking to see if your system supports off64_t...$c" >&4
8586 #include <sys/types.h>
8588 off64_t foo() { off64_t x; x = 7; return x; }'
8590 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8592 echo " Yup, it does." >&4
8595 echo " Nope, it doesn't." >&4
8601 : check for fpos64_t
8603 echo $n "Checking to see if your system supports fpos64_t...$c" >&4
8605 #include <sys/stdio.h>
8606 fpos64_t foo() { fpos64_t x; x = 7; return x; }'
8608 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8610 echo " Yup, it does." >&4
8613 echo " Nope, it doesn't." >&4
8619 : see if fseeko exists
8623 : see if fsetpos exists
8624 set fsetpos d_fsetpos
8627 : see if this is a sys/param system
8628 set sys/param.h i_sysparam
8631 : see if this is a sys/mount.h system
8632 set sys/mount.h i_sysmount
8636 : see if statfs exists
8640 : see if fstatfs exists
8641 set fstatfs d_fstatfs
8644 : see if statfs knows about mount flags
8645 set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
8649 : see if statvfs exists
8650 set statvfs d_statvfs
8653 : see if fstatvfs exists
8654 set fstatvfs d_fstatvfs
8658 : see if ftello exists
8662 : see if getgrent exists
8663 set getgrent d_getgrent
8666 : see if gethostbyaddr exists
8667 set gethostbyaddr d_gethbyaddr
8670 : see if gethostbyname exists
8671 set gethostbyname d_gethbyname
8674 : see if gethostent exists
8675 set gethostent d_gethent
8678 : see how we will look up host name
8681 if set gethostname val -f d_gethname; eval $csym; $val; then
8682 echo 'gethostname() found.' >&4
8683 d_gethname="$define"
8686 if set uname val -f d_uname; eval $csym; $val; then
8689 uname() was found, but you're running xenix, and older versions of xenix
8690 have a broken uname(). If you don't really know whether your xenix is old
8691 enough to have a broken system call, use the default answer.
8698 rp='Is your uname() broken?'
8701 n*) d_uname="$define"; call=uname;;
8704 echo 'uname() found.' >&4
8711 case "$d_gethname" in
8712 '') d_gethname="$undef";;
8715 '') d_uname="$undef";;
8717 case "$d_uname$d_gethname" in
8722 Every now and then someone has a $call() that lies about the hostname
8723 but can't be fixed for political or economic reasons. If you wish, I can
8724 pretend $call() isn't there and maybe compute hostname at run-time
8725 thanks to the '$phostname' command.
8728 rp="Shall I ignore $call() from now on?"
8731 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8734 case "$phostname" in
8736 *) case "$aphostname" in
8742 file=`./loc $file $file $pth`
8743 aphostname=`echo $file $*`
8748 case "$d_uname$d_gethname" in
8751 case "$phostname" in
8753 echo "There will be no way for $package to get your hostname." >&4;;
8755 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8759 case "$d_phostname" in
8760 '') d_phostname="$undef";;
8763 : see if this is a netdb.h system
8767 : see if prototypes for various gethostxxx netdb.h functions are available
8769 set d_gethostprotos gethostent $i_netdb netdb.h
8772 : see if getlogin exists
8773 set getlogin d_getlogin
8776 : see if getmntent exists
8777 set getmntent d_getmntent
8780 : see if getnetbyaddr exists
8781 set getnetbyaddr d_getnbyaddr
8784 : see if getnetbyname exists
8785 set getnetbyname d_getnbyname
8788 : see if getnetent exists
8789 set getnetent d_getnent
8792 : see if prototypes for various getnetxxx netdb.h functions are available
8794 set d_getnetprotos getnetent $i_netdb netdb.h
8798 : see if getprotobyname exists
8799 set getprotobyname d_getpbyname
8802 : see if getprotobynumber exists
8803 set getprotobynumber d_getpbynumber
8806 : see if getprotoent exists
8807 set getprotoent d_getpent
8810 : see if getpgid exists
8811 set getpgid d_getpgid
8814 : see if getpgrp2 exists
8815 set getpgrp2 d_getpgrp2
8818 : see if getppid exists
8819 set getppid d_getppid
8822 : see if getpriority exists
8823 set getpriority d_getprior
8826 : see if prototypes for various getprotoxxx netdb.h functions are available
8828 set d_getprotoprotos getprotoent $i_netdb netdb.h
8831 : see if getpwent exists
8832 set getpwent d_getpwent
8836 : see if getservbyname exists
8837 set getservbyname d_getsbyname
8840 : see if getservbyport exists
8841 set getservbyport d_getsbyport
8844 : see if getservent exists
8845 set getservent d_getsent
8848 : see if prototypes for various getservxxx netdb.h functions are available
8850 set d_getservprotos getservent $i_netdb netdb.h
8853 : see if getspent exists
8854 set getspent d_getspent
8857 : see if getspnam exists
8858 set getspnam d_getspnam
8861 : see if gettimeofday or ftime exists
8862 set gettimeofday d_gettimeod
8864 case "$d_gettimeod" in
8870 val="$undef"; set d_ftime; eval $setvar
8873 case "$d_gettimeod$d_ftime" in
8876 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8880 : see if this is an grp system
8886 xxx=`./findhdr grp.h`
8887 $cppstdin $cppflags $cppminus < $xxx >$$.h
8889 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8901 set d_grpasswd; eval $setvar
8905 : see if hasmntopt exists
8906 set hasmntopt d_hasmntopt
8909 : see if this is a netinet/in.h or sys/in.h system
8910 set netinet/in.h i_niin sys/in.h i_sysin
8913 : see if arpa/inet.h has to be included
8914 set arpa/inet.h i_arpainet
8917 : see if htonl --and friends-- exists
8922 : Maybe they are macros.
8927 #include <sys/types.h>
8928 #$i_niin I_NETINET_IN
8930 #$i_arpainet I_ARPA_INET
8932 #include <netinet/in.h>
8938 #include <arpa/inet.h>
8941 printf("Defined as a macro.");
8944 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8945 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8947 echo "But it seems to be defined as a macro." >&4
8955 : see which of string.h or strings.h is needed
8957 strings=`./findhdr string.h`
8958 if $test "$strings" && $test -r "$strings"; then
8959 echo "Using <string.h> instead of <strings.h>." >&4
8963 strings=`./findhdr strings.h`
8964 if $test "$strings" && $test -r "$strings"; then
8965 echo "Using <strings.h> instead of <string.h>." >&4
8967 echo "No string header found -- You'll surely have problems." >&4
8973 "$undef") strings=`./findhdr strings.h`;;
8974 *) strings=`./findhdr string.h`;;
8979 if set index val -f; eval $csym; $val; then
8980 if set strchr val -f d_strchr; eval $csym; $val; then
8981 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8984 echo "strchr() found." >&4
8988 echo "index() found." >&4
8993 echo "index() found." >&4
8996 if set strchr val -f d_strchr; eval $csym; $val; then
8999 echo "strchr() found." >&4
9001 echo "No index() or strchr() found!" >&4
9006 set d_strchr; eval $setvar
9008 set d_index; eval $setvar
9010 : check whether inet_aton exists
9011 set inet_aton d_inetaton
9016 $cat >isascii.c <<'EOCP'
9028 if eval $compile; then
9029 echo "isascii() found." >&4
9032 echo "isascii() NOT found." >&4
9039 : see if killpg exists
9043 : see if lchown exists
9045 $cat > try.c <<'EOCP'
9046 /* System header to define __stub macros and hopefully few prototypes,
9047 which can conflict with char lchown(); below. */
9049 /* Override any gcc2 internal prototype to avoid an error. */
9050 /* We use char because int might match the return type of a gcc2
9051 builtin and then its argument prototype would still apply. */
9054 /* The GNU C library defines this for functions which it implements
9055 to always fail with ENOSYS. Some functions are actually named
9056 something starting with __ and the normal name is an alias. */
9057 #if defined (__stub_lchown) || defined (__stub___lchown)
9065 if eval $compile; then
9066 $echo "lchown() found." >&4
9069 $echo "lchown() NOT found." >&4
9075 : See if number of significant digits in a double precision number is known
9077 $cat >ldbl_dig.c <<EOM
9087 printf("Contains LDBL_DIG");
9090 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9091 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9092 echo "LDBL_DIG found." >&4
9095 echo "LDBL_DIG NOT found." >&4
9102 : see if link exists
9106 : see if localeconv exists
9107 set localeconv d_locconv
9110 : see if lockf exists
9114 : see if lstat exists
9118 : see if madvise exists
9119 set madvise d_madvise
9122 : see if mblen exists
9126 : see if mbstowcs exists
9127 set mbstowcs d_mbstowcs
9130 : see if mbtowc exists
9134 : see if memchr exists
9138 : see if memcmp exists
9142 : see if memcpy exists
9146 : see if memmove exists
9147 set memmove d_memmove
9150 : see if memset exists
9154 : see if mkdir exists
9158 : see if mkfifo exists
9162 : see if mktime exists
9166 : see if this is a sys/mman.h system
9167 set sys/mman.h i_sysmman
9170 : see if mmap exists
9173 : see what shmat returns
9174 : default to something harmless
9176 case "$i_sysmman$d_mmap" in
9178 $cat >mmap.c <<'END'
9179 #include <sys/mman.h>
9182 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9187 echo "and it returns ($mmaptype)." >&4
9193 : see if mprotect exists
9194 set mprotect d_mprotect
9197 : see if msgctl exists
9201 : see if msgget exists
9205 : see if msgsnd exists
9209 : see if msgrcv exists
9213 : see how much of the 'msg*(2)' library is present.
9216 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9217 *"$undef"*) h_msg=false;;
9221 case "`ipcs 2>&1`" in
9222 "SVID messages"*"not configured"*)
9223 echo "Your $osname does not have the msg*(2) configured." >&4
9238 : we could also check for sys/ipc.h ...
9239 if $h_msg && $test `./findhdr sys/msg.h`; then
9240 echo "You have the full msg*(2) library." >&4
9243 echo "You don't have the full msg*(2) library." >&4
9249 : see if msync exists
9253 : see if munmap exists
9257 : see if nice exists
9261 : see if POSIX threads are available
9262 set pthread.h i_pthread
9268 : how to create joinable pthreads
9269 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9271 echo "Checking what constant to use for creating joinable pthreads..." >&4
9272 $cat >try.c <<'EOCP'
9273 #include <pthread.h>
9275 int detachstate = JOINABLE;
9278 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9279 if eval $compile; then
9280 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9281 val="$undef" # Yes, undef.
9282 set d_old_pthread_create_joinable
9285 set old_pthread_create_joinable
9288 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9289 if eval $compile; then
9290 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9292 set d_old_pthread_create_joinable
9294 val=PTHREAD_CREATE_UNDETACHED
9295 set old_pthread_create_joinable
9298 set try -DJOINABLE=__UNDETACHED
9299 if eval $compile; then
9300 echo "You seem to use __UNDETACHED." >&4
9302 set d_old_pthread_create_joinable
9305 set old_pthread_create_joinable
9308 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9310 set d_old_pthread_create_joinable
9313 set old_pthread_create_joinable
9320 d_old_pthread_create_joinable="$undef"
9321 old_pthread_create_joinable=""
9324 : see if pause exists
9328 : see if pipe exists
9332 : see if poll exists
9337 : see whether the various POSIXish _yields exist
9339 #include <pthread.h>
9345 #ifdef PTHREAD_YIELD
9348 #ifdef PTHREAD_YIELD_NULL
9349 pthread_yield(NULL);
9355 : see if sched_yield exists
9356 set try -DSCHED_YIELD
9357 if eval $compile; then
9359 sched_yield='sched_yield()'
9363 case "$usethreads" in
9366 $define) echo 'sched_yield() found.' >&4 ;;
9367 *) echo 'sched_yield() NOT found.' >&4 ;;
9373 : see if pthread_yield exists
9374 set try -DPTHREAD_YIELD
9375 if eval $compile; then
9377 case "$sched_yield" in
9378 '') sched_yield='pthread_yield()' ;;
9381 set try -DPTHREAD_YIELD_NULL
9382 if eval $compile; then
9384 case "$sched_yield" in
9385 '') sched_yield='pthread_yield(NULL)' ;;
9391 case "$usethreads" in
9394 $define) echo 'pthread_yield() found.' >&4 ;;
9395 *) echo 'pthread_yield() NOT found.' >&4 ;;
9402 case "$sched_yield" in
9403 '') sched_yield=undef ;;
9408 : see if this is a pwd.h system
9414 xxx=`./findhdr pwd.h`
9415 $cppstdin $cppflags $cppminus < $xxx >$$.h
9417 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9425 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9433 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9441 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9449 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9457 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9465 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9473 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9485 set d_pwquota; eval $setvar
9486 set d_pwage; eval $setvar
9487 set d_pwchange; eval $setvar
9488 set d_pwclass; eval $setvar
9489 set d_pwexpire; eval $setvar
9490 set d_pwcomment; eval $setvar
9491 set d_pwgecos; eval $setvar
9492 set d_pwpasswd; eval $setvar
9496 : see if readdir and friends exist
9497 set readdir d_readdir
9499 set seekdir d_seekdir
9501 set telldir d_telldir
9503 set rewinddir d_rewinddir
9506 : see if readlink exists
9507 set readlink d_readlink
9510 : see if readv exists
9514 : see if rename exists
9518 : see if rmdir exists
9522 : see if memory.h is available.
9527 : See if it conflicts with string.h
9533 $cppstdin $cppflags $cppminus < $strings > mem.h
9534 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9536 echo "We won't be including <memory.h>."
9546 : can bcopy handle overlapping blocks?
9551 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9558 $cat >>try.c <<'EOCP'
9561 # include <memory.h>
9564 # include <stdlib.h>
9567 # include <string.h>
9569 # include <strings.h>
9572 # include <unistd.h> /* Needed for NetBSD */
9576 char buf[128], abc[128];
9582 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9584 for (align = 7; align >= 0; align--) {
9585 for (len = 36; len; len--) {
9588 for (off = 1; off <= len; off++) {
9589 bcopy(b, b+off, len);
9590 bcopy(b+off, b, len);
9591 if (bcmp(b, abc, len))
9600 if eval $compile_ok; then
9601 if ./try 2>/dev/null; then
9605 echo "It can't, sorry."
9606 case "$d_memmove" in
9607 "$define") echo "But that's Ok since you have memmove()." ;;
9611 echo "(I can't compile the test program, so we'll assume not...)"
9612 case "$d_memmove" in
9613 "$define") echo "But that's Ok since you have memmove()." ;;
9618 $rm -f try.* try core
9622 : can memcpy handle overlapping blocks?
9627 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9634 $cat >>try.c <<'EOCP'
9637 # include <memory.h>
9640 # include <stdlib.h>
9643 # include <string.h>
9645 # include <strings.h>
9648 # include <unistd.h> /* Needed for NetBSD */
9652 char buf[128], abc[128];
9658 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9659 try to store the string in read-only memory. */
9660 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9662 for (align = 7; align >= 0; align--) {
9663 for (len = 36; len; len--) {
9665 memcpy(b, abc, len);
9666 for (off = 1; off <= len; off++) {
9667 memcpy(b+off, b, len);
9668 memcpy(b, b+off, len);
9669 if (memcmp(b, abc, len))
9678 if eval $compile_ok; then
9679 if ./try 2>/dev/null; then
9683 echo "It can't, sorry."
9684 case "$d_memmove" in
9685 "$define") echo "But that's Ok since you have memmove()." ;;
9689 echo "(I can't compile the test program, so we'll assume not...)"
9690 case "$d_memmove" in
9691 "$define") echo "But that's Ok since you have memmove()." ;;
9696 $rm -f try.* try core
9700 : can memcmp be trusted to compare relative magnitude?
9705 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9712 $cat >>try.c <<'EOCP'
9715 # include <memory.h>
9718 # include <stdlib.h>
9721 # include <string.h>
9723 # include <strings.h>
9726 # include <unistd.h> /* Needed for NetBSD */
9732 if ((a < b) && memcmp(&a, &b, 1) < 0)
9738 if eval $compile_ok; then
9739 if ./try 2>/dev/null; then
9743 echo "No, it can't (it uses signed chars)."
9746 echo "(I can't compile the test program, so we'll assume not...)"
9750 $rm -f try.* try core
9754 : see if select exists
9758 : see if semctl exists
9762 : see if semget exists
9766 : see if semop exists
9770 : see how much of the 'sem*(2)' library is present.
9773 case "$d_semctl$d_semget$d_semop" in
9774 *"$undef"*) h_sem=false;;
9778 case "`ipcs 2>&1`" in
9779 "SVID messages"*"not configured"*)
9780 echo "Your $osname does not have the sem*(2) configured." >&4
9793 : we could also check for sys/ipc.h ...
9794 if $h_sem && $test `./findhdr sys/sem.h`; then
9795 echo "You have the full sem*(2) library." >&4
9798 echo "You don't have the full sem*(2) library." >&4
9804 : see whether sys/sem.h defines union semun
9806 $cat > try.c <<'END'
9807 #include <sys/types.h>
9808 #include <sys/ipc.h>
9809 #include <sys/sem.h>
9810 int main () { union semun semun; semun.buf = 0; }
9813 if eval $compile; then
9814 echo "You have union semun in <sys/sem.h>." >&4
9817 echo "You do not have union semun in <sys/sem.h>." >&4
9820 $rm -f try try.c try.h
9824 : see how to do semctl IPC_STAT
9827 : see whether semctl IPC_STAT can use union semun
9832 # define S_IRUSR S_IREAD
9833 # define S_IWUSR S_IWRITE
9834 # define S_IXUSR S_IEXEC
9836 # define S_IRUSR 0400
9837 # define S_IWUSR 0200
9838 # define S_IXUSR 0100
9840 # define S_IRGRP (S_IRUSR>>3)
9841 # define S_IWGRP (S_IWUSR>>3)
9842 # define S_IXGRP (S_IXUSR>>3)
9843 # define S_IROTH (S_IRUSR>>6)
9844 # define S_IWOTH (S_IWUSR>>6)
9845 # define S_IXOTH (S_IXUSR>>6)
9848 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9849 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9850 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9855 #include <sys/types.h>
9856 #include <sys/ipc.h>
9857 #include <sys/sem.h>
9858 #include <sys/stat.h>
9865 #$d_union_semun HAS_UNION_SEMUN
9868 #ifndef HAS_UNION_SEMUN
9871 struct semid_ds *buf;
9872 unsigned short *array;
9878 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9879 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9881 struct semid_ds argbuf;
9884 st = semctl(sem, 0, IPC_STAT, arg);
9888 # endif /* IPC_STAT */
9889 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9891 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9892 # endif /* IPC_RMID */
9893 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9895 #endif /* IPC_PRIVATE && ... */
9896 printf("semget failed: errno = %d\n", errno);
9902 if eval $compile; then
9905 semun) val="$define" ;;
9911 case "$d_semctl_semun" in
9913 echo "You can use union semun for semctl IPC_STAT." >&4
9916 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9921 : see whether semctl IPC_STAT can use struct semid_ds pointer
9922 $cat > try.c <<'END'
9923 #include <sys/types.h>
9924 #include <sys/ipc.h>
9925 #include <sys/sem.h>
9926 #include <sys/stat.h>
9934 struct semid_ds arg;
9937 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9938 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9941 st = semctl(sem, 0, IPC_STAT, &arg);
9943 printf("semid_ds\n");
9945 # endif /* IPC_STAT */
9946 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9948 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9949 # endif /* IPC_RMID */
9950 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9952 #endif /* IPC_PRIVATE && ... */
9953 printf("semget failed: errno = %d\n", errno);
9960 if eval $compile; then
9963 semid_ds) val="$define" ;;
9967 set d_semctl_semid_ds
9969 case "$d_semctl_semid_ds" in
9971 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
9973 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
9980 # We do not have the full sem*(2) library, so assume we can not
9986 set d_semctl_semid_ds
9991 : see if setegid exists
9992 set setegid d_setegid
9995 : see if seteuid exists
9996 set seteuid d_seteuid
9999 : see if setgrent exists
10000 set setgrent d_setgrent
10003 : see if sethostent exists
10004 set sethostent d_sethent
10007 : see if setlinebuf exists
10008 set setlinebuf d_setlinebuf
10011 : see if setlocale exists
10012 set setlocale d_setlocale
10015 : see if setnetent exists
10016 set setnetent d_setnent
10019 : see if setprotoent exists
10020 set setprotoent d_setpent
10023 : see if setpgid exists
10024 set setpgid d_setpgid
10027 : see if setpgrp2 exists
10028 set setpgrp2 d_setpgrp2
10031 : see if setpriority exists
10032 set setpriority d_setprior
10035 : see if setpwent exists
10036 set setpwent d_setpwent
10039 : see if setregid exists
10040 set setregid d_setregid
10042 set setresgid d_setresgid
10045 : see if setreuid exists
10046 set setreuid d_setreuid
10048 set setresuid d_setresuid
10051 : see if setrgid exists
10052 set setrgid d_setrgid
10055 : see if setruid exists
10056 set setruid d_setruid
10059 : see if setservent exists
10060 set setservent d_setsent
10063 : see if setsid exists
10064 set setsid d_setsid
10067 : see if setspent exists
10068 set setspent d_setspent
10071 : see if setvbuf exists
10072 set setvbuf d_setvbuf
10075 : see if sfio.h is available
10080 : see if sfio library is available
10091 : Ok, but do we want to use it.
10095 true|$define|[yY]*) dflt='y';;
10098 echo "$package can use the sfio library, but it is experimental."
10099 rp="You seem to have sfio available, do you want to try using it?"
10103 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10105 : Remove sfio from list of libraries to use
10106 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10109 echo "libs = $libs" >&4
10113 *) case "$usesfio" in
10114 true|$define|[yY]*)
10115 echo "Sorry, cannot find sfio on this machine" >&4
10116 echo "Ignoring your setting of usesfio=$usesfio" >&4
10124 $define) usesfio='true';;
10125 *) usesfio='false';;
10128 : see if shmctl exists
10129 set shmctl d_shmctl
10132 : see if shmget exists
10133 set shmget d_shmget
10136 : see if shmat exists
10139 : see what shmat returns
10142 $cat >shmat.c <<'END'
10143 #include <sys/shm.h>
10146 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10151 echo "and it returns ($shmattype)." >&4
10152 : see if a prototype for shmat is available
10153 xxx=`./findhdr sys/shm.h`
10154 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10155 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10166 set d_shmatprototype
10169 : see if shmdt exists
10173 : see how much of the 'shm*(2)' library is present.
10176 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10177 *"$undef"*) h_shm=false;;
10181 case "`ipcs 2>&1`" in
10182 "SVID shared memory"*"not configured"*)
10183 echo "Your $osname does not have the shm*(2) configured." >&4
10186 set shmctl d_shmctl
10188 set shmget d_shmget
10198 : we could also check for sys/ipc.h ...
10199 if $h_shm && $test `./findhdr sys/shm.h`; then
10200 echo "You have the full shm*(2) library." >&4
10203 echo "You don't have the full shm*(2) library." >&4
10210 : see if we have sigaction
10211 if set sigaction val -f d_sigaction; eval $csym; $val; then
10212 echo 'sigaction() found.' >&4
10213 $cat > try.c <<'EOP'
10215 #include <sys/types.h>
10216 #include <signal.h>
10219 struct sigaction act, oact;
10221 oact.sa_handler = 0;
10225 if eval $compile_ok; then
10228 echo "But you don't seem to have a useable struct sigaction." >&4
10232 echo 'sigaction NOT found.' >&4
10235 set d_sigaction; eval $setvar
10236 $rm -f try try$_o try.c
10238 : see if sigsetjmp exists
10240 case "$d_sigsetjmp" in
10242 $cat >try.c <<'EOP'
10243 #include <setjmp.h>
10248 if (sigsetjmp(env,1))
10251 siglongjmp(env, 1);
10256 if eval $compile; then
10257 if ./try >/dev/null 2>&1; then
10258 echo "POSIX sigsetjmp found." >&4
10262 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10268 echo "sigsetjmp not found." >&4
10272 *) val="$d_sigsetjmp"
10273 case "$d_sigsetjmp" in
10274 $define) echo "POSIX sigsetjmp found." >&4;;
10275 $undef) echo "sigsetjmp not found." >&4;;
10283 : see if sys/stat.h is available
10284 set sys/stat.h i_sysstat
10287 : see if stat knows about block sizes
10289 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10292 : see if _ptr and _cnt from stdio act std
10294 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10295 echo "(Looks like you have stdio.h from Linux.)"
10296 case "$stdio_ptr" in
10297 '') stdio_ptr='((fp)->_IO_read_ptr)'
10300 *) ptr_lval=$d_stdio_ptr_lval;;
10302 case "$stdio_cnt" in
10303 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10306 *) cnt_lval=$d_stdio_cnt_lval;;
10308 case "$stdio_base" in
10309 '') stdio_base='((fp)->_IO_read_base)';;
10311 case "$stdio_bufsiz" in
10312 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10315 case "$stdio_ptr" in
10316 '') stdio_ptr='((fp)->_ptr)'
10319 *) ptr_lval=$d_stdio_ptr_lval;;
10321 case "$stdio_cnt" in
10322 '') stdio_cnt='((fp)->_cnt)'
10325 *) cnt_lval=$d_stdio_cnt_lval;;
10327 case "$stdio_base" in
10328 '') stdio_base='((fp)->_base)';;
10330 case "$stdio_bufsiz" in
10331 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10334 : test whether _ptr and _cnt really work
10335 echo "Checking how std your stdio is..." >&4
10338 #define FILE_ptr(fp) $stdio_ptr
10339 #define FILE_cnt(fp) $stdio_cnt
10341 FILE *fp = fopen("try.c", "r");
10344 18 <= FILE_cnt(fp) &&
10345 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10353 if eval $compile; then
10355 echo "Your stdio acts pretty std."
10358 echo "Your stdio isn't very std."
10361 echo "Your stdio doesn't appear very std."
10367 : Can _ptr be used as an lvalue?
10368 case "$d_stdstdio$ptr_lval" in
10369 $define$define) val=$define ;;
10372 set d_stdio_ptr_lval
10375 : Can _cnt be used as an lvalue?
10376 case "$d_stdstdio$cnt_lval" in
10377 $define$define) val=$define ;;
10380 set d_stdio_cnt_lval
10383 : see if _base is also standard
10385 case "$d_stdstdio" in
10389 #define FILE_base(fp) $stdio_base
10390 #define FILE_bufsiz(fp) $stdio_bufsiz
10392 FILE *fp = fopen("try.c", "r");
10395 19 <= FILE_bufsiz(fp) &&
10396 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10403 if eval $compile; then
10405 echo "And its _base field acts std."
10408 echo "But its _base field isn't std."
10411 echo "However, it seems to be lacking the _base field."
10420 Checking how to access stdio streams by file descriptor number...
10422 case "$stdio_stream_array" in
10423 '') $cat >try.c <<EOCP
10426 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10430 for s in _iob __iob __sF
10432 set try -DSTDIO_STREAM_ARRAY=$s
10433 if eval $compile; then
10434 case "`./try$exe_ext`" in
10435 yes) stdio_stream_array=$s; break ;;
10439 $rm -f try.* try$exe_ext
10441 case "$stdio_stream_array" in
10443 I can't figure out how to access stdio streams by file descriptor number.
10445 d_stdio_stream_array="$undef"
10448 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10450 d_stdio_stream_array="$define"
10454 : see if strcoll exists
10455 set strcoll d_strcoll
10458 : check for structure copying
10460 echo "Checking to see if your C compiler can copy structs..." >&4
10461 $cat >try.c <<'EOCP'
10471 if $cc -c try.c >/dev/null 2>&1 ; then
10473 echo "Yup, it can."
10476 echo "Nope, it can't."
10482 : see if strerror and/or sys_errlist[] exist
10484 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10485 if set strerror val -f d_strerror; eval $csym; $val; then
10486 echo 'strerror() found.' >&4
10487 d_strerror="$define"
10488 d_strerrm='strerror(e)'
10489 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10490 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10491 d_syserrlst="$define"
10493 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10494 d_syserrlst="$undef"
10496 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10497 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10498 echo 'strerror() found in string header.' >&4
10499 d_strerror="$define"
10500 d_strerrm='strerror(e)'
10501 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10502 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10503 d_syserrlst="$define"
10505 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10506 d_syserrlst="$undef"
10508 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10509 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10510 d_strerror="$undef"
10511 d_syserrlst="$define"
10512 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10514 echo 'strerror() and sys_errlist[] NOT found.' >&4
10515 d_strerror="$undef"
10516 d_syserrlst="$undef"
10517 d_strerrm='"unknown"'
10521 : see if strtod exists
10522 set strtod d_strtod
10525 : see if strtol exists
10526 set strtol d_strtol
10529 : see if strtoul exists
10530 set strtoul d_strtoul
10533 : see if strtoull exists
10534 set strtoull d_strtoull
10537 : see if strxfrm exists
10538 set strxfrm d_strxfrm
10541 : see if symlink exists
10542 set symlink d_symlink
10545 : see if syscall exists
10546 set syscall d_syscall
10549 : see if sysconf exists
10550 set sysconf d_sysconf
10553 : see if system exists
10554 set system d_system
10557 : see if tcgetpgrp exists
10558 set tcgetpgrp d_tcgetpgrp
10561 : see if tcsetpgrp exists
10562 set tcsetpgrp d_tcsetpgrp
10565 : see if sys/types.h has to be included
10566 set sys/types.h i_systypes
10569 : see if prototype for telldir is available
10571 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10574 : define an is-a-typedef? function
10575 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10577 "") inclist="sys/types.h";;
10579 eval "varval=\$$var";
10583 for inc in $inclist; do
10584 echo "#include <$inc>" >>temp.c;
10586 echo "#ifdef $type" >> temp.c;
10587 echo "printf(\"We have $type\");" >> temp.c;
10588 echo "#endif" >> temp.c;
10589 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10590 if $contains $type temp.E >/dev/null 2>&1; then
10591 eval "$var=\$type";
10596 *) eval "$var=\$varval";;
10599 : define an is-a-typedef? function that prompts if the type is not available.
10600 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10602 "") inclist="sys/types.h";;
10604 eval "varval=\$$var";
10608 for inc in $inclist; do
10609 echo "#include <$inc>" >>temp.c;
10611 echo "#ifdef $type" >> temp.c;
10612 echo "printf(\"We have $type\");" >> temp.c;
10613 echo "#endif" >> temp.c;
10614 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10616 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10617 if $contains $type temp.E >/dev/null 2>&1; then
10618 echo "$type found." >&4;
10619 eval "$var=\$type";
10621 echo "$type NOT found." >&4;
10627 *) eval "$var=\$varval";;
10630 : see if this is a sys/times.h system
10631 set sys/times.h i_systimes
10634 : see if times exists
10636 if set times val -f d_times; eval $csym; $val; then
10637 echo 'times() found.' >&4
10640 case "$i_systimes" in
10641 "$define") inc='sys/times.h';;
10643 rp="What is the type returned by times() on this system?"
10644 set clock_t clocktype long stdio.h sys/types.h $inc
10647 echo 'times() NOT found, hope that will do.' >&4
10652 : see if truncate exists
10653 set truncate d_truncate
10656 : see if tzname[] exists
10658 if set tzname val -a d_tzname; eval $csym; $val; then
10660 echo 'tzname[] found.' >&4
10663 echo 'tzname[] NOT found.' >&4
10668 : see if umask exists
10672 : backward compatibility for d_hvfork
10673 if test X$d_hvfork != X; then
10674 d_vfork="$d_hvfork"
10677 : see if there is a vfork
10682 : Ok, but do we want to use it. vfork is reportedly unreliable in
10683 : perl on Solaris 2.x, and probably elsewhere.
10687 case "$usevfork" in
10693 Perl can only use a vfork() that doesn't suffer from strict
10694 restrictions on calling functions or modifying global data in
10695 the child. For example, glibc-2.1 contains such a vfork()
10696 that is unsuitable. If your system provides a proper fork()
10697 call, chances are that you do NOT want perl to use vfork().
10700 rp="Do you still want to use vfork()?"
10705 echo "Ok, we won't use vfork()."
10714 $define) usevfork='true';;
10715 *) usevfork='false';;
10718 : see if this is an sysdir system
10719 set sys/dir.h i_sysdir
10722 : see if this is an sysndir system
10723 set sys/ndir.h i_sysndir
10726 : see if closedir exists
10727 set closedir d_closedir
10730 case "$d_closedir" in
10733 echo "Checking whether closedir() returns a status..." >&4
10734 cat > closedir.c <<EOM
10735 #$i_dirent I_DIRENT /**/
10736 #$i_sysdir I_SYS_DIR /**/
10737 #$i_sysndir I_SYS_NDIR /**/
10738 #$i_systypes I_SYS_TYPES /**/
10740 #if defined(I_SYS_TYPES)
10741 #include <sys/types.h>
10743 #if defined(I_DIRENT)
10744 #include <dirent.h>
10745 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10746 #include <sys/dir.h>
10750 #include <sys/ndir.h>
10754 #include <ndir.h> /* may be wrong in the future */
10756 #include <sys/dir.h>
10761 int main() { return closedir(opendir(".")); }
10764 if eval $compile_ok; then
10765 if ./closedir > /dev/null 2>&1 ; then
10766 echo "Yes, it does."
10769 echo "No, it doesn't."
10773 echo "(I can't seem to compile the test program--assuming it doesn't)"
10781 set d_void_closedir
10784 : check for volatile keyword
10786 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10787 $cat >try.c <<'EOCP'
10790 typedef struct _goo_struct goo_struct;
10791 goo_struct * volatile goo = ((goo_struct *)0);
10792 struct _goo_struct {
10797 typedef unsigned short foo_t;
10798 char *volatile foo;
10800 volatile foo_t blech;
10804 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10806 echo "Yup, it does."
10809 echo "Nope, it doesn't."
10815 : see if there is a wait4
10819 : see if waitpid exists
10820 set waitpid d_waitpid
10823 : see if wcstombs exists
10824 set wcstombs d_wcstombs
10827 : see if wctomb exists
10828 set wctomb d_wctomb
10831 : see if writev exists
10832 set writev d_writev
10835 : preserve RCS keywords in files with variable substitution, grrr
10840 Revision='$Revision'
10842 case "$crosscompile" in
10843 ''|[nN]*) crosscompile="$undef" ;;
10847 next|rhapsody) multiarch="$define" ;;
10849 case "$multiarch" in
10850 ''|[nN]*) multiarch="$undef" ;;
10853 : check for alignment requirements
10855 case "$crosscompile$multiarch" in
10858 You seem to be either cross-compiling or doing a multiarchitecture build,
10859 skipping the memory alignment check.
10862 case "$alignbytes" in
10863 '') alignbytes=8 ;;
10867 case "$alignbytes" in
10868 '') echo "Checking alignment constraints..." >&4
10869 $cat >try.c <<'EOCP'
10876 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10880 if eval $compile_ok; then
10884 echo "(I can't seem to compile the test program...)"
10887 *) dflt="$alignbytes"
10890 rp="Doubles must be aligned on a how-many-byte boundary?"
10898 : check for ordering of bytes in a long
10900 case "$crosscompile$multiarch" in
10903 You seem to be either cross-compiling or doing a multiarchitecture build,
10904 skipping the byteorder check.
10910 case "$byteorder" in
10913 In the following, larger digits indicate more significance. A big-endian
10914 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10915 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10916 machines may have weird orders like 3412. A Cray will report 87654321,
10917 an Alpha will report 12345678. If the test program works the default is
10919 I'm now running the test program...
10921 $cat >try.c <<'EOCP'
10928 char c[sizeof(long)];
10931 if (sizeof(long) > 4)
10932 u.l = (0x08070605L << 32) | 0x04030201L;
10935 for (i = 0; i < sizeof(long); i++)
10936 printf("%c", u.c[i]+'0');
10943 if eval $compile && ./try > /dev/null; then
10946 [1-4][1-4][1-4][1-4]|12345678|87654321)
10947 echo "(The test program ran ok.)"
10948 echo "byteorder=$dflt"
10951 ????|????????) echo "(The test program ran ok.)" ;;
10952 *) echo "(The test program didn't run right for some reason.)" ;;
10957 (I can't seem to compile the test program. Guessing big-endian...)
10960 case "$xxx_prompt" in
10962 rp="What is the order of bytes in a long?"
10976 : how do we catenate cpp tokens here?
10978 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
10979 $cat >cpp_stuff.c <<'EOCP'
10980 #define RCAT(a,b)a/**/b
10981 #define ACAT(a,b)a ## b
10985 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
10986 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
10987 echo "Oh! Smells like ANSI's been here." >&4
10988 echo "We can catify or stringify, separately or together!"
10990 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
10991 echo "Ah, yes! The good old days!" >&4
10992 echo "However, in the good old days we don't know how to stringify and"
10993 echo "catify at the same time."
10997 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
10998 to have to edit the values of CAT[2-5] in config.h...
11000 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11004 : see if this is a db.h system
11010 : Check db version.
11012 echo "Checking Berkeley DB version ..." >&4
11018 #include <sys/types.h>
11023 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11024 int Major, Minor, Patch ;
11025 unsigned long Version ;
11026 (void)db_version(&Major, &Minor, &Patch) ;
11027 printf("You have Berkeley DB Version 2 or greater\n");
11029 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11030 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11031 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11032 Major, Minor, Patch) ;
11034 /* check that db.h & libdb are compatible */
11035 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11036 printf("db.h and libdb are incompatible\n") ;
11040 printf("db.h and libdb are compatible\n") ;
11042 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11043 + DB_VERSION_PATCH ;
11045 /* needs to be >= 2.3.4 */
11046 if (Version < 2003004) {
11047 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11048 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11054 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11055 printf("You have Berkeley DB Version 1\n");
11056 exit(0); /* DB version < 2: the coast is clear. */
11058 exit(1); /* <db.h> not Berkeley DB? */
11064 if eval $compile && ./try; then
11065 echo 'Looks OK.' >&4
11067 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11071 : Remove db from list of libraries to use
11072 echo "Removing unusable -ldb from library list" >&4
11073 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11076 echo "libs = $libs" >&4
11086 : Check the return type needed for hash
11088 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11094 #include <sys/types.h>
11097 #ifndef DB_VERSION_MAJOR
11098 u_int32_t hash_cb (ptr, size)
11106 info.hash = hash_cb;
11110 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11111 if $contains warning try.out >>/dev/null 2>&1 ; then
11114 db_hashtype='u_int32_t'
11117 : XXX Maybe we should just give up here.
11118 db_hashtype=u_int32_t
11120 echo "Help: I can't seem to compile the db test program." >&4
11121 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11124 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11126 *) db_hashtype=u_int32_t
11131 : Check the return type needed for prefix
11133 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11139 #include <sys/types.h>
11142 #ifndef DB_VERSION_MAJOR
11143 size_t prefix_cb (key1, key2)
11151 info.prefix = prefix_cb;
11155 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11156 if $contains warning try.out >>/dev/null 2>&1 ; then
11157 db_prefixtype='int'
11159 db_prefixtype='size_t'
11162 db_prefixtype='size_t'
11163 : XXX Maybe we should just give up here.
11165 echo "Help: I can't seem to compile the db test program." >&4
11166 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11169 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11171 *) db_prefixtype='size_t'
11175 : check for void type
11177 echo "Checking to see how well your C compiler groks the void type..." >&4
11178 case "$voidflags" in
11180 $cat >try.c <<'EOCP'
11186 extern void moo(); /* function returning void */
11187 void (*goo)(); /* ptr to func returning void */
11189 void *hue; /* generic ptr */
11202 int main() { sub(); }
11204 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11205 voidflags=$defvoidused
11206 echo "Good. It appears to support void to the level $package wants.">&4
11207 if $contains warning .out >/dev/null 2>&1; then
11208 echo "However, you might get some warnings that look like this:"
11212 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11213 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11214 echo "It supports 1..."
11215 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11216 echo "It also supports 2..."
11217 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11219 echo "And it supports 4 but not 8 definitely."
11221 echo "It doesn't support 4..."
11222 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11224 echo "But it supports 8."
11227 echo "Neither does it support 8."
11231 echo "It does not support 2..."
11232 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11234 echo "But it supports 4 and 8."
11236 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11238 echo "And it supports 4 but has not heard about 8."
11240 echo "However it supports 8 but not 4."
11245 echo "There is no support at all for void."
11250 case "$voidflags" in
11252 *) $cat >&4 <<'EOM'
11253 Support flag bits are:
11254 1: basic void declarations.
11255 2: arrays of pointers to functions returning void.
11256 4: operations between pointers to and addresses of void functions.
11257 8: generic void pointers.
11260 rp="Your void support flags add up to what?"
11268 : How can we generate normalized random numbers ?
11270 echo "Looking for a random number function..." >&4
11271 case "$randfunc" in
11273 if set drand48 val -f; eval $csym; $val; then
11275 echo "Good, found drand48()." >&4
11276 elif set random val -f; eval $csym; $val; then
11278 echo "OK, found random()." >&4
11281 echo "Yick, looks like I have to use rand()." >&4
11292 *-Dmy_rand=*|*-Dmy_srand=*)
11293 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11294 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11295 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11296 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11300 while $test "$cont"; do
11301 rp="Use which function to generate random numbers?"
11303 if $test "$ans" = "$dflt"; then
11309 if set $ans val -f; eval $csym; $val; then
11313 rp="I cannot find function $ans. Use that name anyway?"
11322 case "$randfunc" in
11324 drand01="drand48()"
11330 case "$randbits" in
11332 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11334 #$i_unistd I_UNISTD
11335 #$i_stdlib I_STDLIB
11338 # include <unistd.h>
11341 # include <stdlib.h>
11346 register unsigned long tmp;
11347 register unsigned long max = 0L;
11349 for (i = 1000; i; i--) {
11350 tmp = (unsigned long) $randfunc();
11351 if (tmp > max) max = tmp;
11353 for (i = 0; max; i++)
11359 if eval $compile_ok; then
11363 echo "(I can't seem to compile the test program...)"
11370 rp="How many bits does your $randfunc() function produce?"
11374 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11375 seedfunc="s$randfunc"
11376 randseedtype=unsigned
11380 rp="How many bits does your $randfunc() function produce?"
11383 seedfunc="s$randfunc"
11384 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11385 if set $seedfunc val -f; eval $csym; $val; then
11386 echo "(Using $seedfunc() to seed random generator)"
11388 echo "(Warning: no $seedfunc() to seed random generator)"
11391 randseedtype=unsigned
11399 echo "Determining whether or not we are on an EBCDIC system..." >&4
11400 $cat >tebcdic.c <<'EOM'
11403 if ('M'==0xd4) return 0;
11410 if eval $compile_ok; then
11412 echo "You have EBCDIC." >&4
11415 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin, or UTF." >&4
11418 echo "I'm unable to compile the test program." >&4
11419 echo "I'll assume ASCII or some ISO Latin." >&4
11421 $rm -f tebcdic.c tebcdic
11427 Checking how to flush all pending stdio output...
11429 # I only know how to find the first 32 possibly open files on SunOS.
11430 # See also hints/sunos_4_1.sh and util.c --AD
11432 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11434 $cat >>try.c <<EOCP
11436 #$i_unistd I_UNISTD
11438 # include <unistd.h>
11440 #$d_sysconf HAS_SYSCONF
11441 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11442 #ifdef HAS_STDIO_STREAM_ARRAY
11443 # define STDIO_STREAM_ARRAY $stdio_stream_array
11446 FILE* p = fopen("try.out", "w");
11450 # ifdef TRY_FPRINTF
11454 #ifdef TRY_FFLUSH_NULL
11457 #ifdef TRY_FFLUSH_ALL
11459 long open_max = -1;
11460 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11461 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11463 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11464 open_max = sysconf(_SC_OPEN_MAX);
11467 open_max = FOPEN_MAX;
11470 open_max = OPEN_MAX;
11479 # ifdef HAS_STDIO_STREAM_ARRAY
11480 if (open_max > 0) {
11482 for (i = 0; i < open_max; i++)
11483 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11484 STDIO_STREAM_ARRAY[i]._file < open_max &&
11485 STDIO_STREAM_ARRAY[i]._flag)
11486 fflush(&STDIO_STREAM_ARRAY[i]);
11494 : first we have to find out how _not_ to flush
11495 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11497 set try -DTRY_FPUTC
11498 if eval $compile; then
11500 ./try$exe_ext 2>/dev/null
11501 if $test ! -s try.out -a "X$?" = X42; then
11507 set try -DTRY_FPRINTF
11509 if eval $compile; then
11511 ./try$exe_ext 2>/dev/null
11512 if $test ! -s try.out -a "X$?" = X42; then
11513 output=-DTRY_FPRINTF
11519 : check for fflush NULL behaviour
11520 case "$fflushNULL" in
11521 '') set try -DTRY_FFLUSH_NULL $output
11522 if eval $compile; then
11524 ./try$exe_ext 2>/dev/null
11526 if $test -s try.out -a "X$code" = X42; then
11527 fflushNULL="`$cat try.out`"
11529 if $test "X$code" != X42; then
11531 (If this test failed, don't worry, we'll try another method shortly.)
11536 $rm -f core try.core core.try.*
11537 case "$fflushNULL" in
11539 Your fflush(NULL) works okay.
11541 fflushNULL="$define"
11544 Your fflush(NULL) isn't working (contrary to ANSI C).
11546 fflushNULL="$undef"
11549 Cannot figure out whether your fflush(NULL) works or not.
11550 I'm assuming it doesn't (contrary to ANSI C).
11552 fflushNULL="$undef"
11556 $define|true|[yY]*)
11557 fflushNULL="$define"
11560 fflushNULL="$undef"
11563 : check explicit looping only if NULL did not work
11564 case "$fflushNULL" in
11566 : check for fflush all behaviour
11567 case "$fflushall" in
11568 '') set try -DTRY_FFLUSH_ALL $output
11569 if eval $compile; then
11571 (Now testing the other method--but note that also this may fail.)
11574 ./try$exe_ext 2>/dev/null
11575 if $test -s try.out -a "X$?" = X42; then
11576 fflushall="`$cat try.out`"
11579 $rm -f core try.core core.try.*
11580 case "$fflushall" in
11582 Whew. Flushing explicitly all the stdio streams works.
11584 fflushall="$define"
11587 Sigh. Flushing explicitly all the stdio streams doesn't work.
11592 Cannot figure out whether flushing stdio streams explicitly works or not.
11593 I'm assuming it doesn't.
11599 "$define"|true|[yY]*)
11600 fflushall="$define"
11607 *) fflushall="$undef"
11610 case "$fflushNULL$fflushall" in
11613 I cannot figure out how to flush pending stdio output.
11617 $rm -f try.* try$exe_ext
11619 : see what type file positions are declared as in the library
11620 rp="What is the type for file position used by fsetpos()?"
11621 set fpos_t fpostype long stdio.h sys/types.h
11624 : Store the full pathname to the ar program for use in the C program
11625 : Respect a hint or command line value for full_ar.
11630 : Store the full pathname to the sed program for use in the C program
11633 : see what type gids are declared as in the kernel
11635 echo "Looking for the type for group ids returned by getgid()."
11636 set gid_t gidtype xxx stdio.h sys/types.h
11640 xxx=`./findhdr sys/user.h`
11641 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11643 unsigned) dflt="$1 $2" ;;
11647 *) dflt="$gidtype";;
11650 gid_t) echo "gid_t found." ;;
11651 *) rp="What is the type for group ids returned by getgid()?"
11657 : see if getgroups exists
11658 set getgroups d_getgrps
11661 : see if setgroups exists
11662 set setgroups d_setgrps
11666 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11668 case "$d_getgrps$d_setgrps" in
11670 case "$groupstype" in
11671 '') dflt="$gidtype" ;;
11672 *) dflt="$groupstype" ;;
11675 What type of pointer is the second argument to getgroups() and setgroups()?
11676 Usually this is the same as group ids, $gidtype, but not always.
11679 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11683 *) groupstype="$gidtype";;
11686 : see what type lseek is declared as in the kernel
11687 rp="What is the type used for lseek's offset on this system?"
11688 set off_t lseektype long stdio.h sys/types.h
11692 $echo $n "Checking to see how big your file offsets are...$c" >&4
11694 #include <sys/types.h>
11698 printf("%d\n", sizeof($lseektype));
11702 if eval $compile_ok; then
11704 $echo " $lseeksize bytes." >&4
11708 echo "(I can't seem to compile the test program. Guessing...)"
11709 rp="What is the size of your file offsets (in bytes)?"
11716 echo "Checking if your $make program sets \$(MAKE)..." >&4
11717 case "$make_set_make" in
11719 $sed 's/^X //' > testmake.mak << 'EOF'
11721 X @echo 'maketemp="$(MAKE)"'
11723 case "`$make -f testmake.mak 2>/dev/null`" in
11724 *maketemp=*) make_set_make='#' ;;
11725 *) make_set_make="MAKE=$make" ;;
11727 $rm -f testmake.mak
11730 case "$make_set_make" in
11731 '#') echo "Yup, it does.";;
11732 *) echo "Nope, it doesn't.";;
11735 : see what type is used for mode_t
11736 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11737 set mode_t modetype int stdio.h sys/types.h
11740 : define a fucntion to check prototypes
11741 $cat > protochk <<EOSH
11744 optimize="$optimize"
11746 prototype="$prototype"
11751 $cat >> protochk <<'EOSH'
11756 while test $# -ge 2; do
11758 $define) echo "#include <$2>" >> try.c ;;
11759 literal) echo "$2" >> try.c ;;
11763 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11764 cat >> try.c <<'EOCP'
11765 #ifdef CAN_PROTOTYPE
11766 #define _(args) args
11771 echo "$foo" >> try.c
11772 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11773 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11779 $eunicefix protochk
11781 : see what type is used for size_t
11782 rp="What is the type used for the length parameter for string functions?"
11783 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11786 : check for type of arguments to gethostbyaddr.
11787 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11788 case "$d_gethbyaddr" in
11792 Checking to see what type of arguments are accepted by gethostbyaddr().
11794 hdrs="$define sys/types.h
11795 $d_socket sys/socket.h
11796 $i_niin netinet/in.h
11798 $i_unistd unistd.h"
11799 : The first arg can 'char *' or 'void *'
11800 : The second arg is some of integral type
11801 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11802 for yyy in size_t long int; do
11803 case "$netdb_host_type" in
11804 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11805 if ./protochk "$try" $hdrs; then
11806 echo "Your system accepts $xxx for the first arg."
11807 echo "...and $yyy for the second arg."
11808 netdb_host_type="$xxx"
11809 netdb_hlen_type="$yyy"
11815 : In case none of those worked, prompt the user.
11816 case "$netdb_host_type" in
11817 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11820 netdb_host_type=$ans
11821 rp='What is the type for the 2nd argument to gethostbyaddr?'
11824 netdb_hlen_type=$ans
11828 *) : no gethostbyaddr, so pick harmless defaults
11829 netdb_host_type='char *'
11830 netdb_hlen_type="$sizetype"
11833 # Remove the "const" if needed. -- but then we'll have a
11835 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11838 : check for type of argument to gethostbyname.
11839 if test "X$netdb_name_type" = X ; then
11840 case "$d_gethbyname" in
11844 Checking to see what type of argument is accepted by gethostbyname().
11846 hdrs="$define sys/types.h
11847 $d_socket sys/socket.h
11848 $i_niin netinet/in.h
11850 $i_unistd unistd.h"
11851 for xxx in "const char *" "char *"; do
11852 case "$netdb_name_type" in
11853 '') try="extern struct hostent *gethostbyname($xxx);"
11854 if ./protochk "$try" $hdrs; then
11855 echo "Your system accepts $xxx."
11856 netdb_name_type="$xxx"
11861 : In case none of those worked, prompt the user.
11862 case "$netdb_name_type" in
11863 '') rp='What is the type for the 1st argument to gethostbyname?'
11866 netdb_name_type=$ans
11870 *) : no gethostbyname, so pick harmless default
11871 netdb_name_type='char *'
11876 : check for type of 1st argument to getnetbyaddr.
11877 if test "X$netdb_net_type" = X ; then
11878 case "$d_getnbyaddr" in
11882 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11884 hdrs="$define sys/types.h
11885 $d_socket sys/socket.h
11886 $i_niin netinet/in.h
11888 $i_unistd unistd.h"
11889 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11890 case "$netdb_net_type" in
11891 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11892 if ./protochk "$try" $hdrs; then
11893 echo "Your system accepts $xxx."
11894 netdb_net_type="$xxx"
11899 : In case none of those worked, prompt the user.
11900 case "$netdb_net_type" in
11901 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11904 netdb_net_type=$ans
11908 *) : no getnetbyaddr, so pick harmless default
11909 netdb_net_type='long'
11913 : locate the preferred pager for this system
11927 '') dflt=/usr/ucb/more;;
11934 rp='What pager is used on your system?'
11938 : see what type pids are declared as in the kernel
11939 rp="What is the type of process ids on this system?"
11940 set pid_t pidtype int stdio.h sys/types.h
11943 : Find earliest binary compatible site_perl subdirectory perl can use.
11944 case "$bincompat5005" in
11945 "$define") xs_apiversion='5.005' ;;
11946 *) xs_apiversion=$apiversion ;; # The current site_perl version.
11948 : Find earliest pure perl site_perl subdirectory perl can use.
11949 : The versioned directories started at 5.005.
11950 pm_apiversion='5.005'
11952 : check for length of pointer
11956 $echo $n "Checking to see how big your pointers are...$c" >&4
11957 if test "$voidflags" -gt 7; then
11958 echo '#define VOID_PTR char *' > try.c
11960 echo '#define VOID_PTR void *' > try.c
11962 $cat >>try.c <<'EOCP'
11966 printf("%d\n", sizeof(VOID_PTR));
11971 if eval $compile_ok; then
11973 $echo " $ptrsize bytes." >&4
11976 echo "(I can't seem to compile the test program. Guessing...)" >&4
11977 rp="What is the size of a pointer (in bytes)?"
11985 : see if ar generates random libraries by itself
11987 echo "Checking how to generate random libraries on your machine..." >&4
11988 echo 'int bar1() { return bar2(); }' > bar1.c
11989 echo 'int bar2() { return 2; }' > bar2.c
11990 $cat > foo.c <<'EOP'
11991 int main() { printf("%d\n", bar1()); exit(0); }
11993 $cc $ccflags -c bar1.c >/dev/null 2>&1
11994 $cc $ccflags -c bar2.c >/dev/null 2>&1
11995 $cc $ccflags -c foo.c >/dev/null 2>&1
11996 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
11997 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11998 ./foobar >/dev/null 2>&1; then
11999 echo "$ar appears to generate random libraries itself."
12002 elif $ar ts bar$_a >/dev/null 2>&1 &&
12003 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12004 ./foobar >/dev/null 2>&1; then
12005 echo "a table of contents needs to be added with '$ar ts'."
12012 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12013 $test -f $ranlib || ranlib=''
12016 if $test -n "$ranlib"; then
12017 echo "your system has '$ranlib'; we'll use that."
12020 echo "your system doesn't seem to support random libraries"
12021 echo "so we'll use lorder and tsort to order the libraries."
12028 : check for type of arguments to select.
12029 case "$selecttype" in
12030 '') case "$d_select" in
12033 Checking to see what type of arguments are accepted by select().
12035 hdrs="$define sys/types.h
12036 $i_systime sys/time.h
12037 $i_sysselct sys/select.h
12038 $d_socket sys/socket.h"
12039 : The first arg can be int, unsigned, or size_t
12040 : The last arg may or may not be 'const'
12042 : void pointer has been seen but using that
12043 : breaks the selectminbits test
12044 for xxx in 'fd_set *' 'int *'; do
12045 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12046 for tmo in 'struct timeval *' 'const struct timeval *'; do
12048 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12049 if ./protochk "$try" $hdrs; then
12050 echo "Your system accepts $xxx."
12059 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12060 case "$d_fd_set" in
12061 $define) dflt="fd_set *" ;;
12070 *) : no select, so pick a harmless default
12077 : check for the select 'width'
12078 case "$selectminbits" in
12079 '') case "$d_select" in
12083 Checking to see on how many bits at a time your select() operates...
12086 #include <sys/types.h>
12088 #$i_systime I_SYS_TIME
12089 #$i_systimek I_SYS_TIME_KERNEL
12094 # ifdef I_SYS_TIME_KERNEL
12097 # include <sys/time.h>
12098 # ifdef I_SYS_TIME_KERNEL
12102 #$i_sysselct I_SYS_SELECT
12103 #ifdef I_SYS_SELECT
12104 #include <sys/select.h>
12106 #$d_socket HAS_SOCKET
12108 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12112 #define S sizeof(*(b))
12114 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12115 #define NBITS (NBYTES * 8)
12124 fp = fopen("try.c", "r");
12130 b = ($selecttype)s;
12131 for (i = 0; i < NBITS; i++)
12135 select(fd + 1, b, 0, 0, &t);
12136 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12137 printf("%d\n", i + 1);
12142 if eval $compile_ok; then
12143 selectminbits=`./try`
12144 case "$selectminbits" in
12146 Cannot figure out on how many bits at a time your select() operates.
12147 I'll play safe and guess it is 32 bits.
12153 *) bits="$selectminbits bits" ;;
12155 echo "Your select() operates on $bits at a time." >&4
12157 rp='What is the minimum number of bits your select() operates on?'
12158 case "$byteorder" in
12159 1234|12345678) dflt=32 ;;
12164 selectminbits="$val"
12168 *) : no select, so pick a harmless default
12175 : Trace out the files included by signal.h, then look for SIGxxx names.
12176 : Remove SIGARRAYSIZE used by HPUX.
12177 : Remove SIGSTKSIZE used by Linux.
12178 : Remove SIGSTKSZ used by Posix.
12179 : Remove SIGTYP void lines used by OS2.
12180 xxx=`echo '#include <signal.h>' |
12181 $cppstdin $cppminus $cppflags 2>/dev/null |
12182 $grep '^[ ]*#.*include' |
12183 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12184 : Check this list of files to be sure we have parsed the cpp output ok.
12185 : This will also avoid potentially non-existent files, such
12188 for xx in $xxx /dev/null ; do
12189 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12191 : If we have found no files, at least try signal.h
12192 case "$xxxfiles" in
12193 '') xxxfiles=`./findhdr signal.h` ;;
12196 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12197 print substr($2, 4, 20)
12199 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12200 print substr($3, 4, 20)
12202 : Append some common names just in case the awk scan failed.
12203 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12204 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12205 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12206 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12207 : generate a few handy files for later
12208 $cat > signal.c <<'EOCP'
12209 #include <sys/types.h>
12210 #include <signal.h>
12214 /* Strange style to avoid deeply-nested #if/#else/#endif */
12217 # define NSIG (_NSIG)
12223 # define NSIG (SIGMAX+1)
12229 # define NSIG (SIG_MAX+1)
12235 # define NSIG (MAXSIG+1)
12241 # define NSIG (MAX_SIG+1)
12246 # ifdef SIGARRAYSIZE
12247 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12253 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12257 /* Default to some arbitrary number that's big enough to get most
12258 of the common signals.
12264 printf("NSIG %d\n", NSIG);
12270 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12272 printf "#ifdef SIG"; printf $1; printf "\n"
12273 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12274 printf $1; printf ");\n"
12278 printf "#endif /* JUST_NSIG */\n";
12282 $cat >signal.awk <<'EOP'
12283 BEGIN { ndups = 0 }
12284 $1 ~ /^NSIG$/ { nsig = $2 }
12285 ($1 !~ /^NSIG$/) && (NF == 2) {
12286 if ($2 > maxsig) { maxsig = $2 }
12287 if (sig_name[$2]) {
12288 dup_name[ndups] = $1
12289 dup_num[ndups] = $2
12301 printf("NSIG %d\n", nsig);
12302 for (n = 1; n < nsig; n++) {
12304 printf("%s %d\n", sig_name[n], sig_num[n])
12307 printf("NUM%d %d\n", n, n)
12310 for (n = 0; n < ndups; n++) {
12311 printf("%s %d\n", dup_name[n], dup_num[n])
12315 $cat >signal_cmd <<EOS
12317 if $test -s signal.lst; then
12318 echo "Using your existing signal.lst file"
12323 $cat >>signal_cmd <<'EOS'
12326 if eval $compile_ok; then
12327 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12329 echo "(I can't seem be able to compile the whole test program)" >&4
12330 echo "(I'll try it in little pieces.)" >&4
12331 set signal -DJUST_NSIG
12332 if eval $compile_ok; then
12333 ./signal$_exe > signal.nsg
12336 echo "I can't seem to figure out how many signals you have." >&4
12337 echo "Guessing 50." >&4
12338 echo 'NSIG 50' > signal.nsg
12340 : Now look at all the signal names, one at a time.
12341 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12342 $cat > signal.c <<EOCP
12343 #include <sys/types.h>
12344 #include <signal.h>
12347 printf("$xx %d\n", SIG${xx});
12352 if eval $compile; then
12353 echo "SIG${xx} found."
12354 ./signal$_exe >> signal.ls1
12356 echo "SIG${xx} NOT found."
12359 if $test -s signal.ls1; then
12360 $cat signal.nsg signal.ls1 |
12361 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12365 if $test -s signal.lst; then
12368 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12369 echo 'kill -l' >signal
12370 set X `csh -f <signal`
12374 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12376 echo $@ | $tr ' ' $trnl | \
12377 $awk '{ printf "%s %d\n", $1, ++s; }
12378 END { printf "NSIG %d\n", ++s }' >signal.lst
12380 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12382 chmod a+x signal_cmd
12383 $eunicefix signal_cmd
12385 : generate list of signal names
12387 case "$sig_name_init" in
12389 *) case "$sig_num_init" in
12390 ''|*,*) doinit=yes ;;
12395 echo "Generating a list of signal names and numbers..." >&4
12397 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12398 sig_name=`$awk 'BEGIN { printf "ZERO " }
12399 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12400 sig_num=`$awk 'BEGIN { printf "0 " }
12401 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12402 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12403 !/^NSIG/ { printf "\"%s\", ", $1 }
12404 END { printf "0\n" }' signal.lst`
12405 sig_num_init=`$awk 'BEGIN { printf "0, " }
12406 !/^NSIG/ { printf "%d, ", $2}
12407 END { printf "0\n"}' signal.lst`
12410 echo "The following $sig_count signals are available:"
12412 echo $sig_name | $awk \
12413 'BEGIN { linelen = 0 }
12415 for (i = 1; i <= NF; i++) {
12416 name = "SIG" $i " "
12417 linelen = linelen + length(name)
12418 if (linelen > 70) {
12420 linelen = length(name)
12426 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12428 : see what type is used for signed size_t
12429 set ssize_t ssizetype int stdio.h sys/types.h
12432 $cat > ssize.c <<EOM
12434 #include <sys/types.h>
12435 #define Size_t $sizetype
12436 #define SSize_t $dflt
12439 if (sizeof(Size_t) == sizeof(SSize_t))
12441 else if (sizeof(Size_t) == sizeof(int))
12450 if eval $compile_ok && ./ssize > /dev/null; then
12451 ssizetype=`./ssize`
12452 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12455 Help! I can't compile and run the ssize_t test program: please enlighten me!
12456 (This is probably a misconfiguration in your system or libraries, and
12457 you really ought to fix it. Still, I'll try anyway.)
12459 I need a type that is the same size as $sizetype, but is guaranteed to
12460 be signed. Common values are ssize_t, int and long.
12463 rp="What signed type is the same size as $sizetype?"
12467 $rm -f ssize ssize.*
12469 : see what type of char stdio uses.
12471 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12472 echo "Your stdio uses unsigned chars." >&4
12473 stdchar="unsigned char"
12475 echo "Your stdio uses signed chars." >&4
12479 : see if time exists
12481 if test "X$d_time" = X -o X"$timetype" = X; then
12482 if set time val -f d_time; eval $csym; $val; then
12483 echo 'time() found.' >&4
12485 rp="What is the type returned by time() on this system?"
12486 set time_t timetype long stdio.h sys/types.h
12489 echo 'time() not found, hope that will do.' >&4
12497 : see what type uids are declared as in the kernel
12499 echo "Looking for the type for user ids returned by getuid()."
12500 set uid_t uidtype xxx stdio.h sys/types.h
12504 xxx=`./findhdr sys/user.h`
12505 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12507 unsigned) dflt="$1 $2" ;;
12511 *) dflt="$uidtype";;
12514 uid_t) echo "uid_t found." ;;
12515 *) rp="What is the type for user ids returned by getuid()?"
12521 : see if dbm.h is available
12522 : see if dbmclose exists
12523 set dbmclose d_dbmclose
12526 case "$d_dbmclose" in
12536 *) set rpcsvc/dbm.h i_rpcsvcdbm
12541 *) echo "We won't be including <dbm.h>"
12551 : see if this is a sys/file.h system
12556 : do we need to include sys/file.h ?
12560 if $h_sysfile; then
12562 echo "We'll be including <sys/file.h>." >&4
12565 echo "We won't be including <sys/file.h>." >&4
12575 : see if fcntl.h is there
12580 : see if we can include fcntl.h
12586 echo "We'll be including <fcntl.h>." >&4
12589 if $h_sysfile; then
12590 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12592 echo "We won't be including <fcntl.h>." >&4
12604 : see if locale.h is available
12605 set locale.h i_locale
12608 : see if mach cthreads are available
12609 if test "X$usethreads" = "X$define"; then
12610 set mach/cthreads.h i_machcthr
12613 i_machcthr="$undef"
12618 : see if this is a math.h system
12622 : see if this is a mntent.h system
12623 set mntent.h i_mntent
12626 : see if ndbm.h is available
12631 : see if dbm_open exists
12632 set dbm_open d_dbm_open
12634 case "$d_dbm_open" in
12637 echo "We won't be including <ndbm.h>"
12646 : see if net/errno.h is available
12648 set net/errno.h val
12651 : Unfortunately, it causes problems on some systems. Arrgh.
12654 cat > try.c <<'EOM'
12657 #include <net/errno.h>
12663 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12664 echo "We'll be including <net/errno.h>." >&4
12666 echo "We won't be including <net/errno.h>." >&4
12675 : see if netinet/tcp.h is available
12676 set netinet/tcp.h i_netinettcp
12679 : see if this is a poll.h system
12683 : get C preprocessor symbols handy
12685 $echo $n "Hmm... $c"
12686 echo $al | $tr ' ' $trnl >Cppsym.know
12687 $cat <<EOSS >Cppsym
12695 case "\$list\$#" in
12698 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12700 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12703 unknown="\$unknown \$sym"
12713 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12715 exit 0; _ _ _ _\1\\ \1\\
12718 echo "exit 1; _ _ _" >>Cppsym\$\$
12719 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12721 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12727 $rm -f Cppsym\$\$ Cppsym2\$\$
12732 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12734 : now check the C compiler for additional symbols
12735 postprocess_cc_v=''
12737 aix) postprocess_cc_v="|$tr , ' '" ;;
12744 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12747 -D*) echo "\$i" | $sed 's/^-D//';;
12748 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12753 postprocess_cc_v=''
12756 ./ccsym > ccsym1.raw
12757 if $test -s ccsym1.raw; then
12758 $sort ccsym1.raw | $uniq >ccsym.raw
12760 mv ccsym1.raw ccsym.raw
12763 $awk '/\=/ { print $0; next }
12764 { print $0"=1" }' ccsym.raw >ccsym.list
12765 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12766 $comm -13 ccsym.true ccsym.list >ccsym.own
12767 $comm -12 ccsym.true ccsym.list >ccsym.com
12768 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12770 if $test -z ccsym.raw; then
12771 echo "Your C compiler doesn't seem to define any symbols!" >&4
12773 echo "However, your C preprocessor defines the following symbols:"
12776 cppsymbols=`$cat Cppsym.true`
12777 cppsymbols=`echo $cppsymbols`
12778 cppccsymbols="$cppsymbols"
12780 if $test -s ccsym.com; then
12781 echo "Your C compiler and pre-processor define these symbols:"
12782 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12785 cppccsymbols=`$cat ccsym.com`
12786 cppccsymbols=`echo $cppccsymbols`
12787 $test "$silent" || sleep 1
12789 if $test -s ccsym.cpp; then
12790 $test "$also" && echo " "
12791 echo "Your C pre-processor ${also}defines the following symbols:"
12792 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12794 cppsymbols=`$cat ccsym.cpp`
12795 cppsymbols=`echo $cppsymbols`
12796 $test "$silent" || sleep 1
12798 if $test -s ccsym.own; then
12799 $test "$also" && echo " "
12800 echo "Your C compiler ${also}defines the following cpp symbols:"
12801 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12802 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12803 ccsymbols=`$cat ccsym.own`
12804 ccsymbols=`echo $ccsymbols`
12805 $test "$silent" || sleep 1
12810 : see if this is a termio system
12814 if $test `./findhdr termios.h`; then
12815 set tcsetattr i_termios
12821 "$define") echo "You have POSIX termios.h... good!" >&4;;
12822 *) if ./Cppsym pyr; then
12823 case "`/bin/universe`" in
12824 ucb) if $test `./findhdr sgtty.h`; then
12826 echo "<sgtty.h> found." >&4
12828 echo "System is pyramid with BSD universe."
12829 echo "<sgtty.h> not found--you could have problems." >&4
12831 *) if $test `./findhdr termio.h`; then
12833 echo "<termio.h> found." >&4
12835 echo "System is pyramid with USG universe."
12836 echo "<termio.h> not found--you could have problems." >&4
12840 if $test `./findhdr termio.h`; then
12841 echo "<termio.h> found." >&4
12843 elif $test `./findhdr sgtty.h`; then
12844 echo "<sgtty.h> found." >&4
12847 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12850 if $test `./findhdr sgtty.h`; then
12851 echo "<sgtty.h> found." >&4
12853 elif $test `./findhdr termio.h`; then
12854 echo "<termio.h> found." >&4
12857 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12861 set i_termio; eval $setvar
12862 val=$val2; set i_sgtty; eval $setvar
12863 val=$val3; set i_termios; eval $setvar
12865 : see if this is a shadow.h system
12866 set shadow.h i_shadow
12869 : see if this is a socks.h system
12870 set socks.h i_socks
12873 : see if stdarg is available
12875 if $test `./findhdr stdarg.h`; then
12876 echo "<stdarg.h> found." >&4
12879 echo "<stdarg.h> NOT found." >&4
12883 : see if varags is available
12885 if $test `./findhdr varargs.h`; then
12886 echo "<varargs.h> found." >&4
12888 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12891 : set up the varargs testing programs
12892 $cat > varargs.c <<EOP
12894 #include <stdarg.h>
12897 #include <varargs.h>
12901 int f(char *p, ...)
12915 p = va_arg(ap, char *);
12920 $cat > varargs <<EOP
12922 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
12931 : now check which varargs header should be included
12936 if `./varargs I_STDARG`; then
12938 elif `./varargs I_VARARGS`; then
12943 if `./varargs I_VARARGS`; then
12950 echo "I could not find the definition for va_dcl... You have problems..." >&4
12951 val="$undef"; set i_stdarg; eval $setvar
12952 val="$undef"; set i_varargs; eval $setvar
12957 case "$i_varhdr" in
12959 val="$define"; set i_stdarg; eval $setvar
12960 val="$undef"; set i_varargs; eval $setvar
12963 val="$undef"; set i_stdarg; eval $setvar
12964 val="$define"; set i_varargs; eval $setvar
12967 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
12971 : see if stddef is available
12972 set stddef.h i_stddef
12975 : see if sys/access.h is available
12976 set sys/access.h i_sysaccess
12979 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
12980 set sys/filio.h i_sysfilio
12983 if $test `./findhdr sys/ioctl.h`; then
12985 echo '<sys/ioctl.h> found.' >&4
12988 if $test $i_sysfilio = "$define"; then
12989 echo '<sys/ioctl.h> NOT found.' >&4
12991 $test $i_sgtty = "$define" && xxx="sgtty.h"
12992 $test $i_termio = "$define" && xxx="termio.h"
12993 $test $i_termios = "$define" && xxx="termios.h"
12994 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13000 : see if sys/resource.h has to be included
13001 set sys/resource.h i_sysresrc
13004 : see if sys/security.h is available
13005 set sys/security.h i_syssecrt
13008 : see if this is a sys/statvfs.h system
13009 set sys/statvfs.h i_sysstatvfs
13012 : see if this is a sys/un.h system
13013 set sys/un.h i_sysun
13016 : see if this is a syswait system
13017 set sys/wait.h i_syswait
13020 : see if this is an utime system
13021 set utime.h i_utime
13024 : see if this is a values.h system
13025 set values.h i_values
13028 : see if this is a vfork system
13031 set vfork.h i_vfork
13039 : see if gdbm.h is available
13044 : see if gdbm_open exists
13045 set gdbm_open d_gdbm_open
13047 case "$d_gdbm_open" in
13050 echo "We won't be including <gdbm.h>"
13060 echo "Looking for extensions..." >&4
13061 : If we are using the old config.sh, known_extensions may contain
13062 : old or inaccurate or duplicate values.
13063 known_extensions=''
13064 nonxs_extensions=''
13065 : We do not use find because it might not be available.
13066 : We do not just use MANIFEST because the user may have dropped
13067 : some additional extensions into the source tree and expect them
13070 : Function to recursively find available extensions, ignoring DynaLoader
13071 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13075 DynaLoader|dynaload) ;;
13077 if $test -f $xxx/$xxx.xs; then
13078 known_extensions="$known_extensions $1$xxx";
13079 elif $test -f $xxx/Makefile.PL; then
13080 nonxs_extensions="$nonxs_extensions $1$xxx";
13082 if $test -d $xxx -a $# -lt 10; then
13085 eval $find_extensions;
13097 eval $find_extensions
13098 set X $nonxs_extensions
13100 nonxs_extensions="$*"
13101 set X $known_extensions
13103 known_extensions="$*"
13106 : Now see which are supported on this system.
13108 for xxx in $known_extensions ; do
13112 $define) avail_ext="$avail_ext $xxx" ;;
13115 GDBM_File|gdbm_fil)
13117 $define) avail_ext="$avail_ext $xxx" ;;
13120 NDBM_File|ndbm_fil)
13122 $define) avail_ext="$avail_ext $xxx" ;;
13125 ODBM_File|odbm_fil)
13126 case "${i_dbm}${i_rpcsvcdbm}" in
13127 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13131 case "$useposix" in
13132 true|define|y) avail_ext="$avail_ext $xxx" ;;
13136 case "$useopcode" in
13137 true|define|y) avail_ext="$avail_ext $xxx" ;;
13141 case "$d_socket" in
13142 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13146 case "$usethreads" in
13147 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13151 : XXX Do we need a useipcsysv variable here
13152 case "${d_msg}${d_sem}${d_shm}" in
13153 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13156 *) avail_ext="$avail_ext $xxx"
13165 : Now see which nonxs extensions are supported on this system.
13166 : For now assume all are.
13168 for xxx in $nonxs_extensions ; do
13170 *) nonxs_ext="$nonxs_ext $xxx"
13182 A number of extensions are supplied with $package. You may choose to
13183 compile these extensions for dynamic loading (the default), compile
13184 them into the $package executable (static loading), or not include
13185 them at all. Answer "none" to include no extensions.
13186 Note that DynaLoader is always built and need not be mentioned here.
13189 case "$dynamic_ext" in
13190 '') dflt="$avail_ext" ;;
13191 *) dflt="$dynamic_ext"
13192 # Perhaps we are reusing an old out-of-date config.sh.
13195 if test X"$dynamic_ext" != X"$avail_ext"; then
13197 NOTICE: Your previous config.sh list may be incorrect.
13198 The extensions now available to you are
13200 but the default list from your previous config.sh is
13212 rp="What extensions do you wish to load dynamically?"
13215 none) dynamic_ext=' ' ;;
13216 *) dynamic_ext="$ans" ;;
13219 case "$static_ext" in
13221 : Exclude those already listed in dynamic linking
13223 for xxx in $avail_ext; do
13224 case " $dynamic_ext " in
13226 *) dflt="$dflt $xxx" ;;
13233 *) dflt="$static_ext"
13240 rp="What extensions do you wish to load statically?"
13243 none) static_ext=' ' ;;
13244 *) static_ext="$ans" ;;
13249 A number of extensions are supplied with $package. Answer "none"
13250 to include no extensions.
13251 Note that DynaLoader is always built and need not be mentioned here.
13254 case "$static_ext" in
13255 '') dflt="$avail_ext" ;;
13256 *) dflt="$static_ext"
13257 # Perhaps we are reusing an old out-of-date config.sh.
13260 if test X"$static_ext" != X"$avail_ext"; then
13262 NOTICE: Your previous config.sh list may be incorrect.
13263 The extensions now available to you are
13265 but the default list from your previous config.sh is
13274 : Exclude those that are not xs extensions
13278 rp="What extensions do you wish to include?"
13281 none) static_ext=' ' ;;
13282 *) static_ext="$ans" ;;
13287 set X $dynamic_ext $static_ext $nonxs_ext
13291 : Remove build directory name from cppstdin so it can be used from
13292 : either the present location or the final installed location.
13294 : Get out of the UU directory to get correct path name.
13296 case "$cppstdin" in
13298 echo "Stripping down cppstdin path name"
13304 : end of configuration questions
13306 echo "End of configuration questions."
13309 : back to where it started
13310 if test -d ../UU; then
13314 : configuration may be patched via a 'config.over' file
13315 if $test -f config.over; then
13318 rp='I see a config.over file. Do you wish to load it?'
13321 n*) echo "OK, I'll ignore it.";;
13323 echo "Configuration override changes have been loaded."
13328 : in case they want portability, strip down executable paths
13329 case "$d_portable" in
13332 echo "Stripping down executable paths..." >&4
13333 for file in $loclist $trylist; do
13335 eval $file=`basename $temp`
13340 : create config.sh file
13342 echo "Creating config.sh..." >&4
13343 $spitshell <<EOT >config.sh
13346 # This file was produced by running the Configure script. It holds all the
13347 # definitions figured out by Configure. Should you modify one of these values,
13348 # do not forget to propagate your changes by running "Configure -der". You may
13349 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13352 # Package name : $package
13353 # Source directory : $src
13354 # Configuration time: $cf_time
13355 # Configured by : $cf_by
13356 # Target system : $myuname
13366 Revision='$Revision'
13373 alignbytes='$alignbytes'
13374 ansi2knr='$ansi2knr'
13375 aphostname='$aphostname'
13376 apiversion='$apiversion'
13379 archlibexp='$archlibexp'
13380 archname64='$archname64'
13381 archname='$archname'
13382 archobjs='$archobjs'
13387 bincompat5005='$bincompat5005'
13391 byteorder='$byteorder'
13393 castflags='$castflags'
13396 cccdlflags='$cccdlflags'
13397 ccdlflags='$ccdlflags'
13399 ccsymbols='$ccsymbols'
13401 cf_email='$cf_email'
13406 clocktype='$clocktype'
13408 compress='$compress'
13409 contains='$contains'
13413 cpp_stuff='$cpp_stuff'
13414 cppccsymbols='$cppccsymbols'
13415 cppflags='$cppflags'
13417 cppminus='$cppminus'
13419 cppstdin='$cppstdin'
13420 cppsymbols='$cppsymbols'
13421 crosscompile='$crosscompile'
13422 cryptlib='$cryptlib'
13424 d_Gconvert='$d_Gconvert'
13425 d_PRIEldbl='$d_PRIEldbl'
13426 d_PRIFldbl='$d_PRIFldbl'
13427 d_PRIGldbl='$d_PRIGldbl'
13428 d_PRIX64='$d_PRIX64'
13429 d_PRId64='$d_PRId64'
13430 d_PRIeldbl='$d_PRIeldbl'
13431 d_PRIfldbl='$d_PRIfldbl'
13432 d_PRIgldbl='$d_PRIgldbl'
13433 d_PRIi64='$d_PRIi64'
13434 d_PRIo64='$d_PRIo64'
13435 d_PRIu64='$d_PRIu64'
13436 d_PRIx64='$d_PRIx64'
13437 d_access='$d_access'
13438 d_accessx='$d_accessx'
13440 d_archlib='$d_archlib'
13443 d_attribut='$d_attribut'
13446 d_bincompat5005='$d_bincompat5005'
13448 d_bsdgetpgrp='$d_bsdgetpgrp'
13449 d_bsdsetpgrp='$d_bsdsetpgrp'
13451 d_casti32='$d_casti32'
13452 d_castneg='$d_castneg'
13453 d_charvspr='$d_charvspr'
13455 d_chroot='$d_chroot'
13456 d_chsize='$d_chsize'
13457 d_closedir='$d_closedir'
13458 d_cmsghdr_s='$d_cmsghdr_s'
13462 d_cuserid='$d_cuserid'
13463 d_dbl_dig='$d_dbl_dig'
13464 d_difftime='$d_difftime'
13465 d_dirnamlen='$d_dirnamlen'
13466 d_dlerror='$d_dlerror'
13467 d_dlopen='$d_dlopen'
13468 d_dlsymun='$d_dlsymun'
13469 d_dosuid='$d_dosuid'
13470 d_drand48proto='$d_drand48proto'
13472 d_eaccess='$d_eaccess'
13473 d_endgrent='$d_endgrent'
13474 d_endhent='$d_endhent'
13475 d_endnent='$d_endnent'
13476 d_endpent='$d_endpent'
13477 d_endpwent='$d_endpwent'
13478 d_endsent='$d_endsent'
13479 d_endspent='$d_endspent'
13480 d_eofnblk='$d_eofnblk'
13481 d_eunice='$d_eunice'
13482 d_fchmod='$d_fchmod'
13483 d_fchown='$d_fchown'
13485 d_fd_macros='$d_fd_macros'
13486 d_fd_set='$d_fd_set'
13487 d_fds_bits='$d_fds_bits'
13488 d_fgetpos='$d_fgetpos'
13489 d_flexfnam='$d_flexfnam'
13492 d_fpathconf='$d_fpathconf'
13493 d_fpos64_t='$d_fpos64_t'
13494 d_fseeko='$d_fseeko'
13495 d_fsetpos='$d_fsetpos'
13496 d_fstatfs='$d_fstatfs'
13497 d_fstatvfs='$d_fstatvfs'
13498 d_ftello='$d_ftello'
13500 d_getgrent='$d_getgrent'
13501 d_getgrps='$d_getgrps'
13502 d_gethbyaddr='$d_gethbyaddr'
13503 d_gethbyname='$d_gethbyname'
13504 d_gethent='$d_gethent'
13505 d_gethname='$d_gethname'
13506 d_gethostprotos='$d_gethostprotos'
13507 d_getlogin='$d_getlogin'
13508 d_getmntent='$d_getmntent'
13509 d_getnbyaddr='$d_getnbyaddr'
13510 d_getnbyname='$d_getnbyname'
13511 d_getnent='$d_getnent'
13512 d_getnetprotos='$d_getnetprotos'
13513 d_getpbyname='$d_getpbyname'
13514 d_getpbynumber='$d_getpbynumber'
13515 d_getpent='$d_getpent'
13516 d_getpgid='$d_getpgid'
13517 d_getpgrp2='$d_getpgrp2'
13518 d_getpgrp='$d_getpgrp'
13519 d_getppid='$d_getppid'
13520 d_getprior='$d_getprior'
13521 d_getprotoprotos='$d_getprotoprotos'
13522 d_getpwent='$d_getpwent'
13523 d_getsbyname='$d_getsbyname'
13524 d_getsbyport='$d_getsbyport'
13525 d_getsent='$d_getsent'
13526 d_getservprotos='$d_getservprotos'
13527 d_getspent='$d_getspent'
13528 d_getspnam='$d_getspnam'
13529 d_gettimeod='$d_gettimeod'
13530 d_gnulibc='$d_gnulibc'
13531 d_grpasswd='$d_grpasswd'
13532 d_hasmntopt='$d_hasmntopt'
13535 d_inetaton='$d_inetaton'
13536 d_int64t='$d_int64t'
13537 d_iovec_s='$d_iovec_s'
13538 d_isascii='$d_isascii'
13539 d_killpg='$d_killpg'
13540 d_lchown='$d_lchown'
13541 d_ldbl_dig='$d_ldbl_dig'
13543 d_llseek='$d_llseek'
13544 d_locconv='$d_locconv'
13546 d_longdbl='$d_longdbl'
13547 d_longlong='$d_longlong'
13549 d_madvise='$d_madvise'
13551 d_mbstowcs='$d_mbstowcs'
13552 d_mbtowc='$d_mbtowc'
13553 d_memchr='$d_memchr'
13554 d_memcmp='$d_memcmp'
13555 d_memcpy='$d_memcpy'
13556 d_memmove='$d_memmove'
13557 d_memset='$d_memset'
13559 d_mkfifo='$d_mkfifo'
13560 d_mktime='$d_mktime'
13562 d_mprotect='$d_mprotect'
13564 d_msg_ctrunc='$d_msg_ctrunc'
13565 d_msg_dontroute='$d_msg_dontroute'
13566 d_msg_oob='$d_msg_oob'
13567 d_msg_peek='$d_msg_peek'
13568 d_msg_proxy='$d_msg_proxy'
13569 d_msgctl='$d_msgctl'
13570 d_msgget='$d_msgget'
13571 d_msghdr_s='$d_msghdr_s'
13572 d_msgrcv='$d_msgrcv'
13573 d_msgsnd='$d_msgsnd'
13575 d_munmap='$d_munmap'
13576 d_mymalloc='$d_mymalloc'
13578 d_off64_t='$d_off64_t'
13579 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13580 d_oldpthreads='$d_oldpthreads'
13581 d_oldsock='$d_oldsock'
13583 d_pathconf='$d_pathconf'
13585 d_phostname='$d_phostname'
13588 d_portable='$d_portable'
13589 d_pthread_yield='$d_pthread_yield'
13591 d_pwchange='$d_pwchange'
13592 d_pwclass='$d_pwclass'
13593 d_pwcomment='$d_pwcomment'
13594 d_pwexpire='$d_pwexpire'
13595 d_pwgecos='$d_pwgecos'
13596 d_pwpasswd='$d_pwpasswd'
13597 d_pwquota='$d_pwquota'
13598 d_readdir='$d_readdir'
13599 d_readlink='$d_readlink'
13601 d_recvmsg='$d_recvmsg'
13602 d_rename='$d_rename'
13603 d_rewinddir='$d_rewinddir'
13605 d_safebcpy='$d_safebcpy'
13606 d_safemcpy='$d_safemcpy'
13607 d_sanemcmp='$d_sanemcmp'
13608 d_sched_yield='$d_sched_yield'
13609 d_scm_rights='$d_scm_rights'
13610 d_seekdir='$d_seekdir'
13611 d_select='$d_select'
13613 d_semctl='$d_semctl'
13614 d_semctl_semid_ds='$d_semctl_semid_ds'
13615 d_semctl_semun='$d_semctl_semun'
13616 d_semget='$d_semget'
13618 d_sendmsg='$d_sendmsg'
13619 d_setegid='$d_setegid'
13620 d_seteuid='$d_seteuid'
13621 d_setgrent='$d_setgrent'
13622 d_setgrps='$d_setgrps'
13623 d_sethent='$d_sethent'
13624 d_setlinebuf='$d_setlinebuf'
13625 d_setlocale='$d_setlocale'
13626 d_setnent='$d_setnent'
13627 d_setpent='$d_setpent'
13628 d_setpgid='$d_setpgid'
13629 d_setpgrp2='$d_setpgrp2'
13630 d_setpgrp='$d_setpgrp'
13631 d_setprior='$d_setprior'
13632 d_setpwent='$d_setpwent'
13633 d_setregid='$d_setregid'
13634 d_setresgid='$d_setresgid'
13635 d_setresuid='$d_setresuid'
13636 d_setreuid='$d_setreuid'
13637 d_setrgid='$d_setrgid'
13638 d_setruid='$d_setruid'
13639 d_setsent='$d_setsent'
13640 d_setsid='$d_setsid'
13641 d_setspent='$d_setspent'
13642 d_setvbuf='$d_setvbuf'
13646 d_shmatprototype='$d_shmatprototype'
13647 d_shmctl='$d_shmctl'
13649 d_shmget='$d_shmget'
13650 d_sigaction='$d_sigaction'
13651 d_sigsetjmp='$d_sigsetjmp'
13652 d_socket='$d_socket'
13653 d_sockpair='$d_sockpair'
13654 d_statblks='$d_statblks'
13655 d_statfs='$d_statfs'
13656 d_statfsflags='$d_statfsflags'
13657 d_statvfs='$d_statvfs'
13658 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13659 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13660 d_stdio_stream_array='$d_stdio_stream_array'
13661 d_stdiobase='$d_stdiobase'
13662 d_stdstdio='$d_stdstdio'
13663 d_strchr='$d_strchr'
13664 d_strcoll='$d_strcoll'
13665 d_strctcpy='$d_strctcpy'
13666 d_strerrm='$d_strerrm'
13667 d_strerror='$d_strerror'
13668 d_strtod='$d_strtod'
13669 d_strtol='$d_strtol'
13670 d_strtoul='$d_strtoul'
13671 d_strtoull='$d_strtoull'
13672 d_strxfrm='$d_strxfrm'
13673 d_suidsafe='$d_suidsafe'
13674 d_symlink='$d_symlink'
13675 d_syscall='$d_syscall'
13676 d_sysconf='$d_sysconf'
13677 d_sysernlst='$d_sysernlst'
13678 d_syserrlst='$d_syserrlst'
13679 d_system='$d_system'
13680 d_tcgetpgrp='$d_tcgetpgrp'
13681 d_tcsetpgrp='$d_tcsetpgrp'
13682 d_telldir='$d_telldir'
13683 d_telldirproto='$d_telldirproto'
13686 d_truncate='$d_truncate'
13687 d_tzname='$d_tzname'
13690 d_union_semun='$d_union_semun'
13691 d_vendorlib='$d_vendorlib'
13693 d_void_closedir='$d_void_closedir'
13694 d_voidsig='$d_voidsig'
13695 d_voidtty='$d_voidtty'
13696 d_volatile='$d_volatile'
13697 d_vprintf='$d_vprintf'
13699 d_waitpid='$d_waitpid'
13700 d_wcstombs='$d_wcstombs'
13701 d_wctomb='$d_wctomb'
13702 d_writev='$d_writev'
13705 db_hashtype='$db_hashtype'
13706 db_prefixtype='$db_prefixtype'
13707 defvoidused='$defvoidused'
13708 direntrytype='$direntrytype'
13711 doublesize='$doublesize'
13713 dynamic_ext='$dynamic_ext'
13719 eunicefix='$eunicefix'
13722 extensions='$extensions'
13723 fflushNULL='$fflushNULL'
13724 fflushall='$fflushall'
13726 firstmakefile='$firstmakefile'
13728 fpostype='$fpostype'
13729 freetype='$freetype'
13731 full_csh='$full_csh'
13732 full_sed='$full_sed'
13733 gccversion='$gccversion'
13737 groupcat='$groupcat'
13738 groupstype='$groupstype'
13741 h_sysfile='$h_sysfile'
13745 i_arpainet='$i_arpainet'
13746 i_bsdioctl='$i_bsdioctl'
13749 i_dirent='$i_dirent'
13756 i_inttypes='$i_inttypes'
13757 i_limits='$i_limits'
13758 i_locale='$i_locale'
13759 i_machcthr='$i_machcthr'
13760 i_malloc='$i_malloc'
13762 i_memory='$i_memory'
13763 i_mntent='$i_mntent'
13766 i_neterrno='$i_neterrno'
13767 i_netinettcp='$i_netinettcp'
13770 i_pthread='$i_pthread'
13772 i_rpcsvcdbm='$i_rpcsvcdbm'
13775 i_shadow='$i_shadow'
13777 i_stdarg='$i_stdarg'
13778 i_stddef='$i_stddef'
13779 i_stdlib='$i_stdlib'
13780 i_string='$i_string'
13781 i_sysaccess='$i_sysaccess'
13782 i_sysdir='$i_sysdir'
13783 i_sysfile='$i_sysfile'
13784 i_sysfilio='$i_sysfilio'
13786 i_sysioctl='$i_sysioctl'
13787 i_sysmman='$i_sysmman'
13788 i_sysmount='$i_sysmount'
13789 i_sysndir='$i_sysndir'
13790 i_sysparam='$i_sysparam'
13791 i_sysresrc='$i_sysresrc'
13792 i_syssecrt='$i_syssecrt'
13793 i_sysselct='$i_sysselct'
13794 i_syssockio='$i_syssockio'
13795 i_sysstat='$i_sysstat'
13796 i_sysstatvfs='$i_sysstatvfs'
13797 i_systime='$i_systime'
13798 i_systimek='$i_systimek'
13799 i_systimes='$i_systimes'
13800 i_systypes='$i_systypes'
13801 i_sysuio='$i_sysuio'
13803 i_syswait='$i_syswait'
13804 i_termio='$i_termio'
13805 i_termios='$i_termios'
13807 i_unistd='$i_unistd'
13809 i_values='$i_values'
13810 i_varargs='$i_varargs'
13811 i_varhdr='$i_varhdr'
13813 ignore_versioned_solibs='$ignore_versioned_solibs'
13816 installarchlib='$installarchlib'
13817 installbin='$installbin'
13818 installman1dir='$installman1dir'
13819 installman3dir='$installman3dir'
13820 installprefix='$installprefix'
13821 installprefixexp='$installprefixexp'
13822 installprivlib='$installprivlib'
13823 installscript='$installscript'
13824 installsitearch='$installsitearch'
13825 installsitelib='$installsitelib'
13826 installstyle='$installstyle'
13827 installusrbinperl='$installusrbinperl'
13828 installvendorlib='$installvendorlib'
13830 known_extensions='$known_extensions'
13834 lddlflags='$lddlflags'
13836 ldlibpthname='$ldlibpthname'
13843 libswanted='$libswanted'
13849 locincpth='$locincpth'
13850 loclibpth='$loclibpth'
13851 longdblsize='$longdblsize'
13852 longlongsize='$longlongsize'
13853 longsize='$longsize'
13857 lseeksize='$lseeksize'
13858 lseektype='$lseektype'
13862 make_set_make='$make_set_make'
13863 mallocobj='$mallocobj'
13864 mallocsrc='$mallocsrc'
13865 malloctype='$malloctype'
13867 man1direxp='$man1direxp'
13870 man3direxp='$man3direxp'
13874 mips_type='$mips_type'
13876 mmaptype='$mmaptype'
13878 modetype='$modetype'
13880 multiarch='$multiarch'
13882 myarchname='$myarchname'
13883 mydomain='$mydomain'
13884 myhostname='$myhostname'
13887 netdb_hlen_type='$netdb_hlen_type'
13888 netdb_host_type='$netdb_host_type'
13889 netdb_name_type='$netdb_name_type'
13890 netdb_net_type='$netdb_net_type'
13893 nm_so_opt='$nm_so_opt'
13894 nonxs_ext='$nonxs_ext'
13896 o_nonblock='$o_nonblock'
13898 old_pthread_create_joinable='$old_pthread_create_joinable'
13899 optimize='$optimize'
13900 orderlib='$orderlib'
13906 patchlevel='$patchlevel'
13907 path_sep='$path_sep'
13909 perladmin='$perladmin'
13910 perlpath='$perlpath'
13912 phostname='$phostname'
13915 pm_apiversion='$pm_apiversion'
13919 prefixexp='$prefixexp'
13921 privlibexp='$privlibexp'
13922 prototype='$prototype'
13924 randbits='$randbits'
13925 randfunc='$randfunc'
13926 randseedtype='$randseedtype'
13928 rd_nodata='$rd_nodata'
13932 sPRIEldbl='$sPRIEldbl'
13933 sPRIFldbl='$sPRIFldbl'
13934 sPRIGldbl='$sPRIGldbl'
13937 sPRIeldbl='$sPRIeldbl'
13938 sPRIfldbl='$sPRIfldbl'
13939 sPRIgldbl='$sPRIgldbl'
13944 sched_yield='$sched_yield'
13945 scriptdir='$scriptdir'
13946 scriptdirexp='$scriptdirexp'
13948 seedfunc='$seedfunc'
13949 selectminbits='$selectminbits'
13950 selecttype='$selecttype'
13951 sendmail='$sendmail'
13954 sharpbang='$sharpbang'
13955 shmattype='$shmattype'
13956 shortsize='$shortsize'
13959 sig_count='$sig_count'
13960 sig_name='$sig_name'
13961 sig_name_init='$sig_name_init'
13963 sig_num_init='$sig_num_init'
13964 signal_t='$signal_t'
13965 sitearch='$sitearch'
13966 sitearchexp='$sitearchexp'
13968 sitelibexp='$sitelibexp'
13969 siteprefix='$siteprefix'
13970 siteprefixexp='$siteprefixexp'
13971 sizetype='$sizetype'
13976 sockethdr='$sockethdr'
13977 socketlib='$socketlib'
13979 spackage='$spackage'
13980 spitshell='$spitshell'
13983 ssizetype='$ssizetype'
13984 startperl='$startperl'
13986 static_ext='$static_ext'
13988 stdio_base='$stdio_base'
13989 stdio_bufsiz='$stdio_bufsiz'
13990 stdio_cnt='$stdio_cnt'
13991 stdio_filbuf='$stdio_filbuf'
13992 stdio_ptr='$stdio_ptr'
13993 stdio_stream_array='$stdio_stream_array'
13996 subversion='$subversion'
14003 timeincl='$timeincl'
14004 timetype='$timetype'
14012 use64bits='$use64bits'
14014 uselargefiles='$uselargefiles'
14015 uselongdouble='$uselongdouble'
14016 usemorebits='$usemorebits'
14017 usemultiplicity='$usemultiplicity'
14018 usemymalloc='$usemymalloc'
14020 useopcode='$useopcode'
14021 useperlio='$useperlio'
14022 useposix='$useposix'
14024 useshrplib='$useshrplib'
14025 usesocks='$usesocks'
14026 usethreads='$usethreads'
14027 usevendorprefix='$usevendorprefix'
14028 usevfork='$usevfork'
14031 vendorlib='$vendorlib'
14032 vendorlibexp='$vendorlibexp'
14033 vendorprefix='$vendorprefix'
14034 vendorprefixexp='$vendorprefixexp'
14037 voidflags='$voidflags'
14039 xs_apiversion='$xs_apiversion'
14044 : Add in command line options if available
14045 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14047 : add special variables
14048 $test -f $src/patchlevel.h && \
14049 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14050 echo "CONFIGDOTSH=true" >>config.sh
14052 : propagate old symbols
14053 if $test -f UU/config.sh; then
14054 <UU/config.sh sort | uniq >UU/oldconfig.sh
14055 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14056 sort | uniq -u >UU/oldsyms
14057 set X `cat UU/oldsyms`
14063 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14065 echo "# Variables propagated from previous config.sh file." >>config.sh
14066 for sym in `cat UU/oldsyms`; do
14067 echo " Propagating $hint variable "'$'"$sym..."
14068 eval 'tmp="$'"${sym}"'"'
14070 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14076 : Finish up by extracting the .SH files
14090 If you'd like to make any changes to the config.sh file before I begin
14091 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14094 rp="Press return or use a shell escape to edit config.sh:"
14099 *) : in case they cannot read
14100 sh 1>&4 -c "$ans";;
14105 : if this fails, just run all the .SH files by hand
14112 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14119 Now you need to generate make dependencies by running "$make depend".
14120 You might prefer to run it in background: "$make depend > makedepend.out &"
14121 It can take a while, so you might not want to run it right now.
14126 rp="Run $make depend now?"
14130 $make depend && echo "Now you must run a $make."
14133 echo "You must run '$make depend' then '$make'."
14136 elif test -f [Mm]akefile; then
14138 echo "Now you must run a $make."
14143 if $test -f Policy.sh; then
14146 If you compile $package on a different machine or from a different object
14147 directory, copy the Policy.sh file from this object directory to the
14148 new one before you run Configure -- this will help you with most of
14149 the policy defaults.
14153 if $test -f config.msg; then
14154 echo "Hmm. I also noted the following information while running:"
14156 $cat config.msg >&4
14159 $rm -f kit*isdone ark*isdone