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
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # The metaunits are also available from the public git repository:
23 # http://perl5.git.perl.org/metaconfig.git/ or
24 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
26 # See Porting/pumpkin.pod for more information on metaconfig.
29 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
31 # Generated on Fri Nov 6 07:43:05 CET 2009 [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
340 initialinstalllocation=''
369 d_attribute_deprecated=''
370 d_attribute_format=''
371 d_attribute_malloc=''
372 d_attribute_nonnull=''
373 d_attribute_noreturn=''
375 d_attribute_unused=''
376 d_attribute_warn_unused_result=''
377 d_printf_format_null=''
380 d_builtin_choose_expr=''
383 d_c99_variadic_macros=''
430 endhostent_r_proto=''
436 endprotoent_r_proto=''
442 endservent_r_proto=''
495 gethostbyaddr_r_proto=''
497 gethostbyname_r_proto=''
499 gethostent_r_proto=''
512 getnetbyaddr_r_proto=''
514 getnetbyname_r_proto=''
528 d_getprotobyname_r=''
529 getprotobyname_r_proto=''
530 d_getprotobynumber_r=''
531 getprotobynumber_r_proto=''
533 getprotoent_r_proto=''
545 getservbyname_r_proto=''
547 getservbyport_r_proto=''
549 getservent_r_proto=''
575 d_libm_lib_version=''
578 d_localtime_r_needs_tzset=''
589 d_malloc_good_size=''
631 d_old_pthread_create_joinable=''
632 old_pthread_create_joinable=''
634 d_pthread_attr_setscope=''
673 sethostent_r_proto=''
690 setprotoent_r_proto=''
702 setservent_r_proto=''
736 d_sprintf_returns_strlen=''
751 d_stdio_ptr_lval_nochange_cnt=''
752 d_stdio_ptr_lval_sets_cnt=''
896 d_gdbm_ndbm_h_uses_prototypes=''
897 d_gdbmndbm_h_uses_prototypes=''
899 d_ndbm_h_uses_prototypes=''
973 d_inc_version_list=''
975 inc_version_list_init=''
994 ignore_versioned_solibs=''
1058 d_perl_otherlibdirs=''
1066 api_versionstring=''
1072 version_patchlevel_string=''
1076 d_nv_preserves_uv=''
1077 d_nv_zero_is_allbits_zero=''
1088 nv_overflows_integers_at=''
1089 nv_preserves_uv_bits=''
1161 installsitehtml1dir=''
1164 installsitehtml3dir=''
1171 installsiteman1dir=''
1174 installsiteman3dir=''
1179 installsitescript=''
1194 d_stdio_stream_array=''
1195 stdio_stream_array=''
1212 ccflags_uselargefiles=''
1213 ldflags_uselargefiles=''
1214 libswanted_uselargefiles=''
1234 installvendorarch=''
1241 installvendorhtml1dir=''
1243 vendorhtml1direxp=''
1244 installvendorhtml3dir=''
1246 vendorhtml3direxp=''
1252 installvendorman1dir=''
1255 installvendorman3dir=''
1262 installvendorscript=''
1275 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1278 : We must find out about Eunice early
1280 if test -f /etc/unixtovms; then
1281 eunicefix=/etc/unixtovms
1283 if test -f /etc/unixtovms.exe; then
1284 eunicefix=/etc/unixtovms.exe
1287 : Set executable suffix now -- needed before hints available
1288 if test -f "/libs/version.library"; then
1291 elif test -f "/system/gnu_library/bin/ar.pm"; then
1294 elif test -n "$DJGPP"; then
1297 elif test -d c:/. -o -n "$is_os2" ; then
1304 : Trailing extension. Override this in a hint file, if needed.
1305 : Extra object files, if any, needed on this platform.
1309 : change the next line if compiling for Xenix/286 on Xenix/386
1310 xlibpth='/usr/lib/386 /lib/386'
1311 : Possible local library directories to search.
1312 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1313 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1315 : general looking path for locating libraries
1316 glibpth="/lib /usr/lib $xlibpth"
1317 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1318 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1319 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1320 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1322 : Private path used by Configure to find libraries. Its value
1323 : is prepended to libpth. This variable takes care of special
1324 : machines, like the mips. Usually, it should be empty.
1327 : default library list
1329 : some systems want to use only the non-versioned libso:s
1330 ignore_versioned_solibs=''
1331 : set usethreads on the Configure command line to enable threads.
1332 usereentrant='undef'
1333 : full support for void wanted by default
1336 : Possible local include directories to search.
1337 : Set locincpth to "" in a hint file to defeat local include searches.
1338 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1339 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1341 : no include file wanted by default
1344 : Enable -DEBUGGING and -DDEBUGGING from the command line
1351 : set useposix=false in your hint file to disable the POSIX extension.
1353 : set useopcode=false in your hint file to disable the Opcode extension.
1356 ccflags_uselargefiles=''
1357 ldflags_uselargefiles=''
1358 libswanted_uselargefiles=''
1359 : set usemultiplicity on the Configure command line to enable multiplicity.
1360 : set usesocks on the Configure command line to enable socks.
1361 : List of libraries we want.
1362 : If anyone needs extra -lxxx, put those in a hint file.
1363 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1364 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1365 : We probably want to search /usr/shlib before most other libraries.
1366 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1367 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1368 glibpth="/usr/shlib $glibpth"
1369 : Do not use vfork unless overridden by a hint file.
1372 : Find the basic shell for Bourne shell scripts
1376 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1379 if test -f "$xxx"; then
1382 : Build up a list and do a single loop so we can 'break' out.
1383 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1384 for xxx in sh bash ksh pdksh ash; do
1386 try="$try ${p}/${xxx}"
1390 if test -f "$xxx"; then
1393 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1396 elif test -f "$xxx.exe"; then
1407 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1409 Usually it's in /bin/sh. How did you even get this far?
1410 Please contact me (Perl Maintainers) at perlbug@perl.org and
1411 we'll try to straighten this all out.
1417 : see if sh knows # comments
1418 if `$sh -c '#' >/dev/null 2>&1`; then
1422 test -f $xcat$_exe || xcat=/usr/bin/cat
1423 if test ! -f $xcat$_exe; then
1424 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1425 if test -f $p/cat$_exe; then
1430 if test ! -f $xcat$_exe; then
1431 echo "Can't find cat anywhere!"
1435 echo "#!$xcat" >sharp
1438 ./sharp > today 2>/dev/null
1439 if test -s today; then
1442 echo "#! $xcat" > sharp
1445 ./sharp > today 2>/dev/null
1446 if test -s today; then
1454 echo "Your $sh doesn't grok # comments--I will strip them later on."
1457 echo "exec grep -v '^[ ]*#'" >spitshell
1459 $eunicefix spitshell
1460 spitshell=`pwd`/spitshell
1462 echo "I presume that if # doesn't work, #! won't work either!"
1467 : figure out how to guarantee sh startup
1469 '') startsh=${sharpbang}${sh} ;;
1481 : echo "Yup, it does."
1483 echo "Hmm... '$startsh' does not guarantee sh startup..."
1484 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1488 : Save command line options in file UU/cmdline.opt for later use in
1489 : generating config.sh.
1490 cat > cmdline.opt <<EOSH
1491 : Configure command line arguments.
1500 cat >>cmdline.opt <<EOSH
1501 config_arg$argn='$arg'
1503 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1506 arg_exp=`cat cmdl.opt`
1507 args_exp="$args_exp$args_sep'$arg_exp'"
1508 argn=`expr $argn + 1`
1513 : produce awk script to parse command line options
1514 cat >options.awk <<'EOF'
1516 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1518 len = length(optstr);
1519 for (i = 1; i <= len; i++) {
1520 c = substr(optstr, i, 1);
1521 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1532 if (substr(str, 1, 1) != "-") {
1533 printf("'%s'\n", str);
1537 for (i = 2; i <= len; i++) {
1538 c = substr(str, i, 1);
1540 printf("-%s\n", substr(str, i));
1546 printf("'%s'\n", substr(str, i + 1));
1559 : process the command line options
1560 set X `for arg in "$@"; do echo "X$arg"; done |
1561 sed -e s/X// | awk -f options.awk`
1566 : set up default values
1576 rm -f optdef.sh posthint.sh
1577 cat >optdef.sh <<EOS
1583 while test $# -gt 0; do
1585 -d) shift; fastread=yes;;
1586 -e) shift; alldone=cont;;
1590 if test -r "$1"; then
1593 echo "$me: cannot read config file $1." >&2
1599 -h) shift; error=true;;
1600 -r) shift; reuseval=true;;
1601 -s) shift; silent=true; realsilent=true;;
1602 -E) shift; alldone=exit;;
1603 -K) shift; knowitall=true;;
1604 -O) shift; override=true;;
1605 -S) shift; silent=true; extractsh=true;;
1610 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1611 echo "$me: ignoring -D $1" >&2
1614 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1615 *) echo "$1='define'" >> optdef.sh;;
1622 *=) echo "$1" >> optdef.sh;;
1624 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1625 echo "$me: ignoring -U $1" >&2
1627 *) echo "$1='undef'" >> optdef.sh;;
1638 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1642 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1643 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1649 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1650 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1651 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1652 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1653 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1654 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1660 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1662 echo "$yyy=''" >> posthint.sh ;;
1667 echo "$yyy='$zzz'" >> posthint.sh ;;
1669 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1671 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1676 echo "$yyy=$zzz" >> posthint.sh ;;
1677 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1681 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1684 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1692 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1693 [-U symbol] [-U symbol=] [-A command:symbol...]
1694 -d : use defaults for all answers.
1695 -e : go on without questioning past the production of config.sh.
1696 -f : specify an alternate default configuration file.
1697 -h : print this help message and exit (with an error status).
1698 -r : reuse C symbols value if possible (skips costly nm extraction).
1699 -s : silent mode, only echoes questions and essential information.
1700 -D : define symbol to have some value:
1701 -D symbol symbol gets the value 'define'
1702 -D symbol=value symbol gets the value 'value'
1703 common used examples (see INSTALL for more info):
1704 -Duse64bitint use 64bit integers
1705 -Duse64bitall use 64bit integers and pointers
1706 -Dusethreads use thread support
1707 -Dinc_version_list=none do not include older perl trees in @INC
1708 -DEBUGGING=none DEBUGGING options
1709 -Dcc=gcc choose your compiler
1710 -Dprefix=/opt/perl5 choose your destination
1711 -E : stop at the end of questions, after having produced config.sh.
1712 -K : do not use unless you know what you are doing.
1713 -O : let -D and -U override definitions from loaded configuration file.
1714 -S : perform variable substitutions on all .SH files (can mix with -f)
1715 -U : undefine symbol:
1716 -U symbol symbol gets the value 'undef'
1717 -U symbol= symbol gets completely empty
1719 -A : manipulate symbol after the platform specific hints have been applied:
1720 -A append:symbol=value append value to symbol
1721 -A symbol=value like append:, but with a separating space
1722 -A define:symbol=value define symbol to have value
1723 -A clear:symbol define symbol to be ''
1724 -A define:symbol define symbol to be 'define'
1725 -A eval:symbol=value define symbol to be eval of value
1726 -A prepend:symbol=value prepend value to symbol
1727 -A undef:symbol define symbol to be 'undef'
1728 -A undef:symbol= define symbol to be ''
1729 e.g.: -A prepend:libswanted='cl pthread '
1730 -A ccflags=-DSOME_MACRO
1731 -V : print version number and exit (with a zero status).
1738 case "$fastread$alldone" in
1741 case "$extractsh" in
1744 if test ! -t 0; then
1745 echo "Say 'sh Configure', not 'sh <Configure'"
1755 true) exec 1>/dev/null;;
1758 : run the defines and the undefines, if any, but leave the file out there...
1761 : create the posthint manipulation script and leave the file out there...
1766 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1767 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1768 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1769 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1770 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1773 : Some greps do not return status, grrr.
1774 echo "grimblepritz" >grimble
1775 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1777 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1783 : the following should work in any shell
1787 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1788 cat >contains <<'EOSS'
1789 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1794 : Find the path to the source tree
1797 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1801 *) src=`cd ../$src && pwd` ;;
1814 if test -f $rsrc/Configure && \
1815 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1817 : found it, so we are ok.
1820 for src in . .. ../.. ../../.. ../../../..; do
1821 if test -f ../$src/Configure && \
1822 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1833 Sorry, I can't seem to locate the source dir for $package. Please start
1834 Configure with an explicit path -- i.e. /some/path/Configure.
1842 echo "Sources for $package found in \"$src\"." >&4
1846 : script used to extract .SH files with variable substitutions
1847 cat >extract <<'EOS'
1849 echo "Doing variable substitutions on .SH files..."
1850 if test -f MANIFEST; then
1851 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1853 echo "(Looking for .SH files under the source directory.)"
1854 set x `(cd "$src"; find . -name "*.SH" -print)`
1858 0) set x `(cd "$src"; echo *.SH)`; shift;;
1860 if test ! -f "$src/$1"; then
1866 while test $name; do
1867 if test ! -d "$name"; then
1868 create="$name $create";
1869 name=`echo $name | sed -e "s|^[^/]*$||"`;
1870 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1875 for file in $create; do
1884 dir=`expr X$file : 'X\(.*\)/'`
1885 file=`expr X$file : 'X.*/\(.*\)'`
1886 (cd "$dir" && . ./$file)
1896 dir=`expr X$file : 'X\(.*\)/'`
1897 file=`expr X$file : 'X.*/\(.*\)'`
1898 (set x $dir; shift; eval $mkdir_p)
1899 sh <"$src/$dir/$file"
1908 if test -f "$src/config_h.SH"; then
1909 if test ! -f config.h; then
1910 : oops, they left it out of MANIFEST, probably, so do it anyway.
1911 . "$src/config_h.SH"
1916 : extract files and exit if asked to do so
1917 case "$extractsh" in
1919 case "$realsilent" in
1923 case "$config_sh" in
1924 '') config_sh='config.sh';;
1927 echo "Fetching answers from $config_sh..."
1930 test "$override" && . ./optdef.sh
1934 echo "Extraction done."
1939 : Eunice requires " " instead of "", can you believe it
1942 echo "Beginning of configuration questions for $package."
1944 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1946 : first determine how to suppress newline on echo command
1948 echo "Checking echo to see how to suppress newlines..."
1949 (echo "hi there\c" ; echo " ") >.echotmp
1950 if $contains c .echotmp >/dev/null 2>&1 ; then
1961 echo $n "The star should be here-->$c"
1965 : Now test for existence of everything in MANIFEST
1967 if test -f "$rsrc/MANIFEST"; then
1968 echo "First let's make sure your kit is complete. Checking..." >&4
1969 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1970 (split -l 50 2>/dev/null || split -50)
1973 for filelist in x??; do
1974 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1975 >/dev/null 2>>"$tmppwd/missing")
1977 if test -s missing; then
1981 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1983 You have the option of continuing the configuration process, despite the
1984 distinct possibility that your kit is damaged, by typing 'y'es. If you
1985 do, don't blame me if something goes wrong. I advise you to type 'n'o
1986 and contact the author (perlbug@perl.org).
1989 echo $n "Continue? [n] $c" >&4
1993 echo "Continuing..." >&4
1997 echo "ABORTING..." >&4
2002 echo "Looks good..."
2005 echo "There is no MANIFEST file. I hope your kit is complete !"
2009 : Find the appropriate value for a newline for tr
2011 if test -n "$DJGPP"; then
2014 if test X"$trnl" = X; then
2015 case "`echo foo|tr '\n' x 2>/dev/null`" in
2019 if test X"$trnl" = X; then
2020 case "`echo foo|tr '\012' x 2>/dev/null`" in
2021 foox) trnl='\012' ;;
2024 if test X"$trnl" = X; then
2025 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2026 fooxy) trnl='\n\r' ;;
2029 if test X"$trnl" = X; then
2032 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2038 : compute the number of columns on the terminal for proper question formatting
2043 : set up the echo used in my read
2044 myecho="case \"\$xxxm\" in
2045 '') echo $n \"\$rp $c\" >&4;;
2047 '') echo $n \"[\$xxxm] $c\";;
2049 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2051 echo $n \"[\$xxxm] $c\" >&4
2053 echo $n \"\$rp [\$xxxm] $c\" >&4
2059 : now set up to do reads with possible shell escape and default assignment
2065 case "\$fastread" in
2066 yes) case "\$dflt" in
2069 case "\$silent-\$rp" in
2074 *) case "\$silent" in
2075 true) case "\$rp" in
2080 while expr "X\$ans" : "X!" >/dev/null; do
2084 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2092 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2101 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2106 echo "(OK, I'll run with -d after this question.)" >&4
2109 echo "*** Sorry, \$1 not supported yet." >&4
2119 echo "*** Substitution done -- please confirm."
2121 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2126 echo "*** Error -- try again."
2133 case "\$ans\$xxxm\$nostick" in
2145 : create .config dir to save info across Configure sessions
2146 test -d ../.config || mkdir ../.config
2147 cat >../.config/README <<EOF
2148 This directory created by Configure to save information that should
2149 persist across sessions for $package.
2151 You may safely delete it if you wish.
2154 : See if we are using a devel version and want that
2155 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2158 usedevel="$define" ;;
2159 *) case "$xversion" in
2162 *** WHOA THERE!!! ***
2164 This is an UNSTABLE DEVELOPMENT release.
2165 The version of this $package distribution is $xversion, that is, odd,
2166 (as opposed to even) and that signifies a development release.
2167 If you want a maintenance release, you want an even-numbered version.
2169 Do ***NOT*** install this into production use.
2170 Data corruption and crashes are possible.
2172 It is most seriously suggested that you do not continue any further
2173 unless you want to help in developing and debugging Perl.
2175 If you *still* want to build perl, you can answer 'y' now,
2176 or pass -Dusedevel to Configure.
2179 rp='Do you really want to continue?'
2183 [yY]) echo >&4 "Okay, continuing."
2184 usedevel="$define" ;;
2185 *) echo >&4 "Okay, bye."
2196 case "$versiononly" in
2197 '') versiononly="$define" ;;
2199 case "$installusrbinperl" in
2200 '') installusrbinperl="$undef" ;;
2205 : general instructions
2208 user=`(logname) 2>/dev/null`
2210 '') user=`whoami 2>&1`;;
2212 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2215 rp='Would you like to see the instructions?'
2226 This installation shell script will examine your system and ask you questions
2227 to determine how the perl5 package should be installed. If you get
2228 stuck on a question, you may use a ! shell escape to start a subshell or
2229 execute a command. Many of the questions will have default answers in square
2230 brackets; typing carriage return will give you the default.
2232 On some of the questions which ask for file or directory names you are allowed
2233 to use the ~name construct to specify the login directory belonging to "name",
2234 even if you don't have a shell which knows about that. Questions where this is
2235 allowed will be marked "(~name ok)".
2239 dflt='Type carriage return to continue'
2243 The prompter used in this script allows you to use shell variables and
2244 backticks in your answers. You may use $1, $2, etc... to refer to the words
2245 in the default answer, as if the default line was a set of arguments given to a
2246 script shell. This means you may also use $* to repeat the whole default line,
2247 so you do not have to re-type everything to add something to the default.
2249 Everytime there is a substitution, you will have to confirm. If there is an
2250 error (e.g. an unmatched backtick), the default answer will remain unchanged
2251 and you will be prompted again.
2253 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2254 the questions and use the computed defaults (or the previous answers if there
2255 was already a config.sh file). Type 'Configure -h' for a list of options.
2256 You may also start interactively and then answer '& -d' at any prompt to turn
2257 on the non-interactive behaviour for the remainder of the execution.
2263 Much effort has been expended to ensure that this shell script will run on any
2264 Unix system. If despite that it blows up on yours, your best bet is to edit
2265 Configure and run it again. If you can't run Configure for some reason,
2266 you'll have to generate a config.sh file by hand. Whatever problems you
2267 have, let me (perlbug@perl.org) know how I blew it.
2269 This installation script affects things in two ways:
2271 1) it may do direct variable substitutions on some of the files included
2273 2) it builds a config.h file for inclusion in C programs. You may edit
2274 any of these files as the need arises after running this script.
2276 If you make a mistake on a question, there is no easy way to back up to it
2277 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2278 files. Configure will offer to let you do this before it runs the SH files.
2281 dflt='Type carriage return to continue'
2283 case "$firsttime" in
2284 true) echo $user >>../.config/instruct;;
2288 : find out where common programs are
2290 echo "Locating common programs..." >&4
2303 if test -d \$dir/\$thing; then
2309 for thisthing in \$dir/\$thing; do
2310 : just loop through to pick last item
2312 if test -f \$thisthing; then
2315 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2318 elif test -f \$dir/\$thing.exe; then
2319 if test -n "$DJGPP"; then
2320 echo \$dir/\$thing.exe
2321 elif test "$eunicefix" != ":"; then
2322 : on Eunice apparently
2374 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2375 pth="$pth /lib /usr/lib"
2376 for file in $loclist; do
2380 if test -f "$xxx"; then
2383 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2384 xxx=`./loc $file $file $pth`
2387 '') xxx=`./loc $file $file $pth`;;
2388 *) xxx=`./loc $xxx $xxx $pth`;;
2390 eval $file=$xxx$_exe
2394 echo $file is in $xxx.
2397 echo $file is in $xxx.
2400 echo "I don't know where '$file' is, and my life depends on it." >&4
2401 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2407 echo "Don't worry if any of the following aren't found..."
2409 for file in $trylist; do
2413 if test -f "$xxx"; then
2416 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2417 xxx=`./loc $file $file $pth`
2420 '') xxx=`./loc $file $file $pth`;;
2421 *) xxx=`./loc $xxx $xxx $pth`;;
2423 eval $file=$xxx$_exe
2427 echo $file is in $xxx.
2430 echo $file is in $xxx.
2433 echo "I don't see $file out there, $say."
2440 echo "Substituting grep for egrep."
2447 echo "Substituting cp for ln."
2456 echo "I can't find make or gmake, and my life depends on it." >&4
2457 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2465 *) # We can't have osname yet.
2466 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2467 # Assume that gmake, if found, is definitely GNU make
2468 # and prefer it over the system make.
2469 echo "Substituting gmake for make."
2477 echo "Hopefully test is built into your sh."
2480 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2481 echo "Using the test built into your sh."
2489 echo "Hopefully echo is built into your sh."
2494 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2495 $echo $n "hi there$c" >foo1
2496 echo $n "hi there$c" >foo2
2497 if cmp foo1 foo2 >/dev/null 2>&1; then
2498 echo "They are compatible. In fact, they may be identical."
2505 They are not compatible! You are probably running ksh on a non-USG system.
2506 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2507 have echo built in and we may have to run some Bourne shell scripts. That
2508 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2511 $echo $n "The star should be here-->$c"
2518 # This question was auctioned at YAPC::Europe-2007 in Vienna
2519 # I never promised you could answer it. I only auctioned the question.
2521 The following message is sponsored by
2523 Dresden.pm<--The stars should be here.
2525 Dear Perl user, system administrator or package
2526 maintainer, the Perl community sends greetings to
2527 you. Do you (emblematical) greet back [Y/n]? n
2531 : Check what type of C compiler we use
2535 cat <<'EOSC' >>trygcc
2540 int main(int argc, char *argv[]) {
2544 if $cc -o try $ccflags $ldflags try.c; then
2547 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2553 # Skip this test because it gives a false match on output like:
2554 # ./trygcc: line 23: cc: command not found
2555 # case "`$cc -v -c try.c 2>&1`" in
2556 # *gcc*) trygcc=no ;;
2558 if $test X"$trygcc" = Xyes; then
2559 if gcc -o try -c try.c; then
2561 echo "You seem to have a working gcc, though." >&4
2562 # Switching compilers may undo the work of hints files.
2563 # The most common problem is -D_REENTRANT for threads.
2564 # This heuristic catches that case, but gets false positives
2565 # if -Dusethreads was not actually specified. Better to
2566 # bail out here with a useful message than fail
2567 # mysteriously later. Should we perhaps just try to
2568 # re-invoke Configure -Dcc=gcc config_args ?
2569 if $test -f usethreads.cbu; then
2572 *** However, any setting of the C compiler flags (e.g. for thread support)
2573 *** will be lost. It may be necessary for you to restart Configure and
2574 *** add -Dcc=gcc to your Configure command line.
2577 rp="Would you like to go ahead and try gcc anyway?"
2580 rp="Would you like to use it?"
2583 if $test -f myread; then
2586 if $test -f UU/myread; then
2589 echo "Cannot find myread, sorry. Aborting." >&2
2594 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2607 cat <<'EOSC' >>checkcc
2612 int main(int argc, char *argv[]) {
2616 if $cc -o try $ccflags $ldflags try.c; then
2619 if $test X"$despair" = Xyes; then
2620 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2623 You need to find a working C compiler.
2624 Either (purchase and) install the C compiler supplied by your OS vendor,
2625 or for a free C compiler try http://gcc.gnu.org/
2626 I cannot continue any further, aborting.
2635 : determine whether symbolic links are supported
2638 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2639 echo "Symbolic links are supported." >&4
2642 echo "Symbolic links are NOT supported." >&4
2647 : determine whether symbolic links are supported
2651 echo "Checking how to test for symbolic links..." >&4
2653 if $test "X$issymlink" = X; then
2655 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2656 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2658 if test $? = 0; then
2661 echo "Your builtin 'test -h' may be broken." >&4
2664 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2667 if test -f "$p/$test"; then
2676 echo "Trying external '$test -h'." >&4
2677 issymlink="$test -h"
2678 if $test ! -h sym >/dev/null 2>&1; then
2679 echo "External '$test -h' is broken, too." >&4
2687 if $test "X$issymlink" = X; then
2688 if $test -L sym 2>/dev/null; then
2689 issymlink="$test -L"
2690 echo "The builtin '$test -L' worked." >&4
2693 if $test "X$issymlink" != X; then
2694 echo "You can test for symbolic links with '$issymlink'." >&4
2696 echo "I do not know how you can test for symbolic links." >&4
2700 *) echo "No symbolic links, so not testing for their testing..." >&4
2705 : Make symlinks util
2706 case "$mksymlinks" in
2709 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2712 *) case "$lns:$issymlink" in
2713 *"ln"*" -s:"*"test -"?)
2714 echo "Creating the symbolic links..." >&4
2715 echo "(First creating the subdirectories...)" >&4
2717 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2719 test -z "$directory" && break
2723 if test ! -d t/base; then
2724 echo "Failed to create the subdirectories. Aborting." >&4
2727 echo "(Then creating the symlinks...)" >&4
2728 awk '{print $1}' $src/MANIFEST | while true; do
2730 test -z "$filename" && break
2731 if test -f $filename; then
2732 if $issymlink $filename; then
2736 if test -f $filename; then
2737 echo "$filename already exists, not symlinking."
2739 ln -s $src/$filename $filename
2743 if test ! -f t/base/lex.t; then
2744 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2749 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2757 : Check for Cross-Compilation
2758 case "$usecrosscompile" in
2760 $echo "Cross-compiling..."
2763 *-*-gcc) # A cross-compiling gcc, probably.
2764 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2766 # leave out ld, choosing it is more complex
2768 ranlib=$targetarch-ranlib
2769 $echo 'extern int foo;' > try.c
2770 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2772 if $test $# -gt 0; then
2774 incpth="`$echo $incpth|$sed 's/^ //'`"
2775 echo "Guessing incpth '$incpth'." >&4
2777 j="`$echo $i|$sed 's,/include$,/lib,'`"
2778 if $test -d $j; then
2782 libpth="`$echo $libpth|$sed 's/^ //'`"
2783 echo "Guessing libpth '$libpth'." >&4
2788 case "$targetarch" in
2789 '') echo "Targetarch not defined." >&4; croak=y ;;
2790 *) echo "Using targetarch $targetarch." >&4 ;;
2793 '') echo "Incpth not defined." >&4; croak=y ;;
2794 *) echo "Using incpth '$incpth'." >&4 ;;
2797 '') echo "Libpth not defined." >&4; croak=y ;;
2798 *) echo "Using libpth '$libpth'." >&4 ;;
2801 '') for i in $incpth; do
2802 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2804 echo "Guessing usrinc $usrinc." >&4
2809 '') echo "Usrinc not defined." >&4; croak=y ;;
2812 *) echo "Using usrinc $usrinc." >&4 ;;
2814 case "$targethost" in
2815 '') echo "Targethost not defined." >&4; croak=y ;;
2816 *) echo "Using targethost $targethost." >&4
2821 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2824 /*) run=$src/Cross/run
2825 targetmkdir=$src/Cross/mkdir
2827 from=$src/Cross/from
2829 *) pwd=`$test -f ../Configure & cd ..; pwd`
2831 targetmkdir=$pwd/Cross/mkdir
2833 from=$pwd/Cross/from
2836 case "$targetrun" in
2837 '') targetrun=ssh ;;
2842 case "$targetfrom" in
2843 '') targetfrom=scp ;;
2847 from=$from-$targetfrom
2848 case "$targetdir" in
2850 echo "Guessing targetdir $targetdir." >&4
2853 case "$targetuser" in
2855 echo "Guessing targetuser $targetuser." >&4
2858 case "$targetfrom" in
2862 case "$targetrun" in
2874 '') cwd=$targetdir ;;
2878 if $test ! -f \$exe.xok; then
2882 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2885 *) echo "Unknown targetrun '$targetrun'" >&4
2889 case "$targetmkdir" in
2891 cat >$targetmkdir <<EOF
2893 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2895 $chmod a+rx $targetmkdir
2897 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2909 $targetmkdir \`dirname \$f\`
2910 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2913 $targetmkdir $targetdir/\`dirname \$f\`
2914 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2927 $mkdir -p $targetdir/\`dirname \$f\`
2928 $cp \$f $targetdir/\$f || exit 1
2931 $targetmkdir $targetdir/\`dirname \$f\`
2932 $cp \$f $targetdir/\$f || exit 1
2939 *) echo "Unknown targetto '$targetto'" >&4
2943 case "$targetfrom" in
2950 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2955 cp) cat >$from <<EOF
2960 cp $targetdir/\$f . || exit 1
2965 *) echo "Unknown targetfrom '$targetfrom'" >&4
2969 if $test ! -f $run; then
2970 echo "Target 'run' script '$run' not found." >&4
2974 if $test ! -f $to; then
2975 echo "Target 'to' script '$to' not found." >&4
2979 if $test ! -f $from; then
2980 echo "Target 'from' script '$from' not found." >&4
2984 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2988 Using '$run' for remote execution,
2989 and '$from' and '$to'
2990 for remote file transfer.
2996 usecrosscompile='undef'
3001 : see whether [:lower:] and [:upper:] are supported character classes
3003 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3005 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3009 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3010 # (0xd9 and 0xe2), therefore that is a nice testing point.
3011 if test "X$up" = X -o "X$low" = X; then
3012 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3018 if test "X$up" = X -o "X$low" = X; then
3019 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3025 if test "X$up" = X -o "X$low" = X; then
3026 case "`echo RS | od -x 2>/dev/null`" in
3028 echo "Hey, this might be EBCDIC." >&4
3029 if test "X$up" = X -o "X$low" = X; then
3030 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3031 rs) up='[A-IJ-RS-Z]'
3036 if test "X$up" = X -o "X$low" = X; then
3037 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3047 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3049 echo "Using $up and $low to convert case." >&4
3052 echo "I don't know how to translate letters from upper to lower case." >&4
3053 echo "Your tr is not acting any way I know of." >&4
3057 : set up the translation script tr, must be called with ./tr of course
3061 '[A-Z][a-z]') exec $tr '$up' '$low';;
3062 '[a-z][A-Z]') exec $tr '$low' '$up';;
3069 : Try to determine whether config.sh was made on this system
3070 case "$config_sh" in
3072 myuname=`$uname -a 2>/dev/null`
3073 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3074 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3075 # because the A-Z/a-z are not consecutive.
3076 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3077 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3078 newmyuname="$myuname"
3080 case "$knowitall" in
3082 if test -f ../config.sh; then
3083 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3084 eval "`grep myuname= ../config.sh`"
3086 if test "X$myuname" = "X$newmyuname"; then
3094 : Get old answers from old config file if Configure was run on the
3095 : same system, otherwise use the hints.
3098 if test -f config.sh; then
3100 rp="I see a config.sh file. Shall I use it to set the defaults?"
3103 n*|N*) echo "OK, I'll ignore it."
3104 mv config.sh config.sh.old
3105 myuname="$newmyuname"
3107 *) echo "Fetching default answers from your old config.sh file..." >&4
3115 : Older versions did not always set $sh. Catch re-use of such
3125 if test ! -f config.sh; then
3128 First time through, eh? I have some defaults handy for some systems
3129 that need some extra help getting the Configure answers right:
3132 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3134 : Half the following guesses are probably wrong... If you have better
3135 : tests or hints, please send them to perlbug@perl.org
3136 : The metaconfig authors would also appreciate a copy...
3137 $test -f /irix && osname=irix
3138 $test -f /xenix && osname=sco_xenix
3139 $test -f /dynix && osname=dynix
3140 $test -f /dnix && osname=dnix
3141 $test -f /lynx.os && osname=lynxos
3142 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3143 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3144 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3145 $test -f /bin/mips && /bin/mips && osname=mips
3146 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3147 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3148 $test -d /usr/apollo/bin && osname=apollo
3149 $test -f /etc/saf/_sactab && osname=svr4
3150 $test -d /usr/include/minix && osname=minix
3151 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3152 if $test -d /MachTen -o -d /MachTen_Folder; then
3154 if $test -x /sbin/version; then
3155 osvers=`/sbin/version | $awk '{print $2}' |
3156 $sed -e 's/[A-Za-z]$//'`
3157 elif $test -x /usr/etc/version; then
3158 osvers=`/usr/etc/version | $awk '{print $2}' |
3159 $sed -e 's/[A-Za-z]$//'`
3165 $test -f /sys/posix.dll &&
3166 $test -f /usr/bin/what &&
3167 set X `/usr/bin/what /sys/posix.dll` &&
3168 $test "$3" = UWIN &&
3172 if $test -f $uname; then
3180 umips) osname=umips ;;
3183 [23]100) osname=mips ;;
3184 next*) osname=next ;;
3186 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3187 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3190 elif $test -f /etc/kconfig; then
3192 if test "$lns" = "$ln -s"; then
3194 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3196 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3203 if test -n "$DJGPP"; then
3212 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3214 # oslevel can fail with:
3215 # oslevel: Unable to acquire lock.
3216 *not\ found) osvers="$4"."$3" ;;
3217 '<3240'|'<>3240') osvers=3.2.0 ;;
3218 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3219 '=3250'|'>3250') osvers=3.2.5 ;;
3223 bsd386) osname=bsd386
3226 cygwin*) osname=cygwin
3229 *dc.osx) osname=dcosx
3235 domainos) osname=apollo
3241 dragonfly) osname=dragonfly
3244 dynixptx*) osname=dynixptx
3245 osvers=`echo "$4"|sed 's/^v//'`
3247 freebsd) osname=freebsd
3249 genix) osname=genix ;;
3253 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3269 netbsd*) osname=netbsd
3272 news-os) osvers="$3"
3274 4*) osname=newsos4 ;;
3278 next*) osname=next ;;
3279 nonstop-ux) osname=nonstopux ;;
3280 openbsd) osname=openbsd
3286 POSIX-BC | posix-bc ) osname=posix-bc
3289 powerux | power_ux | powermax_os | powermaxos | \
3290 powerunix | power_unix) osname=powerux
3296 solaris) osname=solaris
3298 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3305 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3309 titanos) osname=titanos
3318 ultrix) osname=ultrix
3321 osf1|mls+) case "$5" in
3324 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3327 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3330 hp*) osname=hp_osf1 ;;
3331 mips) osname=mips_osf1 ;;
3334 # UnixWare 7.1.2 is known as Open UNIX 8
3335 openunix|unixware) osname=svr5
3343 $2) case "$osname" in
3347 : svr4.x or possibly later
3357 if test -f /stand/boot ; then
3358 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3359 if test -n "$INITPROG" -a -f "$INITPROG"; then
3360 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3361 if test -n "$isesix"; then
3369 *) if test -f /etc/systemid; then
3371 set `echo $3 | $sed 's/\./ /g'` $4
3372 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3374 elif $test -f $src/hints/sco_$1_$2.sh; then
3376 elif $test -f $src/hints/sco_$1.sh; then
3381 '') : Still unknown. Probably a generic Sys V.
3390 *) case "$osname" in
3391 '') : Still unknown. Probably a generic BSD.
3399 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3400 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3401 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3404 $rm -f UU/kernel.what
3405 elif test -d c:/. -o -n "$is_os2" ; then
3412 case "$targetarch" in
3415 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3420 : Now look for a hint file osname_osvers, unless one has been
3421 : specified already.
3424 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3425 : Also try without trailing minor version numbers.
3426 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3427 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3428 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3429 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3432 *) case "$osvers" in
3435 *) if $test -f $src/hints/$file.sh ; then
3437 elif $test -f $src/hints/$xfile.sh ; then
3439 elif $test -f $src/hints/$xxfile.sh ; then
3441 elif $test -f $src/hints/$xxxfile.sh ; then
3443 elif $test -f $src/hints/$xxxxfile.sh ; then
3445 elif $test -f "$src/hints/${osname}.sh" ; then
3454 if $test -f Policy.sh ; then
3457 none) dflt="Policy" ;;
3458 *) dflt="Policy $dflt" ;;
3463 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3467 if $test -f Policy.sh ; then
3470 There's also a Policy hint file available, which should make the
3471 site-specific (policy) questions easier to answer.
3478 You may give one or more space-separated answers, or "none" if appropriate.
3479 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3480 previous run of Configure, you may specify it as well as or instead of
3481 OS-specific hints. If hints are provided for your OS, you should use them:
3482 although Perl can probably be built without hints on many platforms, using
3483 hints often improve performance and may enable features that Configure can't
3484 set up on its own. If there are no hints that match your OS, specify "none";
3485 DO NOT give a wrong version or a wrong OS.
3489 rp="Which of these apply, if any?"
3492 for file in $tans; do
3493 if $test X$file = XPolicy -a -f Policy.sh; then
3495 $cat Policy.sh >> UU/config.sh
3496 elif $test -f $src/hints/$file.sh; then
3497 . $src/hints/$file.sh
3498 $cat $src/hints/$file.sh >> UU/config.sh
3499 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3502 : Give one chance to correct a possible typo.
3503 echo "$file.sh does not exist"
3505 rp="hint to use instead?"
3507 for file in $ans; do
3508 if $test -f "$src/hints/$file.sh"; then
3509 . $src/hints/$file.sh
3510 $cat $src/hints/$file.sh >> UU/config.sh
3511 elif $test X$ans = X -o X$ans = Xnone ; then
3514 echo "$file.sh does not exist -- ignored."
3521 : Remember our hint file for later.
3522 if $test -f "$src/hints/$file.sh" ; then
3532 echo "Fetching default answers from $config_sh..." >&4
3536 cp $config_sh config.sh 2>/dev/null
3546 test "$override" && . ./optdef.sh
3548 : Restore computed paths
3549 for file in $loclist $trylist; do
3550 eval $file="\$_$file"
3555 Configure uses the operating system name and version to set some defaults.
3556 The default value is probably right if the name rings a bell. Otherwise,
3557 since spelling matters for me, either accept the default or answer "none"
3564 ''|' '|none) dflt=none ;;
3565 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3568 *) dflt="$osname" ;;
3570 rp="Operating system name?"
3574 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3580 ''|' '|none) dflt=none ;;
3581 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3582 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3584 ''|' ') dflt=none ;;
3589 *) dflt="$osvers" ;;
3591 rp="Operating system version?"
3601 : who configured the system
3602 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3605 cf_by=`(logname) 2>/dev/null`
3608 cf_by=`(whoami) 2>/dev/null`
3610 "") cf_by=unknown ;;
3615 : decide how portable to be. Allow command line overrides.
3616 case "$d_portable" in
3618 *) d_portable="$define" ;;
3621 : set up shell script to do ~ expansion
3627 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3630 if $test -f /bin/csh; then
3631 /bin/csh -f -c "glob \$1"
3636 name=\`$expr x\$1 : '..\([^/]*\)'\`
3637 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3638 if $test ! -d "\$dir"; then
3640 echo "\$me: can't locate home directory for: \$name" >&2
3645 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3661 : now set up to get a file name
3665 cat <<'EOSC' >>getfile
3681 : getfile will accept an answer from the comma-separated list
3682 : enclosed in parentheses even if it does not meet other criteria.
3683 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3684 fn=`echo $fn | sed 's/(.*)//'`
3690 loc_file=`expr $fn : '.*:\(.*\)'`
3691 fn=`expr $fn : '\(.*\):.*'`
3699 */*) fullpath=true;;
3708 *e*) exp_file=true;;
3711 *p*) nopath_ok=true;;
3716 *d*) type='Directory';;
3717 *l*) type='Locate';;
3722 Locate) what='File';;
3727 case "$d_portable" in
3735 while test "$type"; do
3740 true) rp="$rp (~name ok)";;
3743 if test -f UU/getfile.ok && \
3744 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3763 value=`UU/filexp $ans`
3766 if test "$ans" != "$value"; then
3767 echo "(That expands to $value on this system.)"
3781 /*) value="$ansexp" ;;
3782 [a-zA-Z]:/*) value="$ansexp" ;;
3787 echo "I shall only accept a full path name, as in /bin/ls." >&4
3788 echo "Use a ! shell escape if you wish to check pathnames." >&4
3791 echo "Please give a full path name, starting with slash." >&4
3794 echo "Note that using ~name is ok provided it expands well." >&4
3807 for fp in $gfpth; do
3808 if test "X$fp" = X.; then
3813 if test -f "$pf"; then
3815 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3817 echo "($value is not a plain file, but that's ok.)"
3820 if test X"$type" = X; then
3827 for fp in $gfpth; do
3828 if test "X$fp" = X.; then
3833 direxp="$fp/$ansexp"
3835 if test -d "$direxp"; then
3843 if test -d "$ansexp"; then
3844 echo "(Looking for $loc_file in directory $value.)"
3845 value="$value/$loc_file"
3846 ansexp="$ansexp/$loc_file"
3848 if test -f "$ansexp"; then
3851 case "$nopath_ok" in
3852 true) case "$value" in
3854 *) echo "Assuming $value will be in people's path."
3870 if test "$fastread" = yes; then
3875 rp="$what $value doesn't exist. Use that name anyway?"
3894 test "X$gfpthkeep" != Xy && gfpth=""
3897 : determine root of directory hierarchy where package will be installed.
3900 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3903 dflt=`echo "$prefix" | sed 's/.$//'`
3911 By default, $package will be installed in $dflt/bin, manual pages
3912 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3913 installation directories. Typically this is something like /usr/local.
3914 If you wish to have binaries under /usr/bin but other parts of the
3915 installation under /usr/local, that's ok: you will be prompted
3916 separately for each of the installation directories, the prefix being
3917 only used to set the defaults.
3921 rp='Installation prefix to use?'
3929 *) oldprefix="$prefix";;
3936 : allow them to override the AFS root
3939 *) afsroot=$afsroot ;;
3945 $define|true) afs=true ;;
3946 $undef|false) afs=false ;;
3947 *) if $test -d $afsroot; then
3955 echo "AFS may be running... I'll be extra cautious then..." >&4
3957 echo "AFS does not seem to be running..." >&4
3960 : determine installation prefix for where package is to be installed.
3964 Since you are running AFS, I need to distinguish the directory in which
3965 files will reside from the directory in which they are installed (and from
3966 which they are presumably copied to the former directory by occult means).
3969 case "$installprefix" in
3970 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3971 *) dflt="$installprefix";;
3976 In some special cases, particularly when building $package for distribution,
3977 it is convenient to distinguish the directory in which files should be
3978 installed from the directory ($prefix) in which they will
3979 eventually reside. For most users, these two directories are the same.
3982 case "$installprefix" in
3984 *) dflt=$installprefix;;
3988 rp='What installation prefix should I use for installing files?'
3990 installprefix="$ans"
3991 installprefixexp="$ansexp"
3993 : Perform the prefixexp/installprefixexp correction if necessary
3994 cat <<EOS >installprefix
3997 cat <<'EOSC' >>installprefix
3998 : Change installation prefix, if necessary.
3999 if $test X"$prefix" != X"$installprefix"; then
4000 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4002 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4005 chmod +x installprefix
4006 $eunicefix installprefix
4008 : Set variables such as privlib and privlibexp from the output of ./getfile
4009 : performing the prefixexp/installprefixexp correction if necessary.
4010 cat <<EOS >setprefixvar
4013 cat <<'EOSC' >>setprefixvar
4014 eval "${prefixvar}=\"\$ans\""
4015 eval "${prefixvar}exp=\"\$ansexp\""
4018 chmod +x setprefixvar
4019 $eunicefix setprefixvar
4021 : set up the script used to warn in case of inconsistency
4030 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4032 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4033 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4038 echo "*** WHOA THERE!!! ***" >&4
4039 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4042 rp=" Keep the $hint value?"
4045 y) td=$was; tu=$was;;
4049 : function used to set '$1' to '$val'
4050 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4052 $define$undef) . ./whoa; eval "$var=\$td";;
4053 $undef$define) . ./whoa; eval "$var=\$tu";;
4054 *) eval "$var=$val";;
4057 : Check is we will use socks
4059 $define|true|[yY]*) dflt='y';;
4064 Perl can be built to use the SOCKS proxy protocol library. To do so,
4065 Configure must be run with -Dusesocks. If you use SOCKS you also need
4066 to use the PerlIO abstraction layer, this will be implicitly selected.
4068 If this doesn't make any sense to you, just accept the default '$dflt'.
4070 rp='Build Perl for SOCKS?'
4073 y|Y) val="$define" ;;
4080 $define|true|[yY]*) useperlio="$define";;
4083 : Check if we want perlio
4084 case "$useperlio" in
4085 $define|true|[yY]*|'') dflt='y';;
4090 Previous version of $package used the standard IO mechanisms as
4091 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4092 alternate IO mechanisms via the PerlIO abstraction layer, but the
4093 stdio mechanism is still available if needed. The abstraction layer
4094 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4095 Using PerlIO with sfio may cause problems with some extension modules.
4097 If this doesn't make any sense to you, just accept the default '$dflt'.
4099 rp='Use the PerlIO abstraction layer?'
4106 echo "Ok, doing things the stdio way."
4115 case "$useperlio" in
4116 $define|true|[yY]*) ;;
4119 You are using the SOCKS proxy protocol library which means that you
4120 should also use the PerlIO layer. You may be headed for trouble.
4128 : get the patchlevel
4130 echo "Getting the current patchlevel..." >&4
4131 if $test -r $rsrc/patchlevel.h;then
4132 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4133 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4134 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4135 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4136 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4137 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4138 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4147 $echo "(You do not have patchlevel.h. Eek.)"
4149 if $test -r $rsrc/.patch ; then
4150 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4151 perl_patchlevel=`cat $rsrc/.patch`
4154 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4155 version_patchlevel_string="version $patchlevel subversion $subversion"
4156 case "$perl_patchlevel" in
4158 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4159 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4163 $echo "(You have $package $version_patchlevel_string.)"
4167 : XXX Should be a Configure test for double-dots in filenames.
4168 version=`echo $revision $patchlevel $subversion | \
4169 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4170 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4171 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4174 version=`echo $revision $patchlevel $subversion | \
4175 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4176 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4177 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4180 : Special case the 5.005_xx maintenance series, which used 5.005
4181 : without any subversion label as a subdirectory in $sitelib
4182 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4183 api_versionstring='5.005'
4186 : Do we want threads support and if so, what type
4187 case "$usethreads" in
4188 $define|true|[yY]*) dflt='y';;
4189 *) # Catch case where user specified ithreads or 5005threads but
4190 # forgot -Dusethreads (A.D. 4/2002)
4191 case "$useithreads$use5005threads" in
4193 case "$useperlio" in
4194 "$define") dflt='y' ;;
4204 Perl can be built to take advantage of threads on some systems.
4205 To do so, Configure can be run with -Dusethreads.
4207 Note that Perl built with threading support runs slightly slower
4208 and uses more memory than plain Perl. The current implementation
4209 is believed to be stable, but it is fairly new, and so should be
4210 treated with caution.
4212 If this doesn't make any sense to you, just accept the default '$dflt'.
4214 rp='Build a threading Perl?'
4217 y|Y) val="$define" ;;
4223 if $test $patchlevel -lt 9; then
4224 case "$usethreads" in
4228 Since release 5.6, Perl has had two different threading implementations,
4229 the newer interpreter-based version (ithreads) with one interpreter per
4230 thread, and the older 5.005 version (5005threads).
4231 The 5005threads version is effectively unmaintained and will probably be
4232 removed in Perl 5.10, so there should be no need to build a Perl using it
4233 unless needed for backwards compatibility with some existing 5.005threads
4237 : Default to ithreads unless overridden on command line or with
4240 case "$use5005threads" in
4241 $define|true|[yY]*) dflt='n';;
4243 case "$useithreads" in
4244 $undef|false|[nN]*) dflt='n';;
4246 rp='Use the newer interpreter-based ithreads?'
4249 y|Y) val="$define" ;;
4254 : Now set use5005threads to the opposite value.
4255 case "$useithreads" in
4256 $define) val="$undef" ;;
4263 useithreads="$undef"
4264 use5005threads="$undef"
4268 case "$useithreads$use5005threads" in
4272 You cannot have both the ithreads and the 5.005 threads enabled
4273 at the same time. Disabling the 5.005 threads since they are
4274 much less stable than the ithreads.
4277 use5005threads="$undef"
4282 : perl-5.9.x and later
4284 if test X"$usethreads" = "X$define"; then
4285 case "$use5005threads" in
4289 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4296 use5005threads="$undef"
4297 useithreads="$usethreads"
4300 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4303 *** To build with ithreads you must also use the PerlIO layer.
4304 *** Cannot continue, aborting.
4310 case "$d_oldpthreads" in
4311 '') : Configure tests would be welcome here. For now, assume undef.
4313 *) val="$d_oldpthreads" ;;
4319 : Look for a hint-file generated 'call-back-unit'. If the
4320 : user has specified that a threading perl is to be built,
4321 : we may need to set or change some other defaults.
4322 if $test -f usethreads.cbu; then
4323 echo "Your platform has some specific hints regarding threaded builds, using them..."
4326 case "$usethreads" in
4327 "$define"|true|[yY]*)
4329 (Your platform does not have any specific hints for threaded builds.
4330 Assuming POSIX threads, then.)
4336 : Check if multiplicity is required
4339 Perl can be built so that multiple Perl interpreters can coexist
4340 within the same Perl executable.
4343 case "$useithreads" in
4346 This multiple interpreter support is required for interpreter-based threads.
4350 *) case "$usemultiplicity" in
4351 $define|true|[yY]*) dflt='y';;
4355 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4356 rp='Build Perl for multiplicity?'
4359 y|Y) val="$define" ;;
4367 : Check if morebits is requested
4368 case "$usemorebits" in
4369 "$define"|true|[yY]*)
4370 use64bitint="$define"
4371 uselongdouble="$define"
4372 usemorebits="$define"
4374 *) usemorebits="$undef"
4378 : Determine the C compiler to be used
4384 rp="Use which C compiler?"
4388 : See whether they have no cc but they do have gcc
4390 if $test -f cc.cbu; then
4395 : make some quick guesses about what we are up against
4397 $echo $n "Hmm... $c"
4407 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4408 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4410 echo "Looks kind of like an OSF/1 system, but we'll see..."
4412 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4413 xxx=`./loc addbib blurfl $pth`
4414 if $test -f $xxx; then
4415 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4419 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4420 echo "Looks kind of like an extended USG system, but we'll see..."
4422 echo "Looks kind of like a USG system, but we'll see..."
4426 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4427 echo "Looks kind of like a BSD system, but we'll see..."
4431 echo "Looks kind of like a Version 7 system, but we'll see..."
4434 case "$eunicefix" in
4437 There is, however, a strange, musty smell in the air that reminds me of
4438 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4442 : it so happens the Eunice I know will not run shell scripts in Unix format
4446 echo "Congratulations. You aren't running Eunice."
4450 : Detect OS2. The p_ variable is set above in the Head.U unit.
4451 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4452 : semicolon as a patch separator
4457 I have the feeling something is not exactly right, however...don't tell me...
4458 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4459 (Or you may be running DOS with DJGPP.)
4464 if test -f /xenix; then
4465 echo "Actually, this looks more like a XENIX system..."
4470 echo "It's not Xenix..."
4475 if test -f /venix; then
4476 echo "Actually, this looks more like a VENIX system..."
4483 echo "Nor is it Venix..."
4486 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4487 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4490 : Check if we are using GNU gcc and what its version is
4492 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4496 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4498 printf("%s\n", __VERSION__);
4500 printf("%s\n", "1");
4506 if $cc -o try $ccflags $ldflags try.c; then
4507 gccversion=`$run ./try`
4508 case "$gccversion" in
4509 '') echo "You are not using GNU cc." ;;
4510 *) echo "You are using GNU cc $gccversion."
4516 echo "*** WHOA THERE!!! ***" >&4
4517 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4518 case "$knowitall" in
4520 echo " You'd better start hunting for one and let me know about it." >&4
4526 case "$gccversion" in
4527 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4529 case "$gccversion" in
4530 '') gccosandvers='' ;;
4531 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4532 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4534 case "$gccosandvers" in
4535 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4536 $osname$osvers) ;; # looking good
4537 $osname*) cat <<EOM >&4
4539 *** WHOA THERE!!! ***
4541 Your gcc has not been compiled for the exact release of
4542 your operating system ($gccosandvers versus $osname$osvers).
4544 In general it is a good idea to keep gcc synchronized with
4545 the operating system because otherwise serious problems
4546 may ensue when trying to compile software, like Perl.
4548 I'm trying to be optimistic here, though, and will continue.
4549 If later during the configuration and build icky compilation
4550 problems appear (headerfile conflicts being the most common
4551 manifestation), I suggest reinstalling the gcc to match
4552 your operating system release.
4556 *) gccosandvers='' ;; # failed to parse, better be silent
4564 # gcc 3.* complain about adding -Idirectories that they already know about,
4565 # so we will take those off from locincpth.
4566 case "$gccversion" in
4568 echo "main(){}">try.c
4569 for incdir in $locincpth; do
4570 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4571 grep '^c[cp]p*[01]: warning: changing search order '`
4572 if test "X$warn" != X; then
4573 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4579 : What should the include directory be ?
4581 $echo $n "Hmm... $c"
4585 if $test -f /bin/mips && /bin/mips; then
4586 echo "Looks like a MIPS system..."
4587 $cat >usr.c <<'EOCP'
4588 #ifdef SYSTYPE_BSD43
4592 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4593 dflt='/bsd43/usr/include'
4597 mips_type='System V'
4599 $rm -f usr.c usr.out
4600 echo "and you're compiling with the $mips_type compiler and libraries."
4604 echo "Doesn't look like a MIPS system."
4614 case "$xxx_prompt" in
4617 rp='Where are the include files you want to use?'
4625 : see how we invoke the C preprocessor
4627 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4628 cat <<'EOT' >testcpp.c
4634 if test ! -f cppstdin; then
4635 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4636 # AIX cc -E doesn't show the absolute headerfile
4637 # locations but we'll cheat by using the -M flag.
4638 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
4640 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4643 echo "Keeping your $hint cppstdin wrapper."
4646 wrapper=`pwd`/cppstdin
4650 if $test "X$cppstdin" != "X" && \
4651 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4652 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4654 echo "You used to use $cppstdin $cppminus so we'll use that again."
4656 '') echo "But let's see if we can live without a wrapper..." ;;
4658 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4659 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4661 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4664 echo "(However, $cpprun $cpplast does not work, let's see...)"
4672 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4679 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4680 $cc -E <testcpp.c >testcpp.out 2>&1; \
4681 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4682 echo "Yup, it does."
4685 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4686 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4687 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4688 echo "Yup, it does."
4691 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4692 $cc -P <testcpp.c >testcpp.out 2>&1; \
4693 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4694 echo "Yipee, that works!"
4697 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4698 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4699 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4700 echo "At long last!"
4703 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4704 $cpp <testcpp.c >testcpp.out 2>&1; \
4705 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4709 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4710 $cpp - <testcpp.c >testcpp.out 2>&1; \
4711 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4712 echo "Hooray, it works! I was beginning to wonder."
4715 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4716 $wrapper <testcpp.c >testcpp.out 2>&1; \
4717 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4723 rp="No dice. I can't find a C preprocessor. Name one:"
4727 $x_cpp <testcpp.c >testcpp.out 2>&1
4728 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4729 echo "OK, that will do." >&4
4731 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4746 echo "Perhaps can we force $cc -E using a wrapper..."
4747 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4748 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4754 echo "Nope, we'll have to live without it..."
4768 "$wrapper"|'cppstdin') ;;
4769 *) $rm -f $wrapper;;
4771 $rm -f testcpp.c testcpp.out
4773 : Set private lib path
4776 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4781 '') dlist="$loclibpth $plibpth $glibpth";;
4782 *) dlist="$libpth";;
4785 : Now check and see which directories actually exist, avoiding duplicates
4789 if $test -d $xxx; then
4792 *) libpth="$libpth $xxx";;
4798 Some systems have incompatible or broken versions of libraries. Among
4799 the directories listed in the question below, please remove any you
4800 know not to be holding relevant libraries, and add any that are needed.
4801 Say "none" for none.
4812 rp="Directories to use for library searches?"
4819 : compute shared library extension
4822 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4832 On some systems, shared libraries may be available. Answer 'none' if
4833 you want to suppress searching of shared libraries for the remainder
4834 of this configuration.
4837 rp='What is the file extension used for shared libraries?'
4841 : Define several unixisms.
4842 : Hints files or command line option can be used to override them.
4843 : The convoluted testing is in case hints files set either the old
4846 '') case "$exe_ext" in
4848 *) _exe="$exe_ext" ;;
4853 '') case "$lib_ext" in
4860 '') case "$obj_ext" in
4867 '') case "$path_sep" in
4878 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4880 : Which makefile gets called first. This is used by make depend.
4881 case "$firstmakefile" in
4882 '') firstmakefile='makefile';;
4885 : Check for uselongdouble support
4887 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4890 case "$uselongdouble" in
4891 $define|true|[yY]*) dflt='y';;
4896 Perl can be built to take advantage of long doubles which
4897 (if available) may give more accuracy and range for floating point numbers.
4899 If this doesn't make any sense to you, just accept the default '$dflt'.
4901 rp='Try to use long doubles if available?'
4904 y|Y) val="$define" ;;
4910 case "$uselongdouble" in
4911 true|[yY]*) uselongdouble="$define" ;;
4914 : Look for a hint-file generated 'call-back-unit'. If the
4915 : user has specified that long doubles should be used,
4916 : we may need to set or change some other defaults.
4917 if $test -f uselongdouble.cbu; then
4918 echo "Your platform has some specific hints regarding long doubles, using them..."
4919 . ./uselongdouble.cbu
4921 case "$uselongdouble" in
4924 (Your platform does not have any specific hints for long doubles.)
4930 : Looking for optional libraries
4932 echo "Checking for optional libraries..." >&4
4937 case "$libswanted" in
4938 '') libswanted='c_s';;
4941 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4947 for thisdir in $libpth $xlibpth; do
4948 test -d $thisdir && libspath="$libspath $thisdir"
4950 for thislib in $libswanted; do
4951 for thisdir in $libspath; do
4953 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4954 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4955 $test -f "$xxx" && eval $libscheck
4956 $test -f "$xxx" && libstyle=shared
4958 if test ! -f "$xxx"; then
4959 xxx=$thisdir/lib$thislib.$so
4960 $test -f "$xxx" && eval $libscheck
4961 $test -f "$xxx" && libstyle=shared
4963 if test ! -f "$xxx"; then
4964 xxx=$thisdir/lib$thislib$_a
4965 $test -f "$xxx" && eval $libscheck
4966 $test -f "$xxx" && libstyle=static
4968 if test ! -f "$xxx"; then
4969 xxx=$thisdir/$thislib$_a
4970 $test -f "$xxx" && eval $libscheck
4971 $test -f "$xxx" && libstyle=static
4973 if test ! -f "$xxx"; then
4974 xxx=$thisdir/lib${thislib}_s$_a
4975 $test -f "$xxx" && eval $libscheck
4976 $test -f "$xxx" && libstyle=static
4977 $test -f "$xxx" && thislib=${thislib}_s
4979 if test ! -f "$xxx"; then
4980 xxx=$thisdir/Slib$thislib$_a
4981 $test -f "$xxx" && eval $libscheck
4982 $test -f "$xxx" && libstyle=static
4984 if $test -f "$xxx"; then
4986 shared) echo "Found -l$thislib (shared)." ;;
4987 static) echo "Found -l$thislib." ;;
4988 *) echo "Found -l$thislib ($libstyle)." ;;
4992 *) dflt="$dflt -l$thislib"
4993 libsfound="$libsfound $xxx"
4995 libsfiles="$libsfiles $yyy"
4996 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4997 case " $libsdirs " in
4999 *) libsdirs="$libsdirs $yyy" ;;
5006 if $test ! -f "$xxx"; then
5007 echo "No -l$thislib."
5018 ' '|'') dflt='none';;
5023 In order to compile $package on your machine, a number of libraries
5024 are usually needed. Include any other special libraries here as well.
5025 Say "none" for none. The default list is almost always right.
5029 rp="What libraries to use?"
5036 : determine optimization, if desired, or use for debug flag also
5038 ' '|$undef) dflt='none';;
5040 *) dflt="$optimize";;
5044 By default, $package compiles with the -O flag to use the optimizer.
5045 Alternately, you might want to use the symbolic debugger, which uses
5046 the -g flag (on traditional Unix systems). Either flag can be
5047 specified here. To use neither flag, specify the word "none".
5050 rp="What optimizer/debugger flag should be used?"
5054 'none') optimize=" ";;
5057 : Check what DEBUGGING is required from the command line
5058 : -DEBUGGING or -DDEBUGGING or
5059 : -DEBUGGING=both = -g + -DDEBUGGING
5060 : -DEBUGGING=-g or -Doptimize=-g = -g
5061 : -DEBUGGING=none or -UDEBUGGING =
5062 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5065 *) DEBUGGING=$EBUGGING ;;
5068 case "$DEBUGGING" in
5072 *) optimize="$optimize -g" ;;
5076 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5084 case "$DEBUGGING" in
5085 both|$define) dflt='-DDEBUGGING'
5088 : argument order is deliberate, as the flag will start with - which set could
5089 : think is an option
5090 checkccflag='check=$1; flag=$2; callback=$3;
5092 echo "Checking if your compiler accepts $flag" 2>&1;
5093 echo "int main(void) { return 0; }" > gcctest.c;
5094 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5095 echo "Yes, it does." 2>&1;
5096 if $test -s gcctest.out ; then
5097 echo "But your platform does not like it:";
5102 echo "Leaving current flags $ccflags alone." 2>&1
5104 *) dflt="$dflt $flag";
5110 echo "Nope, it does not, but that is ok." 2>&1;
5114 : We will not override a previous value, but we might want to
5115 : augment a hint file
5117 default|recommended)
5118 case "$gccversion" in
5119 1*) dflt="$dflt -fpcc-struct-return" ;;
5121 case "$optimize:$DEBUGGING" in
5122 *-g*:old) dflt="$dflt -DDEBUGGING";;
5124 case "$gccversion" in
5125 2*) if $test -d /etc/conf/kconfig.d &&
5126 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5128 # Interactive Systems (ISC) POSIX mode.
5133 case "$gccversion" in
5136 ?*) set strict-aliasing -fno-strict-aliasing
5140 # For gcc, adding -pipe speeds up compilations for some, but apparently
5141 # some assemblers can't read from stdin. (It also slows down compilations
5142 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5143 case "$gccversion" in
5149 # on x86_64 (at least) we require an extra library (libssp) in the
5150 # link command line. This library is not named, so I infer that it is
5151 # an implementation detail that may change. Hence the safest approach
5152 # is to add the flag to the flags passed to the compiler at link time,
5153 # as that way the compiler can do the right implementation dependant
5155 case "$gccversion" in
5156 ?*) set stack-protector -fstack-protector
5163 case "$mips_type" in
5164 *BSD*|'') inclwanted="$locincpth $usrinc";;
5165 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5167 for thisincl in $inclwanted; do
5168 if $test -d $thisincl; then
5169 if $test x$thisincl != x$usrinc; then
5171 *" -I$thisincl "*);;
5172 *) dflt="$dflt -I$thisincl ";;
5178 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5180 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5188 *) dflt="$dflt -D$2";;
5192 set signal.h LANGUAGE_C; eval $inctest
5196 ccflags="$ccflags -DSOCKS"
5201 default|recommended) dflt="$ccflags $dflt" ;;
5202 *) dflt="$ccflags";;
5211 Your C compiler may want other flags. For this question you should include
5212 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5213 but you should NOT include libraries or ld flags like -lwhatever. If you
5214 want $package to honor its debug switch, you should include -DDEBUGGING here.
5215 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5217 To use no flags, specify the word "none".
5223 rp="Any additional cc flags?"
5230 : the following weeds options from ccflags that are of no interest to cpp
5232 '') cppflags="$ccflags" ;;
5233 *) cppflags="$cppflags $ccflags" ;;
5235 case "$gccversion" in
5236 1*) cppflags="$cppflags -D__GNUC__"
5238 case "$mips_type" in
5240 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5246 echo "Let me guess what the preprocessor flags are..." >&4
5260 *) ftry="$previous $flag";;
5262 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5263 >cpp1.out 2>/dev/null && \
5264 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5265 >cpp2.out 2>/dev/null && \
5266 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5267 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5269 cppflags="$cppflags $ftry"
5279 *-*) echo "They appear to be: $cppflags";;
5281 $rm -f cpp.c cpp?.out
5285 : flags used in final linking phase
5287 '') if ./venix; then
5293 *-posix*) dflt="$dflt -posix" ;;
5296 *) dflt="$ldflags";;
5298 # See note above about -fstack-protector
5300 *-fstack-protector*)
5302 *-fstack-protector*) ;; # Don't add it again
5303 *) dflt="$dflt -fstack-protector" ;;
5308 : Try to guess additional flags to pick up local libraries.
5309 for thislibdir in $libpth; do
5310 case " $loclibpth " in
5313 *"-L$thislibdir "*) ;;
5314 *) dflt="$dflt -L$thislibdir" ;;
5326 Your C linker may need flags. For this question you should
5327 include -L/whatever and any other flags used by the C linker, but you
5328 should NOT include libraries like -lwhatever.
5330 Make sure you include the appropriate -L/path flags if your C linker
5331 does not normally search all of the directories you specified above,
5334 To use no flags, specify the word "none".
5338 rp="Any additional ld flags (NOT including libraries)?"
5344 rmlist="$rmlist pdp11"
5348 echo "Checking your choice of C compiler and flags for coherency..." >&4
5349 $cat > try.c <<'EOF'
5351 int main() { printf("Ok\n"); return(0); }
5353 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5355 $cat >try.msg <<'EOM'
5356 I've tried to compile and run the following simple program:
5359 $cat try.c >> try.msg
5361 $cat >> try.msg <<EOM
5368 and I got the following output:
5372 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5373 if $sh -c "$run ./try " >>try.msg 2>&1; then
5377 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5380 cat >> try.msg <<'EOQS'
5381 If $libs contains -lsfio, and sfio is mis-configured, then it
5382 sometimes (apparently) runs and exits with a 0 status, but with no
5383 output! It may have to do with sfio's use of _exit vs. exit.
5386 rp="You have a big problem. Shall I abort Configure"
5393 echo "The program compiled OK, but exited with status $?." >>try.msg
5394 rp="You have a problem. Shall I abort Configure"
5398 echo "I can't compile the test program." >>try.msg
5399 rp="You have a BIG problem. Shall I abort Configure"
5405 case "$knowitall" in
5407 echo "(The supplied flags or libraries might be incorrect.)"
5415 *) echo "Ok. Stopping Configure." >&4
5420 n) echo "OK, that should do.";;
5422 $rm_try gcctest gcctest.out
5424 : define a shorthand compile call
5428 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5429 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5433 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5434 : define a shorthand compile call for compilations that should be ok.
5438 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5440 : determine filename position in cpp output
5442 echo "Computing filename position in cpp output for #include directives..." >&4
5444 vos) testaccess=-e ;;
5447 echo '#include <stdio.h>' > foo.c
5450 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5451 $grep '^[ ]*#.*stdio\.h' | \
5452 while read cline; do
5455 while $test \$# -gt 0; do
5456 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5461 pos=\`expr \$pos + 1\`
5473 *) pos="${fieldn}th";;
5475 echo "Your cpp writes the filename in the $pos field of the line."
5478 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5479 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5482 : locate header file
5487 for usrincdir in $usrinc
5489 if test -f \$usrincdir/\$wanted; then
5490 echo "\$usrincdir/\$wanted"
5494 awkprg='{ print \$$fieldn }'
5495 echo "#include <\$wanted>" > foo\$\$.c
5496 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5497 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5498 while read cline; do
5499 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5501 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5502 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5507 # status = 0: grep returned 0 lines, case statement not executed
5508 # status = 1: headerfile found
5509 # status = 2: while loop executed, no headerfile found
5513 if test \$status -eq 1; then
5520 : define an alternate in-header-list? function
5521 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5522 cont=true; xxf="echo \"<\$1> found.\" >&4";
5523 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5524 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5526 case $# in 4) instead=instead;; *) instead="at last";; esac;
5527 while $test "$cont"; do
5529 var=$2; eval "was=\$$2";
5530 if $test "$xxx" && $test -r "$xxx";
5532 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5535 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5536 set $yyy; shift; shift; yyy=$@;
5537 case $# in 0) cont="";;
5538 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5539 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5540 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5541 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5545 do set $yyy; var=$2; eval "was=\$$2";
5546 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5547 set $yyy; shift; shift; yyy=$@;
5550 : see if stdlib is available
5551 set stdlib.h i_stdlib
5554 : check for lengths of integral types
5558 echo "Checking to see how big your integers are..." >&4
5567 printf("intsize=%d;\n", (int)sizeof(int));
5568 printf("longsize=%d;\n", (int)sizeof(long));
5569 printf("shortsize=%d;\n", (int)sizeof(short));
5574 if eval $compile_ok && $run ./try > /dev/null; then
5576 echo "Your integers are $intsize bytes long."
5577 echo "Your long integers are $longsize bytes long."
5578 echo "Your short integers are $shortsize bytes long."
5582 Help! I can't compile and run the intsize test program: please enlighten me!
5583 (This is probably a misconfiguration in your system or libraries, and
5584 you really ought to fix it. Still, I'll try anyway.)
5588 rp="What is the size of an integer (in bytes)?"
5592 rp="What is the size of a long integer (in bytes)?"
5596 rp="What is the size of a short integer (in bytes)?"
5604 : check for long long
5606 echo "Checking to see if you have long long..." >&4
5607 echo 'int main() { long long x = 7; return 0; }' > try.c
5609 if eval $compile; then
5611 echo "You have long long."
5614 echo "You do not have long long."
5620 : check for length of long long
5621 case "${d_longlong}${longlongsize}" in
5624 echo "Checking to see how big your long longs are..." >&4
5625 $cat >try.c <<'EOCP'
5629 printf("%d\n", (int)sizeof(long long));
5634 if eval $compile_ok; then
5635 longlongsize=`$run ./try`
5636 echo "Your long longs are $longlongsize bytes long."
5640 echo "(I can't seem to compile the test program. Guessing...)"
5641 rp="What is the size of a long long (in bytes)?"
5645 if $test "X$longsize" = "X$longlongsize"; then
5646 echo "(That isn't any different from an ordinary long.)"
5652 : see if inttypes.h is available
5653 : we want a real compile instead of Inhdr because some systems
5654 : have an inttypes.h which includes non-existent headers
5657 #include <inttypes.h>
5659 static int32_t foo32 = 0x12345678;
5663 if eval $compile; then
5664 echo "<inttypes.h> found." >&4
5667 echo "<inttypes.h> NOT found." >&4
5676 echo "Checking to see if you have int64_t..." >&4
5678 #include <sys/types.h>
5679 #$i_inttypes I_INTTYPES
5681 #include <inttypes.h>
5683 int main() { int64_t x = 7; }
5686 if eval $compile; then
5688 echo "You have int64_t."
5691 echo "You do not have int64_t."
5697 : Check if 64bit ints have a quad type
5699 echo "Checking which 64-bit integer type we could use..." >&4
5705 val='"unsigned int"'
5710 *) case "$longsize" in
5714 val='"unsigned long"'
5719 *) case "$d_longlong:$longlongsize" in
5724 val='"unsigned long long"'
5729 *) case "$d_int64_t" in
5748 '') echo "Alas, no 64-bit integer types in sight." >&4
5751 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5756 : Do we want 64bit support
5757 case "$uselonglong" in
5758 "$define"|true|[yY]*)
5761 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5763 use64bitint="$define"
5766 case "$use64bits" in
5767 "$define"|true|[yY]*)
5770 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5772 use64bitint="$define"
5775 case "$use64bitints" in
5776 "$define"|true|[yY]*)
5779 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5781 use64bitint="$define"
5784 case "$use64bitsint" in
5785 "$define"|true|[yY]*)
5788 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5790 use64bitint="$define"
5793 case "$uselonglongs" in
5794 "$define"|true|[yY]*)
5797 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5799 use64bitint="$define"
5802 case "$use64bitsall" in
5803 "$define"|true|[yY]*)
5806 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5808 use64bitall="$define"
5813 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5815 case "$use64bitall" in
5816 "$define"|true|[yY]*) use64bitint="$define" ;;
5822 You have natively 64-bit long integers.
5826 *) case "$use64bitint" in
5827 "$define"|true|[yY]*) dflt='y';;
5836 Perl can be built to take advantage of 64-bit integer types
5837 on some systems. To do so, Configure can be run with -Duse64bitint.
5838 Choosing this option will most probably introduce binary incompatibilities.
5840 If this doesn't make any sense to you, just accept the default '$dflt'.
5841 (The default has been chosen based on your configuration.)
5843 rp='Try to use 64-bit integers, if available?'
5846 [yY]*) val="$define" ;;
5854 case "$use64bitall" in
5855 "$define"|true|[yY]*) dflt='y' ;;
5856 *) case "$longsize" in
5864 You may also choose to try maximal 64-bitness. It means using as much
5865 64-bitness as possible on the platform. This in turn means even more
5866 binary incompatibilities. On the other hand, your platform may not
5867 have any more 64-bitness available than what you already have chosen.
5869 If this doesn't make any sense to you, just accept the default '$dflt'.
5870 (The default has been chosen based on your configuration.)
5872 rp='Try to use maximal 64-bit support, if available?'
5875 [yY]*) val="$define" ;;
5880 case "$use64bitall" in
5882 case "$use64bitint" in
5886 Since you have chosen a maximally 64-bit build, I'm also turning on
5887 the use of 64-bit integers.
5889 use64bitint="$define" ;;
5894 : Look for a hint-file generated 'call-back-unit'. If the
5895 : user has specified that a 64-bit perl is to be built,
5896 : we may need to set or change some other defaults.
5897 if $test -f use64bitint.cbu; then
5898 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5901 case "$use64bitint" in
5902 "$define"|true|[yY]*)
5904 4) case "$archname64" in
5905 '') archname64=64int ;;
5912 : Look for a hint-file generated 'call-back-unit'. If the
5913 : user has specified that a maximally 64-bit perl is to be built,
5914 : we may need to set or change some other defaults.
5915 if $test -f use64bitall.cbu; then
5916 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5919 case "$use64bitall" in
5920 "$define"|true|[yY]*)
5922 4) case "$archname64" in
5923 ''|64int) archname64=64all ;;
5930 case "$d_quad:$use64bitint" in
5934 *** You have chosen to use 64-bit integers,
5935 *** but none can be found.
5936 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5937 *** Cannot continue, aborting.
5944 : check for length of double
5946 case "$doublesize" in
5948 echo "Checking to see how big your double precision numbers are..." >&4
5957 printf("%d\n", (int)sizeof(double));
5962 if eval $compile_ok; then
5963 doublesize=`$run ./try`
5964 echo "Your double is $doublesize bytes long."
5967 echo "(I can't seem to compile the test program. Guessing...)"
5968 rp="What is the size of a double precision number (in bytes)?"
5976 : check for long doubles
5978 echo "Checking to see if you have long double..." >&4
5979 echo 'int main() { long double x = 7.0; }' > try.c
5981 if eval $compile; then
5983 echo "You have long double."
5986 echo "You do not have long double."
5992 : check for length of long double
5993 case "${d_longdbl}${longdblsize}" in
5996 echo "Checking to see how big your long doubles are..." >&4
5997 $cat >try.c <<'EOCP'
6001 printf("%d\n", sizeof(long double));
6006 if eval $compile; then
6007 longdblsize=`$run ./try`
6008 echo "Your long doubles are $longdblsize bytes long."
6012 echo "(I can't seem to compile the test program. Guessing...)" >&4
6013 rp="What is the size of a long double (in bytes)?"
6017 if $test "X$doublesize" = "X$longdblsize"; then
6018 echo "That isn't any different from an ordinary double."
6019 echo "I'll keep your setting anyway, but you may see some"
6020 echo "harmless compilation warnings."
6026 : determine the architecture name
6028 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6029 tarch=`arch`"-$osname"
6030 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6031 if uname -m > tmparch 2>&1 ; then
6032 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6033 -e 's/$/'"-$osname/" tmparch`
6041 case "$myarchname" in
6044 echo "(Your architecture name used to be $myarchname.)"
6048 case "$targetarch" in
6050 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6055 *) dflt="$archname";;
6057 rp='What is your architecture name'
6060 case "$usethreads" in
6062 echo "Threads selected." >&4
6064 *-thread*) echo "...and architecture name already has -thread." >&4
6066 *) archname="$archname-thread"
6067 echo "...setting architecture name to $archname." >&4
6072 case "$usemultiplicity" in
6074 echo "Multiplicity selected." >&4
6076 *-multi*) echo "...and architecture name already has -multi." >&4
6078 *) archname="$archname-multi"
6079 echo "...setting architecture name to $archname." >&4
6084 case "$use64bitint$use64bitall" in
6086 case "$archname64" in
6088 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6091 case "$use64bitint" in
6092 "$define") echo "64 bit integers selected." >&4 ;;
6094 case "$use64bitall" in
6095 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6098 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6100 *) archname="$archname-$archname64"
6101 echo "...setting architecture name to $archname." >&4
6107 case "$uselongdouble" in
6109 echo "Long doubles selected." >&4
6110 case "$longdblsize" in
6112 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6116 *-ld*) echo "...and architecture name already has -ld." >&4
6118 *) archname="$archname-ld"
6119 echo "...setting architecture name to $archname." >&4
6126 case "$useperlio" in
6128 echo "Perlio selected." >&4
6131 echo "Perlio not selected, using stdio." >&4
6133 *-stdio*) echo "...and architecture name already has -stdio." >&4
6135 *) archname="$archname-stdio"
6136 echo "...setting architecture name to $archname." >&4
6141 if $test -f archname.cbu; then
6142 echo "Your platform has some specific hints for architecture name, using them..."
6146 : set the prefixit variable, to compute a suitable default value
6147 prefixit='case "$3" in
6149 case "$oldprefix" in
6150 "") eval "$1=\"\$$2\"";;
6157 ""|" ") eval "$1=\"\$$2\"";;
6163 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6165 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6166 /*-$oldprefix/*|\~*-$oldprefix/*)
6167 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6168 *) eval "$1=\"\$$2\"";;
6172 : determine installation style
6173 : For now, try to deduce it from prefix unless it is already set.
6174 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6175 case "$installstyle" in
6176 '') case "$prefix" in
6177 *perl*) dflt='lib';;
6178 *) dflt='lib/perl5' ;;
6181 *) dflt="$installstyle" ;;
6183 : Probably not worth prompting for this since we prompt for all
6184 : the directories individually, and the prompt would be too long and
6188 : determine where public executables go
6193 rp='Pathname where the public executables will reside?'
6195 if $test "X$ansexp" != "X$binexp"; then
6199 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6200 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6201 : this via initialinstalllocation
6204 case "$userelocatableinc" in
6205 $define|true|[yY]*) dflt='y' ;;
6210 Would you like to build Perl so that the installation is relocatable, so that
6211 library paths in @INC are determined relative to the path of the perl binary?
6212 This is not advised for system Perl installs, or if you need to run setid
6213 scripts or scripts under taint mode.
6215 If this doesn't make any sense to you, just accept the default '$dflt'.
6217 rp='Use relocatable @INC?'
6220 y|Y) val="$define" ;;
6223 set userelocatableinc
6226 initialinstalllocation="$binexp"
6227 : Default prefix is now "up one level from where the binaries are"
6228 case "$userelocatableinc" in
6234 installprefixexp=".../.."
6238 : determine where private library files go
6239 : Usual default is /usr/local/lib/perl5/$version.
6240 : Also allow things like /opt/perl/lib/$version, since
6241 : /opt/perl/lib/perl5... would be redundant.
6242 : The default "style" setting is made in installstyle.U
6243 case "$installstyle" in
6244 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6245 *) set dflt privlib lib/$version ;;
6250 There are some auxiliary files for $package that need to be put into a
6251 private library directory that is accessible by everyone.
6256 rp='Pathname where the private library files will reside?'
6261 : set the prefixup variable, to restore leading tilda escape
6262 prefixup='case "$prefixexp" in
6264 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6267 : determine where public architecture dependent libraries go
6270 : privlib default is /usr/local/lib/$package/$version
6271 : archlib default is /usr/local/lib/$package/$version/$archname
6272 : privlib may have an optional trailing /share.
6273 tdflt=`echo $privlib | $sed 's,/share$,,'`
6274 tdflt=$tdflt/$archname
6283 $spackage contains architecture-dependent library files. If you are
6284 sharing libraries in a heterogeneous environment, you might store
6285 these files in a separate location. Otherwise, you can just include
6286 them with the rest of the public library files.
6291 rp='Where do you want to put the public architecture-dependent libraries?'
6295 if $test X"$archlib" = X"$privlib"; then
6301 : see if setuid scripts can be secure
6304 Some kernels have a bug that prevents setuid #! scripts from being
6305 secure. Some sites have disabled setuid #! scripts because of this.
6307 First let's decide if your kernel supports secure setuid #! scripts.
6308 (If setuid #! scripts would be secure but have been disabled anyway,
6309 don't say that they are secure if asked.)
6314 if $test -d /dev/fd; then
6315 echo "#!$ls" >reflect
6316 chmod +x,u+s reflect
6317 ./reflect >flect 2>&1
6318 if $contains "/dev/fd" flect >/dev/null; then
6319 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6323 If you are not sure if they are secure, I can check but I'll need a
6324 username and password different from the one you are using right now.
6325 If you don't have such a username or don't want me to test, simply
6329 rp='Other username to test security of setuid scripts with?'
6334 case "$d_suidsafe" in
6335 '') echo "I'll assume setuid scripts are *not* secure." >&4
6338 echo "Well, the $hint value is *not* secure." >&4
6340 *) echo "Well, the $hint value *is* secure." >&4
6345 $rm -f reflect flect
6346 echo "#!$ls" >reflect
6347 chmod +x,u+s reflect
6350 echo '"su" will (probably) prompt you for '"$ans's password."
6351 su $ans -c './reflect >flect'
6352 if $contains "/dev/fd" flect >/dev/null; then
6353 echo "Okay, it looks like setuid scripts are secure." >&4
6356 echo "I don't think setuid scripts are secure." >&4
6361 rp='Does your kernel have *secure* setuid scripts?'
6364 [yY]*) val="$define";;
6369 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6370 echo "(That's for file descriptors, not floppy disks.)"
6376 $rm -f reflect flect
6378 : now see if they want to do setuid emulation
6379 if $test $patchlevel -lt 11; then
6382 case "$d_suidsafe" in
6385 echo "No need to emulate SUID scripts since they are secure here." >&4
6389 Some systems have disabled setuid scripts, especially systems where
6390 setuid scripts cannot be secure. On systems where setuid scripts have
6391 been disabled, the setuid/setgid bits on scripts are currently
6392 useless. It is possible for $package to detect those bits and emulate
6393 setuid/setgid in a secure fashion. This emulation will only work if
6394 setuid scripts have been disabled in your kernel.
6398 "$define") dflt=y ;;
6401 rp="Do you want to do setuid/setgid emulation?"
6404 [yY]*) val="$define";;
6416 SUID emulation has been removed for 5.12
6417 Please re-run Configure without -Dd_dosuid
6426 : Find perl5.005 or later.
6427 echo "Looking for a previously installed perl5.005 or later... "
6429 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6430 : Check if this perl is recent and can load a simple module
6431 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6434 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6444 '') echo "None found. That's ok.";;
6445 *) echo "Using $perl5." ;;
6448 : Set the siteprefix variables
6451 After $package is installed, you may wish to install various
6452 add-on modules and utilities. Typically, these add-ons will
6453 be installed under $prefix with the rest
6454 of this package. However, you may wish to install such add-ons
6455 elsewhere under a different prefix.
6457 If you do not wish to put everything under a single prefix, that's
6458 ok. You will be prompted for the individual locations; this siteprefix
6459 is only used to suggest the defaults.
6461 The default should be fine for most people.
6465 rp='Installation prefix to use for add-on modules and utilities?'
6466 : XXX Here might be another good place for an installstyle setting.
6467 case "$siteprefix" in
6469 *) dflt=$siteprefix ;;
6472 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6474 case "$siteprefix" in
6478 *) oldsiteprefix="$prefix";;
6483 siteprefixexp="$ansexp"
6485 : determine where site specific libraries go.
6486 : Usual default is /usr/local/lib/perl5/site_perl/$version
6487 : The default "style" setting is made in installstyle.U
6488 : XXX No longer works with Prefixit stuff.
6489 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6491 '') case "$installstyle" in
6492 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6493 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6501 The installation process will create a directory for
6502 site-specific extensions and modules. Most users find it convenient
6503 to place all site-specific files in this directory rather than in the
6504 main distribution directory.
6508 rp='Pathname for the site-specific library files?'
6512 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6514 : Determine list of previous versions to include in @INC
6515 $cat > getverlist <<EOPL
6518 \$api_versionstring = "$api_versionstring";
6519 \$version = "$version";
6520 \$stem = "$sitelib_stem";
6521 \$archname = "$archname";
6523 $cat >> getverlist <<'EOPL'
6524 # The list found is store twice for each entry: the original name, and
6525 # the binary broken down version as pack "sss", so sorting is easy and
6526 # unambiguous. This will work for all versions that have a maximum of
6527 # three digit groups, separate by '.'s or '_'s. Names are extended with
6528 # ".0.0" to ensure at least three elements for the pack.
6529 # -- H.Merijn Brand (m)'06 23-10-2006
6531 # Can't have leading @ because metaconfig interprets it as a command!
6532 ;@inc_version_list=();
6533 # XXX Redo to do opendir/readdir?
6536 ;@candidates = map {
6537 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6538 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6544 ($pversion, $aversion, $vsn5005) = map {
6545 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6546 foreach $d (@candidates) {
6547 if ($d->[1] lt $pversion) {
6548 if ($d->[1] ge $aversion) {
6549 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6551 elsif ($d->[1] ge $vsn5005) {
6552 unshift(@inc_version_list, grep { -d } $d->[0]);
6556 # Skip newer version. I.e. don't look in
6557 # 5.7.0 if we're installing 5.6.1.
6561 if (@inc_version_list) {
6562 print join(' ', @inc_version_list);
6565 # Blank space to preserve value for next Configure run.
6570 case "$inc_version_list" in
6571 '') if test -x "$perl5$exe_ext"; then
6572 dflt=`$perl5 getverlist`
6577 $undef) dflt='none' ;;
6578 *) eval dflt=\"$inc_version_list\" ;;
6581 ''|' ') dflt=none ;;
6588 In order to ease the process of upgrading, this version of perl
6589 can be configured to use modules built and installed with earlier
6590 versions of perl that were installed under $prefix. Specify here
6591 the list of earlier versions that this version of perl should check.
6592 If Configure detected no earlier versions of perl installed under
6593 $prefix, then the list will be empty. Answer 'none' to tell perl
6594 to not search earlier versions.
6596 The default should almost always be sensible, so if you're not sure,
6597 just accept the default.
6600 rp='List of earlier versions to include in @INC?'
6603 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6604 *) inc_version_list="$ans" ;;
6606 case "$inc_version_list" in
6608 inc_version_list_init='0'
6609 d_inc_version_list="$undef"
6611 *) inc_version_list_init=`echo $inc_version_list |
6612 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6613 d_inc_version_list="$define"
6618 : see if malloc/malloc.h has to be included
6619 set malloc/malloc.h i_mallocmalloc
6622 : see if this is a malloc.h system
6623 : we want a real compile instead of Inhdr because some systems have a
6624 : malloc.h that just gives a compile error saying to use stdlib.h instead
6629 #$i_mallocmalloc I_MALLOCMALLOC
6630 #ifdef I_MALLOCMALLOC
6631 # include <malloc/malloc.h>
6634 int main () { return 0; }
6637 if eval $compile; then
6638 echo "<malloc.h> found." >&4
6641 echo "<malloc.h> NOT found." >&4
6648 : check for void type
6650 echo "Checking to see how well your C compiler groks the void type..." >&4
6651 case "$voidflags" in
6663 extern void moo(); /* function returning void */
6664 void (*goo)(); /* ptr to func returning void */
6666 void *hue; /* generic ptr */
6679 int main() { sub(); }
6681 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6682 voidflags=$defvoidused
6683 echo "Good. It appears to support void to the level $package wants.">&4
6684 if $contains warning .out >/dev/null 2>&1; then
6685 echo "However, you might get some warnings that look like this:"
6689 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6690 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6691 echo "It supports 1..."
6692 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6693 echo "It also supports 2..."
6694 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6696 echo "And it supports 4 but not 8 definitely."
6698 echo "It doesn't support 4..."
6699 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6701 echo "But it supports 8."
6704 echo "Neither does it support 8."
6708 echo "It does not support 2..."
6709 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6711 echo "But it supports 4 and 8."
6713 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6715 echo "And it supports 4 but has not heard about 8."
6717 echo "However it supports 8 but not 4."
6722 echo "There is no support at all for void."
6727 case "$voidflags" in
6730 Support flag bits are:
6731 1: basic void declarations.
6732 2: arrays of pointers to functions returning void.
6733 4: operations between pointers to and addresses of void functions.
6734 8: generic void pointers.
6737 rp="Your void support flags add up to what?"
6744 : check for length of pointer
6748 echo "Checking to see how big your pointers are..." >&4
6749 if test "$voidflags" -gt 7; then
6750 echo '#define VOID_PTR char *' > try.c
6752 echo '#define VOID_PTR void *' > try.c
6762 printf("%d\n", (int)sizeof(VOID_PTR));
6767 if eval $compile_ok; then
6768 ptrsize=`$run ./try`
6769 echo "Your pointers are $ptrsize bytes long."
6772 echo "(I can't seem to compile the test program. Guessing...)" >&4
6773 rp="What is the size of a pointer (in bytes)?"
6780 case "$use64bitall" in
6781 "$define"|true|[yY]*)
6785 *** You have chosen a maximally 64-bit build,
6786 *** but your pointers are only 4 bytes wide.
6787 *** Please rerun Configure without -Duse64bitall.
6792 *** Since you have quads, you could possibly try with -Duse64bitint.
6797 *** Cannot continue, aborting.
6808 : determine whether to use malloc wrapping
6810 case "$usemallocwrap" in
6811 [yY]*|true|$define) dflt='y' ;;
6812 [nN]*|false|$undef) dflt='n' ;;
6813 *) case "$usedevel" in
6814 [yY]*|true|$define) dflt='y' ;;
6819 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6821 usemallocwrap="$ans"
6824 usemallocwrap="$define" ;;
6826 usemallocwrap="$undef" ;;
6829 : determine which malloc to compile in
6831 case "$usemymalloc" in
6832 [yY]*|true|$define) dflt='y' ;;
6833 [nN]*|false|$undef) dflt='n' ;;
6834 *) case "$ptrsize" in
6840 rp="Do you wish to attempt to use the malloc that comes with $package?"
6846 mallocsrc='malloc.c'
6847 mallocobj="malloc$_o"
6848 d_mymalloc="$define"
6851 : Remove malloc from list of libraries to use
6852 echo "Removing unneeded -lmalloc from library list" >&4
6853 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6856 echo "libs = $libs" >&4
6868 : compute the return types of malloc and free
6870 $cat >malloc.c <<END
6874 #include <sys/types.h>
6888 case "$malloctype" in
6890 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6897 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6901 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6908 echo "Your system uses $freetype free(), it would seem." >&4
6910 : determine where site specific architecture-dependent libraries go.
6911 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6912 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6913 : sitelib may have an optional trailing /share.
6915 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6916 dflt="$dflt/$archname"
6921 set sitearch sitearch none
6925 The installation process will also create a directory for
6926 architecture-dependent site-specific extensions and modules.
6930 rp='Pathname for the site-specific architecture-dependent library files?'
6934 if $test X"$sitearch" = X"$sitelib"; then
6937 d_sitearch="$define"
6940 : Set the vendorprefix variables
6943 The installation process will also create a directory for
6944 vendor-supplied add-ons. Vendors who supply perl with their system
6945 may find it convenient to place all vendor-supplied files in this
6946 directory rather than in the main distribution directory. This will
6947 ease upgrades between binary-compatible maintenance versions of perl.
6949 Of course you may also use these directories in whatever way you see
6950 fit. For example, you might use them to access modules shared over a
6951 company-wide network.
6953 The default answer should be fine for most people.
6954 This causes further questions about vendor add-ons to be skipped
6955 and no vendor-specific directories will be configured for perl.
6958 rp='Do you want to configure vendor-specific add-on directories?'
6959 case "$usevendorprefix" in
6960 define|true|[yY]*) dflt=y ;;
6961 *) : User may have set vendorprefix directly on Configure command line.
6962 case "$vendorprefix" in
6971 rp='Installation prefix to use for vendor-supplied add-ons?'
6972 case "$vendorprefix" in
6974 *) dflt=$vendorprefix ;;
6977 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6979 case "$vendorprefix" in
6983 *) oldvendorprefix="$prefix";;
6987 usevendorprefix="$define"
6989 vendorprefixexp="$ansexp"
6991 *) usevendorprefix="$undef"
6997 : Set the vendorlib variables
6998 case "$vendorprefix" in
6999 '') d_vendorlib="$undef"
7003 *) d_vendorlib="$define"
7004 : determine where vendor-supplied modules go.
7005 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7006 case "$vendorlib" in
7008 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7009 case "$installstyle" in
7010 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7011 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7014 *) dflt="$vendorlib"
7018 rp='Pathname for the vendor-supplied library files?'
7021 vendorlibexp="$ansexp"
7024 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7028 : Set the vendorarch variables
7029 case "$vendorprefix" in
7030 '') d_vendorarch="$undef"
7034 *) d_vendorarch="$define"
7035 : determine where vendor-supplied architecture-dependent libraries go.
7036 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7037 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7038 : vendorlib may have an optional trailing /share.
7039 case "$vendorarch" in
7040 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7041 dflt="$dflt/$archname"
7043 *) dflt="$vendorarch" ;;
7046 rp='Pathname for vendor-supplied architecture-dependent files?'
7049 vendorarchexp="$ansexp"
7052 prefixvar=vendorarch
7054 if $test X"$vendorarch" = X"$vendorlib"; then
7055 d_vendorarch="$undef"
7057 d_vendorarch="$define"
7060 : Final catch-all directories to search
7063 Lastly, you can have perl look in other directories for extensions and
7064 modules in addition to those already specified.
7065 These directories will be searched after
7069 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7070 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7072 case "$otherlibdirs" in
7073 ''|' ') dflt='none' ;;
7074 *) dflt="$otherlibdirs" ;;
7077 Enter a colon-separated set of extra paths to include in perl's @INC
7078 search path, or enter 'none' for no extra paths.
7082 rp='Colon-separated list of additional directories for perl to search?'
7085 ' '|''|none) otherlibdirs=' ' ;;
7086 *) otherlibdirs="$ans" ;;
7088 case "$otherlibdirs" in
7092 set d_perl_otherlibdirs
7095 : Cruising for prototypes
7097 echo "Checking out function prototypes..." >&4
7098 $cat >prototype.c <<EOCP
7103 int main(int argc, char *argv[]) {
7106 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7107 echo "Your C compiler appears to support function prototypes."
7110 echo "Your C compiler doesn't seem to understand function prototypes."
7117 : Check if ansi2knr is required
7118 case "$prototype" in
7120 *) ansi2knr='ansi2knr'
7125 This version of $package can only be compiled by a compiler that
7126 understands function prototypes. Unfortunately, your C compiler
7128 doesn't seem to understand them. Sorry about that.
7130 If GNU cc is available for your system, perhaps you could try that instead.
7132 Eventually, we hope to support building Perl with pre-ANSI compilers.
7133 If you would like to help in that effort, please contact <perlbug@perl.org>.
7135 Aborting Configure now.
7142 dflt_dtrace='/usr/sbin/dtrace'
7145 Perl can be built to support DTrace on platforms that support it.
7146 DTrace is a diagnosis and performance analysis tool from Sun.
7148 If this doesn't make any sense to you, just accept the default '$dflt'.
7152 case "$usedtrace" in
7158 dflt_dtrace=$usedtrace
7165 rp='Support DTrace if available?'
7168 y|Y) val="$define" ;;
7174 test "X$usedtrace" != "X$define" && break
7177 rp='Where is the dtrace executable?'
7186 if $dtrace -h -s ../perldtrace.d \
7187 -o perldtrace.tmp >/dev/null 2>&1 \
7188 && rm -f perldtrace.tmp
7191 echo "Good: your $dtrace knows about the -h flag."
7195 *** $me: Fatal Error: $dtrace doesn't support -h flag
7197 *** Your installed dtrace doesn't support the -h switch to compile a D
7198 *** program into a C header. Can't continue.
7210 *** $me: Fatal Error: $dtrace not found.
7217 echo "*** $dtrace was not found."
7223 : See if we want extra modules installed
7230 Perl can be built with extra modules or bundles of modules which
7231 will be fetched from the CPAN and installed alongside Perl.
7233 Notice that you will need access to the CPAN; either via the Internet,
7234 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7235 be asked later to configure the CPAN.pm module which will in turn do
7236 the installation of the rest of the extra modules or bundles.)
7238 Notice also that if the modules require any external software such as
7239 libraries and headers (the libz library and the zlib.h header for the
7240 Compress::Zlib module, for example) you MUST have any such software
7241 already installed, this configuration process will NOT install such
7244 If this doesn't make any sense to you, just accept the default '$dflt'.
7246 rp='Install any extra modules (y or n)?'
7252 Please list any extra modules or bundles to be installed from CPAN,
7253 with spaces between the names. The names can be in any format the
7254 'install' command of CPAN.pm will understand. (Answer 'none',
7255 without the quotes, to install no extra modules or bundles.)
7265 $rm -f ../extras.lst
7267 *) echo "(Saving the list of extras for later...)"
7268 echo "$extras" > ../extras.lst
7276 : determine where html pages for programs go
7277 set html1dir html1dir none
7281 If you wish to install html files for programs in $spackage, indicate
7282 the appropriate directory here. To skip installing html files,
7286 ''|none|$undef|' ') dflt=none ;;
7287 *) dflt=$html1dir ;;
7290 rp="Directory for the main $spackage html pages?"
7294 : Use ' ' for none so value is preserved next time through Configure
7295 $test X"$html1dir" = "X" && html1dir=' '
7297 : determine where html pages for libraries and modules go
7298 set html3dir html3dir none
7302 If you wish to install html files for modules associated with $spackage,
7303 indicate the appropriate directory here. To skip installing html files,
7306 : There is no obvious default. If they have specified html1dir, then
7307 : try to key off that, possibly changing .../html1 into .../html3.
7309 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7310 *) dflt=$html3dir ;;
7313 rp="Directory for the $spackage module html pages?"
7317 : Use ' ' for none so value is preserved next time through Configure
7318 $test X"$html3dir" = "X" && html3dir=' '
7320 : determine whether to install perl also as /usr/bin/perl
7323 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7325 Many scripts expect perl to be installed as /usr/bin/perl.
7327 If you want to, I can install the perl you are about to compile
7328 as /usr/bin/perl (in addition to $bin/perl).
7330 if test -f /usr/bin/perl; then
7333 However, please note that because you already have a /usr/bin/perl,
7334 overwriting that with a new Perl would very probably cause problems.
7335 Therefore I'm assuming you don't want to do that (unless you insist).
7338 case "$installusrbinperl" in
7339 "$define"|[yY]*) dflt='y';;
7345 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7348 case "$installusrbinperl" in
7349 "$undef"|[nN]*) dflt='n';;
7353 rp="Do you want to install perl as /usr/bin/perl?"
7356 [yY]*) val="$define";;
7362 set installusrbinperl
7365 : Check if we are using the GNU C library
7367 echo "Checking for GNU C Library..." >&4
7369 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7370 alone are insufficient to distinguish different versions, such as
7371 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7372 libc version 2.1.0. A. Dougherty, June 3, 2002.
7378 # ifdef __GLIBC_MINOR__
7379 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7380 # include <gnu/libc-version.h>
7381 printf("%s\n", gnu_get_libc_version());
7383 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7386 printf("%d\n", __GLIBC__);
7395 if eval $compile_ok && $run ./try > glibc.ver; then
7397 gnulibc_version=`$cat glibc.ver`
7398 echo "You are using the GNU C Library version $gnulibc_version"
7402 echo "You are not using the GNU C Library"
7408 : see if nm is to be used to determine whether a symbol is defined or not
7412 case "$d_gnulibc" in
7415 echo "nm probably won't work on the GNU C Library." >&4
7421 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7423 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7424 echo "'nm' won't be sufficient on this sytem." >&4
7430 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7431 if $test $dflt -gt 20; then
7441 true|$define) dflt=y;;
7448 I can use $nm to extract the symbols from your C libraries. This
7449 is a time consuming task which may generate huge output on the disk (up
7450 to 3 megabytes) but that should make the symbols extraction faster. The
7451 alternative is to skip the 'nm' extraction part and to compile a small
7452 test program instead to determine whether each symbol is present. If
7453 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7454 this may be the best solution.
7456 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7459 rp="Shall I use $nm to extract C symbols from the libraries?"
7462 [Nn]*) usenm=false;;
7471 : nm options which may be necessary
7473 '') if $test -f /mach_boot; then
7475 elif $test -d /usr/ccs/lib; then
7476 nm_opt='-p' # Solaris (and SunOS?)
7477 elif $test -f /dgux; then
7479 elif $test -f /lib64/rld; then
7480 nm_opt='-p' # 64-bit Irix
7486 : nm options which may be necessary for shared libraries but illegal
7487 : for archive libraries. Thank you, Linux.
7488 case "$nm_so_opt" in
7489 '') case "$myuname" in
7491 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7492 nm_so_opt='--dynamic'
7499 : Figure out where the libc is located
7502 : get list of predefined functions in a handy place
7507 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7513 *) for thislib in $libs; do
7516 : Handle C library specially below.
7519 thislib=`echo $thislib | $sed -e 's/^-l//'`
7520 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7522 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7524 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7526 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7528 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7530 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7532 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7537 libnames="$libnames $try"
7539 *) libnames="$libnames $thislib" ;;
7548 for xxx in $libpth; do
7549 $test -r $1 || set $xxx/libc.$so
7550 : The messy sed command sorts on library version numbers.
7552 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7553 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7555 s/[0-9][0-9]*/0000&/g
7556 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7559 $sort | $sed -e 's/^.* //'`
7562 $test -r $1 || set /usr/ccs/lib/libc.$so
7563 $test -r $1 || set /lib/libsys_s$_a
7569 if $test -r "$1"; then
7570 echo "Your (shared) C library seems to be in $1."
7572 elif $test -r /lib/libc && $test -r /lib/clib; then
7573 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7575 libc='/lib/clib /lib/libc'
7576 if $test -r /lib/syslib; then
7577 echo "(Your math library is in /lib/syslib.)"
7578 libc="$libc /lib/syslib"
7580 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7581 echo "Your C library seems to be in $libc, as you said before."
7582 elif $test -r $incpath/usr/lib/libc$_a; then
7583 libc=$incpath/usr/lib/libc$_a;
7584 echo "Your C library seems to be in $libc. That's fine."
7585 elif $test -r /lib/libc$_a; then
7587 echo "Your C library seems to be in $libc. You're normal."
7589 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7591 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7592 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7593 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7595 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7597 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7600 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7602 if $test -r "$tans"; then
7603 echo "Your C library seems to be in $tans, of all places."
7609 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7613 If the guess above is wrong (which it might be if you're using a strange
7614 compiler, or your machine supports multiple models), you can override it here.
7619 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7621 I can't seem to find your C library. I've looked in the following places:
7624 $sed 's/^/ /' libpath
7627 None of these seems to contain your C library. I need to get its name...
7632 rp='Where is your C library?'
7637 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7638 set X `cat libnames`
7641 case $# in 1) xxx=file; esac
7642 echo "Extracting names from the following $xxx for later perusal:" >&4
7644 $sed 's/^/ /' libnames >&4
7646 $echo $n "This may take a while...$c" >&4
7650 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7651 *) $nm $nm_opt $file 2>/dev/null;;
7656 $grep fprintf libc.tmp > libc.ptf
7657 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7658 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7660 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7664 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7666 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7668 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7670 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7672 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7674 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7676 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7678 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7680 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7682 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7684 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7685 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7687 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7689 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7691 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7693 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7695 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7697 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7699 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7701 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7703 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7705 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7707 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7709 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7711 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7713 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7715 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7718 $nm -p $* 2>/dev/null >libc.tmp
7719 $grep fprintf libc.tmp > libc.ptf
7720 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7721 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7727 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7729 if $ar t $libc > libc.tmp && \
7730 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7732 for thisname in $libnames $libc; do
7733 $ar t $thisname >>libc.tmp
7735 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7737 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7738 for thisname in $libnames $libc; do
7739 $ar tv $thisname >>libc.tmp
7740 emximp -o tmp.imp $thisname \
7742 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7743 < tmp.imp >>libc.tmp
7746 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7749 echo "$ar didn't seem to work right." >&4
7750 echo "Maybe this is a Cray...trying bld instead..." >&4
7752 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7755 for thisname in $libnames; do
7757 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7758 $ar t $thisname >>libc.tmp
7762 echo "That didn't work either. Giving up." >&4
7772 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7773 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7775 *) if $test -f /lib/syscalls.exp; then
7777 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7778 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7779 /lib/syscalls.exp >>libc.list
7785 $rm -f libnames libpath
7787 : see if dld is available
7791 : Check if we are using C++
7793 echo "Checking for C++..." >&4
7794 $cat >try.c <<'EOCP'
7806 if eval $compile_ok && $run ./try; then
7808 echo "You are using a C++ compiler."
7811 echo "You are not using a C++ compiler."
7817 : is a C symbol defined?
7820 -v) tf=libc.tmp; tdc="";;
7821 -a) tf=libc.tmp; tdc="[]";;
7822 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7824 case "$d_cplusplus" in
7825 $define) extern_C="extern \"C\"" ;;
7826 *) extern_C="extern" ;;
7829 case "$reuseval-$4" in
7831 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7836 if $test "$runnm" = true; then
7837 if $contains $tlook $tf >/dev/null 2>&1; then
7839 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7840 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7841 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7842 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7846 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7847 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7853 $define) tval=true;;
7860 : define an is-in-libc? function
7861 inlibc='echo " "; td=$define; tu=$undef;
7862 sym=$1; var=$2; eval "was=\$$2";
7864 case "$reuseval$was" in
7874 echo "$sym() found." >&4;
7875 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7877 echo "$sym() NOT found." >&4;
7878 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7882 $define) echo "$sym() found." >&4;;
7883 *) echo "$sym() NOT found." >&4;;
7887 : see if dlopen exists
7889 xxx_ccflags="$ccflags"
7891 : with g++ one needs -shared to get is-in-libc to work for dlopen
7892 case "$gccversion" in
7894 *) case "$d_cplusplus" in
7895 "$define") ccflags="$ccflags -shared" ;;
7902 ccflags="$xxx_ccflags"
7904 : see if this is a unistd.h system
7905 set unistd.h i_unistd
7908 : determine which dynamic loading, if any, to compile in
7910 dldir="ext/DynaLoader"
7923 $define) dflt='y' ;;
7926 $define) dflt='y' ;;
7928 : Does a dl_xxx.xs file exist for this operating system
7929 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7932 rp="Do you wish to use dynamic loading?"
7940 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7941 dflt="$dldir/dl_${osname}.xs"
7942 elif $test "$d_dlopen" = "$define" ; then
7943 dflt="$dldir/dl_dlopen.xs"
7944 elif $test "$i_dld" = "$define" ; then
7945 dflt="$dldir/dl_dld.xs"
7950 *) dflt="$dldir/$dlsrc"
7953 echo "The following dynamic loading files are available:"
7954 : Can not go over to $dldir because getfile has path hard-coded in.
7955 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7956 rp="Source file to use for dynamic loading"
7962 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7966 Some systems may require passing special flags to $cc -c to
7967 compile modules that will be used to create a shared library.
7968 To use no flags, say "none".
7971 case "$cccdlflags" in
7972 '') case "$gccversion" in
7973 '') case "$osname" in
7975 next) dflt='none' ;;
7976 irix*) dflt='-KPIC' ;;
7977 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7978 sunos) dflt='-pic' ;;
7982 *) case "$osname" in
7983 darwin) dflt='none' ;;
7984 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7989 *) dflt="$cccdlflags" ;;
7991 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7994 none) cccdlflags=' ' ;;
7995 *) cccdlflags="$ans" ;;
8000 Some systems use ld to create libraries that can be dynamically loaded,
8001 while other systems (such as those using ELF) use $cc.
8005 '') $cat >try.c <<EOM
8006 /* Test for whether ELF binaries are produced */
8018 int i = open("a.out",O_RDONLY);
8021 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8022 exit(0); /* succeed (yes, it's ELF) */
8027 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8029 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8034 echo "I'll use ld to build dynamic libraries."
8043 rp="What command should be used to create dynamic libraries?"
8049 Some systems may require passing special flags to $ld to create a
8050 library that can be dynamically loaded. If your ld flags include
8051 -L/other/path options to locate libraries outside your loader's normal
8052 search path, you may need to specify those -L options here as well. To
8053 use no flags, say "none".
8056 case "$lddlflags" in
8057 '') case "$osname" in
8058 beos) dflt='-nostart' ;;
8059 haiku) dflt='-shared' ;;
8061 case "$gccversion" in
8062 '') dflt="$dflt +vnocompatwarnings" ;;
8065 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8066 next) dflt='none' ;;
8067 solaris) dflt='-G' ;;
8068 sunos) dflt='-assert nodefinitions' ;;
8069 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8073 *) dflt="$lddlflags" ;;
8076 : Try to guess additional flags to pick up local libraries.
8077 : Be careful not to append to a plain 'none'
8081 for thisflag in $ldflags; do
8086 *) dflt="$dflt $thisflag" ;;
8093 ''|' ') dflt='none' ;;
8097 *-fstack-protector*)
8099 *-fstack-protector*) ;; # Don't add it again
8100 *) dflt="$dflt -fstack-protector" ;;
8106 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8109 none) lddlflags=' ' ;;
8110 *) lddlflags="$ans" ;;
8115 Some systems may require passing special flags to $cc to indicate that
8116 the resulting executable will use dynamic linking. To use no flags,
8120 case "$ccdlflags" in
8121 '') case "$osname" in
8122 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8123 next|sunos) dflt='none' ;;
8127 *) dflt="$ccdlflags" ;;
8129 rp="Any special flags to pass to $cc to use dynamic linking?"
8132 none) ccdlflags=' ' ;;
8133 *) ccdlflags="$ans" ;;
8144 : Do we want a shared libperl?
8148 # No dynamic loading being used, so don't bother even to prompt.
8151 *) case "$useshrplib" in
8152 '') case "$osname" in
8153 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8155 also='Building a shared libperl is required for dynamic loading to work on your system.'
8160 also='Building a shared libperl is needed for MAB support.'
8178 The perl executable is normally obtained by linking perlmain.c with
8179 libperl${_a}, any static extensions (usually just DynaLoader), and
8180 any other libraries needed on this system (such as -lm, etc.). Since
8181 your system supports dynamic loading, it is probably possible to build
8182 a shared libperl.$so. If you will have more than one executable linked
8183 to libperl.$so, this will significantly reduce the size of each
8184 executable, but it may have a noticeable effect on performance. The
8185 default is probably sensible for your system.
8189 rp="Build a shared libperl.$so (y/n)"
8193 useshrplib='true' ;;
8194 *) useshrplib='false' ;;
8199 case "$useshrplib" in
8201 case "$userelocatableinc" in
8203 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8204 echo "See INSTALL for an explanation why that won't work." >&4
8210 # Figure out a good name for libperl.so. Since it gets stored in
8211 # a version-specific architecture-dependent library, the version
8212 # number isn't really that important, except for making cc/ld happy.
8214 # A name such as libperl.so.10.1
8215 majmin="libperl.$so.$patchlevel.$subversion"
8216 # A name such as libperl.so.100
8217 majonly=`echo $patchlevel $subversion |
8218 $awk '{printf "%d%02d", $1, $2}'`
8219 majonly=libperl.$so.$majonly
8220 # I'd prefer to keep the os-specific stuff here to a minimum, and
8221 # rely on figuring it out from the naming of libc.
8222 case "${osname}${osvers}" in
8225 # XXX How handle the --version stuff for MAB?
8227 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8230 cygwin*) # ld links now against the dll directly
8231 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8232 majonly=`echo $patchlevel $subversion |
8233 $awk '{printf "%03d%03d", $1, $2}'`
8234 majonly=cygperl5.$majonly.$so
8237 *) # Try to guess based on whether libc has major.minor.
8239 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8240 *libc.$so.[0-9]*) dflt=$majonly ;;
8241 *) dflt=libperl.$so ;;
8251 I need to select a good name for the shared libperl. If your system uses
8252 library names with major and minor numbers, then you might want something
8253 like $majmin. Alternatively, if your system uses a single version
8254 number for shared libraries, then you might want to use $majonly.
8255 Or, your system might be quite happy with a simple libperl.$so.
8257 Since the shared libperl will get installed into a version-specific
8258 architecture-dependent directory, the version number of the shared perl
8259 library probably isn't important, so the default should be o.k.
8262 rp='What name do you want to give to the shared libperl?'
8265 echo "Ok, I'll use $libperl"
8268 libperl="libperl${_a}"
8272 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8276 WARNING: Use of the shrpdir variable for the installation location of
8277 the shared $libperl is not supported. It was never documented and
8278 will not work in this version. Let me (perlbug@perl.org)
8279 know of any problems this may cause.
8285 But your current setting of $shrpdir is
8286 the default anyway, so it's harmless.
8291 Further, your current attempted setting of $shrpdir
8292 conflicts with the value of $archlibexp/CORE
8293 that installperl will use.
8300 # How will the perl executable find the installed shared $libperl?
8301 # Add $xxx to ccdlflags.
8302 # If we can't figure out a command-line option, use $shrpenv to
8303 # set env LD_RUN_PATH. The main perl makefile uses this.
8304 shrpdir=$archlibexp/CORE
8307 if "$useshrplib"; then
8310 # We'll set it in Makefile.SH...
8315 freebsd|netbsd|openbsd|interix|dragonfly)
8316 xxx="-Wl,-R$shrpdir"
8318 bsdos|linux|irix*|dec_osf|gnu*)
8319 xxx="-Wl,-rpath,$shrpdir"
8322 # next doesn't like the default...
8325 # beos doesn't like the default, either.
8328 # Haiku doesn't like the default, either.
8331 # hpux doesn't like the default, either.
8332 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8335 # cygwin needs only ldlibpth
8338 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8344 # Only add $xxx if it isn't already in ccdlflags.
8345 case " $ccdlflags " in
8347 *) ccdlflags="$ccdlflags $xxx"
8350 Adding $xxx to the flags
8351 passed to $ld so that the perl executable will find the
8352 installed shared $libperl.
8360 # Fix ccdlflags in AIX for building external extensions.
8361 # (For building Perl itself bare -bE:perl.exp is needed,
8362 # Makefile.SH takes care of this.)
8364 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8366 # Respect a hint or command-line value.
8368 '') shrpenv="$tmp_shrpenv" ;;
8370 case "$ldlibpthname" in
8371 '') ldlibpthname=LD_LIBRARY_PATH ;;
8372 none) ldlibpthname='' ;;
8375 : determine where manual pages are on this system
8379 syspath='/usr/share/man/man1 /usr/man/man1'
8380 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8381 syspath="$syspath /usr/man/u_man/man1"
8382 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8383 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8384 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8385 sysman=`./loc . /usr/man/man1 $syspath`
8388 if $test -d "$sysman"; then
8389 echo "System manual is in $sysman." >&4
8391 echo "Could not find manual pages in source form." >&4
8394 : determine where manual pages go
8395 set man1dir man1dir none
8399 $spackage has manual pages available in source form.
8403 echo "However, you don't have nroff, so they're probably useless to you."
8405 '') man1dir="none";;
8408 echo "If you don't want the manual sources installed, answer 'none'."
8413 lookpath="$prefixexp/share/man/man1"
8414 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8415 lookpath="$lookpath $prefixexp/man/p_man/man1"
8416 lookpath="$lookpath $prefixexp/man/u_man/man1"
8417 lookpath="$lookpath $prefixexp/man/man.1"
8419 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8420 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8430 rp="Where do the main $spackage manual pages (source) go?"
8432 if $test "X$man1direxp" != "X$ansexp"; then
8443 : What suffix to use on installed man pages
8450 rp="What suffix should be used for the main $spackage man pages?"
8452 '') case "$man1dir" in
8466 *) dflt="$man1ext";;
8473 : see if we can have long filenames
8475 first=123456789abcdef
8477 if (echo hi >$first) 2>/dev/null; then
8478 if $test -f 123456789abcde; then
8479 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8482 echo 'You can have filenames longer than 14 characters.'>&4
8487 You can't have filenames longer than 14 chars.
8488 You can't even think about them!
8494 $rm -rf 123456789abcde*
8496 : determine where library module manual pages go
8497 set man3dir man3dir none
8501 $spackage has manual pages for many of the library modules.
8507 However, you don't have nroff, so they're probably useless to you.
8510 '') man3dir="none";;
8514 case "$d_flexfnam" in
8517 However, your system can't handle the long file names like File::Basename.3.
8520 '') man3dir="none";;
8524 echo "If you don't want the manual sources installed, answer 'none'."
8525 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8527 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8528 if $test -d "$privlib/man/man3"; then
8531 WARNING: Previous versions of perl installed man3 pages into
8532 $privlib/man/man3. This version will suggest a
8533 new default of $dflt.
8537 rp='Do you wish to preserve the old behavior?(y/n)'
8540 y*) dflt="$privlib/man/man3" ;;
8545 *) dflt="$man3dir" ;;
8552 rp="Where do the $package library man pages (source) go?"
8562 : What suffix to use on installed man pages
8568 rp="What suffix should be used for the $package library man pages?"
8570 '') case "$man3dir" in
8584 *) dflt="$man3ext";;
8591 : see if we have to deal with yellow pages, now NIS.
8592 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8593 if $test -f /usr/etc/nibindd; then
8595 echo "I'm fairly confident you're on a NeXT."
8597 rp='Do you get the hosts file via NetInfo?'
8606 y*) hostcat='nidump hosts .';;
8607 *) case "$hostcat" in
8608 nidump*) hostcat='';;
8618 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8626 rp='Are you getting the hosts file via yellow pages?'
8629 y*) hostcat='ypcat hosts';;
8630 *) hostcat='cat /etc/hosts';;
8636 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8639 '') test -f /etc/group && groupcat='cat /etc/group';;
8642 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8645 : now get the host name
8647 echo "Figuring out host name..." >&4
8648 case "$myhostname" in
8650 echo 'Maybe "hostname" will work...'
8651 if tans=`sh -c hostname 2>&1` ; then
8659 if $test "$cont"; then
8661 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8662 if tans=`cat /etc/systemid 2>&1` ; then
8664 phostname='cat /etc/systemid'
8665 echo "Whadyaknow. Xenix always was a bit strange..."
8668 elif $test -r /etc/systemid; then
8669 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8672 if $test "$cont"; then
8673 echo 'No, maybe "uuname -l" will work...'
8674 if tans=`sh -c 'uuname -l' 2>&1` ; then
8676 phostname='uuname -l'
8678 echo 'Strange. Maybe "uname -n" will work...'
8679 if tans=`sh -c 'uname -n' 2>&1` ; then
8681 phostname='uname -n'
8683 echo 'Oh well, maybe I can mine it out of whoami.h...'
8684 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8685 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8686 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8688 case "$myhostname" in
8689 '') echo "Does this machine have an identity crisis or something?"
8692 echo "Well, you said $myhostname before..."
8693 phostname='echo $myhostname';;
8699 case "$myhostname" in
8700 '') myhostname=noname ;;
8702 : you do not want to know about this
8707 if $test "$myhostname" ; then
8709 rp='Your host name appears to be "'$myhostname'".'" Right?"
8717 : bad guess or no guess
8718 while $test "X$myhostname" = X ; do
8720 rp="Please type the (one word) name of your host:"
8725 : translate upper to lower if necessary
8726 case "$myhostname" in
8728 echo "(Normalizing case in your host name)"
8729 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8733 case "$myhostname" in
8735 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8736 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8737 echo "(Trimming domain name from host name--host name is now $myhostname)"
8739 *) case "$mydomain" in
8742 test "X$hostcat" = "Xypcat hosts" &&
8743 ypmatch "$myhostname" hosts 2>/dev/null |\
8744 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8747 test "X$hostcat" != "X" &&
8748 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8749 /[ ]$myhostname[ . ]/p" > hosts
8752 if $test -f hosts; then
8753 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8754 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8755 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8756 hosts | $sort | $uniq | \
8757 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8758 case `$echo X$dflt` in
8759 X*\ *) echo "(Several hosts in the database matched hostname)"
8762 X.) echo "(You do not have fully-qualified names in the hosts database)"
8766 echo "(I cannot locate a hosts database anywhere)"
8771 tans=`./loc resolv.conf X /etc /usr/etc`
8772 if $test -f "$tans"; then
8773 echo "(Attempting domain name extraction from $tans)"
8774 dflt=.`$sed -n -e 's/ / /g' \
8775 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8778 .) dflt=.`$sed -n -e 's/ / /g' \
8779 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8787 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8788 dflt=.`sh -c domainname 2>/dev/null`
8791 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8795 case "$dflt$osname" in
8796 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8797 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8801 .) echo "(Lost all hope -- silly guess then)"
8807 *) dflt="$mydomain";;
8811 rp="What is your domain name?"
8821 : translate upper to lower if necessary
8824 echo "(Normalizing case in your domain name)"
8825 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8829 : a little sanity check here
8830 case "$phostname" in
8833 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8834 $myhostname$mydomain|$myhostname) ;;
8836 case "$phostname" in
8838 echo "(That doesn't agree with your whoami.h file, by the way.)"
8841 echo "(That doesn't agree with your $phostname command, by the way.)"
8849 : determine the e-mail address of the user who is running us
8852 I need to get your e-mail address in Internet format if possible, i.e.
8853 something like user@host.domain. Please answer accurately since I have
8854 no easy means to double check it. The default value provided below
8855 is most probably close to reality but may not be valid from outside
8856 your organization...
8860 while test "$cont"; do
8862 '') dflt="$cf_by@$myhostname$mydomain";;
8863 *) dflt="$cf_email";;
8865 rp='What is your e-mail address?'
8871 rp='Address does not look like an Internet one. Use it anyway?'
8885 : Ask e-mail of administrator
8888 If you or somebody else will be maintaining perl at your site, please
8889 fill in the correct e-mail address here so that they may be contacted
8890 if necessary. Currently, the "perlbug" program included with perl
8891 will send mail to this address in addition to perlbug@perl.org. You may
8892 enter "none" for no administrator.
8895 case "$perladmin" in
8896 '') dflt="$cf_email";;
8897 *) dflt="$perladmin";;
8899 rp='Perl administrator e-mail address'
8903 : determine whether to only install version-specific parts.
8906 Do you want to install only the version-specific parts of the perl
8907 distribution? Usually you do *not* want to do this.
8909 case "$versiononly" in
8910 "$define"|[Yy]*|true) dflt='y' ;;
8913 rp="Do you want to install only the version-specific parts of perl?"
8916 [yY]*) val="$define";;
8922 case "$versiononly" in
8923 "$define") inc_version_list=''
8924 inc_version_list_init=0
8928 : figure out how to guarantee perl startup
8929 : XXX Note that this currently takes advantage of the bug that binexp ignores
8930 : the Configure -Dinstallprefix setting, which in turn means that under
8931 : relocatable @INC, initialinstalllocation is what binexp started as.
8932 case "$startperl" in
8934 case "$sharpbang" in
8938 I can use the #! construct to start perl on your system. This will
8939 make startup of perl scripts faster, but may cause problems if you
8940 want to share those scripts and perl is not in a standard place
8941 ($initialinstalllocation/perl) on all your platforms. The alternative
8942 is to force a shell by starting the script with a single ':' character.
8945 case "$versiononly" in
8946 "$define") dflt="$initialinstalllocation/perl$version";;
8947 *) dflt="$initialinstalllocation/perl";;
8949 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8952 none) startperl=": # use perl";;
8953 *) startperl="#!$ans"
8954 if $test 30 -lt `echo "$ans" | wc -c`; then
8957 WARNING: Some systems limit the #! command to 32 characters.
8958 If you experience difficulty running Perl scripts with #!, try
8959 installing Perl in a directory with a shorter pathname.
8965 *) startperl=": # use perl"
8970 echo "I'll use $startperl to start perl scripts."
8972 : figure best path for perl in scripts
8975 case "$versiononly" in
8976 "$define") perlpath="$initialinstalllocation/perl$version";;
8977 *) perlpath="$initialinstalllocation/perl";;
8979 case "$startperl" in
8984 I will use the "eval 'exec'" idiom to start Perl on your system.
8985 I can use the full path of your Perl binary for this purpose, but
8986 doing so may cause problems if you want to share those scripts and
8987 Perl is not always in a standard place ($initialinstalllocation/perl).
8990 dflt="$initialinstalllocation/perl"
8991 rp="What path shall I use in \"eval 'exec'\"?"
8998 case "$startperl" in
9000 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9003 : determine where public executable scripts go
9004 set scriptdir scriptdir
9006 case "$scriptdir" in
9009 : guess some guesses
9010 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9011 $test -d /usr/share/bin && dflt=/usr/share/bin
9012 $test -d /usr/local/script && dflt=/usr/local/script
9013 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9014 $test -d $prefixexp/script && dflt=$prefixexp/script
9018 *) dflt="$scriptdir"
9023 Some installations have a separate directory just for executable scripts so
9024 that they can mount it across multiple architectures but keep the scripts in
9025 one spot. You might, for example, have a subdirectory of /usr/share for this.
9026 Or you might just lump your scripts in with all your other executables.
9030 rp='Where do you keep publicly executable scripts?'
9032 if $test "X$ansexp" != "X$scriptdirexp"; then
9038 : A little fix up for an irregularly named variable.
9039 installscript="$installscriptdir"
9041 : determine where add-on public executables go
9043 '') dflt=$siteprefix/bin ;;
9047 rp='Pathname where the add-on public executables should be installed?'
9052 : determine where add-on html pages go
9053 : There is no standard location, so try to copy the previously-selected
9054 : directory structure for the core html pages.
9055 case "$sitehtml1dir" in
9056 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9057 *) dflt=$sitehtml1dir ;;
9060 ''|' ') dflt=none ;;
9063 rp='Pathname where the site-specific html pages should be installed?'
9065 prefixvar=sitehtml1dir
9068 : determine where add-on library html pages go
9069 : There is no standard location, so try to copy the previously-selected
9070 : directory structure for the core html pages.
9071 case "$sitehtml3dir" in
9072 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9073 *) dflt=$sitehtml3dir ;;
9076 ''|' ') dflt=none ;;
9079 rp='Pathname where the site-specific library html pages should be installed?'
9081 prefixvar=sitehtml3dir
9084 : determine where add-on manual pages go
9085 case "$siteman1dir" in
9086 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9087 *) dflt=$siteman1dir ;;
9090 ''|' ') dflt=none ;;
9093 rp='Pathname where the site-specific manual pages should be installed?'
9095 prefixvar=siteman1dir
9098 : determine where add-on library man pages go
9099 case "$siteman3dir" in
9100 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9101 *) dflt=$siteman3dir ;;
9104 ''|' ') dflt=none ;;
9107 rp='Pathname where the site-specific library manual pages should be installed?'
9109 prefixvar=siteman3dir
9112 : determine where add-on public executable scripts go
9113 case "$sitescript" in
9114 '') dflt=$siteprefix/script
9115 $test -d $dflt || dflt=$sitebin ;;
9116 *) dflt="$sitescript" ;;
9119 rp='Pathname where add-on public executable scripts should be installed?'
9121 prefixvar=sitescript
9124 : Check if faststdio is requested and available
9125 case "$usefaststdio" in
9126 $define|true|[yY]*|'')
9127 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9137 Perl can be built to use 'fast stdio', which means using the stdio
9138 library but also directly manipulating the stdio buffers to enable
9139 faster I/O. Using stdio is better for backward compatibility (especially
9140 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9141 interface has been preferred instead of stdio.
9143 If this doesn't make any sense to you, just accept the default '$dflt'.
9145 rp='Use the "fast stdio" if available?'
9148 y|Y) val="$define" ;;
9155 : define an is-a-typedef? function
9156 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9158 "") inclist="sys/types.h";;
9160 eval "varval=\$$var";
9164 for inc in $inclist; do
9165 echo "#include <$inc>" >>temp.c;
9167 echo "#ifdef $type" >> temp.c;
9168 echo "printf(\"We have $type\");" >> temp.c;
9169 echo "#endif" >> temp.c;
9170 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9171 if $contains $type temp.E >/dev/null 2>&1; then
9177 *) eval "$var=\$varval";;
9180 : define an is-a-typedef? function that prompts if the type is not available.
9181 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9183 "") inclist="sys/types.h";;
9185 eval "varval=\$$var";
9189 for inc in $inclist; do
9190 echo "#include <$inc>" >>temp.c;
9192 echo "#ifdef $type" >> temp.c;
9193 echo "printf(\"We have $type\");" >> temp.c;
9194 echo "#endif" >> temp.c;
9195 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9197 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9198 if $contains $type temp.E >/dev/null 2>&1; then
9199 echo "$type found." >&4;
9202 echo "$type NOT found." >&4;
9208 *) eval "$var=\$varval";;
9211 : see what type lseek is declared as in the kernel
9212 rp="What is the type used for lseek's offset on this system?"
9213 set off_t lseektype long stdio.h sys/types.h
9217 echo "Checking to see how big your file offsets are..." >&4
9219 #include <sys/types.h>
9223 printf("%d\n", (int)sizeof($lseektype));
9228 if eval $compile_ok; then
9229 lseeksize=`$run ./try`
9230 echo "Your file offsets are $lseeksize bytes long."
9234 echo "(I can't seem to compile the test program. Guessing...)"
9235 rp="What is the size of your file offsets (in bytes)?"
9241 : see what type file positions are declared as in the library
9242 rp="What is the type for file position used by fsetpos()?"
9243 set fpos_t fpostype long stdio.h sys/types.h
9246 : Check size for Fpos_t
9249 *_t) zzz="$fpostype" ;;
9252 echo "Checking the size of $zzz..." >&4
9254 #include <sys/types.h>
9261 printf("%d\n", (int)sizeof($fpostype));
9266 if eval $compile_ok; then
9270 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9273 echo "Your $zzz is $fpossize bytes long."
9279 echo "(I can't compile the test program. Guessing...)" >&4
9280 rp="What is the size of your file positions (in bytes)?"
9285 : Check for large file support
9286 # Backward compatibility (uselfs is deprecated).
9288 "$define"|true|[yY]*)
9291 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9293 uselargefiles="$define"
9297 case "$lseeksize:$fpossize" in
9300 You can have files larger than 2 gigabytes.
9303 *) case "$uselargefiles" in
9304 "$undef"|false|[nN]*) dflt='n' ;;
9309 Perl can be built to understand large files (files larger than 2 gigabytes)
9310 on some systems. To do so, Configure can be run with -Duselargefiles.
9312 If this doesn't make any sense to you, just accept the default '$dflt'.
9314 rp='Try to understand large files, if available?'
9317 y|Y) val="$define" ;;
9324 : Look for a hint-file generated 'call-back-unit'. If the
9325 : user has specified that a large files perl is to be built,
9326 : we may need to set or change some other defaults.
9327 if $test -f uselargefiles.cbu; then
9328 echo "Your platform has some specific hints regarding large file builds, using them..."
9329 . ./uselargefiles.cbu
9331 case "$uselargefiles" in
9333 if $test -f uselargefiles.cbu; then
9335 echo "Rechecking to see how big your file offsets are..." >&4
9337 #include <sys/types.h>
9341 printf("%d\n", (int)sizeof($lseektype));
9346 if eval $compile_ok; then
9347 lseeksize=`$run ./try`
9348 $echo "Your file offsets are now $lseeksize bytes long."
9352 echo "(I can't seem to compile the test program. Guessing...)"
9353 rp="What is the size of your file offsets (in bytes)?"
9358 *_t) zzz="$fpostype" ;;
9361 $echo $n "Rechecking the size of $zzz...$c" >&4
9363 #include <sys/types.h>
9370 printf("%d\n", (int)sizeof($fpostype));
9375 if eval $compile_ok; then
9380 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9383 echo " $fpossize bytes." >&4
9389 echo "(I can't compile the test program. Guessing...)" >&4
9390 rp="What is the size of your file positions (in bytes)?"
9399 : Set the vendorbin variables
9400 case "$vendorprefix" in
9401 '') d_vendorbin="$undef"
9405 *) d_vendorbin="$define"
9406 : determine where vendor-supplied executables go.
9407 case "$vendorbin" in
9408 '') dflt=$vendorprefix/bin ;;
9409 *) dflt="$vendorbin" ;;
9412 rp='Pathname for the vendor-supplied executables directory?'
9415 vendorbinexp="$ansexp"
9421 : Set the vendorhtml1dir variables
9422 case "$vendorprefix" in
9423 '') vendorhtml1dir=''
9424 vendorhtml1direxp=''
9426 *) : determine where vendor-supplied html pages go.
9427 : There is no standard location, so try to copy the previously-selected
9428 : directory structure for the core html pages.
9429 : XXX Better default suggestions would be welcome.
9430 case "$vendorhtml1dir" in
9431 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9432 *) dflt=$vendorhtml1dir ;;
9435 ''|' ') dflt=none ;;
9438 rp='Pathname for the vendor-supplied html pages?'
9440 vendorhtml1dir="$ans"
9441 vendorhtml1direxp="$ansexp"
9444 : Use ' ' for none so value is preserved next time through Configure
9445 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9446 prefixvar=vendorhtml1dir
9449 : Set the vendorhtml3dir variables
9450 case "$vendorprefix" in
9451 '') vendorhtml3dir=''
9452 vendorhtml3direxp=''
9454 *) : determine where vendor-supplied module html pages go.
9455 : There is no standard location, so try to copy the previously-selected
9456 : directory structure for the core html pages.
9457 : XXX Better default suggestions would be welcome.
9458 case "$vendorhtml3dir" in
9459 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9460 *) dflt=$vendorhtml3dir ;;
9463 ''|' ') dflt=none ;;
9466 rp='Pathname for the vendor-supplied html pages?'
9468 vendorhtml3dir="$ans"
9469 vendorhtml3direxp="$ansexp"
9472 : Use ' ' for none so value is preserved next time through Configure
9473 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9474 prefixvar=vendorhtml3dir
9477 : Set the vendorman1dir variables
9478 case "$vendorprefix" in
9479 '') vendorman1dir=''
9482 *) : determine where vendor-supplied manual pages go.
9483 case "$vendorman1dir" in
9484 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9485 *) dflt=$vendorman1dir ;;
9488 ''|' ') dflt=none ;;
9491 rp='Pathname for the vendor-supplied manual section 1 pages?'
9493 vendorman1dir="$ans"
9494 vendorman1direxp="$ansexp"
9497 : Use ' ' for none so value is preserved next time through Configure
9498 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9499 prefixvar=vendorman1dir
9502 : Set the vendorman3dir variables
9503 case "$vendorprefix" in
9504 '') vendorman3dir=''
9507 *) : determine where vendor-supplied module manual pages go.
9508 case "$vendorman3dir" in
9509 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9510 *) dflt=$vendorman3dir ;;
9513 ''|' ') dflt=none ;;
9516 rp='Pathname for the vendor-supplied manual section 3 pages?'
9518 vendorman3dir="$ans"
9519 vendorman3direxp="$ansexp"
9522 : Use ' ' for none so value is preserved next time through Configure
9523 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9524 prefixvar=vendorman3dir
9527 : Set the vendorscript variables
9528 case "$vendorprefix" in
9529 '') d_vendorscript="$undef"
9533 *) d_vendorscript="$define"
9534 : determine where vendor-supplied scripts go.
9535 case "$vendorscript" in
9536 '') dflt=$vendorprefix/script
9537 $test -d $dflt || dflt=$vendorbin ;;
9538 *) dflt="$vendorscript" ;;
9542 The installation process will create a directory for
9543 vendor-supplied scripts.
9547 rp='Pathname for the vendor-supplied scripts directory?'
9550 vendorscriptexp="$ansexp"
9553 prefixvar=vendorscript
9556 : script used to emit important warnings
9559 if test \$# -gt 0; then
9564 echo "*** WARNING:" >&4
9565 sed -e 's/^/*** /' <msg >&4
9567 cat msg >>config.msg
9568 echo " " >>config.msg
9574 : see which of string.h or strings.h is needed
9576 strings=`./findhdr string.h`
9577 if $test "$strings" && $test -r "$strings"; then
9578 echo "Using <string.h> instead of <strings.h>." >&4
9582 strings=`./findhdr strings.h`
9583 if $test "$strings" && $test -r "$strings"; then
9584 echo "Using <strings.h> instead of <string.h>." >&4
9586 ./warn "No string header found -- You'll surely have problems."
9592 "$undef") strings=`./findhdr strings.h`;;
9593 *) strings=`./findhdr string.h`;;
9596 : see if qgcvt exists
9600 : Check print/scan long double stuff
9603 if $test X"$d_longdbl" = X"$define"; then
9605 echo "Checking how to print long doubles..." >&4
9607 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9608 $cat >try.c <<'EOCP'
9609 #include <sys/types.h>
9613 printf("%.3f\n", d);
9617 if eval $compile; then
9621 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9622 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9623 echo "We will use %f."
9629 if $test X"$sPRIfldbl" = X; then
9630 $cat >try.c <<'EOCP'
9631 #include <sys/types.h>
9634 long double d = 123.456;
9635 printf("%.3Lf\n", d);
9639 if eval $compile; then
9643 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9644 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9645 echo "We will use %Lf."
9651 if $test X"$sPRIfldbl" = X; then
9652 $cat >try.c <<'EOCP'
9653 #include <sys/types.h>
9656 long double d = 123.456;
9657 printf("%.3llf\n", d);
9661 if eval $compile; then
9665 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9666 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9667 echo "We will use %llf."
9673 if $test X"$sPRIfldbl" = X; then
9674 $cat >try.c <<'EOCP'
9675 #include <sys/types.h>
9678 long double d = 123.456;
9679 printf("%.3lf\n", d);
9683 if eval $compile; then
9687 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9688 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9689 echo "We will use %lf."
9695 if $test X"$sPRIfldbl" = X; then
9696 echo "Cannot figure out how to print long doubles." >&4
9698 sSCNfldbl=$sPRIfldbl # expect consistency
9705 case "$sPRIfldbl" in
9706 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9707 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9708 d_SCNfldbl="$undef";
9710 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9711 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9712 d_SCNfldbl="$define";
9716 : Check how to convert floats to strings.
9718 if test "X$d_Gconvert" = X; then
9721 echo "Checking for an efficient way to convert floats to strings."
9723 case "$uselongdouble" in
9724 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9726 case "$d_longdbl" in
9727 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9729 case "$d_PRIgldbl" in
9730 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9734 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9735 char *myname = "gconvert";
9738 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9739 char *myname = "gcvt";
9742 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9743 char *myname = "qgcvt";
9744 #define DOUBLETYPE long double
9747 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9749 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9751 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9754 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9756 char *myname = "sprintf";
9760 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9761 #define DOUBLETYPE long double
9763 #define DOUBLETYPE double
9775 # include <string.h>
9777 # include <strings.h>
9780 int checkit(char *expect, char *got)
9782 if (strcmp(expect, got)) {
9783 printf("%s oddity: Expected %s, got %s\n",
9784 myname, expect, got);
9794 /* This must be 1st test on (which?) platform */
9795 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9796 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9797 checkit("0.1", buf);
9799 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9800 checkit("0.01", buf);
9802 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9803 checkit("0.001", buf);
9805 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9806 checkit("0.0001", buf);
9808 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9809 if (strlen(buf) > 5)
9810 checkit("9e-005", buf); /* for Microsoft ?? */
9812 checkit("9e-05", buf);
9814 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9817 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9818 checkit("1.1", buf);
9820 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9821 checkit("1.01", buf);
9823 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9824 checkit("1.001", buf);
9826 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9827 checkit("1.0001", buf);
9829 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9830 checkit("1.00001", buf);
9832 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9833 checkit("1.000001", buf);
9835 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9838 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9841 /* Some Linux gcvt's give 1.e+5 here. */
9842 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9843 checkit("100000", buf);
9845 /* Some Linux gcvt's give -1.e+5 here. */
9846 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9847 checkit("-100000", buf);
9849 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9850 checkit("123.456", buf);
9852 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9853 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9854 /* 34 should be enough to scare even long double
9855 * places into using the e notation. */
9856 if (strlen(buf) > 5)
9857 checkit("1e+034", buf); /* for Microsoft */
9859 checkit("1e+34", buf);
9861 /* For Perl, if you add additional tests here, also add them to
9862 * t/base/num.t for benefit of platforms not using Configure or
9863 * overriding d_Gconvert */
9868 : first add preferred functions to our list
9870 for xxx_convert in $gconvert_preference; do
9871 case $xxx_convert in
9872 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9873 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9876 : then add any others
9877 for xxx_convert in gconvert gcvt sprintf; do
9880 *) xxx_list="$xxx_list $xxx_convert" ;;
9884 case "$d_longdbl$uselongdouble" in
9886 : again, add prefered functions to our list first
9888 for xxx_convert in $gconvert_ld_preference; do
9889 case $xxx_convert in
9890 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9891 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9894 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9895 for xxx_convert in qgcvt sprintf $xxx_list; do
9896 case "$xxx_ld_list" in
9897 $xxx_convert*|*" $xxx_convert"*) ;;
9898 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9901 : if sprintf cannot do long doubles, move it to the end
9902 if test "$d_PRIgldbl" != "$define"; then
9903 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9905 : if no qgcvt, remove it
9906 if test "$d_qgcvt" != "$define"; then
9907 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9910 xxx_list="$xxx_ld_list"
9914 for xxx_convert in $xxx_list; do
9915 echo "Trying $xxx_convert..."
9916 $rm -f try try$_o core
9917 set try -DTRY_$xxx_convert
9918 if eval $compile; then
9919 echo "$xxx_convert() found." >&4
9921 echo "I'll use $xxx_convert to convert floats into a string." >&4
9924 echo "...But $xxx_convert didn't work as I expected."
9928 echo "$xxx_convert NOT found." >&4
9932 if test X$xxx_convert = X; then
9933 echo "*** WHOA THERE!!! ***" >&4
9934 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9938 case "$xxx_convert" in
9939 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9940 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9941 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9942 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9943 "$define$define$define")
9944 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9945 "$define$define$undef")
9946 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9947 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9955 : see if _fwalk exists
9959 : Initialize h_fcntl
9962 : Initialize h_sysfile
9965 : access call always available on UNIX
9969 : locate the flags for 'access()'
9973 $cat >access.c <<EOCP
9974 #include <sys/types.h>
9979 #include <sys/file.h>
9992 : check sys/file.h first, no particular reason here
9993 if $test `./findhdr sys/file.h` && \
9994 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9996 echo "<sys/file.h> defines the *_OK access constants." >&4
9997 elif $test `./findhdr fcntl.h` && \
9998 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10000 echo "<fcntl.h> defines the *_OK access constants." >&4
10001 elif $test `./findhdr unistd.h` && \
10002 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10003 echo "<unistd.h> defines the *_OK access constants." >&4
10005 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10011 : see if accessx exists
10012 set accessx d_accessx
10015 : see if aintl exists
10019 : see if alarm exists
10023 : see if 64bit time functions exists
10025 set ctime64 d_ctime64
10028 set localtime64 d_localtime64
10031 set gmtime64 d_gmtime64
10034 set mktime64 d_mktime64
10037 set difftime64 d_difftime64
10040 set asctime64 d_asctime64
10043 : see if POSIX threads are available
10044 set pthread.h i_pthread
10047 : define a fucntion to check prototypes
10048 $cat > protochk <<EOSH
10051 optimize="$optimize"
10053 prototype="$prototype"
10056 usethreads=$usethreads
10057 i_pthread=$i_pthread
10058 pthread_h_first=$pthread_h_first
10061 $cat >> protochk <<'EOSH'
10066 while test $# -ge 2; do
10068 $define) echo "#include <$2>" >> try.c ;;
10069 literal) echo "$2" >> try.c ;;
10071 # Extra magic for the benefit of systems that need pthread.h
10072 # to be included early to correctly detect threadsafe functions.
10073 # Such functions must guarantee themselves, though, that the usethreads
10074 # and i_pthread have been defined, before calling protochk.
10075 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10076 echo "#include <pthread.h>" >> try.c
10081 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10082 cat >> try.c <<'EOCP'
10083 #ifdef CAN_PROTOTYPE
10084 #define _(args) args
10089 echo "$foo" >> try.c
10090 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10091 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10097 $eunicefix protochk
10099 : Define hasproto macro for Configure internal use
10100 hasproto='varname=$1; func=$2; shift; shift;
10101 while $test $# -ge 2; do
10103 $define) echo "#include <$2>";;
10107 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10108 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10109 echo "$func() prototype found.";
10112 echo "$func() prototype NOT found.";
10119 : see if sys/types.h has to be included
10120 set sys/types.h i_systypes
10123 : see if sys/select.h has to be included
10124 set sys/select.h i_sysselct
10127 : Define hasfield macro for Configure internal use
10128 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10129 while $test $# -ge 2; do
10131 $define) echo "#include <$2>";;
10135 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10137 if eval $compile; then
10146 : see if we should include time.h, sys/time.h, or both
10148 if test "X$timeincl" = X; then
10149 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10150 $echo $n "I'm now running the test program...$c"
10152 #include <sys/types.h>
10157 #ifdef SYSTIMEKERNEL
10160 #include <sys/time.h>
10163 #include <sys/select.h>
10165 #$i_stdlib I_STDLIB
10167 #include <stdlib.h>
10173 struct timeval bar;
10176 struct timezone tzp;
10178 if (foo.tm_sec == foo.tm_sec)
10181 if (bar.tv_sec == bar.tv_sec)
10188 for s_timezone in '-DS_TIMEZONE' ''; do
10190 for s_timeval in '-DS_TIMEVAL' ''; do
10191 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10192 for i_time in '' '-DI_TIME'; do
10193 for i_systime in '-DI_SYSTIME' ''; do
10196 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10197 if eval $compile; then
10198 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10202 $echo $n "Succeeded with $flags$c"
10214 *SYSTIMEKERNEL*) i_systimek="$define"
10215 timeincl=`./findhdr sys/time.h`
10216 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10217 *) i_systimek="$undef";;
10220 *I_TIME*) i_time="$define"
10221 timeincl=`./findhdr time.h`" $timeincl"
10222 echo "We'll include <time.h>." >&4;;
10223 *) i_time="$undef";;
10226 *I_SYSTIME*) i_systime="$define"
10227 timeincl=`./findhdr sys/time.h`" $timeincl"
10228 echo "We'll include <sys/time.h>." >&4;;
10229 *) i_systime="$undef";;
10233 : see if struct tm knows about tm_zone
10234 case "$i_systime$i_time" in
10237 echo "Checking to see if your struct tm has tm_zone field..." >&4
10238 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10246 case "$d_tm_tm_zone" in
10247 "$define") echo "Yes, it does." ;;
10248 *) echo "No, it doesn't." ;;
10250 : see if struct tm knows about tm_gmtoff
10251 case "$i_systime$i_time" in
10254 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10255 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10263 case "$d_tm_tm_gmtoff" in
10264 "$define") echo "Yes, it does." ;;
10265 *) echo "No, it doesn't." ;;
10268 : see if asctime_r exists
10269 set asctime_r d_asctime_r
10271 case "$d_asctime_r" in
10273 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10274 case "$d_asctime_r_proto:$usethreads" in
10275 ":define") d_asctime_r_proto=define
10276 set d_asctime_r_proto asctime_r $hdrs
10280 case "$d_asctime_r_proto" in
10282 case "$asctime_r_proto" in
10283 ''|0) try='char* asctime_r(const struct tm*, char*);'
10284 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10286 case "$asctime_r_proto" in
10287 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10288 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10290 case "$asctime_r_proto" in
10291 ''|0) try='int asctime_r(const struct tm*, char*);'
10292 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10294 case "$asctime_r_proto" in
10295 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10296 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10298 case "$asctime_r_proto" in
10299 ''|0) d_asctime_r=undef
10301 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10302 * ) case "$asctime_r_proto" in
10303 REENTRANT_PROTO*) ;;
10304 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10306 echo "Prototype: $try" ;;
10309 *) case "$usethreads" in
10310 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10317 *) asctime_r_proto=0
10321 : see if atolf exists
10325 : see if atoll exists
10329 : Look for GCC-style attribute format
10330 case "$d_attribute_format" in
10333 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10334 $cat >attrib.c <<'EOCP'
10336 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10338 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10339 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10340 echo "Your C compiler doesn't support __attribute__((format))."
10343 echo "Your C compiler supports __attribute__((format))."
10347 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10351 *) val="$d_attribute_format" ;;
10353 set d_attribute_format
10357 : Look for GCC-style attribute format with null format allowed
10358 case "$d_printf_format_null" in
10359 '') case "$d_attribute_format" in
10362 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10363 $cat >attrib.c <<EOCP
10365 #$i_stdlib I_STDLIB
10367 #include <stdlib.h>
10369 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10370 int null_printf (char* pat,...) { return (int)pat; }
10371 int main () { exit(null_printf(NULL)); }
10373 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10374 : run the executable in case it produces a run-time warning
10375 if $run ./attrib >>attrib.out 2>&1; then
10376 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10377 echo "Your C compiler doesn't allow __printf__ format to be null."
10380 echo "Your C compiler allows __printf__ format to be null."
10384 echo "Your C compiler executable failed with __printf__ format null."
10388 echo "Your C compiler fails with __printf__ format null."
10395 *) val="$d_printf_format_null" ;;
10397 set d_printf_format_null
10401 : Look for GCC-style attribute malloc
10402 case "$d_attribute_malloc" in
10405 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10406 $cat >attrib.c <<'EOCP'
10408 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10410 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10411 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10412 echo "Your C compiler doesn't support __attribute__((malloc))."
10415 echo "Your C compiler supports __attribute__((malloc))."
10419 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10423 *) val="$d_attribute_malloc" ;;
10425 set d_attribute_malloc
10429 : Look for GCC-style attribute nonnull
10430 case "$d_attribute_nonnull" in
10433 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10434 $cat >attrib.c <<'EOCP'
10436 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10438 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10439 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10440 echo "Your C compiler doesn't support __attribute__((nonnull))."
10443 echo "Your C compiler supports __attribute__((nonnull))."
10447 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10451 *) val="$d_attribute_nonnull" ;;
10453 set d_attribute_nonnull
10457 : Look for GCC-style attribute noreturn
10458 case "$d_attribute_noreturn" in
10461 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10462 $cat >attrib.c <<'EOCP'
10464 void fall_over_dead( void ) __attribute__((noreturn));
10466 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10467 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10468 echo "Your C compiler doesn't support __attribute__((noreturn))."
10471 echo "Your C compiler supports __attribute__((noreturn))."
10475 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10479 *) val="$d_attribute_noreturn" ;;
10481 set d_attribute_noreturn
10485 : Look for GCC-style attribute pure
10486 case "$d_attribute_pure" in
10489 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10490 $cat >attrib.c <<'EOCP'
10492 int square( int n ) __attribute__((pure));
10494 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10495 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10496 echo "Your C compiler doesn't support __attribute__((pure))."
10499 echo "Your C compiler supports __attribute__((pure))."
10503 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10507 *) val="$d_attribute_pure" ;;
10509 set d_attribute_pure
10513 : Look for GCC-style attribute unused
10514 case "$d_attribute_unused" in
10517 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10518 $cat >attrib.c <<'EOCP'
10520 int do_something( int dummy __attribute__((unused)), int n );
10522 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10523 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10524 echo "Your C compiler doesn't support __attribute__((unused))."
10527 echo "Your C compiler supports __attribute__((unused))."
10531 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10535 *) val="$d_attribute_unused" ;;
10537 set d_attribute_unused
10541 : Look for GCC-style attribute deprecated
10542 case "$d_attribute_deprecated" in
10545 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10546 $cat >attrib.c <<'EOCP'
10548 int I_am_deprecated(void) __attribute__((deprecated));
10550 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10551 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10552 echo "Your C compiler doesn't support __attribute__((deprecated))."
10555 echo "Your C compiler supports __attribute__((deprecated))."
10559 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10563 *) val="$d_attribute_deprecated" ;;
10565 set d_attribute_deprecated
10569 : Look for GCC-style attribute warn_unused_result
10570 case "$d_attribute_warn_unused_result" in
10573 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10574 $cat >attrib.c <<'EOCP'
10576 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10578 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10579 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10580 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10583 echo "Your C compiler supports __attribute__((warn_unused_result))."
10587 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10591 *) val="$d_attribute_warn_unused_result" ;;
10593 set d_attribute_warn_unused_result
10597 : see if bcmp exists
10601 : see if bcopy exists
10605 : see if getpgrp exists
10606 set getpgrp d_getpgrp
10609 case "$d_getpgrp" in
10612 echo "Checking to see which flavor of getpgrp 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 (getpgrp(1) == 0)
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 getpgrp(pid) instead of getpgrp()." >&4
10642 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10643 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10646 echo "I can't seem to compile and run the test program."
10648 xxx="a USG one, i.e. you use getpgrp()."
10650 # SVR4 systems can appear rather BSD-ish.
10651 case "$i_unistd" in
10653 xxx="a BSD one, i.e. you use getpgrp(pid)."
10657 xxx="probably a USG one, i.e. you use getpgrp()."
10662 echo "Assuming your getpgrp is $xxx" >&4
10671 : see if setpgrp exists
10672 set setpgrp d_setpgrp
10675 case "$d_setpgrp" in
10678 echo "Checking to see which flavor of setpgrp is in use..."
10680 #$i_unistd I_UNISTD
10681 #include <sys/types.h>
10683 # include <unistd.h>
10685 #$i_stdlib I_STDLIB
10687 #include <stdlib.h>
10691 if (getuid() == 0) {
10692 printf("(I see you are running Configure as super-user...)\n");
10695 #ifdef TRY_BSD_PGRP
10696 if (-1 == setpgrp(1, 1))
10699 if (setpgrp() != -1)
10705 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10706 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10708 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10709 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10712 echo "(I can't seem to compile and run the test program.)"
10714 xxx="a USG one, i.e. you use setpgrp()."
10716 # SVR4 systems can appear rather BSD-ish.
10717 case "$i_unistd" in
10719 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10723 xxx="probably a USG one, i.e. you use setpgrp()."
10728 echo "Assuming your setpgrp is $xxx" >&4
10737 : Look for GCC-style __builtin_choose_expr
10738 case "$d_builtin_choose_expr" in
10741 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10742 $cat >try.c <<'EOCP'
10743 #include <assert.h>
10744 #include <stdlib.h>
10747 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10750 assert( SYRINX(1) == 2112 );
10751 assert( SYRINX(1) != 5150 );
10752 assert( SYRINX(0) == 5150 );
10753 assert( SYRINX(0) != 2112 );
10754 puts( "All good!" );
10760 if eval $compile && $run ./try; then
10761 echo "Your C compiler supports __builtin_choose_expr."
10764 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10768 *) val="$d_builtin_choose_expr" ;;
10771 set d_builtin_choose_expr
10775 : Look for GCC-style __builtin_expect
10776 case "$d_builtin_expect" in
10779 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10780 $cat >try.c <<'EOCP'
10783 if ( __builtin_expect(n, 0) ) n = 1;
10784 /* Remember shell exit code truth is 0, C truth is non-zero */
10789 if eval $compile && $run ./try; then
10790 echo "Your C compiler supports __builtin_expect."
10793 echo "Your C compiler doesn't seem to understand __builtin_expect."
10797 *) val="$d_builtin_expect" ;;
10800 set d_builtin_expect
10804 : see if bzero exists
10808 : see if stdarg is available
10810 if $test `./findhdr stdarg.h`; then
10811 echo "<stdarg.h> found." >&4
10814 echo "<stdarg.h> NOT found." >&4
10818 : see if varags is available
10820 if $test `./findhdr varargs.h`; then
10821 echo "<varargs.h> found." >&4
10823 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10826 : set up the varargs testing programs
10827 $cat > varargs.c <<EOP
10829 #include <stdarg.h>
10832 #include <varargs.h>
10836 int f(char *p, ...)
10850 p = va_arg(ap, char *);
10856 $cat > varargs <<EOP
10858 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10867 : now check which varargs header should be included
10872 if `./varargs I_STDARG`; then
10874 elif `./varargs I_VARARGS`; then
10879 if `./varargs I_VARARGS`; then
10886 echo "I could not find the definition for va_dcl... You have problems..." >&4
10887 val="$undef"; set i_stdarg; eval $setvar
10888 val="$undef"; set i_varargs; eval $setvar
10893 case "$i_varhdr" in
10895 val="$define"; set i_stdarg; eval $setvar
10896 val="$undef"; set i_varargs; eval $setvar
10899 val="$undef"; set i_stdarg; eval $setvar
10900 val="$define"; set i_varargs; eval $setvar
10903 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10907 : see if the Compiler supports C99 variadic macros
10908 case "$i_stdarg$i_stdlib" in
10910 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10913 #include <stdarg.h>
10915 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10919 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10925 if eval $compile && $run ./try 2>&1 >/dev/null; then
10926 case "`$run ./try`" in
10928 echo "You have C99 variadic macros." >&4
10929 d_c99_variadic_macros="$define"
10932 echo "You don't have functional C99 variadic macros." >&4
10933 d_c99_variadic_macros="$undef"
10937 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10938 d_c99_variadic_macros="$undef"
10943 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10944 d_c99_variadic_macros="$undef"
10948 : see if signal is declared as pointer to function returning int or void
10950 xxx=`./findhdr signal.h`
10951 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10952 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10953 echo "You have int (*signal())() instead of void." >&4
10955 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10956 echo "You have void (*signal())()." >&4
10958 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10959 echo "You have int (*signal())() instead of void." >&4
10961 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10962 echo "You have void (*signal())()." >&4
10965 case "$d_voidsig" in
10967 echo "I can't determine whether signal handler returns void or int..." >&4
10969 rp="What type does your signal handler return?"
10972 v*) val="$define";;
10976 echo "As you already told me, signal handler returns void." >&4
10979 *) echo "As you already told me, signal handler returns int." >&4
10986 case "$d_voidsig" in
10987 "$define") signal_t="void";;
10988 *) signal_t="int";;
10992 : check for ability to cast large floats to 32-bit ints.
10994 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10995 if $test "$intsize" -ge 4; then
11002 #$i_stdlib I_STDLIB
11004 #include <stdlib.h>
11006 #include <sys/types.h>
11007 #include <signal.h>
11008 $signal_t blech(int s) { exit(3); }
11015 signal(SIGFPE, blech);
11017 /* Don't let compiler optimize the test away. Store the number
11018 in a writable string for gcc to pass to sscanf under HP-UX.
11020 sprintf(str, "2147483647");
11021 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11025 /* x86 processors will probably give 0x8000 0000, which is a
11026 sign change. We don't want that. We want to mimic SPARC
11027 behavior here, which is to preserve the sign and give
11030 if (i32 != ($xxx) f)
11036 if eval $compile_ok; then
11040 echo "(I can't seem to compile the test program--assuming it can't)"
11045 echo "Yup, it can."
11048 echo "Nope, it can't."
11055 : check for ability to cast negative floats to unsigned
11057 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11060 #$i_stdlib I_STDLIB
11062 #include <stdlib.h>
11064 #include <sys/types.h>
11065 #include <signal.h>
11066 $signal_t blech(int s) { exit(7); }
11067 $signal_t blech_in_list(int s) { exit(4); }
11068 unsigned long dummy_long(unsigned long p) { return p; }
11069 unsigned int dummy_int(unsigned int p) { return p; }
11070 unsigned short dummy_short(unsigned short p) { return p; }
11074 unsigned long along;
11076 unsigned short ashort;
11080 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11081 a direct f = -123. assignment. gcc-2.8.0 reportedly
11082 optimized the whole file away
11084 /* Store the number in a writable string for gcc to pass to
11085 sscanf under HP-UX.
11087 sprintf(str, "-123");
11088 sscanf(str, "%lf", &f); /* f = -123.; */
11090 signal(SIGFPE, blech);
11091 along = (unsigned long)f;
11092 aint = (unsigned int)f;
11093 ashort = (unsigned short)f;
11094 if (along != (unsigned long)-123)
11096 if (aint != (unsigned int)-123)
11098 if (ashort != (unsigned short)-123)
11100 sprintf(str, "1073741824.");
11101 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11104 along = (unsigned long)f;
11105 if (along != 0x80000000)
11109 along = (unsigned long)f;
11110 if (along != 0x7fffffff)
11114 along = (unsigned long)f;
11115 if (along != 0x80000001)
11119 signal(SIGFPE, blech_in_list);
11120 sprintf(str, "123.");
11121 sscanf(str, "%lf", &f); /* f = 123.; */
11122 along = dummy_long((unsigned long)f);
11123 aint = dummy_int((unsigned int)f);
11124 ashort = dummy_short((unsigned short)f);
11125 if (along != (unsigned long)123)
11127 if (aint != (unsigned int)123)
11129 if (ashort != (unsigned short)123)
11136 if eval $compile_ok; then
11140 echo "(I can't seem to compile the test program--assuming it can't)"
11143 case "$castflags" in
11145 echo "Yup, it can."
11148 echo "Nope, it can't."
11155 : see if vprintf exists
11157 if set vprintf val -f d_vprintf; eval $csym; $val; then
11158 echo 'vprintf() found.' >&4
11161 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11162 #$i_varargs I_VARARGS
11164 #$i_stdlib I_STDLIB
11165 #$i_unistd I_UNISTD
11168 # include <stdarg.h>
11169 #else /* I_VARARGS */
11170 # include <varargs.h>
11174 # include <unistd.h>
11178 # include <stdlib.h>
11181 #include <stdio.h> /* vsprintf prototype */
11184 void xxx(int n, ...)
11189 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11191 int main() { xxx(1, "foo"); }
11193 #else /* I_VARARGS */
11201 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11203 int main() { xxx("foo"); }
11209 if eval $compile_ok; then
11210 if $run ./try; then
11211 echo "Your vsprintf() returns (int)." >&4
11214 echo "Your vsprintf() returns (char*)." >&4
11218 echo 'I am unable to compile the vsprintf() test program.' >&4
11219 # We shouldn't get here. If we do, assume the standard signature,
11220 # not the old BSD one.
11221 echo 'Guessing that vsprintf() returns (int).' >&4
11225 echo 'vprintf() NOT found.' >&4
11236 : see if chown exists
11240 : see if chroot exists
11241 set chroot d_chroot
11244 : see if chsize exists
11245 set chsize d_chsize
11248 : see if class exists
11252 : see if clearenv exists
11253 set clearenv d_clearenv
11256 : Define hasstruct macro for Configure internal use
11257 hasstruct='varname=$1; struct=$2; shift; shift;
11258 while $test $# -ge 2; do
11260 $define) echo "#include <$2>";;
11264 echo "int main () { struct $struct foo; }" >> try.c;
11266 if eval $compile; then
11275 : see whether socket exists
11279 $echo $n "Hmm... $c" >&4
11280 if set socket val -f d_socket; eval $csym; $val; then
11281 echo "Looks like you have Berkeley networking support." >&4
11283 if set setsockopt val -f; eval $csym; $val; then
11286 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11287 d_oldsock="$define"
11290 if $contains socklib libc.list >/dev/null 2>&1; then
11291 echo "Looks like you have Berkeley networking support." >&4
11293 : we will have to assume that it supports the 4.2 BSD interface
11296 echo "You don't have Berkeley networking in libc$_a..." >&4
11297 if test "X$d_socket" = "X$define"; then
11298 echo "...but you seem to believe that you have sockets." >&4
11300 for net in net socket
11302 if test -f /usr/lib/lib$net$_a; then
11303 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11304 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11305 if $contains socket libc.list >/dev/null 2>&1; then
11310 echo "...but the Wollongong group seems to have hacked it in." >&4
11311 sockethdr="-I/usr/netinclude"
11314 echo "Found Berkeley sockets interface in lib$net." >&4
11315 if $contains setsockopt libc.list >/dev/null 2>&1; then
11318 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11319 d_oldsock="$define"
11325 if test "X$d_socket" != "X$define"; then
11326 echo "or anywhere else I see." >&4
11334 : see if socketpair exists
11335 set socketpair d_sockpair
11340 echo "Checking the availability of certain socket constants..." >&4
11341 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11342 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11344 #include <sys/types.h>
11345 #include <sys/socket.h>
11351 set try; if eval $compile; then
11354 set d_${enum}; eval $setvar
11358 : see if this is a sys/uio.h system
11359 set sys/uio.h i_sysuio
11362 : Check for cmsghdr support
11364 echo "Checking to see if your system supports struct cmsghdr..." >&4
11365 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11367 case "$d_cmsghdr_s" in
11368 "$define") echo "Yes, it does." ;;
11369 *) echo "No, it doesn't." ;;
11373 : check for const keyword
11375 echo 'Checking to see if your C compiler knows about "const"...' >&4
11376 $cat >const.c <<'EOCP'
11377 typedef struct spug { int drokk; } spug;
11381 const spug y = { 0 };
11384 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11386 echo "Yup, it does."
11389 echo "Nope, it doesn't."
11394 : see if copysignl exists
11395 set copysignl d_copysignl
11398 : see if crypt exists
11403 $define) cryptlib='' ;;
11404 *) if set crypt val -f d_crypt; eval $csym; $val; then
11405 echo 'crypt() found.' >&4
11409 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11410 if $test -z "$cryptlib"; then
11411 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11415 if $test -z "$cryptlib"; then
11416 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11420 if $test -z "$cryptlib"; then
11421 cryptlib=`./loc libcrypt$_a "" $libpth`
11425 if $test -z "$cryptlib"; then
11426 echo 'crypt() NOT found.' >&4
11437 : see if this is a crypt.h system
11438 set crypt.h i_crypt
11441 : see if crypt_r exists
11442 set crypt_r d_crypt_r
11444 case "$d_crypt_r" in
11446 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11447 case "$d_crypt_r_proto:$usethreads" in
11448 ":define") d_crypt_r_proto=define
11449 set d_crypt_r_proto crypt_r $hdrs
11453 case "$d_crypt_r_proto" in
11455 case "$crypt_r_proto" in
11456 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11457 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11459 case "$crypt_r_proto" in
11460 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11461 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11463 case "$crypt_r_proto" in
11464 ''|0) d_crypt_r=undef
11466 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11467 * ) case "$crypt_r_proto" in
11468 REENTRANT_PROTO*) ;;
11469 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11471 echo "Prototype: $try" ;;
11474 *) case "$usethreads" in
11475 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11486 : get csh whereabouts
11488 'csh') val="$undef" ;;
11489 *) val="$define" ;;
11493 : Respect a hint or command line value for full_csh.
11494 case "$full_csh" in
11495 '') full_csh=$csh ;;
11498 : see if ctermid exists
11499 set ctermid d_ctermid
11502 : see if ctermid_r exists
11503 set ctermid_r d_ctermid_r
11505 case "$d_ctermid_r" in
11507 hdrs="$i_systypes sys/types.h define stdio.h "
11508 case "$d_ctermid_r_proto:$usethreads" in
11509 ":define") d_ctermid_r_proto=define
11510 set d_ctermid_r_proto ctermid_r $hdrs
11514 case "$d_ctermid_r_proto" in
11516 case "$ctermid_r_proto" in
11517 ''|0) try='char* ctermid_r(char*);'
11518 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11520 case "$ctermid_r_proto" in
11521 ''|0) d_ctermid_r=undef
11523 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11524 * ) case "$ctermid_r_proto" in
11525 REENTRANT_PROTO*) ;;
11526 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11528 echo "Prototype: $try" ;;
11531 *) case "$usethreads" in
11532 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11539 *) ctermid_r_proto=0
11543 : see if ctime_r exists
11544 set ctime_r d_ctime_r
11546 case "$d_ctime_r" in
11548 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11549 case "$d_ctime_r_proto:$usethreads" in
11550 ":define") d_ctime_r_proto=define
11551 set d_ctime_r_proto ctime_r $hdrs
11555 case "$d_ctime_r_proto" in
11557 case "$ctime_r_proto" in
11558 ''|0) try='char* ctime_r(const time_t*, char*);'
11559 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11561 case "$ctime_r_proto" in
11562 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11563 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11565 case "$ctime_r_proto" in
11566 ''|0) try='int ctime_r(const time_t*, char*);'
11567 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11569 case "$ctime_r_proto" in
11570 ''|0) try='int ctime_r(const time_t*, char*, int);'
11571 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11573 case "$ctime_r_proto" in
11574 ''|0) d_ctime_r=undef
11576 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11577 * ) case "$ctime_r_proto" in
11578 REENTRANT_PROTO*) ;;
11579 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11581 echo "Prototype: $try" ;;
11584 *) case "$usethreads" in
11585 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11596 : see if cuserid exists
11597 set cuserid d_cuserid
11600 : see if this is a limits.h system
11601 set limits.h i_limits
11604 : see if this is a float.h system
11605 set float.h i_float
11608 : See if number of significant digits in a double precision number is known
11610 $cat >dbl_dig.c <<EOM
11611 #$i_limits I_LIMITS
11614 #include <limits.h>
11620 printf("Contains DBL_DIG");
11623 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11624 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11625 echo "DBL_DIG found." >&4
11628 echo "DBL_DIG NOT found." >&4
11635 : see if dbm.h is available
11636 : see if dbmclose exists
11637 set dbmclose d_dbmclose
11640 case "$d_dbmclose" in
11650 *) set rpcsvc/dbm.h i_rpcsvcdbm
11655 *) echo "We won't be including <dbm.h>"
11665 : see if prototype for dbminit is available
11667 set d_dbminitproto dbminit $i_dbm dbm.h
11670 : see if difftime exists
11671 set difftime d_difftime
11674 : see if this is a dirent system
11676 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11678 echo "<dirent.h> found." >&4
11681 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11682 echo "<sys/dir.h> found." >&4
11685 xinc=`./findhdr sys/ndir.h`
11687 echo "<dirent.h> NOT found." >&4
11692 : Look for type of directory structure.
11694 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11696 case "$direntrytype" in
11698 case "$i_dirent" in
11699 $define) guess1='struct dirent' ;;
11700 *) guess1='struct direct' ;;
11703 *) guess1="$direntrytype"
11708 'struct dirent') guess2='struct direct' ;;
11709 *) guess2='struct dirent' ;;
11712 if $contains "$guess1" try.c >/dev/null 2>&1; then
11713 direntrytype="$guess1"
11714 echo "Your directory entries are $direntrytype." >&4
11715 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11716 direntrytype="$guess2"
11717 echo "Your directory entries seem to be $direntrytype." >&4
11719 echo "I don't recognize your system's directory entries." >&4
11720 rp="What type is used for directory entries on this system?"
11723 direntrytype="$ans"
11727 : see if the directory entry stores field length
11729 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11730 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11731 echo "Good, your directory entry keeps length information in d_namlen." >&4
11734 echo "Your directory entry does not know about the d_namlen field." >&4
11741 : Look for DIR.dd_fd
11742 case "$i_dirent" in
11744 echo "Checking to see if DIR has a dd_fd member variable" >&4
11746 #$i_stdlib I_STDLIB
11748 #include <stdlib.h>
11750 #include <dirent.h>
11760 if eval $compile; then
11761 echo "Yes, it does."
11764 echo "No, it does not."
11769 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11777 : see if this is an sysdir system
11778 set sys/dir.h i_sysdir
11781 : see if this is an sysndir system
11782 set sys/ndir.h i_sysndir
11787 $cat >dirfd.c <<EOM
11789 #$i_stdlib I_STDLIB
11791 #include <stdlib.h>
11793 #$i_dirent I_DIRENT /**/
11794 #$i_sysdir I_SYS_DIR /**/
11795 #$i_sysndir I_SYS_NDIR /**/
11796 #$i_systypes I_SYS_TYPES /**/
11797 #if defined(I_SYS_TYPES)
11798 #include <sys/types.h>
11800 #if defined(I_DIRENT)
11801 #include <dirent.h>
11802 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11803 #include <sys/dir.h>
11807 #include <sys/ndir.h>
11811 #include <ndir.h> /* may be wrong in the future */
11813 #include <sys/dir.h>
11819 DIR *dirp = opendir(".");
11820 if (dirfd(dirp) >= 0)
11828 if eval $compile; then
11832 $define) echo "dirfd() found." >&4 ;;
11833 *) echo "dirfd() NOT found." >&4 ;;
11839 : see if dlerror exists
11842 set dlerror d_dlerror
11846 : see if dlfcn is available
11847 set dlfcn.h i_dlfcn
11850 : Check what extension to use for shared libs
11855 On a few systems, the dynamically loaded modules that perl generates and uses
11856 will need a different extension than shared libs. The default will probably
11862 *) dflt="$dlext" ;;
11864 rp='What is the extension of dynamically loaded modules'
11873 : Check if dlsym need a leading underscore
11879 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11880 $cat >dyna.c <<'EOM'
11887 #$i_stdlib I_STDLIB
11889 #include <stdlib.h>
11893 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11895 #include <sys/types.h>
11900 extern int fred() ;
11909 int mode = RTLD_LAZY ;
11911 handle = dlopen("./dyna.$dlext", mode) ;
11912 if (handle == NULL) {
11917 symbol = dlsym(handle, "fred") ;
11918 if (symbol == NULL) {
11919 /* try putting a leading underscore */
11920 symbol = dlsym(handle, "_fred") ;
11921 if (symbol == NULL) {
11934 : Call the object file tmp-dyna.o in case dlext=o.
11935 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11936 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11937 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11938 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11941 1) echo "Test program failed using dlopen." >&4
11942 echo "Perhaps you should not use dynamic loading." >&4;;
11943 2) echo "Test program failed using dlsym." >&4
11944 echo "Perhaps you should not use dynamic loading." >&4;;
11945 3) echo "dlsym needs a leading underscore" >&4
11947 4) echo "dlsym doesn't need a leading underscore." >&4;;
11950 echo "I can't compile and run the test program." >&4
11951 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11956 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11961 : see if drand48_r exists
11962 set drand48_r d_drand48_r
11964 case "$d_drand48_r" in
11966 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11967 case "$d_drand48_r_proto:$usethreads" in
11968 ":define") d_drand48_r_proto=define
11969 set d_drand48_r_proto drand48_r $hdrs
11973 case "$d_drand48_r_proto" in
11975 case "$drand48_r_proto" in
11976 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11977 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11979 case "$drand48_r_proto" in
11980 ''|0) d_drand48_r=undef
11982 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11983 * ) case "$drand48_r_proto" in
11984 REENTRANT_PROTO*) ;;
11985 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11987 echo "Prototype: $try" ;;
11990 *) case "$usethreads" in
11991 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11998 *) drand48_r_proto=0
12002 : see if prototype for drand48 is available
12004 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12007 : see if dup2 exists
12011 : see if eaccess exists
12012 set eaccess d_eaccess
12015 : see if endgrent exists
12016 set endgrent d_endgrent
12019 : see if this is an grp system
12025 xxx=`./findhdr grp.h`
12026 $cppstdin $cppflags $cppminus < $xxx >$$.h
12028 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12040 set d_grpasswd; eval $setvar
12044 : see if endgrent_r exists
12045 set endgrent_r d_endgrent_r
12047 case "$d_endgrent_r" in
12049 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12050 case "$d_endgrent_r_proto:$usethreads" in
12051 ":define") d_endgrent_r_proto=define
12052 set d_endgrent_r_proto endgrent_r $hdrs
12056 case "$d_endgrent_r_proto" in
12058 case "$endgrent_r_proto" in
12059 ''|0) try='int endgrent_r(FILE**);'
12060 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12062 case "$endgrent_r_proto" in
12063 ''|0) try='void endgrent_r(FILE**);'
12064 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12066 case "$endgrent_r_proto" in
12067 ''|0) d_endgrent_r=undef
12069 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12070 * ) case "$endgrent_r_proto" in
12071 REENTRANT_PROTO*) ;;
12072 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12074 echo "Prototype: $try" ;;
12077 *) case "$usethreads" in
12078 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12085 *) endgrent_r_proto=0
12089 : see if endhostent exists
12090 set endhostent d_endhent
12093 : see if this is a netdb.h system
12094 set netdb.h i_netdb
12097 : see if endhostent_r exists
12098 set endhostent_r d_endhostent_r
12100 case "$d_endhostent_r" in
12102 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12103 case "$d_endhostent_r_proto:$usethreads" in
12104 ":define") d_endhostent_r_proto=define
12105 set d_endhostent_r_proto endhostent_r $hdrs
12109 case "$d_endhostent_r_proto" in
12111 case "$endhostent_r_proto" in
12112 ''|0) try='int endhostent_r(struct hostent_data*);'
12113 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12115 case "$endhostent_r_proto" in
12116 ''|0) try='void endhostent_r(struct hostent_data*);'
12117 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12119 case "$endhostent_r_proto" in
12120 ''|0) d_endhostent_r=undef
12121 endhostent_r_proto=0
12122 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12123 * ) case "$endhostent_r_proto" in
12124 REENTRANT_PROTO*) ;;
12125 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12127 echo "Prototype: $try" ;;
12130 *) case "$usethreads" in
12131 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12133 d_endhostent_r=undef
12134 endhostent_r_proto=0
12138 *) endhostent_r_proto=0
12142 : see if endnetent exists
12143 set endnetent d_endnent
12146 : see if endnetent_r exists
12147 set endnetent_r d_endnetent_r
12149 case "$d_endnetent_r" in
12151 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12152 case "$d_endnetent_r_proto:$usethreads" in
12153 ":define") d_endnetent_r_proto=define
12154 set d_endnetent_r_proto endnetent_r $hdrs
12158 case "$d_endnetent_r_proto" in
12160 case "$endnetent_r_proto" in
12161 ''|0) try='int endnetent_r(struct netent_data*);'
12162 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12164 case "$endnetent_r_proto" in
12165 ''|0) try='void endnetent_r(struct netent_data*);'
12166 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12168 case "$endnetent_r_proto" in
12169 ''|0) d_endnetent_r=undef
12170 endnetent_r_proto=0
12171 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12172 * ) case "$endnetent_r_proto" in
12173 REENTRANT_PROTO*) ;;
12174 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12176 echo "Prototype: $try" ;;
12179 *) case "$usethreads" in
12180 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12182 d_endnetent_r=undef
12183 endnetent_r_proto=0
12187 *) endnetent_r_proto=0
12191 : see if endprotoent exists
12192 set endprotoent d_endpent
12195 : see if endprotoent_r exists
12196 set endprotoent_r d_endprotoent_r
12198 case "$d_endprotoent_r" in
12200 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12201 case "$d_endprotoent_r_proto:$usethreads" in
12202 ":define") d_endprotoent_r_proto=define
12203 set d_endprotoent_r_proto endprotoent_r $hdrs
12207 case "$d_endprotoent_r_proto" in
12209 case "$endprotoent_r_proto" in
12210 ''|0) try='int endprotoent_r(struct protoent_data*);'
12211 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12213 case "$endprotoent_r_proto" in
12214 ''|0) try='void endprotoent_r(struct protoent_data*);'
12215 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12217 case "$endprotoent_r_proto" in
12218 ''|0) d_endprotoent_r=undef
12219 endprotoent_r_proto=0
12220 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12221 * ) case "$endprotoent_r_proto" in
12222 REENTRANT_PROTO*) ;;
12223 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12225 echo "Prototype: $try" ;;
12228 *) case "$usethreads" in
12229 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12231 d_endprotoent_r=undef
12232 endprotoent_r_proto=0
12236 *) endprotoent_r_proto=0
12240 : see if endpwent exists
12241 set endpwent d_endpwent
12244 : see if this is a pwd.h system
12250 xxx=`./findhdr pwd.h`
12251 $cppstdin $cppflags $cppminus < $xxx >$$.h
12253 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12261 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12269 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12277 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12285 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12293 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12301 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12309 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12321 set d_pwquota; eval $setvar
12322 set d_pwage; eval $setvar
12323 set d_pwchange; eval $setvar
12324 set d_pwclass; eval $setvar
12325 set d_pwexpire; eval $setvar
12326 set d_pwcomment; eval $setvar
12327 set d_pwgecos; eval $setvar
12328 set d_pwpasswd; eval $setvar
12332 : see if endpwent_r exists
12333 set endpwent_r d_endpwent_r
12335 case "$d_endpwent_r" in
12337 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12338 case "$d_endpwent_r_proto:$usethreads" in
12339 ":define") d_endpwent_r_proto=define
12340 set d_endpwent_r_proto endpwent_r $hdrs
12344 case "$d_endpwent_r_proto" in
12346 case "$endpwent_r_proto" in
12347 ''|0) try='int endpwent_r(FILE**);'
12348 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12350 case "$endpwent_r_proto" in
12351 ''|0) try='void endpwent_r(FILE**);'
12352 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12354 case "$endpwent_r_proto" in
12355 ''|0) d_endpwent_r=undef
12357 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12358 * ) case "$endpwent_r_proto" in
12359 REENTRANT_PROTO*) ;;
12360 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12362 echo "Prototype: $try" ;;
12365 *) case "$usethreads" in
12366 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12373 *) endpwent_r_proto=0
12377 : see if endservent exists
12378 set endservent d_endsent
12381 : see if endservent_r exists
12382 set endservent_r d_endservent_r
12384 case "$d_endservent_r" in
12386 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12387 case "$d_endservent_r_proto:$usethreads" in
12388 ":define") d_endservent_r_proto=define
12389 set d_endservent_r_proto endservent_r $hdrs
12393 case "$d_endservent_r_proto" in
12395 case "$endservent_r_proto" in
12396 ''|0) try='int endservent_r(struct servent_data*);'
12397 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12399 case "$endservent_r_proto" in
12400 ''|0) try='void endservent_r(struct servent_data*);'
12401 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12403 case "$endservent_r_proto" in
12404 ''|0) d_endservent_r=undef
12405 endservent_r_proto=0
12406 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12407 * ) case "$endservent_r_proto" in
12408 REENTRANT_PROTO*) ;;
12409 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12411 echo "Prototype: $try" ;;
12414 *) case "$usethreads" in
12415 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12417 d_endservent_r=undef
12418 endservent_r_proto=0
12422 *) endservent_r_proto=0
12426 : Locate the flags for 'open()'
12429 #include <sys/types.h>
12434 #include <sys/file.h>
12436 #$i_stdlib I_STDLIB
12438 #include <stdlib.h>
12449 : check sys/file.h first to get FREAD on Sun
12450 if $test `./findhdr sys/file.h` && \
12451 set try -DI_SYS_FILE && eval $compile; then
12453 echo "<sys/file.h> defines the O_* constants..." >&4
12454 if $run ./try; then
12455 echo "and you have the 3 argument form of open()." >&4
12458 echo "but not the 3 argument form of open(). Oh, well." >&4
12461 elif $test `./findhdr fcntl.h` && \
12462 set try -DI_FCNTL && eval $compile; then
12464 echo "<fcntl.h> defines the O_* constants..." >&4
12465 if $run ./try; then
12466 echo "and you have the 3 argument form of open()." >&4
12469 echo "but not the 3 argument form of open(). Oh, well." >&4
12474 echo "I can't find the O_* constant definitions! You got problems." >&4
12480 : see if this is a sys/file.h system
12485 : do we need to include sys/file.h ?
12489 if $h_sysfile; then
12491 echo "We'll be including <sys/file.h>." >&4
12494 echo "We won't be including <sys/file.h>." >&4
12504 : see if fcntl.h is there
12509 : see if we can include fcntl.h
12515 echo "We'll be including <fcntl.h>." >&4
12518 if $h_sysfile; then
12519 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12521 echo "We won't be including <fcntl.h>." >&4
12533 : see if fork exists
12537 : see if pipe exists
12541 : check for non-blocking I/O stuff
12542 case "$h_sysfile" in
12543 true) echo "#include <sys/file.h>" > head.c;;
12546 true) echo "#include <fcntl.h>" > head.c;;
12547 *) echo "#include <sys/fcntl.h>" > head.c;;
12552 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12553 case "$o_nonblock" in
12555 $cat head.c > try.c
12556 $cat >>try.c <<EOCP
12558 #$i_stdlib I_STDLIB
12560 #include <stdlib.h>
12568 printf("O_NONBLOCK\n");
12572 printf("O_NDELAY\n");
12576 printf("FNDELAY\n");
12583 if eval $compile_ok; then
12584 o_nonblock=`$run ./try`
12585 case "$o_nonblock" in
12586 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12587 *) echo "Seems like we can use $o_nonblock.";;
12590 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12593 *) echo "Using $hint value $o_nonblock.";;
12598 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12601 case "$d_fork:$d_pipe" in
12603 $cat head.c > try.c
12604 $cat >>try.c <<EOCP
12606 #include <sys/types.h>
12607 #include <signal.h>
12609 #$i_stdlib I_STDLIB
12611 #include <stdlib.h>
12617 #define MY_O_NONBLOCK $o_nonblock
12618 #ifndef errno /* XXX need better Configure test */
12621 #$i_unistd I_UNISTD
12623 #include <unistd.h>
12625 #$i_string I_STRING
12627 #include <string.h>
12629 #include <strings.h>
12631 $signal_t blech(int x) { exit(3); }
12633 $cat >> try.c <<'EOCP'
12641 pipe(pd); /* Down: child -> parent */
12642 pipe(pu); /* Up: parent -> child */
12645 close(pd[1]); /* Parent reads from pd[0] */
12646 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12648 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12653 signal(SIGALRM, blech);
12655 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12657 sprintf(string, "%d\n", ret);
12658 write(2, string, strlen(string));
12661 if (errno == EAGAIN) {
12662 printf("EAGAIN\n");
12667 if (errno == EWOULDBLOCK)
12668 printf("EWOULDBLOCK\n");
12671 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12672 sleep(2); /* Give it time to close our pipe */
12674 ret = read(pd[0], buf, 1); /* Should read EOF */
12676 sprintf(string, "%d\n", ret);
12677 write(4, string, strlen(string));
12681 close(pd[0]); /* We write to pd[1] */
12682 close(pu[1]); /* We read from pu[0] */
12683 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12684 close(pd[1]); /* Pipe pd is now fully closed! */
12685 exit(0); /* Bye bye, thank you for playing! */
12689 if eval $compile_ok; then
12690 echo "$startsh" >mtry
12691 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12693 ./mtry >/dev/null 2>&1
12695 0) eagain=`$cat try.out`;;
12696 1) echo "Could not perform non-blocking setting!";;
12697 2) echo "I did a successful read() for something that was not there!";;
12698 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12699 4) echo "Could not find F_SETFL!";;
12700 *) echo "Something terribly wrong happened during testing.";;
12702 rd_nodata=`$cat try.ret`
12703 echo "A read() system call with no data present returns $rd_nodata."
12704 case "$rd_nodata" in
12707 echo "(That's peculiar, fixing that to be -1.)"
12713 echo "Forcing errno EAGAIN on read() with no data available."
12717 echo "Your read() sets errno to $eagain when no data is available."
12720 status=`$cat try.err`
12722 0) echo "And it correctly returns 0 to signal EOF.";;
12723 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12724 *) echo "However, your read() returns '$status' on EOF??";;
12727 if test "$status" = "$rd_nodata"; then
12728 echo "WARNING: you can't distinguish between EOF and no data!"
12732 echo "I can't compile the test program--assuming errno EAGAIN will do."
12736 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12745 echo "Using $hint value $eagain."
12746 echo "Your read() returns $rd_nodata when no data is present."
12747 case "$d_eofnblk" in
12748 "$define") echo "And you can see EOF because read() returns 0.";;
12749 "$undef") echo "But you can't see EOF status from read() returned value.";;
12751 echo "(Assuming you can't see EOF status from read anyway.)"
12757 $rm_try head.c mtry
12759 : see if _ptr and _cnt from stdio act std
12762 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12763 echo "(Looks like you have stdio.h from BSD.)"
12764 case "$stdio_ptr" in
12765 '') stdio_ptr='((fp)->_p)'
12768 *) ptr_lval=$d_stdio_ptr_lval;;
12770 case "$stdio_cnt" in
12771 '') stdio_cnt='((fp)->_r)'
12774 *) cnt_lval=$d_stdio_cnt_lval;;
12776 case "$stdio_base" in
12777 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12779 case "$stdio_bufsiz" in
12780 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12782 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12783 echo "(Looks like you have stdio.h from Linux.)"
12784 case "$stdio_ptr" in
12785 '') stdio_ptr='((fp)->_IO_read_ptr)'
12788 *) ptr_lval=$d_stdio_ptr_lval;;
12790 case "$stdio_cnt" in
12791 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12794 *) cnt_lval=$d_stdio_cnt_lval;;
12796 case "$stdio_base" in
12797 '') stdio_base='((fp)->_IO_read_base)';;
12799 case "$stdio_bufsiz" in
12800 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12803 case "$stdio_ptr" in
12804 '') stdio_ptr='((fp)->_ptr)'
12807 *) ptr_lval=$d_stdio_ptr_lval;;
12809 case "$stdio_cnt" in
12810 '') stdio_cnt='((fp)->_cnt)'
12813 *) cnt_lval=$d_stdio_cnt_lval;;
12815 case "$stdio_base" in
12816 '') stdio_base='((fp)->_base)';;
12818 case "$stdio_bufsiz" in
12819 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12823 : test whether _ptr and _cnt really work
12824 echo "Checking how std your stdio is..." >&4
12827 #$i_stdlib I_STDLIB
12829 #include <stdlib.h>
12831 #define FILE_ptr(fp) $stdio_ptr
12832 #define FILE_cnt(fp) $stdio_cnt
12834 FILE *fp = fopen("try.c", "r");
12837 18 <= FILE_cnt(fp) &&
12838 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12846 if eval $compile && $to try.c; then
12847 if $run ./try; then
12848 echo "Your stdio acts pretty std."
12851 echo "Your stdio isn't very std."
12854 echo "Your stdio doesn't appear very std."
12858 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12859 # direct buffer manipulation no longer works. The Configure tests
12860 # should be changed to correctly detect this, but until then,
12861 # the following check should at least let perl compile and run.
12862 # (This quick fix should be updated before 5.8.1.)
12863 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12864 # A. Dougherty, June 3, 2002.
12865 case "$d_gnulibc" in
12867 case "$gnulibc_version" in
12871 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12880 : Can _ptr be used as an lvalue?
12881 case "$d_stdstdio$ptr_lval" in
12882 $define$define) val=$define ;;
12885 set d_stdio_ptr_lval
12888 : Can _cnt be used as an lvalue?
12889 case "$d_stdstdio$cnt_lval" in
12890 $define$define) val=$define ;;
12893 set d_stdio_cnt_lval
12897 : test whether setting _ptr sets _cnt as a side effect
12898 d_stdio_ptr_lval_sets_cnt="$undef"
12899 d_stdio_ptr_lval_nochange_cnt="$undef"
12900 case "$d_stdio_ptr_lval$d_stdstdio" in
12902 echo "Checking to see what happens if we set the stdio ptr..." >&4
12905 /* Can we scream? */
12906 /* Eat dust sed :-) */
12907 /* In the buffer space, no one can hear you scream. */
12908 #$i_stdlib I_STDLIB
12910 #include <stdlib.h>
12912 #define FILE_ptr(fp) $stdio_ptr
12913 #define FILE_cnt(fp) $stdio_cnt
12914 #include <sys/types.h>
12916 FILE *fp = fopen("try.c", "r");
12921 puts("Fail even to read");
12924 c = getc(fp); /* Read away the first # */
12926 puts("Fail even to read");
12930 18 <= FILE_cnt(fp) &&
12931 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12933 puts("Fail even to read");
12936 ptr = (char*) FILE_ptr(fp);
12937 cnt = (size_t)FILE_cnt(fp);
12939 FILE_ptr(fp) += 42;
12941 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12942 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12945 if (FILE_cnt(fp) <= 20) {
12946 printf ("Fail (<20 chars to test)");
12949 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12950 puts("Fail compare");
12953 if (cnt == FILE_cnt(fp)) {
12954 puts("Pass_unchanged");
12957 if (FILE_cnt(fp) == (cnt - 42)) {
12958 puts("Pass_changed");
12961 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12967 if eval $compile && $to try.c; then
12968 case `$run ./try` in
12970 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12971 d_stdio_ptr_lval_sets_cnt="$define" ;;
12973 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12974 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12976 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12978 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12981 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12987 : see if _base is also standard
12989 case "$d_stdstdio" in
12993 #$i_stdlib I_STDLIB
12995 #include <stdlib.h>
12997 #define FILE_base(fp) $stdio_base
12998 #define FILE_bufsiz(fp) $stdio_bufsiz
13000 FILE *fp = fopen("try.c", "r");
13003 19 <= FILE_bufsiz(fp) &&
13004 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13011 if eval $compile && $to try.c; then
13012 if $run ./try; then
13013 echo "And its _base field acts std."
13016 echo "But its _base field isn't std."
13019 echo "However, it seems to be lacking the _base field."
13027 : see if fast_stdio exists
13029 case "$d_stdstdio:$d_stdio_ptr_lval" in
13031 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13033 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13044 : see if fchdir exists
13045 set fchdir d_fchdir
13048 : see if fchmod exists
13049 set fchmod d_fchmod
13052 : see if fchown exists
13053 set fchown d_fchown
13056 : see if this is an fcntl system
13060 : See if fcntl-based locking works.
13063 #$i_stdlib I_STDLIB
13065 #include <stdlib.h>
13067 #include <unistd.h>
13069 #include <signal.h>
13070 $signal_t blech(int x) { exit(3); }
13072 #if defined(F_SETLK) && defined(F_SETLKW)
13073 struct flock flock;
13075 fd = open("try.c", O_RDONLY);
13076 flock.l_type = F_RDLCK;
13077 flock.l_whence = SEEK_SET;
13078 flock.l_start = flock.l_len = 0;
13079 signal(SIGALRM, blech);
13081 retval = fcntl(fd, F_SETLK, &flock);
13083 (retval < 0 ? exit(2) : exit(0));
13089 echo "Checking if fcntl-based file locking works... "
13093 if eval $compile_ok; then
13094 if $run ./try; then
13095 echo "Yes, it seems to work."
13098 echo "Nope, it didn't work."
13103 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13104 *** This is (almost) impossible.
13105 *** If your NFS lock daemons are not feeling well, something like
13106 *** this may happen, please investigate. Cannot continue, aborting.
13114 echo "I'm unable to compile the test program, so I'll assume not."
13119 echo "Nope, since you don't even have fcntl()."
13122 set d_fcntl_can_lock
13126 : check for fd_set items
13129 Checking to see how well your C compiler handles fd_set and friends ...
13132 #$i_stdlib I_STDLIB
13134 #include <stdlib.h>
13136 #$i_systime I_SYS_TIME
13137 #$i_sysselct I_SYS_SELECT
13138 #$d_socket HAS_SOCKET
13139 #include <sys/types.h>
13141 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13144 #include <sys/time.h>
13146 #ifdef I_SYS_SELECT
13147 #include <sys/select.h>
13156 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13164 if eval $compile; then
13165 d_fds_bits="$define"
13167 echo "Well, your system knows about the normal fd_set typedef..." >&4
13168 if $run ./try; then
13169 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13170 d_fd_macros="$define"
13173 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13175 d_fd_macros="$undef"
13179 Hmm, your compiler has some difficulty with fd_set. Checking further...
13182 if eval $compile; then
13183 d_fds_bits="$undef"
13185 echo "Well, your system has some sort of fd_set available..." >&4
13186 if $run ./try; then
13187 echo "and you have the normal fd_set macros." >&4
13188 d_fd_macros="$define"
13191 but not the normal fd_set macros! Gross! More work for me...
13193 d_fd_macros="$undef"
13196 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13198 d_fds_bits="$undef"
13199 d_fd_macros="$undef"
13204 : see if fgetpos exists
13205 set fgetpos d_fgetpos
13208 : see if finite exists
13209 set finite d_finite
13212 : see if finitel exists
13213 set finitel d_finitel
13216 : see if flock exists
13220 : see if prototype for flock is available
13222 set d_flockproto flock $i_sysfile sys/file.h
13225 : see if fp_class exists
13226 set fp_class d_fp_class
13229 : see if pathconf exists
13230 set pathconf d_pathconf
13233 : see if fpathconf exists
13234 set fpathconf d_fpathconf
13237 : see if fpclass exists
13238 set fpclass d_fpclass
13241 : see if fpclassify exists
13242 set fpclassify d_fpclassify
13245 : see if fpclassl exists
13246 set fpclassl d_fpclassl
13249 : check for fpos64_t
13251 echo "Checking to see if you have fpos64_t..." >&4
13254 int main() { fpos64_t x = 7; }
13257 if eval $compile; then
13259 echo "You have fpos64_t."
13262 echo "You do not have fpos64_t."
13263 case "$fpossize" in
13264 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13271 : see if frexpl exists
13272 set frexpl d_frexpl
13275 : see if this is a sys/param system
13276 set sys/param.h i_sysparam
13279 : see if this is a sys/mount.h system
13280 set sys/mount.h i_sysmount
13283 : Check for fs_data_s
13285 echo "Checking to see if your system supports struct fs_data..." >&4
13286 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13288 case "$d_fs_data_s" in
13289 "$define") echo "Yes, it does." ;;
13290 *) echo "No, it doesn't." ;;
13293 : see if fseeko exists
13294 set fseeko d_fseeko
13296 case "$longsize" in
13297 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13300 : see if fsetpos exists
13301 set fsetpos d_fsetpos
13304 : see if fstatfs exists
13305 set fstatfs d_fstatfs
13308 : see if statvfs exists
13309 set statvfs d_statvfs
13312 : see if fstatvfs exists
13313 set fstatvfs d_fstatvfs
13317 : see if fsync exists
13321 : see if ftello exists
13322 set ftello d_ftello
13324 case "$longsize" in
13325 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13328 : check for a working futimes
13331 echo "Checking if you have a working futimes()" >&4
13334 #include <sys/time.h>
13341 fd = open ("try.c", O_RDWR);
13342 if (-1 == fd) exit (1);
13343 rv = futimes (fd, NULL);
13344 exit (rv == -1 ? errno : 0);
13348 if eval $compile; then
13352 0) echo "Yes, you have" >&4
13353 d_futimes="$define"
13355 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13359 echo "No, it does not (probably harmless)" >&4
13363 : see if ndbm.h is available
13366 : Compatibility location for RedHat 7.1
13367 set gdbm/ndbm.h i_gdbmndbm
13369 : Compatibility location for Debian 4.0
13370 set gdbm-ndbm.h i_gdbm_ndbm
13374 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13375 : see if dbm_open exists
13376 set dbm_open d_dbm_open
13378 case "$d_dbm_open" in
13381 i_gdbmndbm="$undef"
13382 i_gdbm_ndbm="$undef"
13383 echo "We won't be including <ndbm.h>"
13393 ndbm_hdr_protochk='name=$1; hdr=$2;
13394 eval "ihdr=\$""i_$name";
13396 if $test "$ihdr" = "$define"; then
13397 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13398 case "$d_cplusplus" in
13399 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13400 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13403 $define) $echo "Your <$hdr> seems to have prototypes";;
13404 *) $echo "Your <$hdr> does not seem to have prototypes";;
13407 set "d_${name}_h_uses_prototypes";
13411 eval $ndbm_hdr_protochk
13412 set gdbmndbm gdbm/ndbm.h
13413 eval $ndbm_hdr_protochk
13414 set gdbm_ndbm gdbm-ndbm.h
13415 eval $ndbm_hdr_protochk
13417 : see if getaddrinfo exists
13418 set getaddrinfo d_getaddrinfo
13421 : see if getcwd exists
13422 set getcwd d_getcwd
13425 : see if getespwnam exists
13426 set getespwnam d_getespwnam
13429 : see if getfsstat exists
13430 set getfsstat d_getfsstat
13433 : see if getgrent exists
13434 set getgrent d_getgrent
13437 : see if getgrent_r exists
13438 set getgrent_r d_getgrent_r
13440 case "$d_getgrent_r" in
13442 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13443 case "$d_getgrent_r_proto:$usethreads" in
13444 ":define") d_getgrent_r_proto=define
13445 set d_getgrent_r_proto getgrent_r $hdrs
13449 case "$d_getgrent_r_proto" in
13451 case "$getgrent_r_proto" in
13452 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13453 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13455 case "$getgrent_r_proto" in
13456 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13457 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13459 case "$getgrent_r_proto" in
13460 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13461 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13463 case "$getgrent_r_proto" in
13464 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13465 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13467 case "$getgrent_r_proto" in
13468 ''|0) try='int getgrent_r(struct group*, char*, int);'
13469 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13471 case "$getgrent_r_proto" in
13472 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13473 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13475 case "$getgrent_r_proto" in
13476 ''|0) d_getgrent_r=undef
13478 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13479 * ) case "$getgrent_r_proto" in
13480 REENTRANT_PROTO*) ;;
13481 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13483 echo "Prototype: $try" ;;
13486 *) case "$usethreads" in
13487 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13494 *) getgrent_r_proto=0
13498 : see if getgrgid_r exists
13499 set getgrgid_r d_getgrgid_r
13501 case "$d_getgrgid_r" in
13503 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13504 case "$d_getgrgid_r_proto:$usethreads" in
13505 ":define") d_getgrgid_r_proto=define
13506 set d_getgrgid_r_proto getgrgid_r $hdrs
13510 case "$d_getgrgid_r_proto" in
13512 case "$getgrgid_r_proto" in
13513 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13514 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13516 case "$getgrgid_r_proto" in
13517 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13518 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13520 case "$getgrgid_r_proto" in
13521 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13522 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13524 case "$getgrgid_r_proto" in
13525 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13526 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13528 case "$getgrgid_r_proto" in
13529 ''|0) d_getgrgid_r=undef
13531 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13532 * ) case "$getgrgid_r_proto" in
13533 REENTRANT_PROTO*) ;;
13534 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13536 echo "Prototype: $try" ;;
13539 *) case "$usethreads" in
13540 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13547 *) getgrgid_r_proto=0
13551 : see if getgrnam_r exists
13552 set getgrnam_r d_getgrnam_r
13554 case "$d_getgrnam_r" in
13556 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13557 case "$d_getgrnam_r_proto:$usethreads" in
13558 ":define") d_getgrnam_r_proto=define
13559 set d_getgrnam_r_proto getgrnam_r $hdrs
13563 case "$d_getgrnam_r_proto" in
13565 case "$getgrnam_r_proto" in
13566 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13567 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13569 case "$getgrnam_r_proto" in
13570 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13571 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13573 case "$getgrnam_r_proto" in
13574 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13575 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13577 case "$getgrnam_r_proto" in
13578 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13579 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13581 case "$getgrnam_r_proto" in
13582 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13583 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13585 case "$getgrnam_r_proto" in
13586 ''|0) d_getgrnam_r=undef
13588 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13589 * ) case "$getgrnam_r_proto" in
13590 REENTRANT_PROTO*) ;;
13591 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13593 echo "Prototype: $try" ;;
13596 *) case "$usethreads" in
13597 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13604 *) getgrnam_r_proto=0
13608 : see if gethostbyaddr exists
13609 set gethostbyaddr d_gethbyaddr
13612 : see if gethostbyname exists
13613 set gethostbyname d_gethbyname
13616 : see if gethostent exists
13617 set gethostent d_gethent
13620 : see how we will look up host name
13623 if set gethostname val -f d_gethname; eval $csym; $val; then
13624 echo 'gethostname() found.' >&4
13625 d_gethname="$define"
13628 if set uname val -f d_uname; eval $csym; $val; then
13631 uname() was found, but you're running xenix, and older versions of xenix
13632 have a broken uname(). If you don't really know whether your xenix is old
13633 enough to have a broken system call, use the default answer.
13638 "$define") dflt=n;;
13640 rp='Is your uname() broken?'
13643 n*) d_uname="$define"; call=uname;;
13646 echo 'uname() found.' >&4
13653 case "$d_gethname" in
13654 '') d_gethname="$undef";;
13657 '') d_uname="$undef";;
13659 case "$d_uname$d_gethname" in
13664 Every now and then someone has a $call() that lies about the hostname
13665 but can't be fixed for political or economic reasons. If you wish, I can
13666 pretend $call() isn't there and maybe compute hostname at run-time
13667 thanks to the '$phostname' command.
13670 rp="Shall I ignore $call() from now on?"
13673 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13676 case "$phostname" in
13677 '') aphostname='';;
13678 *) case "$aphostname" in
13680 *) set X $phostname
13684 file=`./loc $file $file $pth`
13685 aphostname=`echo $file $*`
13690 case "$d_uname$d_gethname" in
13693 case "$phostname" in
13695 echo "There will be no way for $package to get your hostname." >&4;;
13697 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13701 case "$d_phostname" in
13702 '') d_phostname="$undef";;
13705 : see if gethostbyaddr_r exists
13706 set gethostbyaddr_r d_gethostbyaddr_r
13708 case "$d_gethostbyaddr_r" in
13710 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13711 case "$d_gethostbyaddr_r_proto:$usethreads" in
13712 ":define") d_gethostbyaddr_r_proto=define
13713 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13717 case "$d_gethostbyaddr_r_proto" in
13719 case "$gethostbyaddr_r_proto" in
13720 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13721 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13723 case "$gethostbyaddr_r_proto" in
13724 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13725 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13727 case "$gethostbyaddr_r_proto" in
13728 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13729 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13731 case "$gethostbyaddr_r_proto" in
13732 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13733 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13735 case "$gethostbyaddr_r_proto" in
13736 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13737 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13739 case "$gethostbyaddr_r_proto" in
13740 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13741 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13743 case "$gethostbyaddr_r_proto" in
13744 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13745 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13747 case "$gethostbyaddr_r_proto" in
13748 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13749 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13751 case "$gethostbyaddr_r_proto" in
13752 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13753 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13755 case "$gethostbyaddr_r_proto" in
13756 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13757 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13759 case "$gethostbyaddr_r_proto" in
13760 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13761 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13763 case "$gethostbyaddr_r_proto" in
13764 ''|0) d_gethostbyaddr_r=undef
13765 gethostbyaddr_r_proto=0
13766 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13767 * ) case "$gethostbyaddr_r_proto" in
13768 REENTRANT_PROTO*) ;;
13769 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13771 echo "Prototype: $try" ;;
13774 *) case "$usethreads" in
13775 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13777 d_gethostbyaddr_r=undef
13778 gethostbyaddr_r_proto=0
13782 *) gethostbyaddr_r_proto=0
13786 : see if gethostbyname_r exists
13787 set gethostbyname_r d_gethostbyname_r
13789 case "$d_gethostbyname_r" in
13791 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13792 case "$d_gethostbyname_r_proto:$usethreads" in
13793 ":define") d_gethostbyname_r_proto=define
13794 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13798 case "$d_gethostbyname_r_proto" in
13800 case "$gethostbyname_r_proto" in
13801 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13802 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13804 case "$gethostbyname_r_proto" in
13805 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13806 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13808 case "$gethostbyname_r_proto" in
13809 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13810 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13812 case "$gethostbyname_r_proto" in
13813 ''|0) d_gethostbyname_r=undef
13814 gethostbyname_r_proto=0
13815 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13816 * ) case "$gethostbyname_r_proto" in
13817 REENTRANT_PROTO*) ;;
13818 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13820 echo "Prototype: $try" ;;
13823 *) case "$usethreads" in
13824 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13826 d_gethostbyname_r=undef
13827 gethostbyname_r_proto=0
13831 *) gethostbyname_r_proto=0
13835 : see if gethostent_r exists
13836 set gethostent_r d_gethostent_r
13838 case "$d_gethostent_r" in
13840 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13841 case "$d_gethostent_r_proto:$usethreads" in
13842 ":define") d_gethostent_r_proto=define
13843 set d_gethostent_r_proto gethostent_r $hdrs
13847 case "$d_gethostent_r_proto" in
13849 case "$gethostent_r_proto" in
13850 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13851 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13853 case "$gethostent_r_proto" in
13854 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13855 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13857 case "$gethostent_r_proto" in
13858 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13859 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13861 case "$gethostent_r_proto" in
13862 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13863 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13865 case "$gethostent_r_proto" in
13866 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13867 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13869 case "$gethostent_r_proto" in
13870 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13871 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13873 case "$gethostent_r_proto" in
13874 ''|0) d_gethostent_r=undef
13875 gethostent_r_proto=0
13876 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13877 * ) case "$gethostent_r_proto" in
13878 REENTRANT_PROTO*) ;;
13879 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13881 echo "Prototype: $try" ;;
13884 *) case "$usethreads" in
13885 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13887 d_gethostent_r=undef
13888 gethostent_r_proto=0
13892 *) gethostent_r_proto=0
13896 : see if prototypes for various gethostxxx netdb.h functions are available
13898 set d_gethostprotos gethostent $i_netdb netdb.h
13901 : see if getitimer exists
13902 set getitimer d_getitimer
13905 : see if getlogin exists
13906 set getlogin d_getlogin
13909 : see if getlogin_r exists
13910 set getlogin_r d_getlogin_r
13912 case "$d_getlogin_r" in
13914 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13915 case "$d_getlogin_r_proto:$usethreads" in
13916 ":define") d_getlogin_r_proto=define
13917 set d_getlogin_r_proto getlogin_r $hdrs
13921 case "$d_getlogin_r_proto" in
13923 case "$getlogin_r_proto" in
13924 ''|0) try='int getlogin_r(char*, size_t);'
13925 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13927 case "$getlogin_r_proto" in
13928 ''|0) try='int getlogin_r(char*, int);'
13929 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13931 case "$getlogin_r_proto" in
13932 ''|0) try='char* getlogin_r(char*, size_t);'
13933 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13935 case "$getlogin_r_proto" in
13936 ''|0) try='char* getlogin_r(char*, int);'
13937 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13939 case "$getlogin_r_proto" in
13940 ''|0) d_getlogin_r=undef
13942 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13943 * ) case "$getlogin_r_proto" in
13944 REENTRANT_PROTO*) ;;
13945 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13947 echo "Prototype: $try" ;;
13950 *) case "$usethreads" in
13951 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13958 *) getlogin_r_proto=0
13962 : see if getmnt exists
13963 set getmnt d_getmnt
13966 : see if getmntent exists
13967 set getmntent d_getmntent
13970 : see if getnameinfo exists
13971 set getnameinfo d_getnameinfo
13974 : see if getnetbyaddr exists
13975 set getnetbyaddr d_getnbyaddr
13978 : see if getnetbyname exists
13979 set getnetbyname d_getnbyname
13982 : see if getnetent exists
13983 set getnetent d_getnent
13986 : see if getnetbyaddr_r exists
13987 set getnetbyaddr_r d_getnetbyaddr_r
13989 case "$d_getnetbyaddr_r" in
13991 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13992 case "$d_getnetbyaddr_r_proto:$usethreads" in
13993 ":define") d_getnetbyaddr_r_proto=define
13994 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13998 case "$d_getnetbyaddr_r_proto" in
14000 case "$getnetbyaddr_r_proto" in
14001 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14002 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14004 case "$getnetbyaddr_r_proto" in
14005 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14006 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14008 case "$getnetbyaddr_r_proto" in
14009 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14010 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14012 case "$getnetbyaddr_r_proto" in
14013 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14014 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14016 case "$getnetbyaddr_r_proto" in
14017 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14018 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14020 case "$getnetbyaddr_r_proto" in
14021 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14022 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14024 case "$getnetbyaddr_r_proto" in
14025 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14026 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14028 case "$getnetbyaddr_r_proto" in
14029 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14030 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14032 case "$getnetbyaddr_r_proto" in
14033 ''|0) d_getnetbyaddr_r=undef
14034 getnetbyaddr_r_proto=0
14035 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14036 * ) case "$getnetbyaddr_r_proto" in
14037 REENTRANT_PROTO*) ;;
14038 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14040 echo "Prototype: $try" ;;
14043 *) case "$usethreads" in
14044 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14046 d_getnetbyaddr_r=undef
14047 getnetbyaddr_r_proto=0
14051 *) getnetbyaddr_r_proto=0
14055 : see if getnetbyname_r exists
14056 set getnetbyname_r d_getnetbyname_r
14058 case "$d_getnetbyname_r" in
14060 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14061 case "$d_getnetbyname_r_proto:$usethreads" in
14062 ":define") d_getnetbyname_r_proto=define
14063 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14067 case "$d_getnetbyname_r_proto" in
14069 case "$getnetbyname_r_proto" in
14070 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14071 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14073 case "$getnetbyname_r_proto" in
14074 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14075 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14077 case "$getnetbyname_r_proto" in
14078 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14079 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14081 case "$getnetbyname_r_proto" in
14082 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14083 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14085 case "$getnetbyname_r_proto" in
14086 ''|0) d_getnetbyname_r=undef
14087 getnetbyname_r_proto=0
14088 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14089 * ) case "$getnetbyname_r_proto" in
14090 REENTRANT_PROTO*) ;;
14091 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14093 echo "Prototype: $try" ;;
14096 *) case "$usethreads" in
14097 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14099 d_getnetbyname_r=undef
14100 getnetbyname_r_proto=0
14104 *) getnetbyname_r_proto=0
14108 : see if getnetent_r exists
14109 set getnetent_r d_getnetent_r
14111 case "$d_getnetent_r" in
14113 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14114 case "$d_getnetent_r_proto:$usethreads" in
14115 ":define") d_getnetent_r_proto=define
14116 set d_getnetent_r_proto getnetent_r $hdrs
14120 case "$d_getnetent_r_proto" in
14122 case "$getnetent_r_proto" in
14123 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14124 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14126 case "$getnetent_r_proto" in
14127 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14128 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14130 case "$getnetent_r_proto" in
14131 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14132 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14134 case "$getnetent_r_proto" in
14135 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14136 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14138 case "$getnetent_r_proto" in
14139 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14140 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14142 case "$getnetent_r_proto" in
14143 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14144 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14146 case "$getnetent_r_proto" in
14147 ''|0) d_getnetent_r=undef
14148 getnetent_r_proto=0
14149 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14150 * ) case "$getnetent_r_proto" in
14151 REENTRANT_PROTO*) ;;
14152 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14154 echo "Prototype: $try" ;;
14157 *) case "$usethreads" in
14158 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14160 d_getnetent_r=undef
14161 getnetent_r_proto=0
14165 *) getnetent_r_proto=0
14169 : see if prototypes for various getnetxxx netdb.h functions are available
14171 set d_getnetprotos getnetent $i_netdb netdb.h
14174 : see if getpagesize exists
14175 set getpagesize d_getpagsz
14178 : Optional checks for getprotobyname and getprotobynumber
14180 : see if getprotobyname exists
14181 set getprotobyname d_getpbyname
14184 : see if getprotobynumber exists
14185 set getprotobynumber d_getpbynumber
14188 : see if getprotoent exists
14189 set getprotoent d_getpent
14192 : see if getpgid exists
14193 set getpgid d_getpgid
14196 : see if getpgrp2 exists
14197 set getpgrp2 d_getpgrp2
14200 : see if getppid exists
14201 set getppid d_getppid
14204 : see if getpriority exists
14205 set getpriority d_getprior
14208 : see if getprotobyname_r exists
14209 set getprotobyname_r d_getprotobyname_r
14211 case "$d_getprotobyname_r" in
14213 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14214 case "$d_getprotobyname_r_proto:$usethreads" in
14215 ":define") d_getprotobyname_r_proto=define
14216 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14220 case "$d_getprotobyname_r_proto" in
14222 case "$getprotobyname_r_proto" in
14223 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14224 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14226 case "$getprotobyname_r_proto" in
14227 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14228 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14230 case "$getprotobyname_r_proto" in
14231 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14232 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14234 case "$getprotobyname_r_proto" in
14235 ''|0) d_getprotobyname_r=undef
14236 getprotobyname_r_proto=0
14237 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14238 * ) case "$getprotobyname_r_proto" in
14239 REENTRANT_PROTO*) ;;
14240 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14242 echo "Prototype: $try" ;;
14245 *) case "$usethreads" in
14246 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14248 d_getprotobyname_r=undef
14249 getprotobyname_r_proto=0
14253 *) getprotobyname_r_proto=0
14257 : see if getprotobynumber_r exists
14258 set getprotobynumber_r d_getprotobynumber_r
14260 case "$d_getprotobynumber_r" in
14262 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14263 case "$d_getprotobynumber_r_proto:$usethreads" in
14264 ":define") d_getprotobynumber_r_proto=define
14265 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14269 case "$d_getprotobynumber_r_proto" in
14271 case "$getprotobynumber_r_proto" in
14272 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14273 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14275 case "$getprotobynumber_r_proto" in
14276 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14277 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14279 case "$getprotobynumber_r_proto" in
14280 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14281 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14283 case "$getprotobynumber_r_proto" in
14284 ''|0) d_getprotobynumber_r=undef
14285 getprotobynumber_r_proto=0
14286 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14287 * ) case "$getprotobynumber_r_proto" in
14288 REENTRANT_PROTO*) ;;
14289 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14291 echo "Prototype: $try" ;;
14294 *) case "$usethreads" in
14295 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14297 d_getprotobynumber_r=undef
14298 getprotobynumber_r_proto=0
14302 *) getprotobynumber_r_proto=0
14306 : see if getprotoent_r exists
14307 set getprotoent_r d_getprotoent_r
14309 case "$d_getprotoent_r" in
14311 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14312 case "$d_getprotoent_r_proto:$usethreads" in
14313 ":define") d_getprotoent_r_proto=define
14314 set d_getprotoent_r_proto getprotoent_r $hdrs
14318 case "$d_getprotoent_r_proto" in
14320 case "$getprotoent_r_proto" in
14321 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14322 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14324 case "$getprotoent_r_proto" in
14325 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14326 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14328 case "$getprotoent_r_proto" in
14329 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14330 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14332 case "$getprotoent_r_proto" in
14333 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14334 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14336 case "$getprotoent_r_proto" in
14337 ''|0) d_getprotoent_r=undef
14338 getprotoent_r_proto=0
14339 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14340 * ) case "$getprotoent_r_proto" in
14341 REENTRANT_PROTO*) ;;
14342 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14344 echo "Prototype: $try" ;;
14347 *) case "$usethreads" in
14348 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14350 d_getprotoent_r=undef
14351 getprotoent_r_proto=0
14355 *) getprotoent_r_proto=0
14359 : see if prototypes for various getprotoxxx netdb.h functions are available
14361 set d_getprotoprotos getprotoent $i_netdb netdb.h
14364 : see if getprpwnam exists
14365 set getprpwnam d_getprpwnam
14368 : see if getpwent exists
14369 set getpwent d_getpwent
14372 : see if getpwent_r exists
14373 set getpwent_r d_getpwent_r
14375 case "$d_getpwent_r" in
14377 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14378 case "$d_getpwent_r_proto:$usethreads" in
14379 ":define") d_getpwent_r_proto=define
14380 set d_getpwent_r_proto getpwent_r $hdrs
14384 case "$d_getpwent_r_proto" in
14386 case "$getpwent_r_proto" in
14387 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14388 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14390 case "$getpwent_r_proto" in
14391 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14392 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14394 case "$getpwent_r_proto" in
14395 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14396 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14398 case "$getpwent_r_proto" in
14399 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14400 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14402 case "$getpwent_r_proto" in
14403 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14404 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14406 case "$getpwent_r_proto" in
14407 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14408 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14410 case "$getpwent_r_proto" in
14411 ''|0) d_getpwent_r=undef
14413 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14414 * ) case "$getpwent_r_proto" in
14415 REENTRANT_PROTO*) ;;
14416 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14418 echo "Prototype: $try" ;;
14421 *) case "$usethreads" in
14422 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14429 *) getpwent_r_proto=0
14433 : see if getpwnam_r exists
14434 set getpwnam_r d_getpwnam_r
14436 case "$d_getpwnam_r" in
14438 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14439 case "$d_getpwnam_r_proto:$usethreads" in
14440 ":define") d_getpwnam_r_proto=define
14441 set d_getpwnam_r_proto getpwnam_r $hdrs
14445 case "$d_getpwnam_r_proto" in
14447 case "$getpwnam_r_proto" in
14448 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14449 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14451 case "$getpwnam_r_proto" in
14452 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14453 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14455 case "$getpwnam_r_proto" in
14456 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14457 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14459 case "$getpwnam_r_proto" in
14460 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14461 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14463 case "$getpwnam_r_proto" in
14464 ''|0) d_getpwnam_r=undef
14466 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14467 * ) case "$getpwnam_r_proto" in
14468 REENTRANT_PROTO*) ;;
14469 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14471 echo "Prototype: $try" ;;
14474 *) case "$usethreads" in
14475 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14482 *) getpwnam_r_proto=0
14486 : see if getpwuid_r exists
14487 set getpwuid_r d_getpwuid_r
14489 case "$d_getpwuid_r" in
14491 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14492 case "$d_getpwuid_r_proto:$usethreads" in
14493 ":define") d_getpwuid_r_proto=define
14494 set d_getpwuid_r_proto getpwuid_r $hdrs
14498 case "$d_getpwuid_r_proto" in
14500 case "$getpwuid_r_proto" in
14501 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14502 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14504 case "$getpwuid_r_proto" in
14505 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14506 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14508 case "$getpwuid_r_proto" in
14509 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14510 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14512 case "$getpwuid_r_proto" in
14513 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14514 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14516 case "$getpwuid_r_proto" in
14517 ''|0) d_getpwuid_r=undef
14519 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14520 * ) case "$getpwuid_r_proto" in
14521 REENTRANT_PROTO*) ;;
14522 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14524 echo "Prototype: $try" ;;
14527 *) case "$usethreads" in
14528 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14535 *) getpwuid_r_proto=0
14539 : Optional checks for getsbyname and getsbyport
14541 : see if getservbyname exists
14542 set getservbyname d_getsbyname
14545 : see if getservbyport exists
14546 set getservbyport d_getsbyport
14549 : see if getservent exists
14550 set getservent d_getsent
14553 : see if getservbyname_r exists
14554 set getservbyname_r d_getservbyname_r
14556 case "$d_getservbyname_r" in
14558 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14559 case "$d_getservbyname_r_proto:$usethreads" in
14560 ":define") d_getservbyname_r_proto=define
14561 set d_getservbyname_r_proto getservbyname_r $hdrs
14565 case "$d_getservbyname_r_proto" in
14567 case "$getservbyname_r_proto" in
14568 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14569 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14571 case "$getservbyname_r_proto" in
14572 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14573 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14575 case "$getservbyname_r_proto" in
14576 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14577 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14579 case "$getservbyname_r_proto" in
14580 ''|0) d_getservbyname_r=undef
14581 getservbyname_r_proto=0
14582 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14583 * ) case "$getservbyname_r_proto" in
14584 REENTRANT_PROTO*) ;;
14585 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14587 echo "Prototype: $try" ;;
14590 *) case "$usethreads" in
14591 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14593 d_getservbyname_r=undef
14594 getservbyname_r_proto=0
14598 *) getservbyname_r_proto=0
14602 : see if getservbyport_r exists
14603 set getservbyport_r d_getservbyport_r
14605 case "$d_getservbyport_r" in
14607 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14608 case "$d_getservbyport_r_proto:$usethreads" in
14609 ":define") d_getservbyport_r_proto=define
14610 set d_getservbyport_r_proto getservbyport_r $hdrs
14614 case "$d_getservbyport_r_proto" in
14616 case "$getservbyport_r_proto" in
14617 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14618 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14620 case "$getservbyport_r_proto" in
14621 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14622 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14624 case "$getservbyport_r_proto" in
14625 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14626 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14628 case "$getservbyport_r_proto" in
14629 ''|0) d_getservbyport_r=undef
14630 getservbyport_r_proto=0
14631 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14632 * ) case "$getservbyport_r_proto" in
14633 REENTRANT_PROTO*) ;;
14634 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14636 echo "Prototype: $try" ;;
14639 *) case "$usethreads" in
14640 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14642 d_getservbyport_r=undef
14643 getservbyport_r_proto=0
14647 *) getservbyport_r_proto=0
14651 : see if getservent_r exists
14652 set getservent_r d_getservent_r
14654 case "$d_getservent_r" in
14656 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14657 case "$d_getservent_r_proto:$usethreads" in
14658 ":define") d_getservent_r_proto=define
14659 set d_getservent_r_proto getservent_r $hdrs
14663 case "$d_getservent_r_proto" in
14665 case "$getservent_r_proto" in
14666 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14667 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14669 case "$getservent_r_proto" in
14670 ''|0) try='int getservent_r(struct servent*, char*, int);'
14671 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14673 case "$getservent_r_proto" in
14674 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14675 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14677 case "$getservent_r_proto" in
14678 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14679 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14681 case "$getservent_r_proto" in
14682 ''|0) d_getservent_r=undef
14683 getservent_r_proto=0
14684 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14685 * ) case "$getservent_r_proto" in
14686 REENTRANT_PROTO*) ;;
14687 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14689 echo "Prototype: $try" ;;
14692 *) case "$usethreads" in
14693 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14695 d_getservent_r=undef
14696 getservent_r_proto=0
14700 *) getservent_r_proto=0
14704 : see if prototypes for various getservxxx netdb.h functions are available
14706 set d_getservprotos getservent $i_netdb netdb.h
14709 : see if getspnam exists
14710 set getspnam d_getspnam
14713 : see if this is a shadow.h system
14714 set shadow.h i_shadow
14717 : see if getspnam_r exists
14718 set getspnam_r d_getspnam_r
14720 case "$d_getspnam_r" in
14722 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14723 case "$d_getspnam_r_proto:$usethreads" in
14724 ":define") d_getspnam_r_proto=define
14725 set d_getspnam_r_proto getspnam_r $hdrs
14729 case "$d_getspnam_r_proto" in
14731 case "$getspnam_r_proto" in
14732 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14733 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14735 case "$getspnam_r_proto" in
14736 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14737 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14739 case "$getspnam_r_proto" in
14740 ''|0) d_getspnam_r=undef
14742 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14743 * ) case "$getspnam_r_proto" in
14744 REENTRANT_PROTO*) ;;
14745 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14747 echo "Prototype: $try" ;;
14750 *) case "$usethreads" in
14751 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14758 *) getspnam_r_proto=0
14762 : see if gettimeofday or ftime exists
14763 set gettimeofday d_gettimeod
14765 case "$d_gettimeod" in
14771 val="$undef"; set d_ftime; eval $setvar
14774 case "$d_gettimeod$d_ftime" in
14777 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14781 : see if gmtime_r exists
14782 set gmtime_r d_gmtime_r
14784 case "$d_gmtime_r" in
14786 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14787 case "$d_gmtime_r_proto:$usethreads" in
14788 ":define") d_gmtime_r_proto=define
14789 set d_gmtime_r_proto gmtime_r $hdrs
14793 case "$d_gmtime_r_proto" in
14795 case "$gmtime_r_proto" in
14796 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14797 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14799 case "$gmtime_r_proto" in
14800 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14801 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14803 case "$gmtime_r_proto" in
14804 ''|0) d_gmtime_r=undef
14806 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14807 * ) case "$gmtime_r_proto" in
14808 REENTRANT_PROTO*) ;;
14809 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14811 echo "Prototype: $try" ;;
14814 *) case "$usethreads" in
14815 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14822 *) gmtime_r_proto=0
14826 : see if hasmntopt exists
14827 set hasmntopt d_hasmntopt
14830 : see if this is a netinet/in.h or sys/in.h system
14831 set netinet/in.h i_niin sys/in.h i_sysin
14834 : see if arpa/inet.h has to be included
14835 set arpa/inet.h i_arpainet
14838 : see if htonl --and friends-- exists
14843 : Maybe they are macros.
14846 $cat >htonl.c <<EOM
14848 #include <sys/types.h>
14849 #$i_niin I_NETINET_IN
14851 #$i_arpainet I_ARPA_INET
14852 #ifdef I_NETINET_IN
14853 #include <netinet/in.h>
14856 #include <sys/in.h>
14859 #include <arpa/inet.h>
14862 printf("Defined as a macro.");
14865 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14866 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14868 echo "But it seems to be defined as a macro." >&4
14876 : see if ilogbl exists
14877 set ilogbl d_ilogbl
14882 if set index val -f; eval $csym; $val; then
14883 if set strchr val -f d_strchr; eval $csym; $val; then
14884 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14887 echo "strchr() found." >&4
14891 echo "index() found." >&4
14896 echo "index() found." >&4
14899 if set strchr val -f d_strchr; eval $csym; $val; then
14902 echo "strchr() found." >&4
14904 echo "No index() or strchr() found!" >&4
14909 set d_strchr; eval $setvar
14911 set d_index; eval $setvar
14913 : check whether inet_aton exists
14914 set inet_aton d_inetaton
14917 : see if inet_ntop exists
14918 set inet_ntop d_inetntop
14921 : see if inet_pton exists
14922 set inet_pton d_inetpton
14927 $cat >isascii.c <<EOCP
14930 #$i_stdlib I_STDLIB
14932 #include <stdlib.h>
14943 if eval $compile; then
14944 echo "isascii() found." >&4
14947 echo "isascii() NOT found." >&4
14954 : see if isfinite exists
14955 set isfinite d_isfinite
14958 : see if isinf exists
14962 : see if isnan exists
14966 : see if isnanl exists
14967 set isnanl d_isnanl
14970 : see if killpg exists
14971 set killpg d_killpg
14974 : see if lchown exists
14976 $cat > try.c <<'EOCP'
14977 /* System header to define __stub macros and hopefully few prototypes,
14978 which can conflict with char lchown(); below. */
14979 #include <assert.h>
14980 /* Override any gcc2 internal prototype to avoid an error. */
14981 /* We use char because int might match the return type of a gcc2
14982 builtin and then its argument prototype would still apply. */
14985 /* The GNU C library defines this for functions which it implements
14986 to always fail with ENOSYS. Some functions are actually named
14987 something starting with __ and the normal name is an alias. */
14988 #if defined (__stub_lchown) || defined (__stub___lchown)
14996 if eval $compile; then
14997 $echo "lchown() found." >&4
15000 $echo "lchown() NOT found." >&4
15006 : See if number of significant digits in a double precision number is known
15008 $cat >ldbl_dig.c <<EOM
15009 #$i_limits I_LIMITS
15012 #include <limits.h>
15018 printf("Contains LDBL_DIG");
15021 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15022 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15023 echo "LDBL_DIG found." >&4
15026 echo "LDBL_DIG NOT found." >&4
15033 : see if this is a math.h system
15037 : check to see if math.h defines _LIB_VERSION
15038 d_libm_lib_version="$undef"
15042 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15044 #include <unistd.h>
15046 int main (int argc, char *argv[])
15048 printf ("%d\n", _LIB_VERSION);
15053 if eval $compile; then
15055 echo "Yes, it does ($foo)" >&4
15056 d_libm_lib_version="$define"
15058 echo "No, it does not (probably harmless)" >&4
15065 : see if link exists
15069 : see if localtime_r exists
15070 set localtime_r d_localtime_r
15072 case "$d_localtime_r" in
15074 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15075 case "$d_localtime_r_proto:$usethreads" in
15076 ":define") d_localtime_r_proto=define
15077 set d_localtime_r_proto localtime_r $hdrs
15081 case "$d_localtime_r_proto" in
15083 case "$localtime_r_proto" in
15084 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15085 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15087 case "$localtime_r_proto" in
15088 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15089 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15091 case "$localtime_r_proto" in
15092 ''|0) d_localtime_r=undef
15093 localtime_r_proto=0
15094 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15095 * ) case "$localtime_r_proto" in
15096 REENTRANT_PROTO*) ;;
15097 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15099 echo "Prototype: $try" ;;
15102 *) case "$usethreads" in
15103 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15105 d_localtime_r=undef
15106 localtime_r_proto=0
15110 *) localtime_r_proto=0
15114 : see if localtime_r calls tzset
15115 case "$localtime_r_proto" in
15118 /* Does our libc's localtime_r call tzset ?
15119 * return 0 if so, 1 otherwise.
15121 #$i_systypes I_SYS_TYPES
15122 #$i_unistd I_UNISTD
15124 #$i_stdlib I_STDLIB
15125 #$i_string I_STRING
15126 #$i_malloc I_MALLOC
15128 # include <sys/types.h>
15131 # include <unistd.h>
15137 #include <stdlib.h>
15140 # include <string.h>
15142 # include <strings.h>
15145 # include <malloc.h>
15149 time_t t = time(0L);
15150 char w_tz[]="TZ" "=GMT+5",
15151 e_tz[]="TZ" "=GMT-5",
15152 *tz_e = (char*)malloc(16),
15153 *tz_w = (char*)malloc(16);
15154 struct tm tm_e, tm_w;
15155 memset(&tm_e,'\0',sizeof(struct tm));
15156 memset(&tm_w,'\0',sizeof(struct tm));
15161 localtime_r(&t, &tm_e);
15164 localtime_r(&t, &tm_w);
15166 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15172 if eval $compile; then
15173 if $run ./try; then
15174 d_localtime_r_needs_tzset=undef;
15176 d_localtime_r_needs_tzset=define;
15179 d_localtime_r_needs_tzset=undef;
15183 d_localtime_r_needs_tzset=undef;
15188 : see if localeconv exists
15189 set localeconv d_locconv
15192 : see if lockf exists
15196 : see if prototype for lseek is available
15198 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15201 : see if lstat exists
15205 : see if madvise exists
15206 set madvise d_madvise
15209 : see if malloc_size exists
15210 set malloc_size d_malloc_size
15213 : see if malloc_size_good exists
15214 set malloc_good_size d_malloc_good_size
15217 : see if mblen exists
15221 : see if mbstowcs exists
15222 set mbstowcs d_mbstowcs
15225 : see if mbtowc exists
15226 set mbtowc d_mbtowc
15229 : see if memchr exists
15230 set memchr d_memchr
15233 : see if memcmp exists
15234 set memcmp d_memcmp
15237 : see if memcpy exists
15238 set memcpy d_memcpy
15241 : see if memmove exists
15242 set memmove d_memmove
15245 : see if memset exists
15246 set memset d_memset
15249 : see if mkdir exists
15253 : see if mkdtemp exists
15254 set mkdtemp d_mkdtemp
15257 : see if mkfifo exists
15258 set mkfifo d_mkfifo
15261 : see if mkstemp exists
15262 set mkstemp d_mkstemp
15265 : see if mkstemps exists
15266 set mkstemps d_mkstemps
15269 : see if mktime exists
15270 set mktime d_mktime
15273 : see if this is a sys/mman.h system
15274 set sys/mman.h i_sysmman
15277 : see if mmap exists
15280 : see what shmat returns
15281 : default to something harmless
15283 case "$i_sysmman$d_mmap" in
15285 $cat >mmap.c <<'END'
15286 #include <sys/mman.h>
15289 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15294 echo "and it returns ($mmaptype)." >&4
15300 : see if sqrtl exists
15304 : see if scalbnl exists
15305 set scalbnl d_scalbnl
15308 : see if modfl exists
15312 : see if prototype for modfl is available
15314 set d_modflproto modfl $i_math math.h
15317 d_modfl_pow32_bug="$undef"
15319 case "$d_longdbl$d_modfl" in
15322 Checking to see whether your modfl() is okay for large values...
15328 if $test "X$d_modflproto" != "X$define"; then
15329 $cat >>try.c <<EOCP
15330 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15331 long double modfl (long double, long double *);
15334 $cat >>try.c <<EOCP
15336 long double nv = 4294967303.15;
15342 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15346 case "$osname:$gccversion" in
15347 aix:) saveccflags="$ccflags"
15348 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15351 if eval $compile; then
15354 *" 4294967303.150000 1.150000 4294967302.000000")
15355 echo >&4 "Your modfl() is broken for large values."
15356 d_modfl_pow32_bug="$define"
15358 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15362 *" 4294967303.150000 0.150000 4294967303.000000")
15363 echo >&4 "Your modfl() seems okay for large values."
15365 *) echo >&4 "I don't understand your modfl() at all."
15371 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15374 case "$osname:$gccversion" in
15375 aix:) ccflags="$saveccflags" ;; # restore
15380 if $test "$uselongdouble" = "$define"; then
15382 if $test "$d_sqrtl" != "$define"; then
15383 message="$message sqrtl"
15385 if $test "$d_modfl" != "$define"; then
15386 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15387 echo "You have both aintl and copysignl, so I can emulate modfl."
15389 message="$message modfl"
15392 if $test "$d_frexpl" != "$define"; then
15393 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15394 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15396 message="$message frexpl"
15400 if $test "$message" != ""; then
15403 *** You requested the use of long doubles but you do not seem to have
15404 *** the following mathematical functions needed for long double support:
15406 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15407 *** Cannot continue, aborting.
15415 : see if mprotect exists
15416 set mprotect d_mprotect
15419 : see if msgctl exists
15420 set msgctl d_msgctl
15423 : see if msgget exists
15424 set msgget d_msgget
15427 : see if msgsnd exists
15428 set msgsnd d_msgsnd
15431 : see if msgrcv exists
15432 set msgrcv d_msgrcv
15435 : see how much of the 'msg*(2)' library is present.
15438 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15439 *"$undef"*) h_msg=false;;
15443 case "`ipcs 2>&1`" in
15444 "SVID messages"*"not configured"*)
15445 echo "Your $osname does not have the msg*(2) configured." >&4
15448 set msgctl d_msgctl
15450 set msgget d_msgget
15452 set msgsnd d_msgsnd
15454 set msgrcv d_msgrcv
15460 : we could also check for sys/ipc.h ...
15461 if $h_msg && $test `./findhdr sys/msg.h`; then
15462 echo "You have the full msg*(2) library." >&4
15465 echo "You don't have the full msg*(2) library." >&4
15471 : Check for msghdr_s
15473 echo "Checking to see if your system supports struct msghdr..." >&4
15474 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15476 case "$d_msghdr_s" in
15477 "$define") echo "Yes, it does." ;;
15478 *) echo "No, it doesn't." ;;
15482 : see if msync exists
15486 : see if munmap exists
15487 set munmap d_munmap
15490 : see if nice exists
15494 : see if this is a langinfo.h system
15495 set langinfo.h i_langinfo
15498 : see if nl_langinfo exists
15499 set nl_langinfo d_nl_langinfo
15502 : check for volatile keyword
15504 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15505 $cat >try.c <<'EOCP'
15508 typedef struct _goo_struct goo_struct;
15509 goo_struct * volatile goo = ((goo_struct *)0);
15510 struct _goo_struct {
15515 typedef unsigned short foo_t;
15516 char *volatile foo;
15518 volatile foo_t blech;
15522 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15524 echo "Yup, it does."
15527 echo "Nope, it doesn't."
15533 : Check basic sizes
15535 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15537 case "$use64bitint:$d_quad:$quadtype" in
15540 uvtype="$uquadtype"
15545 uvtype="unsigned long"
15551 case "$uselongdouble:$d_longdbl" in
15553 nvtype="long double"
15554 nvsize=$longdblsize
15561 $echo "(IV will be "$ivtype", $ivsize bytes)"
15562 $echo "(UV will be "$uvtype", $uvsize bytes)"
15563 $echo "(NV will be "$nvtype", $nvsize bytes)"
15566 #$i_inttypes I_INTTYPES
15568 #include <inttypes.h>
15573 int8_t i = INT8_MAX;
15574 uint8_t u = UINT8_MAX;
15575 printf("int8_t\n");
15578 int16_t i = INT16_MAX;
15579 uint16_t i = UINT16_MAX;
15580 printf("int16_t\n");
15583 int32_t i = INT32_MAX;
15584 uint32_t u = UINT32_MAX;
15585 printf("int32_t\n");
15590 i8type="signed char"
15591 u8type="unsigned char"
15596 '') case "$shortsize" in
15598 u16type="unsigned short"
15606 '') set try -DINT16
15607 if eval $compile; then
15608 case "`$run ./try`" in
15620 '') if $test $shortsize -ge 2; then
15622 u16type="unsigned short"
15630 '') case "$longsize" in
15632 u32type="unsigned long"
15636 *) case "$intsize" in
15638 u32type="unsigned int"
15648 '') set try -DINT32
15649 if eval $compile; then
15650 case "`$run ./try`" in
15662 '') if $test $intsize -ge 4; then
15664 u32type="unsigned int"
15672 '') case "$d_quad:$quadtype" in
15674 i64type="$quadtype"
15675 u64type="$uquadtype"
15683 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15684 : volatile so that the compiler has to store it out to memory.
15685 if test X"$d_volatile" = X"$define"; then
15690 #$i_stdlib I_STDLIB
15692 #include <stdlib.h>
15694 #include <sys/types.h>
15695 #include <signal.h>
15697 $volatile int bletched = 0;
15698 $signal_t blech(int s) { bletched = 1; }
15703 int n = 8 * $uvsize;
15706 signal(SIGFPE, blech);
15709 for (i = 0; i < n; i++) {
15710 u = u << 1 | ($uvtype)1;
15712 if (($uvtype)d != u)
15716 d = ($nvtype)(u - 1);
15717 if (($uvtype)d != (u - 1))
15724 printf("%d\n", ((i == n) ? -n : i));
15730 d_nv_preserves_uv="$undef"
15731 if eval $compile; then
15732 nv_preserves_uv_bits="`$run ./try`"
15734 case "$nv_preserves_uv_bits" in
15736 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15737 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15738 d_nv_preserves_uv="$define"
15740 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15741 d_nv_preserves_uv="$undef" ;;
15742 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15743 nv_preserves_uv_bits="0" ;;
15747 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15748 : volatile so that the compiler has to store it out to memory.
15749 if test X"$d_volatile" = X"$define"; then
15755 typedef $nvtype NV;
15762 while(count < 256) {
15763 $volatile NV up = value + 1.0;
15764 $volatile NV negated = -value;
15765 $volatile NV down = negated - 1.0;
15766 $volatile NV got_up = up - value;
15767 int up_good = got_up == 1.0;
15768 int got_down = down - negated;
15769 int down_good = got_down == -1.0;
15771 if (down_good != up_good) {
15773 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15774 up_good, (double) got_up, down_good, (double) got_down,
15775 count, (double) value);
15782 fputs("256.0", stdout);
15785 fputs("2.0", stdout);
15791 fputs("*", stdout);
15797 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15798 count, (double) value);
15804 nv_overflows_integers_at='0'
15805 if eval $compile; then
15811 The largest integer your NVs can preserve is equal to $xxx
15813 nv_overflows_integers_at="$xxx"
15816 Cannot determine the largest integer value your NVs can hold, unexpected output
15823 Cannot determine the largest integer value your NVs can hold
15830 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15831 : volatile so that the compiler has to store it out to memory.
15832 if test X"$d_volatile" = X"$define"; then
15837 #$i_stdlib I_STDLIB
15839 #include <stdlib.h>
15841 #$i_string I_STRING
15843 # include <string.h>
15845 # include <strings.h>
15847 #include <sys/types.h>
15848 #include <signal.h>
15850 $volatile int bletched = 0;
15851 $signal_t blech(int s) { bletched = 1; }
15854 int checkit($nvtype d, char *where) {
15855 unsigned char *p = (char *)&d;
15856 unsigned char *end = p + sizeof(d);
15866 printf("No - %s: 0x", where);
15868 printf ("%02X", *p++);
15873 int main(int argc, char **argv) {
15876 fail += checkit(d, "0.0");
15878 /* The compiler shouldn't be assuming that bletched is 0 */
15881 fail += checkit(d, "bleched");
15884 signal(SIGFPE, blech);
15887 /* Paranoia - the compiler should have no way of knowing that ANSI says
15888 that argv[argc] will always be NULL. Actually, if it did assume this it
15889 would be buggy, as this is C and main() can be called from elsewhere in
15891 d = argv[argc] ? 1 : 0;
15894 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15897 fail += checkit(d, "ternary");
15899 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15902 printf("No - memset doesn't give 0.0\n");
15903 /* This might just blow up: */
15904 printf("(gives %g)\n", d);
15910 printf("No - something bleched\n");
15915 printf("No - %d fail(s)\n", fail);
15924 d_nv_zero_is_allbits_zero="$undef"
15925 if eval $compile; then
15931 0.0 is represented as all bits zero in memory
15933 d_nv_zero_is_allbits_zero="$define"
15936 0.0 is not represented as all bits zero in memory
15938 d_nv_zero_is_allbits_zero="$undef"
15943 0.0 is not represented as all bits zero in memory
15945 d_nv_zero_is_allbits_zero="$undef"
15951 : check for off64_t
15953 echo "Checking to see if you have off64_t..." >&4
15955 #include <sys/types.h>
15956 #include <unistd.h>
15957 int main() { off64_t x = 7; }
15960 if eval $compile; then
15962 echo "You have off64_t."
15965 echo "You do not have off64_t."
15966 case "$lseeksize" in
15967 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15974 : how to create joinable pthreads
15975 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15977 echo "Checking what constant to use for creating joinable pthreads..." >&4
15978 $cat >try.c <<'EOCP'
15979 #include <pthread.h>
15981 int detachstate = JOINABLE;
15984 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15985 if eval $compile; then
15986 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15987 val="$undef" # Yes, undef.
15988 set d_old_pthread_create_joinable
15991 set old_pthread_create_joinable
15994 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15995 if eval $compile; then
15996 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15998 set d_old_pthread_create_joinable
16000 val=PTHREAD_CREATE_UNDETACHED
16001 set old_pthread_create_joinable
16004 set try -DJOINABLE=__UNDETACHED
16005 if eval $compile; then
16006 echo "You seem to use __UNDETACHED." >&4
16008 set d_old_pthread_create_joinable
16011 set old_pthread_create_joinable
16014 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16016 set d_old_pthread_create_joinable
16019 set old_pthread_create_joinable
16026 d_old_pthread_create_joinable="$undef"
16027 old_pthread_create_joinable=""
16030 : see if pause exists
16034 : see if poll exists
16038 : see if readlink exists
16039 set readlink d_readlink
16042 : Check if exe is symlink to abs path of executing program
16046 case "$d_readlink" in
16048 if $issymlink /proc/self/exe ; then
16049 $ls -l /proc/self/exe > reflect
16050 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16051 echo "You have Linux-like /proc/self/exe."
16052 procselfexe='"/proc/self/exe"'
16056 if $issymlink /proc/curproc/file ; then
16057 $ls -l /proc/curproc/file > reflect
16058 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16059 echo "You have BSD-like /proc/curproc/file."
16060 procselfexe='"/proc/curproc/file"'
16070 : backward compatibility for d_hvfork
16071 if test X$d_hvfork != X; then
16072 d_vfork="$d_hvfork"
16075 : see if there is a vfork
16080 d_pseudofork=$undef
16082 : Ok, but do we want to use it. vfork is reportedly unreliable in
16083 : perl on Solaris 2.x, and probably elsewhere.
16087 case "$usevfork" in
16093 Perl can only use a vfork() that doesn't suffer from strict
16094 restrictions on calling functions or modifying global data in
16095 the child. For example, glibc-2.1 contains such a vfork()
16096 that is unsuitable. If your system provides a proper fork()
16097 call, chances are that you do NOT want perl to use vfork().
16100 rp="Do you still want to use vfork()?"
16105 echo "Ok, we won't use vfork()."
16114 $define) usevfork='true';;
16115 *) usevfork='false';;
16118 : see whether the pthread_atfork exists
16120 #include <pthread.h>
16123 #ifdef PTHREAD_ATFORK
16124 pthread_atfork(NULL,NULL,NULL);
16129 : see if pthread_atfork exists
16130 set try -DPTHREAD_ATFORK
16131 if eval $compile; then
16136 case "$usethreads" in
16139 $define) echo 'pthread_atfork found.' >&4 ;;
16140 *) echo 'pthread_atfork NOT found.' >&4 ;;
16143 set d_pthread_atfork
16146 : see if pthread_attr_setscope exists
16147 set pthread_attr_setscope d_pthread_attr_setscope
16150 : see whether the various POSIXish _yields exist
16152 #include <pthread.h>
16158 #ifdef PTHREAD_YIELD
16161 #ifdef PTHREAD_YIELD_NULL
16162 pthread_yield(NULL);
16168 : see if sched_yield exists
16169 set try -DSCHED_YIELD
16170 if eval $compile; then
16172 sched_yield='sched_yield()'
16176 case "$usethreads" in
16179 $define) echo 'sched_yield() found.' >&4 ;;
16180 *) echo 'sched_yield() NOT found.' >&4 ;;
16186 : see if pthread_yield exists
16187 set try -DPTHREAD_YIELD
16188 if eval $compile; then
16190 case "$sched_yield" in
16191 '') sched_yield='pthread_yield()' ;;
16194 set try -DPTHREAD_YIELD_NULL
16195 if eval $compile; then
16197 case "$sched_yield" in
16198 '') sched_yield='pthread_yield(NULL)' ;;
16204 case "$usethreads" in
16207 $define) echo 'pthread_yield() found.' >&4 ;;
16208 *) echo 'pthread_yield() NOT found.' >&4 ;;
16212 set d_pthread_yield
16214 case "$sched_yield" in
16215 '') sched_yield=undef ;;
16219 : see if random_r exists
16220 set random_r d_random_r
16222 case "$d_random_r" in
16224 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16225 case "$d_random_r_proto:$usethreads" in
16226 ":define") d_random_r_proto=define
16227 set d_random_r_proto random_r $hdrs
16231 case "$d_random_r_proto" in
16233 case "$random_r_proto" in
16234 ''|0) try='int random_r(int*, struct random_data*);'
16235 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16237 case "$random_r_proto" in
16238 ''|0) try='int random_r(long*, struct random_data*);'
16239 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16241 case "$random_r_proto" in
16242 ''|0) try='int random_r(struct random_data*, int32_t*);'
16243 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16245 case "$random_r_proto" in
16246 ''|0) d_random_r=undef
16248 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16249 * ) case "$random_r_proto" in
16250 REENTRANT_PROTO*) ;;
16251 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16253 echo "Prototype: $try" ;;
16256 *) case "$usethreads" in
16257 define) echo "random_r has no prototype, not using it." >&4 ;;
16264 *) random_r_proto=0
16268 : see if readdir and friends exist
16269 set readdir d_readdir
16271 set seekdir d_seekdir
16273 set telldir d_telldir
16275 set rewinddir d_rewinddir
16278 : see if readdir64_r exists
16279 set readdir64_r d_readdir64_r
16281 case "$d_readdir64_r" in
16283 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16284 case "$d_readdir64_r_proto:$usethreads" in
16285 ":define") d_readdir64_r_proto=define
16286 set d_readdir64_r_proto readdir64_r $hdrs
16290 case "$d_readdir64_r_proto" in
16292 case "$readdir64_r_proto" in
16293 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16294 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16296 case "$readdir64_r_proto" in
16297 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16298 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16300 case "$readdir64_r_proto" in
16301 ''|0) d_readdir64_r=undef
16302 readdir64_r_proto=0
16303 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16304 * ) case "$readdir64_r_proto" in
16305 REENTRANT_PROTO*) ;;
16306 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16308 echo "Prototype: $try" ;;
16311 *) case "$usethreads" in
16312 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16314 d_readdir64_r=undef
16315 readdir64_r_proto=0
16319 *) readdir64_r_proto=0
16323 : see if readdir_r exists
16324 set readdir_r d_readdir_r
16326 case "$d_readdir_r" in
16328 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16329 case "$d_readdir_r_proto:$usethreads" in
16330 ":define") d_readdir_r_proto=define
16331 set d_readdir_r_proto readdir_r $hdrs
16335 case "$d_readdir_r_proto" in
16337 case "$readdir_r_proto" in
16338 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16339 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16341 case "$readdir_r_proto" in
16342 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16343 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16345 case "$readdir_r_proto" in
16346 ''|0) d_readdir_r=undef
16348 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16349 * ) case "$readdir_r_proto" in
16350 REENTRANT_PROTO*) ;;
16351 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16353 echo "Prototype: $try" ;;
16356 *) case "$usethreads" in
16357 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16364 *) readdir_r_proto=0
16368 : see if readv exists
16372 : see if recvmsg exists
16373 set recvmsg d_recvmsg
16376 : see if rename exists
16377 set rename d_rename
16380 : see if rmdir exists
16384 : see if memory.h is available.
16389 : See if it conflicts with string.h
16395 $cppstdin $cppflags $cppminus < $strings > mem.h
16396 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16398 echo "We won't be including <memory.h>."
16408 : can bcopy handle overlapping blocks?
16411 case "$d_memmove" in
16412 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16413 *) case "$d_bcopy" in
16415 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16417 #$i_memory I_MEMORY
16418 #$i_stdlib I_STDLIB
16419 #$i_string I_STRING
16420 #$i_unistd I_UNISTD
16422 $cat >>try.c <<'EOCP'
16425 # include <memory.h>
16428 # include <stdlib.h>
16431 # include <string.h>
16433 # include <strings.h>
16436 # include <unistd.h> /* Needed for NetBSD */
16440 char buf[128], abc[128];
16446 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16447 try to store the string in read-only memory. */
16448 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16450 for (align = 7; align >= 0; align--) {
16451 for (len = 36; len; len--) {
16453 bcopy(abc, b, len);
16454 for (off = 1; off <= len; off++) {
16455 bcopy(b, b+off, len);
16456 bcopy(b+off, b, len);
16457 if (bcmp(b, abc, len))
16466 if eval $compile_ok; then
16467 if $run ./try 2>/dev/null; then
16468 echo "Yes, it can."
16471 echo "It can't, sorry."
16474 echo "(I can't compile the test program, so we'll assume not...)"
16484 : can memcpy handle overlapping blocks?
16487 case "$d_memmove" in
16488 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16489 *) case "$d_memcpy" in
16491 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16493 #$i_memory I_MEMORY
16494 #$i_stdlib I_STDLIB
16495 #$i_string I_STRING
16496 #$i_unistd I_UNISTD
16498 $cat >>try.c <<'EOCP'
16501 # include <memory.h>
16504 # include <stdlib.h>
16507 # include <string.h>
16509 # include <strings.h>
16512 # include <unistd.h> /* Needed for NetBSD */
16516 char buf[128], abc[128];
16522 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16523 try to store the string in read-only memory. */
16524 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16526 for (align = 7; align >= 0; align--) {
16527 for (len = 36; len; len--) {
16529 memcpy(b, abc, len);
16530 for (off = 1; off <= len; off++) {
16531 memcpy(b+off, b, len);
16532 memcpy(b, b+off, len);
16533 if (memcmp(b, abc, len))
16542 if eval $compile_ok; then
16543 if $run ./try 2>/dev/null; then
16544 echo "Yes, it can."
16547 echo "It can't, sorry."
16550 echo "(I can't compile the test program, so we'll assume not...)"
16560 : can memcmp be trusted to compare relative magnitude?
16562 case "$d_memcmp" in
16565 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16567 #$i_memory I_MEMORY
16568 #$i_stdlib I_STDLIB
16569 #$i_string I_STRING
16570 #$i_unistd I_UNISTD
16572 $cat >>try.c <<'EOCP'
16575 # include <memory.h>
16578 # include <stdlib.h>
16581 # include <string.h>
16583 # include <strings.h>
16586 # include <unistd.h> /* Needed for NetBSD */
16592 if ((a < b) && memcmp(&a, &b, 1) < 0)
16598 if eval $compile_ok; then
16599 if $run ./try 2>/dev/null; then
16600 echo "Yes, it can."
16603 echo "No, it can't (it uses signed chars)."
16606 echo "(I can't compile the test program, so we'll assume not...)"
16614 : see if prototype for sbrk is available
16616 set d_sbrkproto sbrk $i_unistd unistd.h
16619 : see if select exists
16620 set select d_select
16623 : see if semctl exists
16624 set semctl d_semctl
16627 : see if semget exists
16628 set semget d_semget
16631 : see if semop exists
16635 : see how much of the 'sem*(2)' library is present.
16638 case "$d_semctl$d_semget$d_semop" in
16639 *"$undef"*) h_sem=false;;
16643 case "`ipcs 2>&1`" in
16644 "SVID messages"*"not configured"*)
16645 echo "Your $osname does not have the sem*(2) configured." >&4
16648 set semctl d_semctl
16650 set semget d_semget
16658 : we could also check for sys/ipc.h ...
16659 if $h_sem && $test `./findhdr sys/sem.h`; then
16660 echo "You have the full sem*(2) library." >&4
16663 echo "You don't have the full sem*(2) library." >&4
16669 : see whether sys/sem.h defines union semun
16671 $cat > try.c <<'END'
16672 #include <sys/types.h>
16673 #include <sys/ipc.h>
16674 #include <sys/sem.h>
16675 int main () { union semun semun; semun.buf = 0; }
16678 if eval $compile; then
16679 echo "You have union semun in <sys/sem.h>." >&4
16682 echo "You do not have union semun in <sys/sem.h>." >&4
16689 : see how to do semctl IPC_STAT
16693 $cat > tryh.h <<END
16696 # define S_IRUSR S_IREAD
16697 # define S_IWUSR S_IWRITE
16698 # define S_IXUSR S_IEXEC
16700 # define S_IRUSR 0400
16701 # define S_IWUSR 0200
16702 # define S_IXUSR 0100
16704 # define S_IRGRP (S_IRUSR>>3)
16705 # define S_IWGRP (S_IWUSR>>3)
16706 # define S_IXGRP (S_IXUSR>>3)
16707 # define S_IROTH (S_IRUSR>>6)
16708 # define S_IWOTH (S_IWUSR>>6)
16709 # define S_IXOTH (S_IXUSR>>6)
16712 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16713 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16714 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16717 : see whether semctl IPC_STAT can use union semun
16718 case "$d_semctl_semun" in
16722 #include <sys/types.h>
16723 #include <sys/ipc.h>
16724 #include <sys/sem.h>
16725 #include <sys/stat.h>
16732 #$d_union_semun HAS_UNION_SEMUN
16735 #ifndef HAS_UNION_SEMUN
16738 struct semid_ds *buf;
16739 unsigned short *array;
16745 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16746 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16748 struct semid_ds argbuf;
16751 st = semctl(sem, 0, IPC_STAT, arg);
16755 # endif /* IPC_STAT */
16756 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16758 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16759 # endif /* IPC_RMID */
16760 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16762 #endif /* IPC_PRIVATE && ... */
16763 printf("semget failed: errno = %d\n", errno);
16768 if eval $compile; then
16771 semun) val="$define" ;;
16779 case "$d_semctl_semun" in
16781 echo "You can use union semun for semctl IPC_STAT." >&4
16784 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16789 : see whether semctl IPC_STAT can use struct semid_ds pointer
16790 case "$d_semctl_semid_ds" in
16793 $cat > try.c <<'END'
16794 #include <sys/types.h>
16795 #include <sys/ipc.h>
16796 #include <sys/sem.h>
16797 #include <sys/stat.h>
16805 struct semid_ds arg;
16808 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16809 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16812 st = semctl(sem, 0, IPC_STAT, &arg);
16814 printf("semid_ds\n");
16816 # endif /* IPC_STAT */
16817 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16819 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16820 # endif /* IPC_RMID */
16821 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16823 #endif /* IPC_PRIVATE && ... */
16824 printf("semget failed: errno = %d\n", errno);
16830 if eval $compile; then
16833 semid_ds) val="$define" ;;
16837 set d_semctl_semid_ds
16841 case "$d_semctl_semid_ds" in
16843 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16845 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16851 # We do not have the full sem*(2) library, so assume we can not
16857 set d_semctl_semid_ds
16863 : see if sendmsg exists
16864 set sendmsg d_sendmsg
16867 : see if setegid exists
16868 set setegid d_setegid
16871 : see if seteuid exists
16872 set seteuid d_seteuid
16875 : see if setgrent exists
16876 set setgrent d_setgrent
16879 : see if setgrent_r exists
16880 set setgrent_r d_setgrent_r
16882 case "$d_setgrent_r" in
16884 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16885 case "$d_setgrent_r_proto:$usethreads" in
16886 ":define") d_setgrent_r_proto=define
16887 set d_setgrent_r_proto setgrent_r $hdrs
16891 case "$d_setgrent_r_proto" in
16893 case "$setgrent_r_proto" in
16894 ''|0) try='int setgrent_r(FILE**);'
16895 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16897 case "$setgrent_r_proto" in
16898 ''|0) try='void setgrent_r(FILE**);'
16899 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16901 case "$setgrent_r_proto" in
16902 ''|0) d_setgrent_r=undef
16904 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16905 * ) case "$setgrent_r_proto" in
16906 REENTRANT_PROTO*) ;;
16907 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16909 echo "Prototype: $try" ;;
16912 *) case "$usethreads" in
16913 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16920 *) setgrent_r_proto=0
16924 : see if sethostent exists
16925 set sethostent d_sethent
16928 : see if sethostent_r exists
16929 set sethostent_r d_sethostent_r
16931 case "$d_sethostent_r" in
16933 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16934 case "$d_sethostent_r_proto:$usethreads" in
16935 ":define") d_sethostent_r_proto=define
16936 set d_sethostent_r_proto sethostent_r $hdrs
16940 case "$d_sethostent_r_proto" in
16942 case "$sethostent_r_proto" in
16943 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16944 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16946 case "$sethostent_r_proto" in
16947 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16948 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16950 case "$sethostent_r_proto" in
16951 ''|0) d_sethostent_r=undef
16952 sethostent_r_proto=0
16953 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16954 * ) case "$sethostent_r_proto" in
16955 REENTRANT_PROTO*) ;;
16956 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16958 echo "Prototype: $try" ;;
16961 *) case "$usethreads" in
16962 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16964 d_sethostent_r=undef
16965 sethostent_r_proto=0
16969 *) sethostent_r_proto=0
16973 : see if setitimer exists
16974 set setitimer d_setitimer
16977 : see if setlinebuf exists
16978 set setlinebuf d_setlinebuf
16981 : see if setlocale exists
16982 set setlocale d_setlocale
16985 : see if locale.h is available
16986 set locale.h i_locale
16989 : see if setlocale_r exists
16990 set setlocale_r d_setlocale_r
16992 case "$d_setlocale_r" in
16994 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16995 case "$d_setlocale_r_proto:$usethreads" in
16996 ":define") d_setlocale_r_proto=define
16997 set d_setlocale_r_proto setlocale_r $hdrs
17001 case "$d_setlocale_r_proto" in
17003 case "$setlocale_r_proto" in
17004 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17005 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17007 case "$setlocale_r_proto" in
17008 ''|0) d_setlocale_r=undef
17009 setlocale_r_proto=0
17010 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17011 * ) case "$setlocale_r_proto" in
17012 REENTRANT_PROTO*) ;;
17013 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17015 echo "Prototype: $try" ;;
17018 *) case "$usethreads" in
17019 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17021 d_setlocale_r=undef
17022 setlocale_r_proto=0
17026 *) setlocale_r_proto=0
17030 : see if setnetent exists
17031 set setnetent d_setnent
17034 : see if setnetent_r exists
17035 set setnetent_r d_setnetent_r
17037 case "$d_setnetent_r" in
17039 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17040 case "$d_setnetent_r_proto:$usethreads" in
17041 ":define") d_setnetent_r_proto=define
17042 set d_setnetent_r_proto setnetent_r $hdrs
17046 case "$d_setnetent_r_proto" in
17048 case "$setnetent_r_proto" in
17049 ''|0) try='int setnetent_r(int, struct netent_data*);'
17050 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17052 case "$setnetent_r_proto" in
17053 ''|0) try='void setnetent_r(int, struct netent_data*);'
17054 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17056 case "$setnetent_r_proto" in
17057 ''|0) d_setnetent_r=undef
17058 setnetent_r_proto=0
17059 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17060 * ) case "$setnetent_r_proto" in
17061 REENTRANT_PROTO*) ;;
17062 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17064 echo "Prototype: $try" ;;
17067 *) case "$usethreads" in
17068 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17070 d_setnetent_r=undef
17071 setnetent_r_proto=0
17075 *) setnetent_r_proto=0
17079 : see if setprotoent exists
17080 set setprotoent d_setpent
17083 : see if setpgid exists
17084 set setpgid d_setpgid
17087 : see if setpgrp2 exists
17088 set setpgrp2 d_setpgrp2
17091 : see if setpriority exists
17092 set setpriority d_setprior
17095 : see if setproctitle exists
17096 set setproctitle d_setproctitle
17099 : see if setprotoent_r exists
17100 set setprotoent_r d_setprotoent_r
17102 case "$d_setprotoent_r" in
17104 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17105 case "$d_setprotoent_r_proto:$usethreads" in
17106 ":define") d_setprotoent_r_proto=define
17107 set d_setprotoent_r_proto setprotoent_r $hdrs
17111 case "$d_setprotoent_r_proto" in
17113 case "$setprotoent_r_proto" in
17114 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17115 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17117 case "$setprotoent_r_proto" in
17118 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17119 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17121 case "$setprotoent_r_proto" in
17122 ''|0) d_setprotoent_r=undef
17123 setprotoent_r_proto=0
17124 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17125 * ) case "$setprotoent_r_proto" in
17126 REENTRANT_PROTO*) ;;
17127 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17129 echo "Prototype: $try" ;;
17132 *) case "$usethreads" in
17133 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17135 d_setprotoent_r=undef
17136 setprotoent_r_proto=0
17140 *) setprotoent_r_proto=0
17144 : see if setpwent exists
17145 set setpwent d_setpwent
17148 : see if setpwent_r exists
17149 set setpwent_r d_setpwent_r
17151 case "$d_setpwent_r" in
17153 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17154 case "$d_setpwent_r_proto:$usethreads" in
17155 ":define") d_setpwent_r_proto=define
17156 set d_setpwent_r_proto setpwent_r $hdrs
17160 case "$d_setpwent_r_proto" in
17162 case "$setpwent_r_proto" in
17163 ''|0) try='int setpwent_r(FILE**);'
17164 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17166 case "$setpwent_r_proto" in
17167 ''|0) try='void setpwent_r(FILE**);'
17168 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17170 case "$setpwent_r_proto" in
17171 ''|0) d_setpwent_r=undef
17173 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17174 * ) case "$setpwent_r_proto" in
17175 REENTRANT_PROTO*) ;;
17176 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17178 echo "Prototype: $try" ;;
17181 *) case "$usethreads" in
17182 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17189 *) setpwent_r_proto=0
17193 : see if setregid exists
17194 set setregid d_setregid
17196 set setresgid d_setresgid
17199 : see if setreuid exists
17200 set setreuid d_setreuid
17202 set setresuid d_setresuid
17205 : see if setrgid exists
17206 set setrgid d_setrgid
17209 : see if setruid exists
17210 set setruid d_setruid
17213 : see if setservent exists
17214 set setservent d_setsent
17217 : see if setservent_r exists
17218 set setservent_r d_setservent_r
17220 case "$d_setservent_r" in
17222 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17223 case "$d_setservent_r_proto:$usethreads" in
17224 ":define") d_setservent_r_proto=define
17225 set d_setservent_r_proto setservent_r $hdrs
17229 case "$d_setservent_r_proto" in
17231 case "$setservent_r_proto" in
17232 ''|0) try='int setservent_r(int, struct servent_data*);'
17233 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17235 case "$setservent_r_proto" in
17236 ''|0) try='void setservent_r(int, struct servent_data*);'
17237 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17239 case "$setservent_r_proto" in
17240 ''|0) d_setservent_r=undef
17241 setservent_r_proto=0
17242 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17243 * ) case "$setservent_r_proto" in
17244 REENTRANT_PROTO*) ;;
17245 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17247 echo "Prototype: $try" ;;
17250 *) case "$usethreads" in
17251 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17253 d_setservent_r=undef
17254 setservent_r_proto=0
17258 *) setservent_r_proto=0
17262 : see if setsid exists
17263 set setsid d_setsid
17266 : see if setvbuf exists
17267 set setvbuf d_setvbuf
17270 : see if sfio.h is available
17274 : see if sfio library is available
17285 : Ok, but do we want to use it.
17289 true|$define|[yY]*) dflt='y';;
17292 echo "$package can use the sfio library, but it is experimental."
17293 case "$useperlio" in
17295 echo "For sfio also the PerlIO abstraction layer is needed."
17296 echo "Earlier you said you wouldn't want that."
17299 rp="You seem to have sfio available, do you want to try using it?"
17302 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17303 useperlio="$define"
17306 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17311 *) case "$usesfio" in
17312 true|$define|[yY]*)
17313 echo "Sorry, cannot find sfio on this machine." >&4
17314 echo "Ignoring your setting of usesfio=$usesfio." >&4
17323 $define) usesfio='true';;
17324 *) usesfio='false';;
17328 *) : Remove sfio from list of libraries to use
17331 echo "Removing unneeded -lsfio from library list" >&4
17332 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17335 echo "libs = $libs" >&4
17342 : see if shmctl exists
17343 set shmctl d_shmctl
17346 : see if shmget exists
17347 set shmget d_shmget
17350 : see if shmat exists
17353 : see what shmat returns
17356 $cat >shmat.c <<'END'
17357 #include <sys/shm.h>
17360 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17365 echo "and it returns ($shmattype)." >&4
17366 : see if a prototype for shmat is available
17367 xxx=`./findhdr sys/shm.h`
17368 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17369 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17380 set d_shmatprototype
17383 : see if shmdt exists
17387 : see how much of the 'shm*(2)' library is present.
17390 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17391 *"$undef"*) h_shm=false;;
17395 case "`ipcs 2>&1`" in
17396 "SVID shared memory"*"not configured"*)
17397 echo "Your $osname does not have the shm*(2) configured." >&4
17400 set shmctl d_shmctl
17402 set shmget d_shmget
17412 : we could also check for sys/ipc.h ...
17413 if $h_shm && $test `./findhdr sys/shm.h`; then
17414 echo "You have the full shm*(2) library." >&4
17417 echo "You don't have the full shm*(2) library." >&4
17423 : see if we have sigaction
17425 if set sigaction val -f d_sigaction; eval $csym; $val; then
17426 echo 'sigaction() found.' >&4
17429 #include <sys/types.h>
17430 #include <signal.h>
17431 #$i_stdlib I_STDLIB
17433 #include <stdlib.h>
17437 struct sigaction act, oact;
17439 oact.sa_handler = 0;
17440 /* so that act and oact are used */
17441 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17445 if eval $compile_ok; then
17448 echo "But you don't seem to have a useable struct sigaction." >&4
17452 echo 'sigaction NOT found.' >&4
17455 set d_sigaction; eval $setvar
17458 : see if this is a sunmath.h system
17459 set sunmath.h i_sunmath
17462 : see if signbit exists
17463 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17466 #$i_sunmath I_SUNMATH
17470 #ifdef I_SUNMATH /* Solaris special math library */
17471 # include <sunmath.h>
17474 int main(int argc, char **argv)
17478 if ((signbit(x) == 0) && (signbit(y) != 0))
17486 if eval $compile; then
17487 if $run ./try; then
17491 $echo "Signbit seems to be available, but doesn't work as I expected."
17492 $echo "I won't use it." >&4
17503 : see if sigprocmask exists
17504 set sigprocmask d_sigprocmask
17507 : see if sigsetjmp exists
17509 case "$d_sigsetjmp" in
17512 #include <setjmp.h>
17513 #$i_stdlib I_STDLIB
17515 #include <stdlib.h>
17521 if (sigsetjmp(env,1))
17524 siglongjmp(env, 1);
17529 if eval $compile; then
17530 if $run ./try >/dev/null 2>&1; then
17531 echo "POSIX sigsetjmp found." >&4
17535 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17541 echo "sigsetjmp not found." >&4
17545 *) val="$d_sigsetjmp"
17546 case "$d_sigsetjmp" in
17547 $define) echo "POSIX sigsetjmp found." >&4;;
17548 $undef) echo "sigsetjmp not found." >&4;;
17556 : see if snprintf exists
17557 set snprintf d_snprintf
17560 : see if vsnprintf exists
17561 set vsnprintf d_vsnprintf
17564 case "$d_snprintf-$d_vsnprintf" in
17567 Checking whether your snprintf() and vsnprintf() work okay...
17569 $cat >try.c <<'EOCP'
17570 /* v?snprintf testing logic courtesy of Russ Allbery.
17571 * According to C99:
17572 * - if the buffer is too short it still must be \0-terminated
17573 * - if the buffer is too short the potentially required length
17574 * must be returned and not -1
17575 * - if the buffer is NULL the potentially required length
17576 * must be returned and not -1 or core dump
17579 #include <stdarg.h>
17583 int test (char *format, ...)
17588 va_start (args, format);
17589 count = vsnprintf (buf, sizeof buf, format, args);
17596 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17597 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17601 if eval $compile; then
17604 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17606 Your snprintf() and snprintf() don't seem to be working okay.
17608 d_snprintf="$undef"
17609 d_vsnprintf="$undef"
17613 echo "(I can't seem to compile the test program--assuming they don't)"
17614 d_snprintf="$undef"
17615 d_vsnprintf="$undef"
17621 : see if sockatmark exists
17622 set sockatmark d_sockatmark
17625 : see if prototype for sockatmark is available
17627 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17630 : see if socks5_init exists
17631 set socks5_init d_socks5_init
17634 : see if sprintf returns the length of the string in the buffer as per ANSI
17635 $echo "Checking whether sprintf returns the length of the string..." >&4
17638 #$i_stdlib I_STDLIB
17640 #include <stdlib.h>
17642 #$i_string I_STRING
17644 # include <string.h>
17646 # include <strings.h>
17655 int check (size_t expect, int test) {
17656 size_t got = strlen(buffer);
17660 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17665 int main(int argc, char **argv) {
17668 check(sprintf(buffer, ""), ++test);
17669 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17670 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17677 if eval $compile; then
17681 sprintf returns the length of the string (as ANSI says it should)
17683 d_sprintf_returns_strlen="$define"
17686 sprintf does not return the length of the string (how old is this system?)
17688 d_sprintf_returns_strlen="$undef"
17692 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17693 d_sprintf_returns_strlen="$undef"
17697 : see if srand48_r exists
17698 set srand48_r d_srand48_r
17700 case "$d_srand48_r" in
17702 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17703 case "$d_srand48_r_proto:$usethreads" in
17704 ":define") d_srand48_r_proto=define
17705 set d_srand48_r_proto srand48_r $hdrs
17709 case "$d_srand48_r_proto" in
17711 case "$srand48_r_proto" in
17712 ''|0) try='int srand48_r(long, struct drand48_data*);'
17713 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17715 case "$srand48_r_proto" in
17716 ''|0) d_srand48_r=undef
17718 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17719 * ) case "$srand48_r_proto" in
17720 REENTRANT_PROTO*) ;;
17721 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17723 echo "Prototype: $try" ;;
17726 *) case "$usethreads" in
17727 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17734 *) srand48_r_proto=0
17738 : see if srandom_r exists
17739 set srandom_r d_srandom_r
17741 case "$d_srandom_r" in
17743 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17744 case "$d_srandom_r_proto:$usethreads" in
17745 ":define") d_srandom_r_proto=define
17746 set d_srandom_r_proto srandom_r $hdrs
17750 case "$d_srandom_r_proto" in
17752 case "$srandom_r_proto" in
17753 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17754 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17756 case "$srandom_r_proto" in
17757 ''|0) d_srandom_r=undef
17759 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17760 * ) case "$srandom_r_proto" in
17761 REENTRANT_PROTO*) ;;
17762 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17764 echo "Prototype: $try" ;;
17767 *) case "$usethreads" in
17768 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17775 *) srandom_r_proto=0
17779 : see if prototype for setresgid is available
17781 set d_sresgproto setresgid $i_unistd unistd.h
17784 : see if prototype for setresuid is available
17786 set d_sresuproto setresuid $i_unistd unistd.h
17789 : see if sys/stat.h is available
17790 set sys/stat.h i_sysstat
17793 : see if stat knows about block sizes
17795 echo "Checking to see if your struct stat has st_blocks field..." >&4
17796 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17799 : see if this is a sys/vfs.h system
17800 set sys/vfs.h i_sysvfs
17803 : see if this is a sys/statfs.h system
17804 set sys/statfs.h i_sysstatfs
17807 : Check for statfs_s
17809 echo "Checking to see if your system supports struct statfs..." >&4
17810 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
17812 case "$d_statfs_s" in
17813 "$define") echo "Yes, it does." ;;
17814 *) echo "No, it doesn't." ;;
17818 : see if struct statfs knows about f_flags
17819 case "$d_statfs_s" in
17822 echo "Checking to see if your struct statfs has f_flags field..." >&4
17823 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
17827 set d_statfs_f_flags
17831 case "$d_statfs_f_flags" in
17832 "$define") echo "Yes, it does." ;;
17833 *) echo "No, it doesn't." ;;
17836 : Check stream access
17838 Checking how to access stdio streams by file descriptor number...
17840 case "$stdio_stream_array" in
17841 '') $cat >try.c <<EOCP
17844 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17848 for s in _iob __iob __sF
17850 set try -DSTDIO_STREAM_ARRAY=$s
17851 if eval $compile; then
17852 case "`$run ./try`" in
17853 yes) stdio_stream_array=$s; break ;;
17859 case "$stdio_stream_array" in
17861 I can't figure out how to access stdio streams by file descriptor number.
17863 d_stdio_stream_array="$undef"
17866 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17868 d_stdio_stream_array="$define"
17872 : see if strcoll exists
17873 set strcoll d_strcoll
17876 : check for structure copying
17878 echo "Checking to see if your C compiler can copy structs..." >&4
17879 $cat >try.c <<'EOCP'
17889 if $cc -c try.c >/dev/null 2>&1 ; then
17891 echo "Yup, it can."
17894 echo "Nope, it can't."
17900 : see if strerror and/or sys_errlist[] exist
17902 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17903 if set strerror val -f d_strerror; eval $csym; $val; then
17904 echo 'strerror() found.' >&4
17905 d_strerror="$define"
17906 d_strerrm='strerror(e)'
17907 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17908 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17909 d_syserrlst="$define"
17911 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17912 d_syserrlst="$undef"
17914 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17915 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17916 echo 'strerror() found in string header.' >&4
17917 d_strerror="$define"
17918 d_strerrm='strerror(e)'
17919 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17920 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17921 d_syserrlst="$define"
17923 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17924 d_syserrlst="$undef"
17926 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17927 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17928 d_strerror="$undef"
17929 d_syserrlst="$define"
17930 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17932 echo 'strerror() and sys_errlist[] NOT found.' >&4
17933 d_strerror="$undef"
17934 d_syserrlst="$undef"
17935 d_strerrm='"unknown"'
17939 : see if strerror_r exists
17940 set strerror_r d_strerror_r
17942 case "$d_strerror_r" in
17944 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17945 case "$d_strerror_r_proto:$usethreads" in
17946 ":define") d_strerror_r_proto=define
17947 set d_strerror_r_proto strerror_r $hdrs
17951 case "$d_strerror_r_proto" in
17953 case "$strerror_r_proto" in
17954 ''|0) try='int strerror_r(int, char*, size_t);'
17955 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
17957 case "$strerror_r_proto" in
17958 ''|0) try='int strerror_r(int, char*, int);'
17959 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
17961 case "$strerror_r_proto" in
17962 ''|0) try='char* strerror_r(int, char*, size_t);'
17963 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
17965 case "$strerror_r_proto" in
17966 ''|0) d_strerror_r=undef
17968 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17969 * ) case "$strerror_r_proto" in
17970 REENTRANT_PROTO*) ;;
17971 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17973 echo "Prototype: $try" ;;
17976 *) case "$usethreads" in
17977 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17984 *) strerror_r_proto=0
17988 : see if strftime exists
17989 set strftime d_strftime
17992 : see if strlcat exists
17993 set strlcat d_strlcat
17996 : see if strlcpy exists
17997 set strlcpy d_strlcpy
18000 : see if strtod exists
18001 set strtod d_strtod
18004 : see if strtol exists
18005 set strtol d_strtol
18008 : see if strtold exists
18009 set strtold d_strtold
18012 : see if strtoll exists
18013 set strtoll d_strtoll
18016 case "$d_longlong-$d_strtoll" in
18019 Checking whether your strtoll() works okay...
18021 $cat >try.c <<'EOCP'
18024 #define strtoll __strtoll
18027 #define strtoll _strtoll
18030 extern long long int strtoll(char *s, char **, int);
18031 static int bad = 0;
18032 int check(char *s, long long ell, int een) {
18035 gll = strtoll(s, 0, 10);
18036 if (!((gll == ell) && (errno == een)))
18040 check(" 1", 1LL, 0);
18041 check(" 0", 0LL, 0);
18042 check("-1", -1LL, 0);
18043 check("-9223372036854775808", -9223372036854775808LL, 0);
18044 check("-9223372036854775808", -9223372036854775808LL, 0);
18045 check(" 9223372036854775807", 9223372036854775807LL, 0);
18046 check("-9223372036854775808", -9223372036854775808LL, 0);
18047 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18048 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18054 if eval $compile; then
18057 ok) echo "Your strtoll() seems to be working okay." ;;
18059 Your strtoll() doesn't seem to be working okay.
18065 echo "(I can't seem to compile the test program--assuming it doesn't)"
18071 : see if strtoq exists
18072 set strtoq d_strtoq
18075 : see if strtoul exists
18076 set strtoul d_strtoul
18079 case "$d_strtoul" in
18082 Checking whether your strtoul() works okay...
18084 $cat >try.c <<'EOCP'
18087 extern unsigned long int strtoul(char *s, char **, int);
18088 static int bad = 0;
18089 void check(char *s, unsigned long eul, int een) {
18092 gul = strtoul(s, 0, 10);
18093 if (!((gul == eul) && (errno == een)))
18097 check(" 1", 1L, 0);
18098 check(" 0", 0L, 0);
18100 case "$longsize" in
18102 $cat >>try.c <<'EOCP'
18103 check("18446744073709551615", 18446744073709551615UL, 0);
18104 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18105 #if 0 /* strtoul() for /^-/ strings is undefined. */
18106 check("-1", 18446744073709551615UL, 0);
18107 check("-18446744073709551614", 2, 0);
18108 check("-18446744073709551615", 1, 0);
18109 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18110 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18115 $cat >>try.c <<'EOCP'
18116 check("4294967295", 4294967295UL, 0);
18117 check("4294967296", 4294967295UL, ERANGE);
18118 #if 0 /* strtoul() for /^-/ strings is undefined. */
18119 check("-1", 4294967295UL, 0);
18120 check("-4294967294", 2, 0);
18121 check("-4294967295", 1, 0);
18122 check("-4294967296", 4294967295UL, ERANGE);
18123 check("-4294967297", 4294967295UL, ERANGE);
18128 : Should we write these tests to be more portable by sprintf-ing
18129 : ~0 and then manipulating that char string as input for strtol?
18132 $cat >>try.c <<'EOCP'
18139 if eval $compile; then
18140 case "`$run ./try`" in
18141 ok) echo "Your strtoul() seems to be working okay." ;;
18143 Your strtoul() doesn't seem to be working okay.
18149 echo "(I can't seem to compile the test program--assuming it doesn't)"
18155 : see if strtoull exists
18156 set strtoull d_strtoull
18159 case "$d_longlong-$d_strtoull" in
18162 Checking whether your strtoull() works okay...
18164 $cat >try.c <<'EOCP'
18167 #define strtoull __strtoull
18170 extern unsigned long long int strtoull(char *s, char **, int);
18171 static int bad = 0;
18172 int check(char *s, long long eull, int een) {
18175 gull = strtoull(s, 0, 10);
18176 if (!((gull == eull) && (errno == een)))
18180 check(" 1", 1LL, 0);
18181 check(" 0", 0LL, 0);
18182 check("18446744073709551615", 18446744073709551615ULL, 0);
18183 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18184 #if 0 /* strtoull() for /^-/ strings is undefined. */
18185 check("-1", 18446744073709551615ULL, 0);
18186 check("-18446744073709551614", 2LL, 0);
18187 check("-18446744073709551615", 1LL, 0);
18188 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18189 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18196 if eval $compile; then
18197 case "`$run ./try`" in
18198 ok) echo "Your strtoull() seems to be working okay." ;;
18200 Your strtoull() doesn't seem to be working okay.
18202 d_strtoull="$undef"
18206 echo "(I can't seem to compile the test program--assuming it doesn't)"
18207 d_strtoull="$undef"
18212 : see if strtouq exists
18213 set strtouq d_strtouq
18216 case "$d_strtouq" in
18219 Checking whether your strtouq() works okay...
18221 $cat >try.c <<'EOCP'
18224 extern unsigned long long int strtouq(char *s, char **, int);
18225 static int bad = 0;
18226 void check(char *s, unsigned long long eull, int een) {
18227 unsigned long long gull;
18229 gull = strtouq(s, 0, 10);
18230 if (!((gull == eull) && (errno == een)))
18234 check(" 1", 1LL, 0);
18235 check(" 0", 0LL, 0);
18236 check("18446744073709551615", 18446744073709551615ULL, 0);
18237 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18238 #if 0 /* strtouq() for /^-/ strings is undefined. */
18239 check("-1", 18446744073709551615ULL, 0);
18240 check("-18446744073709551614", 2LL, 0);
18241 check("-18446744073709551615", 1LL, 0);
18242 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18243 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18251 if eval $compile; then
18252 case "`$run ./try`" in
18253 ok) echo "Your strtouq() seems to be working okay." ;;
18255 Your strtouq() doesn't seem to be working okay.
18261 echo "(I can't seem to compile the test program--assuming it doesn't)"
18267 : see if strxfrm exists
18268 set strxfrm d_strxfrm
18271 : see if symlink exists
18272 set symlink d_symlink
18275 : see if syscall exists
18276 set syscall d_syscall
18279 : see if prototype for syscall is available
18281 set d_syscallproto syscall $i_unistd unistd.h
18284 : see if sysconf exists
18285 set sysconf d_sysconf
18288 : see if system exists
18289 set system d_system
18292 : see if tcgetpgrp exists
18293 set tcgetpgrp d_tcgetpgrp
18296 : see if tcsetpgrp exists
18297 set tcsetpgrp d_tcsetpgrp
18300 : see if prototype for telldir is available
18302 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18305 : see if time exists
18307 if test "X$d_time" = X -o X"$timetype" = X; then
18308 if set time val -f d_time; eval $csym; $val; then
18309 echo 'time() found.' >&4
18311 rp="What is the type returned by time() on this system?"
18312 set time_t timetype long stdio.h sys/types.h
18315 echo 'time() not found, hope that will do.' >&4
18323 : see if timegm exists
18324 set timegm d_timegm
18327 : see if this is a sys/times.h system
18328 set sys/times.h i_systimes
18331 : see if times exists
18333 if set times val -f d_times; eval $csym; $val; then
18334 echo 'times() found.' >&4
18337 case "$i_systimes" in
18338 "$define") inc='sys/times.h';;
18340 rp="What is the type returned by times() on this system?"
18341 set clock_t clocktype long stdio.h sys/types.h $inc
18344 echo 'times() NOT found, hope that will do.' >&4
18349 : see if tmpnam_r exists
18350 set tmpnam_r d_tmpnam_r
18352 case "$d_tmpnam_r" in
18354 hdrs="$i_systypes sys/types.h define stdio.h "
18355 case "$d_tmpnam_r_proto:$usethreads" in
18356 ":define") d_tmpnam_r_proto=define
18357 set d_tmpnam_r_proto tmpnam_r $hdrs
18361 case "$d_tmpnam_r_proto" in
18363 case "$tmpnam_r_proto" in
18364 ''|0) try='char* tmpnam_r(char*);'
18365 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18367 case "$tmpnam_r_proto" in
18368 ''|0) d_tmpnam_r=undef
18370 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18371 * ) case "$tmpnam_r_proto" in
18372 REENTRANT_PROTO*) ;;
18373 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18375 echo "Prototype: $try" ;;
18378 *) case "$usethreads" in
18379 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18386 *) tmpnam_r_proto=0
18390 : see if truncate exists
18391 set truncate d_truncate
18394 : see if ttyname_r exists
18395 set ttyname_r d_ttyname_r
18397 case "$d_ttyname_r" in
18399 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18400 case "$d_ttyname_r_proto:$usethreads" in
18401 ":define") d_ttyname_r_proto=define
18402 set d_ttyname_r_proto ttyname_r $hdrs
18406 case "$d_ttyname_r_proto" in
18408 case "$ttyname_r_proto" in
18409 ''|0) try='int ttyname_r(int, char*, size_t);'
18410 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18412 case "$ttyname_r_proto" in
18413 ''|0) try='int ttyname_r(int, char*, int);'
18414 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18416 case "$ttyname_r_proto" in
18417 ''|0) try='char* ttyname_r(int, char*, int);'
18418 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18420 case "$ttyname_r_proto" in
18421 ''|0) d_ttyname_r=undef
18423 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18424 * ) case "$ttyname_r_proto" in
18425 REENTRANT_PROTO*) ;;
18426 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18428 echo "Prototype: $try" ;;
18431 *) case "$usethreads" in
18432 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18439 *) ttyname_r_proto=0
18443 : see if tzname[] exists
18445 if set tzname val -a d_tzname; eval $csym; $val; then
18447 echo 'tzname[] found.' >&4
18450 echo 'tzname[] NOT found.' >&4
18455 : Check if is a multiplatform env
18457 next|rhapsody|darwin) multiarch="$define" ;;
18459 case "$multiarch" in
18460 ''|[nN]*) multiarch="$undef" ;;
18463 : check for ordering of bytes in a UV
18465 case "$usecrosscompile$multiarch" in
18468 You seem to be either cross-compiling or doing a multiarchitecture build,
18469 skipping the byteorder check.
18475 case "$byteorder" in
18478 In the following, larger digits indicate more significance. A big-endian
18479 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18480 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18481 machines may have weird orders like 3412. A Cray will report 87654321,
18482 an Alpha will report 12345678. If the test program works the default is
18484 I'm now running the test program...
18488 #$i_stdlib I_STDLIB
18490 #include <stdlib.h>
18492 #include <sys/types.h>
18493 typedef $uvtype UV;
18503 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18505 u.l = (UV)0x04030201;
18506 for (i = 0; i < $uvsize; i++)
18507 printf("%c", u.c[i]+'0');
18514 if eval $compile && $run ./try > /dev/null; then
18517 [1-4][1-4][1-4][1-4]|12345678|87654321)
18518 echo "(The test program ran ok.)"
18519 echo "byteorder=$dflt"
18522 ????|????????) echo "(The test program ran ok.)" ;;
18523 *) echo "(The test program didn't run right for some reason.)" ;;
18528 (I can't seem to compile the test program. Guessing big-endian...)
18531 case "$xxx_prompt" in
18533 rp="What is the order of bytes in $uvtype?"
18546 : Checking 32bit aligndness
18549 Checking to see whether you can access character data unalignedly...
18551 case "$d_u32align" in
18552 '') $cat >try.c <<EOCP
18554 #$i_stdlib I_STDLIB
18556 #include <stdlib.h>
18558 #define U32 $u32type
18559 #define BYTEORDER 0x$byteorder
18561 #include <signal.h>
18563 $signal_t bletch(int s) { exit(4); }
18566 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18571 if (sizeof(U32) != 4) {
18572 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18579 signal(SIGBUS, bletch);
18591 for (i = 0; i < 4; i++) {
18592 up = (U32*)(buf + i);
18593 if (! ((*up == 1 << (8*i)) || /* big-endian */
18594 (*up == 1 << (8*(3-i))) /* little-endian */
18598 printf("read failed (%x)\n", *up);
18604 for (i = 0; i < 4; i++) {
18605 up = (U32*)(buf + i);
18607 if (*up != 0xBeef) {
18608 printf("write failed (%x)\n", *up);
18622 if eval $compile_ok; then
18623 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18624 $run ./try 2>&1 >/dev/null
18627 You can access character data pretty unalignedly.
18629 d_u32align="$undef"
18632 It seems that you must access character data in an aligned manner.
18634 d_u32align="$define"
18638 rp='Can you access character data at unaligned addresses?'
18642 [yY]*) d_u32align="$undef" ;;
18643 *) d_u32align="$define" ;;
18650 : see if ualarm exists
18651 set ualarm d_ualarm
18654 : see if umask exists
18658 : see if unordered exists
18659 set unordered d_unordered
18662 : see if unsetenv exists
18663 set unsetenv d_unsetenv
18666 : see if usleep exists
18667 set usleep d_usleep
18670 : see if prototype for usleep is available
18672 set d_usleepproto usleep $i_unistd unistd.h
18675 : see if ustat exists
18679 : see if closedir exists
18680 set closedir d_closedir
18683 case "$d_closedir" in
18686 echo "Checking whether closedir() returns a status..." >&4
18688 #$i_dirent I_DIRENT /**/
18689 #$i_sysdir I_SYS_DIR /**/
18690 #$i_sysndir I_SYS_NDIR /**/
18691 #$i_systypes I_SYS_TYPES /**/
18693 #if defined(I_SYS_TYPES)
18694 #include <sys/types.h>
18696 #if defined(I_DIRENT)
18697 #include <dirent.h>
18698 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18699 #include <sys/dir.h>
18703 #include <sys/ndir.h>
18707 #include <ndir.h> /* may be wrong in the future */
18709 #include <sys/dir.h>
18714 int main() { return closedir(opendir(".")); }
18717 if eval $compile_ok; then
18718 if $run ./try > /dev/null 2>&1 ; then
18719 echo "Yes, it does."
18722 echo "No, it doesn't."
18726 echo "(I can't seem to compile the test program--assuming it doesn't)"
18734 set d_void_closedir
18738 : see if there is a wait4
18742 : see if waitpid exists
18743 set waitpid d_waitpid
18746 : see if wcstombs exists
18747 set wcstombs d_wcstombs
18750 : see if wctomb exists
18751 set wctomb d_wctomb
18754 : see if writev exists
18755 set writev d_writev
18758 : preserve RCS keywords in files with variable substitution, grrr
18763 Revision='$Revision'
18765 : check for alignment requirements
18767 case "$usecrosscompile$multiarch" in
18770 You seem to be either cross-compiling or doing a multiarchitecture build,
18771 skipping the memory alignment check.
18774 case "$alignbytes" in
18775 '') alignbytes=8 ;;
18779 case "$alignbytes" in
18780 '') echo "Checking alignment constraints..." >&4
18781 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18782 $cat >try.c <<'EOCP'
18783 typedef long double NV;
18786 $cat >try.c <<'EOCP'
18790 $cat >>try.c <<'EOCP'
18798 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18803 if eval $compile_ok; then
18807 echo "(I can't seem to compile the test program...)"
18810 *) dflt="$alignbytes"
18813 rp="Doubles must be aligned on a how-many-byte boundary?"
18821 : set the base revision
18824 : check for length of character
18826 case "$charsize" in
18828 echo "Checking to see how big your characters are (hey, you never know)..." >&4
18831 #$i_stdlib I_STDLIB
18833 #include <stdlib.h>
18837 printf("%d\n", (int)sizeof(char));
18842 if eval $compile_ok; then
18846 echo "(I can't seem to compile the test program. Guessing...)"
18853 rp="What is the size of a character (in bytes)?"
18858 : Check for the number of bits in a character
18859 case "$charbits" in
18860 '') echo "Checking how long a character is (in bits)..." >&4
18867 for (c = 1, n = 0; c; c <<= 1, n++) ;
18868 printf ("%d\n", n);
18873 if eval $compile_ok; then
18877 echo "(I can't seem to compile the test program. Guessing...)"
18884 rp="What is the length of a character (in bits)?"
18888 case "$charbits" in
18891 Your system has an unsigned character size of $charbits bits, which
18892 is rather unusual (normally it is 8 bits). Perl likely will not work
18893 correctly on your system, with subtle bugs in various places.
18895 rp='Do you really want to continue?'
18899 [yY]) echo >&4 "Okay, continuing." ;;
18904 : how do we concatenate cpp tokens here?
18906 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18907 $cat >cpp_stuff.c <<'EOCP'
18908 #define RCAT(a,b)a/**/b
18909 #define ACAT(a,b)a ## b
18913 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18914 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18915 echo "Oh! Smells like ANSI's been here." >&4
18916 echo "We can catify or stringify, separately or together!"
18918 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18919 echo "Ah, yes! The good old days!" >&4
18920 echo "However, in the good old days we don't know how to stringify and"
18921 echo "catify at the same time."
18925 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18926 You're going to have to edit the values of CAT[2-5] in config.h...
18928 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18932 : see if this is a db.h system
18938 : Check db version.
18940 echo "Checking Berkeley DB version ..." >&4
18946 #include <sys/types.h>
18948 #$i_stdlib I_STDLIB
18950 #include <stdlib.h>
18953 int main(int argc, char *argv[])
18955 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18956 int Major, Minor, Patch ;
18957 unsigned long Version ;
18958 (void)db_version(&Major, &Minor, &Patch) ;
18960 printf("%d %d %d %d %d %d\n",
18961 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18962 Major, Minor, Patch);
18965 printf("You have Berkeley DB Version 2 or greater.\n");
18967 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18968 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18969 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18970 Major, Minor, Patch) ;
18972 /* check that db.h & libdb are compatible */
18973 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18974 printf("db.h and libdb are incompatible.\n") ;
18978 printf("db.h and libdb are compatible.\n") ;
18980 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18981 + DB_VERSION_PATCH ;
18983 /* needs to be >= 2.3.4 */
18984 if (Version < 2003004) {
18985 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18986 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18992 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18997 printf("You have Berkeley DB Version 1.\n");
18998 exit(0); /* DB version < 2: the coast is clear. */
19000 exit(1); /* <db.h> not Berkeley DB? */
19006 if eval $compile_ok && $run ./try; then
19007 echo 'Looks OK.' >&4
19009 db_version_major=$1
19010 db_version_minor=$2
19011 db_version_patch=$3
19013 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19017 : Remove db from list of libraries to use
19018 echo "Removing unusable -ldb from library list" >&4
19019 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19022 echo "libs = $libs" >&4
19032 : Check the return type needed for hash
19034 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19040 #include <sys/types.h>
19043 #ifndef DB_VERSION_MAJOR
19044 u_int32_t hash_cb (ptr, size)
19052 info.hash = hash_cb;
19056 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19057 if $contains warning try.out >>/dev/null 2>&1 ; then
19060 db_hashtype='u_int32_t'
19063 : XXX Maybe we should just give up here.
19064 db_hashtype=u_int32_t
19066 echo "Help: I can't seem to compile the db test program." >&4
19067 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19070 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19072 *) db_hashtype=u_int32_t
19077 : Check the return type needed for prefix
19079 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19085 #include <sys/types.h>
19088 #ifndef DB_VERSION_MAJOR
19089 size_t prefix_cb (key1, key2)
19097 info.prefix = prefix_cb;
19101 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19102 if $contains warning try.out >>/dev/null 2>&1 ; then
19103 db_prefixtype='int'
19105 db_prefixtype='size_t'
19108 db_prefixtype='size_t'
19109 : XXX Maybe we should just give up here.
19111 echo "Help: I can't seem to compile the db test program." >&4
19112 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19115 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19117 *) db_prefixtype='size_t'
19121 : How can we generate normalized random numbers ?
19123 echo "Looking for a random number function..." >&4
19124 case "$randfunc" in
19126 if set drand48 val -f; eval $csym; $val; then
19128 echo "Good, found drand48()." >&4
19129 elif set random val -f; eval $csym; $val; then
19131 echo "OK, found random()." >&4
19134 echo "Yick, looks like I have to use rand()." >&4
19145 *-Dmy_rand=*|*-Dmy_srand=*)
19146 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19147 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19148 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19149 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19153 while $test "$cont"; do
19154 rp="Use which function to generate random numbers?"
19156 if $test "$ans" = "$dflt"; then
19162 if set $ans val -f; eval $csym; $val; then
19166 rp="I cannot find function $ans. Use that name anyway?"
19175 case "$randfunc" in
19177 drand01="drand48()"
19183 case "$randbits" in
19185 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19187 #$i_unistd I_UNISTD
19188 #$i_stdlib I_STDLIB
19191 # include <unistd.h>
19194 # include <stdlib.h>
19199 register unsigned long tmp;
19200 register unsigned long max = 0L;
19202 for (i = 1000; i; i--) {
19203 tmp = (unsigned long) $randfunc();
19204 if (tmp > max) max = tmp;
19206 for (i = 0; max; i++)
19212 if eval $compile_ok; then
19216 echo "(I can't seem to compile the test program...)"
19223 rp="How many bits does your $randfunc() function produce?"
19227 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19228 seedfunc="s$randfunc"
19229 randseedtype=unsigned
19233 rp="How many bits does your $randfunc() function produce?"
19236 seedfunc="s$randfunc"
19237 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19238 if set $seedfunc val -f; eval $csym; $val; then
19239 echo "(Using $seedfunc() to seed random generator)"
19241 echo "(Warning: no $seedfunc() to seed random generator)"
19244 randseedtype=unsigned
19251 : Determine if this is an EBCDIC system
19253 echo "Determining whether or not we are on an EBCDIC system..." >&4
19254 $cat >try.c <<'EOM'
19257 if ('M'==0xd4) return 0;
19264 if eval $compile_ok; then
19265 if $run ./try; then
19266 echo "You seem to speak EBCDIC." >&4
19269 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19272 echo "I'm unable to compile the test program." >&4
19273 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19279 : Check how to flush
19282 Checking how to flush all pending stdio output...
19284 # I only know how to find the first 32 possibly open files on SunOS.
19285 # See also hints/sunos_4_1.sh and util.c --AD
19287 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19289 $cat >>try.c <<EOCP
19291 #$i_stdlib I_STDLIB
19293 #include <stdlib.h>
19295 #$i_unistd I_UNISTD
19297 # include <unistd.h>
19299 #$d_sysconf HAS_SYSCONF
19300 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19301 #ifdef HAS_STDIO_STREAM_ARRAY
19302 # define STDIO_STREAM_ARRAY $stdio_stream_array
19307 p = fopen("try.out", "w");
19311 # ifdef TRY_FPRINTF
19315 #ifdef TRY_FFLUSH_NULL
19318 #ifdef TRY_FFLUSH_ALL
19320 long open_max = -1;
19321 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19322 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19324 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19325 open_max = sysconf(_SC_OPEN_MAX);
19328 open_max = FOPEN_MAX;
19331 open_max = OPEN_MAX;
19340 # ifdef HAS_STDIO_STREAM_ARRAY
19341 if (open_max > 0) {
19343 for (i = 0; i < open_max; i++)
19344 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19345 STDIO_STREAM_ARRAY[i]._file < open_max &&
19346 STDIO_STREAM_ARRAY[i]._flag)
19347 fflush(&STDIO_STREAM_ARRAY[i]);
19355 : first we have to find out how _not_ to flush
19357 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19359 set try -DTRY_FPUTC
19360 if eval $compile; then
19361 $run ./try 2>/dev/null
19364 if $test ! -s try.out -a "X$code" = X42; then
19370 set try -DTRY_FPRINTF
19371 if eval $compile; then
19372 $run ./try 2>/dev/null
19375 if $test ! -s try.out -a "X$code" = X42; then
19376 output=-DTRY_FPRINTF
19382 : check for fflush NULL behaviour
19383 case "$fflushNULL" in
19384 '') set try -DTRY_FFLUSH_NULL $output
19385 if eval $compile; then
19386 $run ./try 2>/dev/null
19389 if $test -s try.out -a "X$code" = X42; then
19390 fflushNULL="`$cat try.out`"
19392 if $test "X$code" != X42; then
19394 (If this test failed, don't worry, we'll try another method shortly.)
19399 $rm -f core try.core core.try.*
19400 case "$fflushNULL" in
19402 Your fflush(NULL) works okay for output streams.
19403 Let's see if it clobbers input pipes...
19405 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19406 # bug that improperly flushes the input end of pipes. So we avoid the
19407 # autoflush on fork/system/exec support for now. :-(
19408 $cat >tryp.c <<EOCP
19411 main(int argc, char **argv)
19417 while ((i = getc(stdin)) != -1
19418 && (*bp++ = i) != '\n'
19419 && bp < &buf[1024])
19422 fprintf(stdout, "%s", buf);
19430 fflushNULL="$define"
19432 if eval $compile; then
19434 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19435 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19437 fflush(NULL) seems to behave okay with input streams.
19439 fflushNULL="$define"
19442 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19444 fflushNULL="$undef"
19447 $rm -f core tryp.c tryp.core core.tryp.*
19450 Your fflush(NULL) isn't working (contrary to ANSI C).
19452 fflushNULL="$undef"
19455 Cannot figure out whether your fflush(NULL) works or not.
19456 I'm assuming it doesn't (contrary to ANSI C).
19458 fflushNULL="$undef"
19462 $define|true|[yY]*)
19463 fflushNULL="$define"
19466 fflushNULL="$undef"
19469 : check explicit looping only if NULL did not work, and if the pipe
19470 : bug does not show up on an explicit flush too
19471 case "$fflushNULL" in
19473 $cat >tryp.c <<EOCP
19476 main(int argc, char **argv)
19482 while ((i = getc(stdin)) != -1
19483 && (*bp++ = i) != '\n'
19484 && bp < &buf[1024])
19487 fprintf(stdout, "%s", buf);
19496 if eval $compile; then
19498 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19499 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19501 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19503 : now check for fflushall behaviour
19504 case "$fflushall" in
19505 '') set try -DTRY_FFLUSH_ALL $output
19506 if eval $compile; then
19508 (Now testing the other method--but note that this also may fail.)
19510 $run ./try 2>/dev/null
19513 if $test -s try.out -a "X$code" = X42; then
19514 fflushall="`$cat try.out`"
19518 case "$fflushall" in
19520 Whew. Flushing explicitly all the stdio streams works.
19522 fflushall="$define"
19525 Sigh. Flushing explicitly all the stdio streams doesn't work.
19530 Cannot figure out whether flushing stdio streams explicitly works or not.
19531 I'm assuming it doesn't.
19537 "$define"|true|[yY]*)
19538 fflushall="$define"
19546 All is futile. Even fflush(stdin) clobbers input pipes!
19553 $rm -f core tryp.c tryp.core core.tryp.*
19555 *) fflushall="$undef"
19559 case "$fflushNULL$fflushall" in
19562 OK, I give up. I cannot figure out how to flush pending stdio output.
19563 We won't be flushing handles at all before fork/exec/popen.
19569 : Store the full pathname to the ar program for use in the C program
19570 : Respect a hint or command line value for full_ar.
19575 : Store the full pathname to the sed program for use in the C program
19578 : see what type gids are declared as in the kernel
19580 echo "Looking for the type for group ids returned by getgid()."
19581 set gid_t gidtype xxx stdio.h sys/types.h
19585 xxx=`./findhdr sys/user.h`
19586 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19588 unsigned) dflt="$1 $2" ;;
19592 *) dflt="$gidtype";;
19595 gid_t) echo "gid_t found." ;;
19596 *) rp="What is the type for group ids returned by getgid()?"
19602 : Check the size of GID
19605 *_t) zzz="$gidtype" ;;
19608 echo "Checking the size of $zzz..." >&4
19610 #include <sys/types.h>
19612 #$i_stdlib I_STDLIB
19614 #include <stdlib.h>
19617 printf("%d\n", (int)sizeof($gidtype));
19622 if eval $compile_ok; then
19626 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19629 echo "Your $zzz is $gidsize bytes long."
19634 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19638 : Check if GID is signed
19641 *_t) zzz="$gidtype" ;;
19644 echo "Checking the sign of $zzz..." >&4
19646 #include <sys/types.h>
19657 if eval $compile; then
19661 echo "(I can't execute the test program--guessing unsigned.)" >&4
19665 1) echo "Your $zzz is unsigned." ;;
19666 -1) echo "Your $zzz is signed." ;;
19672 echo "(I can't compile the test program--guessing unsigned.)" >&4
19676 : Check 64bit sizes
19679 if $test X"$quadtype" != X; then
19681 echo "Checking how to print 64-bit integers..." >&4
19683 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19684 $cat >try.c <<'EOCP'
19685 #include <sys/types.h>
19688 int q = 12345678901;
19689 printf("%ld\n", q);
19693 if eval $compile; then
19697 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19698 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19699 echo "We will use %d."
19705 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19706 $cat >try.c <<'EOCP'
19707 #include <sys/types.h>
19710 long q = 12345678901;
19711 printf("%ld\n", q);
19715 if eval $compile; then
19719 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19720 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19721 echo "We will use %ld."
19727 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19728 $cat >try.c <<'EOCP'
19729 #include <sys/types.h>
19730 #include <inttypes.h>
19733 int64_t q = 12345678901;
19734 printf("%" PRId64 "\n", q);
19738 if eval $compile; then
19742 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19743 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19744 echo "We will use the C9X style."
19750 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19752 #include <sys/types.h>
19755 $quadtype q = 12345678901;
19756 printf("%Ld\n", q);
19760 if eval $compile; then
19764 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19765 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19766 echo "We will use %Ld."
19772 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19773 $cat >try.c <<'EOCP'
19774 #include <sys/types.h>
19777 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19778 printf("%lld\n", q);
19782 if eval $compile; then
19786 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19787 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19788 echo "We will use the %lld style."
19794 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19796 #include <sys/types.h>
19799 $quadtype q = 12345678901;
19800 printf("%qd\n", q);
19804 if eval $compile; then
19808 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19809 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19810 echo "We will use %qd."
19816 if $test X"$sPRId64" = X; then
19817 echo "Cannot figure out how to print 64-bit integers." >&4
19824 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19825 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19827 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19828 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19832 : Check format strings for internal types
19834 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19836 if $test X"$ivsize" = X8; then
19837 ivdformat="$sPRId64"
19838 uvuformat="$sPRIu64"
19839 uvoformat="$sPRIo64"
19840 uvxformat="$sPRIx64"
19841 uvXUformat="$sPRIXU64"
19843 if $test X"$ivsize" = X"$longsize"; then
19850 if $test X"$ivsize" = X"$intsize"; then
19858 if $test X"$ivsize" = X"$shortsize"; then
19869 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19870 nveformat="$sPRIeldbl"
19871 nvfformat="$sPRIfldbl"
19872 nvgformat="$sPRIgldbl"
19873 nvEUformat="$sPRIEUldbl"
19874 nvFUformat="$sPRIFUldbl"
19875 nvGUformat="$sPRIGUldbl"
19885 case "$ivdformat" in
19886 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19891 : Check format string for GID
19894 $echo "Checking the format string to be used for gids..." >&4
19897 -1) if $test X"$gidsize" = X"$ivsize"; then
19898 gidformat="$ivdformat"
19900 if $test X"$gidsize" = X"$longsize"; then
19903 if $test X"$gidsize" = X"$intsize"; then
19906 if $test X"$gidsize" = X"$shortsize"; then
19913 *) if $test X"$gidsize" = X"$uvsize"; then
19914 gidformat="$uvuformat"
19916 if $test X"$gidsize" = X"$longsize"; then
19919 if $test X"$gidsize" = X"$intsize"; then
19922 if $test X"$gidsize" = X"$shortsize"; then
19931 : see if getgroups exists
19932 set getgroups d_getgrps
19935 : see if setgroups exists
19936 set setgroups d_setgrps
19939 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19941 case "$d_getgrps$d_setgrps" in
19943 case "$groupstype" in
19944 '') dflt="$gidtype" ;;
19945 *) dflt="$groupstype" ;;
19948 What type of pointer is the second argument to getgroups() and setgroups()?
19949 Usually this is the same as group ids, $gidtype, but not always.
19952 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19956 *) groupstype="$gidtype";;
19959 : MAD = Misc Attribute Definition
19961 if $test $patchlevel -lt 9; then
19962 : MAD is not available in 5.8.x or earlier.
19966 $define|true|[yY]*) dflt='y' ;;
19971 Would you like to build with Misc Attribute Decoration? This is development
19972 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19973 overhead on the interpreter.
19975 If this doesn't make any sense to you, just accept the default '$dflt'.
19977 rp='Build Perl with MAD?'
19982 madlyh='madly.h madly.act madly.tab'
19984 madlyobj="madly$_o" ;;
19993 : check whether make sets MAKE
19995 echo "Checking if your $make program sets \$(MAKE)..." >&4
19996 case "$make_set_make" in
19998 $sed 's/^X //' > testmake.mak << 'EOF'
20000 X @echo 'maketemp="$(MAKE)"'
20002 case "`$make -f testmake.mak 2>/dev/null`" in
20003 *maketemp=*) make_set_make='#' ;;
20004 *) make_set_make="MAKE=$make" ;;
20006 $rm -f testmake.mak
20009 case "$make_set_make" in
20010 '#') echo "Yup, it does.";;
20011 *) echo "Nope, it doesn't.";;
20014 : see what type is used for mode_t
20015 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20016 set mode_t modetype int stdio.h sys/types.h
20019 : see if we need va_copy
20021 case "$i_stdarg" in
20024 #include <stdarg.h>
20026 #$i_stdlib I_STDLIB
20028 #include <stdlib.h>
20030 #include <signal.h>
20033 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20035 return vfprintf(f, fmt, *valp);
20039 myvfprintf(FILE *f, const char *fmt, va_list val)
20041 return ivfprintf(f, fmt, &val);
20045 myprintf(char *fmt, ...)
20048 va_start(val, fmt);
20049 return myvfprintf(stdout, fmt, val);
20053 main(int ac, char **av)
20055 signal(SIGSEGV, exit);
20057 myprintf("%s%cs all right, then\n", "that", '\'');
20062 if eval $compile && $run ./try 2>&1 >/dev/null; then
20063 case "`$run ./try`" in
20064 "that's all right, then")
20070 yes) echo "It seems that you don't need va_copy()." >&4
20071 need_va_copy="$undef"
20073 *) echo "It seems that va_copy() or similar will be needed." >&4
20074 need_va_copy="$define"
20079 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20083 : see what type is used for size_t
20084 rp="What is the type used for the length parameter for string functions?"
20085 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20088 : check for type of arguments to gethostbyaddr.
20089 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20090 case "$d_gethbyaddr" in
20094 Checking to see what type of arguments are accepted by gethostbyaddr().
20096 hdrs="$define sys/types.h
20097 $d_socket sys/socket.h
20098 $i_niin netinet/in.h
20100 $i_unistd unistd.h"
20101 : The first arg can 'char *' or 'void *'
20102 : The second arg is some of integral type
20103 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20104 for yyy in size_t long int; do
20105 case "$netdb_host_type" in
20106 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20107 if ./protochk "$try" $hdrs; then
20108 echo "Your system accepts $xxx for the first arg."
20109 echo "...and $yyy for the second arg."
20110 netdb_host_type="$xxx"
20111 netdb_hlen_type="$yyy"
20117 : In case none of those worked, prompt the user.
20118 case "$netdb_host_type" in
20119 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20122 netdb_host_type=$ans
20123 rp='What is the type for the 2nd argument to gethostbyaddr?'
20126 netdb_hlen_type=$ans
20130 *) : no gethostbyaddr, so pick harmless defaults
20131 netdb_host_type='char *'
20132 netdb_hlen_type="$sizetype"
20135 # Remove the "const" if needed. -- but then we'll have a
20137 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20140 : check for type of argument to gethostbyname.
20141 if test "X$netdb_name_type" = X ; then
20142 case "$d_gethbyname" in
20146 Checking to see what type of argument is accepted by gethostbyname().
20148 hdrs="$define sys/types.h
20149 $d_socket sys/socket.h
20150 $i_niin netinet/in.h
20152 $i_unistd unistd.h"
20153 for xxx in "const char *" "char *"; do
20154 case "$netdb_name_type" in
20155 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20156 if ./protochk "$try" $hdrs; then
20157 echo "Your system accepts $xxx."
20158 netdb_name_type="$xxx"
20163 : In case none of those worked, prompt the user.
20164 case "$netdb_name_type" in
20165 '') rp='What is the type for the 1st argument to gethostbyname?'
20168 netdb_name_type=$ans
20172 *) : no gethostbyname, so pick harmless default
20173 netdb_name_type='char *'
20178 : check for type of 1st argument to getnetbyaddr.
20179 if test "X$netdb_net_type" = X ; then
20180 case "$d_getnbyaddr" in
20184 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20186 hdrs="$define sys/types.h
20187 $d_socket sys/socket.h
20188 $i_niin netinet/in.h
20190 $i_unistd unistd.h"
20191 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20192 case "$netdb_net_type" in
20193 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20194 if ./protochk "$try" $hdrs; then
20195 echo "Your system accepts $xxx."
20196 netdb_net_type="$xxx"
20201 : In case none of those worked, prompt the user.
20202 case "$netdb_net_type" in
20203 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20206 netdb_net_type=$ans
20210 *) : no getnetbyaddr, so pick harmless default
20211 netdb_net_type='long'
20215 : locate the preferred pager for this system
20222 [a-zA-Z]:/*) dflt=$pg;;
20226 [a-zA-Z]:/*) dflt=$more;;
20230 [a-zA-Z]:/*) dflt=$less;;
20233 '') dflt=/usr/ucb/more;;
20241 rp='What pager is used on your system?'
20245 : see what type pids are declared as in the kernel
20246 rp="What is the type of process ids on this system?"
20247 set pid_t pidtype int stdio.h sys/types.h
20250 : see if ar generates random libraries by itself
20252 echo "Checking how to generate random libraries on your machine..." >&4
20253 echo 'int bar1() { return bar2(); }' > bar1.c
20254 echo 'int bar2() { return 2; }' > bar2.c
20256 #$i_stdlib I_STDLIB
20258 #include <stdlib.h>
20260 int main() { printf("%d\n", bar1()); exit(0); }
20262 $cc $ccflags -c bar1.c >/dev/null 2>&1
20263 $cc $ccflags -c bar2.c >/dev/null 2>&1
20264 $cc $ccflags -c foo.c >/dev/null 2>&1
20265 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20266 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20267 $run ./foobar >/dev/null 2>&1; then
20268 echo "$ar appears to generate random libraries itself."
20270 if [ "X$ranlib" = "X" ]; then
20273 elif $ar s bar$_a >/dev/null 2>&1 &&
20274 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20275 $run ./foobar >/dev/null 2>&1; then
20276 echo "a table of contents needs to be added with '$ar s'."
20279 elif $ar ts bar$_a >/dev/null 2>&1 &&
20280 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20281 $run ./foobar >/dev/null 2>&1; then
20282 echo "a table of contents needs to be added with '$ar ts'."
20289 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20290 $test -f $ranlib || ranlib=''
20293 if $test -n "$ranlib"; then
20294 echo "your system has '$ranlib'; we'll use that."
20297 echo "your system doesn't seem to support random libraries"
20298 echo "so we'll use lorder and tsort to order the libraries."
20305 : see if this is a values.h system
20306 set values.h i_values
20309 : Check the max offset that gmtime and localtime accept
20310 echo "Checking max offsets that gmtime () accepts"
20313 define) yyy="#include <values.h>" ;;
20317 case "$sGMTIME_min/$sGMTIME_max" in
20320 #include <sys/types.h>
20329 void gm_check (time_t t, int min_year, int max_year)
20332 if ( tmp == NULL ||
20333 /* Check tm_year overflow */
20334 tmp->tm_year < min_year || tmp->tm_year > max_year)
20345 gm_check (MAXLONG, 69, 0x7fffffff);
20347 if (tmp == NULL || tmp->tm_year < 0) {
20348 for (i = 63; i >= 0; i--) {
20349 time_t x = pt | ((time_t)1 << i);
20350 if (x < 0 || x < pt) continue;
20351 gm_check (x, 69, 0x7fffffff);
20354 printf ("sGMTIME_max=%ld\n", pt);
20363 gm_check (MINLONG, -1900, 70);
20366 for (i = 36; i >= 0; i--) {
20367 time_t x = pt - ((time_t)1 << i);
20368 if (x > 0) continue;
20369 gm_check (x, -1900, 70);
20372 printf ("sGMTIME_min=%ld\n", pt);
20376 int main (int argc, char *argv[])
20378 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20385 if eval $compile; then
20388 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20394 echo "Checking max offsets that localtime () accepts"
20396 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20399 #include <sys/types.h>
20408 void local_check (time_t t, int min_year, int max_year)
20410 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20413 tmp = localtime (&t);
20414 if ( tmp == NULL ||
20415 /* Check tm_year overflow */
20416 tmp->tm_year < min_year || tmp->tm_year > max_year)
20420 } /* local_check */
20427 local_check (MAXLONG, 69, 0x7fffffff);
20429 if (tmp == NULL || tmp->tm_year < 0) {
20430 for (i = 63; i >= 0; i--) {
20431 time_t x = pt | ((time_t)1 << i);
20432 if (x < 0 || x < pt) continue;
20433 local_check (x, 69, 0x7fffffff);
20436 printf ("sLOCALTIME_max=%ld\n", pt);
20445 local_check (MINLONG, -1900, 70);
20448 for (i = 36; i >= 0; i--) {
20449 time_t x = pt - ((time_t)1 << i);
20450 if (x > 0) continue;
20451 local_check (x, -1900, 70);
20454 printf ("sLOCALTIME_min=%ld\n", pt);
20458 int main (int argc, char *argv[])
20466 if eval $compile; then
20469 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20475 : check for type of arguments to select.
20476 case "$selecttype" in
20477 '') case "$d_select" in
20481 Checking to see what type of arguments are accepted by select().
20483 hdrs="$define sys/types.h
20484 $i_systime sys/time.h
20485 $i_sysselct sys/select.h
20486 $d_socket sys/socket.h"
20487 : The first arg can be int, unsigned, or size_t
20488 : The last arg may or may not be 'const'
20490 : void pointer has been seen but using that
20491 : breaks the selectminbits test
20492 for xxx in 'fd_set *' 'int *'; do
20493 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20494 for tmo in 'struct timeval *' 'const struct timeval *'; do
20496 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20497 if ./protochk "$try" $hdrs; then
20498 echo "Your system accepts $xxx."
20507 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20508 case "$d_fd_set" in
20509 $define) dflt="fd_set *" ;;
20518 *) : no select, so pick a harmless default
20525 : check for the select 'width'
20526 case "$selectminbits" in
20527 '') safebits=`expr $ptrsize \* 8`
20528 case "$d_select" in
20532 Checking to see on how many bits at a time your select() operates...
20535 #include <sys/types.h>
20537 #$i_systime I_SYS_TIME
20538 #$i_systimek I_SYS_TIME_KERNEL
20543 # ifdef I_SYS_TIME_KERNEL
20546 # include <sys/time.h>
20547 # ifdef I_SYS_TIME_KERNEL
20551 #$i_sysselct I_SYS_SELECT
20552 #ifdef I_SYS_SELECT
20553 #include <sys/select.h>
20555 #$d_socket HAS_SOCKET
20557 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20560 #$i_stdlib I_STDLIB
20562 #include <stdlib.h>
20565 #define S sizeof(*(b))
20567 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20568 #define NBITS (NBYTES * 8)
20570 char *s = (char *)malloc(NBYTES);
20579 fp = fopen("try.c", "r");
20585 b = ($selecttype)s;
20586 for (i = 0; i < NBITS; i++)
20590 select(fd + 1, b, 0, 0, &t);
20591 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20593 printf("%d\n", i + 1);
20598 if eval $compile_ok; then
20599 selectminbits=`$run ./try`
20600 case "$selectminbits" in
20602 Cannot figure out on how many bits at a time your select() operates.
20603 I'll play safe and guess it is $safebits bits.
20605 selectminbits=$safebits
20606 bits="$safebits bits"
20609 *) bits="$selectminbits bits" ;;
20611 echo "Your select() operates on $bits at a time." >&4
20613 rp='What is the minimum number of bits your select() operates on?'
20614 case "$byteorder" in
20615 12345678) dflt=64 ;;
20621 selectminbits="$val"
20625 *) : no select, so pick a harmless default
20626 selectminbits=$safebits
20632 : Trace out the files included by signal.h, then look for SIGxxx names.
20633 if [ "X$fieldn" = X ]; then
20634 : Just make some guesses. We check them later.
20635 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20637 xxx=`echo '#include <signal.h>' |
20638 $cppstdin $cppminus $cppflags 2>/dev/null |
20639 $grep '^[ ]*#.*include' |
20640 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20641 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20644 for xx in $xxx /dev/null ; do
20645 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20647 case "$xxxfiles" in
20648 '') xxxfiles=`./findhdr signal.h` ;;
20651 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20652 print substr($2, 4, 20)
20654 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20655 print substr($3, 4, 20)
20657 : Append some common names just in case the awk scan failed.
20658 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20659 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20660 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20661 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20662 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20664 : generate a few handy files for later
20665 $cat > signal.c <<EOCP
20666 #include <sys/types.h>
20667 #include <signal.h>
20668 #$i_stdlib I_STDLIB
20670 #include <stdlib.h>
20675 /* Strange style to avoid deeply-nested #if/#else/#endif */
20678 # define NSIG (_NSIG)
20684 # define NSIG (SIGMAX+1)
20690 # define NSIG (SIG_MAX+1)
20696 # define NSIG (_SIG_MAX+1)
20702 # define NSIG (MAXSIG+1)
20708 # define NSIG (MAX_SIG+1)
20713 # ifdef SIGARRAYSIZE
20714 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20720 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20724 /* Default to some arbitrary number that's big enough to get most
20725 of the common signals.
20731 printf("NSIG %d\n", NSIG);
20737 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20739 printf "#ifdef SIG"; printf $1; printf "\n"
20740 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20741 printf $1; printf ");\n"
20745 printf "#endif /* JUST_NSIG */\n";
20746 printf "exit(0);\n}\n";
20749 $cat >signal.awk <<'EOP'
20750 BEGIN { ndups = 0 }
20751 $1 ~ /^NSIG$/ { nsig = $2 }
20752 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20753 if ($2 > maxsig) { maxsig = $2 }
20754 if (sig_name[$2]) {
20755 dup_name[ndups] = $1
20756 dup_num[ndups] = $2
20768 printf("NSIG %d\n", nsig);
20769 for (n = 1; n < nsig; n++) {
20771 printf("%s %d\n", sig_name[n], sig_num[n])
20774 printf("NUM%d %d\n", n, n)
20777 for (n = 0; n < ndups; n++) {
20778 printf("%s %d\n", dup_name[n], dup_num[n])
20782 $cat >signal_cmd <<EOS
20784 if $test -s signal.lst; then
20785 echo "Using your existing signal.lst file"
20790 $cat >>signal_cmd <<'EOS'
20793 if eval $compile_ok; then
20794 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20795 $uniq | $awk -f signal.awk >signal.lst
20797 echo "(I can't seem be able to compile the whole test program)" >&4
20798 echo "(I'll try it in little pieces.)" >&4
20799 set signal -DJUST_NSIG
20800 if eval $compile_ok; then
20801 $run ./signal$_exe > signal.nsg
20804 echo "I can't seem to figure out how many signals you have." >&4
20805 echo "Guessing 50." >&4
20806 echo 'NSIG 50' > signal.nsg
20808 : Now look at all the signal names, one at a time.
20809 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20810 $cat > signal.c <<EOCP
20811 #include <sys/types.h>
20812 #include <signal.h>
20815 printf("$xx %d\n", SIG${xx});
20820 if eval $compile; then
20821 echo "SIG${xx} found."
20822 $run ./signal$_exe >> signal.ls1
20824 echo "SIG${xx} NOT found."
20827 if $test -s signal.ls1; then
20828 $cat signal.nsg signal.ls1 |
20829 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20833 if $test -s signal.lst; then
20836 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20837 echo 'kill -l' >signal
20838 set X `csh -f <signal`
20842 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20844 echo $@ | $tr ' ' $trnl | \
20845 $awk '{ printf "%s %d\n", $1, ++s; }
20846 END { printf "NSIG %d\n", ++s }' >signal.lst
20848 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20850 chmod a+x signal_cmd
20851 $eunicefix signal_cmd
20853 : generate list of signal names
20855 case "$sig_name_init" in
20857 *) case "$sig_num_init" in
20858 ''|*,*) doinit=yes ;;
20863 echo "Generating a list of signal names and numbers..." >&4
20865 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20866 sig_name=`$awk 'BEGIN { printf "ZERO " }
20867 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20868 sig_num=`$awk 'BEGIN { printf "0 " }
20869 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20870 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20871 !/^NSIG/ { printf "\"%s\", ", $1 }
20872 END { printf "0\n" }' signal.lst`
20873 sig_num_init=`$awk 'BEGIN { printf "0, " }
20874 !/^NSIG/ { printf "%d, ", $2}
20875 END { printf "0\n"}' signal.lst`
20878 echo "The following $sig_count signals are available:"
20880 echo $sig_name | $awk \
20881 'BEGIN { linelen = 0 }
20883 for (i = 1; i <= NF; i++) {
20884 name = "SIG" $i " "
20885 linelen = linelen + length(name)
20886 if (linelen > 70) {
20888 linelen = length(name)
20894 sig_size=`echo $sig_name | awk '{print NF}'`
20895 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20897 : Check size of size
20899 case "$sizetype" in
20900 *_t) zzz="$sizetype" ;;
20901 *) zzz="filesize" ;;
20903 echo "Checking the size of $zzz..." >&4
20905 #include <sys/types.h>
20907 #$i_stdlib I_STDLIB
20909 #include <stdlib.h>
20912 printf("%d\n", (int)sizeof($sizetype));
20917 if eval $compile_ok; then
20921 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20924 echo "Your $zzz size is $sizesize bytes."
20929 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20933 : check for socklen_t
20935 echo "Checking to see if you have socklen_t..." >&4
20937 #include <sys/types.h>
20938 #$d_socket HAS_SOCKET
20940 #include <sys/socket.h>
20942 int main() { socklen_t x = 16; }
20945 if eval $compile; then
20947 echo "You have socklen_t."
20950 echo "You do not have socklen_t."
20951 case "$sizetype" in
20952 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20959 : see if this is a socks.h system
20960 set socks.h i_socks
20963 : check for type of the size argument to socket calls
20964 case "$d_socket" in
20968 Checking to see what type is the last argument of accept().
20971 case "$d_socklen_t" in
20972 "$define") yyy="$yyy socklen_t"
20974 yyy="$yyy $sizetype int long unsigned"
20975 for xxx in $yyy; do
20976 case "$socksizetype" in
20977 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
20978 case "$usesocks" in
20980 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20981 echo "Your system accepts '$xxx *' for the last argument of accept()."
20982 socksizetype="$xxx"
20985 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20986 echo "Your system accepts '$xxx *' for the last argument of accept()."
20987 socksizetype="$xxx"
20994 : In case none of those worked, prompt the user.
20995 case "$socksizetype" in
20996 '') rp='What is the type for socket address structure sizes?'
21003 *) : no sockets, so pick relatively harmless default
21008 : see what type is used for signed size_t
21009 set ssize_t ssizetype int stdio.h sys/types.h
21014 #$i_stdlib I_STDLIB
21016 #include <stdlib.h>
21018 #include <sys/types.h>
21019 #define Size_t $sizetype
21020 #define SSize_t $dflt
21023 if (sizeof(Size_t) == sizeof(SSize_t))
21025 else if (sizeof(Size_t) == sizeof(int))
21034 if eval $compile_ok && $run ./try > /dev/null; then
21035 ssizetype=`$run ./try`
21036 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21039 Help! I can't compile and run the ssize_t test program: please enlighten me!
21040 (This is probably a misconfiguration in your system or libraries, and
21041 you really ought to fix it. Still, I'll try anyway.)
21043 I need a type that is the same size as $sizetype, but is guaranteed to
21044 be signed. Common values are ssize_t, int and long.
21047 rp="What signed type is the same size as $sizetype?"
21053 : see what type of char stdio uses.
21055 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21056 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21057 echo "Your stdio uses unsigned chars." >&4
21058 stdchar="unsigned char"
21060 echo "Your stdio uses signed chars." >&4
21065 : see what type uids are declared as in the kernel
21067 echo "Looking for the type for user ids returned by getuid()."
21068 set uid_t uidtype xxx stdio.h sys/types.h
21072 xxx=`./findhdr sys/user.h`
21073 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21075 unsigned) dflt="$1 $2" ;;
21079 *) dflt="$uidtype";;
21082 uid_t) echo "uid_t found." ;;
21083 *) rp="What is the type for user ids returned by getuid()?"
21089 : Check size of UID
21092 *_t) zzz="$uidtype" ;;
21095 echo "Checking the size of $zzz..." >&4
21097 #include <sys/types.h>
21099 #$i_stdlib I_STDLIB
21101 #include <stdlib.h>
21104 printf("%d\n", (int)sizeof($uidtype));
21109 if eval $compile_ok; then
21113 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21116 echo "Your $zzz is $uidsize bytes long."
21121 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21124 : Check if UID is signed
21127 *_t) zzz="$uidtype" ;;
21130 echo "Checking the sign of $zzz..." >&4
21132 #include <sys/types.h>
21143 if eval $compile; then
21147 echo "(I can't execute the test program--guessing unsigned.)" >&4
21151 1) echo "Your $zzz is unsigned." ;;
21152 -1) echo "Your $zzz is signed." ;;
21158 echo "(I can't compile the test program--guessing unsigned.)" >&4
21162 : Check format string for UID
21164 $echo "Checking the format string to be used for uids..." >&4
21167 -1) if $test X"$uidsize" = X"$ivsize"; then
21168 uidformat="$ivdformat"
21170 if $test X"$uidsize" = X"$longsize"; then
21173 if $test X"$uidsize" = X"$intsize"; then
21176 if $test X"$uidsize" = X"$shortsize"; then
21183 *) if $test X"$uidsize" = X"$uvsize"; then
21184 uidformat="$uvuformat"
21186 if $test X"$uidsize" = X"$longsize"; then
21189 if $test X"$uidsize" = X"$intsize"; then
21192 if $test X"$uidsize" = X"$shortsize"; then
21201 : Check if site customization support was requested
21202 case "$usesitecustomize" in
21203 $define|true|[Yy]*)
21204 usesitecustomize="$define"
21207 usesitecustomize="$undef"
21211 : determine compiler compiler
21220 if $test -f "$byacc$_exe"; then
21222 comp="byacc or $comp"
21224 if $test -f "$bison$_exe"; then
21225 comp="$comp or bison -y"
21227 rp="Which compiler compiler ($comp) shall I use?"
21236 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21242 : see if this is a assert.h system
21243 set assert.h i_assert
21246 : see if this is a fp.h system
21250 : see if this is a fp_class.h system
21251 set fp_class.h i_fp_class
21254 : see if gdbm.h is available
21259 : see if gdbm_open exists
21260 set gdbm_open d_gdbm_open
21262 case "$d_gdbm_open" in
21265 echo "We won't be including <gdbm.h>"
21274 : see if this is a ieeefp.h system
21275 case "$i_ieeefp" in
21276 '' ) set ieeefp.h i_ieeefp
21281 : see if this is a libutil.h system
21282 set libutil.h i_libutil
21285 : see if mach cthreads are available
21286 if test "X$usethreads" = "X$define"; then
21287 set mach/cthreads.h i_machcthr
21290 i_machcthr="$undef"
21293 : see if this is a mntent.h system
21294 set mntent.h i_mntent
21297 : see if net/errno.h is available
21299 set net/errno.h val
21302 : Unfortunately, it causes problems on some systems. Arrgh.
21305 cat > try.c <<'EOM'
21308 #include <net/errno.h>
21314 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21315 echo "We'll be including <net/errno.h>." >&4
21317 echo "We won't be including <net/errno.h>." >&4
21326 : see if netinet/tcp.h is available
21327 set netinet/tcp.h i_netinettcp
21330 : see if this is a poll.h system
21334 : see if this is a prot.h system
21338 : Preprocessor symbols
21340 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21341 $cat <<'EOSH' > Cppsym.know
21342 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21343 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21344 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21345 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21346 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21347 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21348 bull c cadmus clipper CMU COFF COMPILER_VERSION
21349 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21350 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21351 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21352 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21354 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21355 H3050R H3050RX hbullx20 hcx host_mips
21356 hp200 hp300 hp700 HP700 hp800 hp9000
21357 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21358 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21359 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21360 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21361 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21362 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21363 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21364 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21365 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21366 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21367 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21368 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21369 MATH_HAS_NO_SIDE_EFFECTS
21370 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21371 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21372 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21373 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21374 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21375 NetBSD news1500 news1700 news1800 news1900 news3700
21376 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21377 ns32016 ns32332 ns32k nsc32000
21378 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21379 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21380 pc532 pdp11 PGC PIC plexus PORTAR posix
21381 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21382 POSIX_C_SOURCE POSIX_SOURCE POWER
21383 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21384 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21385 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21386 sony sony_news sonyrisc sparc sparclite spectrum
21387 stardent stdc STDC_EXT stratos sun sun3 sun386
21388 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21389 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21390 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21391 sysV68 sysV88 Tek4132 Tek4300 titan
21392 TM3200 TM5400 TM5600
21393 tower tower32 tower32_200 tower32_600 tower32_700
21394 tower32_800 tower32_850 tss
21395 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21396 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21397 unix UNIX95 UNIX99 unixpc unos
21398 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21399 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21400 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21402 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21403 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21404 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21407 # Maybe put other stuff here too.
21408 cat <<EOSH >>Cppsym.know
21411 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21412 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21413 $cat Cppsym.know > Cppsym.c
21414 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21415 $rm -f Cppsym.a Cppsym.b Cppsym.c
21416 cat <<EOSH > Cppsym
21418 if $test \$# -gt 0; then
21419 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21420 if $test -s Cppsym.got; then
21427 $tr " " "$trnl" | ./Cppsym.try
21433 cat <<EOSH > Cppsym.try
21435 cat <<'EOCP' > try.c
21438 #define STRINGIFY(a) "a"
21440 #if cpp_stuff == 42
21441 #define StGiFy(a) #a
21442 #define STRINGIFY(a) StGiFy(a)
21444 #if $cpp_stuff != 1 && $cpp_stuff != 42
21445 # include "Bletch: How does this C preprocessor stringify macros?"
21451 cat <<'EOSH' >> Cppsym.try
21453 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21454 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21455 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21456 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21458 echo 'return 0;}' >> try.c
21460 cat <<EOSH >> Cppsym.try
21462 case "$osname-$gccversion" in
21463 irix-) ccflags="\$ccflags -woff 1178" ;;
21464 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21466 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21468 chmod +x Cppsym.try
21469 $eunicefix Cppsym.try
21470 ./Cppsym < Cppsym.know > Cppsym.true
21471 : Add in any linux cpp "predefined macros":
21472 case "$osname::$gccversion" in
21473 *linux*::*.*|*gnukfreebsd*::*.*)
21475 rm -f $tHdrH'.h' $tHdrH
21477 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21478 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21479 if [ -s $tHdrH'_cppsym.real' ]; then
21480 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21483 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21486 : now check the C compiler for additional symbols
21487 postprocess_cc_v=''
21489 aix) postprocess_cc_v="|$tr , ' '" ;;
21496 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21499 -D*) echo "\$i" | $sed 's/^-D//';;
21500 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21505 postprocess_cc_v=''
21508 ./ccsym > ccsym1.raw
21509 if $test -s ccsym1.raw; then
21510 $sort ccsym1.raw | $uniq >ccsym.raw
21512 mv ccsym1.raw ccsym.raw
21515 $awk '/\=/ { print $0; next }
21516 { print $0"=1" }' ccsym.raw >ccsym.list
21517 $comm -13 Cppsym.true ccsym.list >ccsym.own
21518 $comm -12 Cppsym.true ccsym.list >ccsym.com
21519 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21521 if $test -z ccsym.raw; then
21522 echo "Your C compiler doesn't seem to define any symbols!" >&4
21524 echo "However, your C preprocessor defines the following symbols:"
21527 cppsymbols=`$cat Cppsym.true`
21528 cppsymbols=`echo $cppsymbols`
21529 cppccsymbols="$cppsymbols"
21531 if $test -s ccsym.com; then
21532 echo "Your C compiler and pre-processor define these symbols:"
21533 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21536 cppccsymbols=`$cat ccsym.com`
21537 cppccsymbols=`echo $cppccsymbols`
21538 $test "$silent" || sleep 1
21540 if $test -s ccsym.cpp; then
21541 $test "$also" && echo " "
21542 echo "Your C pre-processor ${also}defines the following symbols:"
21543 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21545 cppsymbols=`$cat ccsym.cpp`
21546 cppsymbols=`echo $cppsymbols`
21547 $test "$silent" || sleep 1
21549 if $test -s ccsym.own; then
21550 $test "$also" && echo " "
21551 echo "Your C compiler ${also}defines the following cpp symbols:"
21552 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21553 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21554 ccsymbols=`$cat ccsym.own`
21555 ccsymbols=`echo $ccsymbols`
21556 $test "$silent" || sleep 1
21560 : see if this is a termio system
21564 if $test `./findhdr termios.h`; then
21565 set tcsetattr i_termios
21571 "$define") echo "You have POSIX termios.h... good!" >&4;;
21572 *) if ./Cppsym pyr; then
21573 case "`/bin/universe`" in
21574 ucb) if $test `./findhdr sgtty.h`; then
21576 echo "<sgtty.h> found." >&4
21578 echo "System is pyramid with BSD universe."
21579 ./warn "<sgtty.h> not found--you could have problems."
21581 *) if $test `./findhdr termio.h`; then
21583 echo "<termio.h> found." >&4
21585 echo "System is pyramid with USG universe."
21586 ./warn "<termio.h> not found--you could have problems."
21590 if $test `./findhdr termio.h`; then
21591 echo "<termio.h> found." >&4
21593 elif $test `./findhdr sgtty.h`; then
21594 echo "<sgtty.h> found." >&4
21597 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21600 if $test `./findhdr sgtty.h`; then
21601 echo "<sgtty.h> found." >&4
21603 elif $test `./findhdr termio.h`; then
21604 echo "<termio.h> found." >&4
21607 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21611 set i_termio; eval $setvar
21612 val=$val2; set i_sgtty; eval $setvar
21613 val=$val3; set i_termios; eval $setvar
21615 : see if stddef is available
21616 set stddef.h i_stddef
21619 : see if sys/access.h is available
21620 set sys/access.h i_sysaccess
21623 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21624 set sys/filio.h i_sysfilio
21627 if $test `./findhdr sys/ioctl.h`; then
21629 echo '<sys/ioctl.h> found.' >&4
21632 if $test $i_sysfilio = "$define"; then
21633 echo '<sys/ioctl.h> NOT found.' >&4
21635 $test $i_sgtty = "$define" && xxx="sgtty.h"
21636 $test $i_termio = "$define" && xxx="termio.h"
21637 $test $i_termios = "$define" && xxx="termios.h"
21638 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21644 : see if socket ioctl defs are in sys/sockio.h
21646 xxx=`./findhdr sys/sockio.h`
21647 if $test "$xxx"; then
21648 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21650 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21653 echo "No socket ioctls found in <sys/sockio.h>." >&4
21658 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21664 : see if this is a syslog.h system
21665 set syslog.h i_syslog
21668 : see if this is a sys/mode.h system
21669 set sys/mode.h i_sysmode
21672 : see if there is a sys/poll.h file
21673 set sys/poll.h i_syspoll
21676 : see if sys/resource.h has to be included
21677 set sys/resource.h i_sysresrc
21680 : see if sys/security.h is available
21681 set sys/security.h i_syssecrt
21684 : see if this is a sys/statvfs.h system
21685 set sys/statvfs.h i_sysstatvfs
21688 : see if this is a sys/un.h system
21689 set sys/un.h i_sysun
21692 : see if this is a sys/utsname.h system
21693 set sys/utsname.h i_sysutsname
21696 : see if this is a syswait system
21697 set sys/wait.h i_syswait
21700 : see if this is a ustat.h system
21701 set ustat.h i_ustat
21704 : see if this is an utime system
21705 set utime.h i_utime
21708 : see if this is a vfork system
21711 set vfork.h i_vfork
21721 echo "Looking for extensions..." >&4
21722 : If we are using the old config.sh, known_extensions may contain
21723 : old or inaccurate or duplicate values.
21724 known_extensions=''
21725 nonxs_extensions=''
21726 : We do not use find because it might not be available.
21727 : We do not just use MANIFEST because the user may have dropped
21728 : some additional extensions into the source tree and expect them
21731 : Function to recursively find available extensions, ignoring DynaLoader
21732 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21733 : In 5.10.1 and later, extensions are stored in directories
21734 : like File-Glob instead of the older File/Glob/. In this scheme,
21735 : IO-Compress does not appear to be an XS extension, but we want
21736 : to install it as one. A.D. 8/2009.
21740 DynaLoader|dynaload) ;;
21742 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
21743 leaf=`echo $xxx | $sed -e s/.*-//`;
21744 if $test -d File; then
21745 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21746 known_extensions="$known_extensions $1$this_ext";
21747 elif $test -f $xxx/Makefile.PL; then
21748 nonxs_extensions="$nonxs_extensions $1$this_ext";
21750 if $test -d $xxx -a $# -lt 10; then
21753 eval $find_extensions;
21759 $ls -1 $xxx > $$.tmp;
21760 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
21761 known_extensions="$known_extensions $this_ext";
21762 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
21763 known_extensions="$known_extensions $this_ext";
21764 elif $test "$this_ext" = "IO/Compress"; then
21765 known_extensions="$known_extensions $this_ext";
21766 elif $test -d $xxx; then
21767 nonxs_extensions="$nonxs_extensions $this_ext";
21778 eval $find_extensions
21782 eval $find_extensions
21786 eval $find_extensions
21787 if $test -d File-Glob; then
21788 : All ext/ flattened
21790 # Special case: Add in modules that nest beyond the first level.
21791 # Currently threads/shared and Hash/Util/FieldHash, since they are
21792 # not picked up by the recursive find above (and adding in general
21793 # recursive finding breaks SDBM_File/sdbm).
21794 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21795 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21797 set X $known_extensions
21799 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21800 set X $nonxs_extensions
21802 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21805 : Now see which are supported on this system.
21807 for xxx in $known_extensions ; do
21811 $define) avail_ext="$avail_ext $xxx" ;;
21814 GDBM_File|gdbm_fil)
21816 $define) avail_ext="$avail_ext $xxx" ;;
21819 I18N/Langinfo|i18n_lan)
21820 case "$i_langinfo$d_nl_langinfo" in
21821 $define$define) avail_ext="$avail_ext $xxx" ;;
21825 : XXX Do we need a useipcsysv variable here
21826 case "${d_msg}${d_sem}${d_shm}" in
21827 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21830 NDBM_File|ndbm_fil)
21833 case "$osname-$use64bitint" in
21836 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21839 *) avail_ext="$avail_ext $xxx" ;;
21844 ODBM_File|odbm_fil)
21845 case "${i_dbm}${i_rpcsvcdbm}" in
21847 case "$d_cplusplus" in
21848 define) ;; # delete as a function name will not work
21849 *) case "$osname-$use64bitint" in
21852 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21855 *) avail_ext="$avail_ext $xxx" ;;
21863 case "$useopcode" in
21864 true|define|y) avail_ext="$avail_ext $xxx" ;;
21868 case "$useposix" in
21869 true|define|y) avail_ext="$avail_ext $xxx" ;;
21873 case "$d_socket" in
21876 beos) ;; # not unless BONE
21877 *) avail_ext="$avail_ext $xxx" ;;
21882 Sys/Syslog|sys/syslog)
21883 : XXX syslog requires socket
21884 case "$d_socket" in
21885 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21889 case "$usethreads" in
21891 case "$use5005threads" in
21892 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21896 threads|threads/shared)
21897 # threads and threads::shared are special cases.
21898 # To stop people from asking "Perl 5.8.0 was supposed
21899 # to have this new fancy threads implementation but my
21900 # perl doesn't have it" and from people trying to
21901 # (re)install the threads module using CPAN.pm and
21902 # CPAN.pm then offering to reinstall Perl 5.8.0,
21903 # the threads.pm and threads/shared.pm will always be
21904 # there, croaking informatively ("you need to rebuild
21905 # all of Perl with threads, sorry") when threads haven't
21906 # been compiled in.
21908 avail_ext="$avail_ext $xxx"
21914 cygwin) avail_ext="$avail_ext $xxx" ;;
21917 XS/APItest|xs/apitest)
21918 # This is just for testing. Skip it unless we have dynamic loading.
21921 $define) avail_ext="$avail_ext $xxx" ;;
21924 XS/APItest/KeywordRPN|xs/apitest/keywordrpn)
21925 # This is just for testing. Skip it unless we have dynamic loading.
21928 $define) avail_ext="$avail_ext $xxx" ;;
21931 XS/Typemap|xs/typemap)
21932 # This is just for testing. Skip it unless we have dynamic loading.
21934 $define) avail_ext="$avail_ext $xxx" ;;
21937 *) avail_ext="$avail_ext $xxx"
21946 case "$onlyextensions" in
21948 *) keepextensions=''
21949 echo "You have requested that only certains extensions be included..." >&4
21950 for i in $onlyextensions; do
21951 case " $avail_ext " in
21953 echo "Keeping extension $i."
21954 keepextensions="$keepextensions $i"
21956 *) echo "Ignoring extension $i." ;;
21959 avail_ext="$keepextensions"
21963 case "$noextensions" in
21965 *) keepextensions=''
21966 echo "You have requested that certain extensions be ignored..." >&4
21967 for i in $avail_ext; do
21968 case " $noextensions " in
21969 *" $i "*) echo "Ignoring extension $i." ;;
21970 *) echo "Keeping extension $i.";
21971 keepextensions="$keepextensions $i"
21975 avail_ext="$keepextensions"
21979 : Now see which nonxs extensions are supported on this system.
21980 : For now assume all are.
21982 for xxx in $nonxs_extensions ; do
21984 *) nonxs_ext="$nonxs_ext $xxx"
21996 A number of extensions are supplied with $package. You may choose to
21997 compile these extensions for dynamic loading (the default), compile
21998 them into the $package executable (static loading), or not include
21999 them at all. Answer "none" to include no extensions.
22000 Note that DynaLoader is always built and need not be mentioned here.
22003 case "$dynamic_ext" in
22005 : Exclude those listed in static_ext
22007 for xxx in $avail_ext; do
22008 case " $static_ext " in
22010 *) dflt="$dflt $xxx" ;;
22017 *) dflt="$dynamic_ext"
22018 # Perhaps we are reusing an old out-of-date config.sh.
22021 if test X"$dynamic_ext" != X"$avail_ext"; then
22023 NOTICE: Your previous config.sh list may be incorrect.
22024 The extensions now available to you are
22026 but the default list from your previous config.sh is
22038 rp="What extensions do you wish to load dynamically?"
22041 none) dynamic_ext=' ' ;;
22042 *) dynamic_ext="$ans" ;;
22045 case "$static_ext" in
22047 : Exclude those already listed in dynamic linking
22049 for xxx in $avail_ext; do
22050 case " $dynamic_ext " in
22052 *) dflt="$dflt $xxx" ;;
22059 *) dflt="$static_ext"
22066 rp="What extensions do you wish to load statically?"
22069 none) static_ext=' ' ;;
22070 *) static_ext="$ans" ;;
22075 A number of extensions are supplied with $package. Answer "none"
22076 to include no extensions.
22077 Note that DynaLoader is always built and need not be mentioned here.
22080 case "$static_ext" in
22081 '') dflt="$avail_ext" ;;
22082 *) dflt="$static_ext"
22083 # Perhaps we are reusing an old out-of-date config.sh.
22086 if test X"$static_ext" != X"$avail_ext"; then
22088 NOTICE: Your previous config.sh list may be incorrect.
22089 The extensions now available to you are
22091 but the default list from your previous config.sh is
22100 : Exclude those that are not xs extensions
22104 rp="What extensions do you wish to include?"
22107 none) static_ext=' ' ;;
22108 *) static_ext="$ans" ;;
22113 # Encode is a special case. If we are building Encode as a static
22114 # extension, we need to explicitly list its subextensions as well.
22115 # For other nested extensions, this is handled automatically by
22116 # the appropriate Makefile.PL.
22117 case " $static_ext " in
22118 *" Encode "*) # Add the subextensions of Encode
22120 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22121 static_ext="$static_ext Encode/$xxx"
22127 set X $dynamic_ext $static_ext $nonxs_ext
22131 # Sanity check: We require an extension suitable for use with
22132 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22133 # should show up as failures in the test suite, but it's helpful to
22134 # catch them now.) The 'extensions' list is normally sorted
22135 # alphabetically, so we need to accept either
22136 # DB_File ... Fcntl ... IO ....
22137 # or something like
22138 # Fcntl ... NDBM_File ... IO ....
22139 case " $extensions" in
22140 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22141 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22142 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22143 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22144 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22148 : Remove libraries needed only for extensions
22149 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22150 : The exception is SunOS 4.x, which needs them.
22151 case "${osname}X${osvers}" in
22155 *) case "$usedl" in
22156 $define|true|[yY]*)
22157 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22161 *) perllibs="$libs"
22167 : Remove build directory name from cppstdin so it can be used from
22168 : either the present location or the final installed location.
22170 : Get out of the UU directory to get correct path name.
22172 case "$cppstdin" in
22174 echo "Stripping down cppstdin path name"
22180 : end of configuration questions
22182 echo "End of configuration questions."
22185 : back to where it started
22186 if test -d ../UU; then
22190 : configuration may be unconditionally patched via a 'config.arch' file
22191 if $test -f config.arch; then
22192 echo "I see a config.arch file, loading it." >&4
22196 : configuration may be patched via a 'config.over' file
22197 if $test -f config.over; then
22200 rp='I see a config.over file. Do you wish to load it?'
22203 n*) echo "OK, I'll ignore it.";;
22205 echo "Configuration override changes have been loaded."
22210 : in case they want portability, strip down executable paths
22211 case "$d_portable" in
22214 echo "Stripping down executable paths..." >&4
22215 for file in $loclist $trylist; do
22217 eval $file=`basename $temp`
22222 : create config.sh file
22224 echo "Creating config.sh..." >&4
22225 $spitshell <<EOT >config.sh
22228 # This file was produced by running the Configure script. It holds all the
22229 # definitions figured out by Configure. Should you modify one of these values,
22230 # do not forget to propagate your changes by running "Configure -der". You may
22231 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22234 # Package name : $package
22235 # Source directory : $src
22236 # Configuration time: $cf_time
22237 # Configured by : $cf_by
22238 # Target system : $myuname
22241 : Add in command line options if available
22242 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22244 $spitshell <<EOT >>config.sh
22253 Revision='$Revision'
22261 alignbytes='$alignbytes'
22262 ansi2knr='$ansi2knr'
22263 aphostname='$aphostname'
22264 api_revision='$api_revision'
22265 api_subversion='$api_subversion'
22266 api_version='$api_version'
22267 api_versionstring='$api_versionstring'
22270 archlibexp='$archlibexp'
22271 archname64='$archname64'
22272 archname='$archname'
22273 archobjs='$archobjs'
22274 asctime_r_proto='$asctime_r_proto'
22283 byteorder='$byteorder'
22285 castflags='$castflags'
22288 cccdlflags='$cccdlflags'
22289 ccdlflags='$ccdlflags'
22291 ccflags_uselargefiles='$ccflags_uselargefiles'
22293 ccsymbols='$ccsymbols'
22294 ccversion='$ccversion'
22296 cf_email='$cf_email'
22298 charbits='$charbits'
22299 charsize='$charsize'
22303 clocktype='$clocktype'
22305 compress='$compress'
22306 contains='$contains'
22310 cpp_stuff='$cpp_stuff'
22311 cppccsymbols='$cppccsymbols'
22312 cppflags='$cppflags'
22314 cppminus='$cppminus'
22316 cppstdin='$cppstdin'
22317 cppsymbols='$cppsymbols'
22318 crypt_r_proto='$crypt_r_proto'
22319 cryptlib='$cryptlib'
22321 ctermid_r_proto='$ctermid_r_proto'
22322 ctime_r_proto='$ctime_r_proto'
22323 d_Gconvert='$d_Gconvert'
22324 d_PRIEUldbl='$d_PRIEUldbl'
22325 d_PRIFUldbl='$d_PRIFUldbl'
22326 d_PRIGUldbl='$d_PRIGUldbl'
22327 d_PRIXU64='$d_PRIXU64'
22328 d_PRId64='$d_PRId64'
22329 d_PRIeldbl='$d_PRIeldbl'
22330 d_PRIfldbl='$d_PRIfldbl'
22331 d_PRIgldbl='$d_PRIgldbl'
22332 d_PRIi64='$d_PRIi64'
22333 d_PRIo64='$d_PRIo64'
22334 d_PRIu64='$d_PRIu64'
22335 d_PRIx64='$d_PRIx64'
22336 d_SCNfldbl='$d_SCNfldbl'
22337 d__fwalk='$d__fwalk'
22338 d_access='$d_access'
22339 d_accessx='$d_accessx'
22342 d_archlib='$d_archlib'
22343 d_asctime64='$d_asctime64'
22344 d_asctime_r='$d_asctime_r'
22347 d_attribute_deprecated='$d_attribute_deprecated'
22348 d_attribute_format='$d_attribute_format'
22349 d_attribute_malloc='$d_attribute_malloc'
22350 d_attribute_nonnull='$d_attribute_nonnull'
22351 d_attribute_noreturn='$d_attribute_noreturn'
22352 d_attribute_pure='$d_attribute_pure'
22353 d_attribute_unused='$d_attribute_unused'
22354 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22358 d_bsdgetpgrp='$d_bsdgetpgrp'
22359 d_bsdsetpgrp='$d_bsdsetpgrp'
22360 d_builtin_choose_expr='$d_builtin_choose_expr'
22361 d_builtin_expect='$d_builtin_expect'
22363 d_c99_variadic_macros='$d_c99_variadic_macros'
22364 d_casti32='$d_casti32'
22365 d_castneg='$d_castneg'
22366 d_charvspr='$d_charvspr'
22368 d_chroot='$d_chroot'
22369 d_chsize='$d_chsize'
22371 d_clearenv='$d_clearenv'
22372 d_closedir='$d_closedir'
22373 d_cmsghdr_s='$d_cmsghdr_s'
22375 d_copysignl='$d_copysignl'
22376 d_cplusplus='$d_cplusplus'
22378 d_crypt_r='$d_crypt_r'
22380 d_ctermid='$d_ctermid'
22381 d_ctermid_r='$d_ctermid_r'
22382 d_ctime64='$d_ctime64'
22383 d_ctime_r='$d_ctime_r'
22384 d_cuserid='$d_cuserid'
22385 d_dbl_dig='$d_dbl_dig'
22386 d_dbminitproto='$d_dbminitproto'
22387 d_difftime64='$d_difftime64'
22388 d_difftime='$d_difftime'
22389 d_dir_dd_fd='$d_dir_dd_fd'
22391 d_dirnamlen='$d_dirnamlen'
22392 d_dlerror='$d_dlerror'
22393 d_dlopen='$d_dlopen'
22394 d_dlsymun='$d_dlsymun'
22395 d_dosuid='$d_dosuid'
22396 d_drand48_r='$d_drand48_r'
22397 d_drand48proto='$d_drand48proto'
22399 d_eaccess='$d_eaccess'
22400 d_endgrent='$d_endgrent'
22401 d_endgrent_r='$d_endgrent_r'
22402 d_endhent='$d_endhent'
22403 d_endhostent_r='$d_endhostent_r'
22404 d_endnent='$d_endnent'
22405 d_endnetent_r='$d_endnetent_r'
22406 d_endpent='$d_endpent'
22407 d_endprotoent_r='$d_endprotoent_r'
22408 d_endpwent='$d_endpwent'
22409 d_endpwent_r='$d_endpwent_r'
22410 d_endsent='$d_endsent'
22411 d_endservent_r='$d_endservent_r'
22412 d_eofnblk='$d_eofnblk'
22413 d_eunice='$d_eunice'
22414 d_faststdio='$d_faststdio'
22415 d_fchdir='$d_fchdir'
22416 d_fchmod='$d_fchmod'
22417 d_fchown='$d_fchown'
22419 d_fcntl_can_lock='$d_fcntl_can_lock'
22420 d_fd_macros='$d_fd_macros'
22421 d_fd_set='$d_fd_set'
22422 d_fds_bits='$d_fds_bits'
22423 d_fgetpos='$d_fgetpos'
22424 d_finite='$d_finite'
22425 d_finitel='$d_finitel'
22426 d_flexfnam='$d_flexfnam'
22428 d_flockproto='$d_flockproto'
22430 d_fp_class='$d_fp_class'
22431 d_fpathconf='$d_fpathconf'
22432 d_fpclass='$d_fpclass'
22433 d_fpclassify='$d_fpclassify'
22434 d_fpclassl='$d_fpclassl'
22435 d_fpos64_t='$d_fpos64_t'
22436 d_frexpl='$d_frexpl'
22437 d_fs_data_s='$d_fs_data_s'
22438 d_fseeko='$d_fseeko'
22439 d_fsetpos='$d_fsetpos'
22440 d_fstatfs='$d_fstatfs'
22441 d_fstatvfs='$d_fstatvfs'
22443 d_ftello='$d_ftello'
22445 d_futimes='$d_futimes'
22446 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22447 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22448 d_getaddrinfo='$d_getaddrinfo'
22449 d_getcwd='$d_getcwd'
22450 d_getespwnam='$d_getespwnam'
22451 d_getfsstat='$d_getfsstat'
22452 d_getgrent='$d_getgrent'
22453 d_getgrent_r='$d_getgrent_r'
22454 d_getgrgid_r='$d_getgrgid_r'
22455 d_getgrnam_r='$d_getgrnam_r'
22456 d_getgrps='$d_getgrps'
22457 d_gethbyaddr='$d_gethbyaddr'
22458 d_gethbyname='$d_gethbyname'
22459 d_gethent='$d_gethent'
22460 d_gethname='$d_gethname'
22461 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22462 d_gethostbyname_r='$d_gethostbyname_r'
22463 d_gethostent_r='$d_gethostent_r'
22464 d_gethostprotos='$d_gethostprotos'
22465 d_getitimer='$d_getitimer'
22466 d_getlogin='$d_getlogin'
22467 d_getlogin_r='$d_getlogin_r'
22468 d_getmnt='$d_getmnt'
22469 d_getmntent='$d_getmntent'
22470 d_getnameinfo='$d_getnameinfo'
22471 d_getnbyaddr='$d_getnbyaddr'
22472 d_getnbyname='$d_getnbyname'
22473 d_getnent='$d_getnent'
22474 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22475 d_getnetbyname_r='$d_getnetbyname_r'
22476 d_getnetent_r='$d_getnetent_r'
22477 d_getnetprotos='$d_getnetprotos'
22478 d_getpagsz='$d_getpagsz'
22479 d_getpbyname='$d_getpbyname'
22480 d_getpbynumber='$d_getpbynumber'
22481 d_getpent='$d_getpent'
22482 d_getpgid='$d_getpgid'
22483 d_getpgrp2='$d_getpgrp2'
22484 d_getpgrp='$d_getpgrp'
22485 d_getppid='$d_getppid'
22486 d_getprior='$d_getprior'
22487 d_getprotobyname_r='$d_getprotobyname_r'
22488 d_getprotobynumber_r='$d_getprotobynumber_r'
22489 d_getprotoent_r='$d_getprotoent_r'
22490 d_getprotoprotos='$d_getprotoprotos'
22491 d_getprpwnam='$d_getprpwnam'
22492 d_getpwent='$d_getpwent'
22493 d_getpwent_r='$d_getpwent_r'
22494 d_getpwnam_r='$d_getpwnam_r'
22495 d_getpwuid_r='$d_getpwuid_r'
22496 d_getsbyname='$d_getsbyname'
22497 d_getsbyport='$d_getsbyport'
22498 d_getsent='$d_getsent'
22499 d_getservbyname_r='$d_getservbyname_r'
22500 d_getservbyport_r='$d_getservbyport_r'
22501 d_getservent_r='$d_getservent_r'
22502 d_getservprotos='$d_getservprotos'
22503 d_getspnam='$d_getspnam'
22504 d_getspnam_r='$d_getspnam_r'
22505 d_gettimeod='$d_gettimeod'
22506 d_gmtime64='$d_gmtime64'
22507 d_gmtime_r='$d_gmtime_r'
22508 d_gnulibc='$d_gnulibc'
22509 d_grpasswd='$d_grpasswd'
22510 d_hasmntopt='$d_hasmntopt'
22512 d_ilogbl='$d_ilogbl'
22513 d_inc_version_list='$d_inc_version_list'
22515 d_inetaton='$d_inetaton'
22516 d_inetntop='$d_inetntop'
22517 d_inetpton='$d_inetpton'
22518 d_int64_t='$d_int64_t'
22519 d_isascii='$d_isascii'
22520 d_isfinite='$d_isfinite'
22523 d_isnanl='$d_isnanl'
22524 d_killpg='$d_killpg'
22525 d_lchown='$d_lchown'
22526 d_ldbl_dig='$d_ldbl_dig'
22527 d_libm_lib_version='$d_libm_lib_version'
22529 d_localtime64='$d_localtime64'
22530 d_localtime_r='$d_localtime_r'
22531 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22532 d_locconv='$d_locconv'
22534 d_longdbl='$d_longdbl'
22535 d_longlong='$d_longlong'
22536 d_lseekproto='$d_lseekproto'
22538 d_madvise='$d_madvise'
22539 d_malloc_good_size='$d_malloc_good_size'
22540 d_malloc_size='$d_malloc_size'
22542 d_mbstowcs='$d_mbstowcs'
22543 d_mbtowc='$d_mbtowc'
22544 d_memchr='$d_memchr'
22545 d_memcmp='$d_memcmp'
22546 d_memcpy='$d_memcpy'
22547 d_memmove='$d_memmove'
22548 d_memset='$d_memset'
22550 d_mkdtemp='$d_mkdtemp'
22551 d_mkfifo='$d_mkfifo'
22552 d_mkstemp='$d_mkstemp'
22553 d_mkstemps='$d_mkstemps'
22554 d_mktime64='$d_mktime64'
22555 d_mktime='$d_mktime'
22558 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22559 d_modflproto='$d_modflproto'
22560 d_mprotect='$d_mprotect'
22562 d_msg_ctrunc='$d_msg_ctrunc'
22563 d_msg_dontroute='$d_msg_dontroute'
22564 d_msg_oob='$d_msg_oob'
22565 d_msg_peek='$d_msg_peek'
22566 d_msg_proxy='$d_msg_proxy'
22567 d_msgctl='$d_msgctl'
22568 d_msgget='$d_msgget'
22569 d_msghdr_s='$d_msghdr_s'
22570 d_msgrcv='$d_msgrcv'
22571 d_msgsnd='$d_msgsnd'
22573 d_munmap='$d_munmap'
22574 d_mymalloc='$d_mymalloc'
22576 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22578 d_nl_langinfo='$d_nl_langinfo'
22579 d_nv_preserves_uv='$d_nv_preserves_uv'
22580 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22581 d_off64_t='$d_off64_t'
22582 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22583 d_oldpthreads='$d_oldpthreads'
22584 d_oldsock='$d_oldsock'
22586 d_pathconf='$d_pathconf'
22588 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22589 d_phostname='$d_phostname'
22592 d_portable='$d_portable'
22593 d_printf_format_null='$d_printf_format_null'
22594 d_procselfexe='$d_procselfexe'
22595 d_pseudofork='$d_pseudofork'
22596 d_pthread_atfork='$d_pthread_atfork'
22597 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22598 d_pthread_yield='$d_pthread_yield'
22600 d_pwchange='$d_pwchange'
22601 d_pwclass='$d_pwclass'
22602 d_pwcomment='$d_pwcomment'
22603 d_pwexpire='$d_pwexpire'
22604 d_pwgecos='$d_pwgecos'
22605 d_pwpasswd='$d_pwpasswd'
22606 d_pwquota='$d_pwquota'
22609 d_random_r='$d_random_r'
22610 d_readdir64_r='$d_readdir64_r'
22611 d_readdir='$d_readdir'
22612 d_readdir_r='$d_readdir_r'
22613 d_readlink='$d_readlink'
22615 d_recvmsg='$d_recvmsg'
22616 d_rename='$d_rename'
22617 d_rewinddir='$d_rewinddir'
22619 d_safebcpy='$d_safebcpy'
22620 d_safemcpy='$d_safemcpy'
22621 d_sanemcmp='$d_sanemcmp'
22622 d_sbrkproto='$d_sbrkproto'
22623 d_scalbnl='$d_scalbnl'
22624 d_sched_yield='$d_sched_yield'
22625 d_scm_rights='$d_scm_rights'
22626 d_seekdir='$d_seekdir'
22627 d_select='$d_select'
22629 d_semctl='$d_semctl'
22630 d_semctl_semid_ds='$d_semctl_semid_ds'
22631 d_semctl_semun='$d_semctl_semun'
22632 d_semget='$d_semget'
22634 d_sendmsg='$d_sendmsg'
22635 d_setegid='$d_setegid'
22636 d_seteuid='$d_seteuid'
22637 d_setgrent='$d_setgrent'
22638 d_setgrent_r='$d_setgrent_r'
22639 d_setgrps='$d_setgrps'
22640 d_sethent='$d_sethent'
22641 d_sethostent_r='$d_sethostent_r'
22642 d_setitimer='$d_setitimer'
22643 d_setlinebuf='$d_setlinebuf'
22644 d_setlocale='$d_setlocale'
22645 d_setlocale_r='$d_setlocale_r'
22646 d_setnent='$d_setnent'
22647 d_setnetent_r='$d_setnetent_r'
22648 d_setpent='$d_setpent'
22649 d_setpgid='$d_setpgid'
22650 d_setpgrp2='$d_setpgrp2'
22651 d_setpgrp='$d_setpgrp'
22652 d_setprior='$d_setprior'
22653 d_setproctitle='$d_setproctitle'
22654 d_setprotoent_r='$d_setprotoent_r'
22655 d_setpwent='$d_setpwent'
22656 d_setpwent_r='$d_setpwent_r'
22657 d_setregid='$d_setregid'
22658 d_setresgid='$d_setresgid'
22659 d_setresuid='$d_setresuid'
22660 d_setreuid='$d_setreuid'
22661 d_setrgid='$d_setrgid'
22662 d_setruid='$d_setruid'
22663 d_setsent='$d_setsent'
22664 d_setservent_r='$d_setservent_r'
22665 d_setsid='$d_setsid'
22666 d_setvbuf='$d_setvbuf'
22670 d_shmatprototype='$d_shmatprototype'
22671 d_shmctl='$d_shmctl'
22673 d_shmget='$d_shmget'
22674 d_sigaction='$d_sigaction'
22675 d_signbit='$d_signbit'
22676 d_sigprocmask='$d_sigprocmask'
22677 d_sigsetjmp='$d_sigsetjmp'
22678 d_sitearch='$d_sitearch'
22679 d_snprintf='$d_snprintf'
22680 d_sockatmark='$d_sockatmark'
22681 d_sockatmarkproto='$d_sockatmarkproto'
22682 d_socket='$d_socket'
22683 d_socklen_t='$d_socklen_t'
22684 d_sockpair='$d_sockpair'
22685 d_socks5_init='$d_socks5_init'
22686 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22688 d_srand48_r='$d_srand48_r'
22689 d_srandom_r='$d_srandom_r'
22690 d_sresgproto='$d_sresgproto'
22691 d_sresuproto='$d_sresuproto'
22692 d_statblks='$d_statblks'
22693 d_statfs_f_flags='$d_statfs_f_flags'
22694 d_statfs_s='$d_statfs_s'
22695 d_statvfs='$d_statvfs'
22696 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22697 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22698 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22699 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22700 d_stdio_stream_array='$d_stdio_stream_array'
22701 d_stdiobase='$d_stdiobase'
22702 d_stdstdio='$d_stdstdio'
22703 d_strchr='$d_strchr'
22704 d_strcoll='$d_strcoll'
22705 d_strctcpy='$d_strctcpy'
22706 d_strerrm='$d_strerrm'
22707 d_strerror='$d_strerror'
22708 d_strerror_r='$d_strerror_r'
22709 d_strftime='$d_strftime'
22710 d_strlcat='$d_strlcat'
22711 d_strlcpy='$d_strlcpy'
22712 d_strtod='$d_strtod'
22713 d_strtol='$d_strtol'
22714 d_strtold='$d_strtold'
22715 d_strtoll='$d_strtoll'
22716 d_strtoq='$d_strtoq'
22717 d_strtoul='$d_strtoul'
22718 d_strtoull='$d_strtoull'
22719 d_strtouq='$d_strtouq'
22720 d_strxfrm='$d_strxfrm'
22721 d_suidsafe='$d_suidsafe'
22722 d_symlink='$d_symlink'
22723 d_syscall='$d_syscall'
22724 d_syscallproto='$d_syscallproto'
22725 d_sysconf='$d_sysconf'
22726 d_sysernlst='$d_sysernlst'
22727 d_syserrlst='$d_syserrlst'
22728 d_system='$d_system'
22729 d_tcgetpgrp='$d_tcgetpgrp'
22730 d_tcsetpgrp='$d_tcsetpgrp'
22731 d_telldir='$d_telldir'
22732 d_telldirproto='$d_telldirproto'
22734 d_timegm='$d_timegm'
22736 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22737 d_tm_tm_zone='$d_tm_tm_zone'
22738 d_tmpnam_r='$d_tmpnam_r'
22739 d_truncate='$d_truncate'
22740 d_ttyname_r='$d_ttyname_r'
22741 d_tzname='$d_tzname'
22742 d_u32align='$d_u32align'
22743 d_ualarm='$d_ualarm'
22746 d_union_semun='$d_union_semun'
22747 d_unordered='$d_unordered'
22748 d_unsetenv='$d_unsetenv'
22749 d_usleep='$d_usleep'
22750 d_usleepproto='$d_usleepproto'
22752 d_vendorarch='$d_vendorarch'
22753 d_vendorbin='$d_vendorbin'
22754 d_vendorlib='$d_vendorlib'
22755 d_vendorscript='$d_vendorscript'
22757 d_void_closedir='$d_void_closedir'
22758 d_voidsig='$d_voidsig'
22759 d_voidtty='$d_voidtty'
22760 d_volatile='$d_volatile'
22761 d_vprintf='$d_vprintf'
22762 d_vsnprintf='$d_vsnprintf'
22764 d_waitpid='$d_waitpid'
22765 d_wcstombs='$d_wcstombs'
22766 d_wctomb='$d_wctomb'
22767 d_writev='$d_writev'
22770 db_hashtype='$db_hashtype'
22771 db_prefixtype='$db_prefixtype'
22772 db_version_major='$db_version_major'
22773 db_version_minor='$db_version_minor'
22774 db_version_patch='$db_version_patch'
22775 defvoidused='$defvoidused'
22776 direntrytype='$direntrytype'
22779 doublesize='$doublesize'
22781 drand48_r_proto='$drand48_r_proto'
22783 dynamic_ext='$dynamic_ext'
22789 endgrent_r_proto='$endgrent_r_proto'
22790 endhostent_r_proto='$endhostent_r_proto'
22791 endnetent_r_proto='$endnetent_r_proto'
22792 endprotoent_r_proto='$endprotoent_r_proto'
22793 endpwent_r_proto='$endpwent_r_proto'
22794 endservent_r_proto='$endservent_r_proto'
22795 eunicefix='$eunicefix'
22798 extensions='$extensions'
22799 extern_C='$extern_C'
22801 fflushNULL='$fflushNULL'
22802 fflushall='$fflushall'
22804 firstmakefile='$firstmakefile'
22806 fpossize='$fpossize'
22807 fpostype='$fpostype'
22808 freetype='$freetype'
22811 full_csh='$full_csh'
22812 full_sed='$full_sed'
22813 gccansipedantic='$gccansipedantic'
22814 gccosandvers='$gccosandvers'
22815 gccversion='$gccversion'
22816 getgrent_r_proto='$getgrent_r_proto'
22817 getgrgid_r_proto='$getgrgid_r_proto'
22818 getgrnam_r_proto='$getgrnam_r_proto'
22819 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22820 gethostbyname_r_proto='$gethostbyname_r_proto'
22821 gethostent_r_proto='$gethostent_r_proto'
22822 getlogin_r_proto='$getlogin_r_proto'
22823 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22824 getnetbyname_r_proto='$getnetbyname_r_proto'
22825 getnetent_r_proto='$getnetent_r_proto'
22826 getprotobyname_r_proto='$getprotobyname_r_proto'
22827 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22828 getprotoent_r_proto='$getprotoent_r_proto'
22829 getpwent_r_proto='$getpwent_r_proto'
22830 getpwnam_r_proto='$getpwnam_r_proto'
22831 getpwuid_r_proto='$getpwuid_r_proto'
22832 getservbyname_r_proto='$getservbyname_r_proto'
22833 getservbyport_r_proto='$getservbyport_r_proto'
22834 getservent_r_proto='$getservent_r_proto'
22835 getspnam_r_proto='$getspnam_r_proto'
22836 gidformat='$gidformat'
22842 gmtime_r_proto='$gmtime_r_proto'
22843 gnulibc_version='$gnulibc_version'
22845 groupcat='$groupcat'
22846 groupstype='$groupstype'
22849 h_sysfile='$h_sysfile'
22852 html1dir='$html1dir'
22853 html1direxp='$html1direxp'
22854 html3dir='$html3dir'
22855 html3direxp='$html3direxp'
22864 i_arpainet='$i_arpainet'
22865 i_assert='$i_assert'
22866 i_bsdioctl='$i_bsdioctl'
22870 i_dirent='$i_dirent'
22876 i_fp_class='$i_fp_class'
22878 i_gdbm_ndbm='$i_gdbm_ndbm'
22879 i_gdbmndbm='$i_gdbmndbm'
22881 i_ieeefp='$i_ieeefp'
22882 i_inttypes='$i_inttypes'
22883 i_langinfo='$i_langinfo'
22884 i_libutil='$i_libutil'
22885 i_limits='$i_limits'
22886 i_locale='$i_locale'
22887 i_machcthr='$i_machcthr'
22888 i_malloc='$i_malloc'
22889 i_mallocmalloc='$i_mallocmalloc'
22891 i_memory='$i_memory'
22892 i_mntent='$i_mntent'
22895 i_neterrno='$i_neterrno'
22896 i_netinettcp='$i_netinettcp'
22900 i_pthread='$i_pthread'
22902 i_rpcsvcdbm='$i_rpcsvcdbm'
22905 i_shadow='$i_shadow'
22907 i_stdarg='$i_stdarg'
22908 i_stddef='$i_stddef'
22909 i_stdlib='$i_stdlib'
22910 i_string='$i_string'
22911 i_sunmath='$i_sunmath'
22912 i_sysaccess='$i_sysaccess'
22913 i_sysdir='$i_sysdir'
22914 i_sysfile='$i_sysfile'
22915 i_sysfilio='$i_sysfilio'
22917 i_sysioctl='$i_sysioctl'
22918 i_syslog='$i_syslog'
22919 i_sysmman='$i_sysmman'
22920 i_sysmode='$i_sysmode'
22921 i_sysmount='$i_sysmount'
22922 i_sysndir='$i_sysndir'
22923 i_sysparam='$i_sysparam'
22924 i_syspoll='$i_syspoll'
22925 i_sysresrc='$i_sysresrc'
22926 i_syssecrt='$i_syssecrt'
22927 i_sysselct='$i_sysselct'
22928 i_syssockio='$i_syssockio'
22929 i_sysstat='$i_sysstat'
22930 i_sysstatfs='$i_sysstatfs'
22931 i_sysstatvfs='$i_sysstatvfs'
22932 i_systime='$i_systime'
22933 i_systimek='$i_systimek'
22934 i_systimes='$i_systimes'
22935 i_systypes='$i_systypes'
22936 i_sysuio='$i_sysuio'
22938 i_sysutsname='$i_sysutsname'
22939 i_sysvfs='$i_sysvfs'
22940 i_syswait='$i_syswait'
22941 i_termio='$i_termio'
22942 i_termios='$i_termios'
22944 i_unistd='$i_unistd'
22947 i_values='$i_values'
22948 i_varargs='$i_varargs'
22949 i_varhdr='$i_varhdr'
22951 ignore_versioned_solibs='$ignore_versioned_solibs'
22952 inc_version_list='$inc_version_list'
22953 inc_version_list_init='$inc_version_list_init'
22956 initialinstalllocation='$initialinstalllocation'
22957 installarchlib='$installarchlib'
22958 installbin='$installbin'
22959 installhtml1dir='$installhtml1dir'
22960 installhtml3dir='$installhtml3dir'
22961 installman1dir='$installman1dir'
22962 installman3dir='$installman3dir'
22963 installprefix='$installprefix'
22964 installprefixexp='$installprefixexp'
22965 installprivlib='$installprivlib'
22966 installscript='$installscript'
22967 installsitearch='$installsitearch'
22968 installsitebin='$installsitebin'
22969 installsitehtml1dir='$installsitehtml1dir'
22970 installsitehtml3dir='$installsitehtml3dir'
22971 installsitelib='$installsitelib'
22972 installsiteman1dir='$installsiteman1dir'
22973 installsiteman3dir='$installsiteman3dir'
22974 installsitescript='$installsitescript'
22975 installstyle='$installstyle'
22976 installusrbinperl='$installusrbinperl'
22977 installvendorarch='$installvendorarch'
22978 installvendorbin='$installvendorbin'
22979 installvendorhtml1dir='$installvendorhtml1dir'
22980 installvendorhtml3dir='$installvendorhtml3dir'
22981 installvendorlib='$installvendorlib'
22982 installvendorman1dir='$installvendorman1dir'
22983 installvendorman3dir='$installvendorman3dir'
22984 installvendorscript='$installvendorscript'
22986 issymlink='$issymlink'
22987 ivdformat='$ivdformat'
22990 known_extensions='$known_extensions'
22993 lddlflags='$lddlflags'
22995 ldflags_uselargefiles='$ldflags_uselargefiles'
22996 ldlibpthname='$ldlibpthname'
23003 libsdirs='$libsdirs'
23004 libsfiles='$libsfiles'
23005 libsfound='$libsfound'
23006 libspath='$libspath'
23007 libswanted='$libswanted'
23008 libswanted_uselargefiles='$libswanted_uselargefiles'
23014 localtime_r_proto='$localtime_r_proto'
23015 locincpth='$locincpth'
23016 loclibpth='$loclibpth'
23017 longdblsize='$longdblsize'
23018 longlongsize='$longlongsize'
23019 longsize='$longsize'
23023 lseeksize='$lseeksize'
23024 lseektype='$lseektype'
23027 madlyobj='$madlyobj'
23028 madlysrc='$madlysrc'
23032 make_set_make='$make_set_make'
23033 mallocobj='$mallocobj'
23034 mallocsrc='$mallocsrc'
23035 malloctype='$malloctype'
23037 man1direxp='$man1direxp'
23040 man3direxp='$man3direxp'
23042 mips_type='$mips_type'
23043 mistrustnm='$mistrustnm'
23045 mmaptype='$mmaptype'
23046 modetype='$modetype'
23048 multiarch='$multiarch'
23050 myarchname='$myarchname'
23051 mydomain='$mydomain'
23052 myhostname='$myhostname'
23055 need_va_copy='$need_va_copy'
23056 netdb_hlen_type='$netdb_hlen_type'
23057 netdb_host_type='$netdb_host_type'
23058 netdb_name_type='$netdb_name_type'
23059 netdb_net_type='$netdb_net_type'
23062 nm_so_opt='$nm_so_opt'
23063 nonxs_ext='$nonxs_ext'
23065 nvEUformat='$nvEUformat'
23066 nvFUformat='$nvFUformat'
23067 nvGUformat='$nvGUformat'
23068 nv_overflows_integers_at='$nv_overflows_integers_at'
23069 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23070 nveformat='$nveformat'
23071 nvfformat='$nvfformat'
23072 nvgformat='$nvgformat'
23075 o_nonblock='$o_nonblock'
23077 old_pthread_create_joinable='$old_pthread_create_joinable'
23078 optimize='$optimize'
23079 orderlib='$orderlib'
23082 otherlibdirs='$otherlibdirs'
23086 patchlevel='$patchlevel'
23087 path_sep='$path_sep'
23090 perl_patchlevel='$perl_patchlevel'
23091 perladmin='$perladmin'
23092 perllibs='$perllibs'
23093 perlpath='$perlpath'
23095 phostname='$phostname'
23101 prefixexp='$prefixexp'
23103 privlibexp='$privlibexp'
23104 procselfexe='$procselfexe'
23105 prototype='$prototype'
23107 quadkind='$quadkind'
23108 quadtype='$quadtype'
23109 randbits='$randbits'
23110 randfunc='$randfunc'
23111 random_r_proto='$random_r_proto'
23112 randseedtype='$randseedtype'
23114 rd_nodata='$rd_nodata'
23115 readdir64_r_proto='$readdir64_r_proto'
23116 readdir_r_proto='$readdir_r_proto'
23117 revision='$revision'
23123 sGMTIME_max='$sGMTIME_max'
23124 sGMTIME_min='$sGMTIME_min'
23125 sLOCALTIME_max='$sLOCALTIME_max'
23126 sLOCALTIME_min='$sLOCALTIME_min'
23127 sPRIEUldbl='$sPRIEUldbl'
23128 sPRIFUldbl='$sPRIFUldbl'
23129 sPRIGUldbl='$sPRIGUldbl'
23130 sPRIXU64='$sPRIXU64'
23132 sPRIeldbl='$sPRIeldbl'
23133 sPRIfldbl='$sPRIfldbl'
23134 sPRIgldbl='$sPRIgldbl'
23139 sSCNfldbl='$sSCNfldbl'
23140 sched_yield='$sched_yield'
23141 scriptdir='$scriptdir'
23142 scriptdirexp='$scriptdirexp'
23144 seedfunc='$seedfunc'
23145 selectminbits='$selectminbits'
23146 selecttype='$selecttype'
23147 sendmail='$sendmail'
23148 setgrent_r_proto='$setgrent_r_proto'
23149 sethostent_r_proto='$sethostent_r_proto'
23150 setlocale_r_proto='$setlocale_r_proto'
23151 setnetent_r_proto='$setnetent_r_proto'
23152 setprotoent_r_proto='$setprotoent_r_proto'
23153 setpwent_r_proto='$setpwent_r_proto'
23154 setservent_r_proto='$setservent_r_proto'
23157 sharpbang='$sharpbang'
23158 shmattype='$shmattype'
23159 shortsize='$shortsize'
23162 sig_count='$sig_count'
23163 sig_name='$sig_name'
23164 sig_name_init='$sig_name_init'
23166 sig_num_init='$sig_num_init'
23167 sig_size='$sig_size'
23168 signal_t='$signal_t'
23169 sitearch='$sitearch'
23170 sitearchexp='$sitearchexp'
23172 sitebinexp='$sitebinexp'
23173 sitehtml1dir='$sitehtml1dir'
23174 sitehtml1direxp='$sitehtml1direxp'
23175 sitehtml3dir='$sitehtml3dir'
23176 sitehtml3direxp='$sitehtml3direxp'
23178 sitelib_stem='$sitelib_stem'
23179 sitelibexp='$sitelibexp'
23180 siteman1dir='$siteman1dir'
23181 siteman1direxp='$siteman1direxp'
23182 siteman3dir='$siteman3dir'
23183 siteman3direxp='$siteman3direxp'
23184 siteprefix='$siteprefix'
23185 siteprefixexp='$siteprefixexp'
23186 sitescript='$sitescript'
23187 sitescriptexp='$sitescriptexp'
23188 sizesize='$sizesize'
23189 sizetype='$sizetype'
23193 sockethdr='$sockethdr'
23194 socketlib='$socketlib'
23195 socksizetype='$socksizetype'
23197 spackage='$spackage'
23198 spitshell='$spitshell'
23199 srand48_r_proto='$srand48_r_proto'
23200 srandom_r_proto='$srandom_r_proto'
23202 ssizetype='$ssizetype'
23203 startperl='$startperl'
23205 static_ext='$static_ext'
23207 stdio_base='$stdio_base'
23208 stdio_bufsiz='$stdio_bufsiz'
23209 stdio_cnt='$stdio_cnt'
23210 stdio_filbuf='$stdio_filbuf'
23211 stdio_ptr='$stdio_ptr'
23212 stdio_stream_array='$stdio_stream_array'
23213 strerror_r_proto='$strerror_r_proto'
23216 subversion='$subversion'
23220 targetarch='$targetarch'
23224 timeincl='$timeincl'
23225 timetype='$timetype'
23226 tmpnam_r_proto='$tmpnam_r_proto'
23232 ttyname_r_proto='$ttyname_r_proto'
23241 uidformat='$uidformat'
23247 uquadtype='$uquadtype'
23248 use5005threads='$use5005threads'
23249 use64bitall='$use64bitall'
23250 use64bitint='$use64bitint'
23251 usecrosscompile='$usecrosscompile'
23252 usedevel='$usedevel'
23254 usedtrace='$usedtrace'
23255 usefaststdio='$usefaststdio'
23256 useithreads='$useithreads'
23257 uselargefiles='$uselargefiles'
23258 uselongdouble='$uselongdouble'
23259 usemallocwrap='$usemallocwrap'
23260 usemorebits='$usemorebits'
23261 usemultiplicity='$usemultiplicity'
23262 usemymalloc='$usemymalloc'
23264 useopcode='$useopcode'
23265 useperlio='$useperlio'
23266 useposix='$useposix'
23267 usereentrant='$usereentrant'
23268 userelocatableinc='$userelocatableinc'
23270 useshrplib='$useshrplib'
23271 usesitecustomize='$usesitecustomize'
23272 usesocks='$usesocks'
23273 usethreads='$usethreads'
23274 usevendorprefix='$usevendorprefix'
23275 usevfork='$usevfork'
23278 uvXUformat='$uvXUformat'
23279 uvoformat='$uvoformat'
23282 uvuformat='$uvuformat'
23283 uvxformat='$uvxformat'
23284 vendorarch='$vendorarch'
23285 vendorarchexp='$vendorarchexp'
23286 vendorbin='$vendorbin'
23287 vendorbinexp='$vendorbinexp'
23288 vendorhtml1dir='$vendorhtml1dir'
23289 vendorhtml1direxp='$vendorhtml1direxp'
23290 vendorhtml3dir='$vendorhtml3dir'
23291 vendorhtml3direxp='$vendorhtml3direxp'
23292 vendorlib='$vendorlib'
23293 vendorlib_stem='$vendorlib_stem'
23294 vendorlibexp='$vendorlibexp'
23295 vendorman1dir='$vendorman1dir'
23296 vendorman1direxp='$vendorman1direxp'
23297 vendorman3dir='$vendorman3dir'
23298 vendorman3direxp='$vendorman3direxp'
23299 vendorprefix='$vendorprefix'
23300 vendorprefixexp='$vendorprefixexp'
23301 vendorscript='$vendorscript'
23302 vendorscriptexp='$vendorscriptexp'
23304 version_patchlevel_string='$version_patchlevel_string'
23305 versiononly='$versiononly'
23307 voidflags='$voidflags'
23310 yaccflags='$yaccflags'
23315 : add special variables
23316 $test -f $src/patchlevel.h && \
23317 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23318 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23319 echo "PERL_CONFIG_SH=true" >>config.sh
23321 : propagate old symbols
23322 if $test -f UU/config.sh; then
23323 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23324 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23325 config.sh config.sh UU/oldconfig.sh |\
23326 $sort | $uniq -u >UU/oldsyms
23327 set X `cat UU/oldsyms`
23333 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23335 echo ": Variables propagated from previous config.sh file." >>config.sh
23336 for sym in `cat UU/oldsyms`; do
23337 echo " Propagating $hint variable "'$'"$sym..."
23338 eval 'tmp="$'"${sym}"'"'
23340 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23346 : Finish up by extracting the .SH files
23350 echo "Extraction done."
23360 If you'd like to make any changes to the config.sh file before I begin
23361 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23364 rp="Press return or use a shell escape to edit config.sh:"
23369 *) : in case they cannot read
23370 sh 1>&4 -c "$ans";;
23375 : if this fails, just run all the .SH files by hand
23384 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23391 Now you need to generate make dependencies by running "$make depend".
23392 You might prefer to run it in background: "$make depend > makedepend.out &"
23393 It can take a while, so you might not want to run it right now.
23398 rp="Run $make depend now?"
23402 $make depend && echo "Now you must run '$make'."
23405 echo "You must run '$make depend' then '$make'."
23408 elif test -f [Mm]akefile; then
23410 echo "Now you must run a $make."
23412 echo "Configure done."
23415 if $test -f Policy.sh; then
23418 If you compile $package on a different machine or from a different object
23419 directory, copy the Policy.sh file from this object directory to the
23420 new one before you run Configure -- this will help you with most of
23421 the policy defaults.
23425 if $test -f config.msg; then
23426 echo "Hmm. I also noted the following information while running:"
23428 $cat config.msg >&4
23431 $rm -f kit*isdone ark*isdone