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 package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist
20 # Though this script was generated by metaconfig, it is OK to send
21 # patches against it. It's up to the Configure pumpkin to backport
22 # the patch to the metaunits if it is accepted.
23 # See Porting/pumpkin.pod for more information on metaconfig.
26 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
28 # Generated on Fri Nov 28 08:39:51 CET 2008 [metaconfig 3.5 PL0]
29 # (with additional metaconfig patches by perlbug@perl.org)
34 SCO csh still thinks true is false. Write to SCO today and tell them that next
35 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
37 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
38 we'd have to do is go in and swap the && and || tokens, wherever they are.)
40 [End of diatribe. We now return you to your regularly scheduled programming...]
44 OOPS! You naughty creature! You didn't run Configure with sh!
45 I will attempt to remedy the situation by running sh for you...
49 true || exec sh $0 $argv:q
51 (exit $?0) || cat c2$$
52 (exit $?0) || exec sh $0 $argv:q
55 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
58 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
59 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
60 *** Please read the README.plan9 for further instructions.
61 *** Cannot continue, aborting.
67 if test ! -c /dev/null ; then
70 *** I'm sorry, but /dev/null appears to be a file rather than a device.
71 *** Please consult your operating sytem's notes for making a device
73 *** Cannot continue, aborting.
79 : compute my invocation name
83 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
88 : Proper separator for the PATH environment variable
90 : On OS/2 this directory should exist if this is not floppy only system ":-]"
91 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
92 if test -n "$OS2_SHELL"; then
94 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
95 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
97 elif test -n "$DJGPP"; then
98 case "X${MACHTYPE:-nonesuchmach}" in
105 : Proper PATH setting
106 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
107 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
108 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
109 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
110 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
111 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
112 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
113 paths="$paths /sbin /usr/sbin /usr/libexec"
114 paths="$paths /system/gnu_library/bin"
118 case "$p_$PATH$p_" in
120 *) test -d $p && PATH=$PATH$p_$p ;;
127 : shall we be using ksh?
133 if (PATH=.; alias -x) >/dev/null 2>&1; then
136 if test -f /hp-ux -a -f /bin/ksh; then
137 needksh='to avoid sh bug in "here document" expansion'
139 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
140 if test X`/usr/bin/uname -v` = X4; then
141 avoidksh="to avoid AIX 4's /bin/sh"
145 if test -f /osf_boot -a -f /usr/sbin/setld; then
146 if test X`/usr/bin/uname -s` = XOSF1; then
147 avoidksh="to avoid Digital UNIX' ksh"
152 case "$inksh/$needksh" in
159 case "$inksh/$avoidksh" in
165 case "$inksh/$needksh-$avoidksh-" in
168 (I see you are using the Korn shell. Some ksh's blow up on $me,
169 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
176 echo "(Feeding myself to $newsh $reason.)"
178 Configure|*/Configure) exec $newsh $0 "$@";;
179 *) exec $newsh Configure "$@";;
183 test -x "${newsh}" || unset newsh
185 : if needed, set CDPATH to a harmless value that is not chatty
186 : avoid bash 2.02 problems with empty CDPATH.
190 *bash*) CDPATH='.' ;;
196 : Configure runs within the UU subdirectory
197 test -d UU || mkdir UU
337 initialinstalllocation=''
364 d_attribute_format=''
365 d_attribute_malloc=''
366 d_attribute_nonnull=''
367 d_attribute_noreturn=''
369 d_attribute_unused=''
370 d_attribute_warn_unused_result=''
371 d_printf_format_null=''
374 d_builtin_choose_expr=''
377 d_c99_variadic_macros=''
424 endhostent_r_proto=''
430 endprotoent_r_proto=''
436 endservent_r_proto=''
488 gethostbyaddr_r_proto=''
490 gethostbyname_r_proto=''
492 gethostent_r_proto=''
504 getnetbyaddr_r_proto=''
506 getnetbyname_r_proto=''
520 d_getprotobyname_r=''
521 getprotobyname_r_proto=''
522 d_getprotobynumber_r=''
523 getprotobynumber_r_proto=''
525 getprotoent_r_proto=''
537 getservbyname_r_proto=''
539 getservbyport_r_proto=''
541 getservent_r_proto=''
565 d_libm_lib_version=''
568 d_localtime_r_needs_tzset=''
579 d_malloc_good_size=''
621 d_old_pthread_create_joinable=''
622 old_pthread_create_joinable=''
624 d_pthread_attr_setscope=''
663 sethostent_r_proto=''
680 setprotoent_r_proto=''
692 setservent_r_proto=''
726 d_sprintf_returns_strlen=''
741 d_stdio_ptr_lval_nochange_cnt=''
742 d_stdio_ptr_lval_sets_cnt=''
885 d_gdbm_ndbm_h_uses_prototypes=''
886 d_gdbmndbm_h_uses_prototypes=''
888 d_ndbm_h_uses_prototypes=''
962 d_inc_version_list=''
964 inc_version_list_init=''
983 ignore_versioned_solibs=''
1047 d_perl_otherlibdirs=''
1055 api_versionstring=''
1061 version_patchlevel_string=''
1065 d_nv_preserves_uv=''
1066 d_nv_zero_is_allbits_zero=''
1077 nv_overflows_integers_at=''
1078 nv_preserves_uv_bits=''
1150 installsitehtml1dir=''
1153 installsitehtml3dir=''
1160 installsiteman1dir=''
1163 installsiteman3dir=''
1168 installsitescript=''
1183 d_stdio_stream_array=''
1184 stdio_stream_array=''
1201 ccflags_uselargefiles=''
1202 ldflags_uselargefiles=''
1203 libswanted_uselargefiles=''
1223 installvendorarch=''
1230 installvendorhtml1dir=''
1232 vendorhtml1direxp=''
1233 installvendorhtml3dir=''
1235 vendorhtml3direxp=''
1241 installvendorman1dir=''
1244 installvendorman3dir=''
1251 installvendorscript=''
1264 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1267 : We must find out about Eunice early
1269 if test -f /etc/unixtovms; then
1270 eunicefix=/etc/unixtovms
1272 if test -f /etc/unixtovms.exe; then
1273 eunicefix=/etc/unixtovms.exe
1276 : Set executable suffix now -- needed before hints available
1277 if test -f "/libs/version.library"; then
1280 elif test -f "/system/gnu_library/bin/ar.pm"; then
1283 elif test -n "$DJGPP"; then
1286 elif test -d c:/. -o -n "$is_os2" ; then
1293 : Trailing extension. Override this in a hint file, if needed.
1294 : Extra object files, if any, needed on this platform.
1298 : change the next line if compiling for Xenix/286 on Xenix/386
1299 xlibpth='/usr/lib/386 /lib/386'
1300 : Possible local library directories to search.
1301 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1302 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1304 : general looking path for locating libraries
1305 glibpth="/lib /usr/lib $xlibpth"
1306 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1307 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1308 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1309 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1311 : Private path used by Configure to find libraries. Its value
1312 : is prepended to libpth. This variable takes care of special
1313 : machines, like the mips. Usually, it should be empty.
1316 : default library list
1318 : some systems want to use only the non-versioned libso:s
1319 ignore_versioned_solibs=''
1320 : set usethreads on the Configure command line to enable threads.
1321 usereentrant='undef'
1322 : full support for void wanted by default
1325 : Possible local include directories to search.
1326 : Set locincpth to "" in a hint file to defeat local include searches.
1327 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1328 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1330 : no include file wanted by default
1333 : Enable -DEBUGGING and -DDEBUGGING from the command line
1340 : set useposix=false in your hint file to disable the POSIX extension.
1342 : set useopcode=false in your hint file to disable the Opcode extension.
1345 ccflags_uselargefiles=''
1346 ldflags_uselargefiles=''
1347 libswanted_uselargefiles=''
1348 : set usemultiplicity on the Configure command line to enable multiplicity.
1349 : set usesocks on the Configure command line to enable socks.
1350 : List of libraries we want.
1351 : If anyone needs extra -lxxx, put those in a hint file.
1352 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1353 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1354 : We probably want to search /usr/shlib before most other libraries.
1355 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1356 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1357 glibpth="/usr/shlib $glibpth"
1358 : Do not use vfork unless overridden by a hint file.
1361 : Find the basic shell for Bourne shell scripts
1365 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1368 if test -f "$xxx"; then
1371 : Build up a list and do a single loop so we can 'break' out.
1372 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1373 for xxx in sh bash ksh pdksh ash; do
1375 try="$try ${p}/${xxx}"
1379 if test -f "$xxx"; then
1382 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1385 elif test -f "$xxx.exe"; then
1396 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1398 Usually it's in /bin/sh. How did you even get this far?
1399 Please contact me (Perl Maintainers) at perlbug@perl.org and
1400 we'll try to straighten this all out.
1406 : see if sh knows # comments
1407 if `$sh -c '#' >/dev/null 2>&1`; then
1411 test -f $xcat$_exe || xcat=/usr/bin/cat
1412 if test ! -f $xcat$_exe; then
1413 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1414 if test -f $p/cat$_exe; then
1419 if test ! -f $xcat$_exe; then
1420 echo "Can't find cat anywhere!"
1424 echo "#!$xcat" >sharp
1427 ./sharp > today 2>/dev/null
1428 if test -s today; then
1431 echo "#! $xcat" > sharp
1434 ./sharp > today 2>/dev/null
1435 if test -s today; then
1443 echo "Your $sh doesn't grok # comments--I will strip them later on."
1446 echo "exec grep -v '^[ ]*#'" >spitshell
1448 $eunicefix spitshell
1449 spitshell=`pwd`/spitshell
1451 echo "I presume that if # doesn't work, #! won't work either!"
1456 : figure out how to guarantee sh startup
1458 '') startsh=${sharpbang}${sh} ;;
1470 : echo "Yup, it does."
1472 echo "Hmm... '$startsh' does not guarantee sh startup..."
1473 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1477 : Save command line options in file UU/cmdline.opt for later use in
1478 : generating config.sh.
1479 cat > cmdline.opt <<EOSH
1480 : Configure command line arguments.
1489 cat >>cmdline.opt <<EOSH
1490 config_arg$argn='$arg'
1492 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1495 arg_exp=`cat cmdl.opt`
1496 args_exp="$args_exp$args_sep'$arg_exp'"
1497 argn=`expr $argn + 1`
1502 : produce awk script to parse command line options
1503 cat >options.awk <<'EOF'
1505 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1507 len = length(optstr);
1508 for (i = 1; i <= len; i++) {
1509 c = substr(optstr, i, 1);
1510 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1521 if (substr(str, 1, 1) != "-") {
1522 printf("'%s'\n", str);
1526 for (i = 2; i <= len; i++) {
1527 c = substr(str, i, 1);
1529 printf("-%s\n", substr(str, i));
1535 printf("'%s'\n", substr(str, i + 1));
1548 : process the command line options
1549 set X `for arg in "$@"; do echo "X$arg"; done |
1550 sed -e s/X// | awk -f options.awk`
1555 : set up default values
1565 rm -f optdef.sh posthint.sh
1566 cat >optdef.sh <<EOS
1572 while test $# -gt 0; do
1574 -d) shift; fastread=yes;;
1575 -e) shift; alldone=cont;;
1579 if test -r "$1"; then
1582 echo "$me: cannot read config file $1." >&2
1588 -h) shift; error=true;;
1589 -r) shift; reuseval=true;;
1590 -s) shift; silent=true; realsilent=true;;
1591 -E) shift; alldone=exit;;
1592 -K) shift; knowitall=true;;
1593 -O) shift; override=true;;
1594 -S) shift; silent=true; extractsh=true;;
1599 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1600 echo "$me: ignoring -D $1" >&2
1603 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1604 *) echo "$1='define'" >> optdef.sh;;
1611 *=) echo "$1" >> optdef.sh;;
1613 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1614 echo "$me: ignoring -U $1" >&2
1616 *) echo "$1='undef'" >> optdef.sh;;
1627 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1631 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1632 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1638 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1639 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1640 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1641 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1642 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1643 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1649 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1651 echo "$yyy=''" >> posthint.sh ;;
1656 echo "$yyy='$zzz'" >> posthint.sh ;;
1658 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1660 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1665 echo "$yyy=$zzz" >> posthint.sh ;;
1666 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1670 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1673 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1681 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1682 [-U symbol] [-U symbol=] [-A command:symbol...]
1683 -d : use defaults for all answers.
1684 -e : go on without questioning past the production of config.sh.
1685 -f : specify an alternate default configuration file.
1686 -h : print this help message and exit (with an error status).
1687 -r : reuse C symbols value if possible (skips costly nm extraction).
1688 -s : silent mode, only echoes questions and essential information.
1689 -D : define symbol to have some value:
1690 -D symbol symbol gets the value 'define'
1691 -D symbol=value symbol gets the value 'value'
1692 common used examples (see INSTALL for more info):
1693 -Duse64bitint use 64bit integers
1694 -Duse64bitall use 64bit integers and pointers
1695 -Dusethreads use thread support
1696 -Dinc_version_list=none do not include older perl trees in @INC
1697 -DEBUGGING=none DEBUGGING options
1698 -Dcc=gcc choose your compiler
1699 -Dprefix=/opt/perl5 choose your destination
1700 -E : stop at the end of questions, after having produced config.sh.
1701 -K : do not use unless you know what you are doing.
1702 -O : let -D and -U override definitions from loaded configuration file.
1703 -S : perform variable substitutions on all .SH files (can mix with -f)
1704 -U : undefine symbol:
1705 -U symbol symbol gets the value 'undef'
1706 -U symbol= symbol gets completely empty
1708 -A : manipulate symbol after the platform specific hints have been applied:
1709 -A append:symbol=value append value to symbol
1710 -A symbol=value like append:, but with a separating space
1711 -A define:symbol=value define symbol to have value
1712 -A clear:symbol define symbol to be ''
1713 -A define:symbol define symbol to be 'define'
1714 -A eval:symbol=value define symbol to be eval of value
1715 -A prepend:symbol=value prepend value to symbol
1716 -A undef:symbol define symbol to be 'undef'
1717 -A undef:symbol= define symbol to be ''
1718 e.g.: -A prepend:libswanted='cl pthread '
1719 -A ccflags=-DSOME_MACRO
1720 -V : print version number and exit (with a zero status).
1727 case "$fastread$alldone" in
1730 case "$extractsh" in
1733 if test ! -t 0; then
1734 echo "Say 'sh Configure', not 'sh <Configure'"
1744 true) exec 1>/dev/null;;
1747 : run the defines and the undefines, if any, but leave the file out there...
1750 : create the posthint manipulation script and leave the file out there...
1755 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1756 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1757 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1758 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1759 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1762 : Some greps do not return status, grrr.
1763 echo "grimblepritz" >grimble
1764 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1766 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1772 : the following should work in any shell
1776 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1777 cat >contains <<'EOSS'
1778 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1783 : Find the path to the source tree
1786 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1790 *) src=`cd ../$src && pwd` ;;
1803 if test -f $rsrc/Configure && \
1804 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1806 : found it, so we are ok.
1809 for src in . .. ../.. ../../.. ../../../..; do
1810 if test -f ../$src/Configure && \
1811 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1822 Sorry, I can't seem to locate the source dir for $package. Please start
1823 Configure with an explicit path -- i.e. /some/path/Configure.
1831 echo "Sources for $package found in \"$src\"." >&4
1835 : script used to extract .SH files with variable substitutions
1836 cat >extract <<'EOS'
1838 echo "Doing variable substitutions on .SH files..."
1839 if test -f MANIFEST; then
1840 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1842 echo "(Looking for .SH files under the source directory.)"
1843 set x `(cd "$src"; find . -name "*.SH" -print)`
1847 0) set x `(cd "$src"; echo *.SH)`; shift;;
1849 if test ! -f "$src/$1"; then
1855 while test $name; do
1856 if test ! -d "$name"; then
1857 create="$name $create";
1858 name=`echo $name | sed -e "s|^[^/]*$||"`;
1859 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1864 for file in $create; do
1873 dir=`expr X$file : 'X\(.*\)/'`
1874 file=`expr X$file : 'X.*/\(.*\)'`
1875 (cd "$dir" && . ./$file)
1885 dir=`expr X$file : 'X\(.*\)/'`
1886 file=`expr X$file : 'X.*/\(.*\)'`
1887 (set x $dir; shift; eval $mkdir_p)
1888 sh <"$src/$dir/$file"
1897 if test -f "$src/config_h.SH"; then
1898 if test ! -f config.h; then
1899 : oops, they left it out of MANIFEST, probably, so do it anyway.
1900 . "$src/config_h.SH"
1905 : extract files and exit if asked to do so
1906 case "$extractsh" in
1908 case "$realsilent" in
1912 case "$config_sh" in
1913 '') config_sh='config.sh';;
1916 echo "Fetching answers from $config_sh..."
1919 test "$override" && . ./optdef.sh
1923 echo "Extraction done."
1928 : Eunice requires " " instead of "", can you believe it
1931 echo "Beginning of configuration questions for $package."
1933 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1935 : first determine how to suppress newline on echo command
1937 echo "Checking echo to see how to suppress newlines..."
1938 (echo "hi there\c" ; echo " ") >.echotmp
1939 if $contains c .echotmp >/dev/null 2>&1 ; then
1950 echo $n "The star should be here-->$c"
1954 : Now test for existence of everything in MANIFEST
1956 if test -f "$rsrc/MANIFEST"; then
1957 echo "First let's make sure your kit is complete. Checking..." >&4
1958 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1959 (split -l 50 2>/dev/null || split -50)
1962 for filelist in x??; do
1963 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1964 >/dev/null 2>>"$tmppwd/missing")
1966 if test -s missing; then
1970 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1972 You have the option of continuing the configuration process, despite the
1973 distinct possibility that your kit is damaged, by typing 'y'es. If you
1974 do, don't blame me if something goes wrong. I advise you to type 'n'o
1975 and contact the author (perlbug@perl.org).
1978 echo $n "Continue? [n] $c" >&4
1982 echo "Continuing..." >&4
1986 echo "ABORTING..." >&4
1991 echo "Looks good..."
1994 echo "There is no MANIFEST file. I hope your kit is complete !"
1998 : Find the appropriate value for a newline for tr
2000 if test -n "$DJGPP"; then
2003 if test X"$trnl" = X; then
2004 case "`echo foo|tr '\n' x 2>/dev/null`" in
2008 if test X"$trnl" = X; then
2009 case "`echo foo|tr '\012' x 2>/dev/null`" in
2010 foox) trnl='\012' ;;
2013 if test X"$trnl" = X; then
2014 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2015 fooxy) trnl='\n\r' ;;
2018 if test X"$trnl" = X; then
2021 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2027 : compute the number of columns on the terminal for proper question formatting
2032 : set up the echo used in my read
2033 myecho="case \"\$xxxm\" in
2034 '') echo $n \"\$rp $c\" >&4;;
2036 '') echo $n \"[\$xxxm] $c\";;
2038 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2040 echo $n \"[\$xxxm] $c\" >&4
2042 echo $n \"\$rp [\$xxxm] $c\" >&4
2048 : now set up to do reads with possible shell escape and default assignment
2054 case "\$fastread" in
2055 yes) case "\$dflt" in
2058 case "\$silent-\$rp" in
2063 *) case "\$silent" in
2064 true) case "\$rp" in
2069 while expr "X\$ans" : "X!" >/dev/null; do
2073 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2081 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2090 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2095 echo "(OK, I'll run with -d after this question.)" >&4
2098 echo "*** Sorry, \$1 not supported yet." >&4
2108 echo "*** Substitution done -- please confirm."
2110 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2115 echo "*** Error -- try again."
2122 case "\$ans\$xxxm\$nostick" in
2134 : create .config dir to save info across Configure sessions
2135 test -d ../.config || mkdir ../.config
2136 cat >../.config/README <<EOF
2137 This directory created by Configure to save information that should
2138 persist across sessions for $package.
2140 You may safely delete it if you wish.
2143 : See if we are using a devel version and want that
2144 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2147 usedevel="$define" ;;
2148 *) case "$xversion" in
2151 *** WHOA THERE!!! ***
2153 This is an UNSTABLE DEVELOPMENT release.
2154 The version of this $package distribution is $xversion, that is, odd,
2155 (as opposed to even) and that signifies a development release.
2156 If you want a maintenance release, you want an even-numbered version.
2158 Do ***NOT*** install this into production use.
2159 Data corruption and crashes are possible.
2161 It is most seriously suggested that you do not continue any further
2162 unless you want to help in developing and debugging Perl.
2164 If you *still* want to build perl, you can answer 'y' now,
2165 or pass -Dusedevel to Configure.
2168 rp='Do you really want to continue?'
2172 [yY]) echo >&4 "Okay, continuing."
2173 usedevel="$define" ;;
2174 *) echo >&4 "Okay, bye."
2185 case "$versiononly" in
2186 '') versiononly="$define" ;;
2188 case "$installusrbinperl" in
2189 '') installusrbinperl="$undef" ;;
2194 : general instructions
2197 user=`(logname) 2>/dev/null`
2199 '') user=`whoami 2>&1`;;
2201 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2204 rp='Would you like to see the instructions?'
2215 This installation shell script will examine your system and ask you questions
2216 to determine how the perl5 package should be installed. If you get
2217 stuck on a question, you may use a ! shell escape to start a subshell or
2218 execute a command. Many of the questions will have default answers in square
2219 brackets; typing carriage return will give you the default.
2221 On some of the questions which ask for file or directory names you are allowed
2222 to use the ~name construct to specify the login directory belonging to "name",
2223 even if you don't have a shell which knows about that. Questions where this is
2224 allowed will be marked "(~name ok)".
2228 dflt='Type carriage return to continue'
2232 The prompter used in this script allows you to use shell variables and
2233 backticks in your answers. You may use $1, $2, etc... to refer to the words
2234 in the default answer, as if the default line was a set of arguments given to a
2235 script shell. This means you may also use $* to repeat the whole default line,
2236 so you do not have to re-type everything to add something to the default.
2238 Everytime there is a substitution, you will have to confirm. If there is an
2239 error (e.g. an unmatched backtick), the default answer will remain unchanged
2240 and you will be prompted again.
2242 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2243 the questions and use the computed defaults (or the previous answers if there
2244 was already a config.sh file). Type 'Configure -h' for a list of options.
2245 You may also start interactively and then answer '& -d' at any prompt to turn
2246 on the non-interactive behaviour for the remainder of the execution.
2252 Much effort has been expended to ensure that this shell script will run on any
2253 Unix system. If despite that it blows up on yours, your best bet is to edit
2254 Configure and run it again. If you can't run Configure for some reason,
2255 you'll have to generate a config.sh file by hand. Whatever problems you
2256 have, let me (perlbug@perl.org) know how I blew it.
2258 This installation script affects things in two ways:
2260 1) it may do direct variable substitutions on some of the files included
2262 2) it builds a config.h file for inclusion in C programs. You may edit
2263 any of these files as the need arises after running this script.
2265 If you make a mistake on a question, there is no easy way to back up to it
2266 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2267 files. Configure will offer to let you do this before it runs the SH files.
2270 dflt='Type carriage return to continue'
2272 case "$firsttime" in
2273 true) echo $user >>../.config/instruct;;
2277 : find out where common programs are
2279 echo "Locating common programs..." >&4
2292 if test -d \$dir/\$thing; then
2298 for thisthing in \$dir/\$thing; do
2299 : just loop through to pick last item
2301 if test -f \$thisthing; then
2304 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2307 elif test -f \$dir/\$thing.exe; then
2308 if test -n "$DJGPP"; then
2309 echo \$dir/\$thing.exe
2310 elif test "$eunicefix" != ":"; then
2311 : on Eunice apparently
2363 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2364 pth="$pth /lib /usr/lib"
2365 for file in $loclist; do
2369 if test -f "$xxx"; then
2372 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2373 xxx=`./loc $file $file $pth`
2376 '') xxx=`./loc $file $file $pth`;;
2377 *) xxx=`./loc $xxx $xxx $pth`;;
2379 eval $file=$xxx$_exe
2383 echo $file is in $xxx.
2386 echo $file is in $xxx.
2389 echo "I don't know where '$file' is, and my life depends on it." >&4
2390 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2396 echo "Don't worry if any of the following aren't found..."
2398 for file in $trylist; do
2402 if test -f "$xxx"; then
2405 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2406 xxx=`./loc $file $file $pth`
2409 '') xxx=`./loc $file $file $pth`;;
2410 *) xxx=`./loc $xxx $xxx $pth`;;
2412 eval $file=$xxx$_exe
2416 echo $file is in $xxx.
2419 echo $file is in $xxx.
2422 echo "I don't see $file out there, $say."
2429 echo "Substituting grep for egrep."
2436 echo "Substituting cp for ln."
2445 echo "I can't find make or gmake, and my life depends on it." >&4
2446 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2454 *) # We can't have osname yet.
2455 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2456 # Assume that gmake, if found, is definitely GNU make
2457 # and prefer it over the system make.
2458 echo "Substituting gmake for make."
2466 echo "Hopefully test is built into your sh."
2469 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2470 echo "Using the test built into your sh."
2478 echo "Hopefully echo is built into your sh."
2483 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2484 $echo $n "hi there$c" >foo1
2485 echo $n "hi there$c" >foo2
2486 if cmp foo1 foo2 >/dev/null 2>&1; then
2487 echo "They are compatible. In fact, they may be identical."
2494 They are not compatible! You are probably running ksh on a non-USG system.
2495 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2496 have echo built in and we may have to run some Bourne shell scripts. That
2497 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2500 $echo $n "The star should be here-->$c"
2507 # This question was auctioned at YAPC::Europe-2007 in Vienna
2508 # I never promised you could answer it. I only auctioned the question.
2510 The following message is sponsored by
2512 Dresden.pm<--The stars should be here.
2514 Dear Perl user, system administrator or package
2515 maintainer, the Perl community sends greetings to
2516 you. Do you (emblematical) greet back [Y/n]? n
2520 : Check what type of C compiler we use
2524 cat <<'EOSC' >>trygcc
2529 int main(int argc, char *argv[]) {
2533 if $cc -o try $ccflags $ldflags try.c; then
2536 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2542 # Skip this test because it gives a false match on output like:
2543 # ./trygcc: line 23: cc: command not found
2544 # case "`$cc -v -c try.c 2>&1`" in
2545 # *gcc*) trygcc=no ;;
2547 if $test X"$trygcc" = Xyes; then
2548 if gcc -o try -c try.c; then
2550 echo "You seem to have a working gcc, though." >&4
2551 # Switching compilers may undo the work of hints files.
2552 # The most common problem is -D_REENTRANT for threads.
2553 # This heuristic catches that case, but gets false positives
2554 # if -Dusethreads was not actually specified. Better to
2555 # bail out here with a useful message than fail
2556 # mysteriously later. Should we perhaps just try to
2557 # re-invoke Configure -Dcc=gcc config_args ?
2558 if $test -f usethreads.cbu; then
2561 *** However, any setting of the C compiler flags (e.g. for thread support)
2562 *** will be lost. It may be necessary for you to restart Configure and
2563 *** add -Dcc=gcc to your Configure command line.
2566 rp="Would you like to go ahead and try gcc anyway?"
2569 rp="Would you like to use it?"
2572 if $test -f myread; then
2575 if $test -f UU/myread; then
2578 echo "Cannot find myread, sorry. Aborting." >&2
2583 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2596 cat <<'EOSC' >>checkcc
2601 int main(int argc, char *argv[]) {
2605 if $cc -o try $ccflags $ldflags try.c; then
2608 if $test X"$despair" = Xyes; then
2609 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2612 You need to find a working C compiler.
2613 Either (purchase and) install the C compiler supplied by your OS vendor,
2614 or for a free C compiler try http://gcc.gnu.org/
2615 I cannot continue any further, aborting.
2624 : determine whether symbolic links are supported
2627 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2628 echo "Symbolic links are supported." >&4
2631 echo "Symbolic links are NOT supported." >&4
2636 : determine whether symbolic links are supported
2640 echo "Checking how to test for symbolic links..." >&4
2642 if $test "X$issymlink" = X; then
2644 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2645 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2647 if test $? = 0; then
2650 echo "Your builtin 'test -h' may be broken." >&4
2653 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2656 if test -f "$p/$test"; then
2665 echo "Trying external '$test -h'." >&4
2666 issymlink="$test -h"
2667 if $test ! -h sym >/dev/null 2>&1; then
2668 echo "External '$test -h' is broken, too." >&4
2676 if $test "X$issymlink" = X; then
2677 if $test -L sym 2>/dev/null; then
2678 issymlink="$test -L"
2679 echo "The builtin '$test -L' worked." >&4
2682 if $test "X$issymlink" != X; then
2683 echo "You can test for symbolic links with '$issymlink'." >&4
2685 echo "I do not know how you can test for symbolic links." >&4
2689 *) echo "No symbolic links, so not testing for their testing..." >&4
2694 : Make symlinks util
2695 case "$mksymlinks" in
2698 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2701 *) case "$lns:$issymlink" in
2702 *"ln"*" -s:"*"test -"?)
2703 echo "Creating the symbolic links..." >&4
2704 echo "(First creating the subdirectories...)" >&4
2706 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2708 test -z "$directory" && break
2712 if test ! -d t/base; then
2713 echo "Failed to create the subdirectories. Aborting." >&4
2716 echo "(Then creating the symlinks...)" >&4
2717 awk '{print $1}' $src/MANIFEST | while true; do
2719 test -z "$filename" && break
2720 if test -f $filename; then
2721 if $issymlink $filename; then
2725 if test -f $filename; then
2726 echo "$filename already exists, not symlinking."
2728 ln -s $src/$filename $filename
2732 if test ! -f t/base/lex.t; then
2733 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2738 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2746 : Check for Cross-Compilation
2747 case "$usecrosscompile" in
2749 $echo "Cross-compiling..."
2752 *-*-gcc) # A cross-compiling gcc, probably.
2753 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2755 # leave out ld, choosing it is more complex
2757 ranlib=$targetarch-ranlib
2758 $echo 'extern int foo;' > try.c
2759 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2761 if $test $# -gt 0; then
2763 incpth="`$echo $incpth|$sed 's/^ //'`"
2764 echo "Guessing incpth '$incpth'." >&4
2766 j="`$echo $i|$sed 's,/include$,/lib,'`"
2767 if $test -d $j; then
2771 libpth="`$echo $libpth|$sed 's/^ //'`"
2772 echo "Guessing libpth '$libpth'." >&4
2777 case "$targetarch" in
2778 '') echo "Targetarch not defined." >&4; croak=y ;;
2779 *) echo "Using targetarch $targetarch." >&4 ;;
2782 '') echo "Incpth not defined." >&4; croak=y ;;
2783 *) echo "Using incpth '$incpth'." >&4 ;;
2786 '') echo "Libpth not defined." >&4; croak=y ;;
2787 *) echo "Using libpth '$libpth'." >&4 ;;
2790 '') for i in $incpth; do
2791 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2793 echo "Guessing usrinc $usrinc." >&4
2798 '') echo "Usrinc not defined." >&4; croak=y ;;
2801 *) echo "Using usrinc $usrinc." >&4 ;;
2803 case "$targethost" in
2804 '') echo "Targethost not defined." >&4; croak=y ;;
2805 *) echo "Using targethost $targethost." >&4
2810 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2813 /*) run=$src/Cross/run
2814 targetmkdir=$src/Cross/mkdir
2816 from=$src/Cross/from
2818 *) pwd=`$test -f ../Configure & cd ..; pwd`
2820 targetmkdir=$pwd/Cross/mkdir
2822 from=$pwd/Cross/from
2825 case "$targetrun" in
2826 '') targetrun=ssh ;;
2831 case "$targetfrom" in
2832 '') targetfrom=scp ;;
2836 from=$from-$targetfrom
2837 case "$targetdir" in
2839 echo "Guessing targetdir $targetdir." >&4
2842 case "$targetuser" in
2844 echo "Guessing targetuser $targetuser." >&4
2847 case "$targetfrom" in
2851 case "$targetrun" in
2863 '') cwd=$targetdir ;;
2867 if $test ! -f \$exe.xok; then
2871 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2874 *) echo "Unknown targetrun '$targetrun'" >&4
2878 case "$targetmkdir" in
2880 cat >$targetmkdir <<EOF
2882 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2884 $chmod a+rx $targetmkdir
2886 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2898 $targetmkdir \`dirname \$f\`
2899 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2902 $targetmkdir $targetdir/\`dirname \$f\`
2903 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2916 $mkdir -p $targetdir/\`dirname \$f\`
2917 $cp \$f $targetdir/\$f || exit 1
2920 $targetmkdir $targetdir/\`dirname \$f\`
2921 $cp \$f $targetdir/\$f || exit 1
2928 *) echo "Unknown targetto '$targetto'" >&4
2932 case "$targetfrom" in
2939 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2944 cp) cat >$from <<EOF
2949 cp $targetdir/\$f . || exit 1
2954 *) echo "Unknown targetfrom '$targetfrom'" >&4
2958 if $test ! -f $run; then
2959 echo "Target 'run' script '$run' not found." >&4
2963 if $test ! -f $to; then
2964 echo "Target 'to' script '$to' not found." >&4
2968 if $test ! -f $from; then
2969 echo "Target 'from' script '$from' not found." >&4
2973 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2977 Using '$run' for remote execution,
2978 and '$from' and '$to'
2979 for remote file transfer.
2985 usecrosscompile='undef'
2990 : see whether [:lower:] and [:upper:] are supported character classes
2992 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2994 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2998 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2999 # (0xd9 and 0xe2), therefore that is a nice testing point.
3000 if test "X$up" = X -o "X$low" = X; then
3001 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3007 if test "X$up" = X -o "X$low" = X; then
3008 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3014 if test "X$up" = X -o "X$low" = X; then
3015 case "`echo RS | od -x 2>/dev/null`" in
3017 echo "Hey, this might be EBCDIC." >&4
3018 if test "X$up" = X -o "X$low" = X; then
3019 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3020 rs) up='[A-IJ-RS-Z]'
3025 if test "X$up" = X -o "X$low" = X; then
3026 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3036 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3038 echo "Using $up and $low to convert case." >&4
3041 echo "I don't know how to translate letters from upper to lower case." >&4
3042 echo "Your tr is not acting any way I know of." >&4
3046 : set up the translation script tr, must be called with ./tr of course
3050 '[A-Z][a-z]') exec $tr '$up' '$low';;
3051 '[a-z][A-Z]') exec $tr '$low' '$up';;
3058 : Try to determine whether config.sh was made on this system
3059 case "$config_sh" in
3061 myuname=`$uname -a 2>/dev/null`
3062 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3063 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3064 # because the A-Z/a-z are not consecutive.
3065 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3066 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3067 newmyuname="$myuname"
3069 case "$knowitall" in
3071 if test -f ../config.sh; then
3072 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3073 eval "`grep myuname= ../config.sh`"
3075 if test "X$myuname" = "X$newmyuname"; then
3083 : Get old answers from old config file if Configure was run on the
3084 : same system, otherwise use the hints.
3087 if test -f config.sh; then
3089 rp="I see a config.sh file. Shall I use it to set the defaults?"
3092 n*|N*) echo "OK, I'll ignore it."
3093 mv config.sh config.sh.old
3094 myuname="$newmyuname"
3096 *) echo "Fetching default answers from your old config.sh file..." >&4
3104 : Older versions did not always set $sh. Catch re-use of such
3114 if test ! -f config.sh; then
3117 First time through, eh? I have some defaults handy for some systems
3118 that need some extra help getting the Configure answers right:
3121 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3123 : Half the following guesses are probably wrong... If you have better
3124 : tests or hints, please send them to perlbug@perl.org
3125 : The metaconfig authors would also appreciate a copy...
3126 $test -f /irix && osname=irix
3127 $test -f /xenix && osname=sco_xenix
3128 $test -f /dynix && osname=dynix
3129 $test -f /dnix && osname=dnix
3130 $test -f /lynx.os && osname=lynxos
3131 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3132 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3133 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3134 $test -f /bin/mips && /bin/mips && osname=mips
3135 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3136 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3137 $test -d /usr/apollo/bin && osname=apollo
3138 $test -f /etc/saf/_sactab && osname=svr4
3139 $test -d /usr/include/minix && osname=minix
3140 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3141 if $test -d /MachTen -o -d /MachTen_Folder; then
3143 if $test -x /sbin/version; then
3144 osvers=`/sbin/version | $awk '{print $2}' |
3145 $sed -e 's/[A-Za-z]$//'`
3146 elif $test -x /usr/etc/version; then
3147 osvers=`/usr/etc/version | $awk '{print $2}' |
3148 $sed -e 's/[A-Za-z]$//'`
3154 $test -f /sys/posix.dll &&
3155 $test -f /usr/bin/what &&
3156 set X `/usr/bin/what /sys/posix.dll` &&
3157 $test "$3" = UWIN &&
3161 if $test -f $uname; then
3169 umips) osname=umips ;;
3172 [23]100) osname=mips ;;
3173 next*) osname=next ;;
3175 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3176 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3179 elif $test -f /etc/kconfig; then
3181 if test "$lns" = "$ln -s"; then
3183 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3185 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3192 if test -n "$DJGPP"; then
3201 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3203 # oslevel can fail with:
3204 # oslevel: Unable to acquire lock.
3205 *not\ found) osvers="$4"."$3" ;;
3206 '<3240'|'<>3240') osvers=3.2.0 ;;
3207 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3208 '=3250'|'>3250') osvers=3.2.5 ;;
3212 bsd386) osname=bsd386
3215 cygwin*) osname=cygwin
3218 *dc.osx) osname=dcosx
3224 domainos) osname=apollo
3230 dragonfly) osname=dragonfly
3233 dynixptx*) osname=dynixptx
3234 osvers=`echo "$4"|sed 's/^v//'`
3236 freebsd) osname=freebsd
3238 genix) osname=genix ;;
3242 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3258 netbsd*) osname=netbsd
3261 news-os) osvers="$3"
3263 4*) osname=newsos4 ;;
3267 next*) osname=next ;;
3268 nonstop-ux) osname=nonstopux ;;
3269 openbsd) osname=openbsd
3275 POSIX-BC | posix-bc ) osname=posix-bc
3278 powerux | power_ux | powermax_os | powermaxos | \
3279 powerunix | power_unix) osname=powerux
3285 solaris) osname=solaris
3287 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3294 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3298 titanos) osname=titanos
3307 ultrix) osname=ultrix
3310 osf1|mls+) case "$5" in
3313 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3316 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3319 hp*) osname=hp_osf1 ;;
3320 mips) osname=mips_osf1 ;;
3323 # UnixWare 7.1.2 is known as Open UNIX 8
3324 openunix|unixware) osname=svr5
3332 $2) case "$osname" in
3336 : svr4.x or possibly later
3346 if test -f /stand/boot ; then
3347 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3348 if test -n "$INITPROG" -a -f "$INITPROG"; then
3349 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3350 if test -n "$isesix"; then
3358 *) if test -f /etc/systemid; then
3360 set `echo $3 | $sed 's/\./ /g'` $4
3361 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3363 elif $test -f $src/hints/sco_$1_$2.sh; then
3365 elif $test -f $src/hints/sco_$1.sh; then
3370 '') : Still unknown. Probably a generic Sys V.
3379 *) case "$osname" in
3380 '') : Still unknown. Probably a generic BSD.
3388 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3389 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3390 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3393 $rm -f UU/kernel.what
3394 elif test -d c:/. -o -n "$is_os2" ; then
3401 case "$targetarch" in
3404 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3409 : Now look for a hint file osname_osvers, unless one has been
3410 : specified already.
3413 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3414 : Also try without trailing minor version numbers.
3415 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3416 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3417 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3418 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3421 *) case "$osvers" in
3424 *) if $test -f $src/hints/$file.sh ; then
3426 elif $test -f $src/hints/$xfile.sh ; then
3428 elif $test -f $src/hints/$xxfile.sh ; then
3430 elif $test -f $src/hints/$xxxfile.sh ; then
3432 elif $test -f $src/hints/$xxxxfile.sh ; then
3434 elif $test -f "$src/hints/${osname}.sh" ; then
3443 if $test -f Policy.sh ; then
3446 none) dflt="Policy" ;;
3447 *) dflt="Policy $dflt" ;;
3452 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3456 if $test -f Policy.sh ; then
3459 There's also a Policy hint file available, which should make the
3460 site-specific (policy) questions easier to answer.
3467 You may give one or more space-separated answers, or "none" if appropriate.
3468 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3469 previous run of Configure, you may specify it as well as or instead of
3470 OS-specific hints. If hints are provided for your OS, you should use them:
3471 although Perl can probably be built without hints on many platforms, using
3472 hints often improve performance and may enable features that Configure can't
3473 set up on its own. If there are no hints that match your OS, specify "none";
3474 DO NOT give a wrong version or a wrong OS.
3478 rp="Which of these apply, if any?"
3481 for file in $tans; do
3482 if $test X$file = XPolicy -a -f Policy.sh; then
3484 $cat Policy.sh >> UU/config.sh
3485 elif $test -f $src/hints/$file.sh; then
3486 . $src/hints/$file.sh
3487 $cat $src/hints/$file.sh >> UU/config.sh
3488 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3491 : Give one chance to correct a possible typo.
3492 echo "$file.sh does not exist"
3494 rp="hint to use instead?"
3496 for file in $ans; do
3497 if $test -f "$src/hints/$file.sh"; then
3498 . $src/hints/$file.sh
3499 $cat $src/hints/$file.sh >> UU/config.sh
3500 elif $test X$ans = X -o X$ans = Xnone ; then
3503 echo "$file.sh does not exist -- ignored."
3510 : Remember our hint file for later.
3511 if $test -f "$src/hints/$file.sh" ; then
3521 echo "Fetching default answers from $config_sh..." >&4
3525 cp $config_sh config.sh 2>/dev/null
3535 test "$override" && . ./optdef.sh
3537 : Restore computed paths
3538 for file in $loclist $trylist; do
3539 eval $file="\$_$file"
3544 Configure uses the operating system name and version to set some defaults.
3545 The default value is probably right if the name rings a bell. Otherwise,
3546 since spelling matters for me, either accept the default or answer "none"
3553 ''|' '|none) dflt=none ;;
3554 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3557 *) dflt="$osname" ;;
3559 rp="Operating system name?"
3563 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3569 ''|' '|none) dflt=none ;;
3570 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3571 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3573 ''|' ') dflt=none ;;
3578 *) dflt="$osvers" ;;
3580 rp="Operating system version?"
3590 : who configured the system
3591 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3594 cf_by=`(logname) 2>/dev/null`
3597 cf_by=`(whoami) 2>/dev/null`
3599 "") cf_by=unknown ;;
3604 : decide how portable to be. Allow command line overrides.
3605 case "$d_portable" in
3607 *) d_portable="$define" ;;
3610 : set up shell script to do ~ expansion
3616 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3619 if $test -f /bin/csh; then
3620 /bin/csh -f -c "glob \$1"
3625 name=\`$expr x\$1 : '..\([^/]*\)'\`
3626 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3627 if $test ! -d "\$dir"; then
3629 echo "\$me: can't locate home directory for: \$name" >&2
3634 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3650 : now set up to get a file name
3654 cat <<'EOSC' >>getfile
3670 : getfile will accept an answer from the comma-separated list
3671 : enclosed in parentheses even if it does not meet other criteria.
3672 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3673 fn=`echo $fn | sed 's/(.*)//'`
3679 loc_file=`expr $fn : '.*:\(.*\)'`
3680 fn=`expr $fn : '\(.*\):.*'`
3688 */*) fullpath=true;;
3697 *e*) exp_file=true;;
3700 *p*) nopath_ok=true;;
3705 *d*) type='Directory';;
3706 *l*) type='Locate';;
3711 Locate) what='File';;
3716 case "$d_portable" in
3724 while test "$type"; do
3729 true) rp="$rp (~name ok)";;
3732 if test -f UU/getfile.ok && \
3733 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3752 value=`UU/filexp $ans`
3755 if test "$ans" != "$value"; then
3756 echo "(That expands to $value on this system.)"
3770 /*) value="$ansexp" ;;
3771 [a-zA-Z]:/*) value="$ansexp" ;;
3776 echo "I shall only accept a full path name, as in /bin/ls." >&4
3777 echo "Use a ! shell escape if you wish to check pathnames." >&4
3780 echo "Please give a full path name, starting with slash." >&4
3783 echo "Note that using ~name is ok provided it expands well." >&4
3796 for fp in $gfpth; do
3797 if test "X$fp" = X.; then
3802 if test -f "$pf"; then
3804 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3806 echo "($value is not a plain file, but that's ok.)"
3809 if test X"$type" = X; then
3816 for fp in $gfpth; do
3817 if test "X$fp" = X.; then
3822 direxp="$fp/$ansexp"
3824 if test -d "$direxp"; then
3832 if test -d "$ansexp"; then
3833 echo "(Looking for $loc_file in directory $value.)"
3834 value="$value/$loc_file"
3835 ansexp="$ansexp/$loc_file"
3837 if test -f "$ansexp"; then
3840 case "$nopath_ok" in
3841 true) case "$value" in
3843 *) echo "Assuming $value will be in people's path."
3859 if test "$fastread" = yes; then
3864 rp="$what $value doesn't exist. Use that name anyway?"
3883 test "X$gfpthkeep" != Xy && gfpth=""
3886 : determine root of directory hierarchy where package will be installed.
3889 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3892 dflt=`echo "$prefix" | sed 's/.$//'`
3900 By default, $package will be installed in $dflt/bin, manual pages
3901 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3902 installation directories. Typically this is something like /usr/local.
3903 If you wish to have binaries under /usr/bin but other parts of the
3904 installation under /usr/local, that's ok: you will be prompted
3905 separately for each of the installation directories, the prefix being
3906 only used to set the defaults.
3910 rp='Installation prefix to use?'
3918 *) oldprefix="$prefix";;
3925 : allow them to override the AFS root
3928 *) afsroot=$afsroot ;;
3934 $define|true) afs=true ;;
3935 $undef|false) afs=false ;;
3936 *) if $test -d $afsroot; then
3944 echo "AFS may be running... I'll be extra cautious then..." >&4
3946 echo "AFS does not seem to be running..." >&4
3949 : determine installation prefix for where package is to be installed.
3953 Since you are running AFS, I need to distinguish the directory in which
3954 files will reside from the directory in which they are installed (and from
3955 which they are presumably copied to the former directory by occult means).
3958 case "$installprefix" in
3959 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3960 *) dflt="$installprefix";;
3965 In some special cases, particularly when building $package for distribution,
3966 it is convenient to distinguish the directory in which files should be
3967 installed from the directory ($prefix) in which they will
3968 eventually reside. For most users, these two directories are the same.
3971 case "$installprefix" in
3973 *) dflt=$installprefix;;
3977 rp='What installation prefix should I use for installing files?'
3979 installprefix="$ans"
3980 installprefixexp="$ansexp"
3982 : Perform the prefixexp/installprefixexp correction if necessary
3983 cat <<EOS >installprefix
3986 cat <<'EOSC' >>installprefix
3987 : Change installation prefix, if necessary.
3988 if $test X"$prefix" != X"$installprefix"; then
3989 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3991 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3994 chmod +x installprefix
3995 $eunicefix installprefix
3997 : Set variables such as privlib and privlibexp from the output of ./getfile
3998 : performing the prefixexp/installprefixexp correction if necessary.
3999 cat <<EOS >setprefixvar
4002 cat <<'EOSC' >>setprefixvar
4003 eval "${prefixvar}=\"\$ans\""
4004 eval "${prefixvar}exp=\"\$ansexp\""
4007 chmod +x setprefixvar
4008 $eunicefix setprefixvar
4010 : set up the script used to warn in case of inconsistency
4019 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4021 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4022 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4027 echo "*** WHOA THERE!!! ***" >&4
4028 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4031 rp=" Keep the $hint value?"
4034 y) td=$was; tu=$was;;
4038 : function used to set '$1' to '$val'
4039 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4041 $define$undef) . ./whoa; eval "$var=\$td";;
4042 $undef$define) . ./whoa; eval "$var=\$tu";;
4043 *) eval "$var=$val";;
4046 : Check is we will use socks
4048 $define|true|[yY]*) dflt='y';;
4053 Perl can be built to use the SOCKS proxy protocol library. To do so,
4054 Configure must be run with -Dusesocks. If you use SOCKS you also need
4055 to use the PerlIO abstraction layer, this will be implicitly selected.
4057 If this doesn't make any sense to you, just accept the default '$dflt'.
4059 rp='Build Perl for SOCKS?'
4062 y|Y) val="$define" ;;
4069 $define|true|[yY]*) useperlio="$define";;
4072 : Check if we want perlio
4073 case "$useperlio" in
4074 $define|true|[yY]*|'') dflt='y';;
4079 Previous version of $package used the standard IO mechanisms as
4080 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4081 alternate IO mechanisms via the PerlIO abstraction layer, but the
4082 stdio mechanism is still available if needed. The abstraction layer
4083 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4084 Using PerlIO with sfio may cause problems with some extension modules.
4086 If this doesn't make any sense to you, just accept the default '$dflt'.
4088 rp='Use the PerlIO abstraction layer?'
4095 echo "Ok, doing things the stdio way."
4104 case "$useperlio" in
4105 $define|true|[yY]*) ;;
4108 You are using the SOCKS proxy protocol library which means that you
4109 should also use the PerlIO layer. You may be headed for trouble.
4117 : get the patchlevel
4119 echo "Getting the current patchlevel..." >&4
4120 if $test -r $rsrc/patchlevel.h;then
4121 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4122 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4123 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4124 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4125 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4126 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4127 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4136 $echo "(You do not have patchlevel.h. Eek.)"
4138 if $test -r $rsrc/.patch ; then
4139 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4140 perl_patchlevel=`cat $rsrc/.patch`
4143 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4144 version_patchlevel_string="version $patchlevel subversion $subversion"
4145 case "$perl_patchlevel" in
4147 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4150 $echo "(You have $package $version_patchlevel_string.)"
4154 : XXX Should be a Configure test for double-dots in filenames.
4155 version=`echo $revision $patchlevel $subversion | \
4156 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4157 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4158 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4161 version=`echo $revision $patchlevel $subversion | \
4162 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4163 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4164 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4167 : Special case the 5.005_xx maintenance series, which used 5.005
4168 : without any subversion label as a subdirectory in $sitelib
4169 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4170 api_versionstring='5.005'
4173 : Do we want threads support and if so, what type
4174 case "$usethreads" in
4175 $define|true|[yY]*) dflt='y';;
4176 *) # Catch case where user specified ithreads or 5005threads but
4177 # forgot -Dusethreads (A.D. 4/2002)
4178 case "$useithreads$use5005threads" in
4180 case "$useperlio" in
4181 "$define") dflt='y' ;;
4191 Perl can be built to take advantage of threads on some systems.
4192 To do so, Configure can be run with -Dusethreads.
4194 Note that Perl built with threading support runs slightly slower
4195 and uses more memory than plain Perl. The current implementation
4196 is believed to be stable, but it is fairly new, and so should be
4197 treated with caution.
4199 If this doesn't make any sense to you, just accept the default '$dflt'.
4201 rp='Build a threading Perl?'
4204 y|Y) val="$define" ;;
4210 if $test $patchlevel -lt 9; then
4211 case "$usethreads" in
4215 Since release 5.6, Perl has had two different threading implementations,
4216 the newer interpreter-based version (ithreads) with one interpreter per
4217 thread, and the older 5.005 version (5005threads).
4218 The 5005threads version is effectively unmaintained and will probably be
4219 removed in Perl 5.10, so there should be no need to build a Perl using it
4220 unless needed for backwards compatibility with some existing 5.005threads
4224 : Default to ithreads unless overridden on command line or with
4227 case "$use5005threads" in
4228 $define|true|[yY]*) dflt='n';;
4230 case "$useithreads" in
4231 $undef|false|[nN]*) dflt='n';;
4233 rp='Use the newer interpreter-based ithreads?'
4236 y|Y) val="$define" ;;
4241 : Now set use5005threads to the opposite value.
4242 case "$useithreads" in
4243 $define) val="$undef" ;;
4250 useithreads="$undef"
4251 use5005threads="$undef"
4255 case "$useithreads$use5005threads" in
4259 You cannot have both the ithreads and the 5.005 threads enabled
4260 at the same time. Disabling the 5.005 threads since they are
4261 much less stable than the ithreads.
4264 use5005threads="$undef"
4269 : perl-5.9.x and later
4271 if test X"$usethreads" = "X$define"; then
4272 case "$use5005threads" in
4276 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4283 use5005threads="$undef"
4284 useithreads="$usethreads"
4287 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4290 *** To build with ithreads you must also use the PerlIO layer.
4291 *** Cannot continue, aborting.
4297 case "$d_oldpthreads" in
4298 '') : Configure tests would be welcome here. For now, assume undef.
4300 *) val="$d_oldpthreads" ;;
4306 : Look for a hint-file generated 'call-back-unit'. If the
4307 : user has specified that a threading perl is to be built,
4308 : we may need to set or change some other defaults.
4309 if $test -f usethreads.cbu; then
4310 echo "Your platform has some specific hints regarding threaded builds, using them..."
4313 case "$usethreads" in
4314 "$define"|true|[yY]*)
4316 (Your platform does not have any specific hints for threaded builds.
4317 Assuming POSIX threads, then.)
4323 : Check if multiplicity is required
4326 Perl can be built so that multiple Perl interpreters can coexist
4327 within the same Perl executable.
4330 case "$useithreads" in
4333 This multiple interpreter support is required for interpreter-based threads.
4337 *) case "$usemultiplicity" in
4338 $define|true|[yY]*) dflt='y';;
4342 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4343 rp='Build Perl for multiplicity?'
4346 y|Y) val="$define" ;;
4354 : Check if morebits is requested
4355 case "$usemorebits" in
4356 "$define"|true|[yY]*)
4357 use64bitint="$define"
4358 uselongdouble="$define"
4359 usemorebits="$define"
4361 *) usemorebits="$undef"
4365 : Determine the C compiler to be used
4371 rp="Use which C compiler?"
4375 : See whether they have no cc but they do have gcc
4377 if $test -f cc.cbu; then
4382 : make some quick guesses about what we are up against
4384 $echo $n "Hmm... $c"
4394 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4395 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4397 echo "Looks kind of like an OSF/1 system, but we'll see..."
4399 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4400 xxx=`./loc addbib blurfl $pth`
4401 if $test -f $xxx; then
4402 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4406 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4407 echo "Looks kind of like an extended USG system, but we'll see..."
4409 echo "Looks kind of like a USG system, but we'll see..."
4413 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4414 echo "Looks kind of like a BSD system, but we'll see..."
4418 echo "Looks kind of like a Version 7 system, but we'll see..."
4421 case "$eunicefix" in
4424 There is, however, a strange, musty smell in the air that reminds me of
4425 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4429 : it so happens the Eunice I know will not run shell scripts in Unix format
4433 echo "Congratulations. You aren't running Eunice."
4437 : Detect OS2. The p_ variable is set above in the Head.U unit.
4438 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4439 : semicolon as a patch separator
4444 I have the feeling something is not exactly right, however...don't tell me...
4445 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4446 (Or you may be running DOS with DJGPP.)
4451 if test -f /xenix; then
4452 echo "Actually, this looks more like a XENIX system..."
4457 echo "It's not Xenix..."
4462 if test -f /venix; then
4463 echo "Actually, this looks more like a VENIX system..."
4470 echo "Nor is it Venix..."
4473 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4474 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4477 : Check if we are using GNU gcc and what its version is
4479 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4483 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4485 printf("%s\n", __VERSION__);
4487 printf("%s\n", "1");
4493 if $cc -o try $ccflags $ldflags try.c; then
4494 gccversion=`$run ./try`
4495 case "$gccversion" in
4496 '') echo "You are not using GNU cc." ;;
4497 *) echo "You are using GNU cc $gccversion."
4503 echo "*** WHOA THERE!!! ***" >&4
4504 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4505 case "$knowitall" in
4507 echo " You'd better start hunting for one and let me know about it." >&4
4513 case "$gccversion" in
4514 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4516 case "$gccversion" in
4517 '') gccosandvers='' ;;
4518 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4519 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4521 case "$gccosandvers" in
4522 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4523 $osname$osvers) ;; # looking good
4524 $osname*) cat <<EOM >&4
4526 *** WHOA THERE!!! ***
4528 Your gcc has not been compiled for the exact release of
4529 your operating system ($gccosandvers versus $osname$osvers).
4531 In general it is a good idea to keep gcc synchronized with
4532 the operating system because otherwise serious problems
4533 may ensue when trying to compile software, like Perl.
4535 I'm trying to be optimistic here, though, and will continue.
4536 If later during the configuration and build icky compilation
4537 problems appear (headerfile conflicts being the most common
4538 manifestation), I suggest reinstalling the gcc to match
4539 your operating system release.
4543 *) gccosandvers='' ;; # failed to parse, better be silent
4551 # gcc 3.* complain about adding -Idirectories that they already know about,
4552 # so we will take those off from locincpth.
4553 case "$gccversion" in
4555 echo "main(){}">try.c
4556 for incdir in $locincpth; do
4557 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4558 grep '^c[cp]p*[01]: warning: changing search order '`
4559 if test "X$warn" != X; then
4560 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4566 : What should the include directory be ?
4568 $echo $n "Hmm... $c"
4572 if $test -f /bin/mips && /bin/mips; then
4573 echo "Looks like a MIPS system..."
4574 $cat >usr.c <<'EOCP'
4575 #ifdef SYSTYPE_BSD43
4579 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4580 dflt='/bsd43/usr/include'
4584 mips_type='System V'
4586 $rm -f usr.c usr.out
4587 echo "and you're compiling with the $mips_type compiler and libraries."
4591 echo "Doesn't look like a MIPS system."
4601 case "$xxx_prompt" in
4604 rp='Where are the include files you want to use?'
4612 : see how we invoke the C preprocessor
4614 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4615 cat <<'EOT' >testcpp.c
4621 if test ! -f cppstdin; then
4622 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4623 # AIX cc -E doesn't show the absolute headerfile
4624 # locations but we'll cheat by using the -M flag.
4625 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
4627 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4630 echo "Keeping your $hint cppstdin wrapper."
4633 wrapper=`pwd`/cppstdin
4637 if $test "X$cppstdin" != "X" && \
4638 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4639 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4641 echo "You used to use $cppstdin $cppminus so we'll use that again."
4643 '') echo "But let's see if we can live without a wrapper..." ;;
4645 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4646 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4648 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4651 echo "(However, $cpprun $cpplast does not work, let's see...)"
4659 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4666 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4667 $cc -E <testcpp.c >testcpp.out 2>&1; \
4668 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4669 echo "Yup, it does."
4672 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4673 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4674 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4675 echo "Yup, it does."
4678 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4679 $cc -P <testcpp.c >testcpp.out 2>&1; \
4680 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4681 echo "Yipee, that works!"
4684 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4685 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4686 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4687 echo "At long last!"
4690 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4691 $cpp <testcpp.c >testcpp.out 2>&1; \
4692 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4696 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4697 $cpp - <testcpp.c >testcpp.out 2>&1; \
4698 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4699 echo "Hooray, it works! I was beginning to wonder."
4702 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4703 $wrapper <testcpp.c >testcpp.out 2>&1; \
4704 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4710 rp="No dice. I can't find a C preprocessor. Name one:"
4714 $x_cpp <testcpp.c >testcpp.out 2>&1
4715 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4716 echo "OK, that will do." >&4
4718 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4733 echo "Perhaps can we force $cc -E using a wrapper..."
4734 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4735 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4741 echo "Nope, we'll have to live without it..."
4755 "$wrapper"|'cppstdin') ;;
4756 *) $rm -f $wrapper;;
4758 $rm -f testcpp.c testcpp.out
4760 : Set private lib path
4763 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4768 '') dlist="$loclibpth $plibpth $glibpth";;
4769 *) dlist="$libpth";;
4772 : Now check and see which directories actually exist, avoiding duplicates
4776 if $test -d $xxx; then
4779 *) libpth="$libpth $xxx";;
4785 Some systems have incompatible or broken versions of libraries. Among
4786 the directories listed in the question below, please remove any you
4787 know not to be holding relevant libraries, and add any that are needed.
4788 Say "none" for none.
4799 rp="Directories to use for library searches?"
4806 : compute shared library extension
4809 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4819 On some systems, shared libraries may be available. Answer 'none' if
4820 you want to suppress searching of shared libraries for the remainder
4821 of this configuration.
4824 rp='What is the file extension used for shared libraries?'
4828 : Define several unixisms.
4829 : Hints files or command line option can be used to override them.
4830 : The convoluted testing is in case hints files set either the old
4833 '') case "$exe_ext" in
4835 *) _exe="$exe_ext" ;;
4840 '') case "$lib_ext" in
4847 '') case "$obj_ext" in
4854 '') case "$path_sep" in
4865 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4867 : Which makefile gets called first. This is used by make depend.
4868 case "$firstmakefile" in
4869 '') firstmakefile='makefile';;
4872 : Check for uselongdouble support
4874 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4877 case "$uselongdouble" in
4878 $define|true|[yY]*) dflt='y';;
4883 Perl can be built to take advantage of long doubles which
4884 (if available) may give more accuracy and range for floating point numbers.
4886 If this doesn't make any sense to you, just accept the default '$dflt'.
4888 rp='Try to use long doubles if available?'
4891 y|Y) val="$define" ;;
4897 case "$uselongdouble" in
4898 true|[yY]*) uselongdouble="$define" ;;
4901 : Look for a hint-file generated 'call-back-unit'. If the
4902 : user has specified that long doubles should be used,
4903 : we may need to set or change some other defaults.
4904 if $test -f uselongdouble.cbu; then
4905 echo "Your platform has some specific hints regarding long doubles, using them..."
4906 . ./uselongdouble.cbu
4908 case "$uselongdouble" in
4911 (Your platform does not have any specific hints for long doubles.)
4917 : Looking for optional libraries
4919 echo "Checking for optional libraries..." >&4
4924 case "$libswanted" in
4925 '') libswanted='c_s';;
4928 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4934 for thisdir in $libpth $xlibpth; do
4935 test -d $thisdir && libspath="$libspath $thisdir"
4937 for thislib in $libswanted; do
4938 for thisdir in $libspath; do
4940 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4941 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4942 $test -f "$xxx" && eval $libscheck
4943 $test -f "$xxx" && libstyle=shared
4945 if test ! -f "$xxx"; then
4946 xxx=$thisdir/lib$thislib.$so
4947 $test -f "$xxx" && eval $libscheck
4948 $test -f "$xxx" && libstyle=shared
4950 if test ! -f "$xxx"; then
4951 xxx=$thisdir/lib$thislib$_a
4952 $test -f "$xxx" && eval $libscheck
4953 $test -f "$xxx" && libstyle=static
4955 if test ! -f "$xxx"; then
4956 xxx=$thisdir/$thislib$_a
4957 $test -f "$xxx" && eval $libscheck
4958 $test -f "$xxx" && libstyle=static
4960 if test ! -f "$xxx"; then
4961 xxx=$thisdir/lib${thislib}_s$_a
4962 $test -f "$xxx" && eval $libscheck
4963 $test -f "$xxx" && libstyle=static
4964 $test -f "$xxx" && thislib=${thislib}_s
4966 if test ! -f "$xxx"; then
4967 xxx=$thisdir/Slib$thislib$_a
4968 $test -f "$xxx" && eval $libscheck
4969 $test -f "$xxx" && libstyle=static
4971 if $test -f "$xxx"; then
4973 shared) echo "Found -l$thislib (shared)." ;;
4974 static) echo "Found -l$thislib." ;;
4975 *) echo "Found -l$thislib ($libstyle)." ;;
4979 *) dflt="$dflt -l$thislib"
4980 libsfound="$libsfound $xxx"
4982 libsfiles="$libsfiles $yyy"
4983 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4984 case " $libsdirs " in
4986 *) libsdirs="$libsdirs $yyy" ;;
4993 if $test ! -f "$xxx"; then
4994 echo "No -l$thislib."
5005 ' '|'') dflt='none';;
5010 In order to compile $package on your machine, a number of libraries
5011 are usually needed. Include any other special libraries here as well.
5012 Say "none" for none. The default list is almost always right.
5016 rp="What libraries to use?"
5023 : determine optimization, if desired, or use for debug flag also
5025 ' '|$undef) dflt='none';;
5027 *) dflt="$optimize";;
5031 By default, $package compiles with the -O flag to use the optimizer.
5032 Alternately, you might want to use the symbolic debugger, which uses
5033 the -g flag (on traditional Unix systems). Either flag can be
5034 specified here. To use neither flag, specify the word "none".
5037 rp="What optimizer/debugger flag should be used?"
5041 'none') optimize=" ";;
5044 : Check what DEBUGGING is required from the command line
5045 : -DEBUGGING or -DDEBUGGING or
5046 : -DEBUGGING=both = -g + -DDEBUGGING
5047 : -DEBUGGING=-g or -Doptimize=-g = -g
5048 : -DEBUGGING=none or -UDEBUGGING =
5049 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5052 *) DEBUGGING=$EBUGGING ;;
5055 case "$DEBUGGING" in
5059 *) optimize="$optimize -g" ;;
5063 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5071 case "$DEBUGGING" in
5072 both|$define) dflt='-DDEBUGGING'
5075 : argument order is deliberate, as the flag will start with - which set could
5076 : think is an option
5077 checkccflag='check=$1; flag=$2; callback=$3;
5079 echo "Checking if your compiler accepts $flag" 2>&1;
5080 echo "int main(void) { return 0; }" > gcctest.c;
5081 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5082 echo "Yes, it does." 2>&1;
5083 if $test -s gcctest.out ; then
5084 echo "But your platform does not like it:";
5089 echo "Leaving current flags $ccflags alone." 2>&1
5091 *) dflt="$dflt $flag";
5097 echo "Nope, it does not, but that is ok." 2>&1;
5101 : We will not override a previous value, but we might want to
5102 : augment a hint file
5104 default|recommended)
5105 case "$gccversion" in
5106 1*) dflt="$dflt -fpcc-struct-return" ;;
5108 case "$optimize:$DEBUGGING" in
5109 *-g*:old) dflt="$dflt -DDEBUGGING";;
5111 case "$gccversion" in
5112 2*) if $test -d /etc/conf/kconfig.d &&
5113 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5115 # Interactive Systems (ISC) POSIX mode.
5120 case "$gccversion" in
5123 ?*) set strict-aliasing -fno-strict-aliasing
5127 # For gcc, adding -pipe speeds up compilations for some, but apparently
5128 # some assemblers can't read from stdin. (It also slows down compilations
5129 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5130 case "$gccversion" in
5136 # on x86_64 (at least) we require an extra library (libssp) in the
5137 # link command line. This library is not named, so I infer that it is
5138 # an implementation detail that may change. Hence the safest approach
5139 # is to add the flag to the flags passed to the compiler at link time,
5140 # as that way the compiler can do the right implementation dependant
5142 case "$gccversion" in
5143 ?*) set stack-protector -fstack-protector
5150 case "$mips_type" in
5151 *BSD*|'') inclwanted="$locincpth $usrinc";;
5152 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5154 for thisincl in $inclwanted; do
5155 if $test -d $thisincl; then
5156 if $test x$thisincl != x$usrinc; then
5158 *" -I$thisincl "*);;
5159 *) dflt="$dflt -I$thisincl ";;
5165 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5167 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5175 *) dflt="$dflt -D$2";;
5179 set signal.h LANGUAGE_C; eval $inctest
5183 ccflags="$ccflags -DSOCKS"
5188 default|recommended) dflt="$ccflags $dflt" ;;
5189 *) dflt="$ccflags";;
5198 Your C compiler may want other flags. For this question you should include
5199 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5200 but you should NOT include libraries or ld flags like -lwhatever. If you
5201 want $package to honor its debug switch, you should include -DDEBUGGING here.
5202 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5204 To use no flags, specify the word "none".
5210 rp="Any additional cc flags?"
5217 : the following weeds options from ccflags that are of no interest to cpp
5219 '') cppflags="$ccflags" ;;
5220 *) cppflags="$cppflags $ccflags" ;;
5222 case "$gccversion" in
5223 1*) cppflags="$cppflags -D__GNUC__"
5225 case "$mips_type" in
5227 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5233 echo "Let me guess what the preprocessor flags are..." >&4
5247 *) ftry="$previous $flag";;
5249 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5250 >cpp1.out 2>/dev/null && \
5251 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5252 >cpp2.out 2>/dev/null && \
5253 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5254 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5256 cppflags="$cppflags $ftry"
5266 *-*) echo "They appear to be: $cppflags";;
5268 $rm -f cpp.c cpp?.out
5272 : flags used in final linking phase
5274 '') if ./venix; then
5280 *-posix*) dflt="$dflt -posix" ;;
5283 *) dflt="$ldflags";;
5285 # See note above about -fstack-protector
5287 *-fstack-protector*)
5289 *-fstack-protector*) ;; # Don't add it again
5290 *) dflt="$dflt -fstack-protector" ;;
5295 : Try to guess additional flags to pick up local libraries.
5296 for thislibdir in $libpth; do
5297 case " $loclibpth " in
5300 *"-L$thislibdir "*) ;;
5301 *) dflt="$dflt -L$thislibdir" ;;
5313 Your C linker may need flags. For this question you should
5314 include -L/whatever and any other flags used by the C linker, but you
5315 should NOT include libraries like -lwhatever.
5317 Make sure you include the appropriate -L/path flags if your C linker
5318 does not normally search all of the directories you specified above,
5321 To use no flags, specify the word "none".
5325 rp="Any additional ld flags (NOT including libraries)?"
5331 rmlist="$rmlist pdp11"
5335 echo "Checking your choice of C compiler and flags for coherency..." >&4
5336 $cat > try.c <<'EOF'
5338 int main() { printf("Ok\n"); return(0); }
5340 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5342 $cat >try.msg <<'EOM'
5343 I've tried to compile and run the following simple program:
5346 $cat try.c >> try.msg
5348 $cat >> try.msg <<EOM
5355 and I got the following output:
5359 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5360 if $sh -c "$run ./try " >>try.msg 2>&1; then
5364 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5367 cat >> try.msg <<'EOQS'
5368 If $libs contains -lsfio, and sfio is mis-configured, then it
5369 sometimes (apparently) runs and exits with a 0 status, but with no
5370 output! It may have to do with sfio's use of _exit vs. exit.
5373 rp="You have a big problem. Shall I abort Configure"
5380 echo "The program compiled OK, but exited with status $?." >>try.msg
5381 rp="You have a problem. Shall I abort Configure"
5385 echo "I can't compile the test program." >>try.msg
5386 rp="You have a BIG problem. Shall I abort Configure"
5392 case "$knowitall" in
5394 echo "(The supplied flags or libraries might be incorrect.)"
5402 *) echo "Ok. Stopping Configure." >&4
5407 n) echo "OK, that should do.";;
5409 $rm_try gcctest gcctest.out
5411 : define a shorthand compile call
5415 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5416 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5420 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5421 : define a shorthand compile call for compilations that should be ok.
5425 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5427 : determine filename position in cpp output
5429 echo "Computing filename position in cpp output for #include directives..." >&4
5431 vos) testaccess=-e ;;
5434 echo '#include <stdio.h>' > foo.c
5437 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5438 $grep '^[ ]*#.*stdio\.h' | \
5439 while read cline; do
5442 while $test \$# -gt 0; do
5443 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5448 pos=\`expr \$pos + 1\`
5460 *) pos="${fieldn}th";;
5462 echo "Your cpp writes the filename in the $pos field of the line."
5465 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5466 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5469 : locate header file
5474 for usrincdir in $usrinc
5476 if test -f \$usrincdir/\$wanted; then
5477 echo "\$usrincdir/\$wanted"
5481 awkprg='{ print \$$fieldn }'
5482 echo "#include <\$wanted>" > foo\$\$.c
5483 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5484 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5485 while read cline; do
5486 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5488 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5489 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5494 # status = 0: grep returned 0 lines, case statement not executed
5495 # status = 1: headerfile found
5496 # status = 2: while loop executed, no headerfile found
5500 if test \$status -eq 1; then
5507 : define an alternate in-header-list? function
5508 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5509 cont=true; xxf="echo \"<\$1> found.\" >&4";
5510 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5511 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5513 case $# in 4) instead=instead;; *) instead="at last";; esac;
5514 while $test "$cont"; do
5516 var=$2; eval "was=\$$2";
5517 if $test "$xxx" && $test -r "$xxx";
5519 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5522 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5523 set $yyy; shift; shift; yyy=$@;
5524 case $# in 0) cont="";;
5525 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5526 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5527 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5528 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5532 do set $yyy; var=$2; eval "was=\$$2";
5533 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5534 set $yyy; shift; shift; yyy=$@;
5537 : see if stdlib is available
5538 set stdlib.h i_stdlib
5541 : check for lengths of integral types
5545 echo "Checking to see how big your integers are..." >&4
5554 printf("intsize=%d;\n", (int)sizeof(int));
5555 printf("longsize=%d;\n", (int)sizeof(long));
5556 printf("shortsize=%d;\n", (int)sizeof(short));
5561 if eval $compile_ok && $run ./try > /dev/null; then
5563 echo "Your integers are $intsize bytes long."
5564 echo "Your long integers are $longsize bytes long."
5565 echo "Your short integers are $shortsize bytes long."
5569 Help! I can't compile and run the intsize test program: please enlighten me!
5570 (This is probably a misconfiguration in your system or libraries, and
5571 you really ought to fix it. Still, I'll try anyway.)
5575 rp="What is the size of an integer (in bytes)?"
5579 rp="What is the size of a long integer (in bytes)?"
5583 rp="What is the size of a short integer (in bytes)?"
5591 : check for long long
5593 echo "Checking to see if you have long long..." >&4
5594 echo 'int main() { long long x = 7; return 0; }' > try.c
5596 if eval $compile; then
5598 echo "You have long long."
5601 echo "You do not have long long."
5607 : check for length of long long
5608 case "${d_longlong}${longlongsize}" in
5611 echo "Checking to see how big your long longs are..." >&4
5612 $cat >try.c <<'EOCP'
5616 printf("%d\n", (int)sizeof(long long));
5621 if eval $compile_ok; then
5622 longlongsize=`$run ./try`
5623 echo "Your long longs are $longlongsize bytes long."
5627 echo "(I can't seem to compile the test program. Guessing...)"
5628 rp="What is the size of a long long (in bytes)?"
5632 if $test "X$longsize" = "X$longlongsize"; then
5633 echo "(That isn't any different from an ordinary long.)"
5639 : see if inttypes.h is available
5640 : we want a real compile instead of Inhdr because some systems
5641 : have an inttypes.h which includes non-existent headers
5644 #include <inttypes.h>
5646 static int32_t foo32 = 0x12345678;
5650 if eval $compile; then
5651 echo "<inttypes.h> found." >&4
5654 echo "<inttypes.h> NOT found." >&4
5663 echo "Checking to see if you have int64_t..." >&4
5665 #include <sys/types.h>
5666 #$i_inttypes I_INTTYPES
5668 #include <inttypes.h>
5670 int main() { int64_t x = 7; }
5673 if eval $compile; then
5675 echo "You have int64_t."
5678 echo "You do not have int64_t."
5684 : Check if 64bit ints have a quad type
5686 echo "Checking which 64-bit integer type we could use..." >&4
5692 val='"unsigned int"'
5697 *) case "$longsize" in
5701 val='"unsigned long"'
5706 *) case "$d_longlong:$longlongsize" in
5711 val='"unsigned long long"'
5716 *) case "$d_int64_t" in
5735 '') echo "Alas, no 64-bit integer types in sight." >&4
5738 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5743 : Do we want 64bit support
5744 case "$uselonglong" in
5745 "$define"|true|[yY]*)
5748 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5750 use64bitint="$define"
5753 case "$use64bits" in
5754 "$define"|true|[yY]*)
5757 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5759 use64bitint="$define"
5762 case "$use64bitints" in
5763 "$define"|true|[yY]*)
5766 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5768 use64bitint="$define"
5771 case "$use64bitsint" in
5772 "$define"|true|[yY]*)
5775 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5777 use64bitint="$define"
5780 case "$uselonglongs" in
5781 "$define"|true|[yY]*)
5784 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5786 use64bitint="$define"
5789 case "$use64bitsall" in
5790 "$define"|true|[yY]*)
5793 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5795 use64bitall="$define"
5800 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5802 case "$use64bitall" in
5803 "$define"|true|[yY]*) use64bitint="$define" ;;
5809 You have natively 64-bit long integers.
5813 *) case "$use64bitint" in
5814 "$define"|true|[yY]*) dflt='y';;
5823 Perl can be built to take advantage of 64-bit integer types
5824 on some systems. To do so, Configure can be run with -Duse64bitint.
5825 Choosing this option will most probably introduce binary incompatibilities.
5827 If this doesn't make any sense to you, just accept the default '$dflt'.
5828 (The default has been chosen based on your configuration.)
5830 rp='Try to use 64-bit integers, if available?'
5833 [yY]*) val="$define" ;;
5841 case "$use64bitall" in
5842 "$define"|true|[yY]*) dflt='y' ;;
5843 *) case "$longsize" in
5851 You may also choose to try maximal 64-bitness. It means using as much
5852 64-bitness as possible on the platform. This in turn means even more
5853 binary incompatibilities. On the other hand, your platform may not
5854 have any more 64-bitness available than what you already have chosen.
5856 If this doesn't make any sense to you, just accept the default '$dflt'.
5857 (The default has been chosen based on your configuration.)
5859 rp='Try to use maximal 64-bit support, if available?'
5862 [yY]*) val="$define" ;;
5867 case "$use64bitall" in
5869 case "$use64bitint" in
5873 Since you have chosen a maximally 64-bit build, I'm also turning on
5874 the use of 64-bit integers.
5876 use64bitint="$define" ;;
5881 : Look for a hint-file generated 'call-back-unit'. If the
5882 : user has specified that a 64-bit perl is to be built,
5883 : we may need to set or change some other defaults.
5884 if $test -f use64bitint.cbu; then
5885 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5888 case "$use64bitint" in
5889 "$define"|true|[yY]*)
5891 4) case "$archname64" in
5892 '') archname64=64int ;;
5899 : Look for a hint-file generated 'call-back-unit'. If the
5900 : user has specified that a maximally 64-bit perl is to be built,
5901 : we may need to set or change some other defaults.
5902 if $test -f use64bitall.cbu; then
5903 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5906 case "$use64bitall" in
5907 "$define"|true|[yY]*)
5909 4) case "$archname64" in
5910 ''|64int) archname64=64all ;;
5917 case "$d_quad:$use64bitint" in
5921 *** You have chosen to use 64-bit integers,
5922 *** but none can be found.
5923 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5924 *** Cannot continue, aborting.
5931 : check for length of double
5933 case "$doublesize" in
5935 echo "Checking to see how big your double precision numbers are..." >&4
5944 printf("%d\n", (int)sizeof(double));
5949 if eval $compile_ok; then
5950 doublesize=`$run ./try`
5951 echo "Your double is $doublesize bytes long."
5954 echo "(I can't seem to compile the test program. Guessing...)"
5955 rp="What is the size of a double precision number (in bytes)?"
5963 : check for long doubles
5965 echo "Checking to see if you have long double..." >&4
5966 echo 'int main() { long double x = 7.0; }' > try.c
5968 if eval $compile; then
5970 echo "You have long double."
5973 echo "You do not have long double."
5979 : check for length of long double
5980 case "${d_longdbl}${longdblsize}" in
5983 echo "Checking to see how big your long doubles are..." >&4
5984 $cat >try.c <<'EOCP'
5988 printf("%d\n", sizeof(long double));
5993 if eval $compile; then
5994 longdblsize=`$run ./try`
5995 echo "Your long doubles are $longdblsize bytes long."
5999 echo "(I can't seem to compile the test program. Guessing...)" >&4
6000 rp="What is the size of a long double (in bytes)?"
6004 if $test "X$doublesize" = "X$longdblsize"; then
6005 echo "That isn't any different from an ordinary double."
6006 echo "I'll keep your setting anyway, but you may see some"
6007 echo "harmless compilation warnings."
6013 : determine the architecture name
6015 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6016 tarch=`arch`"-$osname"
6017 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6018 if uname -m > tmparch 2>&1 ; then
6019 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6020 -e 's/$/'"-$osname/" tmparch`
6028 case "$myarchname" in
6031 echo "(Your architecture name used to be $myarchname.)"
6035 case "$targetarch" in
6037 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6042 *) dflt="$archname";;
6044 rp='What is your architecture name'
6047 case "$usethreads" in
6049 echo "Threads selected." >&4
6051 *-thread*) echo "...and architecture name already has -thread." >&4
6053 *) archname="$archname-thread"
6054 echo "...setting architecture name to $archname." >&4
6059 case "$usemultiplicity" in
6061 echo "Multiplicity selected." >&4
6063 *-multi*) echo "...and architecture name already has -multi." >&4
6065 *) archname="$archname-multi"
6066 echo "...setting architecture name to $archname." >&4
6071 case "$use64bitint$use64bitall" in
6073 case "$archname64" in
6075 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6078 case "$use64bitint" in
6079 "$define") echo "64 bit integers selected." >&4 ;;
6081 case "$use64bitall" in
6082 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6085 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6087 *) archname="$archname-$archname64"
6088 echo "...setting architecture name to $archname." >&4
6094 case "$uselongdouble" in
6096 echo "Long doubles selected." >&4
6097 case "$longdblsize" in
6099 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6103 *-ld*) echo "...and architecture name already has -ld." >&4
6105 *) archname="$archname-ld"
6106 echo "...setting architecture name to $archname." >&4
6113 case "$useperlio" in
6115 echo "Perlio selected." >&4
6118 echo "Perlio not selected, using stdio." >&4
6120 *-stdio*) echo "...and architecture name already has -stdio." >&4
6122 *) archname="$archname-stdio"
6123 echo "...setting architecture name to $archname." >&4
6128 if $test -f archname.cbu; then
6129 echo "Your platform has some specific hints for architecture name, using them..."
6133 : set the prefixit variable, to compute a suitable default value
6134 prefixit='case "$3" in
6136 case "$oldprefix" in
6137 "") eval "$1=\"\$$2\"";;
6144 ""|" ") eval "$1=\"\$$2\"";;
6150 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6152 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6153 /*-$oldprefix/*|\~*-$oldprefix/*)
6154 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6155 *) eval "$1=\"\$$2\"";;
6159 : determine installation style
6160 : For now, try to deduce it from prefix unless it is already set.
6161 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6162 case "$installstyle" in
6163 '') case "$prefix" in
6164 *perl*) dflt='lib';;
6165 *) dflt='lib/perl5' ;;
6168 *) dflt="$installstyle" ;;
6170 : Probably not worth prompting for this since we prompt for all
6171 : the directories individually, and the prompt would be too long and
6175 : determine where public executables go
6180 rp='Pathname where the public executables will reside?'
6182 if $test "X$ansexp" != "X$binexp"; then
6186 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6187 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6188 : this via initialinstalllocation
6191 case "$userelocatableinc" in
6192 $define|true|[yY]*) dflt='y' ;;
6197 Would you like to build Perl so that the installation is relocatable, so that
6198 library paths in @INC are determined relative to the path of the perl binary?
6199 This is not advised for system Perl installs, or if you need to run setid
6200 scripts or scripts under taint mode.
6202 If this doesn't make any sense to you, just accept the default '$dflt'.
6204 rp='Use relocatable @INC?'
6207 y|Y) val="$define" ;;
6210 set userelocatableinc
6213 initialinstalllocation="$binexp"
6214 : Default prefix is now "up one level from where the binaries are"
6215 case "$userelocatableinc" in
6221 installprefixexp=".../.."
6225 : determine where private library files go
6226 : Usual default is /usr/local/lib/perl5/$version.
6227 : Also allow things like /opt/perl/lib/$version, since
6228 : /opt/perl/lib/perl5... would be redundant.
6229 : The default "style" setting is made in installstyle.U
6230 case "$installstyle" in
6231 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6232 *) set dflt privlib lib/$version ;;
6237 There are some auxiliary files for $package that need to be put into a
6238 private library directory that is accessible by everyone.
6243 rp='Pathname where the private library files will reside?'
6248 : set the prefixup variable, to restore leading tilda escape
6249 prefixup='case "$prefixexp" in
6251 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6254 : determine where public architecture dependent libraries go
6257 : privlib default is /usr/local/lib/$package/$version
6258 : archlib default is /usr/local/lib/$package/$version/$archname
6259 : privlib may have an optional trailing /share.
6260 tdflt=`echo $privlib | $sed 's,/share$,,'`
6261 tdflt=$tdflt/$archname
6270 $spackage contains architecture-dependent library files. If you are
6271 sharing libraries in a heterogeneous environment, you might store
6272 these files in a separate location. Otherwise, you can just include
6273 them with the rest of the public library files.
6278 rp='Where do you want to put the public architecture-dependent libraries?'
6282 if $test X"$archlib" = X"$privlib"; then
6288 : see if setuid scripts can be secure
6291 Some kernels have a bug that prevents setuid #! scripts from being
6292 secure. Some sites have disabled setuid #! scripts because of this.
6294 First let's decide if your kernel supports secure setuid #! scripts.
6295 (If setuid #! scripts would be secure but have been disabled anyway,
6296 don't say that they are secure if asked.)
6301 if $test -d /dev/fd; then
6302 echo "#!$ls" >reflect
6303 chmod +x,u+s reflect
6304 ./reflect >flect 2>&1
6305 if $contains "/dev/fd" flect >/dev/null; then
6306 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6310 If you are not sure if they are secure, I can check but I'll need a
6311 username and password different from the one you are using right now.
6312 If you don't have such a username or don't want me to test, simply
6316 rp='Other username to test security of setuid scripts with?'
6321 case "$d_suidsafe" in
6322 '') echo "I'll assume setuid scripts are *not* secure." >&4
6325 echo "Well, the $hint value is *not* secure." >&4
6327 *) echo "Well, the $hint value *is* secure." >&4
6332 $rm -f reflect flect
6333 echo "#!$ls" >reflect
6334 chmod +x,u+s reflect
6337 echo '"su" will (probably) prompt you for '"$ans's password."
6338 su $ans -c './reflect >flect'
6339 if $contains "/dev/fd" flect >/dev/null; then
6340 echo "Okay, it looks like setuid scripts are secure." >&4
6343 echo "I don't think setuid scripts are secure." >&4
6348 rp='Does your kernel have *secure* setuid scripts?'
6351 [yY]*) val="$define";;
6356 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6357 echo "(That's for file descriptors, not floppy disks.)"
6363 $rm -f reflect flect
6365 : now see if they want to do setuid emulation
6368 case "$d_suidsafe" in
6371 echo "No need to emulate SUID scripts since they are secure here." >&4
6375 Some systems have disabled setuid scripts, especially systems where
6376 setuid scripts cannot be secure. On systems where setuid scripts have
6377 been disabled, the setuid/setgid bits on scripts are currently
6378 useless. It is possible for $package to detect those bits and emulate
6379 setuid/setgid in a secure fashion. This emulation will only work if
6380 setuid scripts have been disabled in your kernel.
6384 "$define") dflt=y ;;
6387 rp="Do you want to do setuid/setgid emulation?"
6390 [yY]*) val="$define";;
6398 : Find perl5.005 or later.
6399 echo "Looking for a previously installed perl5.005 or later... "
6401 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6402 : Check if this perl is recent and can load a simple module
6403 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6406 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6416 '') echo "None found. That's ok.";;
6417 *) echo "Using $perl5." ;;
6420 : Set the siteprefix variables
6423 After $package is installed, you may wish to install various
6424 add-on modules and utilities. Typically, these add-ons will
6425 be installed under $prefix with the rest
6426 of this package. However, you may wish to install such add-ons
6427 elsewhere under a different prefix.
6429 If you do not wish to put everything under a single prefix, that's
6430 ok. You will be prompted for the individual locations; this siteprefix
6431 is only used to suggest the defaults.
6433 The default should be fine for most people.
6437 rp='Installation prefix to use for add-on modules and utilities?'
6438 : XXX Here might be another good place for an installstyle setting.
6439 case "$siteprefix" in
6441 *) dflt=$siteprefix ;;
6444 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6446 case "$siteprefix" in
6450 *) oldsiteprefix="$prefix";;
6455 siteprefixexp="$ansexp"
6457 : determine where site specific libraries go.
6458 : Usual default is /usr/local/lib/perl5/site_perl/$version
6459 : The default "style" setting is made in installstyle.U
6460 : XXX No longer works with Prefixit stuff.
6461 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6463 '') case "$installstyle" in
6464 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6465 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6473 The installation process will create a directory for
6474 site-specific extensions and modules. Most users find it convenient
6475 to place all site-specific files in this directory rather than in the
6476 main distribution directory.
6480 rp='Pathname for the site-specific library files?'
6484 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6486 : Determine list of previous versions to include in @INC
6487 $cat > getverlist <<EOPL
6490 \$api_versionstring = "$api_versionstring";
6491 \$version = "$version";
6492 \$stem = "$sitelib_stem";
6493 \$archname = "$archname";
6495 $cat >> getverlist <<'EOPL'
6496 # The list found is store twice for each entry: the original name, and
6497 # the binary broken down version as pack "sss", so sorting is easy and
6498 # unambiguous. This will work for all versions that have a maximum of
6499 # three digit groups, separate by '.'s or '_'s. Names are extended with
6500 # ".0.0" to ensure at least three elements for the pack.
6501 # -- H.Merijn Brand (m)'06 23-10-2006
6503 # Can't have leading @ because metaconfig interprets it as a command!
6504 ;@inc_version_list=();
6505 # XXX Redo to do opendir/readdir?
6508 ;@candidates = map {
6509 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6515 ($pversion, $aversion, $vsn5005) = map {
6516 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6517 foreach $d (@candidates) {
6518 if ($d->[1] lt $pversion) {
6519 if ($d->[1] ge $aversion) {
6520 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6522 elsif ($d->[1] ge $vsn5005) {
6523 unshift(@inc_version_list, grep { -d } $d->[0]);
6527 # Skip newer version. I.e. don't look in
6528 # 5.7.0 if we're installing 5.6.1.
6532 if (@inc_version_list) {
6533 print join(' ', @inc_version_list);
6536 # Blank space to preserve value for next Configure run.
6541 case "$inc_version_list" in
6542 '') if test -x "$perl5$exe_ext"; then
6543 dflt=`$perl5 getverlist`
6548 $undef) dflt='none' ;;
6549 *) eval dflt=\"$inc_version_list\" ;;
6552 ''|' ') dflt=none ;;
6559 In order to ease the process of upgrading, this version of perl
6560 can be configured to use modules built and installed with earlier
6561 versions of perl that were installed under $prefix. Specify here
6562 the list of earlier versions that this version of perl should check.
6563 If Configure detected no earlier versions of perl installed under
6564 $prefix, then the list will be empty. Answer 'none' to tell perl
6565 to not search earlier versions.
6567 The default should almost always be sensible, so if you're not sure,
6568 just accept the default.
6571 rp='List of earlier versions to include in @INC?'
6574 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6575 *) inc_version_list="$ans" ;;
6577 case "$inc_version_list" in
6579 inc_version_list_init='0'
6580 d_inc_version_list="$undef"
6582 *) inc_version_list_init=`echo $inc_version_list |
6583 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6584 d_inc_version_list="$define"
6589 : see if malloc/malloc.h has to be included
6590 set malloc/malloc.h i_mallocmalloc
6593 : see if this is a malloc.h system
6594 : we want a real compile instead of Inhdr because some systems have a
6595 : malloc.h that just gives a compile error saying to use stdlib.h instead
6600 #$i_mallocmalloc I_MALLOCMALLOC
6601 #ifdef I_MALLOCMALLOC
6602 # include <malloc/malloc.h>
6605 int main () { return 0; }
6608 if eval $compile; then
6609 echo "<malloc.h> found." >&4
6612 echo "<malloc.h> NOT found." >&4
6619 : check for void type
6621 echo "Checking to see how well your C compiler groks the void type..." >&4
6622 case "$voidflags" in
6634 extern void moo(); /* function returning void */
6635 void (*goo)(); /* ptr to func returning void */
6637 void *hue; /* generic ptr */
6650 int main() { sub(); }
6652 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6653 voidflags=$defvoidused
6654 echo "Good. It appears to support void to the level $package wants.">&4
6655 if $contains warning .out >/dev/null 2>&1; then
6656 echo "However, you might get some warnings that look like this:"
6660 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6661 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6662 echo "It supports 1..."
6663 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6664 echo "It also supports 2..."
6665 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6667 echo "And it supports 4 but not 8 definitely."
6669 echo "It doesn't support 4..."
6670 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6672 echo "But it supports 8."
6675 echo "Neither does it support 8."
6679 echo "It does not support 2..."
6680 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6682 echo "But it supports 4 and 8."
6684 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6686 echo "And it supports 4 but has not heard about 8."
6688 echo "However it supports 8 but not 4."
6693 echo "There is no support at all for void."
6698 case "$voidflags" in
6701 Support flag bits are:
6702 1: basic void declarations.
6703 2: arrays of pointers to functions returning void.
6704 4: operations between pointers to and addresses of void functions.
6705 8: generic void pointers.
6708 rp="Your void support flags add up to what?"
6715 : check for length of pointer
6719 echo "Checking to see how big your pointers are..." >&4
6720 if test "$voidflags" -gt 7; then
6721 echo '#define VOID_PTR char *' > try.c
6723 echo '#define VOID_PTR void *' > try.c
6733 printf("%d\n", (int)sizeof(VOID_PTR));
6738 if eval $compile_ok; then
6739 ptrsize=`$run ./try`
6740 echo "Your pointers are $ptrsize bytes long."
6743 echo "(I can't seem to compile the test program. Guessing...)" >&4
6744 rp="What is the size of a pointer (in bytes)?"
6751 case "$use64bitall" in
6752 "$define"|true|[yY]*)
6756 *** You have chosen a maximally 64-bit build,
6757 *** but your pointers are only 4 bytes wide.
6758 *** Please rerun Configure without -Duse64bitall.
6763 *** Since you have quads, you could possibly try with -Duse64bitint.
6768 *** Cannot continue, aborting.
6779 : determine whether to use malloc wrapping
6781 case "$usemallocwrap" in
6782 [yY]*|true|$define) dflt='y' ;;
6783 [nN]*|false|$undef) dflt='n' ;;
6784 *) case "$usedevel" in
6785 [yY]*|true|$define) dflt='y' ;;
6790 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6792 usemallocwrap="$ans"
6795 usemallocwrap="$define" ;;
6797 usemallocwrap="$undef" ;;
6800 : determine which malloc to compile in
6802 case "$usemymalloc" in
6803 [yY]*|true|$define) dflt='y' ;;
6804 [nN]*|false|$undef) dflt='n' ;;
6805 *) case "$ptrsize" in
6811 rp="Do you wish to attempt to use the malloc that comes with $package?"
6817 mallocsrc='malloc.c'
6818 mallocobj="malloc$_o"
6819 d_mymalloc="$define"
6822 : Remove malloc from list of libraries to use
6823 echo "Removing unneeded -lmalloc from library list" >&4
6824 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6827 echo "libs = $libs" >&4
6839 : compute the return types of malloc and free
6841 $cat >malloc.c <<END
6845 #include <sys/types.h>
6859 case "$malloctype" in
6861 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6868 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6872 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6879 echo "Your system uses $freetype free(), it would seem." >&4
6881 : determine where site specific architecture-dependent libraries go.
6882 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6883 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6884 : sitelib may have an optional trailing /share.
6886 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6887 dflt="$dflt/$archname"
6892 set sitearch sitearch none
6896 The installation process will also create a directory for
6897 architecture-dependent site-specific extensions and modules.
6901 rp='Pathname for the site-specific architecture-dependent library files?'
6905 if $test X"$sitearch" = X"$sitelib"; then
6908 d_sitearch="$define"
6911 : Set the vendorprefix variables
6914 The installation process will also create a directory for
6915 vendor-supplied add-ons. Vendors who supply perl with their system
6916 may find it convenient to place all vendor-supplied files in this
6917 directory rather than in the main distribution directory. This will
6918 ease upgrades between binary-compatible maintenance versions of perl.
6920 Of course you may also use these directories in whatever way you see
6921 fit. For example, you might use them to access modules shared over a
6922 company-wide network.
6924 The default answer should be fine for most people.
6925 This causes further questions about vendor add-ons to be skipped
6926 and no vendor-specific directories will be configured for perl.
6929 rp='Do you want to configure vendor-specific add-on directories?'
6930 case "$usevendorprefix" in
6931 define|true|[yY]*) dflt=y ;;
6932 *) : User may have set vendorprefix directly on Configure command line.
6933 case "$vendorprefix" in
6942 rp='Installation prefix to use for vendor-supplied add-ons?'
6943 case "$vendorprefix" in
6945 *) dflt=$vendorprefix ;;
6948 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6950 case "$vendorprefix" in
6954 *) oldvendorprefix="$prefix";;
6958 usevendorprefix="$define"
6960 vendorprefixexp="$ansexp"
6962 *) usevendorprefix="$undef"
6968 : Set the vendorlib variables
6969 case "$vendorprefix" in
6970 '') d_vendorlib="$undef"
6974 *) d_vendorlib="$define"
6975 : determine where vendor-supplied modules go.
6976 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6977 case "$vendorlib" in
6979 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6980 case "$installstyle" in
6981 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6982 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6985 *) dflt="$vendorlib"
6989 rp='Pathname for the vendor-supplied library files?'
6992 vendorlibexp="$ansexp"
6995 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6999 : Set the vendorarch variables
7000 case "$vendorprefix" in
7001 '') d_vendorarch="$undef"
7005 *) d_vendorarch="$define"
7006 : determine where vendor-supplied architecture-dependent libraries go.
7007 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7008 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7009 : vendorlib may have an optional trailing /share.
7010 case "$vendorarch" in
7011 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7012 dflt="$dflt/$archname"
7014 *) dflt="$vendorarch" ;;
7017 rp='Pathname for vendor-supplied architecture-dependent files?'
7020 vendorarchexp="$ansexp"
7023 prefixvar=vendorarch
7025 if $test X"$vendorarch" = X"$vendorlib"; then
7026 d_vendorarch="$undef"
7028 d_vendorarch="$define"
7031 : Final catch-all directories to search
7034 Lastly, you can have perl look in other directories for extensions and
7035 modules in addition to those already specified.
7036 These directories will be searched after
7040 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7041 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7043 case "$otherlibdirs" in
7044 ''|' ') dflt='none' ;;
7045 *) dflt="$otherlibdirs" ;;
7048 Enter a colon-separated set of extra paths to include in perl's @INC
7049 search path, or enter 'none' for no extra paths.
7053 rp='Colon-separated list of additional directories for perl to search?'
7056 ' '|''|none) otherlibdirs=' ' ;;
7057 *) otherlibdirs="$ans" ;;
7059 case "$otherlibdirs" in
7063 set d_perl_otherlibdirs
7066 : Cruising for prototypes
7068 echo "Checking out function prototypes..." >&4
7069 $cat >prototype.c <<EOCP
7074 int main(int argc, char *argv[]) {
7077 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7078 echo "Your C compiler appears to support function prototypes."
7081 echo "Your C compiler doesn't seem to understand function prototypes."
7088 : Check if ansi2knr is required
7089 case "$prototype" in
7091 *) ansi2knr='ansi2knr'
7096 This version of $package can only be compiled by a compiler that
7097 understands function prototypes. Unfortunately, your C compiler
7099 doesn't seem to understand them. Sorry about that.
7101 If GNU cc is available for your system, perhaps you could try that instead.
7103 Eventually, we hope to support building Perl with pre-ANSI compilers.
7104 If you would like to help in that effort, please contact <perlbug@perl.org>.
7106 Aborting Configure now.
7113 dflt_dtrace='/usr/sbin/dtrace'
7116 Perl can be built to support DTrace on platforms that support it.
7117 DTrace is a diagnosis and performance analysis tool from Sun.
7119 If this doesn't make any sense to you, just accept the default '$dflt'.
7123 case "$usedtrace" in
7129 dflt_dtrace=$usedtrace
7136 rp='Support DTrace if available?'
7139 y|Y) val="$define" ;;
7145 test "X$usedtrace" != "X$define" && break
7148 rp='Where is the dtrace executable?'
7157 if $dtrace -h -s ../perldtrace.d \
7158 -o perldtrace.tmp >/dev/null 2>&1 \
7159 && rm -f perldtrace.tmp
7162 echo "Good: your $dtrace knows about the -h flag."
7166 *** $me: Fatal Error: $dtrace doesn't support -h flag
7168 *** Your installed dtrace doesn't support the -h switch to compile a D
7169 *** program into a C header. Can't continue.
7181 *** $me: Fatal Error: $dtrace not found.
7188 echo "*** $dtrace was not found."
7194 : See if we want extra modules installed
7201 Perl can be built with extra modules or bundles of modules which
7202 will be fetched from the CPAN and installed alongside Perl.
7204 Notice that you will need access to the CPAN; either via the Internet,
7205 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7206 be asked later to configure the CPAN.pm module which will in turn do
7207 the installation of the rest of the extra modules or bundles.)
7209 Notice also that if the modules require any external software such as
7210 libraries and headers (the libz library and the zlib.h header for the
7211 Compress::Zlib module, for example) you MUST have any such software
7212 already installed, this configuration process will NOT install such
7215 If this doesn't make any sense to you, just accept the default '$dflt'.
7217 rp='Install any extra modules (y or n)?'
7223 Please list any extra modules or bundles to be installed from CPAN,
7224 with spaces between the names. The names can be in any format the
7225 'install' command of CPAN.pm will understand. (Answer 'none',
7226 without the quotes, to install no extra modules or bundles.)
7236 $rm -f ../extras.lst
7238 *) echo "(Saving the list of extras for later...)"
7239 echo "$extras" > ../extras.lst
7247 : determine where html pages for programs go
7248 set html1dir html1dir none
7252 If you wish to install html files for programs in $spackage, indicate
7253 the appropriate directory here. To skip installing html files,
7257 ''|none|$undef|' ') dflt=none ;;
7258 *) dflt=$html1dir ;;
7261 rp="Directory for the main $spackage html pages?"
7265 : Use ' ' for none so value is preserved next time through Configure
7266 $test X"$html1dir" = "X" && html1dir=' '
7268 : determine where html pages for libraries and modules go
7269 set html3dir html3dir none
7273 If you wish to install html files for modules associated with $spackage,
7274 indicate the appropriate directory here. To skip installing html files,
7277 : There is no obvious default. If they have specified html1dir, then
7278 : try to key off that, possibly changing .../html1 into .../html3.
7280 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7281 *) dflt=$html3dir ;;
7284 rp="Directory for the $spackage module html pages?"
7288 : Use ' ' for none so value is preserved next time through Configure
7289 $test X"$html3dir" = "X" && html3dir=' '
7291 : determine whether to install perl also as /usr/bin/perl
7294 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7296 Many scripts expect perl to be installed as /usr/bin/perl.
7298 If you want to, I can install the perl you are about to compile
7299 as /usr/bin/perl (in addition to $bin/perl).
7301 if test -f /usr/bin/perl; then
7304 However, please note that because you already have a /usr/bin/perl,
7305 overwriting that with a new Perl would very probably cause problems.
7306 Therefore I'm assuming you don't want to do that (unless you insist).
7309 case "$installusrbinperl" in
7310 "$define"|[yY]*) dflt='y';;
7316 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7319 case "$installusrbinperl" in
7320 "$undef"|[nN]*) dflt='n';;
7324 rp="Do you want to install perl as /usr/bin/perl?"
7327 [yY]*) val="$define";;
7333 set installusrbinperl
7336 : Check if we are using the GNU C library
7338 echo "Checking for GNU C Library..." >&4
7340 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7341 alone are insufficient to distinguish different versions, such as
7342 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7343 libc version 2.1.0. A. Dougherty, June 3, 2002.
7349 # ifdef __GLIBC_MINOR__
7350 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7351 # include <gnu/libc-version.h>
7352 printf("%s\n", gnu_get_libc_version());
7354 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7357 printf("%d\n", __GLIBC__);
7366 if eval $compile_ok && $run ./try > glibc.ver; then
7368 gnulibc_version=`$cat glibc.ver`
7369 echo "You are using the GNU C Library version $gnulibc_version"
7373 echo "You are not using the GNU C Library"
7379 : see if nm is to be used to determine whether a symbol is defined or not
7383 case "$d_gnulibc" in
7386 echo "nm probably won't work on the GNU C Library." >&4
7392 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7394 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7395 echo "'nm' won't be sufficient on this sytem." >&4
7401 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7402 if $test $dflt -gt 20; then
7412 true|$define) dflt=y;;
7419 I can use $nm to extract the symbols from your C libraries. This
7420 is a time consuming task which may generate huge output on the disk (up
7421 to 3 megabytes) but that should make the symbols extraction faster. The
7422 alternative is to skip the 'nm' extraction part and to compile a small
7423 test program instead to determine whether each symbol is present. If
7424 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7425 this may be the best solution.
7427 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7430 rp="Shall I use $nm to extract C symbols from the libraries?"
7433 [Nn]*) usenm=false;;
7442 : nm options which may be necessary
7444 '') if $test -f /mach_boot; then
7446 elif $test -d /usr/ccs/lib; then
7447 nm_opt='-p' # Solaris (and SunOS?)
7448 elif $test -f /dgux; then
7450 elif $test -f /lib64/rld; then
7451 nm_opt='-p' # 64-bit Irix
7457 : nm options which may be necessary for shared libraries but illegal
7458 : for archive libraries. Thank you, Linux.
7459 case "$nm_so_opt" in
7460 '') case "$myuname" in
7462 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7463 nm_so_opt='--dynamic'
7470 : Figure out where the libc is located
7473 : get list of predefined functions in a handy place
7478 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7484 *) for thislib in $libs; do
7487 : Handle C library specially below.
7490 thislib=`echo $thislib | $sed -e 's/^-l//'`
7491 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7493 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7495 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7497 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7499 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7501 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7503 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7508 libnames="$libnames $try"
7510 *) libnames="$libnames $thislib" ;;
7519 for xxx in $libpth; do
7520 $test -r $1 || set $xxx/libc.$so
7521 : The messy sed command sorts on library version numbers.
7523 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7524 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7526 s/[0-9][0-9]*/0000&/g
7527 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7530 $sort | $sed -e 's/^.* //'`
7533 $test -r $1 || set /usr/ccs/lib/libc.$so
7534 $test -r $1 || set /lib/libsys_s$_a
7540 if $test -r "$1"; then
7541 echo "Your (shared) C library seems to be in $1."
7543 elif $test -r /lib/libc && $test -r /lib/clib; then
7544 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7546 libc='/lib/clib /lib/libc'
7547 if $test -r /lib/syslib; then
7548 echo "(Your math library is in /lib/syslib.)"
7549 libc="$libc /lib/syslib"
7551 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7552 echo "Your C library seems to be in $libc, as you said before."
7553 elif $test -r $incpath/usr/lib/libc$_a; then
7554 libc=$incpath/usr/lib/libc$_a;
7555 echo "Your C library seems to be in $libc. That's fine."
7556 elif $test -r /lib/libc$_a; then
7558 echo "Your C library seems to be in $libc. You're normal."
7560 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7562 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7563 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7564 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7566 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7568 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7571 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7573 if $test -r "$tans"; then
7574 echo "Your C library seems to be in $tans, of all places."
7580 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7584 If the guess above is wrong (which it might be if you're using a strange
7585 compiler, or your machine supports multiple models), you can override it here.
7590 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7592 I can't seem to find your C library. I've looked in the following places:
7595 $sed 's/^/ /' libpath
7598 None of these seems to contain your C library. I need to get its name...
7603 rp='Where is your C library?'
7608 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7609 set X `cat libnames`
7612 case $# in 1) xxx=file; esac
7613 echo "Extracting names from the following $xxx for later perusal:" >&4
7615 $sed 's/^/ /' libnames >&4
7617 $echo $n "This may take a while...$c" >&4
7621 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7622 *) $nm $nm_opt $file 2>/dev/null;;
7627 $grep fprintf libc.tmp > libc.ptf
7628 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7629 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7631 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7633 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7635 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7637 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7639 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7641 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7643 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7645 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7647 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7649 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7651 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7653 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7655 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7656 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7660 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7664 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7666 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7668 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7670 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7672 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7674 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7676 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7678 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7680 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7682 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7684 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7686 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7689 $nm -p $* 2>/dev/null >libc.tmp
7690 $grep fprintf libc.tmp > libc.ptf
7691 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7692 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7698 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7700 if $ar t $libc > libc.tmp && \
7701 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7703 for thisname in $libnames $libc; do
7704 $ar t $thisname >>libc.tmp
7706 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7708 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7709 for thisname in $libnames $libc; do
7710 $ar tv $thisname >>libc.tmp
7711 emximp -o tmp.imp $thisname \
7713 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7714 < tmp.imp >>libc.tmp
7717 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7720 echo "$ar didn't seem to work right." >&4
7721 echo "Maybe this is a Cray...trying bld instead..." >&4
7723 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7726 for thisname in $libnames; do
7728 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7729 $ar t $thisname >>libc.tmp
7733 echo "That didn't work either. Giving up." >&4
7743 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7744 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7746 *) if $test -f /lib/syscalls.exp; then
7748 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7749 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7750 /lib/syscalls.exp >>libc.list
7756 $rm -f libnames libpath
7758 : see if dld is available
7762 : Check if we are using C++
7764 echo "Checking for C++..." >&4
7765 $cat >try.c <<'EOCP'
7777 if eval $compile_ok && $run ./try; then
7779 echo "You are using a C++ compiler."
7782 echo "You are not using a C++ compiler."
7788 : is a C symbol defined?
7791 -v) tf=libc.tmp; tdc="";;
7792 -a) tf=libc.tmp; tdc="[]";;
7793 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7795 case "$d_cplusplus" in
7796 $define) extern_C="extern \"C\"" ;;
7797 *) extern_C="extern" ;;
7800 case "$reuseval-$4" in
7802 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7807 if $test "$runnm" = true; then
7808 if $contains $tlook $tf >/dev/null 2>&1; then
7810 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7811 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7812 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7813 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7817 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7818 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7824 $define) tval=true;;
7831 : define an is-in-libc? function
7832 inlibc='echo " "; td=$define; tu=$undef;
7833 sym=$1; var=$2; eval "was=\$$2";
7835 case "$reuseval$was" in
7845 echo "$sym() found." >&4;
7846 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7848 echo "$sym() NOT found." >&4;
7849 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7853 $define) echo "$sym() found." >&4;;
7854 *) echo "$sym() NOT found." >&4;;
7858 : see if dlopen exists
7860 xxx_ccflags="$ccflags"
7862 : with g++ one needs -shared to get is-in-libc to work for dlopen
7863 case "$gccversion" in
7865 *) case "$d_cplusplus" in
7866 "$define") ccflags="$ccflags -shared" ;;
7873 ccflags="$xxx_ccflags"
7875 : see if this is a unistd.h system
7876 set unistd.h i_unistd
7879 : determine which dynamic loading, if any, to compile in
7881 dldir="ext/DynaLoader"
7894 $define) dflt='y' ;;
7897 $define) dflt='y' ;;
7899 : Does a dl_xxx.xs file exist for this operating system
7900 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7903 rp="Do you wish to use dynamic loading?"
7910 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7911 dflt="$dldir/dl_${osname}.xs"
7912 elif $test "$d_dlopen" = "$define" ; then
7913 dflt="$dldir/dl_dlopen.xs"
7914 elif $test "$i_dld" = "$define" ; then
7915 dflt="$dldir/dl_dld.xs"
7920 *) dflt="$dldir/$dlsrc"
7923 echo "The following dynamic loading files are available:"
7924 : Can not go over to $dldir because getfile has path hard-coded in.
7925 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7926 rp="Source file to use for dynamic loading"
7932 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7936 Some systems may require passing special flags to $cc -c to
7937 compile modules that will be used to create a shared library.
7938 To use no flags, say "none".
7941 case "$cccdlflags" in
7942 '') case "$gccversion" in
7943 '') case "$osname" in
7945 next) dflt='none' ;;
7946 irix*) dflt='-KPIC' ;;
7947 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7948 sunos) dflt='-pic' ;;
7952 *) case "$osname" in
7953 darwin) dflt='none' ;;
7954 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7959 *) dflt="$cccdlflags" ;;
7961 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7964 none) cccdlflags=' ' ;;
7965 *) cccdlflags="$ans" ;;
7970 Some systems use ld to create libraries that can be dynamically loaded,
7971 while other systems (such as those using ELF) use $cc.
7975 '') $cat >try.c <<EOM
7976 /* Test for whether ELF binaries are produced */
7988 int i = open("a.out",O_RDONLY);
7991 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7992 exit(0); /* succeed (yes, it's ELF) */
7997 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7999 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8003 echo "I'll use ld to build dynamic libraries."
8012 rp="What command should be used to create dynamic libraries?"
8018 Some systems may require passing special flags to $ld to create a
8019 library that can be dynamically loaded. If your ld flags include
8020 -L/other/path options to locate libraries outside your loader's normal
8021 search path, you may need to specify those -L options here as well. To
8022 use no flags, say "none".
8025 case "$lddlflags" in
8026 '') case "$osname" in
8027 beos) dflt='-nostart' ;;
8028 haiku) dflt='-shared' ;;
8030 case "$gccversion" in
8031 '') dflt="$dflt +vnocompatwarnings" ;;
8034 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8035 next) dflt='none' ;;
8036 solaris) dflt='-G' ;;
8037 sunos) dflt='-assert nodefinitions' ;;
8038 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8042 *) dflt="$lddlflags" ;;
8045 : Try to guess additional flags to pick up local libraries.
8046 : Be careful not to append to a plain 'none'
8050 for thisflag in $ldflags; do
8055 *) dflt="$dflt $thisflag" ;;
8062 ''|' ') dflt='none' ;;
8066 *-fstack-protector*)
8068 *-fstack-protector*) ;; # Don't add it again
8069 *) dflt="$dflt -fstack-protector" ;;
8075 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8078 none) lddlflags=' ' ;;
8079 *) lddlflags="$ans" ;;
8084 Some systems may require passing special flags to $cc to indicate that
8085 the resulting executable will use dynamic linking. To use no flags,
8089 case "$ccdlflags" in
8090 '') case "$osname" in
8091 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8092 next|sunos) dflt='none' ;;
8096 *) dflt="$ccdlflags" ;;
8098 rp="Any special flags to pass to $cc to use dynamic linking?"
8101 none) ccdlflags=' ' ;;
8102 *) ccdlflags="$ans" ;;
8113 : Do we want a shared libperl?
8117 # No dynamic loading being used, so don't bother even to prompt.
8120 *) case "$useshrplib" in
8121 '') case "$osname" in
8122 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8124 also='Building a shared libperl is required for dynamic loading to work on your system.'
8129 also='Building a shared libperl is needed for MAB support.'
8147 The perl executable is normally obtained by linking perlmain.c with
8148 libperl${_a}, any static extensions (usually just DynaLoader), and
8149 any other libraries needed on this system (such as -lm, etc.). Since
8150 your system supports dynamic loading, it is probably possible to build
8151 a shared libperl.$so. If you will have more than one executable linked
8152 to libperl.$so, this will significantly reduce the size of each
8153 executable, but it may have a noticeable effect on performance. The
8154 default is probably sensible for your system.
8158 rp="Build a shared libperl.$so (y/n)"
8162 useshrplib='true' ;;
8163 *) useshrplib='false' ;;
8168 case "$useshrplib" in
8172 # Figure out a good name for libperl.so. Since it gets stored in
8173 # a version-specific architecture-dependent library, the version
8174 # number isn't really that important, except for making cc/ld happy.
8176 # A name such as libperl.so.10.1
8177 majmin="libperl.$so.$patchlevel.$subversion"
8178 # A name such as libperl.so.100
8179 majonly=`echo $patchlevel $subversion |
8180 $awk '{printf "%d%02d", $1, $2}'`
8181 majonly=libperl.$so.$majonly
8182 # I'd prefer to keep the os-specific stuff here to a minimum, and
8183 # rely on figuring it out from the naming of libc.
8184 case "${osname}${osvers}" in
8187 # XXX How handle the --version stuff for MAB?
8189 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8192 cygwin*) # ld links now against the dll directly
8193 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8194 majonly=`echo $patchlevel $subversion |
8195 $awk '{printf "%03d%03d", $1, $2}'`
8196 majonly=cygperl5.$majonly.$so
8199 *) # Try to guess based on whether libc has major.minor.
8201 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8202 *libc.$so.[0-9]*) dflt=$majonly ;;
8203 *) dflt=libperl.$so ;;
8213 I need to select a good name for the shared libperl. If your system uses
8214 library names with major and minor numbers, then you might want something
8215 like $majmin. Alternatively, if your system uses a single version
8216 number for shared libraries, then you might want to use $majonly.
8217 Or, your system might be quite happy with a simple libperl.$so.
8219 Since the shared libperl will get installed into a version-specific
8220 architecture-dependent directory, the version number of the shared perl
8221 library probably isn't important, so the default should be o.k.
8224 rp='What name do you want to give to the shared libperl?'
8227 echo "Ok, I'll use $libperl"
8230 libperl="libperl${_a}"
8234 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8238 WARNING: Use of the shrpdir variable for the installation location of
8239 the shared $libperl is not supported. It was never documented and
8240 will not work in this version. Let me (perlbug@perl.org)
8241 know of any problems this may cause.
8247 But your current setting of $shrpdir is
8248 the default anyway, so it's harmless.
8253 Further, your current attempted setting of $shrpdir
8254 conflicts with the value of $archlibexp/CORE
8255 that installperl will use.
8262 # How will the perl executable find the installed shared $libperl?
8263 # Add $xxx to ccdlflags.
8264 # If we can't figure out a command-line option, use $shrpenv to
8265 # set env LD_RUN_PATH. The main perl makefile uses this.
8266 shrpdir=$archlibexp/CORE
8269 if "$useshrplib"; then
8272 # We'll set it in Makefile.SH...
8277 freebsd|netbsd|openbsd|interix|dragonfly)
8278 xxx="-Wl,-R$shrpdir"
8280 bsdos|linux|irix*|dec_osf|gnu*)
8281 xxx="-Wl,-rpath,$shrpdir"
8284 # next doesn't like the default...
8287 # beos doesn't like the default, either.
8290 # Haiku doesn't like the default, either.
8293 # hpux doesn't like the default, either.
8294 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8297 # cygwin needs only ldlibpth
8300 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8306 # Only add $xxx if it isn't already in ccdlflags.
8307 case " $ccdlflags " in
8309 *) ccdlflags="$ccdlflags $xxx"
8312 Adding $xxx to the flags
8313 passed to $ld so that the perl executable will find the
8314 installed shared $libperl.
8322 # Fix ccdlflags in AIX for building external extensions.
8323 # (For building Perl itself bare -bE:perl.exp is needed,
8324 # Makefile.SH takes care of this.)
8326 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8328 # Respect a hint or command-line value.
8330 '') shrpenv="$tmp_shrpenv" ;;
8332 case "$ldlibpthname" in
8333 '') ldlibpthname=LD_LIBRARY_PATH ;;
8334 none) ldlibpthname='' ;;
8337 : determine where manual pages are on this system
8341 syspath='/usr/share/man/man1 /usr/man/man1'
8342 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8343 syspath="$syspath /usr/man/u_man/man1"
8344 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8345 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8346 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8347 sysman=`./loc . /usr/man/man1 $syspath`
8350 if $test -d "$sysman"; then
8351 echo "System manual is in $sysman." >&4
8353 echo "Could not find manual pages in source form." >&4
8356 : determine where manual pages go
8357 set man1dir man1dir none
8361 $spackage has manual pages available in source form.
8365 echo "However, you don't have nroff, so they're probably useless to you."
8367 '') man1dir="none";;
8370 echo "If you don't want the manual sources installed, answer 'none'."
8375 lookpath="$prefixexp/share/man/man1"
8376 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8377 lookpath="$lookpath $prefixexp/man/p_man/man1"
8378 lookpath="$lookpath $prefixexp/man/u_man/man1"
8379 lookpath="$lookpath $prefixexp/man/man.1"
8381 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8382 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8392 rp="Where do the main $spackage manual pages (source) go?"
8394 if $test "X$man1direxp" != "X$ansexp"; then
8405 : What suffix to use on installed man pages
8412 rp="What suffix should be used for the main $spackage man pages?"
8414 '') case "$man1dir" in
8428 *) dflt="$man1ext";;
8435 : see if we can have long filenames
8437 first=123456789abcdef
8439 if (echo hi >$first) 2>/dev/null; then
8440 if $test -f 123456789abcde; then
8441 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8444 echo 'You can have filenames longer than 14 characters.'>&4
8449 You can't have filenames longer than 14 chars.
8450 You can't even think about them!
8456 $rm -rf 123456789abcde*
8458 : determine where library module manual pages go
8459 set man3dir man3dir none
8463 $spackage has manual pages for many of the library modules.
8469 However, you don't have nroff, so they're probably useless to you.
8472 '') man3dir="none";;
8476 case "$d_flexfnam" in
8479 However, your system can't handle the long file names like File::Basename.3.
8482 '') man3dir="none";;
8486 echo "If you don't want the manual sources installed, answer 'none'."
8487 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8489 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8490 if $test -d "$privlib/man/man3"; then
8493 WARNING: Previous versions of perl installed man3 pages into
8494 $privlib/man/man3. This version will suggest a
8495 new default of $dflt.
8499 rp='Do you wish to preserve the old behavior?(y/n)'
8502 y*) dflt="$privlib/man/man3" ;;
8507 *) dflt="$man3dir" ;;
8514 rp="Where do the $package library man pages (source) go?"
8524 : What suffix to use on installed man pages
8530 rp="What suffix should be used for the $package library man pages?"
8532 '') case "$man3dir" in
8546 *) dflt="$man3ext";;
8553 : see if we have to deal with yellow pages, now NIS.
8554 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8555 if $test -f /usr/etc/nibindd; then
8557 echo "I'm fairly confident you're on a NeXT."
8559 rp='Do you get the hosts file via NetInfo?'
8568 y*) hostcat='nidump hosts .';;
8569 *) case "$hostcat" in
8570 nidump*) hostcat='';;
8580 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8588 rp='Are you getting the hosts file via yellow pages?'
8591 y*) hostcat='ypcat hosts';;
8592 *) hostcat='cat /etc/hosts';;
8598 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8601 '') test -f /etc/group && groupcat='cat /etc/group';;
8604 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8607 : now get the host name
8609 echo "Figuring out host name..." >&4
8610 case "$myhostname" in
8612 echo 'Maybe "hostname" will work...'
8613 if tans=`sh -c hostname 2>&1` ; then
8621 if $test "$cont"; then
8623 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8624 if tans=`cat /etc/systemid 2>&1` ; then
8626 phostname='cat /etc/systemid'
8627 echo "Whadyaknow. Xenix always was a bit strange..."
8630 elif $test -r /etc/systemid; then
8631 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8634 if $test "$cont"; then
8635 echo 'No, maybe "uuname -l" will work...'
8636 if tans=`sh -c 'uuname -l' 2>&1` ; then
8638 phostname='uuname -l'
8640 echo 'Strange. Maybe "uname -n" will work...'
8641 if tans=`sh -c 'uname -n' 2>&1` ; then
8643 phostname='uname -n'
8645 echo 'Oh well, maybe I can mine it out of whoami.h...'
8646 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8647 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8648 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8650 case "$myhostname" in
8651 '') echo "Does this machine have an identity crisis or something?"
8654 echo "Well, you said $myhostname before..."
8655 phostname='echo $myhostname';;
8661 case "$myhostname" in
8662 '') myhostname=noname ;;
8664 : you do not want to know about this
8669 if $test "$myhostname" ; then
8671 rp='Your host name appears to be "'$myhostname'".'" Right?"
8679 : bad guess or no guess
8680 while $test "X$myhostname" = X ; do
8682 rp="Please type the (one word) name of your host:"
8687 : translate upper to lower if necessary
8688 case "$myhostname" in
8690 echo "(Normalizing case in your host name)"
8691 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8695 case "$myhostname" in
8697 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8698 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8699 echo "(Trimming domain name from host name--host name is now $myhostname)"
8701 *) case "$mydomain" in
8704 test "X$hostcat" = "Xypcat hosts" &&
8705 ypmatch "$myhostname" hosts 2>/dev/null |\
8706 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8709 test "X$hostcat" != "X" &&
8710 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8711 /[ ]$myhostname[ . ]/p" > hosts
8714 if $test -f hosts; then
8715 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8716 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8717 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8718 hosts | $sort | $uniq | \
8719 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8720 case `$echo X$dflt` in
8721 X*\ *) echo "(Several hosts in the database matched hostname)"
8724 X.) echo "(You do not have fully-qualified names in the hosts database)"
8728 echo "(I cannot locate a hosts database anywhere)"
8733 tans=`./loc resolv.conf X /etc /usr/etc`
8734 if $test -f "$tans"; then
8735 echo "(Attempting domain name extraction from $tans)"
8736 dflt=.`$sed -n -e 's/ / /g' \
8737 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8740 .) dflt=.`$sed -n -e 's/ / /g' \
8741 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8749 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8750 dflt=.`sh -c domainname 2>/dev/null`
8753 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8757 case "$dflt$osname" in
8758 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8759 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8763 .) echo "(Lost all hope -- silly guess then)"
8769 *) dflt="$mydomain";;
8773 rp="What is your domain name?"
8783 : translate upper to lower if necessary
8786 echo "(Normalizing case in your domain name)"
8787 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8791 : a little sanity check here
8792 case "$phostname" in
8795 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8796 $myhostname$mydomain|$myhostname) ;;
8798 case "$phostname" in
8800 echo "(That doesn't agree with your whoami.h file, by the way.)"
8803 echo "(That doesn't agree with your $phostname command, by the way.)"
8811 : determine the e-mail address of the user who is running us
8814 I need to get your e-mail address in Internet format if possible, i.e.
8815 something like user@host.domain. Please answer accurately since I have
8816 no easy means to double check it. The default value provided below
8817 is most probably close to reality but may not be valid from outside
8818 your organization...
8822 while test "$cont"; do
8824 '') dflt="$cf_by@$myhostname$mydomain";;
8825 *) dflt="$cf_email";;
8827 rp='What is your e-mail address?'
8833 rp='Address does not look like an Internet one. Use it anyway?'
8847 : Ask e-mail of administrator
8850 If you or somebody else will be maintaining perl at your site, please
8851 fill in the correct e-mail address here so that they may be contacted
8852 if necessary. Currently, the "perlbug" program included with perl
8853 will send mail to this address in addition to perlbug@perl.org. You may
8854 enter "none" for no administrator.
8857 case "$perladmin" in
8858 '') dflt="$cf_email";;
8859 *) dflt="$perladmin";;
8861 rp='Perl administrator e-mail address'
8865 : determine whether to only install version-specific parts.
8868 Do you want to install only the version-specific parts of the perl
8869 distribution? Usually you do *not* want to do this.
8871 case "$versiononly" in
8872 "$define"|[Yy]*|true) dflt='y' ;;
8875 rp="Do you want to install only the version-specific parts of perl?"
8878 [yY]*) val="$define";;
8884 case "$versiononly" in
8885 "$define") inc_version_list=''
8886 inc_version_list_init=0
8890 : figure out how to guarantee perl startup
8891 : XXX Note that this currently takes advantage of the bug that binexp ignores
8892 : the Configure -Dinstallprefix setting, which in turn means that under
8893 : relocatable @INC, initialinstalllocation is what binexp started as.
8894 case "$startperl" in
8896 case "$sharpbang" in
8900 I can use the #! construct to start perl on your system. This will
8901 make startup of perl scripts faster, but may cause problems if you
8902 want to share those scripts and perl is not in a standard place
8903 ($initialinstalllocation/perl) on all your platforms. The alternative
8904 is to force a shell by starting the script with a single ':' character.
8907 case "$versiononly" in
8908 "$define") dflt="$initialinstalllocation/perl$version";;
8909 *) dflt="$initialinstalllocation/perl";;
8911 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8914 none) startperl=": # use perl";;
8915 *) startperl="#!$ans"
8916 if $test 30 -lt `echo "$ans" | wc -c`; then
8919 WARNING: Some systems limit the #! command to 32 characters.
8920 If you experience difficulty running Perl scripts with #!, try
8921 installing Perl in a directory with a shorter pathname.
8927 *) startperl=": # use perl"
8932 echo "I'll use $startperl to start perl scripts."
8934 : figure best path for perl in scripts
8937 case "$versiononly" in
8938 "$define") perlpath="$initialinstalllocation/perl$version";;
8939 *) perlpath="$initialinstalllocation/perl";;
8941 case "$startperl" in
8946 I will use the "eval 'exec'" idiom to start Perl on your system.
8947 I can use the full path of your Perl binary for this purpose, but
8948 doing so may cause problems if you want to share those scripts and
8949 Perl is not always in a standard place ($initialinstalllocation/perl).
8952 dflt="$initialinstalllocation/perl"
8953 rp="What path shall I use in \"eval 'exec'\"?"
8960 case "$startperl" in
8962 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8965 : determine where public executable scripts go
8966 set scriptdir scriptdir
8968 case "$scriptdir" in
8971 : guess some guesses
8972 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8973 $test -d /usr/share/bin && dflt=/usr/share/bin
8974 $test -d /usr/local/script && dflt=/usr/local/script
8975 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8976 $test -d $prefixexp/script && dflt=$prefixexp/script
8980 *) dflt="$scriptdir"
8985 Some installations have a separate directory just for executable scripts so
8986 that they can mount it across multiple architectures but keep the scripts in
8987 one spot. You might, for example, have a subdirectory of /usr/share for this.
8988 Or you might just lump your scripts in with all your other executables.
8992 rp='Where do you keep publicly executable scripts?'
8994 if $test "X$ansexp" != "X$scriptdirexp"; then
9000 : A little fix up for an irregularly named variable.
9001 installscript="$installscriptdir"
9003 : determine where add-on public executables go
9005 '') dflt=$siteprefix/bin ;;
9009 rp='Pathname where the add-on public executables should be installed?'
9014 : determine where add-on html pages go
9015 : There is no standard location, so try to copy the previously-selected
9016 : directory structure for the core html pages.
9017 case "$sitehtml1dir" in
9018 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9019 *) dflt=$sitehtml1dir ;;
9022 ''|' ') dflt=none ;;
9025 rp='Pathname where the site-specific html pages should be installed?'
9027 prefixvar=sitehtml1dir
9030 : determine where add-on library html pages go
9031 : There is no standard location, so try to copy the previously-selected
9032 : directory structure for the core html pages.
9033 case "$sitehtml3dir" in
9034 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9035 *) dflt=$sitehtml3dir ;;
9038 ''|' ') dflt=none ;;
9041 rp='Pathname where the site-specific library html pages should be installed?'
9043 prefixvar=sitehtml3dir
9046 : determine where add-on manual pages go
9047 case "$siteman1dir" in
9048 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9049 *) dflt=$siteman1dir ;;
9052 ''|' ') dflt=none ;;
9055 rp='Pathname where the site-specific manual pages should be installed?'
9057 prefixvar=siteman1dir
9060 : determine where add-on library man pages go
9061 case "$siteman3dir" in
9062 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9063 *) dflt=$siteman3dir ;;
9066 ''|' ') dflt=none ;;
9069 rp='Pathname where the site-specific library manual pages should be installed?'
9071 prefixvar=siteman3dir
9074 : determine where add-on public executable scripts go
9075 case "$sitescript" in
9076 '') dflt=$siteprefix/script
9077 $test -d $dflt || dflt=$sitebin ;;
9078 *) dflt="$sitescript" ;;
9081 rp='Pathname where add-on public executable scripts should be installed?'
9083 prefixvar=sitescript
9086 : Check if faststdio is requested and available
9087 case "$usefaststdio" in
9088 $define|true|[yY]*|'')
9089 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9099 Perl can be built to use 'fast stdio', which means using the stdio
9100 library but also directly manipulating the stdio buffers to enable
9101 faster I/O. Using stdio is better for backward compatibility (especially
9102 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9103 interface has been preferred instead of stdio.
9105 If this doesn't make any sense to you, just accept the default '$dflt'.
9107 rp='Use the "fast stdio" if available?'
9110 y|Y) val="$define" ;;
9117 : define an is-a-typedef? function
9118 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9120 "") inclist="sys/types.h";;
9122 eval "varval=\$$var";
9126 for inc in $inclist; do
9127 echo "#include <$inc>" >>temp.c;
9129 echo "#ifdef $type" >> temp.c;
9130 echo "printf(\"We have $type\");" >> temp.c;
9131 echo "#endif" >> temp.c;
9132 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9133 if $contains $type temp.E >/dev/null 2>&1; then
9139 *) eval "$var=\$varval";;
9142 : define an is-a-typedef? function that prompts if the type is not available.
9143 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9145 "") inclist="sys/types.h";;
9147 eval "varval=\$$var";
9151 for inc in $inclist; do
9152 echo "#include <$inc>" >>temp.c;
9154 echo "#ifdef $type" >> temp.c;
9155 echo "printf(\"We have $type\");" >> temp.c;
9156 echo "#endif" >> temp.c;
9157 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9159 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9160 if $contains $type temp.E >/dev/null 2>&1; then
9161 echo "$type found." >&4;
9164 echo "$type NOT found." >&4;
9170 *) eval "$var=\$varval";;
9173 : see what type lseek is declared as in the kernel
9174 rp="What is the type used for lseek's offset on this system?"
9175 set off_t lseektype long stdio.h sys/types.h
9179 echo "Checking to see how big your file offsets are..." >&4
9181 #include <sys/types.h>
9185 printf("%d\n", (int)sizeof($lseektype));
9190 if eval $compile_ok; then
9191 lseeksize=`$run ./try`
9192 echo "Your file offsets are $lseeksize bytes long."
9196 echo "(I can't seem to compile the test program. Guessing...)"
9197 rp="What is the size of your file offsets (in bytes)?"
9203 : see what type file positions are declared as in the library
9204 rp="What is the type for file position used by fsetpos()?"
9205 set fpos_t fpostype long stdio.h sys/types.h
9208 : Check size for Fpos_t
9211 *_t) zzz="$fpostype" ;;
9214 echo "Checking the size of $zzz..." >&4
9216 #include <sys/types.h>
9223 printf("%d\n", (int)sizeof($fpostype));
9228 if eval $compile_ok; then
9232 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9235 echo "Your $zzz is $fpossize bytes long."
9241 echo "(I can't compile the test program. Guessing...)" >&4
9242 rp="What is the size of your file positions (in bytes)?"
9247 : Check for large file support
9248 # Backward compatibility (uselfs is deprecated).
9250 "$define"|true|[yY]*)
9253 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9255 uselargefiles="$define"
9259 case "$lseeksize:$fpossize" in
9262 You can have files larger than 2 gigabytes.
9265 *) case "$uselargefiles" in
9266 "$undef"|false|[nN]*) dflt='n' ;;
9271 Perl can be built to understand large files (files larger than 2 gigabytes)
9272 on some systems. To do so, Configure can be run with -Duselargefiles.
9274 If this doesn't make any sense to you, just accept the default '$dflt'.
9276 rp='Try to understand large files, if available?'
9279 y|Y) val="$define" ;;
9286 : Look for a hint-file generated 'call-back-unit'. If the
9287 : user has specified that a large files perl is to be built,
9288 : we may need to set or change some other defaults.
9289 if $test -f uselargefiles.cbu; then
9290 echo "Your platform has some specific hints regarding large file builds, using them..."
9291 . ./uselargefiles.cbu
9293 case "$uselargefiles" in
9295 if $test -f uselargefiles.cbu; then
9297 echo "Rechecking to see how big your file offsets are..." >&4
9299 #include <sys/types.h>
9303 printf("%d\n", (int)sizeof($lseektype));
9308 if eval $compile_ok; then
9309 lseeksize=`$run ./try`
9310 $echo "Your file offsets are now $lseeksize bytes long."
9314 echo "(I can't seem to compile the test program. Guessing...)"
9315 rp="What is the size of your file offsets (in bytes)?"
9320 *_t) zzz="$fpostype" ;;
9323 $echo $n "Rechecking the size of $zzz...$c" >&4
9325 #include <sys/types.h>
9332 printf("%d\n", (int)sizeof($fpostype));
9337 if eval $compile_ok; then
9342 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9345 echo " $fpossize bytes." >&4
9351 echo "(I can't compile the test program. Guessing...)" >&4
9352 rp="What is the size of your file positions (in bytes)?"
9361 : Set the vendorbin variables
9362 case "$vendorprefix" in
9363 '') d_vendorbin="$undef"
9367 *) d_vendorbin="$define"
9368 : determine where vendor-supplied executables go.
9369 case "$vendorbin" in
9370 '') dflt=$vendorprefix/bin ;;
9371 *) dflt="$vendorbin" ;;
9374 rp='Pathname for the vendor-supplied executables directory?'
9377 vendorbinexp="$ansexp"
9383 : Set the vendorhtml1dir variables
9384 case "$vendorprefix" in
9385 '') vendorhtml1dir=''
9386 vendorhtml1direxp=''
9388 *) : determine where vendor-supplied html pages go.
9389 : There is no standard location, so try to copy the previously-selected
9390 : directory structure for the core html pages.
9391 : XXX Better default suggestions would be welcome.
9392 case "$vendorhtml1dir" in
9393 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9394 *) dflt=$vendorhtml1dir ;;
9397 ''|' ') dflt=none ;;
9400 rp='Pathname for the vendor-supplied html pages?'
9402 vendorhtml1dir="$ans"
9403 vendorhtml1direxp="$ansexp"
9406 : Use ' ' for none so value is preserved next time through Configure
9407 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9408 prefixvar=vendorhtml1dir
9411 : Set the vendorhtml3dir variables
9412 case "$vendorprefix" in
9413 '') vendorhtml3dir=''
9414 vendorhtml3direxp=''
9416 *) : determine where vendor-supplied module html pages go.
9417 : There is no standard location, so try to copy the previously-selected
9418 : directory structure for the core html pages.
9419 : XXX Better default suggestions would be welcome.
9420 case "$vendorhtml3dir" in
9421 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9422 *) dflt=$vendorhtml3dir ;;
9425 ''|' ') dflt=none ;;
9428 rp='Pathname for the vendor-supplied html pages?'
9430 vendorhtml3dir="$ans"
9431 vendorhtml3direxp="$ansexp"
9434 : Use ' ' for none so value is preserved next time through Configure
9435 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9436 prefixvar=vendorhtml3dir
9439 : Set the vendorman1dir variables
9440 case "$vendorprefix" in
9441 '') vendorman1dir=''
9444 *) : determine where vendor-supplied manual pages go.
9445 case "$vendorman1dir" in
9446 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9447 *) dflt=$vendorman1dir ;;
9450 ''|' ') dflt=none ;;
9453 rp='Pathname for the vendor-supplied manual section 1 pages?'
9455 vendorman1dir="$ans"
9456 vendorman1direxp="$ansexp"
9459 : Use ' ' for none so value is preserved next time through Configure
9460 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9461 prefixvar=vendorman1dir
9464 : Set the vendorman3dir variables
9465 case "$vendorprefix" in
9466 '') vendorman3dir=''
9469 *) : determine where vendor-supplied module manual pages go.
9470 case "$vendorman3dir" in
9471 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9472 *) dflt=$vendorman3dir ;;
9475 ''|' ') dflt=none ;;
9478 rp='Pathname for the vendor-supplied manual section 3 pages?'
9480 vendorman3dir="$ans"
9481 vendorman3direxp="$ansexp"
9484 : Use ' ' for none so value is preserved next time through Configure
9485 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9486 prefixvar=vendorman3dir
9489 : Set the vendorscript variables
9490 case "$vendorprefix" in
9491 '') d_vendorscript="$undef"
9495 *) d_vendorscript="$define"
9496 : determine where vendor-supplied scripts go.
9497 case "$vendorscript" in
9498 '') dflt=$vendorprefix/script
9499 $test -d $dflt || dflt=$vendorbin ;;
9500 *) dflt="$vendorscript" ;;
9504 The installation process will create a directory for
9505 vendor-supplied scripts.
9509 rp='Pathname for the vendor-supplied scripts directory?'
9512 vendorscriptexp="$ansexp"
9515 prefixvar=vendorscript
9518 : script used to emit important warnings
9521 if test \$# -gt 0; then
9526 echo "*** WARNING:" >&4
9527 sed -e 's/^/*** /' <msg >&4
9529 cat msg >>config.msg
9530 echo " " >>config.msg
9536 : see which of string.h or strings.h is needed
9538 strings=`./findhdr string.h`
9539 if $test "$strings" && $test -r "$strings"; then
9540 echo "Using <string.h> instead of <strings.h>." >&4
9544 strings=`./findhdr strings.h`
9545 if $test "$strings" && $test -r "$strings"; then
9546 echo "Using <strings.h> instead of <string.h>." >&4
9548 ./warn "No string header found -- You'll surely have problems."
9554 "$undef") strings=`./findhdr strings.h`;;
9555 *) strings=`./findhdr string.h`;;
9558 : see if qgcvt exists
9562 : Check print/scan long double stuff
9565 if $test X"$d_longdbl" = X"$define"; then
9567 echo "Checking how to print long doubles..." >&4
9569 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9570 $cat >try.c <<'EOCP'
9571 #include <sys/types.h>
9575 printf("%.3f\n", d);
9579 if eval $compile; then
9583 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9584 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9585 echo "We will use %f."
9591 if $test X"$sPRIfldbl" = X; then
9592 $cat >try.c <<'EOCP'
9593 #include <sys/types.h>
9596 long double d = 123.456;
9597 printf("%.3Lf\n", d);
9601 if eval $compile; then
9605 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9606 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9607 echo "We will use %Lf."
9613 if $test X"$sPRIfldbl" = X; then
9614 $cat >try.c <<'EOCP'
9615 #include <sys/types.h>
9618 long double d = 123.456;
9619 printf("%.3llf\n", d);
9623 if eval $compile; then
9627 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9628 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9629 echo "We will use %llf."
9635 if $test X"$sPRIfldbl" = X; then
9636 $cat >try.c <<'EOCP'
9637 #include <sys/types.h>
9640 long double d = 123.456;
9641 printf("%.3lf\n", d);
9645 if eval $compile; then
9649 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9650 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9651 echo "We will use %lf."
9657 if $test X"$sPRIfldbl" = X; then
9658 echo "Cannot figure out how to print long doubles." >&4
9660 sSCNfldbl=$sPRIfldbl # expect consistency
9667 case "$sPRIfldbl" in
9668 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9669 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9670 d_SCNfldbl="$undef";
9672 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9673 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9674 d_SCNfldbl="$define";
9678 : Check how to convert floats to strings.
9680 if test "X$d_Gconvert" = X; then
9683 echo "Checking for an efficient way to convert floats to strings."
9685 case "$uselongdouble" in
9686 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9688 case "$d_longdbl" in
9689 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9691 case "$d_PRIgldbl" in
9692 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9696 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9697 char *myname = "gconvert";
9700 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9701 char *myname = "gcvt";
9704 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9705 char *myname = "qgcvt";
9706 #define DOUBLETYPE long double
9709 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9711 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9713 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9716 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9718 char *myname = "sprintf";
9722 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9723 #define DOUBLETYPE long double
9725 #define DOUBLETYPE double
9737 # include <string.h>
9739 # include <strings.h>
9742 int checkit(char *expect, char *got)
9744 if (strcmp(expect, got)) {
9745 printf("%s oddity: Expected %s, got %s\n",
9746 myname, expect, got);
9756 /* This must be 1st test on (which?) platform */
9757 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9758 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9759 checkit("0.1", buf);
9761 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9762 checkit("0.01", buf);
9764 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9765 checkit("0.001", buf);
9767 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9768 checkit("0.0001", buf);
9770 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9771 if (strlen(buf) > 5)
9772 checkit("9e-005", buf); /* for Microsoft ?? */
9774 checkit("9e-05", buf);
9776 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9779 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9780 checkit("1.1", buf);
9782 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9783 checkit("1.01", buf);
9785 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9786 checkit("1.001", buf);
9788 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9789 checkit("1.0001", buf);
9791 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9792 checkit("1.00001", buf);
9794 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9795 checkit("1.000001", buf);
9797 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9800 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9803 /* Some Linux gcvt's give 1.e+5 here. */
9804 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9805 checkit("100000", buf);
9807 /* Some Linux gcvt's give -1.e+5 here. */
9808 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9809 checkit("-100000", buf);
9811 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9812 checkit("123.456", buf);
9814 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9815 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9816 /* 34 should be enough to scare even long double
9817 * places into using the e notation. */
9818 if (strlen(buf) > 5)
9819 checkit("1e+034", buf); /* for Microsoft */
9821 checkit("1e+34", buf);
9823 /* For Perl, if you add additional tests here, also add them to
9824 * t/base/num.t for benefit of platforms not using Configure or
9825 * overriding d_Gconvert */
9830 : first add preferred functions to our list
9832 for xxx_convert in $gconvert_preference; do
9833 case $xxx_convert in
9834 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9835 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9838 : then add any others
9839 for xxx_convert in gconvert gcvt sprintf; do
9842 *) xxx_list="$xxx_list $xxx_convert" ;;
9846 case "$d_longdbl$uselongdouble" in
9848 : again, add prefered functions to our list first
9850 for xxx_convert in $gconvert_ld_preference; do
9851 case $xxx_convert in
9852 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9853 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9856 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9857 for xxx_convert in qgcvt sprintf $xxx_list; do
9858 case "$xxx_ld_list" in
9859 $xxx_convert*|*" $xxx_convert"*) ;;
9860 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9863 : if sprintf cannot do long doubles, move it to the end
9864 if test "$d_PRIgldbl" != "$define"; then
9865 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9867 : if no qgcvt, remove it
9868 if test "$d_qgcvt" != "$define"; then
9869 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9872 xxx_list="$xxx_ld_list"
9876 for xxx_convert in $xxx_list; do
9877 echo "Trying $xxx_convert..."
9878 $rm -f try try$_o core
9879 set try -DTRY_$xxx_convert
9880 if eval $compile; then
9881 echo "$xxx_convert() found." >&4
9883 echo "I'll use $xxx_convert to convert floats into a string." >&4
9886 echo "...But $xxx_convert didn't work as I expected."
9890 echo "$xxx_convert NOT found." >&4
9894 if test X$xxx_convert = X; then
9895 echo "*** WHOA THERE!!! ***" >&4
9896 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9900 case "$xxx_convert" in
9901 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9902 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9903 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9904 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9905 "$define$define$define")
9906 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9907 "$define$define$undef")
9908 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9909 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9917 : see if _fwalk exists
9921 : Initialize h_fcntl
9924 : Initialize h_sysfile
9927 : access call always available on UNIX
9931 : locate the flags for 'access()'
9935 $cat >access.c <<EOCP
9936 #include <sys/types.h>
9941 #include <sys/file.h>
9954 : check sys/file.h first, no particular reason here
9955 if $test `./findhdr sys/file.h` && \
9956 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9958 echo "<sys/file.h> defines the *_OK access constants." >&4
9959 elif $test `./findhdr fcntl.h` && \
9960 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9962 echo "<fcntl.h> defines the *_OK access constants." >&4
9963 elif $test `./findhdr unistd.h` && \
9964 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9965 echo "<unistd.h> defines the *_OK access constants." >&4
9967 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9973 : see if accessx exists
9974 set accessx d_accessx
9977 : see if aintl exists
9981 : see if alarm exists
9985 : see if 64bit time functions exists
9987 set ctime64 d_ctime64
9990 set localtime64 d_localtime64
9993 set gmtime64 d_gmtime64
9996 set mktime64 d_mktime64
9999 set difftime64 d_difftime64
10002 set asctime64 d_asctime64
10005 : see if POSIX threads are available
10006 set pthread.h i_pthread
10009 : define a fucntion to check prototypes
10010 $cat > protochk <<EOSH
10013 optimize="$optimize"
10015 prototype="$prototype"
10018 usethreads=$usethreads
10019 i_pthread=$i_pthread
10020 pthread_h_first=$pthread_h_first
10023 $cat >> protochk <<'EOSH'
10028 while test $# -ge 2; do
10030 $define) echo "#include <$2>" >> try.c ;;
10031 literal) echo "$2" >> try.c ;;
10033 # Extra magic for the benefit of systems that need pthread.h
10034 # to be included early to correctly detect threadsafe functions.
10035 # Such functions must guarantee themselves, though, that the usethreads
10036 # and i_pthread have been defined, before calling protochk.
10037 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10038 echo "#include <pthread.h>" >> try.c
10043 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10044 cat >> try.c <<'EOCP'
10045 #ifdef CAN_PROTOTYPE
10046 #define _(args) args
10051 echo "$foo" >> try.c
10052 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10053 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10059 $eunicefix protochk
10061 : Define hasproto macro for Configure internal use
10062 hasproto='varname=$1; func=$2; shift; shift;
10063 while $test $# -ge 2; do
10065 $define) echo "#include <$2>";;
10069 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10070 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10071 echo "$func() prototype found.";
10074 echo "$func() prototype NOT found.";
10081 : see if sys/types.h has to be included
10082 set sys/types.h i_systypes
10085 : see if sys/select.h has to be included
10086 set sys/select.h i_sysselct
10089 : Define hasfield macro for Configure internal use
10090 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10091 while $test $# -ge 2; do
10093 $define) echo "#include <$2>";;
10097 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10099 if eval $compile; then
10108 : see if we should include time.h, sys/time.h, or both
10110 if test "X$timeincl" = X; then
10111 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10112 $echo $n "I'm now running the test program...$c"
10114 #include <sys/types.h>
10119 #ifdef SYSTIMEKERNEL
10122 #include <sys/time.h>
10125 #include <sys/select.h>
10127 #$i_stdlib I_STDLIB
10129 #include <stdlib.h>
10135 struct timeval bar;
10138 struct timezone tzp;
10140 if (foo.tm_sec == foo.tm_sec)
10143 if (bar.tv_sec == bar.tv_sec)
10150 for s_timezone in '-DS_TIMEZONE' ''; do
10152 for s_timeval in '-DS_TIMEVAL' ''; do
10153 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10154 for i_time in '' '-DI_TIME'; do
10155 for i_systime in '-DI_SYSTIME' ''; do
10158 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10159 if eval $compile; then
10160 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10164 $echo $n "Succeeded with $flags$c"
10176 *SYSTIMEKERNEL*) i_systimek="$define"
10177 timeincl=`./findhdr sys/time.h`
10178 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10179 *) i_systimek="$undef";;
10182 *I_TIME*) i_time="$define"
10183 timeincl=`./findhdr time.h`" $timeincl"
10184 echo "We'll include <time.h>." >&4;;
10185 *) i_time="$undef";;
10188 *I_SYSTIME*) i_systime="$define"
10189 timeincl=`./findhdr sys/time.h`" $timeincl"
10190 echo "We'll include <sys/time.h>." >&4;;
10191 *) i_systime="$undef";;
10195 : see if struct tm knows about tm_zone
10196 case "$i_systime$i_time" in
10199 echo "Checking to see if your struct tm has tm_zone field..." >&4
10200 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10208 case "$d_tm_tm_zone" in
10209 "$define") echo "Yes, it does." ;;
10210 *) echo "No, it doesn't." ;;
10212 : see if struct tm knows about tm_gmtoff
10213 case "$i_systime$i_time" in
10216 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10217 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10225 case "$d_tm_tm_gmtoff" in
10226 "$define") echo "Yes, it does." ;;
10227 *) echo "No, it doesn't." ;;
10230 : see if asctime_r exists
10231 set asctime_r d_asctime_r
10233 case "$d_asctime_r" in
10235 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10236 case "$d_asctime_r_proto:$usethreads" in
10237 ":define") d_asctime_r_proto=define
10238 set d_asctime_r_proto asctime_r $hdrs
10242 case "$d_asctime_r_proto" in
10244 case "$asctime_r_proto" in
10245 ''|0) try='char* asctime_r(const struct tm*, char*);'
10246 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10248 case "$asctime_r_proto" in
10249 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10250 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10252 case "$asctime_r_proto" in
10253 ''|0) try='int asctime_r(const struct tm*, char*);'
10254 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10256 case "$asctime_r_proto" in
10257 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10258 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10260 case "$asctime_r_proto" in
10261 ''|0) d_asctime_r=undef
10263 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10264 * ) case "$asctime_r_proto" in
10265 REENTRANT_PROTO*) ;;
10266 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10268 echo "Prototype: $try" ;;
10271 *) case "$usethreads" in
10272 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10279 *) asctime_r_proto=0
10283 : see if atolf exists
10287 : see if atoll exists
10291 : Look for GCC-style attribute format
10292 case "$d_attribute_format" in
10295 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10296 $cat >attrib.c <<'EOCP'
10298 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10300 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10301 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10302 echo "Your C compiler doesn't support __attribute__((format))."
10305 echo "Your C compiler supports __attribute__((format))."
10309 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10313 *) val="$d_attribute_format" ;;
10315 set d_attribute_format
10319 : Look for GCC-style attribute format with null format allowed
10320 case "$d_printf_format_null" in
10321 '') case "$d_attribute_format" in
10324 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10325 $cat >attrib.c <<EOCP
10327 #$i_stdlib I_STDLIB
10329 #include <stdlib.h>
10331 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10332 int null_printf (char* pat,...) { return (int)pat; }
10333 int main () { exit(null_printf(NULL)); }
10335 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10336 : run the executable in case it produces a run-time warning
10337 if $run ./attrib >>attrib.out 2>&1; then
10338 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10339 echo "Your C compiler doesn't allow __printf__ format to be null."
10342 echo "Your C compiler allows __printf__ format to be null."
10346 echo "Your C compiler executable failed with __printf__ format null."
10350 echo "Your C compiler fails with __printf__ format null."
10357 *) val="$d_printf_format_null" ;;
10359 set d_printf_format_null
10363 : Look for GCC-style attribute malloc
10364 case "$d_attribute_malloc" in
10367 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10368 $cat >attrib.c <<'EOCP'
10370 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10372 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10373 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10374 echo "Your C compiler doesn't support __attribute__((malloc))."
10377 echo "Your C compiler supports __attribute__((malloc))."
10381 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10385 *) val="$d_attribute_malloc" ;;
10387 set d_attribute_malloc
10391 : Look for GCC-style attribute nonnull
10392 case "$d_attribute_nonnull" in
10395 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10396 $cat >attrib.c <<'EOCP'
10398 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10400 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10401 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10402 echo "Your C compiler doesn't support __attribute__((nonnull))."
10405 echo "Your C compiler supports __attribute__((nonnull))."
10409 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10413 *) val="$d_attribute_nonnull" ;;
10415 set d_attribute_nonnull
10419 : Look for GCC-style attribute noreturn
10420 case "$d_attribute_noreturn" in
10423 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10424 $cat >attrib.c <<'EOCP'
10426 void fall_over_dead( void ) __attribute__((noreturn));
10428 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10429 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10430 echo "Your C compiler doesn't support __attribute__((noreturn))."
10433 echo "Your C compiler supports __attribute__((noreturn))."
10437 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10441 *) val="$d_attribute_noreturn" ;;
10443 set d_attribute_noreturn
10447 : Look for GCC-style attribute pure
10448 case "$d_attribute_pure" in
10451 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10452 $cat >attrib.c <<'EOCP'
10454 int square( int n ) __attribute__((pure));
10456 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10457 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10458 echo "Your C compiler doesn't support __attribute__((pure))."
10461 echo "Your C compiler supports __attribute__((pure))."
10465 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10469 *) val="$d_attribute_pure" ;;
10471 set d_attribute_pure
10475 : Look for GCC-style attribute unused
10476 case "$d_attribute_unused" in
10479 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10480 $cat >attrib.c <<'EOCP'
10482 int do_something( int dummy __attribute__((unused)), int n );
10484 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10485 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10486 echo "Your C compiler doesn't support __attribute__((unused))."
10489 echo "Your C compiler supports __attribute__((unused))."
10493 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10497 *) val="$d_attribute_unused" ;;
10499 set d_attribute_unused
10503 : Look for GCC-style attribute warn_unused_result
10504 case "$d_attribute_warn_unused_result" in
10507 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10508 $cat >attrib.c <<'EOCP'
10510 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10512 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10513 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10514 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10517 echo "Your C compiler supports __attribute__((warn_unused_result))."
10521 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10525 *) val="$d_attribute_warn_unused_result" ;;
10527 set d_attribute_warn_unused_result
10531 : see if bcmp exists
10535 : see if bcopy exists
10539 : see if getpgrp exists
10540 set getpgrp d_getpgrp
10543 case "$d_getpgrp" in
10546 echo "Checking to see which flavor of getpgrp is in use..."
10548 #$i_unistd I_UNISTD
10549 #include <sys/types.h>
10551 # include <unistd.h>
10553 #$i_stdlib I_STDLIB
10555 #include <stdlib.h>
10559 if (getuid() == 0) {
10560 printf("(I see you are running Configure as super-user...)\n");
10563 #ifdef TRY_BSD_PGRP
10564 if (getpgrp(1) == 0)
10573 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10574 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10576 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10577 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10580 echo "I can't seem to compile and run the test program."
10582 xxx="a USG one, i.e. you use getpgrp()."
10584 # SVR4 systems can appear rather BSD-ish.
10585 case "$i_unistd" in
10587 xxx="a BSD one, i.e. you use getpgrp(pid)."
10591 xxx="probably a USG one, i.e. you use getpgrp()."
10596 echo "Assuming your getpgrp is $xxx" >&4
10605 : see if setpgrp exists
10606 set setpgrp d_setpgrp
10609 case "$d_setpgrp" in
10612 echo "Checking to see which flavor of setpgrp is in use..."
10614 #$i_unistd I_UNISTD
10615 #include <sys/types.h>
10617 # include <unistd.h>
10619 #$i_stdlib I_STDLIB
10621 #include <stdlib.h>
10625 if (getuid() == 0) {
10626 printf("(I see you are running Configure as super-user...)\n");
10629 #ifdef TRY_BSD_PGRP
10630 if (-1 == setpgrp(1, 1))
10633 if (setpgrp() != -1)
10639 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10640 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10642 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10643 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10646 echo "(I can't seem to compile and run the test program.)"
10648 xxx="a USG one, i.e. you use setpgrp()."
10650 # SVR4 systems can appear rather BSD-ish.
10651 case "$i_unistd" in
10653 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10657 xxx="probably a USG one, i.e. you use setpgrp()."
10662 echo "Assuming your setpgrp is $xxx" >&4
10671 : Look for GCC-style __builtin_choose_expr
10672 case "$d_builtin_choose_expr" in
10675 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10676 $cat >try.c <<'EOCP'
10677 #include <assert.h>
10678 #include <stdlib.h>
10681 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10684 assert( SYRINX(1) == 2112 );
10685 assert( SYRINX(1) != 5150 );
10686 assert( SYRINX(0) == 5150 );
10687 assert( SYRINX(0) != 2112 );
10688 puts( "All good!" );
10694 if eval $compile && $run ./try; then
10695 echo "Your C compiler supports __builtin_choose_expr."
10698 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10702 *) val="$d_builtin_choose_expr" ;;
10705 set d_builtin_choose_expr
10709 : Look for GCC-style __builtin_expect
10710 case "$d_builtin_expect" in
10713 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10714 $cat >try.c <<'EOCP'
10717 if ( __builtin_expect(n, 0) ) n = 1;
10718 /* Remember shell exit code truth is 0, C truth is non-zero */
10723 if eval $compile && $run ./try; then
10724 echo "Your C compiler supports __builtin_expect."
10727 echo "Your C compiler doesn't seem to understand __builtin_expect."
10731 *) val="$d_builtin_expect" ;;
10734 set d_builtin_expect
10738 : see if bzero exists
10742 : see if stdarg is available
10744 if $test `./findhdr stdarg.h`; then
10745 echo "<stdarg.h> found." >&4
10748 echo "<stdarg.h> NOT found." >&4
10752 : see if varags is available
10754 if $test `./findhdr varargs.h`; then
10755 echo "<varargs.h> found." >&4
10757 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10760 : set up the varargs testing programs
10761 $cat > varargs.c <<EOP
10763 #include <stdarg.h>
10766 #include <varargs.h>
10770 int f(char *p, ...)
10784 p = va_arg(ap, char *);
10790 $cat > varargs <<EOP
10792 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10801 : now check which varargs header should be included
10806 if `./varargs I_STDARG`; then
10808 elif `./varargs I_VARARGS`; then
10813 if `./varargs I_VARARGS`; then
10820 echo "I could not find the definition for va_dcl... You have problems..." >&4
10821 val="$undef"; set i_stdarg; eval $setvar
10822 val="$undef"; set i_varargs; eval $setvar
10827 case "$i_varhdr" in
10829 val="$define"; set i_stdarg; eval $setvar
10830 val="$undef"; set i_varargs; eval $setvar
10833 val="$undef"; set i_stdarg; eval $setvar
10834 val="$define"; set i_varargs; eval $setvar
10837 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10841 : see if the Compiler supports C99 variadic macros
10842 case "$i_stdarg$i_stdlib" in
10844 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10847 #include <stdarg.h>
10849 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10853 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10859 if eval $compile && $run ./try 2>&1 >/dev/null; then
10860 case "`$run ./try`" in
10862 echo "You have C99 variadic macros." >&4
10863 d_c99_variadic_macros="$define"
10866 echo "You don't have functional C99 variadic macros." >&4
10867 d_c99_variadic_macros="$undef"
10871 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10872 d_c99_variadic_macros="$undef"
10877 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10878 d_c99_variadic_macros="$undef"
10882 : see if signal is declared as pointer to function returning int or void
10884 xxx=`./findhdr signal.h`
10885 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10886 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10887 echo "You have int (*signal())() instead of void." >&4
10889 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10890 echo "You have void (*signal())()." >&4
10892 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10893 echo "You have int (*signal())() instead of void." >&4
10895 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10896 echo "You have void (*signal())()." >&4
10899 case "$d_voidsig" in
10901 echo "I can't determine whether signal handler returns void or int..." >&4
10903 rp="What type does your signal handler return?"
10906 v*) val="$define";;
10910 echo "As you already told me, signal handler returns void." >&4
10913 *) echo "As you already told me, signal handler returns int." >&4
10920 case "$d_voidsig" in
10921 "$define") signal_t="void";;
10922 *) signal_t="int";;
10926 : check for ability to cast large floats to 32-bit ints.
10928 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10929 if $test "$intsize" -ge 4; then
10936 #$i_stdlib I_STDLIB
10938 #include <stdlib.h>
10940 #include <sys/types.h>
10941 #include <signal.h>
10942 $signal_t blech(int s) { exit(3); }
10949 signal(SIGFPE, blech);
10951 /* Don't let compiler optimize the test away. Store the number
10952 in a writable string for gcc to pass to sscanf under HP/UX.
10954 sprintf(str, "2147483647");
10955 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10959 /* x86 processors will probably give 0x8000 0000, which is a
10960 sign change. We don't want that. We want to mimic SPARC
10961 behavior here, which is to preserve the sign and give
10964 if (i32 != ($xxx) f)
10970 if eval $compile_ok; then
10974 echo "(I can't seem to compile the test program--assuming it can't)"
10979 echo "Yup, it can."
10982 echo "Nope, it can't."
10989 : check for ability to cast negative floats to unsigned
10991 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10994 #$i_stdlib I_STDLIB
10996 #include <stdlib.h>
10998 #include <sys/types.h>
10999 #include <signal.h>
11000 $signal_t blech(int s) { exit(7); }
11001 $signal_t blech_in_list(int s) { exit(4); }
11002 unsigned long dummy_long(unsigned long p) { return p; }
11003 unsigned int dummy_int(unsigned int p) { return p; }
11004 unsigned short dummy_short(unsigned short p) { return p; }
11008 unsigned long along;
11010 unsigned short ashort;
11014 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11015 a direct f = -123. assignment. gcc-2.8.0 reportedly
11016 optimized the whole file away
11018 /* Store the number in a writable string for gcc to pass to
11019 sscanf under HP/UX.
11021 sprintf(str, "-123");
11022 sscanf(str, "%lf", &f); /* f = -123.; */
11024 signal(SIGFPE, blech);
11025 along = (unsigned long)f;
11026 aint = (unsigned int)f;
11027 ashort = (unsigned short)f;
11028 if (along != (unsigned long)-123)
11030 if (aint != (unsigned int)-123)
11032 if (ashort != (unsigned short)-123)
11034 sprintf(str, "1073741824.");
11035 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11038 along = (unsigned long)f;
11039 if (along != 0x80000000)
11043 along = (unsigned long)f;
11044 if (along != 0x7fffffff)
11048 along = (unsigned long)f;
11049 if (along != 0x80000001)
11053 signal(SIGFPE, blech_in_list);
11054 sprintf(str, "123.");
11055 sscanf(str, "%lf", &f); /* f = 123.; */
11056 along = dummy_long((unsigned long)f);
11057 aint = dummy_int((unsigned int)f);
11058 ashort = dummy_short((unsigned short)f);
11059 if (along != (unsigned long)123)
11061 if (aint != (unsigned int)123)
11063 if (ashort != (unsigned short)123)
11070 if eval $compile_ok; then
11074 echo "(I can't seem to compile the test program--assuming it can't)"
11077 case "$castflags" in
11079 echo "Yup, it can."
11082 echo "Nope, it can't."
11089 : see if vprintf exists
11091 if set vprintf val -f d_vprintf; eval $csym; $val; then
11092 echo 'vprintf() found.' >&4
11095 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11096 #$i_varargs I_VARARGS
11098 #$i_stdlib I_STDLIB
11099 #$i_unistd I_UNISTD
11102 # include <stdarg.h>
11103 #else /* I_VARARGS */
11104 # include <varargs.h>
11108 # include <unistd.h>
11112 # include <stdlib.h>
11115 #include <stdio.h> /* vsprintf prototype */
11118 void xxx(int n, ...)
11123 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11125 int main() { xxx(1, "foo"); }
11127 #else /* I_VARARGS */
11135 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11137 int main() { xxx("foo"); }
11143 if eval $compile_ok; then
11144 if $run ./try; then
11145 echo "Your vsprintf() returns (int)." >&4
11148 echo "Your vsprintf() returns (char*)." >&4
11152 echo 'I am unable to compile the vsprintf() test program.' >&4
11153 # We shouldn't get here. If we do, assume the standard signature,
11154 # not the old BSD one.
11155 echo 'Guessing that vsprintf() returns (int).' >&4
11159 echo 'vprintf() NOT found.' >&4
11170 : see if chown exists
11174 : see if chroot exists
11175 set chroot d_chroot
11178 : see if chsize exists
11179 set chsize d_chsize
11182 : see if class exists
11186 : see if clearenv exists
11187 set clearenv d_clearenv
11190 : Define hasstruct macro for Configure internal use
11191 hasstruct='varname=$1; struct=$2; shift; shift;
11192 while $test $# -ge 2; do
11194 $define) echo "#include <$2>";;
11198 echo "int main () { struct $struct foo; }" >> try.c;
11200 if eval $compile; then
11209 : see whether socket exists
11213 $echo $n "Hmm... $c" >&4
11214 if set socket val -f d_socket; eval $csym; $val; then
11215 echo "Looks like you have Berkeley networking support." >&4
11217 if set setsockopt val -f; eval $csym; $val; then
11220 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11221 d_oldsock="$define"
11224 if $contains socklib libc.list >/dev/null 2>&1; then
11225 echo "Looks like you have Berkeley networking support." >&4
11227 : we will have to assume that it supports the 4.2 BSD interface
11230 echo "You don't have Berkeley networking in libc$_a..." >&4
11231 if test "X$d_socket" = "X$define"; then
11232 echo "...but you seem to believe that you have sockets." >&4
11234 for net in net socket
11236 if test -f /usr/lib/lib$net$_a; then
11237 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11238 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11239 if $contains socket libc.list >/dev/null 2>&1; then
11244 echo "...but the Wollongong group seems to have hacked it in." >&4
11245 sockethdr="-I/usr/netinclude"
11248 echo "Found Berkeley sockets interface in lib$net." >&4
11249 if $contains setsockopt libc.list >/dev/null 2>&1; then
11252 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11253 d_oldsock="$define"
11259 if test "X$d_socket" != "X$define"; then
11260 echo "or anywhere else I see." >&4
11268 : see if socketpair exists
11269 set socketpair d_sockpair
11274 echo "Checking the availability of certain socket constants..." >&4
11275 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11276 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11278 #include <sys/types.h>
11279 #include <sys/socket.h>
11285 set try; if eval $compile; then
11288 set d_${enum}; eval $setvar
11292 : see if this is a sys/uio.h system
11293 set sys/uio.h i_sysuio
11296 : Check for cmsghdr support
11298 echo "Checking to see if your system supports struct cmsghdr..." >&4
11299 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11301 case "$d_cmsghdr_s" in
11302 "$define") echo "Yes, it does." ;;
11303 *) echo "No, it doesn't." ;;
11307 : check for const keyword
11309 echo 'Checking to see if your C compiler knows about "const"...' >&4
11310 $cat >const.c <<'EOCP'
11311 typedef struct spug { int drokk; } spug;
11315 const spug y = { 0 };
11318 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11320 echo "Yup, it does."
11323 echo "Nope, it doesn't."
11328 : see if copysignl exists
11329 set copysignl d_copysignl
11332 : see if crypt exists
11337 $define) cryptlib='' ;;
11338 *) if set crypt val -f d_crypt; eval $csym; $val; then
11339 echo 'crypt() found.' >&4
11343 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11344 if $test -z "$cryptlib"; then
11345 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11349 if $test -z "$cryptlib"; then
11350 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11354 if $test -z "$cryptlib"; then
11355 cryptlib=`./loc libcrypt$_a "" $libpth`
11359 if $test -z "$cryptlib"; then
11360 echo 'crypt() NOT found.' >&4
11371 : see if this is a crypt.h system
11372 set crypt.h i_crypt
11375 : see if crypt_r exists
11376 set crypt_r d_crypt_r
11378 case "$d_crypt_r" in
11380 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11381 case "$d_crypt_r_proto:$usethreads" in
11382 ":define") d_crypt_r_proto=define
11383 set d_crypt_r_proto crypt_r $hdrs
11387 case "$d_crypt_r_proto" in
11389 case "$crypt_r_proto" in
11390 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11391 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11393 case "$crypt_r_proto" in
11394 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11395 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11397 case "$crypt_r_proto" in
11398 ''|0) d_crypt_r=undef
11400 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11401 * ) case "$crypt_r_proto" in
11402 REENTRANT_PROTO*) ;;
11403 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11405 echo "Prototype: $try" ;;
11408 *) case "$usethreads" in
11409 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11420 : get csh whereabouts
11422 'csh') val="$undef" ;;
11423 *) val="$define" ;;
11427 : Respect a hint or command line value for full_csh.
11428 case "$full_csh" in
11429 '') full_csh=$csh ;;
11432 : see if ctermid exists
11433 set ctermid d_ctermid
11436 : see if ctermid_r exists
11437 set ctermid_r d_ctermid_r
11439 case "$d_ctermid_r" in
11441 hdrs="$i_systypes sys/types.h define stdio.h "
11442 case "$d_ctermid_r_proto:$usethreads" in
11443 ":define") d_ctermid_r_proto=define
11444 set d_ctermid_r_proto ctermid_r $hdrs
11448 case "$d_ctermid_r_proto" in
11450 case "$ctermid_r_proto" in
11451 ''|0) try='char* ctermid_r(char*);'
11452 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11454 case "$ctermid_r_proto" in
11455 ''|0) d_ctermid_r=undef
11457 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11458 * ) case "$ctermid_r_proto" in
11459 REENTRANT_PROTO*) ;;
11460 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11462 echo "Prototype: $try" ;;
11465 *) case "$usethreads" in
11466 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11473 *) ctermid_r_proto=0
11477 : see if ctime_r exists
11478 set ctime_r d_ctime_r
11480 case "$d_ctime_r" in
11482 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11483 case "$d_ctime_r_proto:$usethreads" in
11484 ":define") d_ctime_r_proto=define
11485 set d_ctime_r_proto ctime_r $hdrs
11489 case "$d_ctime_r_proto" in
11491 case "$ctime_r_proto" in
11492 ''|0) try='char* ctime_r(const time_t*, char*);'
11493 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11495 case "$ctime_r_proto" in
11496 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11497 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11499 case "$ctime_r_proto" in
11500 ''|0) try='int ctime_r(const time_t*, char*);'
11501 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11503 case "$ctime_r_proto" in
11504 ''|0) try='int ctime_r(const time_t*, char*, int);'
11505 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11507 case "$ctime_r_proto" in
11508 ''|0) d_ctime_r=undef
11510 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11511 * ) case "$ctime_r_proto" in
11512 REENTRANT_PROTO*) ;;
11513 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11515 echo "Prototype: $try" ;;
11518 *) case "$usethreads" in
11519 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11530 : see if cuserid exists
11531 set cuserid d_cuserid
11534 : see if this is a limits.h system
11535 set limits.h i_limits
11538 : see if this is a float.h system
11539 set float.h i_float
11542 : See if number of significant digits in a double precision number is known
11544 $cat >dbl_dig.c <<EOM
11545 #$i_limits I_LIMITS
11548 #include <limits.h>
11554 printf("Contains DBL_DIG");
11557 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11558 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11559 echo "DBL_DIG found." >&4
11562 echo "DBL_DIG NOT found." >&4
11569 : see if dbm.h is available
11570 : see if dbmclose exists
11571 set dbmclose d_dbmclose
11574 case "$d_dbmclose" in
11584 *) set rpcsvc/dbm.h i_rpcsvcdbm
11589 *) echo "We won't be including <dbm.h>"
11599 : see if prototype for dbminit is available
11601 set d_dbminitproto dbminit $i_dbm dbm.h
11604 : see if difftime exists
11605 set difftime d_difftime
11608 : see if this is a dirent system
11610 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11612 echo "<dirent.h> found." >&4
11615 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11616 echo "<sys/dir.h> found." >&4
11619 xinc=`./findhdr sys/ndir.h`
11621 echo "<dirent.h> NOT found." >&4
11626 : Look for type of directory structure.
11628 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11630 case "$direntrytype" in
11632 case "$i_dirent" in
11633 $define) guess1='struct dirent' ;;
11634 *) guess1='struct direct' ;;
11637 *) guess1="$direntrytype"
11642 'struct dirent') guess2='struct direct' ;;
11643 *) guess2='struct dirent' ;;
11646 if $contains "$guess1" try.c >/dev/null 2>&1; then
11647 direntrytype="$guess1"
11648 echo "Your directory entries are $direntrytype." >&4
11649 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11650 direntrytype="$guess2"
11651 echo "Your directory entries seem to be $direntrytype." >&4
11653 echo "I don't recognize your system's directory entries." >&4
11654 rp="What type is used for directory entries on this system?"
11657 direntrytype="$ans"
11661 : see if the directory entry stores field length
11663 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11664 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11665 echo "Good, your directory entry keeps length information in d_namlen." >&4
11668 echo "Your directory entry does not know about the d_namlen field." >&4
11675 : Look for DIR.dd_fd
11676 case "$i_dirent" in
11678 echo "Checking to see if DIR has a dd_fd member variable" >&4
11680 #$i_stdlib I_STDLIB
11682 #include <stdlib.h>
11684 #include <dirent.h>
11694 if eval $compile; then
11695 echo "Yes, it does."
11698 echo "No, it does not."
11703 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11711 : see if this is an sysdir system
11712 set sys/dir.h i_sysdir
11715 : see if this is an sysndir system
11716 set sys/ndir.h i_sysndir
11721 $cat >dirfd.c <<EOM
11723 #$i_stdlib I_STDLIB
11725 #include <stdlib.h>
11727 #$i_dirent I_DIRENT /**/
11728 #$i_sysdir I_SYS_DIR /**/
11729 #$i_sysndir I_SYS_NDIR /**/
11730 #$i_systypes I_SYS_TYPES /**/
11731 #if defined(I_SYS_TYPES)
11732 #include <sys/types.h>
11734 #if defined(I_DIRENT)
11735 #include <dirent.h>
11736 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11737 #include <sys/dir.h>
11741 #include <sys/ndir.h>
11745 #include <ndir.h> /* may be wrong in the future */
11747 #include <sys/dir.h>
11753 DIR *dirp = opendir(".");
11754 if (dirfd(dirp) >= 0)
11762 if eval $compile; then
11766 $define) echo "dirfd() found." >&4 ;;
11767 *) echo "dirfd() NOT found." >&4 ;;
11773 : see if dlerror exists
11776 set dlerror d_dlerror
11780 : see if dlfcn is available
11781 set dlfcn.h i_dlfcn
11784 : Check what extension to use for shared libs
11789 On a few systems, the dynamically loaded modules that perl generates and uses
11790 will need a different extension than shared libs. The default will probably
11796 *) dflt="$dlext" ;;
11798 rp='What is the extension of dynamically loaded modules'
11807 : Check if dlsym need a leading underscore
11813 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11814 $cat >dyna.c <<'EOM'
11821 #$i_stdlib I_STDLIB
11823 #include <stdlib.h>
11827 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11829 #include <sys/types.h>
11834 extern int fred() ;
11843 int mode = RTLD_LAZY ;
11845 handle = dlopen("./dyna.$dlext", mode) ;
11846 if (handle == NULL) {
11851 symbol = dlsym(handle, "fred") ;
11852 if (symbol == NULL) {
11853 /* try putting a leading underscore */
11854 symbol = dlsym(handle, "_fred") ;
11855 if (symbol == NULL) {
11868 : Call the object file tmp-dyna.o in case dlext=o.
11869 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11870 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11871 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11872 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11875 1) echo "Test program failed using dlopen." >&4
11876 echo "Perhaps you should not use dynamic loading." >&4;;
11877 2) echo "Test program failed using dlsym." >&4
11878 echo "Perhaps you should not use dynamic loading." >&4;;
11879 3) echo "dlsym needs a leading underscore" >&4
11881 4) echo "dlsym doesn't need a leading underscore." >&4;;
11884 echo "I can't compile and run the test program." >&4
11885 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11890 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11895 : see if drand48_r exists
11896 set drand48_r d_drand48_r
11898 case "$d_drand48_r" in
11900 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11901 case "$d_drand48_r_proto:$usethreads" in
11902 ":define") d_drand48_r_proto=define
11903 set d_drand48_r_proto drand48_r $hdrs
11907 case "$d_drand48_r_proto" in
11909 case "$drand48_r_proto" in
11910 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11911 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11913 case "$drand48_r_proto" in
11914 ''|0) d_drand48_r=undef
11916 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11917 * ) case "$drand48_r_proto" in
11918 REENTRANT_PROTO*) ;;
11919 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11921 echo "Prototype: $try" ;;
11924 *) case "$usethreads" in
11925 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11932 *) drand48_r_proto=0
11936 : see if prototype for drand48 is available
11938 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11941 : see if dup2 exists
11945 : see if eaccess exists
11946 set eaccess d_eaccess
11949 : see if endgrent exists
11950 set endgrent d_endgrent
11953 : see if this is an grp system
11959 xxx=`./findhdr grp.h`
11960 $cppstdin $cppflags $cppminus < $xxx >$$.h
11962 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11974 set d_grpasswd; eval $setvar
11978 : see if endgrent_r exists
11979 set endgrent_r d_endgrent_r
11981 case "$d_endgrent_r" in
11983 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11984 case "$d_endgrent_r_proto:$usethreads" in
11985 ":define") d_endgrent_r_proto=define
11986 set d_endgrent_r_proto endgrent_r $hdrs
11990 case "$d_endgrent_r_proto" in
11992 case "$endgrent_r_proto" in
11993 ''|0) try='int endgrent_r(FILE**);'
11994 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
11996 case "$endgrent_r_proto" in
11997 ''|0) try='void endgrent_r(FILE**);'
11998 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12000 case "$endgrent_r_proto" in
12001 ''|0) d_endgrent_r=undef
12003 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12004 * ) case "$endgrent_r_proto" in
12005 REENTRANT_PROTO*) ;;
12006 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12008 echo "Prototype: $try" ;;
12011 *) case "$usethreads" in
12012 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12019 *) endgrent_r_proto=0
12023 : see if endhostent exists
12024 set endhostent d_endhent
12027 : see if this is a netdb.h system
12028 set netdb.h i_netdb
12031 : see if endhostent_r exists
12032 set endhostent_r d_endhostent_r
12034 case "$d_endhostent_r" in
12036 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12037 case "$d_endhostent_r_proto:$usethreads" in
12038 ":define") d_endhostent_r_proto=define
12039 set d_endhostent_r_proto endhostent_r $hdrs
12043 case "$d_endhostent_r_proto" in
12045 case "$endhostent_r_proto" in
12046 ''|0) try='int endhostent_r(struct hostent_data*);'
12047 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12049 case "$endhostent_r_proto" in
12050 ''|0) try='void endhostent_r(struct hostent_data*);'
12051 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12053 case "$endhostent_r_proto" in
12054 ''|0) d_endhostent_r=undef
12055 endhostent_r_proto=0
12056 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12057 * ) case "$endhostent_r_proto" in
12058 REENTRANT_PROTO*) ;;
12059 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12061 echo "Prototype: $try" ;;
12064 *) case "$usethreads" in
12065 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12067 d_endhostent_r=undef
12068 endhostent_r_proto=0
12072 *) endhostent_r_proto=0
12076 : see if endnetent exists
12077 set endnetent d_endnent
12080 : see if endnetent_r exists
12081 set endnetent_r d_endnetent_r
12083 case "$d_endnetent_r" in
12085 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12086 case "$d_endnetent_r_proto:$usethreads" in
12087 ":define") d_endnetent_r_proto=define
12088 set d_endnetent_r_proto endnetent_r $hdrs
12092 case "$d_endnetent_r_proto" in
12094 case "$endnetent_r_proto" in
12095 ''|0) try='int endnetent_r(struct netent_data*);'
12096 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12098 case "$endnetent_r_proto" in
12099 ''|0) try='void endnetent_r(struct netent_data*);'
12100 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12102 case "$endnetent_r_proto" in
12103 ''|0) d_endnetent_r=undef
12104 endnetent_r_proto=0
12105 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12106 * ) case "$endnetent_r_proto" in
12107 REENTRANT_PROTO*) ;;
12108 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12110 echo "Prototype: $try" ;;
12113 *) case "$usethreads" in
12114 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12116 d_endnetent_r=undef
12117 endnetent_r_proto=0
12121 *) endnetent_r_proto=0
12125 : see if endprotoent exists
12126 set endprotoent d_endpent
12129 : see if endprotoent_r exists
12130 set endprotoent_r d_endprotoent_r
12132 case "$d_endprotoent_r" in
12134 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12135 case "$d_endprotoent_r_proto:$usethreads" in
12136 ":define") d_endprotoent_r_proto=define
12137 set d_endprotoent_r_proto endprotoent_r $hdrs
12141 case "$d_endprotoent_r_proto" in
12143 case "$endprotoent_r_proto" in
12144 ''|0) try='int endprotoent_r(struct protoent_data*);'
12145 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12147 case "$endprotoent_r_proto" in
12148 ''|0) try='void endprotoent_r(struct protoent_data*);'
12149 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12151 case "$endprotoent_r_proto" in
12152 ''|0) d_endprotoent_r=undef
12153 endprotoent_r_proto=0
12154 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12155 * ) case "$endprotoent_r_proto" in
12156 REENTRANT_PROTO*) ;;
12157 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12159 echo "Prototype: $try" ;;
12162 *) case "$usethreads" in
12163 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12165 d_endprotoent_r=undef
12166 endprotoent_r_proto=0
12170 *) endprotoent_r_proto=0
12174 : see if endpwent exists
12175 set endpwent d_endpwent
12178 : see if this is a pwd.h system
12184 xxx=`./findhdr pwd.h`
12185 $cppstdin $cppflags $cppminus < $xxx >$$.h
12187 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12195 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12203 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12211 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12219 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12227 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12235 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12243 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12255 set d_pwquota; eval $setvar
12256 set d_pwage; eval $setvar
12257 set d_pwchange; eval $setvar
12258 set d_pwclass; eval $setvar
12259 set d_pwexpire; eval $setvar
12260 set d_pwcomment; eval $setvar
12261 set d_pwgecos; eval $setvar
12262 set d_pwpasswd; eval $setvar
12266 : see if endpwent_r exists
12267 set endpwent_r d_endpwent_r
12269 case "$d_endpwent_r" in
12271 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12272 case "$d_endpwent_r_proto:$usethreads" in
12273 ":define") d_endpwent_r_proto=define
12274 set d_endpwent_r_proto endpwent_r $hdrs
12278 case "$d_endpwent_r_proto" in
12280 case "$endpwent_r_proto" in
12281 ''|0) try='int endpwent_r(FILE**);'
12282 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12284 case "$endpwent_r_proto" in
12285 ''|0) try='void endpwent_r(FILE**);'
12286 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12288 case "$endpwent_r_proto" in
12289 ''|0) d_endpwent_r=undef
12291 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12292 * ) case "$endpwent_r_proto" in
12293 REENTRANT_PROTO*) ;;
12294 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12296 echo "Prototype: $try" ;;
12299 *) case "$usethreads" in
12300 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12307 *) endpwent_r_proto=0
12311 : see if endservent exists
12312 set endservent d_endsent
12315 : see if endservent_r exists
12316 set endservent_r d_endservent_r
12318 case "$d_endservent_r" in
12320 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12321 case "$d_endservent_r_proto:$usethreads" in
12322 ":define") d_endservent_r_proto=define
12323 set d_endservent_r_proto endservent_r $hdrs
12327 case "$d_endservent_r_proto" in
12329 case "$endservent_r_proto" in
12330 ''|0) try='int endservent_r(struct servent_data*);'
12331 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12333 case "$endservent_r_proto" in
12334 ''|0) try='void endservent_r(struct servent_data*);'
12335 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12337 case "$endservent_r_proto" in
12338 ''|0) d_endservent_r=undef
12339 endservent_r_proto=0
12340 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12341 * ) case "$endservent_r_proto" in
12342 REENTRANT_PROTO*) ;;
12343 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12345 echo "Prototype: $try" ;;
12348 *) case "$usethreads" in
12349 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12351 d_endservent_r=undef
12352 endservent_r_proto=0
12356 *) endservent_r_proto=0
12360 : Locate the flags for 'open()'
12363 #include <sys/types.h>
12368 #include <sys/file.h>
12370 #$i_stdlib I_STDLIB
12372 #include <stdlib.h>
12383 : check sys/file.h first to get FREAD on Sun
12384 if $test `./findhdr sys/file.h` && \
12385 set try -DI_SYS_FILE && eval $compile; then
12387 echo "<sys/file.h> defines the O_* constants..." >&4
12388 if $run ./try; then
12389 echo "and you have the 3 argument form of open()." >&4
12392 echo "but not the 3 argument form of open(). Oh, well." >&4
12395 elif $test `./findhdr fcntl.h` && \
12396 set try -DI_FCNTL && eval $compile; then
12398 echo "<fcntl.h> defines the O_* constants..." >&4
12399 if $run ./try; then
12400 echo "and you have the 3 argument form of open()." >&4
12403 echo "but not the 3 argument form of open(). Oh, well." >&4
12408 echo "I can't find the O_* constant definitions! You got problems." >&4
12414 : see if this is a sys/file.h system
12419 : do we need to include sys/file.h ?
12423 if $h_sysfile; then
12425 echo "We'll be including <sys/file.h>." >&4
12428 echo "We won't be including <sys/file.h>." >&4
12438 : see if fcntl.h is there
12443 : see if we can include fcntl.h
12449 echo "We'll be including <fcntl.h>." >&4
12452 if $h_sysfile; then
12453 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12455 echo "We won't be including <fcntl.h>." >&4
12467 : see if fork exists
12471 : see if pipe exists
12475 : check for non-blocking I/O stuff
12476 case "$h_sysfile" in
12477 true) echo "#include <sys/file.h>" > head.c;;
12480 true) echo "#include <fcntl.h>" > head.c;;
12481 *) echo "#include <sys/fcntl.h>" > head.c;;
12486 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12487 case "$o_nonblock" in
12489 $cat head.c > try.c
12490 $cat >>try.c <<EOCP
12492 #$i_stdlib I_STDLIB
12494 #include <stdlib.h>
12502 printf("O_NONBLOCK\n");
12506 printf("O_NDELAY\n");
12510 printf("FNDELAY\n");
12517 if eval $compile_ok; then
12518 o_nonblock=`$run ./try`
12519 case "$o_nonblock" in
12520 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12521 *) echo "Seems like we can use $o_nonblock.";;
12524 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12527 *) echo "Using $hint value $o_nonblock.";;
12532 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12535 case "$d_fork:$d_pipe" in
12537 $cat head.c > try.c
12538 $cat >>try.c <<EOCP
12540 #include <sys/types.h>
12541 #include <signal.h>
12543 #$i_stdlib I_STDLIB
12545 #include <stdlib.h>
12551 #define MY_O_NONBLOCK $o_nonblock
12552 #ifndef errno /* XXX need better Configure test */
12555 #$i_unistd I_UNISTD
12557 #include <unistd.h>
12559 #$i_string I_STRING
12561 #include <string.h>
12563 #include <strings.h>
12565 $signal_t blech(int x) { exit(3); }
12567 $cat >> try.c <<'EOCP'
12575 pipe(pd); /* Down: child -> parent */
12576 pipe(pu); /* Up: parent -> child */
12579 close(pd[1]); /* Parent reads from pd[0] */
12580 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12582 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12587 signal(SIGALRM, blech);
12589 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12591 sprintf(string, "%d\n", ret);
12592 write(2, string, strlen(string));
12595 if (errno == EAGAIN) {
12596 printf("EAGAIN\n");
12601 if (errno == EWOULDBLOCK)
12602 printf("EWOULDBLOCK\n");
12605 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12606 sleep(2); /* Give it time to close our pipe */
12608 ret = read(pd[0], buf, 1); /* Should read EOF */
12610 sprintf(string, "%d\n", ret);
12611 write(4, string, strlen(string));
12615 close(pd[0]); /* We write to pd[1] */
12616 close(pu[1]); /* We read from pu[0] */
12617 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12618 close(pd[1]); /* Pipe pd is now fully closed! */
12619 exit(0); /* Bye bye, thank you for playing! */
12623 if eval $compile_ok; then
12624 echo "$startsh" >mtry
12625 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12627 ./mtry >/dev/null 2>&1
12629 0) eagain=`$cat try.out`;;
12630 1) echo "Could not perform non-blocking setting!";;
12631 2) echo "I did a successful read() for something that was not there!";;
12632 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12633 4) echo "Could not find F_SETFL!";;
12634 *) echo "Something terribly wrong happened during testing.";;
12636 rd_nodata=`$cat try.ret`
12637 echo "A read() system call with no data present returns $rd_nodata."
12638 case "$rd_nodata" in
12641 echo "(That's peculiar, fixing that to be -1.)"
12647 echo "Forcing errno EAGAIN on read() with no data available."
12651 echo "Your read() sets errno to $eagain when no data is available."
12654 status=`$cat try.err`
12656 0) echo "And it correctly returns 0 to signal EOF.";;
12657 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12658 *) echo "However, your read() returns '$status' on EOF??";;
12661 if test "$status" = "$rd_nodata"; then
12662 echo "WARNING: you can't distinguish between EOF and no data!"
12666 echo "I can't compile the test program--assuming errno EAGAIN will do."
12670 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12679 echo "Using $hint value $eagain."
12680 echo "Your read() returns $rd_nodata when no data is present."
12681 case "$d_eofnblk" in
12682 "$define") echo "And you can see EOF because read() returns 0.";;
12683 "$undef") echo "But you can't see EOF status from read() returned value.";;
12685 echo "(Assuming you can't see EOF status from read anyway.)"
12691 $rm_try head.c mtry
12693 : see if _ptr and _cnt from stdio act std
12696 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12697 echo "(Looks like you have stdio.h from BSD.)"
12698 case "$stdio_ptr" in
12699 '') stdio_ptr='((fp)->_p)'
12702 *) ptr_lval=$d_stdio_ptr_lval;;
12704 case "$stdio_cnt" in
12705 '') stdio_cnt='((fp)->_r)'
12708 *) cnt_lval=$d_stdio_cnt_lval;;
12710 case "$stdio_base" in
12711 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12713 case "$stdio_bufsiz" in
12714 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12716 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12717 echo "(Looks like you have stdio.h from Linux.)"
12718 case "$stdio_ptr" in
12719 '') stdio_ptr='((fp)->_IO_read_ptr)'
12722 *) ptr_lval=$d_stdio_ptr_lval;;
12724 case "$stdio_cnt" in
12725 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12728 *) cnt_lval=$d_stdio_cnt_lval;;
12730 case "$stdio_base" in
12731 '') stdio_base='((fp)->_IO_read_base)';;
12733 case "$stdio_bufsiz" in
12734 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12737 case "$stdio_ptr" in
12738 '') stdio_ptr='((fp)->_ptr)'
12741 *) ptr_lval=$d_stdio_ptr_lval;;
12743 case "$stdio_cnt" in
12744 '') stdio_cnt='((fp)->_cnt)'
12747 *) cnt_lval=$d_stdio_cnt_lval;;
12749 case "$stdio_base" in
12750 '') stdio_base='((fp)->_base)';;
12752 case "$stdio_bufsiz" in
12753 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12757 : test whether _ptr and _cnt really work
12758 echo "Checking how std your stdio is..." >&4
12761 #$i_stdlib I_STDLIB
12763 #include <stdlib.h>
12765 #define FILE_ptr(fp) $stdio_ptr
12766 #define FILE_cnt(fp) $stdio_cnt
12768 FILE *fp = fopen("try.c", "r");
12771 18 <= FILE_cnt(fp) &&
12772 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12780 if eval $compile && $to try.c; then
12781 if $run ./try; then
12782 echo "Your stdio acts pretty std."
12785 echo "Your stdio isn't very std."
12788 echo "Your stdio doesn't appear very std."
12792 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12793 # direct buffer manipulation no longer works. The Configure tests
12794 # should be changed to correctly detect this, but until then,
12795 # the following check should at least let perl compile and run.
12796 # (This quick fix should be updated before 5.8.1.)
12797 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12798 # A. Dougherty, June 3, 2002.
12799 case "$d_gnulibc" in
12801 case "$gnulibc_version" in
12805 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12814 : Can _ptr be used as an lvalue?
12815 case "$d_stdstdio$ptr_lval" in
12816 $define$define) val=$define ;;
12819 set d_stdio_ptr_lval
12822 : Can _cnt be used as an lvalue?
12823 case "$d_stdstdio$cnt_lval" in
12824 $define$define) val=$define ;;
12827 set d_stdio_cnt_lval
12831 : test whether setting _ptr sets _cnt as a side effect
12832 d_stdio_ptr_lval_sets_cnt="$undef"
12833 d_stdio_ptr_lval_nochange_cnt="$undef"
12834 case "$d_stdio_ptr_lval$d_stdstdio" in
12836 echo "Checking to see what happens if we set the stdio ptr..." >&4
12839 /* Can we scream? */
12840 /* Eat dust sed :-) */
12841 /* In the buffer space, no one can hear you scream. */
12842 #$i_stdlib I_STDLIB
12844 #include <stdlib.h>
12846 #define FILE_ptr(fp) $stdio_ptr
12847 #define FILE_cnt(fp) $stdio_cnt
12848 #include <sys/types.h>
12850 FILE *fp = fopen("try.c", "r");
12855 puts("Fail even to read");
12858 c = getc(fp); /* Read away the first # */
12860 puts("Fail even to read");
12864 18 <= FILE_cnt(fp) &&
12865 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12867 puts("Fail even to read");
12870 ptr = (char*) FILE_ptr(fp);
12871 cnt = (size_t)FILE_cnt(fp);
12873 FILE_ptr(fp) += 42;
12875 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12876 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12879 if (FILE_cnt(fp) <= 20) {
12880 printf ("Fail (<20 chars to test)");
12883 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12884 puts("Fail compare");
12887 if (cnt == FILE_cnt(fp)) {
12888 puts("Pass_unchanged");
12891 if (FILE_cnt(fp) == (cnt - 42)) {
12892 puts("Pass_changed");
12895 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12901 if eval $compile && $to try.c; then
12902 case `$run ./try` in
12904 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12905 d_stdio_ptr_lval_sets_cnt="$define" ;;
12907 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12908 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12910 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12912 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12915 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12921 : see if _base is also standard
12923 case "$d_stdstdio" in
12927 #$i_stdlib I_STDLIB
12929 #include <stdlib.h>
12931 #define FILE_base(fp) $stdio_base
12932 #define FILE_bufsiz(fp) $stdio_bufsiz
12934 FILE *fp = fopen("try.c", "r");
12937 19 <= FILE_bufsiz(fp) &&
12938 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12945 if eval $compile && $to try.c; then
12946 if $run ./try; then
12947 echo "And its _base field acts std."
12950 echo "But its _base field isn't std."
12953 echo "However, it seems to be lacking the _base field."
12961 : see if fast_stdio exists
12963 case "$d_stdstdio:$d_stdio_ptr_lval" in
12965 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12967 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12978 : see if fchdir exists
12979 set fchdir d_fchdir
12982 : see if fchmod exists
12983 set fchmod d_fchmod
12986 : see if fchown exists
12987 set fchown d_fchown
12990 : see if this is an fcntl system
12994 : See if fcntl-based locking works.
12997 #$i_stdlib I_STDLIB
12999 #include <stdlib.h>
13001 #include <unistd.h>
13003 #include <signal.h>
13004 $signal_t blech(int x) { exit(3); }
13006 #if defined(F_SETLK) && defined(F_SETLKW)
13007 struct flock flock;
13009 fd = open("try.c", O_RDONLY);
13010 flock.l_type = F_RDLCK;
13011 flock.l_whence = SEEK_SET;
13012 flock.l_start = flock.l_len = 0;
13013 signal(SIGALRM, blech);
13015 retval = fcntl(fd, F_SETLK, &flock);
13017 (retval < 0 ? exit(2) : exit(0));
13023 echo "Checking if fcntl-based file locking works... "
13027 if eval $compile_ok; then
13028 if $run ./try; then
13029 echo "Yes, it seems to work."
13032 echo "Nope, it didn't work."
13037 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13038 *** This is (almost) impossible.
13039 *** If your NFS lock daemons are not feeling well, something like
13040 *** this may happen, please investigate. Cannot continue, aborting.
13048 echo "I'm unable to compile the test program, so I'll assume not."
13053 echo "Nope, since you don't even have fcntl()."
13056 set d_fcntl_can_lock
13060 : check for fd_set items
13063 Checking to see how well your C compiler handles fd_set and friends ...
13066 #$i_stdlib I_STDLIB
13068 #include <stdlib.h>
13070 #$i_systime I_SYS_TIME
13071 #$i_sysselct I_SYS_SELECT
13072 #$d_socket HAS_SOCKET
13073 #include <sys/types.h>
13075 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13078 #include <sys/time.h>
13080 #ifdef I_SYS_SELECT
13081 #include <sys/select.h>
13090 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13098 if eval $compile; then
13099 d_fds_bits="$define"
13101 echo "Well, your system knows about the normal fd_set typedef..." >&4
13102 if $run ./try; then
13103 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13104 d_fd_macros="$define"
13107 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13109 d_fd_macros="$undef"
13113 Hmm, your compiler has some difficulty with fd_set. Checking further...
13116 if eval $compile; then
13117 d_fds_bits="$undef"
13119 echo "Well, your system has some sort of fd_set available..." >&4
13120 if $run ./try; then
13121 echo "and you have the normal fd_set macros." >&4
13122 d_fd_macros="$define"
13125 but not the normal fd_set macros! Gross! More work for me...
13127 d_fd_macros="$undef"
13130 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13132 d_fds_bits="$undef"
13133 d_fd_macros="$undef"
13138 : see if fgetpos exists
13139 set fgetpos d_fgetpos
13142 : see if finite exists
13143 set finite d_finite
13146 : see if finitel exists
13147 set finitel d_finitel
13150 : see if flock exists
13154 : see if prototype for flock is available
13156 set d_flockproto flock $i_sysfile sys/file.h
13159 : see if fp_class exists
13160 set fp_class d_fp_class
13163 : see if pathconf exists
13164 set pathconf d_pathconf
13167 : see if fpathconf exists
13168 set fpathconf d_fpathconf
13171 : see if fpclass exists
13172 set fpclass d_fpclass
13175 : see if fpclassify exists
13176 set fpclassify d_fpclassify
13179 : see if fpclassl exists
13180 set fpclassl d_fpclassl
13183 : check for fpos64_t
13185 echo "Checking to see if you have fpos64_t..." >&4
13188 int main() { fpos64_t x = 7; }
13191 if eval $compile; then
13193 echo "You have fpos64_t."
13196 echo "You do not have fpos64_t."
13197 case "$fpossize" in
13198 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13205 : see if frexpl exists
13206 set frexpl d_frexpl
13209 : see if this is a sys/param system
13210 set sys/param.h i_sysparam
13213 : see if this is a sys/mount.h system
13214 set sys/mount.h i_sysmount
13217 : Check for fs_data_s
13219 echo "Checking to see if your system supports struct fs_data..." >&4
13220 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13222 case "$d_fs_data_s" in
13223 "$define") echo "Yes, it does." ;;
13224 *) echo "No, it doesn't." ;;
13227 : see if fseeko exists
13228 set fseeko d_fseeko
13230 case "$longsize" in
13231 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13234 : see if fsetpos exists
13235 set fsetpos d_fsetpos
13238 : see if fstatfs exists
13239 set fstatfs d_fstatfs
13242 : see if statvfs exists
13243 set statvfs d_statvfs
13246 : see if fstatvfs exists
13247 set fstatvfs d_fstatvfs
13251 : see if fsync exists
13255 : see if ftello exists
13256 set ftello d_ftello
13258 case "$longsize" in
13259 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13262 : check for a working futimes
13265 echo "Checking if you have a working futimes()" >&4
13268 #include <sys/time.h>
13275 fd = open ("try.c", O_RDWR);
13276 if (-1 == fd) exit (1);
13277 rv = futimes (fd, NULL);
13278 exit (rv == -1 ? errno : 0);
13282 if eval $compile; then
13286 0) echo "Yes, you have" >&4
13287 d_futimes="$define"
13289 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13293 echo "No, it does not (probably harmless)" >&4
13297 : see if ndbm.h is available
13300 : Compatibility location for RedHat 7.1
13301 set gdbm/ndbm.h i_gdbmndbm
13303 : Compatibility location for Debian 4.0
13304 set gdbm-ndbm.h i_gdbm_ndbm
13308 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13309 : see if dbm_open exists
13310 set dbm_open d_dbm_open
13312 case "$d_dbm_open" in
13315 i_gdbmndbm="$undef"
13316 i_gdbm_ndbm="$undef"
13317 echo "We won't be including <ndbm.h>"
13327 ndbm_hdr_protochk='name=$1; hdr=$2;
13328 eval "ihdr=\$""i_$name";
13330 if $test "$ihdr" = "$define"; then
13331 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13332 case "$d_cplusplus" in
13333 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13334 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13337 $define) $echo "Your <$hdr> seems to have prototypes";;
13338 *) $echo "Your <$hdr> does not seem to have prototypes";;
13341 set "d_${name}_h_uses_prototypes";
13345 eval $ndbm_hdr_protochk
13346 set gdbmndbm gdbm/ndbm.h
13347 eval $ndbm_hdr_protochk
13348 set gdbm_ndbm gdbm-ndbm.h
13349 eval $ndbm_hdr_protochk
13351 : see if getcwd exists
13352 set getcwd d_getcwd
13355 : see if getespwnam exists
13356 set getespwnam d_getespwnam
13359 : see if getfsstat exists
13360 set getfsstat d_getfsstat
13363 : see if getgrent exists
13364 set getgrent d_getgrent
13367 : see if getgrent_r exists
13368 set getgrent_r d_getgrent_r
13370 case "$d_getgrent_r" in
13372 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13373 case "$d_getgrent_r_proto:$usethreads" in
13374 ":define") d_getgrent_r_proto=define
13375 set d_getgrent_r_proto getgrent_r $hdrs
13379 case "$d_getgrent_r_proto" in
13381 case "$getgrent_r_proto" in
13382 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13383 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13385 case "$getgrent_r_proto" in
13386 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13387 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13389 case "$getgrent_r_proto" in
13390 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13391 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13393 case "$getgrent_r_proto" in
13394 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13395 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13397 case "$getgrent_r_proto" in
13398 ''|0) try='int getgrent_r(struct group*, char*, int);'
13399 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13401 case "$getgrent_r_proto" in
13402 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13403 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13405 case "$getgrent_r_proto" in
13406 ''|0) d_getgrent_r=undef
13408 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13409 * ) case "$getgrent_r_proto" in
13410 REENTRANT_PROTO*) ;;
13411 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13413 echo "Prototype: $try" ;;
13416 *) case "$usethreads" in
13417 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13424 *) getgrent_r_proto=0
13428 : see if getgrgid_r exists
13429 set getgrgid_r d_getgrgid_r
13431 case "$d_getgrgid_r" in
13433 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13434 case "$d_getgrgid_r_proto:$usethreads" in
13435 ":define") d_getgrgid_r_proto=define
13436 set d_getgrgid_r_proto getgrgid_r $hdrs
13440 case "$d_getgrgid_r_proto" in
13442 case "$getgrgid_r_proto" in
13443 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13444 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13446 case "$getgrgid_r_proto" in
13447 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13448 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13450 case "$getgrgid_r_proto" in
13451 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13452 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13454 case "$getgrgid_r_proto" in
13455 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13456 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13458 case "$getgrgid_r_proto" in
13459 ''|0) d_getgrgid_r=undef
13461 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13462 * ) case "$getgrgid_r_proto" in
13463 REENTRANT_PROTO*) ;;
13464 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13466 echo "Prototype: $try" ;;
13469 *) case "$usethreads" in
13470 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13477 *) getgrgid_r_proto=0
13481 : see if getgrnam_r exists
13482 set getgrnam_r d_getgrnam_r
13484 case "$d_getgrnam_r" in
13486 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13487 case "$d_getgrnam_r_proto:$usethreads" in
13488 ":define") d_getgrnam_r_proto=define
13489 set d_getgrnam_r_proto getgrnam_r $hdrs
13493 case "$d_getgrnam_r_proto" in
13495 case "$getgrnam_r_proto" in
13496 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13497 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13499 case "$getgrnam_r_proto" in
13500 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13501 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13503 case "$getgrnam_r_proto" in
13504 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13505 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13507 case "$getgrnam_r_proto" in
13508 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13509 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13511 case "$getgrnam_r_proto" in
13512 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13513 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13515 case "$getgrnam_r_proto" in
13516 ''|0) d_getgrnam_r=undef
13518 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13519 * ) case "$getgrnam_r_proto" in
13520 REENTRANT_PROTO*) ;;
13521 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13523 echo "Prototype: $try" ;;
13526 *) case "$usethreads" in
13527 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13534 *) getgrnam_r_proto=0
13538 : see if gethostbyaddr exists
13539 set gethostbyaddr d_gethbyaddr
13542 : see if gethostbyname exists
13543 set gethostbyname d_gethbyname
13546 : see if gethostent exists
13547 set gethostent d_gethent
13550 : see how we will look up host name
13553 if set gethostname val -f d_gethname; eval $csym; $val; then
13554 echo 'gethostname() found.' >&4
13555 d_gethname="$define"
13558 if set uname val -f d_uname; eval $csym; $val; then
13561 uname() was found, but you're running xenix, and older versions of xenix
13562 have a broken uname(). If you don't really know whether your xenix is old
13563 enough to have a broken system call, use the default answer.
13568 "$define") dflt=n;;
13570 rp='Is your uname() broken?'
13573 n*) d_uname="$define"; call=uname;;
13576 echo 'uname() found.' >&4
13583 case "$d_gethname" in
13584 '') d_gethname="$undef";;
13587 '') d_uname="$undef";;
13589 case "$d_uname$d_gethname" in
13594 Every now and then someone has a $call() that lies about the hostname
13595 but can't be fixed for political or economic reasons. If you wish, I can
13596 pretend $call() isn't there and maybe compute hostname at run-time
13597 thanks to the '$phostname' command.
13600 rp="Shall I ignore $call() from now on?"
13603 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13606 case "$phostname" in
13607 '') aphostname='';;
13608 *) case "$aphostname" in
13610 *) set X $phostname
13614 file=`./loc $file $file $pth`
13615 aphostname=`echo $file $*`
13620 case "$d_uname$d_gethname" in
13623 case "$phostname" in
13625 echo "There will be no way for $package to get your hostname." >&4;;
13627 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13631 case "$d_phostname" in
13632 '') d_phostname="$undef";;
13635 : see if gethostbyaddr_r exists
13636 set gethostbyaddr_r d_gethostbyaddr_r
13638 case "$d_gethostbyaddr_r" in
13640 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13641 case "$d_gethostbyaddr_r_proto:$usethreads" in
13642 ":define") d_gethostbyaddr_r_proto=define
13643 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13647 case "$d_gethostbyaddr_r_proto" in
13649 case "$gethostbyaddr_r_proto" in
13650 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13651 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13653 case "$gethostbyaddr_r_proto" in
13654 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13655 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13657 case "$gethostbyaddr_r_proto" in
13658 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13659 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13661 case "$gethostbyaddr_r_proto" in
13662 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13663 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13665 case "$gethostbyaddr_r_proto" in
13666 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13667 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13669 case "$gethostbyaddr_r_proto" in
13670 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13671 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13673 case "$gethostbyaddr_r_proto" in
13674 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13675 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13677 case "$gethostbyaddr_r_proto" in
13678 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13679 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13681 case "$gethostbyaddr_r_proto" in
13682 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13683 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13685 case "$gethostbyaddr_r_proto" in
13686 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13687 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13689 case "$gethostbyaddr_r_proto" in
13690 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13691 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13693 case "$gethostbyaddr_r_proto" in
13694 ''|0) d_gethostbyaddr_r=undef
13695 gethostbyaddr_r_proto=0
13696 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13697 * ) case "$gethostbyaddr_r_proto" in
13698 REENTRANT_PROTO*) ;;
13699 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13701 echo "Prototype: $try" ;;
13704 *) case "$usethreads" in
13705 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13707 d_gethostbyaddr_r=undef
13708 gethostbyaddr_r_proto=0
13712 *) gethostbyaddr_r_proto=0
13716 : see if gethostbyname_r exists
13717 set gethostbyname_r d_gethostbyname_r
13719 case "$d_gethostbyname_r" in
13721 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13722 case "$d_gethostbyname_r_proto:$usethreads" in
13723 ":define") d_gethostbyname_r_proto=define
13724 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13728 case "$d_gethostbyname_r_proto" in
13730 case "$gethostbyname_r_proto" in
13731 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13732 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13734 case "$gethostbyname_r_proto" in
13735 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13736 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13738 case "$gethostbyname_r_proto" in
13739 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13740 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13742 case "$gethostbyname_r_proto" in
13743 ''|0) d_gethostbyname_r=undef
13744 gethostbyname_r_proto=0
13745 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13746 * ) case "$gethostbyname_r_proto" in
13747 REENTRANT_PROTO*) ;;
13748 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13750 echo "Prototype: $try" ;;
13753 *) case "$usethreads" in
13754 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13756 d_gethostbyname_r=undef
13757 gethostbyname_r_proto=0
13761 *) gethostbyname_r_proto=0
13765 : see if gethostent_r exists
13766 set gethostent_r d_gethostent_r
13768 case "$d_gethostent_r" in
13770 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13771 case "$d_gethostent_r_proto:$usethreads" in
13772 ":define") d_gethostent_r_proto=define
13773 set d_gethostent_r_proto gethostent_r $hdrs
13777 case "$d_gethostent_r_proto" in
13779 case "$gethostent_r_proto" in
13780 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13781 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13783 case "$gethostent_r_proto" in
13784 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13785 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13787 case "$gethostent_r_proto" in
13788 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13789 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13791 case "$gethostent_r_proto" in
13792 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13793 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13795 case "$gethostent_r_proto" in
13796 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13797 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13799 case "$gethostent_r_proto" in
13800 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13801 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13803 case "$gethostent_r_proto" in
13804 ''|0) d_gethostent_r=undef
13805 gethostent_r_proto=0
13806 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13807 * ) case "$gethostent_r_proto" in
13808 REENTRANT_PROTO*) ;;
13809 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13811 echo "Prototype: $try" ;;
13814 *) case "$usethreads" in
13815 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13817 d_gethostent_r=undef
13818 gethostent_r_proto=0
13822 *) gethostent_r_proto=0
13826 : see if prototypes for various gethostxxx netdb.h functions are available
13828 set d_gethostprotos gethostent $i_netdb netdb.h
13831 : see if getitimer exists
13832 set getitimer d_getitimer
13835 : see if getlogin exists
13836 set getlogin d_getlogin
13839 : see if getlogin_r exists
13840 set getlogin_r d_getlogin_r
13842 case "$d_getlogin_r" in
13844 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13845 case "$d_getlogin_r_proto:$usethreads" in
13846 ":define") d_getlogin_r_proto=define
13847 set d_getlogin_r_proto getlogin_r $hdrs
13851 case "$d_getlogin_r_proto" in
13853 case "$getlogin_r_proto" in
13854 ''|0) try='int getlogin_r(char*, size_t);'
13855 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13857 case "$getlogin_r_proto" in
13858 ''|0) try='int getlogin_r(char*, int);'
13859 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13861 case "$getlogin_r_proto" in
13862 ''|0) try='char* getlogin_r(char*, size_t);'
13863 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13865 case "$getlogin_r_proto" in
13866 ''|0) try='char* getlogin_r(char*, int);'
13867 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13869 case "$getlogin_r_proto" in
13870 ''|0) d_getlogin_r=undef
13872 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13873 * ) case "$getlogin_r_proto" in
13874 REENTRANT_PROTO*) ;;
13875 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13877 echo "Prototype: $try" ;;
13880 *) case "$usethreads" in
13881 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13888 *) getlogin_r_proto=0
13892 : see if getmnt exists
13893 set getmnt d_getmnt
13896 : see if getmntent exists
13897 set getmntent d_getmntent
13900 : see if getnetbyaddr exists
13901 set getnetbyaddr d_getnbyaddr
13904 : see if getnetbyname exists
13905 set getnetbyname d_getnbyname
13908 : see if getnetent exists
13909 set getnetent d_getnent
13912 : see if getnetbyaddr_r exists
13913 set getnetbyaddr_r d_getnetbyaddr_r
13915 case "$d_getnetbyaddr_r" in
13917 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13918 case "$d_getnetbyaddr_r_proto:$usethreads" in
13919 ":define") d_getnetbyaddr_r_proto=define
13920 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13924 case "$d_getnetbyaddr_r_proto" in
13926 case "$getnetbyaddr_r_proto" in
13927 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13928 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13930 case "$getnetbyaddr_r_proto" in
13931 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13932 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13934 case "$getnetbyaddr_r_proto" in
13935 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13936 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13938 case "$getnetbyaddr_r_proto" in
13939 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13940 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13942 case "$getnetbyaddr_r_proto" in
13943 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13944 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13946 case "$getnetbyaddr_r_proto" in
13947 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13948 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13950 case "$getnetbyaddr_r_proto" in
13951 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13952 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13954 case "$getnetbyaddr_r_proto" in
13955 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13956 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13958 case "$getnetbyaddr_r_proto" in
13959 ''|0) d_getnetbyaddr_r=undef
13960 getnetbyaddr_r_proto=0
13961 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13962 * ) case "$getnetbyaddr_r_proto" in
13963 REENTRANT_PROTO*) ;;
13964 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13966 echo "Prototype: $try" ;;
13969 *) case "$usethreads" in
13970 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13972 d_getnetbyaddr_r=undef
13973 getnetbyaddr_r_proto=0
13977 *) getnetbyaddr_r_proto=0
13981 : see if getnetbyname_r exists
13982 set getnetbyname_r d_getnetbyname_r
13984 case "$d_getnetbyname_r" in
13986 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13987 case "$d_getnetbyname_r_proto:$usethreads" in
13988 ":define") d_getnetbyname_r_proto=define
13989 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13993 case "$d_getnetbyname_r_proto" in
13995 case "$getnetbyname_r_proto" in
13996 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13997 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13999 case "$getnetbyname_r_proto" in
14000 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14001 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14003 case "$getnetbyname_r_proto" in
14004 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14005 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14007 case "$getnetbyname_r_proto" in
14008 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14009 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14011 case "$getnetbyname_r_proto" in
14012 ''|0) d_getnetbyname_r=undef
14013 getnetbyname_r_proto=0
14014 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14015 * ) case "$getnetbyname_r_proto" in
14016 REENTRANT_PROTO*) ;;
14017 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14019 echo "Prototype: $try" ;;
14022 *) case "$usethreads" in
14023 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14025 d_getnetbyname_r=undef
14026 getnetbyname_r_proto=0
14030 *) getnetbyname_r_proto=0
14034 : see if getnetent_r exists
14035 set getnetent_r d_getnetent_r
14037 case "$d_getnetent_r" in
14039 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14040 case "$d_getnetent_r_proto:$usethreads" in
14041 ":define") d_getnetent_r_proto=define
14042 set d_getnetent_r_proto getnetent_r $hdrs
14046 case "$d_getnetent_r_proto" in
14048 case "$getnetent_r_proto" in
14049 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14050 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14052 case "$getnetent_r_proto" in
14053 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14054 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14056 case "$getnetent_r_proto" in
14057 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14058 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14060 case "$getnetent_r_proto" in
14061 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14062 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14064 case "$getnetent_r_proto" in
14065 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14066 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14068 case "$getnetent_r_proto" in
14069 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14070 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14072 case "$getnetent_r_proto" in
14073 ''|0) d_getnetent_r=undef
14074 getnetent_r_proto=0
14075 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14076 * ) case "$getnetent_r_proto" in
14077 REENTRANT_PROTO*) ;;
14078 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14080 echo "Prototype: $try" ;;
14083 *) case "$usethreads" in
14084 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14086 d_getnetent_r=undef
14087 getnetent_r_proto=0
14091 *) getnetent_r_proto=0
14095 : see if prototypes for various getnetxxx netdb.h functions are available
14097 set d_getnetprotos getnetent $i_netdb netdb.h
14100 : see if getpagesize exists
14101 set getpagesize d_getpagsz
14104 : Optional checks for getprotobyname and getprotobynumber
14106 : see if getprotobyname exists
14107 set getprotobyname d_getpbyname
14110 : see if getprotobynumber exists
14111 set getprotobynumber d_getpbynumber
14114 : see if getprotoent exists
14115 set getprotoent d_getpent
14118 : see if getpgid exists
14119 set getpgid d_getpgid
14122 : see if getpgrp2 exists
14123 set getpgrp2 d_getpgrp2
14126 : see if getppid exists
14127 set getppid d_getppid
14130 : see if getpriority exists
14131 set getpriority d_getprior
14134 : see if getprotobyname_r exists
14135 set getprotobyname_r d_getprotobyname_r
14137 case "$d_getprotobyname_r" in
14139 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14140 case "$d_getprotobyname_r_proto:$usethreads" in
14141 ":define") d_getprotobyname_r_proto=define
14142 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14146 case "$d_getprotobyname_r_proto" in
14148 case "$getprotobyname_r_proto" in
14149 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14150 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14152 case "$getprotobyname_r_proto" in
14153 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14154 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14156 case "$getprotobyname_r_proto" in
14157 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14158 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14160 case "$getprotobyname_r_proto" in
14161 ''|0) d_getprotobyname_r=undef
14162 getprotobyname_r_proto=0
14163 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14164 * ) case "$getprotobyname_r_proto" in
14165 REENTRANT_PROTO*) ;;
14166 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14168 echo "Prototype: $try" ;;
14171 *) case "$usethreads" in
14172 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14174 d_getprotobyname_r=undef
14175 getprotobyname_r_proto=0
14179 *) getprotobyname_r_proto=0
14183 : see if getprotobynumber_r exists
14184 set getprotobynumber_r d_getprotobynumber_r
14186 case "$d_getprotobynumber_r" in
14188 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14189 case "$d_getprotobynumber_r_proto:$usethreads" in
14190 ":define") d_getprotobynumber_r_proto=define
14191 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14195 case "$d_getprotobynumber_r_proto" in
14197 case "$getprotobynumber_r_proto" in
14198 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14199 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14201 case "$getprotobynumber_r_proto" in
14202 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14203 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14205 case "$getprotobynumber_r_proto" in
14206 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14207 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14209 case "$getprotobynumber_r_proto" in
14210 ''|0) d_getprotobynumber_r=undef
14211 getprotobynumber_r_proto=0
14212 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14213 * ) case "$getprotobynumber_r_proto" in
14214 REENTRANT_PROTO*) ;;
14215 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14217 echo "Prototype: $try" ;;
14220 *) case "$usethreads" in
14221 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14223 d_getprotobynumber_r=undef
14224 getprotobynumber_r_proto=0
14228 *) getprotobynumber_r_proto=0
14232 : see if getprotoent_r exists
14233 set getprotoent_r d_getprotoent_r
14235 case "$d_getprotoent_r" in
14237 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14238 case "$d_getprotoent_r_proto:$usethreads" in
14239 ":define") d_getprotoent_r_proto=define
14240 set d_getprotoent_r_proto getprotoent_r $hdrs
14244 case "$d_getprotoent_r_proto" in
14246 case "$getprotoent_r_proto" in
14247 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14248 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14250 case "$getprotoent_r_proto" in
14251 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14252 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14254 case "$getprotoent_r_proto" in
14255 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14256 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14258 case "$getprotoent_r_proto" in
14259 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14260 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14262 case "$getprotoent_r_proto" in
14263 ''|0) d_getprotoent_r=undef
14264 getprotoent_r_proto=0
14265 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14266 * ) case "$getprotoent_r_proto" in
14267 REENTRANT_PROTO*) ;;
14268 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14270 echo "Prototype: $try" ;;
14273 *) case "$usethreads" in
14274 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14276 d_getprotoent_r=undef
14277 getprotoent_r_proto=0
14281 *) getprotoent_r_proto=0
14285 : see if prototypes for various getprotoxxx netdb.h functions are available
14287 set d_getprotoprotos getprotoent $i_netdb netdb.h
14290 : see if getprpwnam exists
14291 set getprpwnam d_getprpwnam
14294 : see if getpwent exists
14295 set getpwent d_getpwent
14298 : see if getpwent_r exists
14299 set getpwent_r d_getpwent_r
14301 case "$d_getpwent_r" in
14303 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14304 case "$d_getpwent_r_proto:$usethreads" in
14305 ":define") d_getpwent_r_proto=define
14306 set d_getpwent_r_proto getpwent_r $hdrs
14310 case "$d_getpwent_r_proto" in
14312 case "$getpwent_r_proto" in
14313 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14314 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14316 case "$getpwent_r_proto" in
14317 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14318 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14320 case "$getpwent_r_proto" in
14321 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14322 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14324 case "$getpwent_r_proto" in
14325 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14326 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14328 case "$getpwent_r_proto" in
14329 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14330 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14332 case "$getpwent_r_proto" in
14333 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14334 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14336 case "$getpwent_r_proto" in
14337 ''|0) d_getpwent_r=undef
14339 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14340 * ) case "$getpwent_r_proto" in
14341 REENTRANT_PROTO*) ;;
14342 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14344 echo "Prototype: $try" ;;
14347 *) case "$usethreads" in
14348 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14355 *) getpwent_r_proto=0
14359 : see if getpwnam_r exists
14360 set getpwnam_r d_getpwnam_r
14362 case "$d_getpwnam_r" in
14364 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14365 case "$d_getpwnam_r_proto:$usethreads" in
14366 ":define") d_getpwnam_r_proto=define
14367 set d_getpwnam_r_proto getpwnam_r $hdrs
14371 case "$d_getpwnam_r_proto" in
14373 case "$getpwnam_r_proto" in
14374 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14375 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14377 case "$getpwnam_r_proto" in
14378 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14379 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14381 case "$getpwnam_r_proto" in
14382 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14383 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14385 case "$getpwnam_r_proto" in
14386 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14387 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14389 case "$getpwnam_r_proto" in
14390 ''|0) d_getpwnam_r=undef
14392 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14393 * ) case "$getpwnam_r_proto" in
14394 REENTRANT_PROTO*) ;;
14395 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14397 echo "Prototype: $try" ;;
14400 *) case "$usethreads" in
14401 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14408 *) getpwnam_r_proto=0
14412 : see if getpwuid_r exists
14413 set getpwuid_r d_getpwuid_r
14415 case "$d_getpwuid_r" in
14417 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14418 case "$d_getpwuid_r_proto:$usethreads" in
14419 ":define") d_getpwuid_r_proto=define
14420 set d_getpwuid_r_proto getpwuid_r $hdrs
14424 case "$d_getpwuid_r_proto" in
14426 case "$getpwuid_r_proto" in
14427 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14428 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14430 case "$getpwuid_r_proto" in
14431 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14432 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14434 case "$getpwuid_r_proto" in
14435 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14436 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14438 case "$getpwuid_r_proto" in
14439 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14440 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14442 case "$getpwuid_r_proto" in
14443 ''|0) d_getpwuid_r=undef
14445 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14446 * ) case "$getpwuid_r_proto" in
14447 REENTRANT_PROTO*) ;;
14448 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14450 echo "Prototype: $try" ;;
14453 *) case "$usethreads" in
14454 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14461 *) getpwuid_r_proto=0
14465 : Optional checks for getsbyname and getsbyport
14467 : see if getservbyname exists
14468 set getservbyname d_getsbyname
14471 : see if getservbyport exists
14472 set getservbyport d_getsbyport
14475 : see if getservent exists
14476 set getservent d_getsent
14479 : see if getservbyname_r exists
14480 set getservbyname_r d_getservbyname_r
14482 case "$d_getservbyname_r" in
14484 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14485 case "$d_getservbyname_r_proto:$usethreads" in
14486 ":define") d_getservbyname_r_proto=define
14487 set d_getservbyname_r_proto getservbyname_r $hdrs
14491 case "$d_getservbyname_r_proto" in
14493 case "$getservbyname_r_proto" in
14494 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14495 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14497 case "$getservbyname_r_proto" in
14498 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14499 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14501 case "$getservbyname_r_proto" in
14502 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14503 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14505 case "$getservbyname_r_proto" in
14506 ''|0) d_getservbyname_r=undef
14507 getservbyname_r_proto=0
14508 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14509 * ) case "$getservbyname_r_proto" in
14510 REENTRANT_PROTO*) ;;
14511 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14513 echo "Prototype: $try" ;;
14516 *) case "$usethreads" in
14517 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14519 d_getservbyname_r=undef
14520 getservbyname_r_proto=0
14524 *) getservbyname_r_proto=0
14528 : see if getservbyport_r exists
14529 set getservbyport_r d_getservbyport_r
14531 case "$d_getservbyport_r" in
14533 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14534 case "$d_getservbyport_r_proto:$usethreads" in
14535 ":define") d_getservbyport_r_proto=define
14536 set d_getservbyport_r_proto getservbyport_r $hdrs
14540 case "$d_getservbyport_r_proto" in
14542 case "$getservbyport_r_proto" in
14543 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14544 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14546 case "$getservbyport_r_proto" in
14547 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14548 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14550 case "$getservbyport_r_proto" in
14551 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14552 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14554 case "$getservbyport_r_proto" in
14555 ''|0) d_getservbyport_r=undef
14556 getservbyport_r_proto=0
14557 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14558 * ) case "$getservbyport_r_proto" in
14559 REENTRANT_PROTO*) ;;
14560 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14562 echo "Prototype: $try" ;;
14565 *) case "$usethreads" in
14566 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14568 d_getservbyport_r=undef
14569 getservbyport_r_proto=0
14573 *) getservbyport_r_proto=0
14577 : see if getservent_r exists
14578 set getservent_r d_getservent_r
14580 case "$d_getservent_r" in
14582 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14583 case "$d_getservent_r_proto:$usethreads" in
14584 ":define") d_getservent_r_proto=define
14585 set d_getservent_r_proto getservent_r $hdrs
14589 case "$d_getservent_r_proto" in
14591 case "$getservent_r_proto" in
14592 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14593 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14595 case "$getservent_r_proto" in
14596 ''|0) try='int getservent_r(struct servent*, char*, int);'
14597 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14599 case "$getservent_r_proto" in
14600 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14601 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14603 case "$getservent_r_proto" in
14604 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14605 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14607 case "$getservent_r_proto" in
14608 ''|0) d_getservent_r=undef
14609 getservent_r_proto=0
14610 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14611 * ) case "$getservent_r_proto" in
14612 REENTRANT_PROTO*) ;;
14613 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14615 echo "Prototype: $try" ;;
14618 *) case "$usethreads" in
14619 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14621 d_getservent_r=undef
14622 getservent_r_proto=0
14626 *) getservent_r_proto=0
14630 : see if prototypes for various getservxxx netdb.h functions are available
14632 set d_getservprotos getservent $i_netdb netdb.h
14635 : see if getspnam exists
14636 set getspnam d_getspnam
14639 : see if this is a shadow.h system
14640 set shadow.h i_shadow
14643 : see if getspnam_r exists
14644 set getspnam_r d_getspnam_r
14646 case "$d_getspnam_r" in
14648 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14649 case "$d_getspnam_r_proto:$usethreads" in
14650 ":define") d_getspnam_r_proto=define
14651 set d_getspnam_r_proto getspnam_r $hdrs
14655 case "$d_getspnam_r_proto" in
14657 case "$getspnam_r_proto" in
14658 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14659 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14661 case "$getspnam_r_proto" in
14662 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14663 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14665 case "$getspnam_r_proto" in
14666 ''|0) d_getspnam_r=undef
14668 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14669 * ) case "$getspnam_r_proto" in
14670 REENTRANT_PROTO*) ;;
14671 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14673 echo "Prototype: $try" ;;
14676 *) case "$usethreads" in
14677 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14684 *) getspnam_r_proto=0
14688 : see if gettimeofday or ftime exists
14689 set gettimeofday d_gettimeod
14691 case "$d_gettimeod" in
14697 val="$undef"; set d_ftime; eval $setvar
14700 case "$d_gettimeod$d_ftime" in
14703 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14707 : see if gmtime_r exists
14708 set gmtime_r d_gmtime_r
14710 case "$d_gmtime_r" in
14712 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14713 case "$d_gmtime_r_proto:$usethreads" in
14714 ":define") d_gmtime_r_proto=define
14715 set d_gmtime_r_proto gmtime_r $hdrs
14719 case "$d_gmtime_r_proto" in
14721 case "$gmtime_r_proto" in
14722 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14723 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14725 case "$gmtime_r_proto" in
14726 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14727 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14729 case "$gmtime_r_proto" in
14730 ''|0) d_gmtime_r=undef
14732 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14733 * ) case "$gmtime_r_proto" in
14734 REENTRANT_PROTO*) ;;
14735 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14737 echo "Prototype: $try" ;;
14740 *) case "$usethreads" in
14741 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14748 *) gmtime_r_proto=0
14752 : see if hasmntopt exists
14753 set hasmntopt d_hasmntopt
14756 : see if this is a netinet/in.h or sys/in.h system
14757 set netinet/in.h i_niin sys/in.h i_sysin
14760 : see if arpa/inet.h has to be included
14761 set arpa/inet.h i_arpainet
14764 : see if htonl --and friends-- exists
14769 : Maybe they are macros.
14772 $cat >htonl.c <<EOM
14774 #include <sys/types.h>
14775 #$i_niin I_NETINET_IN
14777 #$i_arpainet I_ARPA_INET
14778 #ifdef I_NETINET_IN
14779 #include <netinet/in.h>
14782 #include <sys/in.h>
14785 #include <arpa/inet.h>
14788 printf("Defined as a macro.");
14791 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14792 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14794 echo "But it seems to be defined as a macro." >&4
14802 : see if ilogbl exists
14803 set ilogbl d_ilogbl
14808 if set index val -f; eval $csym; $val; then
14809 if set strchr val -f d_strchr; eval $csym; $val; then
14810 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14813 echo "strchr() found." >&4
14817 echo "index() found." >&4
14822 echo "index() found." >&4
14825 if set strchr val -f d_strchr; eval $csym; $val; then
14828 echo "strchr() found." >&4
14830 echo "No index() or strchr() found!" >&4
14835 set d_strchr; eval $setvar
14837 set d_index; eval $setvar
14839 : check whether inet_aton exists
14840 set inet_aton d_inetaton
14845 $cat >isascii.c <<EOCP
14848 #$i_stdlib I_STDLIB
14850 #include <stdlib.h>
14861 if eval $compile; then
14862 echo "isascii() found." >&4
14865 echo "isascii() NOT found." >&4
14872 : see if isfinite exists
14873 set isfinite d_isfinite
14876 : see if isinf exists
14880 : see if isnan exists
14884 : see if isnanl exists
14885 set isnanl d_isnanl
14888 : see if killpg exists
14889 set killpg d_killpg
14892 : see if lchown exists
14894 $cat > try.c <<'EOCP'
14895 /* System header to define __stub macros and hopefully few prototypes,
14896 which can conflict with char lchown(); below. */
14897 #include <assert.h>
14898 /* Override any gcc2 internal prototype to avoid an error. */
14899 /* We use char because int might match the return type of a gcc2
14900 builtin and then its argument prototype would still apply. */
14903 /* The GNU C library defines this for functions which it implements
14904 to always fail with ENOSYS. Some functions are actually named
14905 something starting with __ and the normal name is an alias. */
14906 #if defined (__stub_lchown) || defined (__stub___lchown)
14914 if eval $compile; then
14915 $echo "lchown() found." >&4
14918 $echo "lchown() NOT found." >&4
14924 : See if number of significant digits in a double precision number is known
14926 $cat >ldbl_dig.c <<EOM
14927 #$i_limits I_LIMITS
14930 #include <limits.h>
14936 printf("Contains LDBL_DIG");
14939 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14940 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14941 echo "LDBL_DIG found." >&4
14944 echo "LDBL_DIG NOT found." >&4
14951 : see if this is a math.h system
14955 : check to see if math.h defines _LIB_VERSION
14956 d_libm_lib_version="$undef"
14960 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14962 #include <unistd.h>
14964 int main (int argc, char *argv[])
14966 printf ("%d\n", _LIB_VERSION);
14971 if eval $compile; then
14973 echo "Yes, it does ($foo)" >&4
14974 d_libm_lib_version="$define"
14976 echo "No, it does not (probably harmless)" >&4
14983 : see if link exists
14987 : see if localtime_r exists
14988 set localtime_r d_localtime_r
14990 case "$d_localtime_r" in
14992 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14993 case "$d_localtime_r_proto:$usethreads" in
14994 ":define") d_localtime_r_proto=define
14995 set d_localtime_r_proto localtime_r $hdrs
14999 case "$d_localtime_r_proto" in
15001 case "$localtime_r_proto" in
15002 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15003 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15005 case "$localtime_r_proto" in
15006 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15007 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15009 case "$localtime_r_proto" in
15010 ''|0) d_localtime_r=undef
15011 localtime_r_proto=0
15012 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15013 * ) case "$localtime_r_proto" in
15014 REENTRANT_PROTO*) ;;
15015 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15017 echo "Prototype: $try" ;;
15020 *) case "$usethreads" in
15021 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15023 d_localtime_r=undef
15024 localtime_r_proto=0
15028 *) localtime_r_proto=0
15032 : see if localtime_r calls tzset
15033 case "$localtime_r_proto" in
15036 /* Does our libc's localtime_r call tzset ?
15037 * return 0 if so, 1 otherwise.
15039 #$i_systypes I_SYS_TYPES
15040 #$i_unistd I_UNISTD
15042 #$i_stdlib I_STDLIB
15043 #$i_string I_STRING
15044 #$i_malloc I_MALLOC
15046 # include <sys/types.h>
15049 # include <unistd.h>
15055 #include <stdlib.h>
15058 # include <string.h>
15060 # include <strings.h>
15063 # include <malloc.h>
15067 time_t t = time(0L);
15068 char w_tz[]="TZ" "=GMT+5",
15069 e_tz[]="TZ" "=GMT-5",
15070 *tz_e = (char*)malloc(16),
15071 *tz_w = (char*)malloc(16);
15072 struct tm tm_e, tm_w;
15073 memset(&tm_e,'\0',sizeof(struct tm));
15074 memset(&tm_w,'\0',sizeof(struct tm));
15079 localtime_r(&t, &tm_e);
15082 localtime_r(&t, &tm_w);
15084 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15090 if eval $compile; then
15091 if $run ./try; then
15092 d_localtime_r_needs_tzset=undef;
15094 d_localtime_r_needs_tzset=define;
15097 d_localtime_r_needs_tzset=undef;
15101 d_localtime_r_needs_tzset=undef;
15106 : see if localeconv exists
15107 set localeconv d_locconv
15110 : see if lockf exists
15114 : see if prototype for lseek is available
15116 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15119 : see if lstat exists
15123 : see if madvise exists
15124 set madvise d_madvise
15127 : see if malloc_size exists
15128 set malloc_size d_malloc_size
15131 : see if malloc_size_good exists
15132 set malloc_good_size d_malloc_good_size
15135 : see if mblen exists
15139 : see if mbstowcs exists
15140 set mbstowcs d_mbstowcs
15143 : see if mbtowc exists
15144 set mbtowc d_mbtowc
15147 : see if memchr exists
15148 set memchr d_memchr
15151 : see if memcmp exists
15152 set memcmp d_memcmp
15155 : see if memcpy exists
15156 set memcpy d_memcpy
15159 : see if memmove exists
15160 set memmove d_memmove
15163 : see if memset exists
15164 set memset d_memset
15167 : see if mkdir exists
15171 : see if mkdtemp exists
15172 set mkdtemp d_mkdtemp
15175 : see if mkfifo exists
15176 set mkfifo d_mkfifo
15179 : see if mkstemp exists
15180 set mkstemp d_mkstemp
15183 : see if mkstemps exists
15184 set mkstemps d_mkstemps
15187 : see if mktime exists
15188 set mktime d_mktime
15191 : see if this is a sys/mman.h system
15192 set sys/mman.h i_sysmman
15195 : see if mmap exists
15198 : see what shmat returns
15199 : default to something harmless
15201 case "$i_sysmman$d_mmap" in
15203 $cat >mmap.c <<'END'
15204 #include <sys/mman.h>
15207 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15212 echo "and it returns ($mmaptype)." >&4
15218 : see if sqrtl exists
15222 : see if scalbnl exists
15223 set scalbnl d_scalbnl
15226 : see if modfl exists
15230 : see if prototype for modfl is available
15232 set d_modflproto modfl $i_math math.h
15235 d_modfl_pow32_bug="$undef"
15237 case "$d_longdbl$d_modfl" in
15240 Checking to see whether your modfl() is okay for large values...
15246 if $test "X$d_modflproto" != "X$define"; then
15247 $cat >>try.c <<EOCP
15248 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15249 long double modfl (long double, long double *);
15252 $cat >>try.c <<EOCP
15254 long double nv = 4294967303.15;
15260 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15264 case "$osname:$gccversion" in
15265 aix:) saveccflags="$ccflags"
15266 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15269 if eval $compile; then
15272 *" 4294967303.150000 1.150000 4294967302.000000")
15273 echo >&4 "Your modfl() is broken for large values."
15274 d_modfl_pow32_bug="$define"
15276 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15280 *" 4294967303.150000 0.150000 4294967303.000000")
15281 echo >&4 "Your modfl() seems okay for large values."
15283 *) echo >&4 "I don't understand your modfl() at all."
15289 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15292 case "$osname:$gccversion" in
15293 aix:) ccflags="$saveccflags" ;; # restore
15298 if $test "$uselongdouble" = "$define"; then
15300 if $test "$d_sqrtl" != "$define"; then
15301 message="$message sqrtl"
15303 if $test "$d_modfl" != "$define"; then
15304 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15305 echo "You have both aintl and copysignl, so I can emulate modfl."
15307 message="$message modfl"
15310 if $test "$d_frexpl" != "$define"; then
15311 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15312 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15314 message="$message frexpl"
15318 if $test "$message" != ""; then
15321 *** You requested the use of long doubles but you do not seem to have
15322 *** the following mathematical functions needed for long double support:
15324 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15325 *** Cannot continue, aborting.
15333 : see if mprotect exists
15334 set mprotect d_mprotect
15337 : see if msgctl exists
15338 set msgctl d_msgctl
15341 : see if msgget exists
15342 set msgget d_msgget
15345 : see if msgsnd exists
15346 set msgsnd d_msgsnd
15349 : see if msgrcv exists
15350 set msgrcv d_msgrcv
15353 : see how much of the 'msg*(2)' library is present.
15356 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15357 *"$undef"*) h_msg=false;;
15361 case "`ipcs 2>&1`" in
15362 "SVID messages"*"not configured"*)
15363 echo "Your $osname does not have the msg*(2) configured." >&4
15366 set msgctl d_msgctl
15368 set msgget d_msgget
15370 set msgsnd d_msgsnd
15372 set msgrcv d_msgrcv
15378 : we could also check for sys/ipc.h ...
15379 if $h_msg && $test `./findhdr sys/msg.h`; then
15380 echo "You have the full msg*(2) library." >&4
15383 echo "You don't have the full msg*(2) library." >&4
15389 : Check for msghdr_s
15391 echo "Checking to see if your system supports struct msghdr..." >&4
15392 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15394 case "$d_msghdr_s" in
15395 "$define") echo "Yes, it does." ;;
15396 *) echo "No, it doesn't." ;;
15400 : see if msync exists
15404 : see if munmap exists
15405 set munmap d_munmap
15408 : see if nice exists
15412 : see if this is a langinfo.h system
15413 set langinfo.h i_langinfo
15416 : see if nl_langinfo exists
15417 set nl_langinfo d_nl_langinfo
15420 : check for volatile keyword
15422 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15423 $cat >try.c <<'EOCP'
15426 typedef struct _goo_struct goo_struct;
15427 goo_struct * volatile goo = ((goo_struct *)0);
15428 struct _goo_struct {
15433 typedef unsigned short foo_t;
15434 char *volatile foo;
15436 volatile foo_t blech;
15440 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15442 echo "Yup, it does."
15445 echo "Nope, it doesn't."
15451 : Check basic sizes
15453 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15455 case "$use64bitint:$d_quad:$quadtype" in
15458 uvtype="$uquadtype"
15463 uvtype="unsigned long"
15469 case "$uselongdouble:$d_longdbl" in
15471 nvtype="long double"
15472 nvsize=$longdblsize
15479 $echo "(IV will be "$ivtype", $ivsize bytes)"
15480 $echo "(UV will be "$uvtype", $uvsize bytes)"
15481 $echo "(NV will be "$nvtype", $nvsize bytes)"
15484 #$i_inttypes I_INTTYPES
15486 #include <inttypes.h>
15491 int8_t i = INT8_MAX;
15492 uint8_t u = UINT8_MAX;
15493 printf("int8_t\n");
15496 int16_t i = INT16_MAX;
15497 uint16_t i = UINT16_MAX;
15498 printf("int16_t\n");
15501 int32_t i = INT32_MAX;
15502 uint32_t u = UINT32_MAX;
15503 printf("int32_t\n");
15508 i8type="signed char"
15509 u8type="unsigned char"
15514 '') case "$shortsize" in
15516 u16type="unsigned short"
15524 '') set try -DINT16
15525 if eval $compile; then
15526 case "`$run ./try`" in
15538 '') if $test $shortsize -ge 2; then
15540 u16type="unsigned short"
15548 '') case "$longsize" in
15550 u32type="unsigned long"
15554 *) case "$intsize" in
15556 u32type="unsigned int"
15566 '') set try -DINT32
15567 if eval $compile; then
15568 case "`$run ./try`" in
15580 '') if $test $intsize -ge 4; then
15582 u32type="unsigned int"
15590 '') case "$d_quad:$quadtype" in
15592 i64type="$quadtype"
15593 u64type="$uquadtype"
15601 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15602 : volatile so that the compiler has to store it out to memory.
15603 if test X"$d_volatile" = X"$define"; then
15608 #$i_stdlib I_STDLIB
15610 #include <stdlib.h>
15612 #include <sys/types.h>
15613 #include <signal.h>
15615 $volatile int bletched = 0;
15616 $signal_t blech(int s) { bletched = 1; }
15621 int n = 8 * $uvsize;
15624 signal(SIGFPE, blech);
15627 for (i = 0; i < n; i++) {
15628 u = u << 1 | ($uvtype)1;
15630 if (($uvtype)d != u)
15634 d = ($nvtype)(u - 1);
15635 if (($uvtype)d != (u - 1))
15642 printf("%d\n", ((i == n) ? -n : i));
15648 d_nv_preserves_uv="$undef"
15649 if eval $compile; then
15650 nv_preserves_uv_bits="`$run ./try`"
15652 case "$nv_preserves_uv_bits" in
15654 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15655 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15656 d_nv_preserves_uv="$define"
15658 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15659 d_nv_preserves_uv="$undef" ;;
15660 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15661 nv_preserves_uv_bits="0" ;;
15665 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15666 : volatile so that the compiler has to store it out to memory.
15667 if test X"$d_volatile" = X"$define"; then
15673 typedef $nvtype NV;
15680 while(count < 256) {
15681 $volatile NV up = value + 1.0;
15682 $volatile NV negated = -value;
15683 $volatile NV down = negated - 1.0;
15684 $volatile NV got_up = up - value;
15685 int up_good = got_up == 1.0;
15686 int got_down = down - negated;
15687 int down_good = got_down == -1.0;
15689 if (down_good != up_good) {
15691 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15692 up_good, (double) got_up, down_good, (double) got_down,
15693 count, (double) value);
15700 fputs("256.0", stdout);
15703 fputs("2.0", stdout);
15709 fputs("*", stdout);
15715 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15716 count, (double) value);
15722 nv_overflows_integers_at='0'
15723 if eval $compile; then
15729 The largest integer your NVs can preserve is equal to $xxx
15731 nv_overflows_integers_at="$xxx"
15734 Cannot determine the largest integer value your NVs can hold, unexpected output
15741 Cannot determine the largest integer value your NVs can hold
15748 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15749 : volatile so that the compiler has to store it out to memory.
15750 if test X"$d_volatile" = X"$define"; then
15755 #$i_stdlib I_STDLIB
15757 #include <stdlib.h>
15759 #$i_string I_STRING
15761 # include <string.h>
15763 # include <strings.h>
15765 #include <sys/types.h>
15766 #include <signal.h>
15768 $volatile int bletched = 0;
15769 $signal_t blech(int s) { bletched = 1; }
15772 int checkit($nvtype d, char *where) {
15773 unsigned char *p = (char *)&d;
15774 unsigned char *end = p + sizeof(d);
15784 printf("No - %s: 0x", where);
15786 printf ("%02X", *p++);
15791 int main(int argc, char **argv) {
15794 fail += checkit(d, "0.0");
15796 /* The compiler shouldn't be assuming that bletched is 0 */
15799 fail += checkit(d, "bleched");
15802 signal(SIGFPE, blech);
15805 /* Paranoia - the compiler should have no way of knowing that ANSI says
15806 that argv[argc] will always be NULL. Actually, if it did assume this it
15807 would be buggy, as this is C and main() can be called from elsewhere in
15809 d = argv[argc] ? 1 : 0;
15812 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15815 fail += checkit(d, "ternary");
15817 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15820 printf("No - memset doesn't give 0.0\n");
15821 /* This might just blow up: */
15822 printf("(gives %g)\n", d);
15828 printf("No - something bleched\n");
15833 printf("No - %d fail(s)\n", fail);
15842 d_nv_zero_is_allbits_zero="$undef"
15843 if eval $compile; then
15849 0.0 is represented as all bits zero in memory
15851 d_nv_zero_is_allbits_zero="$define"
15854 0.0 is not represented as all bits zero in memory
15856 d_nv_zero_is_allbits_zero="$undef"
15861 0.0 is not represented as all bits zero in memory
15863 d_nv_zero_is_allbits_zero="$undef"
15869 : check for off64_t
15871 echo "Checking to see if you have off64_t..." >&4
15873 #include <sys/types.h>
15874 #include <unistd.h>
15875 int main() { off64_t x = 7; }
15878 if eval $compile; then
15880 echo "You have off64_t."
15883 echo "You do not have off64_t."
15884 case "$lseeksize" in
15885 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15892 : how to create joinable pthreads
15893 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15895 echo "Checking what constant to use for creating joinable pthreads..." >&4
15896 $cat >try.c <<'EOCP'
15897 #include <pthread.h>
15899 int detachstate = JOINABLE;
15902 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15903 if eval $compile; then
15904 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15905 val="$undef" # Yes, undef.
15906 set d_old_pthread_create_joinable
15909 set old_pthread_create_joinable
15912 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15913 if eval $compile; then
15914 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15916 set d_old_pthread_create_joinable
15918 val=PTHREAD_CREATE_UNDETACHED
15919 set old_pthread_create_joinable
15922 set try -DJOINABLE=__UNDETACHED
15923 if eval $compile; then
15924 echo "You seem to use __UNDETACHED." >&4
15926 set d_old_pthread_create_joinable
15929 set old_pthread_create_joinable
15932 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15934 set d_old_pthread_create_joinable
15937 set old_pthread_create_joinable
15944 d_old_pthread_create_joinable="$undef"
15945 old_pthread_create_joinable=""
15948 : see if pause exists
15952 : see if poll exists
15956 : see if readlink exists
15957 set readlink d_readlink
15960 : Check if exe is symlink to abs path of executing program
15964 case "$d_readlink" in
15966 if $issymlink /proc/self/exe ; then
15967 $ls -l /proc/self/exe > reflect
15968 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15969 echo "You have Linux-like /proc/self/exe."
15970 procselfexe='"/proc/self/exe"'
15974 if $issymlink /proc/curproc/file ; then
15975 $ls -l /proc/curproc/file > reflect
15976 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15977 echo "You have BSD-like /proc/curproc/file."
15978 procselfexe='"/proc/curproc/file"'
15988 : backward compatibility for d_hvfork
15989 if test X$d_hvfork != X; then
15990 d_vfork="$d_hvfork"
15993 : see if there is a vfork
15998 d_pseudofork=$undef
16000 : Ok, but do we want to use it. vfork is reportedly unreliable in
16001 : perl on Solaris 2.x, and probably elsewhere.
16005 case "$usevfork" in
16011 Perl can only use a vfork() that doesn't suffer from strict
16012 restrictions on calling functions or modifying global data in
16013 the child. For example, glibc-2.1 contains such a vfork()
16014 that is unsuitable. If your system provides a proper fork()
16015 call, chances are that you do NOT want perl to use vfork().
16018 rp="Do you still want to use vfork()?"
16023 echo "Ok, we won't use vfork()."
16032 $define) usevfork='true';;
16033 *) usevfork='false';;
16036 : see whether the pthread_atfork exists
16038 #include <pthread.h>
16041 #ifdef PTHREAD_ATFORK
16042 pthread_atfork(NULL,NULL,NULL);
16047 : see if pthread_atfork exists
16048 set try -DPTHREAD_ATFORK
16049 if eval $compile; then
16054 case "$usethreads" in
16057 $define) echo 'pthread_atfork found.' >&4 ;;
16058 *) echo 'pthread_atfork NOT found.' >&4 ;;
16061 set d_pthread_atfork
16064 : see if pthread_attr_setscope exists
16065 set pthread_attr_setscope d_pthread_attr_setscope
16068 : see whether the various POSIXish _yields exist
16070 #include <pthread.h>
16076 #ifdef PTHREAD_YIELD
16079 #ifdef PTHREAD_YIELD_NULL
16080 pthread_yield(NULL);
16086 : see if sched_yield exists
16087 set try -DSCHED_YIELD
16088 if eval $compile; then
16090 sched_yield='sched_yield()'
16094 case "$usethreads" in
16097 $define) echo 'sched_yield() found.' >&4 ;;
16098 *) echo 'sched_yield() NOT found.' >&4 ;;
16104 : see if pthread_yield exists
16105 set try -DPTHREAD_YIELD
16106 if eval $compile; then
16108 case "$sched_yield" in
16109 '') sched_yield='pthread_yield()' ;;
16112 set try -DPTHREAD_YIELD_NULL
16113 if eval $compile; then
16115 case "$sched_yield" in
16116 '') sched_yield='pthread_yield(NULL)' ;;
16122 case "$usethreads" in
16125 $define) echo 'pthread_yield() found.' >&4 ;;
16126 *) echo 'pthread_yield() NOT found.' >&4 ;;
16130 set d_pthread_yield
16132 case "$sched_yield" in
16133 '') sched_yield=undef ;;
16137 : see if random_r exists
16138 set random_r d_random_r
16140 case "$d_random_r" in
16142 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16143 case "$d_random_r_proto:$usethreads" in
16144 ":define") d_random_r_proto=define
16145 set d_random_r_proto random_r $hdrs
16149 case "$d_random_r_proto" in
16151 case "$random_r_proto" in
16152 ''|0) try='int random_r(int*, struct random_data*);'
16153 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16155 case "$random_r_proto" in
16156 ''|0) try='int random_r(long*, struct random_data*);'
16157 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16159 case "$random_r_proto" in
16160 ''|0) try='int random_r(struct random_data*, int32_t*);'
16161 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16163 case "$random_r_proto" in
16164 ''|0) d_random_r=undef
16166 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16167 * ) case "$random_r_proto" in
16168 REENTRANT_PROTO*) ;;
16169 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16171 echo "Prototype: $try" ;;
16174 *) case "$usethreads" in
16175 define) echo "random_r has no prototype, not using it." >&4 ;;
16182 *) random_r_proto=0
16186 : see if readdir and friends exist
16187 set readdir d_readdir
16189 set seekdir d_seekdir
16191 set telldir d_telldir
16193 set rewinddir d_rewinddir
16196 : see if readdir64_r exists
16197 set readdir64_r d_readdir64_r
16199 case "$d_readdir64_r" in
16201 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16202 case "$d_readdir64_r_proto:$usethreads" in
16203 ":define") d_readdir64_r_proto=define
16204 set d_readdir64_r_proto readdir64_r $hdrs
16208 case "$d_readdir64_r_proto" in
16210 case "$readdir64_r_proto" in
16211 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16212 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16214 case "$readdir64_r_proto" in
16215 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16216 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16218 case "$readdir64_r_proto" in
16219 ''|0) d_readdir64_r=undef
16220 readdir64_r_proto=0
16221 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16222 * ) case "$readdir64_r_proto" in
16223 REENTRANT_PROTO*) ;;
16224 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16226 echo "Prototype: $try" ;;
16229 *) case "$usethreads" in
16230 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16232 d_readdir64_r=undef
16233 readdir64_r_proto=0
16237 *) readdir64_r_proto=0
16241 : see if readdir_r exists
16242 set readdir_r d_readdir_r
16244 case "$d_readdir_r" in
16246 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16247 case "$d_readdir_r_proto:$usethreads" in
16248 ":define") d_readdir_r_proto=define
16249 set d_readdir_r_proto readdir_r $hdrs
16253 case "$d_readdir_r_proto" in
16255 case "$readdir_r_proto" in
16256 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16257 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16259 case "$readdir_r_proto" in
16260 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16261 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16263 case "$readdir_r_proto" in
16264 ''|0) d_readdir_r=undef
16266 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16267 * ) case "$readdir_r_proto" in
16268 REENTRANT_PROTO*) ;;
16269 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16271 echo "Prototype: $try" ;;
16274 *) case "$usethreads" in
16275 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16282 *) readdir_r_proto=0
16286 : see if readv exists
16290 : see if recvmsg exists
16291 set recvmsg d_recvmsg
16294 : see if rename exists
16295 set rename d_rename
16298 : see if rmdir exists
16302 : see if memory.h is available.
16307 : See if it conflicts with string.h
16313 $cppstdin $cppflags $cppminus < $strings > mem.h
16314 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16316 echo "We won't be including <memory.h>."
16326 : can bcopy handle overlapping blocks?
16329 case "$d_memmove" in
16330 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16331 *) case "$d_bcopy" in
16333 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16335 #$i_memory I_MEMORY
16336 #$i_stdlib I_STDLIB
16337 #$i_string I_STRING
16338 #$i_unistd I_UNISTD
16340 $cat >>try.c <<'EOCP'
16343 # include <memory.h>
16346 # include <stdlib.h>
16349 # include <string.h>
16351 # include <strings.h>
16354 # include <unistd.h> /* Needed for NetBSD */
16358 char buf[128], abc[128];
16364 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16365 try to store the string in read-only memory. */
16366 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16368 for (align = 7; align >= 0; align--) {
16369 for (len = 36; len; len--) {
16371 bcopy(abc, b, len);
16372 for (off = 1; off <= len; off++) {
16373 bcopy(b, b+off, len);
16374 bcopy(b+off, b, len);
16375 if (bcmp(b, abc, len))
16384 if eval $compile_ok; then
16385 if $run ./try 2>/dev/null; then
16386 echo "Yes, it can."
16389 echo "It can't, sorry."
16392 echo "(I can't compile the test program, so we'll assume not...)"
16402 : can memcpy handle overlapping blocks?
16405 case "$d_memmove" in
16406 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16407 *) case "$d_memcpy" in
16409 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16411 #$i_memory I_MEMORY
16412 #$i_stdlib I_STDLIB
16413 #$i_string I_STRING
16414 #$i_unistd I_UNISTD
16416 $cat >>try.c <<'EOCP'
16419 # include <memory.h>
16422 # include <stdlib.h>
16425 # include <string.h>
16427 # include <strings.h>
16430 # include <unistd.h> /* Needed for NetBSD */
16434 char buf[128], abc[128];
16440 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16441 try to store the string in read-only memory. */
16442 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16444 for (align = 7; align >= 0; align--) {
16445 for (len = 36; len; len--) {
16447 memcpy(b, abc, len);
16448 for (off = 1; off <= len; off++) {
16449 memcpy(b+off, b, len);
16450 memcpy(b, b+off, len);
16451 if (memcmp(b, abc, len))
16460 if eval $compile_ok; then
16461 if $run ./try 2>/dev/null; then
16462 echo "Yes, it can."
16465 echo "It can't, sorry."
16468 echo "(I can't compile the test program, so we'll assume not...)"
16478 : can memcmp be trusted to compare relative magnitude?
16480 case "$d_memcmp" in
16483 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16485 #$i_memory I_MEMORY
16486 #$i_stdlib I_STDLIB
16487 #$i_string I_STRING
16488 #$i_unistd I_UNISTD
16490 $cat >>try.c <<'EOCP'
16493 # include <memory.h>
16496 # include <stdlib.h>
16499 # include <string.h>
16501 # include <strings.h>
16504 # include <unistd.h> /* Needed for NetBSD */
16510 if ((a < b) && memcmp(&a, &b, 1) < 0)
16516 if eval $compile_ok; then
16517 if $run ./try 2>/dev/null; then
16518 echo "Yes, it can."
16521 echo "No, it can't (it uses signed chars)."
16524 echo "(I can't compile the test program, so we'll assume not...)"
16532 : see if prototype for sbrk is available
16534 set d_sbrkproto sbrk $i_unistd unistd.h
16537 : see if select exists
16538 set select d_select
16541 : see if semctl exists
16542 set semctl d_semctl
16545 : see if semget exists
16546 set semget d_semget
16549 : see if semop exists
16553 : see how much of the 'sem*(2)' library is present.
16556 case "$d_semctl$d_semget$d_semop" in
16557 *"$undef"*) h_sem=false;;
16561 case "`ipcs 2>&1`" in
16562 "SVID messages"*"not configured"*)
16563 echo "Your $osname does not have the sem*(2) configured." >&4
16566 set semctl d_semctl
16568 set semget d_semget
16576 : we could also check for sys/ipc.h ...
16577 if $h_sem && $test `./findhdr sys/sem.h`; then
16578 echo "You have the full sem*(2) library." >&4
16581 echo "You don't have the full sem*(2) library." >&4
16587 : see whether sys/sem.h defines union semun
16589 $cat > try.c <<'END'
16590 #include <sys/types.h>
16591 #include <sys/ipc.h>
16592 #include <sys/sem.h>
16593 int main () { union semun semun; semun.buf = 0; }
16596 if eval $compile; then
16597 echo "You have union semun in <sys/sem.h>." >&4
16600 echo "You do not have union semun in <sys/sem.h>." >&4
16607 : see how to do semctl IPC_STAT
16611 $cat > tryh.h <<END
16614 # define S_IRUSR S_IREAD
16615 # define S_IWUSR S_IWRITE
16616 # define S_IXUSR S_IEXEC
16618 # define S_IRUSR 0400
16619 # define S_IWUSR 0200
16620 # define S_IXUSR 0100
16622 # define S_IRGRP (S_IRUSR>>3)
16623 # define S_IWGRP (S_IWUSR>>3)
16624 # define S_IXGRP (S_IXUSR>>3)
16625 # define S_IROTH (S_IRUSR>>6)
16626 # define S_IWOTH (S_IWUSR>>6)
16627 # define S_IXOTH (S_IXUSR>>6)
16630 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16631 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16632 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16635 : see whether semctl IPC_STAT can use union semun
16636 case "$d_semctl_semun" in
16640 #include <sys/types.h>
16641 #include <sys/ipc.h>
16642 #include <sys/sem.h>
16643 #include <sys/stat.h>
16650 #$d_union_semun HAS_UNION_SEMUN
16653 #ifndef HAS_UNION_SEMUN
16656 struct semid_ds *buf;
16657 unsigned short *array;
16663 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16664 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16666 struct semid_ds argbuf;
16669 st = semctl(sem, 0, IPC_STAT, arg);
16673 # endif /* IPC_STAT */
16674 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16676 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16677 # endif /* IPC_RMID */
16678 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16680 #endif /* IPC_PRIVATE && ... */
16681 printf("semget failed: errno = %d\n", errno);
16686 if eval $compile; then
16689 semun) val="$define" ;;
16697 case "$d_semctl_semun" in
16699 echo "You can use union semun for semctl IPC_STAT." >&4
16702 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16707 : see whether semctl IPC_STAT can use struct semid_ds pointer
16708 case "$d_semctl_semid_ds" in
16711 $cat > try.c <<'END'
16712 #include <sys/types.h>
16713 #include <sys/ipc.h>
16714 #include <sys/sem.h>
16715 #include <sys/stat.h>
16723 struct semid_ds arg;
16726 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16727 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16730 st = semctl(sem, 0, IPC_STAT, &arg);
16732 printf("semid_ds\n");
16734 # endif /* IPC_STAT */
16735 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16737 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16738 # endif /* IPC_RMID */
16739 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16741 #endif /* IPC_PRIVATE && ... */
16742 printf("semget failed: errno = %d\n", errno);
16748 if eval $compile; then
16751 semid_ds) val="$define" ;;
16755 set d_semctl_semid_ds
16759 case "$d_semctl_semid_ds" in
16761 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16763 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16769 # We do not have the full sem*(2) library, so assume we can not
16775 set d_semctl_semid_ds
16781 : see if sendmsg exists
16782 set sendmsg d_sendmsg
16785 : see if setegid exists
16786 set setegid d_setegid
16789 : see if seteuid exists
16790 set seteuid d_seteuid
16793 : see if setgrent exists
16794 set setgrent d_setgrent
16797 : see if setgrent_r exists
16798 set setgrent_r d_setgrent_r
16800 case "$d_setgrent_r" in
16802 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16803 case "$d_setgrent_r_proto:$usethreads" in
16804 ":define") d_setgrent_r_proto=define
16805 set d_setgrent_r_proto setgrent_r $hdrs
16809 case "$d_setgrent_r_proto" in
16811 case "$setgrent_r_proto" in
16812 ''|0) try='int setgrent_r(FILE**);'
16813 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16815 case "$setgrent_r_proto" in
16816 ''|0) try='void setgrent_r(FILE**);'
16817 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16819 case "$setgrent_r_proto" in
16820 ''|0) d_setgrent_r=undef
16822 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16823 * ) case "$setgrent_r_proto" in
16824 REENTRANT_PROTO*) ;;
16825 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16827 echo "Prototype: $try" ;;
16830 *) case "$usethreads" in
16831 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16838 *) setgrent_r_proto=0
16842 : see if sethostent exists
16843 set sethostent d_sethent
16846 : see if sethostent_r exists
16847 set sethostent_r d_sethostent_r
16849 case "$d_sethostent_r" in
16851 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16852 case "$d_sethostent_r_proto:$usethreads" in
16853 ":define") d_sethostent_r_proto=define
16854 set d_sethostent_r_proto sethostent_r $hdrs
16858 case "$d_sethostent_r_proto" in
16860 case "$sethostent_r_proto" in
16861 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16862 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16864 case "$sethostent_r_proto" in
16865 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16866 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16868 case "$sethostent_r_proto" in
16869 ''|0) d_sethostent_r=undef
16870 sethostent_r_proto=0
16871 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16872 * ) case "$sethostent_r_proto" in
16873 REENTRANT_PROTO*) ;;
16874 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16876 echo "Prototype: $try" ;;
16879 *) case "$usethreads" in
16880 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16882 d_sethostent_r=undef
16883 sethostent_r_proto=0
16887 *) sethostent_r_proto=0
16891 : see if setitimer exists
16892 set setitimer d_setitimer
16895 : see if setlinebuf exists
16896 set setlinebuf d_setlinebuf
16899 : see if setlocale exists
16900 set setlocale d_setlocale
16903 : see if locale.h is available
16904 set locale.h i_locale
16907 : see if setlocale_r exists
16908 set setlocale_r d_setlocale_r
16910 case "$d_setlocale_r" in
16912 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16913 case "$d_setlocale_r_proto:$usethreads" in
16914 ":define") d_setlocale_r_proto=define
16915 set d_setlocale_r_proto setlocale_r $hdrs
16919 case "$d_setlocale_r_proto" in
16921 case "$setlocale_r_proto" in
16922 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16923 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16925 case "$setlocale_r_proto" in
16926 ''|0) d_setlocale_r=undef
16927 setlocale_r_proto=0
16928 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16929 * ) case "$setlocale_r_proto" in
16930 REENTRANT_PROTO*) ;;
16931 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16933 echo "Prototype: $try" ;;
16936 *) case "$usethreads" in
16937 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16939 d_setlocale_r=undef
16940 setlocale_r_proto=0
16944 *) setlocale_r_proto=0
16948 : see if setnetent exists
16949 set setnetent d_setnent
16952 : see if setnetent_r exists
16953 set setnetent_r d_setnetent_r
16955 case "$d_setnetent_r" in
16957 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16958 case "$d_setnetent_r_proto:$usethreads" in
16959 ":define") d_setnetent_r_proto=define
16960 set d_setnetent_r_proto setnetent_r $hdrs
16964 case "$d_setnetent_r_proto" in
16966 case "$setnetent_r_proto" in
16967 ''|0) try='int setnetent_r(int, struct netent_data*);'
16968 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
16970 case "$setnetent_r_proto" in
16971 ''|0) try='void setnetent_r(int, struct netent_data*);'
16972 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
16974 case "$setnetent_r_proto" in
16975 ''|0) d_setnetent_r=undef
16976 setnetent_r_proto=0
16977 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16978 * ) case "$setnetent_r_proto" in
16979 REENTRANT_PROTO*) ;;
16980 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16982 echo "Prototype: $try" ;;
16985 *) case "$usethreads" in
16986 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16988 d_setnetent_r=undef
16989 setnetent_r_proto=0
16993 *) setnetent_r_proto=0
16997 : see if setprotoent exists
16998 set setprotoent d_setpent
17001 : see if setpgid exists
17002 set setpgid d_setpgid
17005 : see if setpgrp2 exists
17006 set setpgrp2 d_setpgrp2
17009 : see if setpriority exists
17010 set setpriority d_setprior
17013 : see if setproctitle exists
17014 set setproctitle d_setproctitle
17017 : see if setprotoent_r exists
17018 set setprotoent_r d_setprotoent_r
17020 case "$d_setprotoent_r" in
17022 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17023 case "$d_setprotoent_r_proto:$usethreads" in
17024 ":define") d_setprotoent_r_proto=define
17025 set d_setprotoent_r_proto setprotoent_r $hdrs
17029 case "$d_setprotoent_r_proto" in
17031 case "$setprotoent_r_proto" in
17032 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17033 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17035 case "$setprotoent_r_proto" in
17036 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17037 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17039 case "$setprotoent_r_proto" in
17040 ''|0) d_setprotoent_r=undef
17041 setprotoent_r_proto=0
17042 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17043 * ) case "$setprotoent_r_proto" in
17044 REENTRANT_PROTO*) ;;
17045 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17047 echo "Prototype: $try" ;;
17050 *) case "$usethreads" in
17051 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17053 d_setprotoent_r=undef
17054 setprotoent_r_proto=0
17058 *) setprotoent_r_proto=0
17062 : see if setpwent exists
17063 set setpwent d_setpwent
17066 : see if setpwent_r exists
17067 set setpwent_r d_setpwent_r
17069 case "$d_setpwent_r" in
17071 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17072 case "$d_setpwent_r_proto:$usethreads" in
17073 ":define") d_setpwent_r_proto=define
17074 set d_setpwent_r_proto setpwent_r $hdrs
17078 case "$d_setpwent_r_proto" in
17080 case "$setpwent_r_proto" in
17081 ''|0) try='int setpwent_r(FILE**);'
17082 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17084 case "$setpwent_r_proto" in
17085 ''|0) try='void setpwent_r(FILE**);'
17086 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17088 case "$setpwent_r_proto" in
17089 ''|0) d_setpwent_r=undef
17091 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17092 * ) case "$setpwent_r_proto" in
17093 REENTRANT_PROTO*) ;;
17094 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17096 echo "Prototype: $try" ;;
17099 *) case "$usethreads" in
17100 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17107 *) setpwent_r_proto=0
17111 : see if setregid exists
17112 set setregid d_setregid
17114 set setresgid d_setresgid
17117 : see if setreuid exists
17118 set setreuid d_setreuid
17120 set setresuid d_setresuid
17123 : see if setrgid exists
17124 set setrgid d_setrgid
17127 : see if setruid exists
17128 set setruid d_setruid
17131 : see if setservent exists
17132 set setservent d_setsent
17135 : see if setservent_r exists
17136 set setservent_r d_setservent_r
17138 case "$d_setservent_r" in
17140 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17141 case "$d_setservent_r_proto:$usethreads" in
17142 ":define") d_setservent_r_proto=define
17143 set d_setservent_r_proto setservent_r $hdrs
17147 case "$d_setservent_r_proto" in
17149 case "$setservent_r_proto" in
17150 ''|0) try='int setservent_r(int, struct servent_data*);'
17151 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17153 case "$setservent_r_proto" in
17154 ''|0) try='void setservent_r(int, struct servent_data*);'
17155 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17157 case "$setservent_r_proto" in
17158 ''|0) d_setservent_r=undef
17159 setservent_r_proto=0
17160 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17161 * ) case "$setservent_r_proto" in
17162 REENTRANT_PROTO*) ;;
17163 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17165 echo "Prototype: $try" ;;
17168 *) case "$usethreads" in
17169 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17171 d_setservent_r=undef
17172 setservent_r_proto=0
17176 *) setservent_r_proto=0
17180 : see if setsid exists
17181 set setsid d_setsid
17184 : see if setvbuf exists
17185 set setvbuf d_setvbuf
17188 : see if sfio.h is available
17192 : see if sfio library is available
17203 : Ok, but do we want to use it.
17207 true|$define|[yY]*) dflt='y';;
17210 echo "$package can use the sfio library, but it is experimental."
17211 case "$useperlio" in
17213 echo "For sfio also the PerlIO abstraction layer is needed."
17214 echo "Earlier you said you wouldn't want that."
17217 rp="You seem to have sfio available, do you want to try using it?"
17220 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17221 useperlio="$define"
17224 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17229 *) case "$usesfio" in
17230 true|$define|[yY]*)
17231 echo "Sorry, cannot find sfio on this machine." >&4
17232 echo "Ignoring your setting of usesfio=$usesfio." >&4
17241 $define) usesfio='true';;
17242 *) usesfio='false';;
17246 *) : Remove sfio from list of libraries to use
17249 echo "Removing unneeded -lsfio from library list" >&4
17250 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17253 echo "libs = $libs" >&4
17260 : see if shmctl exists
17261 set shmctl d_shmctl
17264 : see if shmget exists
17265 set shmget d_shmget
17268 : see if shmat exists
17271 : see what shmat returns
17274 $cat >shmat.c <<'END'
17275 #include <sys/shm.h>
17278 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17283 echo "and it returns ($shmattype)." >&4
17284 : see if a prototype for shmat is available
17285 xxx=`./findhdr sys/shm.h`
17286 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17287 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17298 set d_shmatprototype
17301 : see if shmdt exists
17305 : see how much of the 'shm*(2)' library is present.
17308 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17309 *"$undef"*) h_shm=false;;
17313 case "`ipcs 2>&1`" in
17314 "SVID shared memory"*"not configured"*)
17315 echo "Your $osname does not have the shm*(2) configured." >&4
17318 set shmctl d_shmctl
17320 set shmget d_shmget
17330 : we could also check for sys/ipc.h ...
17331 if $h_shm && $test `./findhdr sys/shm.h`; then
17332 echo "You have the full shm*(2) library." >&4
17335 echo "You don't have the full shm*(2) library." >&4
17341 : see if we have sigaction
17343 if set sigaction val -f d_sigaction; eval $csym; $val; then
17344 echo 'sigaction() found.' >&4
17347 #include <sys/types.h>
17348 #include <signal.h>
17349 #$i_stdlib I_STDLIB
17351 #include <stdlib.h>
17355 struct sigaction act, oact;
17357 oact.sa_handler = 0;
17358 /* so that act and oact are used */
17359 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17363 if eval $compile_ok; then
17366 echo "But you don't seem to have a useable struct sigaction." >&4
17370 echo 'sigaction NOT found.' >&4
17373 set d_sigaction; eval $setvar
17376 : see if this is a sunmath.h system
17377 set sunmath.h i_sunmath
17380 : see if signbit exists
17381 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17384 #$i_sunmath I_SUNMATH
17388 #ifdef I_SUNMATH /* Solaris special math library */
17389 # include <sunmath.h>
17392 int main(int argc, char **argv)
17396 if ((signbit(x) == 0) && (signbit(y) != 0))
17404 if eval $compile; then
17405 if $run ./try; then
17409 $echo "Signbit seems to be available, but doesn't work as I expected."
17410 $echo "I won't use it." >&4
17421 : see if sigprocmask exists
17422 set sigprocmask d_sigprocmask
17425 : see if sigsetjmp exists
17427 case "$d_sigsetjmp" in
17430 #include <setjmp.h>
17431 #$i_stdlib I_STDLIB
17433 #include <stdlib.h>
17439 if (sigsetjmp(env,1))
17442 siglongjmp(env, 1);
17447 if eval $compile; then
17448 if $run ./try >/dev/null 2>&1; then
17449 echo "POSIX sigsetjmp found." >&4
17453 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17459 echo "sigsetjmp not found." >&4
17463 *) val="$d_sigsetjmp"
17464 case "$d_sigsetjmp" in
17465 $define) echo "POSIX sigsetjmp found." >&4;;
17466 $undef) echo "sigsetjmp not found." >&4;;
17474 : see if snprintf exists
17475 set snprintf d_snprintf
17478 : see if vsnprintf exists
17479 set vsnprintf d_vsnprintf
17482 case "$d_snprintf-$d_vsnprintf" in
17485 Checking whether your snprintf() and vsnprintf() work okay...
17487 $cat >try.c <<'EOCP'
17488 /* v?snprintf testing logic courtesy of Russ Allbery.
17489 * According to C99:
17490 * - if the buffer is too short it still must be \0-terminated
17491 * - if the buffer is too short the potentially required length
17492 * must be returned and not -1
17493 * - if the buffer is NULL the potentially required length
17494 * must be returned and not -1 or core dump
17497 #include <stdarg.h>
17501 int test (char *format, ...)
17506 va_start (args, format);
17507 count = vsnprintf (buf, sizeof buf, format, args);
17514 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17515 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17519 if eval $compile; then
17522 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17524 Your snprintf() and snprintf() don't seem to be working okay.
17526 d_snprintf="$undef"
17527 d_vsnprintf="$undef"
17531 echo "(I can't seem to compile the test program--assuming they don't)"
17532 d_snprintf="$undef"
17533 d_vsnprintf="$undef"
17539 : see if sockatmark exists
17540 set sockatmark d_sockatmark
17543 : see if prototype for sockatmark is available
17545 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17548 : see if socks5_init exists
17549 set socks5_init d_socks5_init
17552 : see if sprintf returns the length of the string in the buffer as per ANSI
17553 $echo "Checking whether sprintf returns the length of the string..." >&4
17556 #$i_stdlib I_STDLIB
17558 #include <stdlib.h>
17560 #$i_string I_STRING
17562 # include <string.h>
17564 # include <strings.h>
17573 int check (size_t expect, int test) {
17574 size_t got = strlen(buffer);
17578 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17583 int main(int argc, char **argv) {
17586 check(sprintf(buffer, ""), ++test);
17587 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17588 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17595 if eval $compile; then
17599 sprintf returns the length of the string (as ANSI says it should)
17601 d_sprintf_returns_strlen="$define"
17604 sprintf does not return the length of the string (how old is this system?)
17606 d_sprintf_returns_strlen="$undef"
17610 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17611 d_sprintf_returns_strlen="$undef"
17615 : see if srand48_r exists
17616 set srand48_r d_srand48_r
17618 case "$d_srand48_r" in
17620 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17621 case "$d_srand48_r_proto:$usethreads" in
17622 ":define") d_srand48_r_proto=define
17623 set d_srand48_r_proto srand48_r $hdrs
17627 case "$d_srand48_r_proto" in
17629 case "$srand48_r_proto" in
17630 ''|0) try='int srand48_r(long, struct drand48_data*);'
17631 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17633 case "$srand48_r_proto" in
17634 ''|0) d_srand48_r=undef
17636 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17637 * ) case "$srand48_r_proto" in
17638 REENTRANT_PROTO*) ;;
17639 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17641 echo "Prototype: $try" ;;
17644 *) case "$usethreads" in
17645 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17652 *) srand48_r_proto=0
17656 : see if srandom_r exists
17657 set srandom_r d_srandom_r
17659 case "$d_srandom_r" in
17661 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17662 case "$d_srandom_r_proto:$usethreads" in
17663 ":define") d_srandom_r_proto=define
17664 set d_srandom_r_proto srandom_r $hdrs
17668 case "$d_srandom_r_proto" in
17670 case "$srandom_r_proto" in
17671 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17672 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17674 case "$srandom_r_proto" in
17675 ''|0) d_srandom_r=undef
17677 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17678 * ) case "$srandom_r_proto" in
17679 REENTRANT_PROTO*) ;;
17680 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17682 echo "Prototype: $try" ;;
17685 *) case "$usethreads" in
17686 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17693 *) srandom_r_proto=0
17697 : see if prototype for setresgid is available
17699 set d_sresgproto setresgid $i_unistd unistd.h
17702 : see if prototype for setresuid is available
17704 set d_sresuproto setresuid $i_unistd unistd.h
17707 : see if sys/stat.h is available
17708 set sys/stat.h i_sysstat
17711 : see if stat knows about block sizes
17713 echo "Checking to see if your struct stat has st_blocks field..." >&4
17714 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17717 : see if this is a sys/vfs.h system
17718 set sys/vfs.h i_sysvfs
17721 : see if this is a sys/statfs.h system
17722 set sys/statfs.h i_sysstatfs
17725 : Check for statfs_s
17727 echo "Checking to see if your system supports struct statfs..." >&4
17728 set d_statfs_s statfs $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
17730 case "$d_statfs_s" in
17731 "$define") echo "Yes, it does." ;;
17732 *) echo "No, it doesn't." ;;
17736 : see if struct statfs knows about f_flags
17737 case "$d_statfs_s" in
17740 echo "Checking to see if your struct statfs has f_flags field..." >&4
17741 set d_statfs_f_flags statfs f_flags $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
17745 set d_statfs_f_flags
17749 case "$d_statfs_f_flags" in
17750 "$define") echo "Yes, it does." ;;
17751 *) echo "No, it doesn't." ;;
17754 : Check stream access
17756 Checking how to access stdio streams by file descriptor number...
17758 case "$stdio_stream_array" in
17759 '') $cat >try.c <<EOCP
17762 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17766 for s in _iob __iob __sF
17768 set try -DSTDIO_STREAM_ARRAY=$s
17769 if eval $compile; then
17770 case "`$run ./try`" in
17771 yes) stdio_stream_array=$s; break ;;
17777 case "$stdio_stream_array" in
17779 I can't figure out how to access stdio streams by file descriptor number.
17781 d_stdio_stream_array="$undef"
17784 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17786 d_stdio_stream_array="$define"
17790 : see if strcoll exists
17791 set strcoll d_strcoll
17794 : check for structure copying
17796 echo "Checking to see if your C compiler can copy structs..." >&4
17797 $cat >try.c <<'EOCP'
17807 if $cc -c try.c >/dev/null 2>&1 ; then
17809 echo "Yup, it can."
17812 echo "Nope, it can't."
17818 : see if strerror and/or sys_errlist[] exist
17820 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17821 if set strerror val -f d_strerror; eval $csym; $val; then
17822 echo 'strerror() found.' >&4
17823 d_strerror="$define"
17824 d_strerrm='strerror(e)'
17825 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17826 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17827 d_syserrlst="$define"
17829 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17830 d_syserrlst="$undef"
17832 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17833 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17834 echo 'strerror() found in string header.' >&4
17835 d_strerror="$define"
17836 d_strerrm='strerror(e)'
17837 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17838 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17839 d_syserrlst="$define"
17841 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17842 d_syserrlst="$undef"
17844 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17845 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17846 d_strerror="$undef"
17847 d_syserrlst="$define"
17848 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17850 echo 'strerror() and sys_errlist[] NOT found.' >&4
17851 d_strerror="$undef"
17852 d_syserrlst="$undef"
17853 d_strerrm='"unknown"'
17857 : see if strerror_r exists
17858 set strerror_r d_strerror_r
17860 case "$d_strerror_r" in
17862 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17863 case "$d_strerror_r_proto:$usethreads" in
17864 ":define") d_strerror_r_proto=define
17865 set d_strerror_r_proto strerror_r $hdrs
17869 case "$d_strerror_r_proto" in
17871 case "$strerror_r_proto" in
17872 ''|0) try='int strerror_r(int, char*, size_t);'
17873 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
17875 case "$strerror_r_proto" in
17876 ''|0) try='int strerror_r(int, char*, int);'
17877 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
17879 case "$strerror_r_proto" in
17880 ''|0) try='char* strerror_r(int, char*, size_t);'
17881 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
17883 case "$strerror_r_proto" in
17884 ''|0) d_strerror_r=undef
17886 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17887 * ) case "$strerror_r_proto" in
17888 REENTRANT_PROTO*) ;;
17889 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17891 echo "Prototype: $try" ;;
17894 *) case "$usethreads" in
17895 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17902 *) strerror_r_proto=0
17906 : see if strftime exists
17907 set strftime d_strftime
17910 : see if strlcat exists
17911 set strlcat d_strlcat
17914 : see if strlcpy exists
17915 set strlcpy d_strlcpy
17918 : see if strtod exists
17919 set strtod d_strtod
17922 : see if strtol exists
17923 set strtol d_strtol
17926 : see if strtold exists
17927 set strtold d_strtold
17930 : see if strtoll exists
17931 set strtoll d_strtoll
17934 case "$d_longlong-$d_strtoll" in
17937 Checking whether your strtoll() works okay...
17939 $cat >try.c <<'EOCP'
17942 #define strtoll __strtoll
17945 #define strtoll _strtoll
17948 extern long long int strtoll(char *s, char **, int);
17949 static int bad = 0;
17950 int check(char *s, long long ell, int een) {
17953 gll = strtoll(s, 0, 10);
17954 if (!((gll == ell) && (errno == een)))
17958 check(" 1", 1LL, 0);
17959 check(" 0", 0LL, 0);
17960 check("-1", -1LL, 0);
17961 check("-9223372036854775808", -9223372036854775808LL, 0);
17962 check("-9223372036854775808", -9223372036854775808LL, 0);
17963 check(" 9223372036854775807", 9223372036854775807LL, 0);
17964 check("-9223372036854775808", -9223372036854775808LL, 0);
17965 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17966 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17972 if eval $compile; then
17975 ok) echo "Your strtoll() seems to be working okay." ;;
17977 Your strtoll() doesn't seem to be working okay.
17983 echo "(I can't seem to compile the test program--assuming it doesn't)"
17989 : see if strtoq exists
17990 set strtoq d_strtoq
17993 : see if strtoul exists
17994 set strtoul d_strtoul
17997 case "$d_strtoul" in
18000 Checking whether your strtoul() works okay...
18002 $cat >try.c <<'EOCP'
18005 extern unsigned long int strtoul(char *s, char **, int);
18006 static int bad = 0;
18007 void check(char *s, unsigned long eul, int een) {
18010 gul = strtoul(s, 0, 10);
18011 if (!((gul == eul) && (errno == een)))
18015 check(" 1", 1L, 0);
18016 check(" 0", 0L, 0);
18018 case "$longsize" in
18020 $cat >>try.c <<'EOCP'
18021 check("18446744073709551615", 18446744073709551615UL, 0);
18022 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18023 #if 0 /* strtoul() for /^-/ strings is undefined. */
18024 check("-1", 18446744073709551615UL, 0);
18025 check("-18446744073709551614", 2, 0);
18026 check("-18446744073709551615", 1, 0);
18027 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18028 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18033 $cat >>try.c <<'EOCP'
18034 check("4294967295", 4294967295UL, 0);
18035 check("4294967296", 4294967295UL, ERANGE);
18036 #if 0 /* strtoul() for /^-/ strings is undefined. */
18037 check("-1", 4294967295UL, 0);
18038 check("-4294967294", 2, 0);
18039 check("-4294967295", 1, 0);
18040 check("-4294967296", 4294967295UL, ERANGE);
18041 check("-4294967297", 4294967295UL, ERANGE);
18046 : Should we write these tests to be more portable by sprintf-ing
18047 : ~0 and then manipulating that char string as input for strtol?
18050 $cat >>try.c <<'EOCP'
18057 if eval $compile; then
18058 case "`$run ./try`" in
18059 ok) echo "Your strtoul() seems to be working okay." ;;
18061 Your strtoul() doesn't seem to be working okay.
18067 echo "(I can't seem to compile the test program--assuming it doesn't)"
18073 : see if strtoull exists
18074 set strtoull d_strtoull
18077 case "$d_longlong-$d_strtoull" in
18080 Checking whether your strtoull() works okay...
18082 $cat >try.c <<'EOCP'
18085 #define strtoull __strtoull
18088 extern unsigned long long int strtoull(char *s, char **, int);
18089 static int bad = 0;
18090 int check(char *s, long long eull, int een) {
18093 gull = strtoull(s, 0, 10);
18094 if (!((gull == eull) && (errno == een)))
18098 check(" 1", 1LL, 0);
18099 check(" 0", 0LL, 0);
18100 check("18446744073709551615", 18446744073709551615ULL, 0);
18101 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18102 #if 0 /* strtoull() for /^-/ strings is undefined. */
18103 check("-1", 18446744073709551615ULL, 0);
18104 check("-18446744073709551614", 2LL, 0);
18105 check("-18446744073709551615", 1LL, 0);
18106 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18107 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18114 if eval $compile; then
18115 case "`$run ./try`" in
18116 ok) echo "Your strtoull() seems to be working okay." ;;
18118 Your strtoull() doesn't seem to be working okay.
18120 d_strtoull="$undef"
18124 echo "(I can't seem to compile the test program--assuming it doesn't)"
18125 d_strtoull="$undef"
18130 : see if strtouq exists
18131 set strtouq d_strtouq
18134 case "$d_strtouq" in
18137 Checking whether your strtouq() works okay...
18139 $cat >try.c <<'EOCP'
18142 extern unsigned long long int strtouq(char *s, char **, int);
18143 static int bad = 0;
18144 void check(char *s, unsigned long long eull, int een) {
18145 unsigned long long gull;
18147 gull = strtouq(s, 0, 10);
18148 if (!((gull == eull) && (errno == een)))
18152 check(" 1", 1LL, 0);
18153 check(" 0", 0LL, 0);
18154 check("18446744073709551615", 18446744073709551615ULL, 0);
18155 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18156 #if 0 /* strtouq() for /^-/ strings is undefined. */
18157 check("-1", 18446744073709551615ULL, 0);
18158 check("-18446744073709551614", 2LL, 0);
18159 check("-18446744073709551615", 1LL, 0);
18160 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18161 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18169 if eval $compile; then
18170 case "`$run ./try`" in
18171 ok) echo "Your strtouq() seems to be working okay." ;;
18173 Your strtouq() doesn't seem to be working okay.
18179 echo "(I can't seem to compile the test program--assuming it doesn't)"
18185 : see if strxfrm exists
18186 set strxfrm d_strxfrm
18189 : see if symlink exists
18190 set symlink d_symlink
18193 : see if syscall exists
18194 set syscall d_syscall
18197 : see if prototype for syscall is available
18199 set d_syscallproto syscall $i_unistd unistd.h
18202 : see if sysconf exists
18203 set sysconf d_sysconf
18206 : see if system exists
18207 set system d_system
18210 : see if tcgetpgrp exists
18211 set tcgetpgrp d_tcgetpgrp
18214 : see if tcsetpgrp exists
18215 set tcsetpgrp d_tcsetpgrp
18218 : see if prototype for telldir is available
18220 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18223 : see if time exists
18225 if test "X$d_time" = X -o X"$timetype" = X; then
18226 if set time val -f d_time; eval $csym; $val; then
18227 echo 'time() found.' >&4
18229 rp="What is the type returned by time() on this system?"
18230 set time_t timetype long stdio.h sys/types.h
18233 echo 'time() not found, hope that will do.' >&4
18241 : see if timegm exists
18242 set timegm d_timegm
18245 : see if this is a sys/times.h system
18246 set sys/times.h i_systimes
18249 : see if times exists
18251 if set times val -f d_times; eval $csym; $val; then
18252 echo 'times() found.' >&4
18255 case "$i_systimes" in
18256 "$define") inc='sys/times.h';;
18258 rp="What is the type returned by times() on this system?"
18259 set clock_t clocktype long stdio.h sys/types.h $inc
18262 echo 'times() NOT found, hope that will do.' >&4
18267 : see if tmpnam_r exists
18268 set tmpnam_r d_tmpnam_r
18270 case "$d_tmpnam_r" in
18272 hdrs="$i_systypes sys/types.h define stdio.h "
18273 case "$d_tmpnam_r_proto:$usethreads" in
18274 ":define") d_tmpnam_r_proto=define
18275 set d_tmpnam_r_proto tmpnam_r $hdrs
18279 case "$d_tmpnam_r_proto" in
18281 case "$tmpnam_r_proto" in
18282 ''|0) try='char* tmpnam_r(char*);'
18283 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18285 case "$tmpnam_r_proto" in
18286 ''|0) d_tmpnam_r=undef
18288 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18289 * ) case "$tmpnam_r_proto" in
18290 REENTRANT_PROTO*) ;;
18291 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18293 echo "Prototype: $try" ;;
18296 *) case "$usethreads" in
18297 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18304 *) tmpnam_r_proto=0
18308 : see if truncate exists
18309 set truncate d_truncate
18312 : see if ttyname_r exists
18313 set ttyname_r d_ttyname_r
18315 case "$d_ttyname_r" in
18317 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18318 case "$d_ttyname_r_proto:$usethreads" in
18319 ":define") d_ttyname_r_proto=define
18320 set d_ttyname_r_proto ttyname_r $hdrs
18324 case "$d_ttyname_r_proto" in
18326 case "$ttyname_r_proto" in
18327 ''|0) try='int ttyname_r(int, char*, size_t);'
18328 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18330 case "$ttyname_r_proto" in
18331 ''|0) try='int ttyname_r(int, char*, int);'
18332 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18334 case "$ttyname_r_proto" in
18335 ''|0) try='char* ttyname_r(int, char*, int);'
18336 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18338 case "$ttyname_r_proto" in
18339 ''|0) d_ttyname_r=undef
18341 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18342 * ) case "$ttyname_r_proto" in
18343 REENTRANT_PROTO*) ;;
18344 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18346 echo "Prototype: $try" ;;
18349 *) case "$usethreads" in
18350 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18357 *) ttyname_r_proto=0
18361 : see if tzname[] exists
18363 if set tzname val -a d_tzname; eval $csym; $val; then
18365 echo 'tzname[] found.' >&4
18368 echo 'tzname[] NOT found.' >&4
18373 : Check if is a multiplatform env
18375 next|rhapsody|darwin) multiarch="$define" ;;
18377 case "$multiarch" in
18378 ''|[nN]*) multiarch="$undef" ;;
18381 : check for ordering of bytes in a UV
18383 case "$usecrosscompile$multiarch" in
18386 You seem to be either cross-compiling or doing a multiarchitecture build,
18387 skipping the byteorder check.
18393 case "$byteorder" in
18396 In the following, larger digits indicate more significance. A big-endian
18397 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18398 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18399 machines may have weird orders like 3412. A Cray will report 87654321,
18400 an Alpha will report 12345678. If the test program works the default is
18402 I'm now running the test program...
18406 #$i_stdlib I_STDLIB
18408 #include <stdlib.h>
18410 #include <sys/types.h>
18411 typedef $uvtype UV;
18421 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18423 u.l = (UV)0x04030201;
18424 for (i = 0; i < $uvsize; i++)
18425 printf("%c", u.c[i]+'0');
18432 if eval $compile && $run ./try > /dev/null; then
18435 [1-4][1-4][1-4][1-4]|12345678|87654321)
18436 echo "(The test program ran ok.)"
18437 echo "byteorder=$dflt"
18440 ????|????????) echo "(The test program ran ok.)" ;;
18441 *) echo "(The test program didn't run right for some reason.)" ;;
18446 (I can't seem to compile the test program. Guessing big-endian...)
18449 case "$xxx_prompt" in
18451 rp="What is the order of bytes in $uvtype?"
18464 : Checking 32bit aligndness
18467 Checking to see whether you can access character data unalignedly...
18469 case "$d_u32align" in
18470 '') $cat >try.c <<EOCP
18472 #$i_stdlib I_STDLIB
18474 #include <stdlib.h>
18476 #define U32 $u32type
18477 #define BYTEORDER 0x$byteorder
18479 #include <signal.h>
18481 $signal_t bletch(int s) { exit(4); }
18484 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18489 if (sizeof(U32) != 4) {
18490 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18497 signal(SIGBUS, bletch);
18509 for (i = 0; i < 4; i++) {
18510 up = (U32*)(buf + i);
18511 if (! ((*up == 1 << (8*i)) || /* big-endian */
18512 (*up == 1 << (8*(3-i))) /* little-endian */
18516 printf("read failed (%x)\n", *up);
18522 for (i = 0; i < 4; i++) {
18523 up = (U32*)(buf + i);
18525 if (*up != 0xBeef) {
18526 printf("write failed (%x)\n", *up);
18540 if eval $compile_ok; then
18541 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18542 $run ./try 2>&1 >/dev/null
18545 You can access character data pretty unalignedly.
18547 d_u32align="$undef"
18550 It seems that you must access character data in an aligned manner.
18552 d_u32align="$define"
18556 rp='Can you access character data at unaligned addresses?'
18560 [yY]*) d_u32align="$undef" ;;
18561 *) d_u32align="$define" ;;
18568 : see if ualarm exists
18569 set ualarm d_ualarm
18572 : see if umask exists
18576 : see if unordered exists
18577 set unordered d_unordered
18580 : see if unsetenv exists
18581 set unsetenv d_unsetenv
18584 : see if usleep exists
18585 set usleep d_usleep
18588 : see if prototype for usleep is available
18590 set d_usleepproto usleep $i_unistd unistd.h
18593 : see if ustat exists
18597 : see if closedir exists
18598 set closedir d_closedir
18601 case "$d_closedir" in
18604 echo "Checking whether closedir() returns a status..." >&4
18606 #$i_dirent I_DIRENT /**/
18607 #$i_sysdir I_SYS_DIR /**/
18608 #$i_sysndir I_SYS_NDIR /**/
18609 #$i_systypes I_SYS_TYPES /**/
18611 #if defined(I_SYS_TYPES)
18612 #include <sys/types.h>
18614 #if defined(I_DIRENT)
18615 #include <dirent.h>
18616 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18617 #include <sys/dir.h>
18621 #include <sys/ndir.h>
18625 #include <ndir.h> /* may be wrong in the future */
18627 #include <sys/dir.h>
18632 int main() { return closedir(opendir(".")); }
18635 if eval $compile_ok; then
18636 if $run ./try > /dev/null 2>&1 ; then
18637 echo "Yes, it does."
18640 echo "No, it doesn't."
18644 echo "(I can't seem to compile the test program--assuming it doesn't)"
18652 set d_void_closedir
18656 : see if there is a wait4
18660 : see if waitpid exists
18661 set waitpid d_waitpid
18664 : see if wcstombs exists
18665 set wcstombs d_wcstombs
18668 : see if wctomb exists
18669 set wctomb d_wctomb
18672 : see if writev exists
18673 set writev d_writev
18676 : preserve RCS keywords in files with variable substitution, grrr
18681 Revision='$Revision'
18683 : check for alignment requirements
18685 case "$usecrosscompile$multiarch" in
18688 You seem to be either cross-compiling or doing a multiarchitecture build,
18689 skipping the memory alignment check.
18692 case "$alignbytes" in
18693 '') alignbytes=8 ;;
18697 case "$alignbytes" in
18698 '') echo "Checking alignment constraints..." >&4
18699 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18700 $cat >try.c <<'EOCP'
18701 typedef long double NV;
18704 $cat >try.c <<'EOCP'
18708 $cat >>try.c <<'EOCP'
18716 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18721 if eval $compile_ok; then
18725 echo "(I can't seem to compile the test program...)"
18728 *) dflt="$alignbytes"
18731 rp="Doubles must be aligned on a how-many-byte boundary?"
18739 : set the base revision
18742 : how do we concatenate cpp tokens here?
18744 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18745 $cat >cpp_stuff.c <<'EOCP'
18746 #define RCAT(a,b)a/**/b
18747 #define ACAT(a,b)a ## b
18751 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18752 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18753 echo "Oh! Smells like ANSI's been here." >&4
18754 echo "We can catify or stringify, separately or together!"
18756 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18757 echo "Ah, yes! The good old days!" >&4
18758 echo "However, in the good old days we don't know how to stringify and"
18759 echo "catify at the same time."
18763 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18764 You're going to have to edit the values of CAT[2-5] in config.h...
18766 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18770 : see if this is a db.h system
18776 : Check db version.
18778 echo "Checking Berkeley DB version ..." >&4
18784 #include <sys/types.h>
18786 #$i_stdlib I_STDLIB
18788 #include <stdlib.h>
18791 int main(int argc, char *argv[])
18793 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18794 int Major, Minor, Patch ;
18795 unsigned long Version ;
18796 (void)db_version(&Major, &Minor, &Patch) ;
18798 printf("%d %d %d %d %d %d\n",
18799 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18800 Major, Minor, Patch);
18803 printf("You have Berkeley DB Version 2 or greater.\n");
18805 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18806 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18807 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18808 Major, Minor, Patch) ;
18810 /* check that db.h & libdb are compatible */
18811 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18812 printf("db.h and libdb are incompatible.\n") ;
18816 printf("db.h and libdb are compatible.\n") ;
18818 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18819 + DB_VERSION_PATCH ;
18821 /* needs to be >= 2.3.4 */
18822 if (Version < 2003004) {
18823 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18824 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18830 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18835 printf("You have Berkeley DB Version 1.\n");
18836 exit(0); /* DB version < 2: the coast is clear. */
18838 exit(1); /* <db.h> not Berkeley DB? */
18844 if eval $compile_ok && $run ./try; then
18845 echo 'Looks OK.' >&4
18847 db_version_major=$1
18848 db_version_minor=$2
18849 db_version_patch=$3
18851 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18855 : Remove db from list of libraries to use
18856 echo "Removing unusable -ldb from library list" >&4
18857 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18860 echo "libs = $libs" >&4
18870 : Check the return type needed for hash
18872 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18878 #include <sys/types.h>
18881 #ifndef DB_VERSION_MAJOR
18882 u_int32_t hash_cb (ptr, size)
18890 info.hash = hash_cb;
18894 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18895 if $contains warning try.out >>/dev/null 2>&1 ; then
18898 db_hashtype='u_int32_t'
18901 : XXX Maybe we should just give up here.
18902 db_hashtype=u_int32_t
18904 echo "Help: I can't seem to compile the db test program." >&4
18905 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18908 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18910 *) db_hashtype=u_int32_t
18915 : Check the return type needed for prefix
18917 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18923 #include <sys/types.h>
18926 #ifndef DB_VERSION_MAJOR
18927 size_t prefix_cb (key1, key2)
18935 info.prefix = prefix_cb;
18939 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18940 if $contains warning try.out >>/dev/null 2>&1 ; then
18941 db_prefixtype='int'
18943 db_prefixtype='size_t'
18946 db_prefixtype='size_t'
18947 : XXX Maybe we should just give up here.
18949 echo "Help: I can't seem to compile the db test program." >&4
18950 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18953 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18955 *) db_prefixtype='size_t'
18959 : How can we generate normalized random numbers ?
18961 echo "Looking for a random number function..." >&4
18962 case "$randfunc" in
18964 if set drand48 val -f; eval $csym; $val; then
18966 echo "Good, found drand48()." >&4
18967 elif set random val -f; eval $csym; $val; then
18969 echo "OK, found random()." >&4
18972 echo "Yick, looks like I have to use rand()." >&4
18983 *-Dmy_rand=*|*-Dmy_srand=*)
18984 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18985 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18986 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18987 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18991 while $test "$cont"; do
18992 rp="Use which function to generate random numbers?"
18994 if $test "$ans" = "$dflt"; then
19000 if set $ans val -f; eval $csym; $val; then
19004 rp="I cannot find function $ans. Use that name anyway?"
19013 case "$randfunc" in
19015 drand01="drand48()"
19021 case "$randbits" in
19023 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19025 #$i_unistd I_UNISTD
19026 #$i_stdlib I_STDLIB
19029 # include <unistd.h>
19032 # include <stdlib.h>
19037 register unsigned long tmp;
19038 register unsigned long max = 0L;
19040 for (i = 1000; i; i--) {
19041 tmp = (unsigned long) $randfunc();
19042 if (tmp > max) max = tmp;
19044 for (i = 0; max; i++)
19050 if eval $compile_ok; then
19054 echo "(I can't seem to compile the test program...)"
19061 rp="How many bits does your $randfunc() function produce?"
19065 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19066 seedfunc="s$randfunc"
19067 randseedtype=unsigned
19071 rp="How many bits does your $randfunc() function produce?"
19074 seedfunc="s$randfunc"
19075 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19076 if set $seedfunc val -f; eval $csym; $val; then
19077 echo "(Using $seedfunc() to seed random generator)"
19079 echo "(Warning: no $seedfunc() to seed random generator)"
19082 randseedtype=unsigned
19089 : Determine if this is an EBCDIC system
19091 echo "Determining whether or not we are on an EBCDIC system..." >&4
19092 $cat >try.c <<'EOM'
19095 if ('M'==0xd4) return 0;
19102 if eval $compile_ok; then
19103 if $run ./try; then
19104 echo "You seem to speak EBCDIC." >&4
19107 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19110 echo "I'm unable to compile the test program." >&4
19111 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19117 : Check how to flush
19120 Checking how to flush all pending stdio output...
19122 # I only know how to find the first 32 possibly open files on SunOS.
19123 # See also hints/sunos_4_1.sh and util.c --AD
19125 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19127 $cat >>try.c <<EOCP
19129 #$i_stdlib I_STDLIB
19131 #include <stdlib.h>
19133 #$i_unistd I_UNISTD
19135 # include <unistd.h>
19137 #$d_sysconf HAS_SYSCONF
19138 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19139 #ifdef HAS_STDIO_STREAM_ARRAY
19140 # define STDIO_STREAM_ARRAY $stdio_stream_array
19145 p = fopen("try.out", "w");
19149 # ifdef TRY_FPRINTF
19153 #ifdef TRY_FFLUSH_NULL
19156 #ifdef TRY_FFLUSH_ALL
19158 long open_max = -1;
19159 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19160 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19162 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19163 open_max = sysconf(_SC_OPEN_MAX);
19166 open_max = FOPEN_MAX;
19169 open_max = OPEN_MAX;
19178 # ifdef HAS_STDIO_STREAM_ARRAY
19179 if (open_max > 0) {
19181 for (i = 0; i < open_max; i++)
19182 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19183 STDIO_STREAM_ARRAY[i]._file < open_max &&
19184 STDIO_STREAM_ARRAY[i]._flag)
19185 fflush(&STDIO_STREAM_ARRAY[i]);
19193 : first we have to find out how _not_ to flush
19195 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19197 set try -DTRY_FPUTC
19198 if eval $compile; then
19199 $run ./try 2>/dev/null
19202 if $test ! -s try.out -a "X$code" = X42; then
19208 set try -DTRY_FPRINTF
19209 if eval $compile; then
19210 $run ./try 2>/dev/null
19213 if $test ! -s try.out -a "X$code" = X42; then
19214 output=-DTRY_FPRINTF
19220 : check for fflush NULL behaviour
19221 case "$fflushNULL" in
19222 '') set try -DTRY_FFLUSH_NULL $output
19223 if eval $compile; then
19224 $run ./try 2>/dev/null
19227 if $test -s try.out -a "X$code" = X42; then
19228 fflushNULL="`$cat try.out`"
19230 if $test "X$code" != X42; then
19232 (If this test failed, don't worry, we'll try another method shortly.)
19237 $rm -f core try.core core.try.*
19238 case "$fflushNULL" in
19240 Your fflush(NULL) works okay for output streams.
19241 Let's see if it clobbers input pipes...
19243 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19244 # bug that improperly flushes the input end of pipes. So we avoid the
19245 # autoflush on fork/system/exec support for now. :-(
19246 $cat >tryp.c <<EOCP
19249 main(int argc, char **argv)
19255 while ((i = getc(stdin)) != -1
19256 && (*bp++ = i) != '\n'
19257 && bp < &buf[1024])
19260 fprintf(stdout, "%s", buf);
19268 fflushNULL="$define"
19270 if eval $compile; then
19272 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19273 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19275 fflush(NULL) seems to behave okay with input streams.
19277 fflushNULL="$define"
19280 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19282 fflushNULL="$undef"
19285 $rm -f core tryp.c tryp.core core.tryp.*
19288 Your fflush(NULL) isn't working (contrary to ANSI C).
19290 fflushNULL="$undef"
19293 Cannot figure out whether your fflush(NULL) works or not.
19294 I'm assuming it doesn't (contrary to ANSI C).
19296 fflushNULL="$undef"
19300 $define|true|[yY]*)
19301 fflushNULL="$define"
19304 fflushNULL="$undef"
19307 : check explicit looping only if NULL did not work, and if the pipe
19308 : bug does not show up on an explicit flush too
19309 case "$fflushNULL" in
19311 $cat >tryp.c <<EOCP
19314 main(int argc, char **argv)
19320 while ((i = getc(stdin)) != -1
19321 && (*bp++ = i) != '\n'
19322 && bp < &buf[1024])
19325 fprintf(stdout, "%s", buf);
19334 if eval $compile; then
19336 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19337 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19339 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19341 : now check for fflushall behaviour
19342 case "$fflushall" in
19343 '') set try -DTRY_FFLUSH_ALL $output
19344 if eval $compile; then
19346 (Now testing the other method--but note that this also may fail.)
19348 $run ./try 2>/dev/null
19351 if $test -s try.out -a "X$code" = X42; then
19352 fflushall="`$cat try.out`"
19356 case "$fflushall" in
19358 Whew. Flushing explicitly all the stdio streams works.
19360 fflushall="$define"
19363 Sigh. Flushing explicitly all the stdio streams doesn't work.
19368 Cannot figure out whether flushing stdio streams explicitly works or not.
19369 I'm assuming it doesn't.
19375 "$define"|true|[yY]*)
19376 fflushall="$define"
19384 All is futile. Even fflush(stdin) clobbers input pipes!
19391 $rm -f core tryp.c tryp.core core.tryp.*
19393 *) fflushall="$undef"
19397 case "$fflushNULL$fflushall" in
19400 OK, I give up. I cannot figure out how to flush pending stdio output.
19401 We won't be flushing handles at all before fork/exec/popen.
19407 : Store the full pathname to the ar program for use in the C program
19408 : Respect a hint or command line value for full_ar.
19413 : Store the full pathname to the sed program for use in the C program
19416 : see what type gids are declared as in the kernel
19418 echo "Looking for the type for group ids returned by getgid()."
19419 set gid_t gidtype xxx stdio.h sys/types.h
19423 xxx=`./findhdr sys/user.h`
19424 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19426 unsigned) dflt="$1 $2" ;;
19430 *) dflt="$gidtype";;
19433 gid_t) echo "gid_t found." ;;
19434 *) rp="What is the type for group ids returned by getgid()?"
19440 : Check the size of GID
19443 *_t) zzz="$gidtype" ;;
19446 echo "Checking the size of $zzz..." >&4
19448 #include <sys/types.h>
19450 #$i_stdlib I_STDLIB
19452 #include <stdlib.h>
19455 printf("%d\n", (int)sizeof($gidtype));
19460 if eval $compile_ok; then
19464 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19467 echo "Your $zzz is $gidsize bytes long."
19472 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19476 : Check if GID is signed
19479 *_t) zzz="$gidtype" ;;
19482 echo "Checking the sign of $zzz..." >&4
19484 #include <sys/types.h>
19495 if eval $compile; then
19499 echo "(I can't execute the test program--guessing unsigned.)" >&4
19503 1) echo "Your $zzz is unsigned." ;;
19504 -1) echo "Your $zzz is signed." ;;
19510 echo "(I can't compile the test program--guessing unsigned.)" >&4
19514 : Check 64bit sizes
19517 if $test X"$quadtype" != X; then
19519 echo "Checking how to print 64-bit integers..." >&4
19521 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19522 $cat >try.c <<'EOCP'
19523 #include <sys/types.h>
19526 int q = 12345678901;
19527 printf("%ld\n", q);
19531 if eval $compile; then
19535 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19536 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19537 echo "We will use %d."
19543 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19544 $cat >try.c <<'EOCP'
19545 #include <sys/types.h>
19548 long q = 12345678901;
19549 printf("%ld\n", q);
19553 if eval $compile; then
19557 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19558 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19559 echo "We will use %ld."
19565 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19566 $cat >try.c <<'EOCP'
19567 #include <sys/types.h>
19568 #include <inttypes.h>
19571 int64_t q = 12345678901;
19572 printf("%" PRId64 "\n", q);
19576 if eval $compile; then
19580 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19581 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19582 echo "We will use the C9X style."
19588 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19590 #include <sys/types.h>
19593 $quadtype q = 12345678901;
19594 printf("%Ld\n", q);
19598 if eval $compile; then
19602 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19603 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19604 echo "We will use %Ld."
19610 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19611 $cat >try.c <<'EOCP'
19612 #include <sys/types.h>
19615 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19616 printf("%lld\n", q);
19620 if eval $compile; then
19624 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19625 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19626 echo "We will use the %lld style."
19632 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19634 #include <sys/types.h>
19637 $quadtype q = 12345678901;
19638 printf("%qd\n", q);
19642 if eval $compile; then
19646 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19647 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19648 echo "We will use %qd."
19654 if $test X"$sPRId64" = X; then
19655 echo "Cannot figure out how to print 64-bit integers." >&4
19662 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19663 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19665 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19666 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19670 : Check format strings for internal types
19672 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19674 if $test X"$ivsize" = X8; then
19675 ivdformat="$sPRId64"
19676 uvuformat="$sPRIu64"
19677 uvoformat="$sPRIo64"
19678 uvxformat="$sPRIx64"
19679 uvXUformat="$sPRIXU64"
19681 if $test X"$ivsize" = X"$longsize"; then
19688 if $test X"$ivsize" = X"$intsize"; then
19696 if $test X"$ivsize" = X"$shortsize"; then
19707 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19708 nveformat="$sPRIeldbl"
19709 nvfformat="$sPRIfldbl"
19710 nvgformat="$sPRIgldbl"
19711 nvEUformat="$sPRIEUldbl"
19712 nvFUformat="$sPRIFUldbl"
19713 nvGUformat="$sPRIGUldbl"
19723 case "$ivdformat" in
19724 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19729 : Check format string for GID
19732 $echo "Checking the format string to be used for gids..." >&4
19735 -1) if $test X"$gidsize" = X"$ivsize"; then
19736 gidformat="$ivdformat"
19738 if $test X"$gidsize" = X"$longsize"; then
19741 if $test X"$gidsize" = X"$intsize"; then
19744 if $test X"$gidsize" = X"$shortsize"; then
19751 *) if $test X"$gidsize" = X"$uvsize"; then
19752 gidformat="$uvuformat"
19754 if $test X"$gidsize" = X"$longsize"; then
19757 if $test X"$gidsize" = X"$intsize"; then
19760 if $test X"$gidsize" = X"$shortsize"; then
19769 : see if getgroups exists
19770 set getgroups d_getgrps
19773 : see if setgroups exists
19774 set setgroups d_setgrps
19777 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19779 case "$d_getgrps$d_setgrps" in
19781 case "$groupstype" in
19782 '') dflt="$gidtype" ;;
19783 *) dflt="$groupstype" ;;
19786 What type of pointer is the second argument to getgroups() and setgroups()?
19787 Usually this is the same as group ids, $gidtype, but not always.
19790 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19794 *) groupstype="$gidtype";;
19797 : MAD = Misc Attribute Definition
19799 if $test $patchlevel -lt 9; then
19800 : MAD is not available in 5.8.x or earlier.
19804 $define|true|[yY]*) dflt='y' ;;
19809 Would you like to build with Misc Attribute Decoration? This is development
19810 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19811 overhead on the interpreter.
19813 If this doesn't make any sense to you, just accept the default '$dflt'.
19815 rp='Build Perl with MAD?'
19820 madlyh='madly.h madly.act madly.tab'
19822 madlyobj="madly$_o" ;;
19831 : check whether make sets MAKE
19833 echo "Checking if your $make program sets \$(MAKE)..." >&4
19834 case "$make_set_make" in
19836 $sed 's/^X //' > testmake.mak << 'EOF'
19838 X @echo 'maketemp="$(MAKE)"'
19840 case "`$make -f testmake.mak 2>/dev/null`" in
19841 *maketemp=*) make_set_make='#' ;;
19842 *) make_set_make="MAKE=$make" ;;
19844 $rm -f testmake.mak
19847 case "$make_set_make" in
19848 '#') echo "Yup, it does.";;
19849 *) echo "Nope, it doesn't.";;
19852 : see what type is used for mode_t
19853 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19854 set mode_t modetype int stdio.h sys/types.h
19857 : see if we need va_copy
19859 case "$i_stdarg" in
19862 #include <stdarg.h>
19864 #$i_stdlib I_STDLIB
19866 #include <stdlib.h>
19868 #include <signal.h>
19871 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19873 return vfprintf(f, fmt, *valp);
19877 myvfprintf(FILE *f, const char *fmt, va_list val)
19879 return ivfprintf(f, fmt, &val);
19883 myprintf(char *fmt, ...)
19886 va_start(val, fmt);
19887 return myvfprintf(stdout, fmt, val);
19891 main(int ac, char **av)
19893 signal(SIGSEGV, exit);
19895 myprintf("%s%cs all right, then\n", "that", '\'');
19900 if eval $compile && $run ./try 2>&1 >/dev/null; then
19901 case "`$run ./try`" in
19902 "that's all right, then")
19908 yes) echo "It seems that you don't need va_copy()." >&4
19909 need_va_copy="$undef"
19911 *) echo "It seems that va_copy() or similar will be needed." >&4
19912 need_va_copy="$define"
19917 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19921 : see what type is used for size_t
19922 rp="What is the type used for the length parameter for string functions?"
19923 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19926 : check for type of arguments to gethostbyaddr.
19927 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19928 case "$d_gethbyaddr" in
19932 Checking to see what type of arguments are accepted by gethostbyaddr().
19934 hdrs="$define sys/types.h
19935 $d_socket sys/socket.h
19936 $i_niin netinet/in.h
19938 $i_unistd unistd.h"
19939 : The first arg can 'char *' or 'void *'
19940 : The second arg is some of integral type
19941 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19942 for yyy in size_t long int; do
19943 case "$netdb_host_type" in
19944 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
19945 if ./protochk "$try" $hdrs; then
19946 echo "Your system accepts $xxx for the first arg."
19947 echo "...and $yyy for the second arg."
19948 netdb_host_type="$xxx"
19949 netdb_hlen_type="$yyy"
19955 : In case none of those worked, prompt the user.
19956 case "$netdb_host_type" in
19957 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19960 netdb_host_type=$ans
19961 rp='What is the type for the 2nd argument to gethostbyaddr?'
19964 netdb_hlen_type=$ans
19968 *) : no gethostbyaddr, so pick harmless defaults
19969 netdb_host_type='char *'
19970 netdb_hlen_type="$sizetype"
19973 # Remove the "const" if needed. -- but then we'll have a
19975 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19978 : check for type of argument to gethostbyname.
19979 if test "X$netdb_name_type" = X ; then
19980 case "$d_gethbyname" in
19984 Checking to see what type of argument is accepted by gethostbyname().
19986 hdrs="$define sys/types.h
19987 $d_socket sys/socket.h
19988 $i_niin netinet/in.h
19990 $i_unistd unistd.h"
19991 for xxx in "const char *" "char *"; do
19992 case "$netdb_name_type" in
19993 '') try="$extern_C struct hostent *gethostbyname($xxx);"
19994 if ./protochk "$try" $hdrs; then
19995 echo "Your system accepts $xxx."
19996 netdb_name_type="$xxx"
20001 : In case none of those worked, prompt the user.
20002 case "$netdb_name_type" in
20003 '') rp='What is the type for the 1st argument to gethostbyname?'
20006 netdb_name_type=$ans
20010 *) : no gethostbyname, so pick harmless default
20011 netdb_name_type='char *'
20016 : check for type of 1st argument to getnetbyaddr.
20017 if test "X$netdb_net_type" = X ; then
20018 case "$d_getnbyaddr" in
20022 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20024 hdrs="$define sys/types.h
20025 $d_socket sys/socket.h
20026 $i_niin netinet/in.h
20028 $i_unistd unistd.h"
20029 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20030 case "$netdb_net_type" in
20031 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20032 if ./protochk "$try" $hdrs; then
20033 echo "Your system accepts $xxx."
20034 netdb_net_type="$xxx"
20039 : In case none of those worked, prompt the user.
20040 case "$netdb_net_type" in
20041 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20044 netdb_net_type=$ans
20048 *) : no getnetbyaddr, so pick harmless default
20049 netdb_net_type='long'
20053 : locate the preferred pager for this system
20060 [a-zA-Z]:/*) dflt=$pg;;
20064 [a-zA-Z]:/*) dflt=$more;;
20068 [a-zA-Z]:/*) dflt=$less;;
20071 '') dflt=/usr/ucb/more;;
20079 rp='What pager is used on your system?'
20083 : see what type pids are declared as in the kernel
20084 rp="What is the type of process ids on this system?"
20085 set pid_t pidtype int stdio.h sys/types.h
20088 : see if ar generates random libraries by itself
20090 echo "Checking how to generate random libraries on your machine..." >&4
20091 echo 'int bar1() { return bar2(); }' > bar1.c
20092 echo 'int bar2() { return 2; }' > bar2.c
20094 #$i_stdlib I_STDLIB
20096 #include <stdlib.h>
20098 int main() { printf("%d\n", bar1()); exit(0); }
20100 $cc $ccflags -c bar1.c >/dev/null 2>&1
20101 $cc $ccflags -c bar2.c >/dev/null 2>&1
20102 $cc $ccflags -c foo.c >/dev/null 2>&1
20103 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20104 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20105 $run ./foobar >/dev/null 2>&1; then
20106 echo "$ar appears to generate random libraries itself."
20108 if [ "X$ranlib" = "X" ]; then
20111 elif $ar s bar$_a >/dev/null 2>&1 &&
20112 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20113 $run ./foobar >/dev/null 2>&1; then
20114 echo "a table of contents needs to be added with '$ar s'."
20117 elif $ar ts bar$_a >/dev/null 2>&1 &&
20118 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20119 $run ./foobar >/dev/null 2>&1; then
20120 echo "a table of contents needs to be added with '$ar ts'."
20127 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20128 $test -f $ranlib || ranlib=''
20131 if $test -n "$ranlib"; then
20132 echo "your system has '$ranlib'; we'll use that."
20135 echo "your system doesn't seem to support random libraries"
20136 echo "so we'll use lorder and tsort to order the libraries."
20143 : see if this is a values.h system
20144 set values.h i_values
20147 : Check the max offset that gmtime and localtime accept
20148 echo "Checking max offsets that gmtime () accepts"
20151 define) yyy="#include <values.h>" ;;
20155 case "$sGMTIME_min/$sGMTIME_max" in
20158 #include <sys/types.h>
20167 void gm_check (time_t t, int min_year, int max_year)
20170 if ( tmp == NULL ||
20171 /* Check tm_year overflow */
20172 tmp->tm_year < min_year || tmp->tm_year > max_year)
20183 gm_check (MAXLONG, 69, 0x7fffffff);
20185 if (tmp == NULL || tmp->tm_year < 0) {
20186 for (i = 63; i >= 0; i--) {
20187 time_t x = pt | ((time_t)1 << i);
20188 if (x < 0 || x < pt) continue;
20189 gm_check (x, 69, 0x7fffffff);
20192 printf ("sGMTIME_max=%ld\n", pt);
20201 gm_check (MINLONG, -1900, 70);
20204 for (i = 36; i >= 0; i--) {
20205 time_t x = pt - ((time_t)1 << i);
20206 if (x > 0) continue;
20207 gm_check (x, -1900, 70);
20210 printf ("sGMTIME_min=%ld\n", pt);
20214 int main (int argc, char *argv[])
20216 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20223 if eval $compile; then
20226 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20232 echo "Checking max offsets that localtime () accepts"
20234 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20237 #include <sys/types.h>
20246 void local_check (time_t t, int min_year, int max_year)
20248 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20251 tmp = localtime (&t);
20252 if ( tmp == NULL ||
20253 /* Check tm_year overflow */
20254 tmp->tm_year < min_year || tmp->tm_year > max_year)
20258 } /* local_check */
20265 local_check (MAXLONG, 69, 0x7fffffff);
20267 if (tmp == NULL || tmp->tm_year < 0) {
20268 for (i = 63; i >= 0; i--) {
20269 time_t x = pt | ((time_t)1 << i);
20270 if (x < 0 || x < pt) continue;
20271 local_check (x, 69, 0x7fffffff);
20274 printf ("sLOCALTIME_max=%ld\n", pt);
20283 local_check (MINLONG, -1900, 70);
20286 for (i = 36; i >= 0; i--) {
20287 time_t x = pt - ((time_t)1 << i);
20288 if (x > 0) continue;
20289 local_check (x, -1900, 70);
20292 printf ("sLOCALTIME_min=%ld\n", pt);
20296 int main (int argc, char *argv[])
20304 if eval $compile; then
20307 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20313 : check for type of arguments to select.
20314 case "$selecttype" in
20315 '') case "$d_select" in
20319 Checking to see what type of arguments are accepted by select().
20321 hdrs="$define sys/types.h
20322 $i_systime sys/time.h
20323 $i_sysselct sys/select.h
20324 $d_socket sys/socket.h"
20325 : The first arg can be int, unsigned, or size_t
20326 : The last arg may or may not be 'const'
20328 : void pointer has been seen but using that
20329 : breaks the selectminbits test
20330 for xxx in 'fd_set *' 'int *'; do
20331 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20332 for tmo in 'struct timeval *' 'const struct timeval *'; do
20334 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20335 if ./protochk "$try" $hdrs; then
20336 echo "Your system accepts $xxx."
20345 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20346 case "$d_fd_set" in
20347 $define) dflt="fd_set *" ;;
20356 *) : no select, so pick a harmless default
20363 : check for the select 'width'
20364 case "$selectminbits" in
20365 '') safebits=`expr $ptrsize \* 8`
20366 case "$d_select" in
20370 Checking to see on how many bits at a time your select() operates...
20373 #include <sys/types.h>
20375 #$i_systime I_SYS_TIME
20376 #$i_systimek I_SYS_TIME_KERNEL
20381 # ifdef I_SYS_TIME_KERNEL
20384 # include <sys/time.h>
20385 # ifdef I_SYS_TIME_KERNEL
20389 #$i_sysselct I_SYS_SELECT
20390 #ifdef I_SYS_SELECT
20391 #include <sys/select.h>
20393 #$d_socket HAS_SOCKET
20395 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20398 #$i_stdlib I_STDLIB
20400 #include <stdlib.h>
20403 #define S sizeof(*(b))
20405 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20406 #define NBITS (NBYTES * 8)
20408 char *s = (char *)malloc(NBYTES);
20417 fp = fopen("try.c", "r");
20423 b = ($selecttype)s;
20424 for (i = 0; i < NBITS; i++)
20428 select(fd + 1, b, 0, 0, &t);
20429 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20431 printf("%d\n", i + 1);
20436 if eval $compile_ok; then
20437 selectminbits=`$run ./try`
20438 case "$selectminbits" in
20440 Cannot figure out on how many bits at a time your select() operates.
20441 I'll play safe and guess it is $safebits bits.
20443 selectminbits=$safebits
20444 bits="$safebits bits"
20447 *) bits="$selectminbits bits" ;;
20449 echo "Your select() operates on $bits at a time." >&4
20451 rp='What is the minimum number of bits your select() operates on?'
20452 case "$byteorder" in
20453 12345678) dflt=64 ;;
20459 selectminbits="$val"
20463 *) : no select, so pick a harmless default
20464 selectminbits=$safebits
20470 : Trace out the files included by signal.h, then look for SIGxxx names.
20471 if [ "X$fieldn" = X ]; then
20472 : Just make some guesses. We check them later.
20473 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20475 xxx=`echo '#include <signal.h>' |
20476 $cppstdin $cppminus $cppflags 2>/dev/null |
20477 $grep '^[ ]*#.*include' |
20478 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20479 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20482 for xx in $xxx /dev/null ; do
20483 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20485 case "$xxxfiles" in
20486 '') xxxfiles=`./findhdr signal.h` ;;
20489 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20490 print substr($2, 4, 20)
20492 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20493 print substr($3, 4, 20)
20495 : Append some common names just in case the awk scan failed.
20496 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20497 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20498 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20499 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20500 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20502 : generate a few handy files for later
20503 $cat > signal.c <<EOCP
20504 #include <sys/types.h>
20505 #include <signal.h>
20506 #$i_stdlib I_STDLIB
20508 #include <stdlib.h>
20513 /* Strange style to avoid deeply-nested #if/#else/#endif */
20516 # define NSIG (_NSIG)
20522 # define NSIG (SIGMAX+1)
20528 # define NSIG (SIG_MAX+1)
20534 # define NSIG (_SIG_MAX+1)
20540 # define NSIG (MAXSIG+1)
20546 # define NSIG (MAX_SIG+1)
20551 # ifdef SIGARRAYSIZE
20552 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20558 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20562 /* Default to some arbitrary number that's big enough to get most
20563 of the common signals.
20569 printf("NSIG %d\n", NSIG);
20575 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20577 printf "#ifdef SIG"; printf $1; printf "\n"
20578 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20579 printf $1; printf ");\n"
20583 printf "#endif /* JUST_NSIG */\n";
20584 printf "exit(0);\n}\n";
20587 $cat >signal.awk <<'EOP'
20588 BEGIN { ndups = 0 }
20589 $1 ~ /^NSIG$/ { nsig = $2 }
20590 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20591 if ($2 > maxsig) { maxsig = $2 }
20592 if (sig_name[$2]) {
20593 dup_name[ndups] = $1
20594 dup_num[ndups] = $2
20606 printf("NSIG %d\n", nsig);
20607 for (n = 1; n < nsig; n++) {
20609 printf("%s %d\n", sig_name[n], sig_num[n])
20612 printf("NUM%d %d\n", n, n)
20615 for (n = 0; n < ndups; n++) {
20616 printf("%s %d\n", dup_name[n], dup_num[n])
20620 $cat >signal_cmd <<EOS
20622 if $test -s signal.lst; then
20623 echo "Using your existing signal.lst file"
20628 $cat >>signal_cmd <<'EOS'
20631 if eval $compile_ok; then
20632 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20633 $uniq | $awk -f signal.awk >signal.lst
20635 echo "(I can't seem be able to compile the whole test program)" >&4
20636 echo "(I'll try it in little pieces.)" >&4
20637 set signal -DJUST_NSIG
20638 if eval $compile_ok; then
20639 $run ./signal$_exe > signal.nsg
20642 echo "I can't seem to figure out how many signals you have." >&4
20643 echo "Guessing 50." >&4
20644 echo 'NSIG 50' > signal.nsg
20646 : Now look at all the signal names, one at a time.
20647 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20648 $cat > signal.c <<EOCP
20649 #include <sys/types.h>
20650 #include <signal.h>
20653 printf("$xx %d\n", SIG${xx});
20658 if eval $compile; then
20659 echo "SIG${xx} found."
20660 $run ./signal$_exe >> signal.ls1
20662 echo "SIG${xx} NOT found."
20665 if $test -s signal.ls1; then
20666 $cat signal.nsg signal.ls1 |
20667 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20671 if $test -s signal.lst; then
20674 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20675 echo 'kill -l' >signal
20676 set X `csh -f <signal`
20680 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20682 echo $@ | $tr ' ' $trnl | \
20683 $awk '{ printf "%s %d\n", $1, ++s; }
20684 END { printf "NSIG %d\n", ++s }' >signal.lst
20686 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20688 chmod a+x signal_cmd
20689 $eunicefix signal_cmd
20691 : generate list of signal names
20693 case "$sig_name_init" in
20695 *) case "$sig_num_init" in
20696 ''|*,*) doinit=yes ;;
20701 echo "Generating a list of signal names and numbers..." >&4
20703 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20704 sig_name=`$awk 'BEGIN { printf "ZERO " }
20705 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20706 sig_num=`$awk 'BEGIN { printf "0 " }
20707 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20708 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20709 !/^NSIG/ { printf "\"%s\", ", $1 }
20710 END { printf "0\n" }' signal.lst`
20711 sig_num_init=`$awk 'BEGIN { printf "0, " }
20712 !/^NSIG/ { printf "%d, ", $2}
20713 END { printf "0\n"}' signal.lst`
20716 echo "The following $sig_count signals are available:"
20718 echo $sig_name | $awk \
20719 'BEGIN { linelen = 0 }
20721 for (i = 1; i <= NF; i++) {
20722 name = "SIG" $i " "
20723 linelen = linelen + length(name)
20724 if (linelen > 70) {
20726 linelen = length(name)
20732 sig_size=`echo $sig_name | awk '{print NF}'`
20733 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20735 : Check size of size
20737 case "$sizetype" in
20738 *_t) zzz="$sizetype" ;;
20739 *) zzz="filesize" ;;
20741 echo "Checking the size of $zzz..." >&4
20743 #include <sys/types.h>
20745 #$i_stdlib I_STDLIB
20747 #include <stdlib.h>
20750 printf("%d\n", (int)sizeof($sizetype));
20755 if eval $compile_ok; then
20759 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20762 echo "Your $zzz size is $sizesize bytes."
20767 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20771 : check for socklen_t
20773 echo "Checking to see if you have socklen_t..." >&4
20775 #include <sys/types.h>
20776 #$d_socket HAS_SOCKET
20778 #include <sys/socket.h>
20780 int main() { socklen_t x = 16; }
20783 if eval $compile; then
20785 echo "You have socklen_t."
20788 echo "You do not have socklen_t."
20789 case "$sizetype" in
20790 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20797 : see if this is a socks.h system
20798 set socks.h i_socks
20801 : check for type of the size argument to socket calls
20802 case "$d_socket" in
20806 Checking to see what type is the last argument of accept().
20809 case "$d_socklen_t" in
20810 "$define") yyy="$yyy socklen_t"
20812 yyy="$yyy $sizetype int long unsigned"
20813 for xxx in $yyy; do
20814 case "$socksizetype" in
20815 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
20816 case "$usesocks" in
20818 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20819 echo "Your system accepts '$xxx *' for the last argument of accept()."
20820 socksizetype="$xxx"
20823 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20824 echo "Your system accepts '$xxx *' for the last argument of accept()."
20825 socksizetype="$xxx"
20832 : In case none of those worked, prompt the user.
20833 case "$socksizetype" in
20834 '') rp='What is the type for socket address structure sizes?'
20841 *) : no sockets, so pick relatively harmless default
20846 : see what type is used for signed size_t
20847 set ssize_t ssizetype int stdio.h sys/types.h
20852 #$i_stdlib I_STDLIB
20854 #include <stdlib.h>
20856 #include <sys/types.h>
20857 #define Size_t $sizetype
20858 #define SSize_t $dflt
20861 if (sizeof(Size_t) == sizeof(SSize_t))
20863 else if (sizeof(Size_t) == sizeof(int))
20872 if eval $compile_ok && $run ./try > /dev/null; then
20873 ssizetype=`$run ./try`
20874 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20877 Help! I can't compile and run the ssize_t test program: please enlighten me!
20878 (This is probably a misconfiguration in your system or libraries, and
20879 you really ought to fix it. Still, I'll try anyway.)
20881 I need a type that is the same size as $sizetype, but is guaranteed to
20882 be signed. Common values are ssize_t, int and long.
20885 rp="What signed type is the same size as $sizetype?"
20891 : see what type of char stdio uses.
20893 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
20894 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20895 echo "Your stdio uses unsigned chars." >&4
20896 stdchar="unsigned char"
20898 echo "Your stdio uses signed chars." >&4
20903 : see what type uids are declared as in the kernel
20905 echo "Looking for the type for user ids returned by getuid()."
20906 set uid_t uidtype xxx stdio.h sys/types.h
20910 xxx=`./findhdr sys/user.h`
20911 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20913 unsigned) dflt="$1 $2" ;;
20917 *) dflt="$uidtype";;
20920 uid_t) echo "uid_t found." ;;
20921 *) rp="What is the type for user ids returned by getuid()?"
20927 : Check size of UID
20930 *_t) zzz="$uidtype" ;;
20933 echo "Checking the size of $zzz..." >&4
20935 #include <sys/types.h>
20937 #$i_stdlib I_STDLIB
20939 #include <stdlib.h>
20942 printf("%d\n", (int)sizeof($uidtype));
20947 if eval $compile_ok; then
20951 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20954 echo "Your $zzz is $uidsize bytes long."
20959 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20962 : Check if UID is signed
20965 *_t) zzz="$uidtype" ;;
20968 echo "Checking the sign of $zzz..." >&4
20970 #include <sys/types.h>
20981 if eval $compile; then
20985 echo "(I can't execute the test program--guessing unsigned.)" >&4
20989 1) echo "Your $zzz is unsigned." ;;
20990 -1) echo "Your $zzz is signed." ;;
20996 echo "(I can't compile the test program--guessing unsigned.)" >&4
21000 : Check format string for UID
21002 $echo "Checking the format string to be used for uids..." >&4
21005 -1) if $test X"$uidsize" = X"$ivsize"; then
21006 uidformat="$ivdformat"
21008 if $test X"$uidsize" = X"$longsize"; then
21011 if $test X"$uidsize" = X"$intsize"; then
21014 if $test X"$uidsize" = X"$shortsize"; then
21021 *) if $test X"$uidsize" = X"$uvsize"; then
21022 uidformat="$uvuformat"
21024 if $test X"$uidsize" = X"$longsize"; then
21027 if $test X"$uidsize" = X"$intsize"; then
21030 if $test X"$uidsize" = X"$shortsize"; then
21039 : Check if site customization support was requested
21040 case "$usesitecustomize" in
21041 $define|true|[Yy]*)
21042 usesitecustomize="$define"
21045 usesitecustomize="$undef"
21049 : determine compiler compiler
21058 if $test -f "$byacc$_exe"; then
21060 comp="byacc or $comp"
21062 if $test -f "$bison$_exe"; then
21063 comp="$comp or bison -y"
21065 rp="Which compiler compiler ($comp) shall I use?"
21074 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21080 : see if this is a assert.h system
21081 set assert.h i_assert
21084 : see if this is a fp.h system
21088 : see if this is a fp_class.h system
21089 set fp_class.h i_fp_class
21092 : see if gdbm.h is available
21097 : see if gdbm_open exists
21098 set gdbm_open d_gdbm_open
21100 case "$d_gdbm_open" in
21103 echo "We won't be including <gdbm.h>"
21112 : see if this is a ieeefp.h system
21113 case "$i_ieeefp" in
21114 '' ) set ieeefp.h i_ieeefp
21119 : see if this is a libutil.h system
21120 set libutil.h i_libutil
21123 : see if mach cthreads are available
21124 if test "X$usethreads" = "X$define"; then
21125 set mach/cthreads.h i_machcthr
21128 i_machcthr="$undef"
21131 : see if this is a mntent.h system
21132 set mntent.h i_mntent
21135 : see if net/errno.h is available
21137 set net/errno.h val
21140 : Unfortunately, it causes problems on some systems. Arrgh.
21143 cat > try.c <<'EOM'
21146 #include <net/errno.h>
21152 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21153 echo "We'll be including <net/errno.h>." >&4
21155 echo "We won't be including <net/errno.h>." >&4
21164 : see if netinet/tcp.h is available
21165 set netinet/tcp.h i_netinettcp
21168 : see if this is a poll.h system
21172 : see if this is a prot.h system
21176 : Preprocessor symbols
21178 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21179 $cat <<'EOSH' > Cppsym.know
21180 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21181 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21182 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21183 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21184 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21185 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21186 bull c cadmus clipper CMU COFF COMPILER_VERSION
21187 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21188 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21189 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21190 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21192 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21193 H3050R H3050RX hbullx20 hcx host_mips
21194 hp200 hp300 hp700 HP700 hp800 hp9000
21195 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21196 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21197 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21198 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21199 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21200 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21201 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21202 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21203 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21204 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21205 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21206 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21207 MATH_HAS_NO_SIDE_EFFECTS
21208 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21209 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21210 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21211 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21212 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21213 NetBSD news1500 news1700 news1800 news1900 news3700
21214 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21215 ns32016 ns32332 ns32k nsc32000
21216 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21217 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21218 pc532 pdp11 PGC PIC plexus PORTAR posix
21219 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21220 POSIX_C_SOURCE POSIX_SOURCE POWER
21221 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21222 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21223 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21224 sony sony_news sonyrisc sparc sparclite spectrum
21225 stardent stdc STDC_EXT stratos sun sun3 sun386
21226 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21227 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21228 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21229 sysV68 sysV88 Tek4132 Tek4300 titan
21230 TM3200 TM5400 TM5600
21231 tower tower32 tower32_200 tower32_600 tower32_700
21232 tower32_800 tower32_850 tss
21233 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21234 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21235 unix UNIX95 UNIX99 unixpc unos
21236 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21237 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21238 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21240 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21241 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21242 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21245 # Maybe put other stuff here too.
21246 cat <<EOSH >>Cppsym.know
21249 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21250 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21251 $cat Cppsym.know > Cppsym.c
21252 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21253 $rm -f Cppsym.a Cppsym.b Cppsym.c
21254 cat <<EOSH > Cppsym
21256 if $test \$# -gt 0; then
21257 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21258 if $test -s Cppsym.got; then
21265 $tr " " "$trnl" | ./Cppsym.try
21271 cat <<EOSH > Cppsym.try
21273 cat <<'EOCP' > try.c
21276 #define STRINGIFY(a) "a"
21278 #if cpp_stuff == 42
21279 #define StGiFy(a) #a
21280 #define STRINGIFY(a) StGiFy(a)
21282 #if $cpp_stuff != 1 && $cpp_stuff != 42
21283 # include "Bletch: How does this C preprocessor stringify macros?"
21289 cat <<'EOSH' >> Cppsym.try
21291 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21292 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21293 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21294 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21296 echo 'return 0;}' >> try.c
21298 cat <<EOSH >> Cppsym.try
21300 case "$osname-$gccversion" in
21301 irix-) ccflags="\$ccflags -woff 1178" ;;
21302 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21304 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21306 chmod +x Cppsym.try
21307 $eunicefix Cppsym.try
21308 ./Cppsym < Cppsym.know > Cppsym.true
21309 : Add in any linux cpp "predefined macros":
21310 case "$osname::$gccversion" in
21313 rm -f $tHdrH'.h' $tHdrH
21315 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21316 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21317 if [ -s $tHdrH'_cppsym.real' ]; then
21318 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21321 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21324 : now check the C compiler for additional symbols
21325 postprocess_cc_v=''
21327 aix) postprocess_cc_v="|$tr , ' '" ;;
21334 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21337 -D*) echo "\$i" | $sed 's/^-D//';;
21338 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21343 postprocess_cc_v=''
21346 ./ccsym > ccsym1.raw
21347 if $test -s ccsym1.raw; then
21348 $sort ccsym1.raw | $uniq >ccsym.raw
21350 mv ccsym1.raw ccsym.raw
21353 $awk '/\=/ { print $0; next }
21354 { print $0"=1" }' ccsym.raw >ccsym.list
21355 $comm -13 Cppsym.true ccsym.list >ccsym.own
21356 $comm -12 Cppsym.true ccsym.list >ccsym.com
21357 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21359 if $test -z ccsym.raw; then
21360 echo "Your C compiler doesn't seem to define any symbols!" >&4
21362 echo "However, your C preprocessor defines the following symbols:"
21365 cppsymbols=`$cat Cppsym.true`
21366 cppsymbols=`echo $cppsymbols`
21367 cppccsymbols="$cppsymbols"
21369 if $test -s ccsym.com; then
21370 echo "Your C compiler and pre-processor define these symbols:"
21371 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21374 cppccsymbols=`$cat ccsym.com`
21375 cppccsymbols=`echo $cppccsymbols`
21376 $test "$silent" || sleep 1
21378 if $test -s ccsym.cpp; then
21379 $test "$also" && echo " "
21380 echo "Your C pre-processor ${also}defines the following symbols:"
21381 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21383 cppsymbols=`$cat ccsym.cpp`
21384 cppsymbols=`echo $cppsymbols`
21385 $test "$silent" || sleep 1
21387 if $test -s ccsym.own; then
21388 $test "$also" && echo " "
21389 echo "Your C compiler ${also}defines the following cpp symbols:"
21390 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21391 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21392 ccsymbols=`$cat ccsym.own`
21393 ccsymbols=`echo $ccsymbols`
21394 $test "$silent" || sleep 1
21398 : see if this is a termio system
21402 if $test `./findhdr termios.h`; then
21403 set tcsetattr i_termios
21409 "$define") echo "You have POSIX termios.h... good!" >&4;;
21410 *) if ./Cppsym pyr; then
21411 case "`/bin/universe`" in
21412 ucb) if $test `./findhdr sgtty.h`; then
21414 echo "<sgtty.h> found." >&4
21416 echo "System is pyramid with BSD universe."
21417 ./warn "<sgtty.h> not found--you could have problems."
21419 *) if $test `./findhdr termio.h`; then
21421 echo "<termio.h> found." >&4
21423 echo "System is pyramid with USG universe."
21424 ./warn "<termio.h> not found--you could have problems."
21428 if $test `./findhdr termio.h`; then
21429 echo "<termio.h> found." >&4
21431 elif $test `./findhdr sgtty.h`; then
21432 echo "<sgtty.h> found." >&4
21435 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21438 if $test `./findhdr sgtty.h`; then
21439 echo "<sgtty.h> found." >&4
21441 elif $test `./findhdr termio.h`; then
21442 echo "<termio.h> found." >&4
21445 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21449 set i_termio; eval $setvar
21450 val=$val2; set i_sgtty; eval $setvar
21451 val=$val3; set i_termios; eval $setvar
21453 : see if stddef is available
21454 set stddef.h i_stddef
21457 : see if sys/access.h is available
21458 set sys/access.h i_sysaccess
21461 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21462 set sys/filio.h i_sysfilio
21465 if $test `./findhdr sys/ioctl.h`; then
21467 echo '<sys/ioctl.h> found.' >&4
21470 if $test $i_sysfilio = "$define"; then
21471 echo '<sys/ioctl.h> NOT found.' >&4
21473 $test $i_sgtty = "$define" && xxx="sgtty.h"
21474 $test $i_termio = "$define" && xxx="termio.h"
21475 $test $i_termios = "$define" && xxx="termios.h"
21476 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21482 : see if socket ioctl defs are in sys/sockio.h
21484 xxx=`./findhdr sys/sockio.h`
21485 if $test "$xxx"; then
21486 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21488 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21491 echo "No socket ioctls found in <sys/sockio.h>." >&4
21496 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21502 : see if this is a syslog.h system
21503 set syslog.h i_syslog
21506 : see if this is a sys/mode.h system
21507 set sys/mode.h i_sysmode
21510 : see if there is a sys/poll.h file
21511 set sys/poll.h i_syspoll
21514 : see if sys/resource.h has to be included
21515 set sys/resource.h i_sysresrc
21518 : see if sys/security.h is available
21519 set sys/security.h i_syssecrt
21522 : see if this is a sys/statvfs.h system
21523 set sys/statvfs.h i_sysstatvfs
21526 : see if this is a sys/un.h system
21527 set sys/un.h i_sysun
21530 : see if this is a sys/utsname.h system
21531 set sys/utsname.h i_sysutsname
21534 : see if this is a syswait system
21535 set sys/wait.h i_syswait
21538 : see if this is a ustat.h system
21539 set ustat.h i_ustat
21542 : see if this is an utime system
21543 set utime.h i_utime
21546 : see if this is a vfork system
21549 set vfork.h i_vfork
21559 echo "Looking for extensions..." >&4
21560 : If we are using the old config.sh, known_extensions may contain
21561 : old or inaccurate or duplicate values.
21562 known_extensions=''
21563 nonxs_extensions=''
21564 : We do not use find because it might not be available.
21565 : We do not just use MANIFEST because the user may have dropped
21566 : some additional extensions into the source tree and expect them
21569 : Function to recursively find available extensions, ignoring DynaLoader
21570 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21574 DynaLoader|dynaload) ;;
21576 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21577 known_extensions="$known_extensions $1$xxx";
21578 elif $test -f $xxx/Makefile.PL; then
21579 nonxs_extensions="$nonxs_extensions $1$xxx";
21581 if $test -d $xxx -a $# -lt 10; then
21584 eval $find_extensions;
21596 eval $find_extensions
21597 # Special case: Add in modules that nest beyond the first level.
21598 # Currently threads/shared and Hash/Util/FieldHash, since they are
21599 # not picked up by the recursive find above (and adding in general
21600 # recursive finding breaks SDBM_File/sdbm).
21601 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21602 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21603 set X $known_extensions
21605 known_extensions="$*"
21606 set X $nonxs_extensions
21608 nonxs_extensions="$*"
21611 : Now see which are supported on this system.
21613 for xxx in $known_extensions ; do
21617 $define) avail_ext="$avail_ext $xxx" ;;
21620 GDBM_File|gdbm_fil)
21622 $define) avail_ext="$avail_ext $xxx" ;;
21625 I18N/Langinfo|i18n_lan)
21626 case "$i_langinfo$d_nl_langinfo" in
21627 $define$define) avail_ext="$avail_ext $xxx" ;;
21631 : XXX Do we need a useipcsysv variable here
21632 case "${d_msg}${d_sem}${d_shm}" in
21633 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21636 NDBM_File|ndbm_fil)
21639 case "$osname-$use64bitint" in
21642 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21645 *) avail_ext="$avail_ext $xxx" ;;
21650 ODBM_File|odbm_fil)
21651 case "${i_dbm}${i_rpcsvcdbm}" in
21653 case "$d_cplusplus" in
21654 define) ;; # delete as a function name will not work
21655 *) case "$osname-$use64bitint" in
21658 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21661 *) avail_ext="$avail_ext $xxx" ;;
21669 case "$useopcode" in
21670 true|define|y) avail_ext="$avail_ext $xxx" ;;
21674 case "$useposix" in
21675 true|define|y) avail_ext="$avail_ext $xxx" ;;
21679 case "$d_socket" in
21682 beos) ;; # not unless BONE
21683 *) avail_ext="$avail_ext $xxx" ;;
21688 Sys/Syslog|sys/syslog)
21689 : XXX syslog requires socket
21690 case "$d_socket" in
21691 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21695 case "$usethreads" in
21697 case "$use5005threads" in
21698 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21702 threads|threads/shared)
21703 # threads and threads::shared are special cases.
21704 # To stop people from asking "Perl 5.8.0 was supposed
21705 # to have this new fancy threads implementation but my
21706 # perl doesn't have it" and from people trying to
21707 # (re)install the threads module using CPAN.pm and
21708 # CPAN.pm then offering to reinstall Perl 5.8.0,
21709 # the threads.pm and threads/shared.pm will always be
21710 # there, croaking informatively ("you need to rebuild
21711 # all of Perl with threads, sorry") when threads haven't
21712 # been compiled in.
21714 avail_ext="$avail_ext $xxx"
21718 cygwin) avail_ext="$avail_ext $xxx" ;;
21721 XS/APItest|xs/apitest)
21722 # This is just for testing. Skip it unless we have dynamic loading.
21725 $define) avail_ext="$avail_ext $xxx" ;;
21728 XS/Typemap|xs/typemap)
21729 # This is just for testing. Skip it unless we have dynamic loading.
21731 $define) avail_ext="$avail_ext $xxx" ;;
21734 *) avail_ext="$avail_ext $xxx"
21743 case "$onlyextensions" in
21745 *) keepextensions=''
21746 echo "You have requested that only certains extensions be included..." >&4
21747 for i in $onlyextensions; do
21748 case " $avail_ext " in
21750 echo "Keeping extension $i."
21751 keepextensions="$keepextensions $i"
21753 *) echo "Ignoring extension $i." ;;
21756 avail_ext="$keepextensions"
21760 case "$noextensions" in
21762 *) keepextensions=''
21763 echo "You have requested that certain extensions be ignored..." >&4
21764 for i in $avail_ext; do
21765 case " $noextensions " in
21766 *" $i "*) echo "Ignoring extension $i." ;;
21767 *) echo "Keeping extension $i.";
21768 keepextensions="$keepextensions $i"
21772 avail_ext="$keepextensions"
21776 : Now see which nonxs extensions are supported on this system.
21777 : For now assume all are.
21779 for xxx in $nonxs_extensions ; do
21781 *) nonxs_ext="$nonxs_ext $xxx"
21793 A number of extensions are supplied with $package. You may choose to
21794 compile these extensions for dynamic loading (the default), compile
21795 them into the $package executable (static loading), or not include
21796 them at all. Answer "none" to include no extensions.
21797 Note that DynaLoader is always built and need not be mentioned here.
21800 case "$dynamic_ext" in
21802 : Exclude those listed in static_ext
21804 for xxx in $avail_ext; do
21805 case " $static_ext " in
21807 *) dflt="$dflt $xxx" ;;
21814 *) dflt="$dynamic_ext"
21815 # Perhaps we are reusing an old out-of-date config.sh.
21818 if test X"$dynamic_ext" != X"$avail_ext"; then
21820 NOTICE: Your previous config.sh list may be incorrect.
21821 The extensions now available to you are
21823 but the default list from your previous config.sh is
21835 rp="What extensions do you wish to load dynamically?"
21838 none) dynamic_ext=' ' ;;
21839 *) dynamic_ext="$ans" ;;
21842 case "$static_ext" in
21844 : Exclude those already listed in dynamic linking
21846 for xxx in $avail_ext; do
21847 case " $dynamic_ext " in
21849 *) dflt="$dflt $xxx" ;;
21856 *) dflt="$static_ext"
21863 rp="What extensions do you wish to load statically?"
21866 none) static_ext=' ' ;;
21867 *) static_ext="$ans" ;;
21872 A number of extensions are supplied with $package. Answer "none"
21873 to include no extensions.
21874 Note that DynaLoader is always built and need not be mentioned here.
21877 case "$static_ext" in
21878 '') dflt="$avail_ext" ;;
21879 *) dflt="$static_ext"
21880 # Perhaps we are reusing an old out-of-date config.sh.
21883 if test X"$static_ext" != X"$avail_ext"; then
21885 NOTICE: Your previous config.sh list may be incorrect.
21886 The extensions now available to you are
21888 but the default list from your previous config.sh is
21897 : Exclude those that are not xs extensions
21901 rp="What extensions do you wish to include?"
21904 none) static_ext=' ' ;;
21905 *) static_ext="$ans" ;;
21910 # Encode is a special case. If we are building Encode as a static
21911 # extension, we need to explicitly list its subextensions as well.
21912 # For other nested extensions, this is handled automatically by
21913 # the appropriate Makefile.PL.
21914 case " $static_ext " in
21915 *" Encode "*) # Add the subextensions of Encode
21917 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21918 static_ext="$static_ext Encode/$xxx"
21924 set X $dynamic_ext $static_ext $nonxs_ext
21928 # Sanity check: We require an extension suitable for use with
21929 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21930 # should show up as failures in the test suite, but it's helpful to
21931 # catch them now.) The 'extensions' list is normally sorted
21932 # alphabetically, so we need to accept either
21933 # DB_File ... Fcntl ... IO ....
21934 # or something like
21935 # Fcntl ... NDBM_File ... IO ....
21936 case " $extensions" in
21937 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21938 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21939 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21940 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21941 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21945 : Remove libraries needed only for extensions
21946 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21947 : The exception is SunOS 4.x, which needs them.
21948 case "${osname}X${osvers}" in
21952 *) case "$usedl" in
21953 $define|true|[yY]*)
21954 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21958 *) perllibs="$libs"
21964 : Remove build directory name from cppstdin so it can be used from
21965 : either the present location or the final installed location.
21967 : Get out of the UU directory to get correct path name.
21969 case "$cppstdin" in
21971 echo "Stripping down cppstdin path name"
21977 : end of configuration questions
21979 echo "End of configuration questions."
21982 : back to where it started
21983 if test -d ../UU; then
21987 : configuration may be unconditionally patched via a 'config.arch' file
21988 if $test -f config.arch; then
21989 echo "I see a config.arch file, loading it." >&4
21993 : configuration may be patched via a 'config.over' file
21994 if $test -f config.over; then
21997 rp='I see a config.over file. Do you wish to load it?'
22000 n*) echo "OK, I'll ignore it.";;
22002 echo "Configuration override changes have been loaded."
22007 : in case they want portability, strip down executable paths
22008 case "$d_portable" in
22011 echo "Stripping down executable paths..." >&4
22012 for file in $loclist $trylist; do
22014 eval $file=`basename $temp`
22019 : create config.sh file
22021 echo "Creating config.sh..." >&4
22022 $spitshell <<EOT >config.sh
22025 # This file was produced by running the Configure script. It holds all the
22026 # definitions figured out by Configure. Should you modify one of these values,
22027 # do not forget to propagate your changes by running "Configure -der". You may
22028 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22031 # Package name : $package
22032 # Source directory : $src
22033 # Configuration time: $cf_time
22034 # Configured by : $cf_by
22035 # Target system : $myuname
22038 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22039 $spitshell <<EOT >>config.sh
22048 Revision='$Revision'
22056 alignbytes='$alignbytes'
22057 ansi2knr='$ansi2knr'
22058 aphostname='$aphostname'
22059 api_revision='$api_revision'
22060 api_subversion='$api_subversion'
22061 api_version='$api_version'
22062 api_versionstring='$api_versionstring'
22065 archlibexp='$archlibexp'
22066 archname64='$archname64'
22067 archname='$archname'
22068 archobjs='$archobjs'
22069 asctime_r_proto='$asctime_r_proto'
22077 byteorder='$byteorder'
22079 castflags='$castflags'
22082 cccdlflags='$cccdlflags'
22083 ccdlflags='$ccdlflags'
22085 ccflags_uselargefiles='$ccflags_uselargefiles'
22087 ccsymbols='$ccsymbols'
22088 ccversion='$ccversion'
22090 cf_email='$cf_email'
22095 clocktype='$clocktype'
22097 compress='$compress'
22098 contains='$contains'
22102 cpp_stuff='$cpp_stuff'
22103 cppccsymbols='$cppccsymbols'
22104 cppflags='$cppflags'
22106 cppminus='$cppminus'
22108 cppstdin='$cppstdin'
22109 cppsymbols='$cppsymbols'
22110 crypt_r_proto='$crypt_r_proto'
22111 cryptlib='$cryptlib'
22113 ctermid_r_proto='$ctermid_r_proto'
22114 ctime_r_proto='$ctime_r_proto'
22115 d_Gconvert='$d_Gconvert'
22116 d_PRIEUldbl='$d_PRIEUldbl'
22117 d_PRIFUldbl='$d_PRIFUldbl'
22118 d_PRIGUldbl='$d_PRIGUldbl'
22119 d_PRIXU64='$d_PRIXU64'
22120 d_PRId64='$d_PRId64'
22121 d_PRIeldbl='$d_PRIeldbl'
22122 d_PRIfldbl='$d_PRIfldbl'
22123 d_PRIgldbl='$d_PRIgldbl'
22124 d_PRIi64='$d_PRIi64'
22125 d_PRIo64='$d_PRIo64'
22126 d_PRIu64='$d_PRIu64'
22127 d_PRIx64='$d_PRIx64'
22128 d_SCNfldbl='$d_SCNfldbl'
22129 d__fwalk='$d__fwalk'
22130 d_access='$d_access'
22131 d_accessx='$d_accessx'
22134 d_archlib='$d_archlib'
22135 d_asctime64='$d_asctime64'
22136 d_asctime_r='$d_asctime_r'
22139 d_attribute_format='$d_attribute_format'
22140 d_attribute_malloc='$d_attribute_malloc'
22141 d_attribute_nonnull='$d_attribute_nonnull'
22142 d_attribute_noreturn='$d_attribute_noreturn'
22143 d_attribute_pure='$d_attribute_pure'
22144 d_attribute_unused='$d_attribute_unused'
22145 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22149 d_bsdgetpgrp='$d_bsdgetpgrp'
22150 d_bsdsetpgrp='$d_bsdsetpgrp'
22151 d_builtin_choose_expr='$d_builtin_choose_expr'
22152 d_builtin_expect='$d_builtin_expect'
22154 d_c99_variadic_macros='$d_c99_variadic_macros'
22155 d_casti32='$d_casti32'
22156 d_castneg='$d_castneg'
22157 d_charvspr='$d_charvspr'
22159 d_chroot='$d_chroot'
22160 d_chsize='$d_chsize'
22162 d_clearenv='$d_clearenv'
22163 d_closedir='$d_closedir'
22164 d_cmsghdr_s='$d_cmsghdr_s'
22166 d_copysignl='$d_copysignl'
22167 d_cplusplus='$d_cplusplus'
22169 d_crypt_r='$d_crypt_r'
22171 d_ctermid='$d_ctermid'
22172 d_ctermid_r='$d_ctermid_r'
22173 d_ctime64='$d_ctime64'
22174 d_ctime_r='$d_ctime_r'
22175 d_cuserid='$d_cuserid'
22176 d_dbl_dig='$d_dbl_dig'
22177 d_dbminitproto='$d_dbminitproto'
22178 d_difftime64='$d_difftime64'
22179 d_difftime='$d_difftime'
22180 d_dir_dd_fd='$d_dir_dd_fd'
22182 d_dirnamlen='$d_dirnamlen'
22183 d_dlerror='$d_dlerror'
22184 d_dlopen='$d_dlopen'
22185 d_dlsymun='$d_dlsymun'
22186 d_dosuid='$d_dosuid'
22187 d_drand48_r='$d_drand48_r'
22188 d_drand48proto='$d_drand48proto'
22190 d_eaccess='$d_eaccess'
22191 d_endgrent='$d_endgrent'
22192 d_endgrent_r='$d_endgrent_r'
22193 d_endhent='$d_endhent'
22194 d_endhostent_r='$d_endhostent_r'
22195 d_endnent='$d_endnent'
22196 d_endnetent_r='$d_endnetent_r'
22197 d_endpent='$d_endpent'
22198 d_endprotoent_r='$d_endprotoent_r'
22199 d_endpwent='$d_endpwent'
22200 d_endpwent_r='$d_endpwent_r'
22201 d_endsent='$d_endsent'
22202 d_endservent_r='$d_endservent_r'
22203 d_eofnblk='$d_eofnblk'
22204 d_eunice='$d_eunice'
22205 d_faststdio='$d_faststdio'
22206 d_fchdir='$d_fchdir'
22207 d_fchmod='$d_fchmod'
22208 d_fchown='$d_fchown'
22210 d_fcntl_can_lock='$d_fcntl_can_lock'
22211 d_fd_macros='$d_fd_macros'
22212 d_fd_set='$d_fd_set'
22213 d_fds_bits='$d_fds_bits'
22214 d_fgetpos='$d_fgetpos'
22215 d_finite='$d_finite'
22216 d_finitel='$d_finitel'
22217 d_flexfnam='$d_flexfnam'
22219 d_flockproto='$d_flockproto'
22221 d_fp_class='$d_fp_class'
22222 d_fpathconf='$d_fpathconf'
22223 d_fpclass='$d_fpclass'
22224 d_fpclassify='$d_fpclassify'
22225 d_fpclassl='$d_fpclassl'
22226 d_fpos64_t='$d_fpos64_t'
22227 d_frexpl='$d_frexpl'
22228 d_fs_data_s='$d_fs_data_s'
22229 d_fseeko='$d_fseeko'
22230 d_fsetpos='$d_fsetpos'
22231 d_fstatfs='$d_fstatfs'
22232 d_fstatvfs='$d_fstatvfs'
22234 d_ftello='$d_ftello'
22236 d_futimes='$d_futimes'
22237 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22238 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22239 d_getcwd='$d_getcwd'
22240 d_getespwnam='$d_getespwnam'
22241 d_getfsstat='$d_getfsstat'
22242 d_getgrent='$d_getgrent'
22243 d_getgrent_r='$d_getgrent_r'
22244 d_getgrgid_r='$d_getgrgid_r'
22245 d_getgrnam_r='$d_getgrnam_r'
22246 d_getgrps='$d_getgrps'
22247 d_gethbyaddr='$d_gethbyaddr'
22248 d_gethbyname='$d_gethbyname'
22249 d_gethent='$d_gethent'
22250 d_gethname='$d_gethname'
22251 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22252 d_gethostbyname_r='$d_gethostbyname_r'
22253 d_gethostent_r='$d_gethostent_r'
22254 d_gethostprotos='$d_gethostprotos'
22255 d_getitimer='$d_getitimer'
22256 d_getlogin='$d_getlogin'
22257 d_getlogin_r='$d_getlogin_r'
22258 d_getmnt='$d_getmnt'
22259 d_getmntent='$d_getmntent'
22260 d_getnbyaddr='$d_getnbyaddr'
22261 d_getnbyname='$d_getnbyname'
22262 d_getnent='$d_getnent'
22263 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22264 d_getnetbyname_r='$d_getnetbyname_r'
22265 d_getnetent_r='$d_getnetent_r'
22266 d_getnetprotos='$d_getnetprotos'
22267 d_getpagsz='$d_getpagsz'
22268 d_getpbyname='$d_getpbyname'
22269 d_getpbynumber='$d_getpbynumber'
22270 d_getpent='$d_getpent'
22271 d_getpgid='$d_getpgid'
22272 d_getpgrp2='$d_getpgrp2'
22273 d_getpgrp='$d_getpgrp'
22274 d_getppid='$d_getppid'
22275 d_getprior='$d_getprior'
22276 d_getprotobyname_r='$d_getprotobyname_r'
22277 d_getprotobynumber_r='$d_getprotobynumber_r'
22278 d_getprotoent_r='$d_getprotoent_r'
22279 d_getprotoprotos='$d_getprotoprotos'
22280 d_getprpwnam='$d_getprpwnam'
22281 d_getpwent='$d_getpwent'
22282 d_getpwent_r='$d_getpwent_r'
22283 d_getpwnam_r='$d_getpwnam_r'
22284 d_getpwuid_r='$d_getpwuid_r'
22285 d_getsbyname='$d_getsbyname'
22286 d_getsbyport='$d_getsbyport'
22287 d_getsent='$d_getsent'
22288 d_getservbyname_r='$d_getservbyname_r'
22289 d_getservbyport_r='$d_getservbyport_r'
22290 d_getservent_r='$d_getservent_r'
22291 d_getservprotos='$d_getservprotos'
22292 d_getspnam='$d_getspnam'
22293 d_getspnam_r='$d_getspnam_r'
22294 d_gettimeod='$d_gettimeod'
22295 d_gmtime64='$d_gmtime64'
22296 d_gmtime_r='$d_gmtime_r'
22297 d_gnulibc='$d_gnulibc'
22298 d_grpasswd='$d_grpasswd'
22299 d_hasmntopt='$d_hasmntopt'
22301 d_ilogbl='$d_ilogbl'
22302 d_inc_version_list='$d_inc_version_list'
22304 d_inetaton='$d_inetaton'
22305 d_int64_t='$d_int64_t'
22306 d_isascii='$d_isascii'
22307 d_isfinite='$d_isfinite'
22310 d_isnanl='$d_isnanl'
22311 d_killpg='$d_killpg'
22312 d_lchown='$d_lchown'
22313 d_ldbl_dig='$d_ldbl_dig'
22314 d_libm_lib_version='$d_libm_lib_version'
22316 d_localtime64='$d_localtime64'
22317 d_localtime_r='$d_localtime_r'
22318 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22319 d_locconv='$d_locconv'
22321 d_longdbl='$d_longdbl'
22322 d_longlong='$d_longlong'
22323 d_lseekproto='$d_lseekproto'
22325 d_madvise='$d_madvise'
22326 d_malloc_good_size='$d_malloc_good_size'
22327 d_malloc_size='$d_malloc_size'
22329 d_mbstowcs='$d_mbstowcs'
22330 d_mbtowc='$d_mbtowc'
22331 d_memchr='$d_memchr'
22332 d_memcmp='$d_memcmp'
22333 d_memcpy='$d_memcpy'
22334 d_memmove='$d_memmove'
22335 d_memset='$d_memset'
22337 d_mkdtemp='$d_mkdtemp'
22338 d_mkfifo='$d_mkfifo'
22339 d_mkstemp='$d_mkstemp'
22340 d_mkstemps='$d_mkstemps'
22341 d_mktime64='$d_mktime64'
22342 d_mktime='$d_mktime'
22345 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22346 d_modflproto='$d_modflproto'
22347 d_mprotect='$d_mprotect'
22349 d_msg_ctrunc='$d_msg_ctrunc'
22350 d_msg_dontroute='$d_msg_dontroute'
22351 d_msg_oob='$d_msg_oob'
22352 d_msg_peek='$d_msg_peek'
22353 d_msg_proxy='$d_msg_proxy'
22354 d_msgctl='$d_msgctl'
22355 d_msgget='$d_msgget'
22356 d_msghdr_s='$d_msghdr_s'
22357 d_msgrcv='$d_msgrcv'
22358 d_msgsnd='$d_msgsnd'
22360 d_munmap='$d_munmap'
22361 d_mymalloc='$d_mymalloc'
22363 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22365 d_nl_langinfo='$d_nl_langinfo'
22366 d_nv_preserves_uv='$d_nv_preserves_uv'
22367 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22368 d_off64_t='$d_off64_t'
22369 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22370 d_oldpthreads='$d_oldpthreads'
22371 d_oldsock='$d_oldsock'
22373 d_pathconf='$d_pathconf'
22375 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22376 d_phostname='$d_phostname'
22379 d_portable='$d_portable'
22380 d_printf_format_null='$d_printf_format_null'
22381 d_procselfexe='$d_procselfexe'
22382 d_pseudofork='$d_pseudofork'
22383 d_pthread_atfork='$d_pthread_atfork'
22384 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22385 d_pthread_yield='$d_pthread_yield'
22387 d_pwchange='$d_pwchange'
22388 d_pwclass='$d_pwclass'
22389 d_pwcomment='$d_pwcomment'
22390 d_pwexpire='$d_pwexpire'
22391 d_pwgecos='$d_pwgecos'
22392 d_pwpasswd='$d_pwpasswd'
22393 d_pwquota='$d_pwquota'
22396 d_random_r='$d_random_r'
22397 d_readdir64_r='$d_readdir64_r'
22398 d_readdir='$d_readdir'
22399 d_readdir_r='$d_readdir_r'
22400 d_readlink='$d_readlink'
22402 d_recvmsg='$d_recvmsg'
22403 d_rename='$d_rename'
22404 d_rewinddir='$d_rewinddir'
22406 d_safebcpy='$d_safebcpy'
22407 d_safemcpy='$d_safemcpy'
22408 d_sanemcmp='$d_sanemcmp'
22409 d_sbrkproto='$d_sbrkproto'
22410 d_scalbnl='$d_scalbnl'
22411 d_sched_yield='$d_sched_yield'
22412 d_scm_rights='$d_scm_rights'
22413 d_seekdir='$d_seekdir'
22414 d_select='$d_select'
22416 d_semctl='$d_semctl'
22417 d_semctl_semid_ds='$d_semctl_semid_ds'
22418 d_semctl_semun='$d_semctl_semun'
22419 d_semget='$d_semget'
22421 d_sendmsg='$d_sendmsg'
22422 d_setegid='$d_setegid'
22423 d_seteuid='$d_seteuid'
22424 d_setgrent='$d_setgrent'
22425 d_setgrent_r='$d_setgrent_r'
22426 d_setgrps='$d_setgrps'
22427 d_sethent='$d_sethent'
22428 d_sethostent_r='$d_sethostent_r'
22429 d_setitimer='$d_setitimer'
22430 d_setlinebuf='$d_setlinebuf'
22431 d_setlocale='$d_setlocale'
22432 d_setlocale_r='$d_setlocale_r'
22433 d_setnent='$d_setnent'
22434 d_setnetent_r='$d_setnetent_r'
22435 d_setpent='$d_setpent'
22436 d_setpgid='$d_setpgid'
22437 d_setpgrp2='$d_setpgrp2'
22438 d_setpgrp='$d_setpgrp'
22439 d_setprior='$d_setprior'
22440 d_setproctitle='$d_setproctitle'
22441 d_setprotoent_r='$d_setprotoent_r'
22442 d_setpwent='$d_setpwent'
22443 d_setpwent_r='$d_setpwent_r'
22444 d_setregid='$d_setregid'
22445 d_setresgid='$d_setresgid'
22446 d_setresuid='$d_setresuid'
22447 d_setreuid='$d_setreuid'
22448 d_setrgid='$d_setrgid'
22449 d_setruid='$d_setruid'
22450 d_setsent='$d_setsent'
22451 d_setservent_r='$d_setservent_r'
22452 d_setsid='$d_setsid'
22453 d_setvbuf='$d_setvbuf'
22457 d_shmatprototype='$d_shmatprototype'
22458 d_shmctl='$d_shmctl'
22460 d_shmget='$d_shmget'
22461 d_sigaction='$d_sigaction'
22462 d_signbit='$d_signbit'
22463 d_sigprocmask='$d_sigprocmask'
22464 d_sigsetjmp='$d_sigsetjmp'
22465 d_sitearch='$d_sitearch'
22466 d_snprintf='$d_snprintf'
22467 d_sockatmark='$d_sockatmark'
22468 d_sockatmarkproto='$d_sockatmarkproto'
22469 d_socket='$d_socket'
22470 d_socklen_t='$d_socklen_t'
22471 d_sockpair='$d_sockpair'
22472 d_socks5_init='$d_socks5_init'
22473 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22475 d_srand48_r='$d_srand48_r'
22476 d_srandom_r='$d_srandom_r'
22477 d_sresgproto='$d_sresgproto'
22478 d_sresuproto='$d_sresuproto'
22479 d_statblks='$d_statblks'
22480 d_statfs_f_flags='$d_statfs_f_flags'
22481 d_statfs_s='$d_statfs_s'
22482 d_statvfs='$d_statvfs'
22483 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22484 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22485 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22486 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22487 d_stdio_stream_array='$d_stdio_stream_array'
22488 d_stdiobase='$d_stdiobase'
22489 d_stdstdio='$d_stdstdio'
22490 d_strchr='$d_strchr'
22491 d_strcoll='$d_strcoll'
22492 d_strctcpy='$d_strctcpy'
22493 d_strerrm='$d_strerrm'
22494 d_strerror='$d_strerror'
22495 d_strerror_r='$d_strerror_r'
22496 d_strftime='$d_strftime'
22497 d_strlcat='$d_strlcat'
22498 d_strlcpy='$d_strlcpy'
22499 d_strtod='$d_strtod'
22500 d_strtol='$d_strtol'
22501 d_strtold='$d_strtold'
22502 d_strtoll='$d_strtoll'
22503 d_strtoq='$d_strtoq'
22504 d_strtoul='$d_strtoul'
22505 d_strtoull='$d_strtoull'
22506 d_strtouq='$d_strtouq'
22507 d_strxfrm='$d_strxfrm'
22508 d_suidsafe='$d_suidsafe'
22509 d_symlink='$d_symlink'
22510 d_syscall='$d_syscall'
22511 d_syscallproto='$d_syscallproto'
22512 d_sysconf='$d_sysconf'
22513 d_sysernlst='$d_sysernlst'
22514 d_syserrlst='$d_syserrlst'
22515 d_system='$d_system'
22516 d_tcgetpgrp='$d_tcgetpgrp'
22517 d_tcsetpgrp='$d_tcsetpgrp'
22518 d_telldir='$d_telldir'
22519 d_telldirproto='$d_telldirproto'
22521 d_timegm='$d_timegm'
22523 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22524 d_tm_tm_zone='$d_tm_tm_zone'
22525 d_tmpnam_r='$d_tmpnam_r'
22526 d_truncate='$d_truncate'
22527 d_ttyname_r='$d_ttyname_r'
22528 d_tzname='$d_tzname'
22529 d_u32align='$d_u32align'
22530 d_ualarm='$d_ualarm'
22533 d_union_semun='$d_union_semun'
22534 d_unordered='$d_unordered'
22535 d_unsetenv='$d_unsetenv'
22536 d_usleep='$d_usleep'
22537 d_usleepproto='$d_usleepproto'
22539 d_vendorarch='$d_vendorarch'
22540 d_vendorbin='$d_vendorbin'
22541 d_vendorlib='$d_vendorlib'
22542 d_vendorscript='$d_vendorscript'
22544 d_void_closedir='$d_void_closedir'
22545 d_voidsig='$d_voidsig'
22546 d_voidtty='$d_voidtty'
22547 d_volatile='$d_volatile'
22548 d_vprintf='$d_vprintf'
22549 d_vsnprintf='$d_vsnprintf'
22551 d_waitpid='$d_waitpid'
22552 d_wcstombs='$d_wcstombs'
22553 d_wctomb='$d_wctomb'
22554 d_writev='$d_writev'
22557 db_hashtype='$db_hashtype'
22558 db_prefixtype='$db_prefixtype'
22559 db_version_major='$db_version_major'
22560 db_version_minor='$db_version_minor'
22561 db_version_patch='$db_version_patch'
22562 defvoidused='$defvoidused'
22563 direntrytype='$direntrytype'
22566 doublesize='$doublesize'
22568 drand48_r_proto='$drand48_r_proto'
22570 dynamic_ext='$dynamic_ext'
22576 endgrent_r_proto='$endgrent_r_proto'
22577 endhostent_r_proto='$endhostent_r_proto'
22578 endnetent_r_proto='$endnetent_r_proto'
22579 endprotoent_r_proto='$endprotoent_r_proto'
22580 endpwent_r_proto='$endpwent_r_proto'
22581 endservent_r_proto='$endservent_r_proto'
22582 eunicefix='$eunicefix'
22585 extensions='$extensions'
22586 extern_C='$extern_C'
22588 fflushNULL='$fflushNULL'
22589 fflushall='$fflushall'
22591 firstmakefile='$firstmakefile'
22593 fpossize='$fpossize'
22594 fpostype='$fpostype'
22595 freetype='$freetype'
22598 full_csh='$full_csh'
22599 full_sed='$full_sed'
22600 gccansipedantic='$gccansipedantic'
22601 gccosandvers='$gccosandvers'
22602 gccversion='$gccversion'
22603 getgrent_r_proto='$getgrent_r_proto'
22604 getgrgid_r_proto='$getgrgid_r_proto'
22605 getgrnam_r_proto='$getgrnam_r_proto'
22606 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22607 gethostbyname_r_proto='$gethostbyname_r_proto'
22608 gethostent_r_proto='$gethostent_r_proto'
22609 getlogin_r_proto='$getlogin_r_proto'
22610 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22611 getnetbyname_r_proto='$getnetbyname_r_proto'
22612 getnetent_r_proto='$getnetent_r_proto'
22613 getprotobyname_r_proto='$getprotobyname_r_proto'
22614 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22615 getprotoent_r_proto='$getprotoent_r_proto'
22616 getpwent_r_proto='$getpwent_r_proto'
22617 getpwnam_r_proto='$getpwnam_r_proto'
22618 getpwuid_r_proto='$getpwuid_r_proto'
22619 getservbyname_r_proto='$getservbyname_r_proto'
22620 getservbyport_r_proto='$getservbyport_r_proto'
22621 getservent_r_proto='$getservent_r_proto'
22622 getspnam_r_proto='$getspnam_r_proto'
22623 gidformat='$gidformat'
22629 gmtime_r_proto='$gmtime_r_proto'
22630 gnulibc_version='$gnulibc_version'
22632 groupcat='$groupcat'
22633 groupstype='$groupstype'
22636 h_sysfile='$h_sysfile'
22639 html1dir='$html1dir'
22640 html1direxp='$html1direxp'
22641 html3dir='$html3dir'
22642 html3direxp='$html3direxp'
22651 i_arpainet='$i_arpainet'
22652 i_assert='$i_assert'
22653 i_bsdioctl='$i_bsdioctl'
22657 i_dirent='$i_dirent'
22663 i_fp_class='$i_fp_class'
22665 i_gdbm_ndbm='$i_gdbm_ndbm'
22666 i_gdbmndbm='$i_gdbmndbm'
22668 i_ieeefp='$i_ieeefp'
22669 i_inttypes='$i_inttypes'
22670 i_langinfo='$i_langinfo'
22671 i_libutil='$i_libutil'
22672 i_limits='$i_limits'
22673 i_locale='$i_locale'
22674 i_machcthr='$i_machcthr'
22675 i_malloc='$i_malloc'
22676 i_mallocmalloc='$i_mallocmalloc'
22678 i_memory='$i_memory'
22679 i_mntent='$i_mntent'
22682 i_neterrno='$i_neterrno'
22683 i_netinettcp='$i_netinettcp'
22687 i_pthread='$i_pthread'
22689 i_rpcsvcdbm='$i_rpcsvcdbm'
22692 i_shadow='$i_shadow'
22694 i_stdarg='$i_stdarg'
22695 i_stddef='$i_stddef'
22696 i_stdlib='$i_stdlib'
22697 i_string='$i_string'
22698 i_sunmath='$i_sunmath'
22699 i_sysaccess='$i_sysaccess'
22700 i_sysdir='$i_sysdir'
22701 i_sysfile='$i_sysfile'
22702 i_sysfilio='$i_sysfilio'
22704 i_sysioctl='$i_sysioctl'
22705 i_syslog='$i_syslog'
22706 i_sysmman='$i_sysmman'
22707 i_sysmode='$i_sysmode'
22708 i_sysmount='$i_sysmount'
22709 i_sysndir='$i_sysndir'
22710 i_sysparam='$i_sysparam'
22711 i_syspoll='$i_syspoll'
22712 i_sysresrc='$i_sysresrc'
22713 i_syssecrt='$i_syssecrt'
22714 i_sysselct='$i_sysselct'
22715 i_syssockio='$i_syssockio'
22716 i_sysstat='$i_sysstat'
22717 i_sysstatfs='$i_sysstatfs'
22718 i_sysstatvfs='$i_sysstatvfs'
22719 i_systime='$i_systime'
22720 i_systimek='$i_systimek'
22721 i_systimes='$i_systimes'
22722 i_systypes='$i_systypes'
22723 i_sysuio='$i_sysuio'
22725 i_sysutsname='$i_sysutsname'
22726 i_sysvfs='$i_sysvfs'
22727 i_syswait='$i_syswait'
22728 i_termio='$i_termio'
22729 i_termios='$i_termios'
22731 i_unistd='$i_unistd'
22734 i_values='$i_values'
22735 i_varargs='$i_varargs'
22736 i_varhdr='$i_varhdr'
22738 ignore_versioned_solibs='$ignore_versioned_solibs'
22739 inc_version_list='$inc_version_list'
22740 inc_version_list_init='$inc_version_list_init'
22743 initialinstalllocation='$initialinstalllocation'
22744 installarchlib='$installarchlib'
22745 installbin='$installbin'
22746 installhtml1dir='$installhtml1dir'
22747 installhtml3dir='$installhtml3dir'
22748 installman1dir='$installman1dir'
22749 installman3dir='$installman3dir'
22750 installprefix='$installprefix'
22751 installprefixexp='$installprefixexp'
22752 installprivlib='$installprivlib'
22753 installscript='$installscript'
22754 installsitearch='$installsitearch'
22755 installsitebin='$installsitebin'
22756 installsitehtml1dir='$installsitehtml1dir'
22757 installsitehtml3dir='$installsitehtml3dir'
22758 installsitelib='$installsitelib'
22759 installsiteman1dir='$installsiteman1dir'
22760 installsiteman3dir='$installsiteman3dir'
22761 installsitescript='$installsitescript'
22762 installstyle='$installstyle'
22763 installusrbinperl='$installusrbinperl'
22764 installvendorarch='$installvendorarch'
22765 installvendorbin='$installvendorbin'
22766 installvendorhtml1dir='$installvendorhtml1dir'
22767 installvendorhtml3dir='$installvendorhtml3dir'
22768 installvendorlib='$installvendorlib'
22769 installvendorman1dir='$installvendorman1dir'
22770 installvendorman3dir='$installvendorman3dir'
22771 installvendorscript='$installvendorscript'
22773 issymlink='$issymlink'
22774 ivdformat='$ivdformat'
22777 known_extensions='$known_extensions'
22780 lddlflags='$lddlflags'
22782 ldflags_uselargefiles='$ldflags_uselargefiles'
22783 ldlibpthname='$ldlibpthname'
22790 libsdirs='$libsdirs'
22791 libsfiles='$libsfiles'
22792 libsfound='$libsfound'
22793 libspath='$libspath'
22794 libswanted='$libswanted'
22795 libswanted_uselargefiles='$libswanted_uselargefiles'
22801 localtime_r_proto='$localtime_r_proto'
22802 locincpth='$locincpth'
22803 loclibpth='$loclibpth'
22804 longdblsize='$longdblsize'
22805 longlongsize='$longlongsize'
22806 longsize='$longsize'
22810 lseeksize='$lseeksize'
22811 lseektype='$lseektype'
22814 madlyobj='$madlyobj'
22815 madlysrc='$madlysrc'
22819 make_set_make='$make_set_make'
22820 mallocobj='$mallocobj'
22821 mallocsrc='$mallocsrc'
22822 malloctype='$malloctype'
22824 man1direxp='$man1direxp'
22827 man3direxp='$man3direxp'
22829 mips_type='$mips_type'
22830 mistrustnm='$mistrustnm'
22832 mmaptype='$mmaptype'
22833 modetype='$modetype'
22835 multiarch='$multiarch'
22837 myarchname='$myarchname'
22838 mydomain='$mydomain'
22839 myhostname='$myhostname'
22842 need_va_copy='$need_va_copy'
22843 netdb_hlen_type='$netdb_hlen_type'
22844 netdb_host_type='$netdb_host_type'
22845 netdb_name_type='$netdb_name_type'
22846 netdb_net_type='$netdb_net_type'
22849 nm_so_opt='$nm_so_opt'
22850 nonxs_ext='$nonxs_ext'
22852 nvEUformat='$nvEUformat'
22853 nvFUformat='$nvFUformat'
22854 nvGUformat='$nvGUformat'
22855 nv_overflows_integers_at='$nv_overflows_integers_at'
22856 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22857 nveformat='$nveformat'
22858 nvfformat='$nvfformat'
22859 nvgformat='$nvgformat'
22862 o_nonblock='$o_nonblock'
22864 old_pthread_create_joinable='$old_pthread_create_joinable'
22865 optimize='$optimize'
22866 orderlib='$orderlib'
22869 otherlibdirs='$otherlibdirs'
22873 patchlevel='$patchlevel'
22874 path_sep='$path_sep'
22877 perl_patchlevel='$perl_patchlevel'
22878 perladmin='$perladmin'
22879 perllibs='$perllibs'
22880 perlpath='$perlpath'
22882 phostname='$phostname'
22888 prefixexp='$prefixexp'
22890 privlibexp='$privlibexp'
22891 procselfexe='$procselfexe'
22892 prototype='$prototype'
22894 quadkind='$quadkind'
22895 quadtype='$quadtype'
22896 randbits='$randbits'
22897 randfunc='$randfunc'
22898 random_r_proto='$random_r_proto'
22899 randseedtype='$randseedtype'
22901 rd_nodata='$rd_nodata'
22902 readdir64_r_proto='$readdir64_r_proto'
22903 readdir_r_proto='$readdir_r_proto'
22904 revision='$revision'
22910 sGMTIME_max='$sGMTIME_max'
22911 sGMTIME_min='$sGMTIME_min'
22912 sLOCALTIME_max='$sLOCALTIME_max'
22913 sLOCALTIME_min='$sLOCALTIME_min'
22914 sPRIEUldbl='$sPRIEUldbl'
22915 sPRIFUldbl='$sPRIFUldbl'
22916 sPRIGUldbl='$sPRIGUldbl'
22917 sPRIXU64='$sPRIXU64'
22919 sPRIeldbl='$sPRIeldbl'
22920 sPRIfldbl='$sPRIfldbl'
22921 sPRIgldbl='$sPRIgldbl'
22926 sSCNfldbl='$sSCNfldbl'
22927 sched_yield='$sched_yield'
22928 scriptdir='$scriptdir'
22929 scriptdirexp='$scriptdirexp'
22931 seedfunc='$seedfunc'
22932 selectminbits='$selectminbits'
22933 selecttype='$selecttype'
22934 sendmail='$sendmail'
22935 setgrent_r_proto='$setgrent_r_proto'
22936 sethostent_r_proto='$sethostent_r_proto'
22937 setlocale_r_proto='$setlocale_r_proto'
22938 setnetent_r_proto='$setnetent_r_proto'
22939 setprotoent_r_proto='$setprotoent_r_proto'
22940 setpwent_r_proto='$setpwent_r_proto'
22941 setservent_r_proto='$setservent_r_proto'
22944 sharpbang='$sharpbang'
22945 shmattype='$shmattype'
22946 shortsize='$shortsize'
22949 sig_count='$sig_count'
22950 sig_name='$sig_name'
22951 sig_name_init='$sig_name_init'
22953 sig_num_init='$sig_num_init'
22954 sig_size='$sig_size'
22955 signal_t='$signal_t'
22956 sitearch='$sitearch'
22957 sitearchexp='$sitearchexp'
22959 sitebinexp='$sitebinexp'
22960 sitehtml1dir='$sitehtml1dir'
22961 sitehtml1direxp='$sitehtml1direxp'
22962 sitehtml3dir='$sitehtml3dir'
22963 sitehtml3direxp='$sitehtml3direxp'
22965 sitelib_stem='$sitelib_stem'
22966 sitelibexp='$sitelibexp'
22967 siteman1dir='$siteman1dir'
22968 siteman1direxp='$siteman1direxp'
22969 siteman3dir='$siteman3dir'
22970 siteman3direxp='$siteman3direxp'
22971 siteprefix='$siteprefix'
22972 siteprefixexp='$siteprefixexp'
22973 sitescript='$sitescript'
22974 sitescriptexp='$sitescriptexp'
22975 sizesize='$sizesize'
22976 sizetype='$sizetype'
22980 sockethdr='$sockethdr'
22981 socketlib='$socketlib'
22982 socksizetype='$socksizetype'
22984 spackage='$spackage'
22985 spitshell='$spitshell'
22986 srand48_r_proto='$srand48_r_proto'
22987 srandom_r_proto='$srandom_r_proto'
22989 ssizetype='$ssizetype'
22990 startperl='$startperl'
22992 static_ext='$static_ext'
22994 stdio_base='$stdio_base'
22995 stdio_bufsiz='$stdio_bufsiz'
22996 stdio_cnt='$stdio_cnt'
22997 stdio_filbuf='$stdio_filbuf'
22998 stdio_ptr='$stdio_ptr'
22999 stdio_stream_array='$stdio_stream_array'
23000 strerror_r_proto='$strerror_r_proto'
23003 subversion='$subversion'
23007 targetarch='$targetarch'
23011 timeincl='$timeincl'
23012 timetype='$timetype'
23013 tmpnam_r_proto='$tmpnam_r_proto'
23019 ttyname_r_proto='$ttyname_r_proto'
23028 uidformat='$uidformat'
23034 uquadtype='$uquadtype'
23035 use5005threads='$use5005threads'
23036 use64bitall='$use64bitall'
23037 use64bitint='$use64bitint'
23038 usecrosscompile='$usecrosscompile'
23039 usedevel='$usedevel'
23041 usedtrace='$usedtrace'
23042 usefaststdio='$usefaststdio'
23043 useithreads='$useithreads'
23044 uselargefiles='$uselargefiles'
23045 uselongdouble='$uselongdouble'
23046 usemallocwrap='$usemallocwrap'
23047 usemorebits='$usemorebits'
23048 usemultiplicity='$usemultiplicity'
23049 usemymalloc='$usemymalloc'
23051 useopcode='$useopcode'
23052 useperlio='$useperlio'
23053 useposix='$useposix'
23054 usereentrant='$usereentrant'
23055 userelocatableinc='$userelocatableinc'
23057 useshrplib='$useshrplib'
23058 usesitecustomize='$usesitecustomize'
23059 usesocks='$usesocks'
23060 usethreads='$usethreads'
23061 usevendorprefix='$usevendorprefix'
23062 usevfork='$usevfork'
23065 uvXUformat='$uvXUformat'
23066 uvoformat='$uvoformat'
23069 uvuformat='$uvuformat'
23070 uvxformat='$uvxformat'
23071 vendorarch='$vendorarch'
23072 vendorarchexp='$vendorarchexp'
23073 vendorbin='$vendorbin'
23074 vendorbinexp='$vendorbinexp'
23075 vendorhtml1dir='$vendorhtml1dir'
23076 vendorhtml1direxp='$vendorhtml1direxp'
23077 vendorhtml3dir='$vendorhtml3dir'
23078 vendorhtml3direxp='$vendorhtml3direxp'
23079 vendorlib='$vendorlib'
23080 vendorlib_stem='$vendorlib_stem'
23081 vendorlibexp='$vendorlibexp'
23082 vendorman1dir='$vendorman1dir'
23083 vendorman1direxp='$vendorman1direxp'
23084 vendorman3dir='$vendorman3dir'
23085 vendorman3direxp='$vendorman3direxp'
23086 vendorprefix='$vendorprefix'
23087 vendorprefixexp='$vendorprefixexp'
23088 vendorscript='$vendorscript'
23089 vendorscriptexp='$vendorscriptexp'
23091 version_patchlevel_string='$version_patchlevel_string'
23092 versiononly='$versiononly'
23094 voidflags='$voidflags'
23097 yaccflags='$yaccflags'
23102 : Add in command line options if available
23103 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23105 : add special variables
23106 $test -f $src/patchlevel.h && \
23107 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23108 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
23109 echo "PERL_CONFIG_SH=true" >>config.sh
23111 : propagate old symbols
23112 if $test -f UU/config.sh; then
23113 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23114 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23115 config.sh config.sh UU/oldconfig.sh |\
23116 $sort | $uniq -u >UU/oldsyms
23117 set X `cat UU/oldsyms`
23123 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23125 echo ": Variables propagated from previous config.sh file." >>config.sh
23126 for sym in `cat UU/oldsyms`; do
23127 echo " Propagating $hint variable "'$'"$sym..."
23128 eval 'tmp="$'"${sym}"'"'
23130 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23136 : Finish up by extracting the .SH files
23140 echo "Extraction done."
23150 If you'd like to make any changes to the config.sh file before I begin
23151 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23154 rp="Press return or use a shell escape to edit config.sh:"
23159 *) : in case they cannot read
23160 sh 1>&4 -c "$ans";;
23165 : if this fails, just run all the .SH files by hand
23174 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23181 Now you need to generate make dependencies by running "$make depend".
23182 You might prefer to run it in background: "$make depend > makedepend.out &"
23183 It can take a while, so you might not want to run it right now.
23188 rp="Run $make depend now?"
23192 $make depend && echo "Now you must run '$make'."
23195 echo "You must run '$make depend' then '$make'."
23198 elif test -f [Mm]akefile; then
23200 echo "Now you must run a $make."
23202 echo "Configure done."
23205 if $test -f Policy.sh; then
23208 If you compile $package on a different machine or from a different object
23209 directory, copy the Policy.sh file from this object directory to the
23210 new one before you run Configure -- this will help you with most of
23211 the policy defaults.
23215 if $test -f config.msg; then
23216 echo "Hmm. I also noted the following information while running:"
23218 $cat config.msg >&4
23221 $rm -f kit*isdone ark*isdone