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 # For more information on patching Configure, see pod/perlhack.pod
24 # The metaunits are also available from the public git repository:
25 # http://perl5.git.perl.org/metaconfig.git/ or
26 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
28 # See Porting/pumpkin.pod for more information on metaconfig.
31 # Generated on Sun Jul 31 12:11:29 CEST 2011 [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=''
633 d_old_pthread_create_joinable=''
634 old_pthread_create_joinable=''
636 d_pthread_attr_setscope=''
675 sethostent_r_proto=''
692 setprotoent_r_proto=''
704 setservent_r_proto=''
740 d_sprintf_returns_strlen=''
752 perl_static_inline=''
757 d_stdio_ptr_lval_nochange_cnt=''
758 d_stdio_ptr_lval_sets_cnt=''
902 d_gdbm_ndbm_h_uses_prototypes=''
903 d_gdbmndbm_h_uses_prototypes=''
905 d_ndbm_h_uses_prototypes=''
980 d_inc_version_list=''
982 inc_version_list_init=''
1001 ignore_versioned_solibs=''
1065 d_perl_otherlibdirs=''
1073 api_versionstring=''
1079 version_patchlevel_string=''
1083 d_nv_preserves_uv=''
1084 d_nv_zero_is_allbits_zero=''
1095 nv_overflows_integers_at=''
1096 nv_preserves_uv_bits=''
1168 installsitehtml1dir=''
1171 installsitehtml3dir=''
1178 installsiteman1dir=''
1181 installsiteman3dir=''
1186 installsitescript=''
1203 d_stdio_stream_array=''
1204 stdio_stream_array=''
1221 ccflags_uselargefiles=''
1222 ldflags_uselargefiles=''
1223 libswanted_uselargefiles=''
1244 installvendorarch=''
1251 installvendorhtml1dir=''
1253 vendorhtml1direxp=''
1254 installvendorhtml3dir=''
1256 vendorhtml3direxp=''
1262 installvendorman1dir=''
1265 installvendorman3dir=''
1272 installvendorscript=''
1285 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1288 : We must find out about Eunice early
1290 if test -f /etc/unixtovms; then
1291 eunicefix=/etc/unixtovms
1293 if test -f /etc/unixtovms.exe; then
1294 eunicefix=/etc/unixtovms.exe
1297 : Set executable suffix now -- needed before hints available
1298 if test -f "/libs/version.library"; then
1301 elif test -f "/system/gnu_library/bin/ar.pm"; then
1304 elif test -n "$DJGPP"; then
1307 elif test -d c:/. -o -n "$is_os2" ; then
1315 : Possible local include directories to search.
1316 : Set locincpth to "" in a hint file to defeat local include searches.
1317 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1318 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1320 : no include file wanted by default
1323 : Enable -DEBUGGING and -DDEBUGGING from the command line
1327 : set usethreads on the Configure command line to enable threads.
1328 usereentrant='undef'
1329 : Trailing extension. Override this in a hint file, if needed.
1330 : Extra object files, if any, needed on this platform.
1333 : change the next line if compiling for Xenix/286 on Xenix/386
1334 xlibpth='/usr/lib/386 /lib/386'
1335 : Possible local library directories to search.
1336 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1337 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1339 : general looking path for locating libraries
1340 glibpth="/lib /usr/lib $xlibpth"
1341 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1342 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1343 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1344 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1346 : Private path used by Configure to find libraries. Its value
1347 : is prepended to libpth. This variable takes care of special
1348 : machines, like the mips. Usually, it should be empty.
1351 : default library list
1353 : some systems want to use only the non-versioned libso:s
1354 ignore_versioned_solibs=''
1355 : full support for void wanted by default
1361 : set useposix=false in your hint file to disable the POSIX extension.
1363 : set useopcode=false in your hint file to disable the Opcode extension.
1366 ccflags_uselargefiles=''
1367 ldflags_uselargefiles=''
1368 libswanted_uselargefiles=''
1369 : set usemultiplicity on the Configure command line to enable multiplicity.
1370 : set usesocks on the Configure command line to enable socks.
1371 : List of libraries we want.
1372 : If anyone needs extra -lxxx, put those in a hint file.
1373 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1374 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1375 : We probably want to search /usr/shlib before most other libraries.
1376 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1377 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1378 glibpth="/usr/shlib $glibpth"
1379 : Do not use vfork unless overridden by a hint file.
1382 : Find the basic shell for Bourne shell scripts
1386 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1389 if test -f "$xxx"; then
1392 : Build up a list and do a single loop so we can 'break' out.
1393 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1394 for xxx in sh bash ksh pdksh ash; do
1396 try="$try ${p}/${xxx}"
1400 if test -f "$xxx"; then
1403 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1406 elif test -f "$xxx.exe"; then
1417 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1419 Usually it's in /bin/sh. How did you even get this far?
1420 Please contact me (Perl Maintainers) at perlbug@perl.org and
1421 we'll try to straighten this all out.
1427 : see if sh knows # comments
1428 if `$sh -c '#' >/dev/null 2>&1`; then
1432 test -f $xcat$_exe || xcat=/usr/bin/cat
1433 if test ! -f $xcat$_exe; then
1434 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1435 if test -f $p/cat$_exe; then
1440 if test ! -f $xcat$_exe; then
1441 echo "Can't find cat anywhere!"
1445 echo "#!$xcat" >sharp
1448 ./sharp > today 2>/dev/null
1449 if test -s today; then
1452 echo "#! $xcat" > sharp
1455 ./sharp > today 2>/dev/null
1456 if test -s today; then
1464 echo "Your $sh doesn't grok # comments--I will strip them later on."
1467 echo "exec grep -v '^[ ]*#'" >spitshell
1469 $eunicefix spitshell
1470 spitshell=`pwd`/spitshell
1472 echo "I presume that if # doesn't work, #! won't work either!"
1477 : figure out how to guarantee sh startup
1479 '') startsh=${sharpbang}${sh} ;;
1491 : echo "Yup, it does."
1493 echo "Hmm... '$startsh' does not guarantee sh startup..."
1494 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1498 : Save command line options in file UU/cmdline.opt for later use in
1499 : generating config.sh.
1500 cat > cmdline.opt <<EOSH
1501 : Configure command line arguments.
1510 cat >>cmdline.opt <<EOSH
1511 config_arg$argn='$arg'
1513 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1516 arg_exp=`cat cmdl.opt`
1517 args_exp="$args_exp$args_sep'$arg_exp'"
1518 argn=`expr $argn + 1`
1523 : produce awk script to parse command line options
1524 cat >options.awk <<'EOF'
1526 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1528 len = length(optstr);
1529 for (i = 1; i <= len; i++) {
1530 c = substr(optstr, i, 1);
1531 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1542 if (substr(str, 1, 1) != "-") {
1543 printf("'%s'\n", str);
1547 for (i = 2; i <= len; i++) {
1548 c = substr(str, i, 1);
1550 printf("-%s\n", substr(str, i));
1556 printf("'%s'\n", substr(str, i + 1));
1569 : process the command line options
1570 set X `for arg in "$@"; do echo "X$arg"; done |
1571 sed -e s/X// | awk -f options.awk`
1576 : set up default values
1586 rm -f optdef.sh posthint.sh
1587 cat >optdef.sh <<EOS
1593 while test $# -gt 0; do
1595 -d) shift; fastread=yes;;
1596 -e) shift; alldone=cont;;
1600 if test -r "$1"; then
1603 echo "$me: cannot read config file $1." >&2
1609 -h) shift; error=true;;
1610 -r) shift; reuseval=true;;
1611 -s) shift; silent=true; realsilent=true;;
1612 -E) shift; alldone=exit;;
1613 -K) shift; knowitall=true;;
1614 -O) shift; override=true;;
1615 -S) shift; silent=true; extractsh=true;;
1620 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1621 echo "$me: ignoring -D $1" >&2
1624 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1625 *) echo "$1='define'" >> optdef.sh;;
1632 *=) echo "$1" >> optdef.sh;;
1634 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1635 echo "$me: ignoring -U $1" >&2
1637 *) echo "$1='undef'" >> optdef.sh;;
1648 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1652 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1653 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1659 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1660 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1661 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1662 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1663 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1664 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1670 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1672 echo "$yyy=''" >> posthint.sh ;;
1677 echo "$yyy='$zzz'" >> posthint.sh ;;
1679 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1681 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1686 echo "$yyy=$zzz" >> posthint.sh ;;
1687 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1691 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1694 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1702 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1703 [-U symbol] [-U symbol=] [-A command:symbol...]
1704 -d : use defaults for all answers.
1705 -e : go on without questioning past the production of config.sh.
1706 -f : specify an alternate default configuration file.
1707 -h : print this help message and exit (with an error status).
1708 -r : reuse C symbols value if possible (skips costly nm extraction).
1709 -s : silent mode, only echoes questions and essential information.
1710 -D : define symbol to have some value:
1711 -D symbol symbol gets the value 'define'
1712 -D symbol=value symbol gets the value 'value'
1713 common used examples (see INSTALL for more info):
1714 -Duse64bitint use 64bit integers
1715 -Duse64bitall use 64bit integers and pointers
1716 -Dusethreads use thread support
1717 -Dinc_version_list=none do not include older perl trees in @INC
1718 -DEBUGGING=none DEBUGGING options
1719 -Dcc=gcc choose your compiler
1720 -Dprefix=/opt/perl5 choose your destination
1721 -E : stop at the end of questions, after having produced config.sh.
1722 -K : do not use unless you know what you are doing.
1723 -O : let -D and -U override definitions from loaded configuration file.
1724 -S : perform variable substitutions on all .SH files (can mix with -f)
1725 -U : undefine symbol:
1726 -U symbol symbol gets the value 'undef'
1727 -U symbol= symbol gets completely empty
1729 -A : manipulate symbol after the platform specific hints have been applied:
1730 -A append:symbol=value append value to symbol
1731 -A symbol=value like append:, but with a separating space
1732 -A define:symbol=value define symbol to have value
1733 -A clear:symbol define symbol to be ''
1734 -A define:symbol define symbol to be 'define'
1735 -A eval:symbol=value define symbol to be eval of value
1736 -A prepend:symbol=value prepend value to symbol
1737 -A undef:symbol define symbol to be 'undef'
1738 -A undef:symbol= define symbol to be ''
1739 e.g.: -A prepend:libswanted='cl pthread '
1740 -A ccflags=-DSOME_MACRO
1741 -V : print version number and exit (with a zero status).
1748 case "$fastread$alldone" in
1751 case "$extractsh" in
1754 if test ! -t 0; then
1755 echo "Say 'sh Configure', not 'sh <Configure'"
1765 true) exec 1>/dev/null;;
1768 : run the defines and the undefines, if any, but leave the file out there...
1771 : create the posthint manipulation script and leave the file out there...
1776 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1777 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1778 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1779 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1780 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1783 : Some greps do not return status, grrr.
1784 echo "grimblepritz" >grimble
1785 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1787 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1793 : the following should work in any shell
1797 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1798 cat >contains <<'EOSS'
1799 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1804 : Find the path to the source tree
1807 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1811 *) src=`cd ../$src && pwd` ;;
1824 if test -f $rsrc/Configure && \
1825 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1827 : found it, so we are ok.
1830 for src in . .. ../.. ../../.. ../../../..; do
1831 if test -f ../$src/Configure && \
1832 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1843 Sorry, I can't seem to locate the source dir for $package. Please start
1844 Configure with an explicit path -- i.e. /some/path/Configure.
1852 echo "Sources for $package found in \"$src\"." >&4
1856 : script used to extract .SH files with variable substitutions
1857 cat >extract <<'EOS'
1859 echo "Doing variable substitutions on .SH files..."
1860 if test -f MANIFEST; then
1861 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1863 echo "(Looking for .SH files under the source directory.)"
1864 set x `(cd "$src"; find . -name "*.SH" -print)`
1868 0) set x `(cd "$src"; echo *.SH)`; shift;;
1870 if test ! -f "$src/$1"; then
1876 while test $name; do
1877 if test ! -d "$name"; then
1878 create="$name $create";
1879 name=`echo $name | sed -e "s|^[^/]*$||"`;
1880 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1885 for file in $create; do
1894 dir=`expr X$file : 'X\(.*\)/'`
1895 file=`expr X$file : 'X.*/\(.*\)'`
1896 (cd "$dir" && . ./$file)
1906 dir=`expr X$file : 'X\(.*\)/'`
1907 file=`expr X$file : 'X.*/\(.*\)'`
1908 (set x $dir; shift; eval $mkdir_p)
1909 sh <"$src/$dir/$file"
1918 if test -f "$src/config_h.SH"; then
1919 if test ! -f config.h; then
1920 : oops, they left it out of MANIFEST, probably, so do it anyway.
1921 . "$src/config_h.SH"
1926 : extract files and exit if asked to do so
1927 case "$extractsh" in
1929 case "$realsilent" in
1933 case "$config_sh" in
1934 '') config_sh='config.sh';;
1937 echo "Fetching answers from $config_sh..."
1940 test "$override" && . ./optdef.sh
1944 echo "Extraction done."
1949 : Eunice requires " " instead of "", can you believe it
1952 echo "Beginning of configuration questions for $package."
1954 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1956 : first determine how to suppress newline on echo command
1958 echo "Checking echo to see how to suppress newlines..."
1959 (echo "hi there\c" ; echo " ") >.echotmp
1960 if $contains c .echotmp >/dev/null 2>&1 ; then
1971 echo $n "The star should be here-->$c"
1975 : Now test for existence of everything in MANIFEST
1977 if test -f "$rsrc/MANIFEST"; then
1978 echo "First let's make sure your kit is complete. Checking..." >&4
1979 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1980 (split -l 50 2>/dev/null || split -50)
1983 for filelist in x??; do
1984 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1985 >/dev/null 2>>"$tmppwd/missing")
1987 if test -s missing; then
1991 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1993 You have the option of continuing the configuration process, despite the
1994 distinct possibility that your kit is damaged, by typing 'y'es. If you
1995 do, don't blame me if something goes wrong. I advise you to type 'n'o
1996 and contact the author (perlbug@perl.org).
1999 echo $n "Continue? [n] $c" >&4
2003 echo "Continuing..." >&4
2007 echo "ABORTING..." >&4
2012 echo "Looks good..."
2015 echo "There is no MANIFEST file. I hope your kit is complete !"
2019 : Find the appropriate value for a newline for tr
2021 if test -n "$DJGPP"; then
2024 if test X"$trnl" = X; then
2025 case "`echo foo|tr '\n' x 2>/dev/null`" in
2029 if test X"$trnl" = X; then
2030 case "`echo foo|tr '\012' x 2>/dev/null`" in
2031 foox) trnl='\012' ;;
2034 if test X"$trnl" = X; then
2035 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2036 fooxy) trnl='\n\r' ;;
2039 if test X"$trnl" = X; then
2042 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2048 : compute the number of columns on the terminal for proper question formatting
2053 : set up the echo used in my read
2054 myecho="case \"\$xxxm\" in
2055 '') echo $n \"\$rp $c\" >&4;;
2057 '') echo $n \"[\$xxxm] $c\";;
2059 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2061 echo $n \"[\$xxxm] $c\" >&4
2063 echo $n \"\$rp [\$xxxm] $c\" >&4
2069 : now set up to do reads with possible shell escape and default assignment
2075 case "\$fastread" in
2076 yes) case "\$dflt" in
2079 case "\$silent-\$rp" in
2084 *) case "\$silent" in
2085 true) case "\$rp" in
2090 while expr "X\$ans" : "X!" >/dev/null; do
2094 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2102 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2111 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2116 echo "(OK, I'll run with -d after this question.)" >&4
2119 echo "*** Sorry, \$1 not supported yet." >&4
2129 echo "*** Substitution done -- please confirm."
2131 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2136 echo "*** Error -- try again."
2143 case "\$ans\$xxxm\$nostick" in
2155 : create .config dir to save info across Configure sessions
2156 test -d ../.config || mkdir ../.config
2157 cat >../.config/README <<EOF
2158 This directory created by Configure to save information that should
2159 persist across sessions for $package.
2161 You may safely delete it if you wish.
2164 : See if we are using a devel version and want that
2165 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2168 usedevel="$define" ;;
2169 *) case "$xversion" in
2172 *** WHOA THERE!!! ***
2174 This is an UNSTABLE DEVELOPMENT release.
2175 The version of this $package distribution is $xversion, that is, odd,
2176 (as opposed to even) and that signifies a development release.
2177 If you want a maintenance release, you want an even-numbered version.
2179 Do ***NOT*** install this into production use.
2180 Data corruption and crashes are possible.
2182 It is most seriously suggested that you do not continue any further
2183 unless you want to help in developing and debugging Perl.
2185 If you *still* want to build perl, you can answer 'y' now,
2186 or pass -Dusedevel to Configure.
2189 rp='Do you really want to continue?'
2193 [yY]) echo >&4 "Okay, continuing."
2194 usedevel="$define" ;;
2195 *) echo >&4 "Okay, bye."
2206 case "$versiononly" in
2207 '') versiononly="$define" ;;
2209 case "$installusrbinperl" in
2210 '') installusrbinperl="$undef" ;;
2215 : general instructions
2218 user=`(logname) 2>/dev/null`
2220 '') user=`whoami 2>&1`;;
2222 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2225 rp='Would you like to see the instructions?'
2236 This installation shell script will examine your system and ask you questions
2237 to determine how the perl5 package should be installed. If you get
2238 stuck on a question, you may use a ! shell escape to start a subshell or
2239 execute a command. Many of the questions will have default answers in square
2240 brackets; typing carriage return will give you the default.
2242 On some of the questions which ask for file or directory names you are allowed
2243 to use the ~name construct to specify the login directory belonging to "name",
2244 even if you don't have a shell which knows about that. Questions where this is
2245 allowed will be marked "(~name ok)".
2249 dflt='Type carriage return to continue'
2253 The prompter used in this script allows you to use shell variables and
2254 backticks in your answers. You may use $1, $2, etc... to refer to the words
2255 in the default answer, as if the default line was a set of arguments given to a
2256 script shell. This means you may also use $* to repeat the whole default line,
2257 so you do not have to re-type everything to add something to the default.
2259 Every time there is a substitution, you will have to confirm. If there is an
2260 error (e.g. an unmatched backtick), the default answer will remain unchanged
2261 and you will be prompted again.
2263 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2264 the questions and use the computed defaults (or the previous answers if there
2265 was already a config.sh file). Type 'Configure -h' for a list of options.
2266 You may also start interactively and then answer '& -d' at any prompt to turn
2267 on the non-interactive behaviour for the remainder of the execution.
2273 Much effort has been expended to ensure that this shell script will run on any
2274 Unix system. If despite that it blows up on yours, your best bet is to edit
2275 Configure and run it again. If you can't run Configure for some reason,
2276 you'll have to generate a config.sh file by hand. Whatever problems you
2277 have, let me (perlbug@perl.org) know how I blew it.
2279 This installation script affects things in two ways:
2281 1) it may do direct variable substitutions on some of the files included
2283 2) it builds a config.h file for inclusion in C programs. You may edit
2284 any of these files as the need arises after running this script.
2286 If you make a mistake on a question, there is no easy way to back up to it
2287 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2288 files. Configure will offer to let you do this before it runs the SH files.
2291 dflt='Type carriage return to continue'
2293 case "$firsttime" in
2294 true) echo $user >>../.config/instruct;;
2298 : find out where common programs are
2300 echo "Locating common programs..." >&4
2313 if test -d \$dir/\$thing; then
2319 for thisthing in \$dir/\$thing; do
2320 : just loop through to pick last item
2322 if test -f \$thisthing; then
2325 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2328 elif test -f \$dir/\$thing.exe; then
2329 if test -n "$DJGPP"; then
2330 echo \$dir/\$thing.exe
2331 elif test "$eunicefix" != ":"; then
2332 : on Eunice apparently
2385 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2386 pth="$pth /lib /usr/lib"
2387 for file in $loclist; do
2391 if test -f "$xxx"; then
2394 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2395 xxx=`./loc $file $file $pth`
2398 '') xxx=`./loc $file $file $pth`;;
2399 *) xxx=`./loc $xxx $xxx $pth`;;
2401 eval $file=$xxx$_exe
2405 echo $file is in $xxx.
2408 echo $file is in $xxx.
2411 echo "I don't know where '$file' is, and my life depends on it." >&4
2412 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2418 echo "Don't worry if any of the following aren't found..."
2420 for file in $trylist; do
2424 if test -f "$xxx"; then
2427 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2428 xxx=`./loc $file $file $pth`
2431 '') xxx=`./loc $file $file $pth`;;
2432 *) xxx=`./loc $xxx $xxx $pth`;;
2434 eval $file=$xxx$_exe
2438 echo $file is in $xxx.
2441 echo $file is in $xxx.
2444 echo "I don't see $file out there, $say."
2451 echo "Substituting grep for egrep."
2458 *) if $less -R </dev/null >/dev/null; then
2459 echo "Substituting less -R for less."
2467 echo "Substituting cp for ln."
2476 echo "I can't find make or gmake, and my life depends on it." >&4
2477 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2485 *) # We can't have osname yet.
2486 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2487 # Assume that gmake, if found, is definitely GNU make
2488 # and prefer it over the system make.
2489 echo "Substituting gmake for make."
2497 echo "Hopefully test is built into your sh."
2500 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2501 echo "Using the test built into your sh."
2509 echo "Hopefully echo is built into your sh."
2514 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2515 $echo $n "hi there$c" >foo1
2516 echo $n "hi there$c" >foo2
2517 if cmp foo1 foo2 >/dev/null 2>&1; then
2518 echo "They are compatible. In fact, they may be identical."
2525 They are not compatible! You are probably running ksh on a non-USG system.
2526 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2527 have echo built in and we may have to run some Bourne shell scripts. That
2528 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2531 $echo $n "The star should be here-->$c"
2538 # This question was auctioned at YAPC::Europe-2007 in Vienna
2539 # I never promised you could answer it. I only auctioned the question.
2541 The following message is sponsored by
2543 Dresden.pm<--The stars should be here.
2545 Dear Perl user, system administrator or package
2546 maintainer, the Perl community sends greetings to
2547 you. Do you (emblematical) greet back [Y/n]? n
2551 : Check what type of C compiler we use
2555 cat <<'EOSC' >>trygcc
2560 int main(int argc, char *argv[]) {
2564 if $cc -o try $ccflags $ldflags try.c; then
2567 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2573 # Skip this test because it gives a false match on output like:
2574 # ./trygcc: line 23: cc: command not found
2575 # case "`$cc -v -c try.c 2>&1`" in
2576 # *gcc*) trygcc=no ;;
2578 if $test X"$trygcc" = Xyes; then
2579 if gcc -o try -c try.c; then
2581 echo "You seem to have a working gcc, though." >&4
2582 # Switching compilers may undo the work of hints files.
2583 # The most common problem is -D_REENTRANT for threads.
2584 # This heuristic catches that case, but gets false positives
2585 # if -Dusethreads was not actually specified. Better to
2586 # bail out here with a useful message than fail
2587 # mysteriously later. Should we perhaps just try to
2588 # re-invoke Configure -Dcc=gcc config_args ?
2589 if $test -f usethreads.cbu; then
2592 *** However, any setting of the C compiler flags (e.g. for thread support)
2593 *** will be lost. It may be necessary for you to restart Configure and
2594 *** add -Dcc=gcc to your Configure command line.
2597 rp="Would you like to go ahead and try gcc anyway?"
2600 rp="Would you like to use it?"
2603 if $test -f myread; then
2606 if $test -f UU/myread; then
2609 echo "Cannot find myread, sorry. Aborting." >&2
2614 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2627 cat <<'EOSC' >>checkcc
2632 int main(int argc, char *argv[]) {
2636 if $cc -o try $ccflags $ldflags try.c; then
2639 if $test X"$despair" = Xyes; then
2640 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2643 You need to find a working C compiler.
2644 Either (purchase and) install the C compiler supplied by your OS vendor,
2645 or for a free C compiler try http://gcc.gnu.org/
2646 I cannot continue any further, aborting.
2655 : determine whether symbolic links are supported
2658 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2659 echo "Symbolic links are supported." >&4
2662 echo "Symbolic links are NOT supported." >&4
2667 : determine whether symbolic links are supported
2671 echo "Checking how to test for symbolic links..." >&4
2673 if $test "X$issymlink" = X; then
2675 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2676 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2678 if test $? = 0; then
2681 echo "Your builtin 'test -h' may be broken." >&4
2684 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2687 if test -f "$p/$test"; then
2696 echo "Trying external '$test -h'." >&4
2697 issymlink="$test -h"
2698 if $test ! -h sym >/dev/null 2>&1; then
2699 echo "External '$test -h' is broken, too." >&4
2707 if $test "X$issymlink" = X; then
2708 if $test -L sym 2>/dev/null; then
2709 issymlink="$test -L"
2710 echo "The builtin '$test -L' worked." >&4
2713 if $test "X$issymlink" != X; then
2714 echo "You can test for symbolic links with '$issymlink'." >&4
2716 echo "I do not know how you can test for symbolic links." >&4
2720 *) echo "No symbolic links, so not testing for their testing..." >&4
2725 : Make symlinks util
2726 case "$mksymlinks" in
2729 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2732 *) case "$lns:$issymlink" in
2733 *"ln"*" -s:"*"test -"?)
2734 echo "Creating the symbolic links..." >&4
2735 echo "(First creating the subdirectories...)" >&4
2737 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2739 test -z "$directory" && break
2743 if test ! -d t/base; then
2744 echo "Failed to create the subdirectories. Aborting." >&4
2747 echo "(Then creating the symlinks...)" >&4
2748 awk '{print $1}' $src/MANIFEST | while true; do
2750 test -z "$filename" && break
2751 if test -f $filename; then
2752 if $issymlink $filename; then
2756 if test -f $filename; then
2757 echo "$filename already exists, not symlinking."
2759 ln -s $src/$filename $filename
2763 if test ! -f t/base/lex.t; then
2764 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2769 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2777 : Check for Cross-Compilation
2778 case "$usecrosscompile" in
2780 $echo "Cross-compiling..."
2783 *-*-gcc) # A cross-compiling gcc, probably.
2784 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2786 # leave out ld, choosing it is more complex
2788 ranlib=$targetarch-ranlib
2789 $echo 'extern int foo;' > try.c
2790 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2792 if $test $# -gt 0; then
2794 incpth="`$echo $incpth|$sed 's/^ //'`"
2795 echo "Guessing incpth '$incpth'." >&4
2797 j="`$echo $i|$sed 's,/include$,/lib,'`"
2798 if $test -d $j; then
2802 libpth="`$echo $libpth|$sed 's/^ //'`"
2803 echo "Guessing libpth '$libpth'." >&4
2808 case "$targetarch" in
2809 '') echo "Targetarch not defined." >&4; croak=y ;;
2810 *) echo "Using targetarch $targetarch." >&4 ;;
2813 '') echo "Incpth not defined." >&4; croak=y ;;
2814 *) echo "Using incpth '$incpth'." >&4 ;;
2817 '') echo "Libpth not defined." >&4; croak=y ;;
2818 *) echo "Using libpth '$libpth'." >&4 ;;
2821 '') for i in $incpth; do
2822 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2824 echo "Guessing usrinc $usrinc." >&4
2829 '') echo "Usrinc not defined." >&4; croak=y ;;
2832 *) echo "Using usrinc $usrinc." >&4 ;;
2834 case "$targethost" in
2835 '') echo "Targethost not defined." >&4; croak=y ;;
2836 *) echo "Using targethost $targethost." >&4
2841 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2844 /*) run=$src/Cross/run
2845 targetmkdir=$src/Cross/mkdir
2847 from=$src/Cross/from
2849 *) pwd=`$test -f ../Configure & cd ..; pwd`
2851 targetmkdir=$pwd/Cross/mkdir
2853 from=$pwd/Cross/from
2856 case "$targetrun" in
2857 '') targetrun=ssh ;;
2862 case "$targetfrom" in
2863 '') targetfrom=scp ;;
2867 from=$from-$targetfrom
2868 case "$targetdir" in
2870 echo "Guessing targetdir $targetdir." >&4
2873 case "$targetuser" in
2875 echo "Guessing targetuser $targetuser." >&4
2878 case "$targetfrom" in
2882 case "$targetrun" in
2894 '') cwd=$targetdir ;;
2898 if $test ! -f \$exe.xok; then
2902 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2905 *) echo "Unknown targetrun '$targetrun'" >&4
2909 case "$targetmkdir" in
2911 cat >$targetmkdir <<EOF
2913 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2915 $chmod a+rx $targetmkdir
2917 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2929 $targetmkdir \`dirname \$f\`
2930 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2933 $targetmkdir $targetdir/\`dirname \$f\`
2934 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2947 $mkdir -p $targetdir/\`dirname \$f\`
2948 $cp \$f $targetdir/\$f || exit 1
2951 $targetmkdir $targetdir/\`dirname \$f\`
2952 $cp \$f $targetdir/\$f || exit 1
2959 *) echo "Unknown targetto '$targetto'" >&4
2963 case "$targetfrom" in
2970 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2975 cp) cat >$from <<EOF
2980 cp $targetdir/\$f . || exit 1
2985 *) echo "Unknown targetfrom '$targetfrom'" >&4
2989 if $test ! -f $run; then
2990 echo "Target 'run' script '$run' not found." >&4
2994 if $test ! -f $to; then
2995 echo "Target 'to' script '$to' not found." >&4
2999 if $test ! -f $from; then
3000 echo "Target 'from' script '$from' not found." >&4
3004 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3008 Using '$run' for remote execution,
3009 and '$from' and '$to'
3010 for remote file transfer.
3016 usecrosscompile='undef'
3021 : see whether [:lower:] and [:upper:] are supported character classes
3023 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3025 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3029 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3030 # (0xd9 and 0xe2), therefore that is a nice testing point.
3031 if test "X$up" = X -o "X$low" = X; then
3032 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3038 if test "X$up" = X -o "X$low" = X; then
3039 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3045 if test "X$up" = X -o "X$low" = X; then
3046 case "`echo RS | od -x 2>/dev/null`" in
3048 echo "Hey, this might be EBCDIC." >&4
3049 if test "X$up" = X -o "X$low" = X; then
3050 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3051 rs) up='[A-IJ-RS-Z]'
3056 if test "X$up" = X -o "X$low" = X; then
3057 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3067 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3069 echo "Using $up and $low to convert case." >&4
3072 echo "I don't know how to translate letters from upper to lower case." >&4
3073 echo "Your tr is not acting any way I know of." >&4
3077 : set up the translation script tr, must be called with ./tr of course
3081 '[A-Z][a-z]') exec $tr '$up' '$low';;
3082 '[a-z][A-Z]') exec $tr '$low' '$up';;
3089 : Try to determine whether config.sh was made on this system
3090 case "$config_sh" in
3092 myuname=`$uname -a 2>/dev/null`
3093 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3094 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3095 # because the A-Z/a-z are not consecutive.
3096 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3097 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3098 newmyuname="$myuname"
3100 case "$knowitall" in
3102 if test -f ../config.sh; then
3103 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3104 eval "`grep myuname= ../config.sh`"
3106 if test "X$myuname" = "X$newmyuname"; then
3114 : Get old answers from old config file if Configure was run on the
3115 : same system, otherwise use the hints.
3118 if test -f config.sh; then
3120 rp="I see a config.sh file. Shall I use it to set the defaults?"
3123 n*|N*) echo "OK, I'll ignore it."
3124 mv config.sh config.sh.old
3125 myuname="$newmyuname"
3127 *) echo "Fetching default answers from your old config.sh file..." >&4
3135 : Older versions did not always set $sh. Catch re-use of such
3145 if test ! -f config.sh; then
3148 First time through, eh? I have some defaults handy for some systems
3149 that need some extra help getting the Configure answers right:
3152 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3154 : Half the following guesses are probably wrong... If you have better
3155 : tests or hints, please send them to perlbug@perl.org
3156 : The metaconfig authors would also appreciate a copy...
3157 $test -f /irix && osname=irix
3158 $test -f /xenix && osname=sco_xenix
3159 $test -f /dynix && osname=dynix
3160 $test -f /dnix && osname=dnix
3161 $test -f /lynx.os && osname=lynxos
3162 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3163 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3164 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3165 $test -f /bin/mips && /bin/mips && osname=mips
3166 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3167 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3168 $test -d /usr/apollo/bin && osname=apollo
3169 $test -f /etc/saf/_sactab && osname=svr4
3170 $test -d /usr/include/minix && osname=minix
3171 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3172 if $test -d /MachTen -o -d /MachTen_Folder; then
3174 if $test -x /sbin/version; then
3175 osvers=`/sbin/version | $awk '{print $2}' |
3176 $sed -e 's/[A-Za-z]$//'`
3177 elif $test -x /usr/etc/version; then
3178 osvers=`/usr/etc/version | $awk '{print $2}' |
3179 $sed -e 's/[A-Za-z]$//'`
3185 $test -f /sys/posix.dll &&
3186 $test -f /usr/bin/what &&
3187 set X `/usr/bin/what /sys/posix.dll` &&
3188 $test "$3" = UWIN &&
3192 if $test -f $uname; then
3200 umips) osname=umips ;;
3203 [23]100) osname=mips ;;
3204 next*) osname=next ;;
3206 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3207 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3210 elif $test -f /etc/kconfig; then
3212 if test "$lns" = "$ln -s"; then
3214 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3216 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3223 if test -n "$DJGPP"; then
3232 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3234 # oslevel can fail with:
3235 # oslevel: Unable to acquire lock.
3236 *not\ found) osvers="$4"."$3" ;;
3237 '<3240'|'<>3240') osvers=3.2.0 ;;
3238 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3239 '=3250'|'>3250') osvers=3.2.5 ;;
3243 bsd386) osname=bsd386
3246 cygwin*) osname=cygwin
3249 *dc.osx) osname=dcosx
3255 domainos) osname=apollo
3261 dragonfly) osname=dragonfly
3264 dynixptx*) osname=dynixptx
3265 osvers=`echo "$4"|sed 's/^v//'`
3267 freebsd) osname=freebsd
3269 genix) osname=genix ;;
3273 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3289 netbsd*) osname=netbsd
3292 news-os) osvers="$3"
3294 4*) osname=newsos4 ;;
3298 next*) osname=next ;;
3299 nonstop-ux) osname=nonstopux ;;
3300 openbsd) osname=openbsd
3306 POSIX-BC | posix-bc ) osname=posix-bc
3309 powerux | power_ux | powermax_os | powermaxos | \
3310 powerunix | power_unix) osname=powerux
3316 solaris) osname=solaris
3318 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3325 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3329 titanos) osname=titanos
3338 ultrix) osname=ultrix
3341 osf1|mls+) case "$5" in
3344 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3347 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3350 hp*) osname=hp_osf1 ;;
3351 mips) osname=mips_osf1 ;;
3354 # UnixWare 7.1.2 is known as Open UNIX 8
3355 openunix|unixware) osname=svr5
3363 $2) case "$osname" in
3367 : svr4.x or possibly later
3377 if test -f /stand/boot ; then
3378 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3379 if test -n "$INITPROG" -a -f "$INITPROG"; then
3380 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3381 if test -n "$isesix"; then
3389 *) if test -f /etc/systemid; then
3391 set `echo $3 | $sed 's/\./ /g'` $4
3392 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3394 elif $test -f $src/hints/sco_$1_$2.sh; then
3396 elif $test -f $src/hints/sco_$1.sh; then
3401 '') : Still unknown. Probably a generic Sys V.
3410 *) case "$osname" in
3411 '') : Still unknown. Probably a generic BSD.
3419 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3420 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3421 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3424 $rm -f UU/kernel.what
3425 elif test -d c:/. -o -n "$is_os2" ; then
3432 case "$targetarch" in
3435 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3440 : Now look for a hint file osname_osvers, unless one has been
3441 : specified already.
3444 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3445 : Also try without trailing minor version numbers.
3446 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3447 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3448 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3449 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3452 *) case "$osvers" in
3455 *) if $test -f $src/hints/$file.sh ; then
3457 elif $test -f $src/hints/$xfile.sh ; then
3459 elif $test -f $src/hints/$xxfile.sh ; then
3461 elif $test -f $src/hints/$xxxfile.sh ; then
3463 elif $test -f $src/hints/$xxxxfile.sh ; then
3465 elif $test -f "$src/hints/${osname}.sh" ; then
3474 if $test -f Policy.sh ; then
3477 none) dflt="Policy" ;;
3478 *) dflt="Policy $dflt" ;;
3483 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3487 if $test -f Policy.sh ; then
3490 There's also a Policy hint file available, which should make the
3491 site-specific (policy) questions easier to answer.
3498 You may give one or more space-separated answers, or "none" if appropriate.
3499 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3500 previous run of Configure, you may specify it as well as or instead of
3501 OS-specific hints. If hints are provided for your OS, you should use them:
3502 although Perl can probably be built without hints on many platforms, using
3503 hints often improve performance and may enable features that Configure can't
3504 set up on its own. If there are no hints that match your OS, specify "none";
3505 DO NOT give a wrong version or a wrong OS.
3509 rp="Which of these apply, if any?"
3512 for file in $tans; do
3513 if $test X$file = XPolicy -a -f Policy.sh; then
3515 $cat Policy.sh >> UU/config.sh
3516 elif $test -f $src/hints/$file.sh; then
3517 . $src/hints/$file.sh
3518 $cat $src/hints/$file.sh >> UU/config.sh
3519 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3522 : Give one chance to correct a possible typo.
3523 echo "$file.sh does not exist"
3525 rp="hint to use instead?"
3527 for file in $ans; do
3528 if $test -f "$src/hints/$file.sh"; then
3529 . $src/hints/$file.sh
3530 $cat $src/hints/$file.sh >> UU/config.sh
3531 elif $test X$ans = X -o X$ans = Xnone ; then
3534 echo "$file.sh does not exist -- ignored."
3541 : Remember our hint file for later.
3542 if $test -f "$src/hints/$file.sh" ; then
3552 echo "Fetching default answers from $config_sh..." >&4
3556 cp $config_sh config.sh 2>/dev/null
3566 test "$override" && . ./optdef.sh
3568 : Restore computed paths
3569 for file in $loclist $trylist; do
3570 eval $file="\$_$file"
3575 Configure uses the operating system name and version to set some defaults.
3576 The default value is probably right if the name rings a bell. Otherwise,
3577 since spelling matters for me, either accept the default or answer "none"
3584 ''|' '|none) dflt=none ;;
3585 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3588 *) dflt="$osname" ;;
3590 rp="Operating system name?"
3594 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3600 ''|' '|none) dflt=none ;;
3601 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3602 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3604 ''|' ') dflt=none ;;
3609 *) dflt="$osvers" ;;
3611 rp="Operating system version?"
3621 : who configured the system
3622 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3625 cf_by=`(logname) 2>/dev/null`
3628 cf_by=`(whoami) 2>/dev/null`
3630 "") cf_by=unknown ;;
3635 : decide how portable to be. Allow command line overrides.
3636 case "$d_portable" in
3638 *) d_portable="$define" ;;
3641 : set up shell script to do ~ expansion
3647 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3650 if $test -f /bin/csh; then
3651 /bin/csh -f -c "glob \$1"
3656 name=\`$expr x\$1 : '..\([^/]*\)'\`
3657 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3658 if $test ! -d "\$dir"; then
3660 echo "\$me: can't locate home directory for: \$name" >&2
3665 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3681 : now set up to get a file name
3685 cat <<'EOSC' >>getfile
3701 : getfile will accept an answer from the comma-separated list
3702 : enclosed in parentheses even if it does not meet other criteria.
3703 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3704 fn=`echo $fn | sed 's/(.*)//'`
3710 loc_file=`expr $fn : '.*:\(.*\)'`
3711 fn=`expr $fn : '\(.*\):.*'`
3719 */*) fullpath=true;;
3728 *e*) exp_file=true;;
3731 *p*) nopath_ok=true;;
3736 *d*) type='Directory';;
3737 *l*) type='Locate';;
3742 Locate) what='File';;
3747 case "$d_portable" in
3755 while test "$type"; do
3760 true) rp="$rp (~name ok)";;
3763 if test -f UU/getfile.ok && \
3764 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3783 value=`UU/filexp $ans`
3786 if test "$ans" != "$value"; then
3787 echo "(That expands to $value on this system.)"
3801 /*) value="$ansexp" ;;
3802 [a-zA-Z]:/*) value="$ansexp" ;;
3807 echo "I shall only accept a full path name, as in /bin/ls." >&4
3808 echo "Use a ! shell escape if you wish to check pathnames." >&4
3811 echo "Please give a full path name, starting with slash." >&4
3814 echo "Note that using ~name is ok provided it expands well." >&4
3827 for fp in $gfpth; do
3828 if test "X$fp" = X.; then
3833 if test -f "$pf"; then
3835 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3837 echo "($value is not a plain file, but that's ok.)"
3840 if test X"$type" = X; then
3847 for fp in $gfpth; do
3848 if test "X$fp" = X.; then
3853 direxp="$fp/$ansexp"
3855 if test -d "$direxp"; then
3863 if test -d "$ansexp"; then
3864 echo "(Looking for $loc_file in directory $value.)"
3865 value="$value/$loc_file"
3866 ansexp="$ansexp/$loc_file"
3868 if test -f "$ansexp"; then
3871 case "$nopath_ok" in
3872 true) case "$value" in
3874 *) echo "Assuming $value will be in people's path."
3890 if test "$fastread" = yes; then
3895 rp="$what $value doesn't exist. Use that name anyway?"
3914 test "X$gfpthkeep" != Xy && gfpth=""
3917 : determine root of directory hierarchy where package will be installed.
3920 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3923 dflt=`echo "$prefix" | sed 's/.$//'`
3931 By default, $package will be installed in $dflt/bin, manual pages
3932 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3933 installation directories. Typically this is something like /usr/local.
3934 If you wish to have binaries under /usr/bin but other parts of the
3935 installation under /usr/local, that's ok: you will be prompted
3936 separately for each of the installation directories, the prefix being
3937 only used to set the defaults.
3941 rp='Installation prefix to use?'
3949 *) oldprefix="$prefix";;
3956 : allow them to override the AFS root
3959 *) afsroot=$afsroot ;;
3965 $define|true) afs=true ;;
3966 $undef|false) afs=false ;;
3967 *) if $test -d $afsroot; then
3975 echo "AFS may be running... I'll be extra cautious then..." >&4
3977 echo "AFS does not seem to be running..." >&4
3980 : determine installation prefix for where package is to be installed.
3984 Since you are running AFS, I need to distinguish the directory in which
3985 files will reside from the directory in which they are installed (and from
3986 which they are presumably copied to the former directory by occult means).
3989 case "$installprefix" in
3990 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3991 *) dflt="$installprefix";;
3996 In some special cases, particularly when building $package for distribution,
3997 it is convenient to distinguish the directory in which files should be
3998 installed from the directory ($prefix) in which they will
3999 eventually reside. For most users, these two directories are the same.
4002 case "$installprefix" in
4004 *) dflt=$installprefix;;
4008 rp='What installation prefix should I use for installing files?'
4010 installprefix="$ans"
4011 installprefixexp="$ansexp"
4013 : Perform the prefixexp/installprefixexp correction if necessary
4014 cat <<EOS >installprefix
4017 cat <<'EOSC' >>installprefix
4018 : Change installation prefix, if necessary.
4019 if $test X"$prefix" != X"$installprefix"; then
4020 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4022 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4025 chmod +x installprefix
4026 $eunicefix installprefix
4028 : Set variables such as privlib and privlibexp from the output of ./getfile
4029 : performing the prefixexp/installprefixexp correction if necessary.
4030 cat <<EOS >setprefixvar
4033 cat <<'EOSC' >>setprefixvar
4034 eval "${prefixvar}=\"\$ans\""
4035 eval "${prefixvar}exp=\"\$ansexp\""
4038 chmod +x setprefixvar
4039 $eunicefix setprefixvar
4041 : set up the script used to warn in case of inconsistency
4050 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4052 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4053 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4058 echo "*** WHOA THERE!!! ***" >&4
4059 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4062 rp=" Keep the $hint value?"
4065 y) td=$was; tu=$was;;
4069 : function used to set '$1' to '$val'
4070 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4072 $define$undef) . ./whoa; eval "$var=\$td";;
4073 $undef$define) . ./whoa; eval "$var=\$tu";;
4074 *) eval "$var=$val";;
4077 : get the patchlevel
4079 echo "Getting the current patchlevel..." >&4
4080 if $test -r $rsrc/patchlevel.h;then
4081 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4082 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4083 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4084 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4085 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4086 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4087 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4096 $echo "(You do not have patchlevel.h. Eek.)"
4098 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4099 version_patchlevel_string="version $patchlevel subversion $subversion"
4100 case "$perl_patchlevel" in
4102 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4103 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4107 $echo "(You have $package $version_patchlevel_string.)"
4111 : XXX Should be a Configure test for double-dots in filenames.
4112 version=`echo $revision $patchlevel $subversion | \
4113 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4114 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4115 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4118 version=`echo $revision $patchlevel $subversion | \
4119 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4120 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4121 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4124 : Special case the 5.005_xx maintenance series, which used 5.005
4125 : without any subversion label as a subdirectory in $sitelib
4126 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4127 api_versionstring='5.005'
4130 : Do we want threads support and if so, what type
4131 case "$usethreads" in
4132 $define|true|[yY]*) dflt='y';;
4133 *) # Catch case where user specified ithreads or 5005threads but
4134 # forgot -Dusethreads (A.D. 4/2002)
4135 case "$useithreads$use5005threads" in
4136 *$define*) dflt='y';;
4143 Perl can be built to take advantage of threads on some systems.
4144 To do so, Configure can be run with -Dusethreads.
4146 Note that Perl built with threading support runs slightly slower
4147 and uses more memory than plain Perl. The current implementation
4148 is believed to be stable, but it is fairly new, and so should be
4149 treated with caution.
4151 If this doesn't make any sense to you, just accept the default '$dflt'.
4153 rp='Build a threading Perl?'
4156 y|Y) val="$define" ;;
4162 if $test $patchlevel -lt 9; then
4163 case "$usethreads" in
4167 Since release 5.6, Perl has had two different threading implementations,
4168 the newer interpreter-based version (ithreads) with one interpreter per
4169 thread, and the older 5.005 version (5005threads).
4170 The 5005threads version is effectively unmaintained and will probably be
4171 removed in Perl 5.10, so there should be no need to build a Perl using it
4172 unless needed for backwards compatibility with some existing 5.005threads
4176 : Default to ithreads unless overridden on command line or with
4179 case "$use5005threads" in
4180 $define|true|[yY]*) dflt='n';;
4182 case "$useithreads" in
4183 $undef|false|[nN]*) dflt='n';;
4185 rp='Use the newer interpreter-based ithreads?'
4188 y|Y) val="$define" ;;
4193 : Now set use5005threads to the opposite value.
4194 case "$useithreads" in
4195 $define) val="$undef" ;;
4202 useithreads="$undef"
4203 use5005threads="$undef"
4207 case "$useithreads$use5005threads" in
4211 You cannot have both the ithreads and the 5.005 threads enabled
4212 at the same time. Disabling the 5.005 threads since they are
4213 much less stable than the ithreads.
4216 use5005threads="$undef"
4221 : perl-5.9.x and later
4223 if test X"$usethreads" = "X$define"; then
4224 case "$use5005threads" in
4228 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4235 use5005threads="$undef"
4236 useithreads="$usethreads"
4239 case "$d_oldpthreads" in
4240 '') : Configure tests would be welcome here. For now, assume undef.
4242 *) val="$d_oldpthreads" ;;
4248 : Look for a hint-file generated 'call-back-unit'. If the
4249 : user has specified that a threading perl is to be built,
4250 : we may need to set or change some other defaults.
4251 if $test -f usethreads.cbu; then
4252 echo "Your platform has some specific hints regarding threaded builds, using them..."
4255 case "$usethreads" in
4256 "$define"|true|[yY]*)
4258 (Your platform does not have any specific hints for threaded builds.
4259 Assuming POSIX threads, then.)
4265 : Check if multiplicity is required
4268 Perl can be built so that multiple Perl interpreters can coexist
4269 within the same Perl executable.
4272 case "$useithreads" in
4275 This multiple interpreter support is required for interpreter-based threads.
4279 *) case "$usemultiplicity" in
4280 $define|true|[yY]*) dflt='y';;
4284 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4285 rp='Build Perl for multiplicity?'
4288 y|Y) val="$define" ;;
4296 : Check if morebits is requested
4297 case "$usemorebits" in
4298 "$define"|true|[yY]*)
4299 use64bitint="$define"
4300 uselongdouble="$define"
4301 usemorebits="$define"
4303 *) usemorebits="$undef"
4307 : Determine the C compiler to be used
4313 rp="Use which C compiler?"
4317 : See whether they have no cc but they do have gcc
4319 if $test -f cc.cbu; then
4324 : make some quick guesses about what we are up against
4326 $echo $n "Hmm... $c"
4336 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4337 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4339 echo "Looks kind of like an OSF/1 system, but we'll see..."
4341 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4342 xxx=`./loc addbib blurfl $pth`
4343 if $test -f $xxx; then
4344 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4348 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4349 echo "Looks kind of like an extended USG system, but we'll see..."
4351 echo "Looks kind of like a USG system, but we'll see..."
4355 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4356 echo "Looks kind of like a BSD system, but we'll see..."
4360 echo "Looks kind of like a Version 7 system, but we'll see..."
4363 case "$eunicefix" in
4366 There is, however, a strange, musty smell in the air that reminds me of
4367 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4371 : it so happens the Eunice I know will not run shell scripts in Unix format
4375 echo "Congratulations. You aren't running Eunice."
4379 : Detect OS2. The p_ variable is set above in the Head.U unit.
4380 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4381 : semicolon as a patch separator
4386 I have the feeling something is not exactly right, however...don't tell me...
4387 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4388 (Or you may be running DOS with DJGPP.)
4393 if test -f /xenix; then
4394 echo "Actually, this looks more like a XENIX system..."
4399 echo "It's not Xenix..."
4404 if test -f /venix; then
4405 echo "Actually, this looks more like a VENIX system..."
4412 echo "Nor is it Venix..."
4415 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4416 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4419 : Check if we are using GNU gcc and what its version is
4421 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4425 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4427 printf("%s\n", __VERSION__);
4429 printf("%s\n", "1");
4435 if $cc -o try $ccflags $ldflags try.c; then
4436 gccversion=`$run ./try`
4437 case "$gccversion" in
4438 '') echo "You are not using GNU cc." ;;
4439 *) echo "You are using GNU cc $gccversion."
4445 echo "*** WHOA THERE!!! ***" >&4
4446 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4447 case "$knowitall" in
4449 echo " You'd better start hunting for one and let me know about it." >&4
4455 case "$gccversion" in
4456 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4458 case "$gccversion" in
4459 '') gccosandvers='' ;;
4460 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4461 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4463 case "$gccosandvers" in
4464 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4465 $osname$osvers) ;; # looking good
4466 $osname*) cat <<EOM >&4
4468 *** WHOA THERE!!! ***
4470 Your gcc has not been compiled for the exact release of
4471 your operating system ($gccosandvers versus $osname$osvers).
4473 In general it is a good idea to keep gcc synchronized with
4474 the operating system because otherwise serious problems
4475 may ensue when trying to compile software, like Perl.
4477 I'm trying to be optimistic here, though, and will continue.
4478 If later during the configuration and build icky compilation
4479 problems appear (headerfile conflicts being the most common
4480 manifestation), I suggest reinstalling the gcc to match
4481 your operating system release.
4485 *) gccosandvers='' ;; # failed to parse, better be silent
4493 # gcc 3.* complain about adding -Idirectories that they already know about,
4494 # so we will take those off from locincpth.
4495 case "$gccversion" in
4497 echo "main(){}">try.c
4498 for incdir in $locincpth; do
4499 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4500 grep '^c[cp]p*[01]: warning: changing search order '`
4501 if test "X$warn" != X; then
4502 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4508 : What should the include directory be ?
4510 $echo $n "Hmm... $c"
4514 if $test -f /bin/mips && /bin/mips; then
4515 echo "Looks like a MIPS system..."
4516 $cat >usr.c <<'EOCP'
4517 #ifdef SYSTYPE_BSD43
4521 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4522 dflt='/bsd43/usr/include'
4526 mips_type='System V'
4528 $rm -f usr.c usr.out
4529 echo "and you're compiling with the $mips_type compiler and libraries."
4533 echo "Doesn't look like a MIPS system."
4543 case "$xxx_prompt" in
4546 rp='Where are the include files you want to use?'
4554 : see how we invoke the C preprocessor
4556 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4557 cat <<'EOT' >testcpp.c
4563 if test ! -f cppstdin; then
4564 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4565 # AIX cc -E doesn't show the absolute headerfile
4566 # locations but we'll cheat by using the -M flag.
4567 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
4569 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4572 echo "Keeping your $hint cppstdin wrapper."
4575 wrapper=`pwd`/cppstdin
4579 if $test "X$cppstdin" != "X" && \
4580 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4581 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4583 echo "You used to use $cppstdin $cppminus so we'll use that again."
4585 '') echo "But let's see if we can live without a wrapper..." ;;
4587 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4588 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4590 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4593 echo "(However, $cpprun $cpplast does not work, let's see...)"
4601 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4608 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4609 $cc -E <testcpp.c >testcpp.out 2>&1; \
4610 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4611 echo "Yup, it does."
4614 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4615 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4616 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4617 echo "Yup, it does."
4620 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4621 $cc -P <testcpp.c >testcpp.out 2>&1; \
4622 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4623 echo "Yipee, that works!"
4626 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4627 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4628 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4629 echo "At long last!"
4632 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4633 $cpp <testcpp.c >testcpp.out 2>&1; \
4634 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4638 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4639 $cpp - <testcpp.c >testcpp.out 2>&1; \
4640 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4641 echo "Hooray, it works! I was beginning to wonder."
4644 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4645 $wrapper <testcpp.c >testcpp.out 2>&1; \
4646 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4652 rp="No dice. I can't find a C preprocessor. Name one:"
4656 $x_cpp <testcpp.c >testcpp.out 2>&1
4657 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4658 echo "OK, that will do." >&4
4660 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4675 echo "Perhaps can we force $cc -E using a wrapper..."
4676 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4677 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4683 echo "Nope, we'll have to live without it..."
4697 "$wrapper"|'cppstdin') ;;
4698 *) $rm -f $wrapper;;
4700 $rm -f testcpp.c testcpp.out
4702 : Set private lib path
4705 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4710 '') dlist="$loclibpth $plibpth $glibpth";;
4711 *) dlist="$libpth";;
4714 : Now check and see which directories actually exist, avoiding duplicates
4718 if $test -d $xxx; then
4721 *) libpth="$libpth $xxx";;
4727 Some systems have incompatible or broken versions of libraries. Among
4728 the directories listed in the question below, please remove any you
4729 know not to be holding relevant libraries, and add any that are needed.
4730 Say "none" for none.
4741 rp="Directories to use for library searches?"
4748 : compute shared library extension
4751 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4761 On some systems, shared libraries may be available. Answer 'none' if
4762 you want to suppress searching of shared libraries for the remainder
4763 of this configuration.
4766 rp='What is the file extension used for shared libraries?'
4770 : Define several unixisms.
4771 : Hints files or command line option can be used to override them.
4772 : The convoluted testing is in case hints files set either the old
4775 '') case "$exe_ext" in
4777 *) _exe="$exe_ext" ;;
4782 '') case "$lib_ext" in
4789 '') case "$obj_ext" in
4796 '') case "$path_sep" in
4807 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4809 : Which makefile gets called first. This is used by make depend.
4810 case "$firstmakefile" in
4811 '') firstmakefile='makefile';;
4814 : Check is we will use socks
4816 $define|true|[yY]*) dflt='y';;
4821 Perl can be built to use the SOCKS proxy protocol library. To do so,
4822 Configure must be run with -Dusesocks. If you use SOCKS you also need
4823 to use the PerlIO abstraction layer, this will be implicitly selected.
4825 If this doesn't make any sense to you, just accept the default '$dflt'.
4827 rp='Build Perl for SOCKS?'
4830 y|Y) val="$define" ;;
4836 : Check for uselongdouble support
4838 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4841 case "$uselongdouble" in
4842 $define|true|[yY]*) dflt='y';;
4847 Perl can be built to take advantage of long doubles which
4848 (if available) may give more accuracy and range for floating point numbers.
4850 If this doesn't make any sense to you, just accept the default '$dflt'.
4852 rp='Try to use long doubles if available?'
4855 y|Y) val="$define" ;;
4861 case "$uselongdouble" in
4862 true|[yY]*) uselongdouble="$define" ;;
4865 : Look for a hint-file generated 'call-back-unit'. If the
4866 : user has specified that long doubles should be used,
4867 : we may need to set or change some other defaults.
4868 if $test -f uselongdouble.cbu; then
4869 echo "Your platform has some specific hints regarding long doubles, using them..."
4870 . ./uselongdouble.cbu
4872 case "$uselongdouble" in
4875 (Your platform does not have any specific hints for long doubles.)
4881 : Looking for optional libraries
4883 echo "Checking for optional libraries..." >&4
4888 case "$libswanted" in
4889 '') libswanted='c_s';;
4892 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4898 for thisdir in $libpth $xlibpth; do
4899 test -d $thisdir && libspath="$libspath $thisdir"
4901 for thislib in $libswanted; do
4902 for thisdir in $libspath; do
4904 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4905 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4906 $test -f "$xxx" && eval $libscheck
4907 $test -f "$xxx" && libstyle=shared
4909 if test ! -f "$xxx"; then
4910 xxx=$thisdir/lib$thislib.$so
4911 $test -f "$xxx" && eval $libscheck
4912 $test -f "$xxx" && libstyle=shared
4914 if test ! -f "$xxx"; then
4915 xxx=$thisdir/lib$thislib$_a
4916 $test -f "$xxx" && eval $libscheck
4917 $test -f "$xxx" && libstyle=static
4919 if test ! -f "$xxx"; then
4920 xxx=$thisdir/$thislib$_a
4921 $test -f "$xxx" && eval $libscheck
4922 $test -f "$xxx" && libstyle=static
4924 if test ! -f "$xxx"; then
4925 xxx=$thisdir/lib${thislib}_s$_a
4926 $test -f "$xxx" && eval $libscheck
4927 $test -f "$xxx" && libstyle=static
4928 $test -f "$xxx" && thislib=${thislib}_s
4930 if test ! -f "$xxx"; then
4931 xxx=$thisdir/Slib$thislib$_a
4932 $test -f "$xxx" && eval $libscheck
4933 $test -f "$xxx" && libstyle=static
4935 if $test -f "$xxx"; then
4937 shared) echo "Found -l$thislib (shared)." ;;
4938 static) echo "Found -l$thislib." ;;
4939 *) echo "Found -l$thislib ($libstyle)." ;;
4943 *) dflt="$dflt -l$thislib"
4944 libsfound="$libsfound $xxx"
4946 libsfiles="$libsfiles $yyy"
4947 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4948 case " $libsdirs " in
4950 *) libsdirs="$libsdirs $yyy" ;;
4957 if $test ! -f "$xxx"; then
4958 echo "No -l$thislib."
4969 ' '|'') dflt='none';;
4974 In order to compile $package on your machine, a number of libraries
4975 are usually needed. Include any other special libraries here as well.
4976 Say "none" for none. The default list is almost always right.
4980 rp="What libraries to use?"
4987 : determine optimization, if desired, or use for debug flag also
4989 ' '|$undef) dflt='none';;
4991 *) dflt="$optimize";;
4995 By default, $package compiles with the -O flag to use the optimizer.
4996 Alternately, you might want to use the symbolic debugger, which uses
4997 the -g flag (on traditional Unix systems). Either flag can be
4998 specified here. To use neither flag, specify the word "none".
5001 rp="What optimizer/debugger flag should be used?"
5005 'none') optimize=" ";;
5008 : Check what DEBUGGING is required from the command line
5009 : -DEBUGGING or -DDEBUGGING or
5010 : -DEBUGGING=both = -g + -DDEBUGGING
5011 : -DEBUGGING=-g or -Doptimize=-g = -g
5012 : -DEBUGGING=none or -UDEBUGGING =
5013 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5016 *) DEBUGGING=$EBUGGING ;;
5019 case "$DEBUGGING" in
5023 *) optimize="$optimize -g" ;;
5027 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5035 case "$DEBUGGING" in
5036 both|$define) dflt='-DDEBUGGING'
5039 : argument order is deliberate, as the flag will start with - which set could
5040 : think is an option
5041 checkccflag='check=$1; flag=$2; callback=$3;
5043 echo "Checking if your compiler accepts $flag" 2>&1;
5044 echo "int main(void) { return 0; }" > gcctest.c;
5045 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5046 echo "Yes, it does." 2>&1;
5047 if $test -s gcctest.out ; then
5048 echo "But your platform does not like it:";
5053 echo "Leaving current flags $ccflags alone." 2>&1
5055 *) dflt="$dflt $flag";
5061 echo "Nope, it does not, but that is ok." 2>&1;
5065 : We will not override a previous value, but we might want to
5066 : augment a hint file
5068 default|recommended)
5069 case "$gccversion" in
5070 1*) dflt="$dflt -fpcc-struct-return" ;;
5072 case "$optimize:$DEBUGGING" in
5073 *-g*:old) dflt="$dflt -DDEBUGGING";;
5075 case "$gccversion" in
5076 2*) if $test -d /etc/conf/kconfig.d &&
5077 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5079 # Interactive Systems (ISC) POSIX mode.
5084 case "$gccversion" in
5087 ?*) set strict-aliasing -fno-strict-aliasing
5091 # For gcc, adding -pipe speeds up compilations for some, but apparently
5092 # some assemblers can't read from stdin. (It also slows down compilations
5093 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5094 case "$gccversion" in
5100 # on x86_64 (at least) we require an extra library (libssp) in the
5101 # link command line. This library is not named, so I infer that it is
5102 # an implementation detail that may change. Hence the safest approach
5103 # is to add the flag to the flags passed to the compiler at link time,
5104 # as that way the compiler can do the right implementation dependant
5106 case "$gccversion" in
5107 ?*) set stack-protector -fstack-protector
5114 case "$mips_type" in
5115 *BSD*|'') inclwanted="$locincpth $usrinc";;
5116 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5118 for thisincl in $inclwanted; do
5119 if $test -d $thisincl; then
5120 if $test x$thisincl != x$usrinc; then
5122 *" -I$thisincl "*);;
5123 *) dflt="$dflt -I$thisincl ";;
5129 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5131 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5139 *) dflt="$dflt -D$2";;
5143 set signal.h LANGUAGE_C; eval $inctest
5147 ccflags="$ccflags -DSOCKS"
5152 default|recommended) dflt="$ccflags $dflt" ;;
5153 *) dflt="$ccflags";;
5162 Your C compiler may want other flags. For this question you should include
5163 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5164 but you should NOT include libraries or ld flags like -lwhatever. If you
5165 want $package to honor its debug switch, you should include -DDEBUGGING here.
5166 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5168 To use no flags, specify the word "none".
5174 rp="Any additional cc flags?"
5181 : the following weeds options from ccflags that are of no interest to cpp
5183 '') cppflags="$ccflags" ;;
5184 *) cppflags="$cppflags $ccflags" ;;
5186 case "$gccversion" in
5187 1*) cppflags="$cppflags -D__GNUC__"
5189 case "$mips_type" in
5191 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5197 echo "Let me guess what the preprocessor flags are..." >&4
5211 *) ftry="$previous $flag";;
5213 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5214 >cpp1.out 2>/dev/null && \
5215 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5216 >cpp2.out 2>/dev/null && \
5217 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5218 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5220 cppflags="$cppflags $ftry"
5230 *-*) echo "They appear to be: $cppflags";;
5232 $rm -f cpp.c cpp?.out
5236 : flags used in final linking phase
5238 '') if ./venix; then
5244 *-posix*) dflt="$dflt -posix" ;;
5247 *) dflt="$ldflags";;
5249 # See note above about -fstack-protector
5251 *-fstack-protector*)
5253 *-fstack-protector*) ;; # Don't add it again
5254 *) dflt="$dflt -fstack-protector" ;;
5259 : Try to guess additional flags to pick up local libraries.
5260 for thislibdir in $libpth; do
5261 case " $loclibpth " in
5264 *"-L$thislibdir "*) ;;
5265 *) dflt="$dflt -L$thislibdir" ;;
5277 Your C linker may need flags. For this question you should
5278 include -L/whatever and any other flags used by the C linker, but you
5279 should NOT include libraries like -lwhatever.
5281 Make sure you include the appropriate -L/path flags if your C linker
5282 does not normally search all of the directories you specified above,
5285 To use no flags, specify the word "none".
5289 rp="Any additional ld flags (NOT including libraries)?"
5295 rmlist="$rmlist pdp11"
5299 echo "Checking your choice of C compiler and flags for coherency..." >&4
5300 $cat > try.c <<'EOF'
5302 int main() { printf("Ok\n"); return(0); }
5304 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5306 $cat >try.msg <<'EOM'
5307 I've tried to compile and run the following simple program:
5310 $cat try.c >> try.msg
5312 $cat >> try.msg <<EOM
5319 and I got the following output:
5323 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5324 if $sh -c "$run ./try " >>try.msg 2>&1; then
5328 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5331 cat >> try.msg <<'EOQS'
5332 If $libs contains -lsfio, and sfio is mis-configured, then it
5333 sometimes (apparently) runs and exits with a 0 status, but with no
5334 output! It may have to do with sfio's use of _exit vs. exit.
5337 rp="You have a big problem. Shall I abort Configure"
5344 echo "The program compiled OK, but exited with status $?." >>try.msg
5345 rp="You have a problem. Shall I abort Configure"
5349 echo "I can't compile the test program." >>try.msg
5350 rp="You have a BIG problem. Shall I abort Configure"
5356 case "$knowitall" in
5358 echo "(The supplied flags or libraries might be incorrect.)"
5366 *) echo "Ok. Stopping Configure." >&4
5371 n) echo "OK, that should do.";;
5373 $rm_try gcctest gcctest.out
5375 : define a shorthand compile call
5379 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5380 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5384 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5385 : define a shorthand compile call for compilations that should be ok.
5389 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5391 : determine filename position in cpp output
5393 echo "Computing filename position in cpp output for #include directives..." >&4
5395 vos) testaccess=-e ;;
5398 echo '#include <stdio.h>' > foo.c
5401 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5402 $grep '^[ ]*#.*stdio\.h' | \
5403 while read cline; do
5406 while $test \$# -gt 0; do
5407 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5412 pos=\`expr \$pos + 1\`
5424 *) pos="${fieldn}th";;
5426 echo "Your cpp writes the filename in the $pos field of the line."
5429 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5430 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5433 : locate header file
5438 for usrincdir in $usrinc
5440 if test -f \$usrincdir/\$wanted; then
5441 echo "\$usrincdir/\$wanted"
5445 awkprg='{ print \$$fieldn }'
5446 echo "#include <\$wanted>" > foo\$\$.c
5447 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5448 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5449 while read cline; do
5450 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5452 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5453 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5458 # status = 0: grep returned 0 lines, case statement not executed
5459 # status = 1: headerfile found
5460 # status = 2: while loop executed, no headerfile found
5464 if test \$status -eq 1; then
5471 : define an alternate in-header-list? function
5472 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5473 cont=true; xxf="echo \"<\$1> found.\" >&4";
5474 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5475 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5477 case $# in 4) instead=instead;; *) instead="at last";; esac;
5478 while $test "$cont"; do
5480 var=$2; eval "was=\$$2";
5481 if $test "$xxx" && $test -r "$xxx";
5483 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5486 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5487 set $yyy; shift; shift; yyy=$@;
5488 case $# in 0) cont="";;
5489 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5490 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5491 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5492 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5496 do set $yyy; var=$2; eval "was=\$$2";
5497 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5498 set $yyy; shift; shift; yyy=$@;
5501 : see if stdlib is available
5502 set stdlib.h i_stdlib
5505 : check for lengths of integral types
5509 echo "Checking to see how big your integers are..." >&4
5518 printf("intsize=%d;\n", (int)sizeof(int));
5519 printf("longsize=%d;\n", (int)sizeof(long));
5520 printf("shortsize=%d;\n", (int)sizeof(short));
5525 if eval $compile_ok && $run ./try > /dev/null; then
5527 echo "Your integers are $intsize bytes long."
5528 echo "Your long integers are $longsize bytes long."
5529 echo "Your short integers are $shortsize bytes long."
5533 Help! I can't compile and run the intsize test program: please enlighten me!
5534 (This is probably a misconfiguration in your system or libraries, and
5535 you really ought to fix it. Still, I'll try anyway.)
5539 rp="What is the size of an integer (in bytes)?"
5543 rp="What is the size of a long integer (in bytes)?"
5547 rp="What is the size of a short integer (in bytes)?"
5555 : check for long long
5557 echo "Checking to see if you have long long..." >&4
5558 echo 'int main() { long long x = 7; return 0; }' > try.c
5560 if eval $compile; then
5562 echo "You have long long."
5565 echo "You do not have long long."
5571 : check for length of long long
5572 case "${d_longlong}${longlongsize}" in
5575 echo "Checking to see how big your long longs are..." >&4
5576 $cat >try.c <<'EOCP'
5580 printf("%d\n", (int)sizeof(long long));
5585 if eval $compile_ok; then
5586 longlongsize=`$run ./try`
5587 echo "Your long longs are $longlongsize bytes long."
5591 echo "(I can't seem to compile the test program. Guessing...)"
5592 rp="What is the size of a long long (in bytes)?"
5596 if $test "X$longsize" = "X$longlongsize"; then
5597 echo "(That isn't any different from an ordinary long.)"
5603 : see if inttypes.h is available
5604 : we want a real compile instead of Inhdr because some systems
5605 : have an inttypes.h which includes non-existent headers
5608 #include <inttypes.h>
5610 static int32_t foo32 = 0x12345678;
5614 if eval $compile; then
5615 echo "<inttypes.h> found." >&4
5618 echo "<inttypes.h> NOT found." >&4
5627 echo "Checking to see if you have int64_t..." >&4
5629 #include <sys/types.h>
5630 #$i_inttypes I_INTTYPES
5632 #include <inttypes.h>
5634 int main() { int64_t x = 7; }
5637 if eval $compile; then
5639 echo "You have int64_t."
5642 echo "You do not have int64_t."
5648 : Check if 64bit ints have a quad type
5650 echo "Checking which 64-bit integer type we could use..." >&4
5656 val='"unsigned int"'
5661 *) case "$longsize" in
5665 val='"unsigned long"'
5670 *) case "$d_longlong:$longlongsize" in
5675 val='"unsigned long long"'
5680 *) case "$d_int64_t" in
5699 '') echo "Alas, no 64-bit integer types in sight." >&4
5702 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5707 : Do we want 64bit support
5708 case "$uselonglong" in
5709 "$define"|true|[yY]*)
5712 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5714 use64bitint="$define"
5717 case "$use64bits" in
5718 "$define"|true|[yY]*)
5721 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5723 use64bitint="$define"
5726 case "$use64bitints" in
5727 "$define"|true|[yY]*)
5730 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5732 use64bitint="$define"
5735 case "$use64bitsint" in
5736 "$define"|true|[yY]*)
5739 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5741 use64bitint="$define"
5744 case "$uselonglongs" in
5745 "$define"|true|[yY]*)
5748 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5750 use64bitint="$define"
5753 case "$use64bitsall" in
5754 "$define"|true|[yY]*)
5757 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5759 use64bitall="$define"
5764 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5766 case "$use64bitall" in
5767 "$define"|true|[yY]*) use64bitint="$define" ;;
5773 You have natively 64-bit long integers.
5777 *) case "$use64bitint" in
5778 "$define"|true|[yY]*) dflt='y';;
5787 Perl can be built to take advantage of 64-bit integer types
5788 on some systems. To do so, Configure can be run with -Duse64bitint.
5789 Choosing this option will most probably introduce binary incompatibilities.
5791 If this doesn't make any sense to you, just accept the default '$dflt'.
5792 (The default has been chosen based on your configuration.)
5794 rp='Try to use 64-bit integers, if available?'
5797 [yY]*) val="$define" ;;
5805 case "$use64bitall" in
5806 "$define"|true|[yY]*) dflt='y' ;;
5807 *) case "$longsize" in
5815 You may also choose to try maximal 64-bitness. It means using as much
5816 64-bitness as possible on the platform. This in turn means even more
5817 binary incompatibilities. On the other hand, your platform may not
5818 have any more 64-bitness available than what you already have chosen.
5820 If this doesn't make any sense to you, just accept the default '$dflt'.
5821 (The default has been chosen based on your configuration.)
5823 rp='Try to use maximal 64-bit support, if available?'
5826 [yY]*) val="$define" ;;
5831 case "$use64bitall" in
5833 case "$use64bitint" in
5837 Since you have chosen a maximally 64-bit build, I'm also turning on
5838 the use of 64-bit integers.
5840 use64bitint="$define" ;;
5845 : Look for a hint-file generated 'call-back-unit'. If the
5846 : user has specified that a 64-bit perl is to be built,
5847 : we may need to set or change some other defaults.
5848 if $test -f use64bitint.cbu; then
5849 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5852 case "$use64bitint" in
5853 "$define"|true|[yY]*)
5855 4) case "$archname64" in
5856 '') archname64=64int ;;
5863 : Look for a hint-file generated 'call-back-unit'. If the
5864 : user has specified that a maximally 64-bit perl is to be built,
5865 : we may need to set or change some other defaults.
5866 if $test -f use64bitall.cbu; then
5867 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5870 case "$use64bitall" in
5871 "$define"|true|[yY]*)
5873 4) case "$archname64" in
5874 ''|64int) archname64=64all ;;
5881 case "$d_quad:$use64bitint" in
5885 *** You have chosen to use 64-bit integers,
5886 *** but none can be found.
5887 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5888 *** Cannot continue, aborting.
5895 : check for length of double
5897 case "$doublesize" in
5899 echo "Checking to see how big your double precision numbers are..." >&4
5908 printf("%d\n", (int)sizeof(double));
5913 if eval $compile_ok; then
5914 doublesize=`$run ./try`
5915 echo "Your double is $doublesize bytes long."
5918 echo "(I can't seem to compile the test program. Guessing...)"
5919 rp="What is the size of a double precision number (in bytes)?"
5927 : check for long doubles
5929 echo "Checking to see if you have long double..." >&4
5930 echo 'int main() { long double x = 7.0; }' > try.c
5932 if eval $compile; then
5934 echo "You have long double."
5937 echo "You do not have long double."
5943 : check for length of long double
5944 case "${d_longdbl}${longdblsize}" in
5947 echo "Checking to see how big your long doubles are..." >&4
5948 $cat >try.c <<'EOCP'
5952 printf("%d\n", sizeof(long double));
5957 if eval $compile; then
5958 longdblsize=`$run ./try`
5959 echo "Your long doubles are $longdblsize bytes long."
5963 echo "(I can't seem to compile the test program. Guessing...)" >&4
5964 rp="What is the size of a long double (in bytes)?"
5968 if $test "X$doublesize" = "X$longdblsize"; then
5969 echo "That isn't any different from an ordinary double."
5970 echo "I'll keep your setting anyway, but you may see some"
5971 echo "harmless compilation warnings."
5977 : determine the architecture name
5979 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5980 tarch=`arch`"-$osname"
5981 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5982 if uname -m > tmparch 2>&1 ; then
5983 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5984 -e 's/$/'"-$osname/" tmparch`
5992 case "$myarchname" in
5995 echo "(Your architecture name used to be $myarchname.)"
5999 case "$targetarch" in
6001 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6006 *) dflt="$archname";;
6008 rp='What is your architecture name'
6011 case "$usethreads" in
6013 echo "Threads selected." >&4
6015 *-thread*) echo "...and architecture name already has -thread." >&4
6017 *) archname="$archname-thread"
6018 echo "...setting architecture name to $archname." >&4
6023 case "$usemultiplicity" in
6025 echo "Multiplicity selected." >&4
6027 *-multi*) echo "...and architecture name already has -multi." >&4
6029 *) archname="$archname-multi"
6030 echo "...setting architecture name to $archname." >&4
6035 case "$use64bitint$use64bitall" in
6037 case "$archname64" in
6039 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6042 case "$use64bitint" in
6043 "$define") echo "64 bit integers selected." >&4 ;;
6045 case "$use64bitall" in
6046 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6049 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6051 *) archname="$archname-$archname64"
6052 echo "...setting architecture name to $archname." >&4
6058 case "$uselongdouble" in
6060 echo "Long doubles selected." >&4
6061 case "$longdblsize" in
6063 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6067 *-ld*) echo "...and architecture name already has -ld." >&4
6069 *) archname="$archname-ld"
6070 echo "...setting architecture name to $archname." >&4
6077 if $test -f archname.cbu; then
6078 echo "Your platform has some specific hints for architecture name, using them..."
6082 : set the prefixit variable, to compute a suitable default value
6083 prefixit='case "$3" in
6085 case "$oldprefix" in
6086 "") eval "$1=\"\$$2\"";;
6093 ""|" ") eval "$1=\"\$$2\"";;
6099 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6101 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6102 /*-$oldprefix/*|\~*-$oldprefix/*)
6103 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6104 *) eval "$1=\"\$$2\"";;
6108 : determine installation style
6109 : For now, try to deduce it from prefix unless it is already set.
6110 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6111 case "$installstyle" in
6112 '') case "$prefix" in
6113 *perl*) dflt='lib';;
6114 *) dflt='lib/perl5' ;;
6117 *) dflt="$installstyle" ;;
6119 : Probably not worth prompting for this since we prompt for all
6120 : the directories individually, and the prompt would be too long and
6124 : determine where public executables go
6129 rp='Pathname where the public executables will reside?'
6131 if $test "X$ansexp" != "X$binexp"; then
6135 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6136 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6137 : this via initialinstalllocation
6140 case "$userelocatableinc" in
6141 $define|true|[yY]*) dflt='y' ;;
6146 Would you like to build Perl so that the installation is relocatable, so that
6147 library paths in @INC are determined relative to the path of the perl binary?
6148 This is not advised for system Perl installs, or if you need to run setid
6149 scripts or scripts under taint mode.
6151 If this doesn't make any sense to you, just accept the default '$dflt'.
6153 rp='Use relocatable @INC?'
6156 y|Y) val="$define" ;;
6159 set userelocatableinc
6162 initialinstalllocation="$binexp"
6163 : Default prefix is now "up one level from where the binaries are"
6164 case "$userelocatableinc" in
6170 installprefixexp=".../.."
6174 : determine where private library files go
6175 : Usual default is /usr/local/lib/perl5/$version.
6176 : Also allow things like /opt/perl/lib/$version, since
6177 : /opt/perl/lib/perl5... would be redundant.
6178 : The default "style" setting is made in installstyle.U
6179 case "$installstyle" in
6180 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6181 *) set dflt privlib lib/$version ;;
6186 There are some auxiliary files for $package that need to be put into a
6187 private library directory that is accessible by everyone.
6192 rp='Pathname where the private library files will reside?'
6197 : set the prefixup variable, to restore leading tilda escape
6198 prefixup='case "$prefixexp" in
6200 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6203 : determine where public architecture dependent libraries go
6206 : privlib default is /usr/local/lib/$package/$version
6207 : archlib default is /usr/local/lib/$package/$version/$archname
6208 : privlib may have an optional trailing /share.
6209 tdflt=`echo $privlib | $sed 's,/share$,,'`
6210 tdflt=$tdflt/$archname
6219 $spackage contains architecture-dependent library files. If you are
6220 sharing libraries in a heterogeneous environment, you might store
6221 these files in a separate location. Otherwise, you can just include
6222 them with the rest of the public library files.
6227 rp='Where do you want to put the public architecture-dependent libraries?'
6231 if $test X"$archlib" = X"$privlib"; then
6237 : see if setuid scripts can be secure
6240 Some kernels have a bug that prevents setuid #! scripts from being
6241 secure. Some sites have disabled setuid #! scripts because of this.
6243 First let's decide if your kernel supports secure setuid #! scripts.
6244 (If setuid #! scripts would be secure but have been disabled anyway,
6245 don't say that they are secure if asked.)
6250 if $test -d /dev/fd; then
6251 echo "#!$ls" >reflect
6252 chmod +x,u+s reflect
6253 ./reflect >flect 2>&1
6254 if $contains "/dev/fd" flect >/dev/null; then
6255 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6259 If you are not sure if they are secure, I can check but I'll need a
6260 username and password different from the one you are using right now.
6261 If you don't have such a username or don't want me to test, simply
6265 rp='Other username to test security of setuid scripts with?'
6270 case "$d_suidsafe" in
6271 '') echo "I'll assume setuid scripts are *not* secure." >&4
6274 echo "Well, the $hint value is *not* secure." >&4
6276 *) echo "Well, the $hint value *is* secure." >&4
6281 $rm -f reflect flect
6282 echo "#!$ls" >reflect
6283 chmod +x,u+s reflect
6286 echo '"su" will (probably) prompt you for '"$ans's password."
6287 su $ans -c './reflect >flect'
6288 if $contains "/dev/fd" flect >/dev/null; then
6289 echo "Okay, it looks like setuid scripts are secure." >&4
6292 echo "I don't think setuid scripts are secure." >&4
6297 rp='Does your kernel have *secure* setuid scripts?'
6300 [yY]*) val="$define";;
6305 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6306 echo "(That's for file descriptors, not floppy disks.)"
6312 $rm -f reflect flect
6314 : now see if they want to do setuid emulation
6315 if $test $patchlevel -lt 11; then
6318 case "$d_suidsafe" in
6321 echo "No need to emulate SUID scripts since they are secure here." >&4
6325 Some systems have disabled setuid scripts, especially systems where
6326 setuid scripts cannot be secure. On systems where setuid scripts have
6327 been disabled, the setuid/setgid bits on scripts are currently
6328 useless. It is possible for $package to detect those bits and emulate
6329 setuid/setgid in a secure fashion. This emulation will only work if
6330 setuid scripts have been disabled in your kernel.
6334 "$define") dflt=y ;;
6337 rp="Do you want to do setuid/setgid emulation?"
6340 [yY]*) val="$define";;
6352 SUID emulation has been removed for 5.12
6353 Please re-run Configure without -Dd_dosuid
6362 : Find perl5.005 or later.
6363 echo "Looking for a previously installed perl5.005 or later... "
6365 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6366 : Check if this perl is recent and can load a simple module
6367 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6370 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6380 '') echo "None found. That's ok.";;
6381 *) echo "Using $perl5." ;;
6384 : Set the siteprefix variables
6387 After $package is installed, you may wish to install various
6388 add-on modules and utilities. Typically, these add-ons will
6389 be installed under $prefix with the rest
6390 of this package. However, you may wish to install such add-ons
6391 elsewhere under a different prefix.
6393 If you do not wish to put everything under a single prefix, that's
6394 ok. You will be prompted for the individual locations; this siteprefix
6395 is only used to suggest the defaults.
6397 The default should be fine for most people.
6401 rp='Installation prefix to use for add-on modules and utilities?'
6402 : XXX Here might be another good place for an installstyle setting.
6403 case "$siteprefix" in
6405 *) dflt=$siteprefix ;;
6408 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6410 case "$siteprefix" in
6414 *) oldsiteprefix="$prefix";;
6419 siteprefixexp="$ansexp"
6421 : determine where site specific libraries go.
6422 : Usual default is /usr/local/lib/perl5/site_perl/$version
6423 : The default "style" setting is made in installstyle.U
6424 : XXX No longer works with Prefixit stuff.
6425 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6427 '') case "$installstyle" in
6428 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6429 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6437 The installation process will create a directory for
6438 site-specific extensions and modules. Most users find it convenient
6439 to place all site-specific files in this directory rather than in the
6440 main distribution directory.
6444 rp='Pathname for the site-specific library files?'
6448 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6450 : Determine list of previous versions to include in @INC
6451 $cat > getverlist <<EOPL
6454 \$api_versionstring = "$api_versionstring";
6455 \$version = "$version";
6456 \$stem = "$sitelib_stem";
6457 \$archname = "$archname";
6459 $cat >> getverlist <<'EOPL'
6460 # The list found is store twice for each entry: the original name, and
6461 # the binary broken down version as pack "sss", so sorting is easy and
6462 # unambiguous. This will work for all versions that have a maximum of
6463 # three digit groups, separate by '.'s or '_'s. Names are extended with
6464 # ".0.0" to ensure at least three elements for the pack.
6465 # -- H.Merijn Brand (m)'06 23-10-2006
6467 # Can't have leading @ because metaconfig interprets it as a command!
6468 ;@inc_version_list=();
6469 # XXX Redo to do opendir/readdir?
6472 ;@candidates = map {
6473 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6474 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6480 ($pversion, $aversion, $vsn5005) = map {
6481 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6482 foreach $d (@candidates) {
6483 if ($d->[1] lt $pversion) {
6484 if ($d->[1] ge $aversion) {
6485 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6487 elsif ($d->[1] ge $vsn5005) {
6488 unshift(@inc_version_list, grep { -d } $d->[0]);
6492 # Skip newer version. I.e. don't look in
6493 # 5.7.0 if we're installing 5.6.1.
6497 if (@inc_version_list) {
6498 print join(' ', @inc_version_list);
6501 # Blank space to preserve value for next Configure run.
6506 case "$inc_version_list" in
6507 '') if test -x "$perl5$exe_ext"; then
6508 dflt=`$perl5 getverlist`
6513 $undef) dflt='none' ;;
6514 *) eval dflt=\"$inc_version_list\" ;;
6517 ''|' ') dflt=none ;;
6524 In order to ease the process of upgrading, this version of perl
6525 can be configured to use modules built and installed with earlier
6526 versions of perl that were installed under $prefix. Specify here
6527 the list of earlier versions that this version of perl should check.
6528 If Configure detected no earlier versions of perl installed under
6529 $prefix, then the list will be empty. Answer 'none' to tell perl
6530 to not search earlier versions.
6532 The default should almost always be sensible, so if you're not sure,
6533 just accept the default.
6536 rp='List of earlier versions to include in @INC?'
6539 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6540 *) inc_version_list="$ans" ;;
6542 case "$inc_version_list" in
6544 inc_version_list_init='0'
6545 d_inc_version_list="$undef"
6547 *) inc_version_list_init=`echo $inc_version_list |
6548 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6549 d_inc_version_list="$define"
6554 : see if malloc/malloc.h has to be included
6555 set malloc/malloc.h i_mallocmalloc
6558 : see if this is a malloc.h system
6559 : we want a real compile instead of Inhdr because some systems have a
6560 : malloc.h that just gives a compile error saying to use stdlib.h instead
6565 #$i_mallocmalloc I_MALLOCMALLOC
6566 #ifdef I_MALLOCMALLOC
6567 # include <malloc/malloc.h>
6570 int main () { return 0; }
6573 if eval $compile; then
6574 echo "<malloc.h> found." >&4
6577 echo "<malloc.h> NOT found." >&4
6584 : check for void type
6586 echo "Checking to see how well your C compiler groks the void type..." >&4
6587 case "$voidflags" in
6599 extern void moo(); /* function returning void */
6600 void (*goo)(); /* ptr to func returning void */
6602 void *hue; /* generic ptr */
6615 int main() { sub(); }
6617 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6618 voidflags=$defvoidused
6619 echo "Good. It appears to support void to the level $package wants.">&4
6620 if $contains warning .out >/dev/null 2>&1; then
6621 echo "However, you might get some warnings that look like this:"
6625 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6626 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6627 echo "It supports 1..."
6628 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6629 echo "It also supports 2..."
6630 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6632 echo "And it supports 4 but not 8 definitely."
6634 echo "It doesn't support 4..."
6635 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6637 echo "But it supports 8."
6640 echo "Neither does it support 8."
6644 echo "It does not support 2..."
6645 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6647 echo "But it supports 4 and 8."
6649 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6651 echo "And it supports 4 but has not heard about 8."
6653 echo "However it supports 8 but not 4."
6658 echo "There is no support at all for void."
6663 case "$voidflags" in
6666 Support flag bits are:
6667 1: basic void declarations.
6668 2: arrays of pointers to functions returning void.
6669 4: operations between pointers to and addresses of void functions.
6670 8: generic void pointers.
6673 rp="Your void support flags add up to what?"
6680 : check for length of pointer
6684 echo "Checking to see how big your pointers are..." >&4
6685 if test "$voidflags" -gt 7; then
6686 echo '#define VOID_PTR char *' > try.c
6688 echo '#define VOID_PTR void *' > try.c
6698 printf("%d\n", (int)sizeof(VOID_PTR));
6703 if eval $compile_ok; then
6704 ptrsize=`$run ./try`
6705 echo "Your pointers are $ptrsize bytes long."
6708 echo "(I can't seem to compile the test program. Guessing...)" >&4
6709 rp="What is the size of a pointer (in bytes)?"
6716 case "$use64bitall" in
6717 "$define"|true|[yY]*)
6721 *** You have chosen a maximally 64-bit build,
6722 *** but your pointers are only 4 bytes wide.
6723 *** Please rerun Configure without -Duse64bitall.
6728 *** Since you have quads, you could possibly try with -Duse64bitint.
6733 *** Cannot continue, aborting.
6744 : determine whether to use malloc wrapping
6746 case "$usemallocwrap" in
6747 [yY]*|true|$define) dflt='y' ;;
6748 [nN]*|false|$undef) dflt='n' ;;
6749 *) case "$usedevel" in
6750 [yY]*|true|$define) dflt='y' ;;
6755 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6757 usemallocwrap="$ans"
6760 usemallocwrap="$define" ;;
6762 usemallocwrap="$undef" ;;
6765 : determine which malloc to compile in
6767 case "$usemymalloc" in
6768 [yY]*|true|$define) dflt='y' ;;
6769 [nN]*|false|$undef) dflt='n' ;;
6770 *) case "$ptrsize" in
6776 rp="Do you wish to attempt to use the malloc that comes with $package?"
6782 mallocsrc='malloc.c'
6783 mallocobj="malloc$_o"
6784 d_mymalloc="$define"
6787 : Remove malloc from list of libraries to use
6788 echo "Removing unneeded -lmalloc from library list" >&4
6789 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6792 echo "libs = $libs" >&4
6804 : compute the return types of malloc and free
6806 $cat >malloc.c <<END
6810 #include <sys/types.h>
6824 case "$malloctype" in
6826 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6833 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6837 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6844 echo "Your system uses $freetype free(), it would seem." >&4
6846 : determine where site specific architecture-dependent libraries go.
6847 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6848 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6849 : sitelib may have an optional trailing /share.
6851 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6852 dflt="$dflt/$archname"
6857 set sitearch sitearch none
6861 The installation process will also create a directory for
6862 architecture-dependent site-specific extensions and modules.
6866 rp='Pathname for the site-specific architecture-dependent library files?'
6870 if $test X"$sitearch" = X"$sitelib"; then
6873 d_sitearch="$define"
6876 : Set the vendorprefix variables
6879 The installation process will also create a directory for
6880 vendor-supplied add-ons. Vendors who supply perl with their system
6881 may find it convenient to place all vendor-supplied files in this
6882 directory rather than in the main distribution directory. This will
6883 ease upgrades between binary-compatible maintenance versions of perl.
6885 Of course you may also use these directories in whatever way you see
6886 fit. For example, you might use them to access modules shared over a
6887 company-wide network.
6889 The default answer should be fine for most people.
6890 This causes further questions about vendor add-ons to be skipped
6891 and no vendor-specific directories will be configured for perl.
6894 rp='Do you want to configure vendor-specific add-on directories?'
6895 case "$usevendorprefix" in
6896 define|true|[yY]*) dflt=y ;;
6897 *) : User may have set vendorprefix directly on Configure command line.
6898 case "$vendorprefix" in
6907 rp='Installation prefix to use for vendor-supplied add-ons?'
6908 case "$vendorprefix" in
6910 *) dflt=$vendorprefix ;;
6913 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6915 case "$vendorprefix" in
6919 *) oldvendorprefix="$prefix";;
6923 usevendorprefix="$define"
6925 vendorprefixexp="$ansexp"
6927 *) usevendorprefix="$undef"
6933 : Set the vendorlib variables
6934 case "$vendorprefix" in
6935 '') d_vendorlib="$undef"
6939 *) d_vendorlib="$define"
6940 : determine where vendor-supplied modules go.
6941 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6942 case "$vendorlib" in
6944 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6945 case "$installstyle" in
6946 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6947 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6950 *) dflt="$vendorlib"
6954 rp='Pathname for the vendor-supplied library files?'
6957 vendorlibexp="$ansexp"
6960 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6964 : Set the vendorarch variables
6965 case "$vendorprefix" in
6966 '') d_vendorarch="$undef"
6970 *) d_vendorarch="$define"
6971 : determine where vendor-supplied architecture-dependent libraries go.
6972 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6973 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6974 : vendorlib may have an optional trailing /share.
6975 case "$vendorarch" in
6976 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6977 dflt="$dflt/$archname"
6979 *) dflt="$vendorarch" ;;
6982 rp='Pathname for vendor-supplied architecture-dependent files?'
6985 vendorarchexp="$ansexp"
6988 prefixvar=vendorarch
6990 if $test X"$vendorarch" = X"$vendorlib"; then
6991 d_vendorarch="$undef"
6993 d_vendorarch="$define"
6996 : Final catch-all directories to search
6999 Lastly, you can have perl look in other directories for extensions and
7000 modules in addition to those already specified.
7001 These directories will be searched after
7005 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7006 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7008 case "$otherlibdirs" in
7009 ''|' ') dflt='none' ;;
7010 *) dflt="$otherlibdirs" ;;
7013 Enter a colon-separated set of extra paths to include in perl's @INC
7014 search path, or enter 'none' for no extra paths.
7018 rp='Colon-separated list of additional directories for perl to search?'
7021 ' '|''|none) otherlibdirs=' ' ;;
7022 *) otherlibdirs="$ans" ;;
7024 case "$otherlibdirs" in
7028 set d_perl_otherlibdirs
7031 : Cruising for prototypes
7033 echo "Checking out function prototypes..." >&4
7034 $cat >prototype.c <<EOCP
7039 int main(int argc, char *argv[]) {
7042 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7043 echo "Your C compiler appears to support function prototypes."
7046 echo "Your C compiler doesn't seem to understand function prototypes."
7053 : Check if ansi2knr is required
7054 case "$prototype" in
7056 *) ansi2knr='ansi2knr'
7061 This version of $package can only be compiled by a compiler that
7062 understands function prototypes. Unfortunately, your C compiler
7064 doesn't seem to understand them. Sorry about that.
7066 If GNU cc is available for your system, perhaps you could try that instead.
7068 Eventually, we hope to support building Perl with pre-ANSI compilers.
7069 If you would like to help in that effort, please contact <perlbug@perl.org>.
7071 Aborting Configure now.
7078 dflt_dtrace='/usr/sbin/dtrace'
7079 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7083 Perl can be built to support DTrace on platforms that support it.
7084 DTrace is a diagnosis and performance analysis tool from Sun.
7086 If this doesn't make any sense to you, just accept the default '$dflt'.
7090 case "$usedtrace" in
7096 dflt_dtrace=$usedtrace
7103 rp='Support DTrace if available?'
7106 y|Y) val="$define" ;;
7112 test "X$usedtrace" != "X$define" && break
7115 rp='Where is the dtrace executable?'
7124 if $dtrace -h -s ../perldtrace.d \
7125 -o perldtrace.tmp >/dev/null 2>&1 \
7126 && rm -f perldtrace.tmp
7129 echo "Good: your $dtrace knows about the -h flag."
7133 *** $me: Fatal Error: $dtrace doesn't support -h flag
7135 *** Your installed dtrace doesn't support the -h switch to compile a D
7136 *** program into a C header. Can't continue.
7148 *** $me: Fatal Error: $dtrace not found.
7155 echo "*** $dtrace was not found."
7161 : See if we want extra modules installed
7168 Perl can be built with extra modules or bundles of modules which
7169 will be fetched from the CPAN and installed alongside Perl.
7171 Notice that you will need access to the CPAN; either via the Internet,
7172 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7173 be asked later to configure the CPAN.pm module which will in turn do
7174 the installation of the rest of the extra modules or bundles.)
7176 Notice also that if the modules require any external software such as
7177 libraries and headers (the libz library and the zlib.h header for the
7178 Compress::Zlib module, for example) you MUST have any such software
7179 already installed, this configuration process will NOT install such
7182 If this doesn't make any sense to you, just accept the default '$dflt'.
7184 rp='Install any extra modules (y or n)?'
7190 Please list any extra modules or bundles to be installed from CPAN,
7191 with spaces between the names. The names can be in any format the
7192 'install' command of CPAN.pm will understand. (Answer 'none',
7193 without the quotes, to install no extra modules or bundles.)
7203 $rm -f ../extras.lst
7205 *) echo "(Saving the list of extras for later...)"
7206 echo "$extras" > ../extras.lst
7214 : determine where html pages for programs go
7215 set html1dir html1dir none
7219 If you wish to install html files for programs in $spackage, indicate
7220 the appropriate directory here. To skip installing html files,
7224 ''|none|$undef|' ') dflt=none ;;
7225 *) dflt=$html1dir ;;
7228 rp="Directory for the main $spackage html pages?"
7232 : Use ' ' for none so value is preserved next time through Configure
7233 $test X"$html1dir" = "X" && html1dir=' '
7235 : determine where html pages for libraries and modules go
7236 set html3dir html3dir none
7240 If you wish to install html files for modules associated with $spackage,
7241 indicate the appropriate directory here. To skip installing html files,
7244 : There is no obvious default. If they have specified html1dir, then
7245 : try to key off that, possibly changing .../html1 into .../html3.
7247 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7248 *) dflt=$html3dir ;;
7251 rp="Directory for the $spackage module html pages?"
7255 : Use ' ' for none so value is preserved next time through Configure
7256 $test X"$html3dir" = "X" && html3dir=' '
7258 : determine whether to install perl also as /usr/bin/perl
7261 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7263 Many scripts expect perl to be installed as /usr/bin/perl.
7265 If you want to, I can install the perl you are about to compile
7266 as /usr/bin/perl (in addition to $bin/perl).
7268 if test -f /usr/bin/perl; then
7271 However, please note that because you already have a /usr/bin/perl,
7272 overwriting that with a new Perl would very probably cause problems.
7273 Therefore I'm assuming you don't want to do that (unless you insist).
7276 case "$installusrbinperl" in
7277 "$define"|[yY]*) dflt='y';;
7283 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7286 case "$installusrbinperl" in
7287 "$undef"|[nN]*) dflt='n';;
7291 rp="Do you want to install perl as /usr/bin/perl?"
7294 [yY]*) val="$define";;
7300 set installusrbinperl
7303 : Check if we are using the GNU C library
7305 echo "Checking for GNU C Library..." >&4
7307 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7308 alone are insufficient to distinguish different versions, such as
7309 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7310 libc version 2.1.0. A. Dougherty, June 3, 2002.
7316 # ifdef __GLIBC_MINOR__
7317 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7318 # include <gnu/libc-version.h>
7319 printf("%s\n", gnu_get_libc_version());
7321 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7324 printf("%d\n", __GLIBC__);
7333 if eval $compile_ok && $run ./try > glibc.ver; then
7335 gnulibc_version=`$cat glibc.ver`
7336 echo "You are using the GNU C Library version $gnulibc_version"
7340 echo "You are not using the GNU C Library"
7346 : see if nm is to be used to determine whether a symbol is defined or not
7350 case "$d_gnulibc" in
7353 echo "nm probably won't work on the GNU C Library." >&4
7359 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7361 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7362 echo "'nm' won't be sufficient on this sytem." >&4
7368 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7369 if $test $dflt -gt 20; then
7379 true|$define) dflt=y;;
7386 I can use $nm to extract the symbols from your C libraries. This
7387 is a time consuming task which may generate huge output on the disk (up
7388 to 3 megabytes) but that should make the symbols extraction faster. The
7389 alternative is to skip the 'nm' extraction part and to compile a small
7390 test program instead to determine whether each symbol is present. If
7391 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7392 this may be the best solution.
7394 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7397 rp="Shall I use $nm to extract C symbols from the libraries?"
7400 [Nn]*) usenm=false;;
7409 : nm options which may be necessary
7411 '') if $test -f /mach_boot; then
7413 elif $test -d /usr/ccs/lib; then
7414 nm_opt='-p' # Solaris (and SunOS?)
7415 elif $test -f /dgux; then
7417 elif $test -f /lib64/rld; then
7418 nm_opt='-p' # 64-bit Irix
7424 : nm options which may be necessary for shared libraries but illegal
7425 : for archive libraries. Thank you, Linux.
7426 case "$nm_so_opt" in
7427 '') case "$myuname" in
7429 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7430 nm_so_opt='--dynamic'
7437 : Figure out where the libc is located
7440 : get list of predefined functions in a handy place
7445 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7451 *) for thislib in $libs; do
7454 : Handle C library specially below.
7457 thislib=`echo $thislib | $sed -e 's/^-l//'`
7458 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7460 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7462 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7464 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7466 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7468 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7470 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7475 libnames="$libnames $try"
7477 *) libnames="$libnames $thislib" ;;
7486 for xxx in $libpth; do
7487 $test -r $1 || set $xxx/libc.$so
7488 : The messy sed command sorts on library version numbers.
7490 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7491 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7493 s/[0-9][0-9]*/0000&/g
7494 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7497 $sort | $sed -e 's/^.* //'`
7500 $test -r $1 || set /usr/ccs/lib/libc.$so
7501 $test -r $1 || set /lib/libsys_s$_a
7507 if $test -r "$1"; then
7508 echo "Your (shared) C library seems to be in $1."
7510 elif $test -r /lib/libc && $test -r /lib/clib; then
7511 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7513 libc='/lib/clib /lib/libc'
7514 if $test -r /lib/syslib; then
7515 echo "(Your math library is in /lib/syslib.)"
7516 libc="$libc /lib/syslib"
7518 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7519 echo "Your C library seems to be in $libc, as you said before."
7520 elif $test -r $incpath/usr/lib/libc$_a; then
7521 libc=$incpath/usr/lib/libc$_a;
7522 echo "Your C library seems to be in $libc. That's fine."
7523 elif $test -r /lib/libc$_a; then
7525 echo "Your C library seems to be in $libc. You're normal."
7527 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7529 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7530 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7531 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7533 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7535 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7538 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7540 if $test -r "$tans"; then
7541 echo "Your C library seems to be in $tans, of all places."
7547 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7551 If the guess above is wrong (which it might be if you're using a strange
7552 compiler, or your machine supports multiple models), you can override it here.
7557 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7559 I can't seem to find your C library. I've looked in the following places:
7562 $sed 's/^/ /' libpath
7565 None of these seems to contain your C library. I need to get its name...
7570 rp='Where is your C library?'
7575 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7576 set X `cat libnames`
7579 case $# in 1) xxx=file; esac
7580 echo "Extracting names from the following $xxx for later perusal:" >&4
7582 $sed 's/^/ /' libnames >&4
7584 $echo $n "This may take a while...$c" >&4
7588 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7589 *) $nm $nm_opt $file 2>/dev/null;;
7594 $grep fprintf libc.tmp > libc.ptf
7595 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7596 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7598 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7600 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7602 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7604 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7606 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7608 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7610 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7612 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7614 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7616 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7618 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7620 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7622 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7623 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7625 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7627 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7629 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7631 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7633 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7635 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7637 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7639 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7641 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7643 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7645 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7647 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7649 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7651 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7653 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7656 $nm -p $* 2>/dev/null >libc.tmp
7657 $grep fprintf libc.tmp > libc.ptf
7658 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7659 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7665 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7667 if $ar t $libc > libc.tmp && \
7668 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7670 for thisname in $libnames $libc; do
7671 $ar t $thisname >>libc.tmp
7673 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7675 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7676 for thisname in $libnames $libc; do
7677 $ar tv $thisname >>libc.tmp
7678 emximp -o tmp.imp $thisname \
7680 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7681 < tmp.imp >>libc.tmp
7684 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7687 echo "$ar didn't seem to work right." >&4
7688 echo "Maybe this is a Cray...trying bld instead..." >&4
7690 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7693 for thisname in $libnames; do
7695 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7696 $ar t $thisname >>libc.tmp
7700 echo "That didn't work either. Giving up." >&4
7710 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7711 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7713 *) if $test -f /lib/syscalls.exp; then
7715 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7716 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7717 /lib/syscalls.exp >>libc.list
7723 $rm -f libnames libpath
7725 : see if dld is available
7729 : Check if we are using C++
7731 echo "Checking for C++..." >&4
7732 $cat >try.c <<'EOCP'
7744 if eval $compile_ok && $run ./try; then
7746 echo "You are using a C++ compiler."
7749 echo "You are not using a C++ compiler."
7755 : is a C symbol defined?
7758 -v) tf=libc.tmp; tdc="";;
7759 -a) tf=libc.tmp; tdc="[]";;
7760 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7762 case "$d_cplusplus" in
7763 $define) extern_C="extern \"C\"" ;;
7764 *) extern_C="extern" ;;
7767 case "$reuseval-$4" in
7769 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7774 if $test "$runnm" = true; then
7775 if $contains $tlook $tf >/dev/null 2>&1; then
7777 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7778 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7779 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7780 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7784 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7785 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7791 $define) tval=true;;
7798 : define an is-in-libc? function
7799 inlibc='echo " "; td=$define; tu=$undef;
7800 sym=$1; var=$2; eval "was=\$$2";
7802 case "$reuseval$was" in
7812 echo "$sym() found." >&4;
7813 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7815 echo "$sym() NOT found." >&4;
7816 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7820 $define) echo "$sym() found." >&4;;
7821 *) echo "$sym() NOT found." >&4;;
7825 : see if dlopen exists
7827 xxx_ccflags="$ccflags"
7829 : with g++ one needs -shared to get is-in-libc to work for dlopen
7830 case "$gccversion" in
7832 *) case "$d_cplusplus" in
7833 "$define") ccflags="$ccflags -shared" ;;
7840 ccflags="$xxx_ccflags"
7842 : see if this is a unistd.h system
7843 set unistd.h i_unistd
7846 : determine which dynamic loading, if any, to compile in
7848 dldir="ext/DynaLoader"
7861 $define) dflt='y' ;;
7864 $define) dflt='y' ;;
7866 : Does a dl_xxx.xs file exist for this operating system
7867 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7870 rp="Do you wish to use dynamic loading?"
7878 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7879 dflt="$dldir/dl_${osname}.xs"
7880 elif $test "$d_dlopen" = "$define" ; then
7881 dflt="$dldir/dl_dlopen.xs"
7882 elif $test "$i_dld" = "$define" ; then
7883 dflt="$dldir/dl_dld.xs"
7888 *) dflt="$dldir/$dlsrc"
7891 echo "The following dynamic loading files are available:"
7892 : Can not go over to $dldir because getfile has path hard-coded in.
7893 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7894 rp="Source file to use for dynamic loading"
7900 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7904 Some systems may require passing special flags to $cc -c to
7905 compile modules that will be used to create a shared library.
7906 To use no flags, say "none".
7909 case "$cccdlflags" in
7910 '') case "$gccversion" in
7911 '') case "$osname" in
7913 next) dflt='none' ;;
7914 irix*) dflt='-KPIC' ;;
7915 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7916 sunos) dflt='-pic' ;;
7920 *) case "$osname" in
7921 darwin) dflt='none' ;;
7922 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7927 *) dflt="$cccdlflags" ;;
7929 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7932 none) cccdlflags=' ' ;;
7933 *) cccdlflags="$ans" ;;
7938 Some systems use ld to create libraries that can be dynamically loaded,
7939 while other systems (such as those using ELF) use $cc.
7943 '') $cat >try.c <<EOM
7944 /* Test for whether ELF binaries are produced */
7956 int i = open("a.out",O_RDONLY);
7959 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7960 exit(0); /* succeed (yes, it's ELF) */
7965 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7967 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7972 echo "I'll use ld to build dynamic libraries."
7981 rp="What command should be used to create dynamic libraries?"
7987 Some systems may require passing special flags to $ld to create a
7988 library that can be dynamically loaded. If your ld flags include
7989 -L/other/path options to locate libraries outside your loader's normal
7990 search path, you may need to specify those -L options here as well. To
7991 use no flags, say "none".
7994 case "$lddlflags" in
7995 '') case "$osname" in
7996 beos) dflt='-nostart' ;;
7997 haiku) dflt='-shared' ;;
7999 case "$gccversion" in
8000 '') dflt="$dflt +vnocompatwarnings" ;;
8003 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8004 next) dflt='none' ;;
8005 solaris) dflt='-G' ;;
8006 sunos) dflt='-assert nodefinitions' ;;
8007 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8011 *) dflt="$lddlflags" ;;
8014 : Try to guess additional flags to pick up local libraries.
8015 : Be careful not to append to a plain 'none'
8019 for thisflag in $ldflags; do
8024 *) dflt="$dflt $thisflag" ;;
8031 ''|' ') dflt='none' ;;
8035 *-fstack-protector*)
8037 *-fstack-protector*) ;; # Don't add it again
8038 *) dflt="$dflt -fstack-protector" ;;
8044 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8047 none) lddlflags=' ' ;;
8048 *) lddlflags="$ans" ;;
8053 Some systems may require passing special flags to $cc to indicate that
8054 the resulting executable will use dynamic linking. To use no flags,
8058 case "$ccdlflags" in
8059 '') case "$osname" in
8060 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8061 next|sunos) dflt='none' ;;
8065 *) dflt="$ccdlflags" ;;
8067 rp="Any special flags to pass to $cc to use dynamic linking?"
8070 none) ccdlflags=' ' ;;
8071 *) ccdlflags="$ans" ;;
8082 : Do we want a shared libperl?
8086 # No dynamic loading being used, so don't bother even to prompt.
8089 *) case "$useshrplib" in
8090 '') case "$osname" in
8091 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8093 also='Building a shared libperl is required for dynamic loading to work on your system.'
8098 also='Building a shared libperl is needed for MAB support.'
8116 The perl executable is normally obtained by linking perlmain.c with
8117 libperl${_a}, any static extensions (usually just DynaLoader), and
8118 any other libraries needed on this system (such as -lm, etc.). Since
8119 your system supports dynamic loading, it is probably possible to build
8120 a shared libperl.$so. If you will have more than one executable linked
8121 to libperl.$so, this will significantly reduce the size of each
8122 executable, but it may have a noticeable effect on performance. The
8123 default is probably sensible for your system.
8127 rp="Build a shared libperl.$so (y/n)"
8131 useshrplib='true' ;;
8132 *) useshrplib='false' ;;
8137 case "$useshrplib" in
8139 case "$userelocatableinc" in
8141 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8142 echo "See INSTALL for an explanation why that won't work." >&4
8148 # Figure out a good name for libperl.so. Since it gets stored in
8149 # a version-specific architecture-dependent library, the version
8150 # number isn't really that important, except for making cc/ld happy.
8152 # A name such as libperl.so.10.1
8153 majmin="libperl.$so.$patchlevel.$subversion"
8154 # A name such as libperl.so.100
8155 majonly=`echo $patchlevel $subversion |
8156 $awk '{printf "%d%02d", $1, $2}'`
8157 majonly=libperl.$so.$majonly
8158 # I'd prefer to keep the os-specific stuff here to a minimum, and
8159 # rely on figuring it out from the naming of libc.
8160 case "${osname}${osvers}" in
8163 # XXX How handle the --version stuff for MAB?
8165 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8168 cygwin*) # ld links now against the dll directly
8169 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8170 majonly=`echo $patchlevel $subversion |
8171 $awk '{printf "%03d%03d", $1, $2}'`
8172 majonly=cygperl5.$majonly.$so
8175 *) # Try to guess based on whether libc has major.minor.
8177 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8178 *libc.$so.[0-9]*) dflt=$majonly ;;
8179 *) dflt=libperl.$so ;;
8189 I need to select a good name for the shared libperl. If your system uses
8190 library names with major and minor numbers, then you might want something
8191 like $majmin. Alternatively, if your system uses a single version
8192 number for shared libraries, then you might want to use $majonly.
8193 Or, your system might be quite happy with a simple libperl.$so.
8195 Since the shared libperl will get installed into a version-specific
8196 architecture-dependent directory, the version number of the shared perl
8197 library probably isn't important, so the default should be o.k.
8200 rp='What name do you want to give to the shared libperl?'
8203 echo "Ok, I'll use $libperl"
8206 libperl="libperl${_a}"
8210 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8214 WARNING: Use of the shrpdir variable for the installation location of
8215 the shared $libperl is not supported. It was never documented and
8216 will not work in this version. Let me (perlbug@perl.org)
8217 know of any problems this may cause.
8223 But your current setting of $shrpdir is
8224 the default anyway, so it's harmless.
8229 Further, your current attempted setting of $shrpdir
8230 conflicts with the value of $archlibexp/CORE
8231 that installperl will use.
8238 # How will the perl executable find the installed shared $libperl?
8239 # Add $xxx to ccdlflags.
8240 # If we can't figure out a command-line option, use $shrpenv to
8241 # set env LD_RUN_PATH. The main perl makefile uses this.
8242 shrpdir=$archlibexp/CORE
8245 if "$useshrplib"; then
8248 # We'll set it in Makefile.SH...
8253 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly)
8254 xxx="-Wl,-R$shrpdir"
8256 bsdos|linux|irix*|dec_osf|gnu*)
8257 xxx="-Wl,-rpath,$shrpdir"
8260 # next doesn't like the default...
8263 # beos doesn't like the default, either.
8266 # Haiku doesn't like the default, either.
8269 # hpux doesn't like the default, either.
8270 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8273 # cygwin needs only ldlibpth
8276 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8282 # Only add $xxx if it isn't already in ccdlflags.
8283 case " $ccdlflags " in
8285 *) ccdlflags="$ccdlflags $xxx"
8288 Adding $xxx to the flags
8289 passed to $ld so that the perl executable will find the
8290 installed shared $libperl.
8298 # Fix ccdlflags in AIX for building external extensions.
8299 # (For building Perl itself bare -bE:perl.exp is needed,
8300 # Makefile.SH takes care of this.)
8302 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8304 # Respect a hint or command-line value.
8306 '') shrpenv="$tmp_shrpenv" ;;
8308 case "$ldlibpthname" in
8309 '') ldlibpthname=LD_LIBRARY_PATH ;;
8310 none) ldlibpthname='' ;;
8313 : determine where manual pages are on this system
8317 syspath='/usr/share/man/man1 /usr/man/man1'
8318 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8319 syspath="$syspath /usr/man/u_man/man1"
8320 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8321 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8322 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8323 sysman=`./loc . /usr/man/man1 $syspath`
8326 if $test -d "$sysman"; then
8327 echo "System manual is in $sysman." >&4
8329 echo "Could not find manual pages in source form." >&4
8332 : determine where manual pages go
8333 set man1dir man1dir none
8337 $spackage has manual pages available in source form.
8341 echo "However, you don't have nroff, so they're probably useless to you."
8343 '') man1dir="none";;
8346 echo "If you don't want the manual sources installed, answer 'none'."
8351 lookpath="$prefixexp/share/man/man1"
8352 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8353 lookpath="$lookpath $prefixexp/man/p_man/man1"
8354 lookpath="$lookpath $prefixexp/man/u_man/man1"
8355 lookpath="$lookpath $prefixexp/man/man.1"
8357 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8358 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8368 rp="Where do the main $spackage manual pages (source) go?"
8370 if $test "X$man1direxp" != "X$ansexp"; then
8381 : What suffix to use on installed man pages
8388 rp="What suffix should be used for the main $spackage man pages?"
8390 '') case "$man1dir" in
8404 *) dflt="$man1ext";;
8411 : see if we can have long filenames
8413 first=123456789abcdef
8415 if (echo hi >$first) 2>/dev/null; then
8416 if $test -f 123456789abcde; then
8417 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8420 echo 'You can have filenames longer than 14 characters.'>&4
8425 You can't have filenames longer than 14 chars.
8426 You can't even think about them!
8432 $rm -rf 123456789abcde*
8434 : determine where library module manual pages go
8435 set man3dir man3dir none
8439 $spackage has manual pages for many of the library modules.
8445 However, you don't have nroff, so they're probably useless to you.
8448 '') man3dir="none";;
8452 case "$d_flexfnam" in
8455 However, your system can't handle the long file names like File::Basename.3.
8458 '') man3dir="none";;
8462 echo "If you don't want the manual sources installed, answer 'none'."
8463 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8465 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8466 if $test -d "$privlib/man/man3"; then
8469 WARNING: Previous versions of perl installed man3 pages into
8470 $privlib/man/man3. This version will suggest a
8471 new default of $dflt.
8475 rp='Do you wish to preserve the old behavior?(y/n)'
8478 y*) dflt="$privlib/man/man3" ;;
8483 *) dflt="$man3dir" ;;
8490 rp="Where do the $package library man pages (source) go?"
8500 : What suffix to use on installed man pages
8506 rp="What suffix should be used for the $package library man pages?"
8508 '') case "$man3dir" in
8522 *) dflt="$man3ext";;
8529 : see if we have to deal with yellow pages, now NIS.
8530 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8531 if $test -f /usr/etc/nibindd; then
8533 echo "I'm fairly confident you're on a NeXT."
8535 rp='Do you get the hosts file via NetInfo?'
8544 y*) hostcat='nidump hosts .';;
8545 *) case "$hostcat" in
8546 nidump*) hostcat='';;
8556 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8564 rp='Are you getting the hosts file via yellow pages?'
8567 y*) hostcat='ypcat hosts';;
8568 *) hostcat='cat /etc/hosts';;
8574 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8577 '') test -f /etc/group && groupcat='cat /etc/group';;
8580 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8583 : now get the host name
8585 echo "Figuring out host name..." >&4
8586 case "$myhostname" in
8588 echo 'Maybe "hostname" will work...'
8589 if tans=`sh -c hostname 2>&1` ; then
8597 if $test "$cont"; then
8599 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8600 if tans=`cat /etc/systemid 2>&1` ; then
8602 phostname='cat /etc/systemid'
8603 echo "Whadyaknow. Xenix always was a bit strange..."
8606 elif $test -r /etc/systemid; then
8607 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8610 if $test "$cont"; then
8611 echo 'No, maybe "uuname -l" will work...'
8612 if tans=`sh -c 'uuname -l' 2>&1` ; then
8614 phostname='uuname -l'
8616 echo 'Strange. Maybe "uname -n" will work...'
8617 if tans=`sh -c 'uname -n' 2>&1` ; then
8619 phostname='uname -n'
8621 echo 'Oh well, maybe I can mine it out of whoami.h...'
8622 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8623 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8624 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8626 case "$myhostname" in
8627 '') echo "Does this machine have an identity crisis or something?"
8630 echo "Well, you said $myhostname before..."
8631 phostname='echo $myhostname';;
8637 case "$myhostname" in
8638 '') myhostname=noname ;;
8640 : you do not want to know about this
8645 if $test "$myhostname" ; then
8647 rp='Your host name appears to be "'$myhostname'".'" Right?"
8655 : bad guess or no guess
8656 while $test "X$myhostname" = X ; do
8658 rp="Please type the (one word) name of your host:"
8663 : translate upper to lower if necessary
8664 case "$myhostname" in
8666 echo "(Normalizing case in your host name)"
8667 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8671 case "$myhostname" in
8673 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8674 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8675 echo "(Trimming domain name from host name--host name is now $myhostname)"
8677 *) case "$mydomain" in
8680 test "X$hostcat" = "Xypcat hosts" &&
8681 ypmatch "$myhostname" hosts 2>/dev/null |\
8682 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8685 test "X$hostcat" != "X" &&
8686 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8687 /[ ]$myhostname[ . ]/p" > hosts
8690 if $test -f hosts; then
8691 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8692 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8693 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8694 hosts | $sort | $uniq | \
8695 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8696 case `$echo X$dflt` in
8697 X*\ *) echo "(Several hosts in the database matched hostname)"
8700 X.) echo "(You do not have fully-qualified names in the hosts database)"
8704 echo "(I cannot locate a hosts database anywhere)"
8709 tans=`./loc resolv.conf X /etc /usr/etc`
8710 if $test -f "$tans"; then
8711 echo "(Attempting domain name extraction from $tans)"
8712 dflt=.`$sed -n -e 's/ / /g' \
8713 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8716 .) dflt=.`$sed -n -e 's/ / /g' \
8717 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8725 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8726 dflt=.`sh -c domainname 2>/dev/null`
8729 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8733 case "$dflt$osname" in
8734 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8735 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8739 .) echo "(Lost all hope -- silly guess then)"
8745 *) dflt="$mydomain";;
8749 rp="What is your domain name?"
8759 : translate upper to lower if necessary
8762 echo "(Normalizing case in your domain name)"
8763 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8767 : a little sanity check here
8768 case "$phostname" in
8771 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8772 $myhostname$mydomain|$myhostname) ;;
8774 case "$phostname" in
8776 echo "(That doesn't agree with your whoami.h file, by the way.)"
8779 echo "(That doesn't agree with your $phostname command, by the way.)"
8787 : determine the e-mail address of the user who is running us
8790 I need to get your e-mail address in Internet format if possible, i.e.
8791 something like user@host.domain. Please answer accurately since I have
8792 no easy means to double check it. The default value provided below
8793 is most probably close to reality but may not be valid from outside
8794 your organization...
8798 while test "$cont"; do
8800 '') dflt="$cf_by@$myhostname$mydomain";;
8801 *) dflt="$cf_email";;
8803 rp='What is your e-mail address?'
8809 rp='Address does not look like an Internet one. Use it anyway?'
8823 : Ask e-mail of administrator
8826 If you or somebody else will be maintaining perl at your site, please
8827 fill in the correct e-mail address here so that they may be contacted
8828 if necessary. Currently, the "perlbug" program included with perl
8829 will send mail to this address in addition to perlbug@perl.org. You may
8830 enter "none" for no administrator.
8833 case "$perladmin" in
8834 '') dflt="$cf_email";;
8835 *) dflt="$perladmin";;
8837 rp='Perl administrator e-mail address'
8841 : determine whether to only install version-specific parts.
8844 Do you want to install only the version-specific parts of the perl
8845 distribution? Usually you do *not* want to do this.
8847 case "$versiononly" in
8848 "$define"|[Yy]*|true) dflt='y' ;;
8851 rp="Do you want to install only the version-specific parts of perl?"
8854 [yY]*) val="$define";;
8860 case "$versiononly" in
8861 "$define") inc_version_list=''
8862 inc_version_list_init=0
8866 : figure out how to guarantee perl startup
8867 : XXX Note that this currently takes advantage of the bug that binexp ignores
8868 : the Configure -Dinstallprefix setting, which in turn means that under
8869 : relocatable @INC, initialinstalllocation is what binexp started as.
8870 case "$startperl" in
8872 case "$sharpbang" in
8876 I can use the #! construct to start perl on your system. This will
8877 make startup of perl scripts faster, but may cause problems if you
8878 want to share those scripts and perl is not in a standard place
8879 ($initialinstalllocation/perl) on all your platforms. The alternative
8880 is to force a shell by starting the script with a single ':' character.
8883 case "$versiononly" in
8884 "$define") dflt="$initialinstalllocation/perl$version";;
8885 *) dflt="$initialinstalllocation/perl";;
8887 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8890 none) startperl=": # use perl";;
8891 *) startperl="#!$ans"
8892 if $test 30 -lt `echo "$ans" | wc -c`; then
8895 WARNING: Some systems limit the #! command to 32 characters.
8896 If you experience difficulty running Perl scripts with #!, try
8897 installing Perl in a directory with a shorter pathname.
8903 *) startperl=": # use perl"
8908 echo "I'll use $startperl to start perl scripts."
8910 : figure best path for perl in scripts
8913 case "$versiononly" in
8914 "$define") perlpath="$initialinstalllocation/perl$version";;
8915 *) perlpath="$initialinstalllocation/perl";;
8917 case "$startperl" in
8922 I will use the "eval 'exec'" idiom to start Perl on your system.
8923 I can use the full path of your Perl binary for this purpose, but
8924 doing so may cause problems if you want to share those scripts and
8925 Perl is not always in a standard place ($initialinstalllocation/perl).
8928 dflt="$initialinstalllocation/perl"
8929 rp="What path shall I use in \"eval 'exec'\"?"
8936 case "$startperl" in
8938 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8941 : determine where public executable scripts go
8942 set scriptdir scriptdir
8944 case "$scriptdir" in
8947 : guess some guesses
8948 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8949 $test -d /usr/share/bin && dflt=/usr/share/bin
8950 $test -d /usr/local/script && dflt=/usr/local/script
8951 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8952 $test -d $prefixexp/script && dflt=$prefixexp/script
8956 *) dflt="$scriptdir"
8961 Some installations have a separate directory just for executable scripts so
8962 that they can mount it across multiple architectures but keep the scripts in
8963 one spot. You might, for example, have a subdirectory of /usr/share for this.
8964 Or you might just lump your scripts in with all your other executables.
8968 rp='Where do you keep publicly executable scripts?'
8970 if $test "X$ansexp" != "X$scriptdirexp"; then
8976 : A little fix up for an irregularly named variable.
8977 installscript="$installscriptdir"
8979 : determine where add-on public executables go
8981 '') dflt=$siteprefix/bin ;;
8985 rp='Pathname where the add-on public executables should be installed?'
8990 : determine where add-on html pages go
8991 : There is no standard location, so try to copy the previously-selected
8992 : directory structure for the core html pages.
8993 case "$sitehtml1dir" in
8994 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8995 *) dflt=$sitehtml1dir ;;
8998 ''|' ') dflt=none ;;
9001 rp='Pathname where the site-specific html pages should be installed?'
9003 prefixvar=sitehtml1dir
9006 : determine where add-on library html pages go
9007 : There is no standard location, so try to copy the previously-selected
9008 : directory structure for the core html pages.
9009 case "$sitehtml3dir" in
9010 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9011 *) dflt=$sitehtml3dir ;;
9014 ''|' ') dflt=none ;;
9017 rp='Pathname where the site-specific library html pages should be installed?'
9019 prefixvar=sitehtml3dir
9022 : determine where add-on manual pages go
9023 case "$siteman1dir" in
9024 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9025 *) dflt=$siteman1dir ;;
9028 ''|' ') dflt=none ;;
9031 rp='Pathname where the site-specific manual pages should be installed?'
9033 prefixvar=siteman1dir
9036 : determine where add-on library man pages go
9037 case "$siteman3dir" in
9038 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9039 *) dflt=$siteman3dir ;;
9042 ''|' ') dflt=none ;;
9045 rp='Pathname where the site-specific library manual pages should be installed?'
9047 prefixvar=siteman3dir
9050 : determine where add-on public executable scripts go
9051 case "$sitescript" in
9052 '') dflt=$siteprefix/script
9053 $test -d $dflt || dflt=$sitebin ;;
9054 *) dflt="$sitescript" ;;
9057 rp='Pathname where add-on public executable scripts should be installed?'
9059 prefixvar=sitescript
9062 : Check if faststdio is requested and available
9063 case "$usefaststdio" in
9064 $define|true|[yY]*|'')
9065 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9075 Perl can be built to use 'fast stdio', which means using the stdio
9076 library but also directly manipulating the stdio buffers to enable
9077 faster I/O. Using stdio is better for backward compatibility (especially
9078 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9079 interface has been preferred instead of stdio.
9081 If this doesn't make any sense to you, just accept the default '$dflt'.
9083 rp='Use the "fast stdio" if available?'
9086 y|Y) val="$define" ;;
9093 : define an is-a-typedef? function
9094 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9096 "") inclist="sys/types.h";;
9098 eval "varval=\$$var";
9102 for inc in $inclist; do
9103 echo "#include <$inc>" >>temp.c;
9105 echo "#ifdef $type" >> temp.c;
9106 echo "printf(\"We have $type\");" >> temp.c;
9107 echo "#endif" >> temp.c;
9108 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9109 if $contains $type temp.E >/dev/null 2>&1; then
9115 *) eval "$var=\$varval";;
9118 : define an is-a-typedef? function that prompts if the type is not available.
9119 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9121 "") inclist="sys/types.h";;
9123 eval "varval=\$$var";
9127 for inc in $inclist; do
9128 echo "#include <$inc>" >>temp.c;
9130 echo "#ifdef $type" >> temp.c;
9131 echo "printf(\"We have $type\");" >> temp.c;
9132 echo "#endif" >> temp.c;
9133 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9135 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9136 if $contains $type temp.E >/dev/null 2>&1; then
9137 echo "$type found." >&4;
9140 echo "$type NOT found." >&4;
9146 *) eval "$var=\$varval";;
9149 : see what type lseek is declared as in the kernel
9150 rp="What is the type used for lseek's offset on this system?"
9151 set off_t lseektype long stdio.h sys/types.h
9155 echo "Checking to see how big your file offsets are..." >&4
9157 #include <sys/types.h>
9161 printf("%d\n", (int)sizeof($lseektype));
9166 if eval $compile_ok; then
9167 lseeksize=`$run ./try`
9168 echo "Your file offsets are $lseeksize bytes long."
9172 echo "(I can't seem to compile the test program. Guessing...)"
9173 rp="What is the size of your file offsets (in bytes)?"
9179 : see what type file positions are declared as in the library
9180 rp="What is the type for file position used by fsetpos()?"
9181 set fpos_t fpostype long stdio.h sys/types.h
9184 : Check size for Fpos_t
9187 *_t) zzz="$fpostype" ;;
9190 echo "Checking the size of $zzz..." >&4
9192 #include <sys/types.h>
9199 printf("%d\n", (int)sizeof($fpostype));
9204 if eval $compile_ok; then
9208 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9211 echo "Your $zzz is $fpossize bytes long."
9217 echo "(I can't compile the test program. Guessing...)" >&4
9218 rp="What is the size of your file positions (in bytes)?"
9223 : Check for large file support
9224 # Backward compatibility (uselfs is deprecated).
9226 "$define"|true|[yY]*)
9229 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9231 uselargefiles="$define"
9235 case "$lseeksize:$fpossize" in
9238 You can have files larger than 2 gigabytes.
9241 *) case "$uselargefiles" in
9242 "$undef"|false|[nN]*) dflt='n' ;;
9247 Perl can be built to understand large files (files larger than 2 gigabytes)
9248 on some systems. To do so, Configure can be run with -Duselargefiles.
9250 If this doesn't make any sense to you, just accept the default '$dflt'.
9252 rp='Try to understand large files, if available?'
9255 y|Y) val="$define" ;;
9262 : Look for a hint-file generated 'call-back-unit'. If the
9263 : user has specified that a large files perl is to be built,
9264 : we may need to set or change some other defaults.
9265 if $test -f uselargefiles.cbu; then
9266 echo "Your platform has some specific hints regarding large file builds, using them..."
9267 . ./uselargefiles.cbu
9269 case "$uselargefiles" in
9271 if $test -f uselargefiles.cbu; then
9273 echo "Rechecking to see how big your file offsets are..." >&4
9275 #include <sys/types.h>
9279 printf("%d\n", (int)sizeof($lseektype));
9284 if eval $compile_ok; then
9285 lseeksize=`$run ./try`
9286 $echo "Your file offsets are now $lseeksize bytes long."
9290 echo "(I can't seem to compile the test program. Guessing...)"
9291 rp="What is the size of your file offsets (in bytes)?"
9296 *_t) zzz="$fpostype" ;;
9299 $echo $n "Rechecking the size of $zzz...$c" >&4
9301 #include <sys/types.h>
9308 printf("%d\n", (int)sizeof($fpostype));
9313 if eval $compile_ok; then
9318 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9321 echo " $fpossize bytes." >&4
9327 echo "(I can't compile the test program. Guessing...)" >&4
9328 rp="What is the size of your file positions (in bytes)?"
9337 : Check if we want perlio
9340 : Set the vendorbin variables
9341 case "$vendorprefix" in
9342 '') d_vendorbin="$undef"
9346 *) d_vendorbin="$define"
9347 : determine where vendor-supplied executables go.
9348 case "$vendorbin" in
9349 '') dflt=$vendorprefix/bin ;;
9350 *) dflt="$vendorbin" ;;
9353 rp='Pathname for the vendor-supplied executables directory?'
9356 vendorbinexp="$ansexp"
9362 : Set the vendorhtml1dir variables
9363 case "$vendorprefix" in
9364 '') vendorhtml1dir=''
9365 vendorhtml1direxp=''
9367 *) : determine where vendor-supplied html pages go.
9368 : There is no standard location, so try to copy the previously-selected
9369 : directory structure for the core html pages.
9370 : XXX Better default suggestions would be welcome.
9371 case "$vendorhtml1dir" in
9372 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9373 *) dflt=$vendorhtml1dir ;;
9376 ''|' ') dflt=none ;;
9379 rp='Pathname for the vendor-supplied html pages?'
9381 vendorhtml1dir="$ans"
9382 vendorhtml1direxp="$ansexp"
9385 : Use ' ' for none so value is preserved next time through Configure
9386 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9387 prefixvar=vendorhtml1dir
9390 : Set the vendorhtml3dir variables
9391 case "$vendorprefix" in
9392 '') vendorhtml3dir=''
9393 vendorhtml3direxp=''
9395 *) : determine where vendor-supplied module html pages go.
9396 : There is no standard location, so try to copy the previously-selected
9397 : directory structure for the core html pages.
9398 : XXX Better default suggestions would be welcome.
9399 case "$vendorhtml3dir" in
9400 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9401 *) dflt=$vendorhtml3dir ;;
9404 ''|' ') dflt=none ;;
9407 rp='Pathname for the vendor-supplied html pages?'
9409 vendorhtml3dir="$ans"
9410 vendorhtml3direxp="$ansexp"
9413 : Use ' ' for none so value is preserved next time through Configure
9414 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9415 prefixvar=vendorhtml3dir
9418 : Set the vendorman1dir variables
9419 case "$vendorprefix" in
9420 '') vendorman1dir=''
9423 *) : determine where vendor-supplied manual pages go.
9424 case "$vendorman1dir" in
9425 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9426 *) dflt=$vendorman1dir ;;
9429 ''|' ') dflt=none ;;
9432 rp='Pathname for the vendor-supplied manual section 1 pages?'
9434 vendorman1dir="$ans"
9435 vendorman1direxp="$ansexp"
9438 : Use ' ' for none so value is preserved next time through Configure
9439 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9440 prefixvar=vendorman1dir
9443 : Set the vendorman3dir variables
9444 case "$vendorprefix" in
9445 '') vendorman3dir=''
9448 *) : determine where vendor-supplied module manual pages go.
9449 case "$vendorman3dir" in
9450 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9451 *) dflt=$vendorman3dir ;;
9454 ''|' ') dflt=none ;;
9457 rp='Pathname for the vendor-supplied manual section 3 pages?'
9459 vendorman3dir="$ans"
9460 vendorman3direxp="$ansexp"
9463 : Use ' ' for none so value is preserved next time through Configure
9464 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9465 prefixvar=vendorman3dir
9468 : Set the vendorscript variables
9469 case "$vendorprefix" in
9470 '') d_vendorscript="$undef"
9474 *) d_vendorscript="$define"
9475 : determine where vendor-supplied scripts go.
9476 case "$vendorscript" in
9477 '') dflt=$vendorprefix/script
9478 $test -d $dflt || dflt=$vendorbin ;;
9479 *) dflt="$vendorscript" ;;
9483 The installation process will create a directory for
9484 vendor-supplied scripts.
9488 rp='Pathname for the vendor-supplied scripts directory?'
9491 vendorscriptexp="$ansexp"
9494 prefixvar=vendorscript
9497 : script used to emit important warnings
9500 if test \$# -gt 0; then
9505 echo "*** WARNING:" >&4
9506 sed -e 's/^/*** /' <msg >&4
9508 cat msg >>config.msg
9509 echo " " >>config.msg
9515 : see which of string.h or strings.h is needed
9517 strings=`./findhdr string.h`
9518 if $test "$strings" && $test -r "$strings"; then
9519 echo "Using <string.h> instead of <strings.h>." >&4
9523 strings=`./findhdr strings.h`
9524 if $test "$strings" && $test -r "$strings"; then
9525 echo "Using <strings.h> instead of <string.h>." >&4
9527 ./warn "No string header found -- You'll surely have problems."
9533 "$undef") strings=`./findhdr strings.h`;;
9534 *) strings=`./findhdr string.h`;;
9537 : see if qgcvt exists
9541 : Check print/scan long double stuff
9544 if $test X"$d_longdbl" = X"$define"; then
9546 echo "Checking how to print long doubles..." >&4
9548 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9549 $cat >try.c <<'EOCP'
9550 #include <sys/types.h>
9554 printf("%.3f\n", d);
9558 if eval $compile; then
9562 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9563 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9564 echo "We will use %f."
9570 if $test X"$sPRIfldbl" = X; then
9571 $cat >try.c <<'EOCP'
9572 #include <sys/types.h>
9575 long double d = 123.456;
9576 printf("%.3Lf\n", d);
9580 if eval $compile; then
9584 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9585 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9586 echo "We will use %Lf."
9592 if $test X"$sPRIfldbl" = X; then
9593 $cat >try.c <<'EOCP'
9594 #include <sys/types.h>
9597 long double d = 123.456;
9598 printf("%.3llf\n", d);
9602 if eval $compile; then
9606 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9607 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9608 echo "We will use %llf."
9614 if $test X"$sPRIfldbl" = X; then
9615 $cat >try.c <<'EOCP'
9616 #include <sys/types.h>
9619 long double d = 123.456;
9620 printf("%.3lf\n", d);
9624 if eval $compile; then
9628 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9629 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9630 echo "We will use %lf."
9636 if $test X"$sPRIfldbl" = X; then
9637 echo "Cannot figure out how to print long doubles." >&4
9639 sSCNfldbl=$sPRIfldbl # expect consistency
9646 case "$sPRIfldbl" in
9647 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9648 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9649 d_SCNfldbl="$undef";
9651 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9652 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9653 d_SCNfldbl="$define";
9657 : Check how to convert floats to strings.
9659 if test "X$d_Gconvert" = X; then
9662 echo "Checking for an efficient way to convert floats to strings."
9664 case "$uselongdouble" in
9665 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9667 case "$d_longdbl" in
9668 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9670 case "$d_PRIgldbl" in
9671 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9675 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9676 char *myname = "gconvert";
9679 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9680 char *myname = "gcvt";
9683 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9684 char *myname = "qgcvt";
9685 #define DOUBLETYPE long double
9688 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9690 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9692 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9695 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9697 char *myname = "sprintf";
9701 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9702 #define DOUBLETYPE long double
9704 #define DOUBLETYPE double
9716 # include <string.h>
9718 # include <strings.h>
9721 int checkit(char *expect, char *got)
9723 if (strcmp(expect, got)) {
9724 printf("%s oddity: Expected %s, got %s\n",
9725 myname, expect, got);
9735 /* This must be 1st test on (which?) platform */
9736 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9737 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9738 checkit("0.1", buf);
9740 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9741 checkit("0.01", buf);
9743 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9744 checkit("0.001", buf);
9746 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9747 checkit("0.0001", buf);
9749 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9750 if (strlen(buf) > 5)
9751 checkit("9e-005", buf); /* for Microsoft ?? */
9753 checkit("9e-05", buf);
9755 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9758 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9759 checkit("1.1", buf);
9761 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9762 checkit("1.01", buf);
9764 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9765 checkit("1.001", buf);
9767 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9768 checkit("1.0001", buf);
9770 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9771 checkit("1.00001", buf);
9773 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9774 checkit("1.000001", buf);
9776 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9779 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9782 /* Some Linux gcvt's give 1.e+5 here. */
9783 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9784 checkit("100000", buf);
9786 /* Some Linux gcvt's give -1.e+5 here. */
9787 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9788 checkit("-100000", buf);
9790 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9791 checkit("123.456", buf);
9793 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9794 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9795 /* 34 should be enough to scare even long double
9796 * places into using the e notation. */
9797 if (strlen(buf) > 5)
9798 checkit("1e+034", buf); /* for Microsoft */
9800 checkit("1e+34", buf);
9802 /* For Perl, if you add additional tests here, also add them to
9803 * t/base/num.t for benefit of platforms not using Configure or
9804 * overriding d_Gconvert */
9809 : first add preferred functions to our list
9811 for xxx_convert in $gconvert_preference; do
9812 case $xxx_convert in
9813 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9814 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9817 : then add any others
9818 for xxx_convert in gconvert gcvt sprintf; do
9821 *) xxx_list="$xxx_list $xxx_convert" ;;
9825 case "$d_longdbl$uselongdouble" in
9827 : again, add preferred functions to our list first
9829 for xxx_convert in $gconvert_ld_preference; do
9830 case $xxx_convert in
9831 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9832 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9835 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9836 for xxx_convert in qgcvt sprintf $xxx_list; do
9837 case "$xxx_ld_list" in
9838 $xxx_convert*|*" $xxx_convert"*) ;;
9839 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9842 : if sprintf cannot do long doubles, move it to the end
9843 if test "$d_PRIgldbl" != "$define"; then
9844 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9846 : if no qgcvt, remove it
9847 if test "$d_qgcvt" != "$define"; then
9848 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9851 xxx_list="$xxx_ld_list"
9855 for xxx_convert in $xxx_list; do
9856 echo "Trying $xxx_convert..."
9857 $rm -f try try$_o core
9858 set try -DTRY_$xxx_convert
9859 if eval $compile; then
9860 echo "$xxx_convert() found." >&4
9862 echo "I'll use $xxx_convert to convert floats into a string." >&4
9865 echo "...But $xxx_convert didn't work as I expected."
9869 echo "$xxx_convert NOT found." >&4
9873 if test X$xxx_convert = X; then
9874 echo "*** WHOA THERE!!! ***" >&4
9875 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9879 case "$xxx_convert" in
9880 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9881 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9882 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9883 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9884 "$define$define$define")
9885 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9886 "$define$define$undef")
9887 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9888 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9896 : see if _fwalk exists
9900 : Initialize h_fcntl
9903 : Initialize h_sysfile
9906 : access call always available on UNIX
9910 : locate the flags for 'access()'
9914 $cat >access.c <<EOCP
9915 #include <sys/types.h>
9920 #include <sys/file.h>
9933 : check sys/file.h first, no particular reason here
9934 if $test `./findhdr sys/file.h` && \
9935 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9937 echo "<sys/file.h> defines the *_OK access constants." >&4
9938 elif $test `./findhdr fcntl.h` && \
9939 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9941 echo "<fcntl.h> defines the *_OK access constants." >&4
9942 elif $test `./findhdr unistd.h` && \
9943 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9944 echo "<unistd.h> defines the *_OK access constants." >&4
9946 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9952 : see if accessx exists
9953 set accessx d_accessx
9956 : see if aintl exists
9960 : see if alarm exists
9964 : see if 64bit time functions exists
9966 set ctime64 d_ctime64
9969 set localtime64 d_localtime64
9972 set gmtime64 d_gmtime64
9975 set mktime64 d_mktime64
9978 set difftime64 d_difftime64
9981 set asctime64 d_asctime64
9984 : see if POSIX threads are available
9985 set pthread.h i_pthread
9988 : define a function to check prototypes
9989 $cat > protochk <<EOSH
9992 optimize="$optimize"
9994 prototype="$prototype"
9997 usethreads=$usethreads
9998 i_pthread=$i_pthread
9999 pthread_h_first=$pthread_h_first
10002 $cat >> protochk <<'EOSH'
10007 while test $# -ge 2; do
10009 $define) echo "#include <$2>" >> try.c ;;
10010 literal) echo "$2" >> try.c ;;
10012 # Extra magic for the benefit of systems that need pthread.h
10013 # to be included early to correctly detect threadsafe functions.
10014 # Such functions must guarantee themselves, though, that the usethreads
10015 # and i_pthread have been defined, before calling protochk.
10016 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10017 echo "#include <pthread.h>" >> try.c
10022 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10023 cat >> try.c <<'EOCP'
10024 #ifdef CAN_PROTOTYPE
10025 #define _(args) args
10030 echo "$foo" >> try.c
10031 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10032 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10038 $eunicefix protochk
10040 : Define hasproto macro for Configure internal use
10041 hasproto='varname=$1; func=$2; shift; shift;
10042 while $test $# -ge 2; do
10044 $define) echo "#include <$2>";;
10048 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10049 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10050 echo "$func() prototype found.";
10053 echo "$func() prototype NOT found.";
10060 : see if sys/types.h has to be included
10061 set sys/types.h i_systypes
10064 : see if sys/select.h has to be included
10065 set sys/select.h i_sysselct
10068 : Define hasfield macro for Configure internal use
10069 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10070 while $test $# -ge 2; do
10072 $define) echo "#include <$2>";;
10076 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10078 if eval $compile; then
10087 : see if we should include time.h, sys/time.h, or both
10089 if test "X$timeincl" = X; then
10090 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10091 $echo $n "I'm now running the test program...$c"
10093 #include <sys/types.h>
10098 #ifdef SYSTIMEKERNEL
10101 #include <sys/time.h>
10104 #include <sys/select.h>
10106 #$i_stdlib I_STDLIB
10108 #include <stdlib.h>
10114 struct timeval bar;
10117 struct timezone tzp;
10119 if (foo.tm_sec == foo.tm_sec)
10122 if (bar.tv_sec == bar.tv_sec)
10129 for s_timezone in '-DS_TIMEZONE' ''; do
10131 for s_timeval in '-DS_TIMEVAL' ''; do
10132 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10133 for i_time in '' '-DI_TIME'; do
10134 for i_systime in '-DI_SYSTIME' ''; do
10137 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10138 if eval $compile; then
10139 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10143 $echo $n "Succeeded with $flags$c"
10155 *SYSTIMEKERNEL*) i_systimek="$define"
10156 timeincl=`./findhdr sys/time.h`
10157 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10158 *) i_systimek="$undef";;
10161 *I_TIME*) i_time="$define"
10162 timeincl=`./findhdr time.h`" $timeincl"
10163 echo "We'll include <time.h>." >&4;;
10164 *) i_time="$undef";;
10167 *I_SYSTIME*) i_systime="$define"
10168 timeincl=`./findhdr sys/time.h`" $timeincl"
10169 echo "We'll include <sys/time.h>." >&4;;
10170 *) i_systime="$undef";;
10174 : see if struct tm knows about tm_zone
10175 case "$i_systime$i_time" in
10178 echo "Checking to see if your struct tm has tm_zone field..." >&4
10179 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10187 case "$d_tm_tm_zone" in
10188 "$define") echo "Yes, it does." ;;
10189 *) echo "No, it doesn't." ;;
10191 : see if struct tm knows about tm_gmtoff
10192 case "$i_systime$i_time" in
10195 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10196 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10204 case "$d_tm_tm_gmtoff" in
10205 "$define") echo "Yes, it does." ;;
10206 *) echo "No, it doesn't." ;;
10209 : see if asctime_r exists
10210 set asctime_r d_asctime_r
10212 case "$d_asctime_r" in
10214 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10215 case "$d_asctime_r_proto:$usethreads" in
10216 ":define") d_asctime_r_proto=define
10217 set d_asctime_r_proto asctime_r $hdrs
10221 case "$d_asctime_r_proto" in
10223 case "$asctime_r_proto" in
10224 ''|0) try='char* asctime_r(const struct tm*, char*);'
10225 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10227 case "$asctime_r_proto" in
10228 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10229 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10231 case "$asctime_r_proto" in
10232 ''|0) try='int asctime_r(const struct tm*, char*);'
10233 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10235 case "$asctime_r_proto" in
10236 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10237 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10239 case "$asctime_r_proto" in
10240 ''|0) d_asctime_r=undef
10242 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10243 * ) case "$asctime_r_proto" in
10244 REENTRANT_PROTO*) ;;
10245 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10247 echo "Prototype: $try" ;;
10250 *) case "$usethreads" in
10251 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10258 *) asctime_r_proto=0
10262 : see if atolf exists
10266 : see if atoll exists
10270 : Look for GCC-style attribute format
10271 case "$d_attribute_format" in
10274 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10275 $cat >attrib.c <<'EOCP'
10277 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10279 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10280 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10281 echo "Your C compiler doesn't support __attribute__((format))."
10284 echo "Your C compiler supports __attribute__((format))."
10288 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10292 *) val="$d_attribute_format" ;;
10294 set d_attribute_format
10298 : Look for GCC-style attribute format with null format allowed
10299 case "$d_printf_format_null" in
10300 '') case "$d_attribute_format" in
10303 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10304 $cat >attrib.c <<EOCP
10306 #$i_stdlib I_STDLIB
10308 #include <stdlib.h>
10310 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10311 int null_printf (char* pat,...) { return (int)pat; }
10312 int main () { exit(null_printf(NULL)); }
10314 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10315 : run the executable in case it produces a run-time warning
10316 if $run ./attrib >>attrib.out 2>&1; then
10317 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10318 echo "Your C compiler doesn't allow __printf__ format to be null."
10321 echo "Your C compiler allows __printf__ format to be null."
10325 echo "Your C compiler executable failed with __printf__ format null."
10329 echo "Your C compiler fails with __printf__ format null."
10336 *) val="$d_printf_format_null" ;;
10338 set d_printf_format_null
10342 : Look for GCC-style attribute malloc
10343 case "$d_attribute_malloc" in
10346 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10347 $cat >attrib.c <<'EOCP'
10349 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10351 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10352 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10353 echo "Your C compiler doesn't support __attribute__((malloc))."
10356 echo "Your C compiler supports __attribute__((malloc))."
10360 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10364 *) val="$d_attribute_malloc" ;;
10366 set d_attribute_malloc
10370 : Look for GCC-style attribute nonnull
10371 case "$d_attribute_nonnull" in
10374 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10375 $cat >attrib.c <<'EOCP'
10377 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10379 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10380 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10381 echo "Your C compiler doesn't support __attribute__((nonnull))."
10384 echo "Your C compiler supports __attribute__((nonnull))."
10388 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10392 *) val="$d_attribute_nonnull" ;;
10394 set d_attribute_nonnull
10398 : Look for GCC-style attribute noreturn
10399 case "$d_attribute_noreturn" in
10402 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10403 $cat >attrib.c <<'EOCP'
10405 void fall_over_dead( void ) __attribute__((noreturn));
10407 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10408 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10409 echo "Your C compiler doesn't support __attribute__((noreturn))."
10412 echo "Your C compiler supports __attribute__((noreturn))."
10416 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10420 *) val="$d_attribute_noreturn" ;;
10422 set d_attribute_noreturn
10426 : Look for GCC-style attribute pure
10427 case "$d_attribute_pure" in
10430 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10431 $cat >attrib.c <<'EOCP'
10433 int square( int n ) __attribute__((pure));
10435 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10436 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10437 echo "Your C compiler doesn't support __attribute__((pure))."
10440 echo "Your C compiler supports __attribute__((pure))."
10444 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10448 *) val="$d_attribute_pure" ;;
10450 set d_attribute_pure
10454 : Look for GCC-style attribute unused
10455 case "$d_attribute_unused" in
10458 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10459 $cat >attrib.c <<'EOCP'
10461 int do_something( int dummy __attribute__((unused)), int n );
10463 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10464 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10465 echo "Your C compiler doesn't support __attribute__((unused))."
10468 echo "Your C compiler supports __attribute__((unused))."
10472 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10476 *) val="$d_attribute_unused" ;;
10478 set d_attribute_unused
10482 : Look for GCC-style attribute deprecated
10483 case "$d_attribute_deprecated" in
10486 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10487 $cat >attrib.c <<'EOCP'
10489 int I_am_deprecated(void) __attribute__((deprecated));
10491 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10492 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10493 echo "Your C compiler doesn't support __attribute__((deprecated))."
10496 echo "Your C compiler supports __attribute__((deprecated))."
10500 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10504 *) val="$d_attribute_deprecated" ;;
10506 set d_attribute_deprecated
10510 : Look for GCC-style attribute warn_unused_result
10511 case "$d_attribute_warn_unused_result" in
10514 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10515 $cat >attrib.c <<'EOCP'
10517 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10519 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10520 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10521 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10524 echo "Your C compiler supports __attribute__((warn_unused_result))."
10528 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10532 *) val="$d_attribute_warn_unused_result" ;;
10534 set d_attribute_warn_unused_result
10538 : see if bcmp exists
10542 : see if bcopy exists
10546 : see if getpgrp exists
10547 set getpgrp d_getpgrp
10550 case "$d_getpgrp" in
10553 echo "Checking to see which flavor of getpgrp is in use..."
10555 #$i_unistd I_UNISTD
10556 #include <sys/types.h>
10558 # include <unistd.h>
10560 #$i_stdlib I_STDLIB
10562 #include <stdlib.h>
10566 if (getuid() == 0) {
10567 printf("(I see you are running Configure as super-user...)\n");
10570 #ifdef TRY_BSD_PGRP
10571 if (getpgrp(1) == 0)
10580 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10581 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10583 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10584 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10587 echo "I can't seem to compile and run the test program."
10589 xxx="a USG one, i.e. you use getpgrp()."
10591 # SVR4 systems can appear rather BSD-ish.
10592 case "$i_unistd" in
10594 xxx="a BSD one, i.e. you use getpgrp(pid)."
10598 xxx="probably a USG one, i.e. you use getpgrp()."
10603 echo "Assuming your getpgrp is $xxx" >&4
10612 : see if setpgrp exists
10613 set setpgrp d_setpgrp
10616 case "$d_setpgrp" in
10619 echo "Checking to see which flavor of setpgrp is in use..."
10621 #$i_unistd I_UNISTD
10622 #include <sys/types.h>
10624 # include <unistd.h>
10626 #$i_stdlib I_STDLIB
10628 #include <stdlib.h>
10632 if (getuid() == 0) {
10633 printf("(I see you are running Configure as super-user...)\n");
10636 #ifdef TRY_BSD_PGRP
10637 if (-1 == setpgrp(1, 1))
10640 if (setpgrp() != -1)
10646 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10647 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10649 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10650 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10653 echo "(I can't seem to compile and run the test program.)"
10655 xxx="a USG one, i.e. you use setpgrp()."
10657 # SVR4 systems can appear rather BSD-ish.
10658 case "$i_unistd" in
10660 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10664 xxx="probably a USG one, i.e. you use setpgrp()."
10669 echo "Assuming your setpgrp is $xxx" >&4
10678 : Look for GCC-style __builtin_choose_expr
10679 case "$d_builtin_choose_expr" in
10682 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10683 $cat >try.c <<'EOCP'
10684 #include <assert.h>
10685 #include <stdlib.h>
10688 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10691 assert( SYRINX(1) == 2112 );
10692 assert( SYRINX(1) != 5150 );
10693 assert( SYRINX(0) == 5150 );
10694 assert( SYRINX(0) != 2112 );
10695 puts( "All good!" );
10701 if eval $compile && $run ./try; then
10702 echo "Your C compiler supports __builtin_choose_expr."
10705 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10709 *) val="$d_builtin_choose_expr" ;;
10712 set d_builtin_choose_expr
10716 : Look for GCC-style __builtin_expect
10717 case "$d_builtin_expect" in
10720 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10721 $cat >try.c <<'EOCP'
10724 if ( __builtin_expect(n, 0) ) n = 1;
10725 /* Remember shell exit code truth is 0, C truth is non-zero */
10730 if eval $compile && $run ./try; then
10731 echo "Your C compiler supports __builtin_expect."
10734 echo "Your C compiler doesn't seem to understand __builtin_expect."
10738 *) val="$d_builtin_expect" ;;
10741 set d_builtin_expect
10745 : see if bzero exists
10749 : see if stdarg is available
10751 if $test `./findhdr stdarg.h`; then
10752 echo "<stdarg.h> found." >&4
10755 echo "<stdarg.h> NOT found." >&4
10759 : see if varags is available
10761 if $test `./findhdr varargs.h`; then
10762 echo "<varargs.h> found." >&4
10764 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10767 : set up the varargs testing programs
10768 $cat > varargs.c <<EOP
10770 #include <stdarg.h>
10773 #include <varargs.h>
10777 int f(char *p, ...)
10791 p = va_arg(ap, char *);
10797 $cat > varargs <<EOP
10799 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10808 : now check which varargs header should be included
10813 if `./varargs I_STDARG`; then
10815 elif `./varargs I_VARARGS`; then
10820 if `./varargs I_VARARGS`; then
10827 echo "I could not find the definition for va_dcl... You have problems..." >&4
10828 val="$undef"; set i_stdarg; eval $setvar
10829 val="$undef"; set i_varargs; eval $setvar
10834 case "$i_varhdr" in
10836 val="$define"; set i_stdarg; eval $setvar
10837 val="$undef"; set i_varargs; eval $setvar
10840 val="$undef"; set i_stdarg; eval $setvar
10841 val="$define"; set i_varargs; eval $setvar
10844 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10848 : see if the Compiler supports C99 variadic macros
10849 case "$i_stdarg$i_stdlib" in
10851 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10854 #include <stdarg.h>
10856 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10860 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10866 if eval $compile && $run ./try 2>&1 >/dev/null; then
10867 case "`$run ./try`" in
10869 echo "You have C99 variadic macros." >&4
10870 d_c99_variadic_macros="$define"
10873 echo "You don't have functional C99 variadic macros." >&4
10874 d_c99_variadic_macros="$undef"
10878 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10879 d_c99_variadic_macros="$undef"
10884 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10885 d_c99_variadic_macros="$undef"
10889 : see if signal is declared as pointer to function returning int or void
10891 xxx=`./findhdr signal.h`
10892 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10893 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10894 echo "You have int (*signal())() instead of void." >&4
10896 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10897 echo "You have void (*signal())()." >&4
10899 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10900 echo "You have int (*signal())() instead of void." >&4
10902 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10903 echo "You have void (*signal())()." >&4
10906 case "$d_voidsig" in
10908 echo "I can't determine whether signal handler returns void or int..." >&4
10910 rp="What type does your signal handler return?"
10913 v*) val="$define";;
10917 echo "As you already told me, signal handler returns void." >&4
10920 *) echo "As you already told me, signal handler returns int." >&4
10927 case "$d_voidsig" in
10928 "$define") signal_t="void";;
10929 *) signal_t="int";;
10933 : check for ability to cast large floats to 32-bit ints.
10935 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10936 if $test "$intsize" -ge 4; then
10943 #$i_stdlib I_STDLIB
10945 #include <stdlib.h>
10947 #include <sys/types.h>
10948 #include <signal.h>
10949 $signal_t blech(int s) { exit(3); }
10956 signal(SIGFPE, blech);
10958 /* Don't let compiler optimize the test away. Store the number
10959 in a writable string for gcc to pass to sscanf under HP-UX.
10961 sprintf(str, "2147483647");
10962 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10966 /* x86 processors will probably give 0x8000 0000, which is a
10967 sign change. We don't want that. We want to mimic SPARC
10968 behavior here, which is to preserve the sign and give
10971 if (i32 != ($xxx) f)
10977 if eval $compile_ok; then
10981 echo "(I can't seem to compile the test program--assuming it can't)"
10986 echo "Yup, it can."
10989 echo "Nope, it can't."
10996 : check for ability to cast negative floats to unsigned
10998 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11001 #$i_stdlib I_STDLIB
11003 #include <stdlib.h>
11005 #include <sys/types.h>
11006 #include <signal.h>
11007 $signal_t blech(int s) { exit(7); }
11008 $signal_t blech_in_list(int s) { exit(4); }
11009 unsigned long dummy_long(unsigned long p) { return p; }
11010 unsigned int dummy_int(unsigned int p) { return p; }
11011 unsigned short dummy_short(unsigned short p) { return p; }
11015 unsigned long along;
11017 unsigned short ashort;
11021 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11022 a direct f = -123. assignment. gcc-2.8.0 reportedly
11023 optimized the whole file away
11025 /* Store the number in a writable string for gcc to pass to
11026 sscanf under HP-UX.
11028 sprintf(str, "-123");
11029 sscanf(str, "%lf", &f); /* f = -123.; */
11031 signal(SIGFPE, blech);
11032 along = (unsigned long)f;
11033 aint = (unsigned int)f;
11034 ashort = (unsigned short)f;
11035 if (along != (unsigned long)-123)
11037 if (aint != (unsigned int)-123)
11039 if (ashort != (unsigned short)-123)
11041 sprintf(str, "1073741824.");
11042 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11045 along = (unsigned long)f;
11046 if (along != 0x80000000)
11050 along = (unsigned long)f;
11051 if (along != 0x7fffffff)
11055 along = (unsigned long)f;
11056 if (along != 0x80000001)
11060 signal(SIGFPE, blech_in_list);
11061 sprintf(str, "123.");
11062 sscanf(str, "%lf", &f); /* f = 123.; */
11063 along = dummy_long((unsigned long)f);
11064 aint = dummy_int((unsigned int)f);
11065 ashort = dummy_short((unsigned short)f);
11066 if (along != (unsigned long)123)
11068 if (aint != (unsigned int)123)
11070 if (ashort != (unsigned short)123)
11077 if eval $compile_ok; then
11081 echo "(I can't seem to compile the test program--assuming it can't)"
11084 case "$castflags" in
11086 echo "Yup, it can."
11089 echo "Nope, it can't."
11096 : see if vprintf exists
11098 if set vprintf val -f d_vprintf; eval $csym; $val; then
11099 echo 'vprintf() found.' >&4
11102 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11103 #$i_varargs I_VARARGS
11105 #$i_stdlib I_STDLIB
11106 #$i_unistd I_UNISTD
11109 # include <stdarg.h>
11110 #else /* I_VARARGS */
11111 # include <varargs.h>
11115 # include <unistd.h>
11119 # include <stdlib.h>
11122 #include <stdio.h> /* vsprintf prototype */
11125 void xxx(int n, ...)
11130 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11132 int main() { xxx(1, "foo"); }
11134 #else /* I_VARARGS */
11142 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11144 int main() { xxx("foo"); }
11150 if eval $compile_ok; then
11151 if $run ./try; then
11152 echo "Your vsprintf() returns (int)." >&4
11155 echo "Your vsprintf() returns (char*)." >&4
11159 echo 'I am unable to compile the vsprintf() test program.' >&4
11160 # We shouldn't get here. If we do, assume the standard signature,
11161 # not the old BSD one.
11162 echo 'Guessing that vsprintf() returns (int).' >&4
11166 echo 'vprintf() NOT found.' >&4
11177 : see if chown exists
11181 : see if chroot exists
11182 set chroot d_chroot
11185 : see if chsize exists
11186 set chsize d_chsize
11189 : see if class exists
11193 : see if clearenv exists
11194 set clearenv d_clearenv
11197 : Define hasstruct macro for Configure internal use
11198 hasstruct='varname=$1; struct=$2; shift; shift;
11199 while $test $# -ge 2; do
11201 $define) echo "#include <$2>";;
11205 echo "int main () { struct $struct foo; }" >> try.c;
11207 if eval $compile; then
11216 : see whether socket exists
11220 $echo $n "Hmm... $c" >&4
11221 if set socket val -f d_socket; eval $csym; $val; then
11222 echo "Looks like you have Berkeley networking support." >&4
11224 if set setsockopt val -f; eval $csym; $val; then
11227 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11228 d_oldsock="$define"
11231 if $contains socklib libc.list >/dev/null 2>&1; then
11232 echo "Looks like you have Berkeley networking support." >&4
11234 : we will have to assume that it supports the 4.2 BSD interface
11237 echo "You don't have Berkeley networking in libc$_a..." >&4
11238 if test "X$d_socket" = "X$define"; then
11239 echo "...but you seem to believe that you have sockets." >&4
11241 for net in net socket
11243 if test -f /usr/lib/lib$net$_a; then
11244 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11245 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11246 if $contains socket libc.list >/dev/null 2>&1; then
11251 echo "...but the Wollongong group seems to have hacked it in." >&4
11252 sockethdr="-I/usr/netinclude"
11255 echo "Found Berkeley sockets interface in lib$net." >&4
11256 if $contains setsockopt libc.list >/dev/null 2>&1; then
11259 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11260 d_oldsock="$define"
11266 if test "X$d_socket" != "X$define"; then
11267 echo "or anywhere else I see." >&4
11275 : see if socketpair exists
11276 set socketpair d_sockpair
11281 echo "Checking the availability sa_len in the sock struct ..." >&4
11283 #include <sys/types.h>
11284 #include <sys/socket.h>
11286 struct sockaddr sa;
11287 return (sa.sa_len);
11291 set try; if eval $compile; then
11294 set d_sockaddr_sa_len; eval $setvar
11298 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11300 #include <sys/types.h>
11301 #include <sys/socket.h>
11302 #include <netinet/in.h>
11304 struct sockaddr_in6 sin6;
11305 return (sin6.sin6_scope_id);
11309 set try; if eval $compile; then
11312 set d_sin6_scope_id; eval $setvar
11316 echo "Checking the availability of certain socket constants..." >&4
11317 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11318 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11320 #include <sys/types.h>
11321 #include <sys/socket.h>
11327 set try; if eval $compile; then
11330 set d_${enum}; eval $setvar
11334 : see if this is a sys/uio.h system
11335 set sys/uio.h i_sysuio
11338 : Check for cmsghdr support
11340 echo "Checking to see if your system supports struct cmsghdr..." >&4
11341 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11343 case "$d_cmsghdr_s" in
11344 "$define") echo "Yes, it does." ;;
11345 *) echo "No, it doesn't." ;;
11349 : check for const keyword
11351 echo 'Checking to see if your C compiler knows about "const"...' >&4
11352 $cat >const.c <<'EOCP'
11353 typedef struct spug { int drokk; } spug;
11357 const spug y = { 0 };
11360 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11362 echo "Yup, it does."
11365 echo "Nope, it doesn't."
11370 : see if copysignl exists
11371 set copysignl d_copysignl
11374 : see if crypt exists
11379 $define) cryptlib='' ;;
11380 *) if set crypt val -f d_crypt; eval $csym; $val; then
11381 echo 'crypt() found.' >&4
11385 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11386 if $test -z "$cryptlib"; then
11387 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11391 if $test -z "$cryptlib"; then
11392 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11396 if $test -z "$cryptlib"; then
11397 cryptlib=`./loc libcrypt$_a "" $libpth`
11401 if $test -z "$cryptlib"; then
11402 echo 'crypt() NOT found.' >&4
11413 : see if this is a crypt.h system
11414 set crypt.h i_crypt
11417 : see if crypt_r exists
11418 set crypt_r d_crypt_r
11420 case "$d_crypt_r" in
11422 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11423 case "$d_crypt_r_proto:$usethreads" in
11424 ":define") d_crypt_r_proto=define
11425 set d_crypt_r_proto crypt_r $hdrs
11429 case "$d_crypt_r_proto" in
11431 case "$crypt_r_proto" in
11432 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11433 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11435 case "$crypt_r_proto" in
11436 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11437 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11439 case "$crypt_r_proto" in
11440 ''|0) d_crypt_r=undef
11442 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11443 * ) case "$crypt_r_proto" in
11444 REENTRANT_PROTO*) ;;
11445 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11447 echo "Prototype: $try" ;;
11450 *) case "$usethreads" in
11451 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11462 : get csh whereabouts
11464 'csh') val="$undef" ;;
11465 *) val="$define" ;;
11469 : Respect a hint or command line value for full_csh.
11470 case "$full_csh" in
11471 '') full_csh=$csh ;;
11474 : see if ctermid exists
11475 set ctermid d_ctermid
11478 : see if ctermid_r exists
11479 set ctermid_r d_ctermid_r
11481 case "$d_ctermid_r" in
11483 hdrs="$i_systypes sys/types.h define stdio.h "
11484 case "$d_ctermid_r_proto:$usethreads" in
11485 ":define") d_ctermid_r_proto=define
11486 set d_ctermid_r_proto ctermid_r $hdrs
11490 case "$d_ctermid_r_proto" in
11492 case "$ctermid_r_proto" in
11493 ''|0) try='char* ctermid_r(char*);'
11494 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11496 case "$ctermid_r_proto" in
11497 ''|0) d_ctermid_r=undef
11499 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11500 * ) case "$ctermid_r_proto" in
11501 REENTRANT_PROTO*) ;;
11502 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11504 echo "Prototype: $try" ;;
11507 *) case "$usethreads" in
11508 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11515 *) ctermid_r_proto=0
11519 : see if ctime_r exists
11520 set ctime_r d_ctime_r
11522 case "$d_ctime_r" in
11524 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11525 case "$d_ctime_r_proto:$usethreads" in
11526 ":define") d_ctime_r_proto=define
11527 set d_ctime_r_proto ctime_r $hdrs
11531 case "$d_ctime_r_proto" in
11533 case "$ctime_r_proto" in
11534 ''|0) try='char* ctime_r(const time_t*, char*);'
11535 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11537 case "$ctime_r_proto" in
11538 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11539 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11541 case "$ctime_r_proto" in
11542 ''|0) try='int ctime_r(const time_t*, char*);'
11543 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11545 case "$ctime_r_proto" in
11546 ''|0) try='int ctime_r(const time_t*, char*, int);'
11547 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11549 case "$ctime_r_proto" in
11550 ''|0) d_ctime_r=undef
11552 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11553 * ) case "$ctime_r_proto" in
11554 REENTRANT_PROTO*) ;;
11555 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11557 echo "Prototype: $try" ;;
11560 *) case "$usethreads" in
11561 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11572 : see if cuserid exists
11573 set cuserid d_cuserid
11576 : see if this is a limits.h system
11577 set limits.h i_limits
11580 : see if this is a float.h system
11581 set float.h i_float
11584 : See if number of significant digits in a double precision number is known
11586 $cat >dbl_dig.c <<EOM
11587 #$i_limits I_LIMITS
11590 #include <limits.h>
11596 printf("Contains DBL_DIG");
11599 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11600 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11601 echo "DBL_DIG found." >&4
11604 echo "DBL_DIG NOT found." >&4
11611 : see if dbm.h is available
11612 : see if dbmclose exists
11613 set dbmclose d_dbmclose
11616 case "$d_dbmclose" in
11626 *) set rpcsvc/dbm.h i_rpcsvcdbm
11631 *) echo "We won't be including <dbm.h>"
11641 : see if prototype for dbminit is available
11643 set d_dbminitproto dbminit $i_dbm dbm.h
11646 : see if difftime exists
11647 set difftime d_difftime
11650 : see if this is a dirent system
11652 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11654 echo "<dirent.h> found." >&4
11657 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11658 echo "<sys/dir.h> found." >&4
11661 xinc=`./findhdr sys/ndir.h`
11663 echo "<dirent.h> NOT found." >&4
11668 : Look for type of directory structure.
11670 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11672 case "$direntrytype" in
11674 case "$i_dirent" in
11675 $define) guess1='struct dirent' ;;
11676 *) guess1='struct direct' ;;
11679 *) guess1="$direntrytype"
11684 'struct dirent') guess2='struct direct' ;;
11685 *) guess2='struct dirent' ;;
11688 if $contains "$guess1" try.c >/dev/null 2>&1; then
11689 direntrytype="$guess1"
11690 echo "Your directory entries are $direntrytype." >&4
11691 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11692 direntrytype="$guess2"
11693 echo "Your directory entries seem to be $direntrytype." >&4
11695 echo "I don't recognize your system's directory entries." >&4
11696 rp="What type is used for directory entries on this system?"
11699 direntrytype="$ans"
11703 : see if the directory entry stores field length
11705 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11706 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11707 echo "Good, your directory entry keeps length information in d_namlen." >&4
11710 echo "Your directory entry does not know about the d_namlen field." >&4
11717 : Look for DIR.dd_fd
11718 case "$i_dirent" in
11720 echo "Checking to see if DIR has a dd_fd member variable" >&4
11722 #$i_stdlib I_STDLIB
11724 #include <stdlib.h>
11726 #include <dirent.h>
11736 if eval $compile; then
11737 echo "Yes, it does."
11740 echo "No, it does not."
11745 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11753 : see if this is an sysdir system
11754 set sys/dir.h i_sysdir
11757 : see if this is an sysndir system
11758 set sys/ndir.h i_sysndir
11763 $cat >dirfd.c <<EOM
11765 #$i_stdlib I_STDLIB
11767 #include <stdlib.h>
11769 #$i_dirent I_DIRENT /**/
11770 #$i_sysdir I_SYS_DIR /**/
11771 #$i_sysndir I_SYS_NDIR /**/
11772 #$i_systypes I_SYS_TYPES /**/
11773 #if defined(I_SYS_TYPES)
11774 #include <sys/types.h>
11776 #if defined(I_DIRENT)
11777 #include <dirent.h>
11778 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11779 #include <sys/dir.h>
11783 #include <sys/ndir.h>
11787 #include <ndir.h> /* may be wrong in the future */
11789 #include <sys/dir.h>
11795 DIR *dirp = opendir(".");
11796 if (dirfd(dirp) >= 0)
11804 if eval $compile; then
11808 $define) echo "dirfd() found." >&4 ;;
11809 *) echo "dirfd() NOT found." >&4 ;;
11815 : see if dlerror exists
11818 set dlerror d_dlerror
11822 : see if dlfcn is available
11823 set dlfcn.h i_dlfcn
11826 : Check what extension to use for shared libs
11831 On a few systems, the dynamically loaded modules that perl generates and uses
11832 will need a different extension than shared libs. The default will probably
11838 *) dflt="$dlext" ;;
11840 rp='What is the extension of dynamically loaded modules'
11849 : Check if dlsym need a leading underscore
11855 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11856 $cat >dyna.c <<'EOM'
11863 #$i_stdlib I_STDLIB
11865 #include <stdlib.h>
11869 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11871 #include <sys/types.h>
11876 extern int fred() ;
11885 int mode = RTLD_LAZY ;
11887 handle = dlopen("./dyna.$dlext", mode) ;
11888 if (handle == NULL) {
11893 symbol = dlsym(handle, "fred") ;
11894 if (symbol == NULL) {
11895 /* try putting a leading underscore */
11896 symbol = dlsym(handle, "_fred") ;
11897 if (symbol == NULL) {
11910 : Call the object file tmp-dyna.o in case dlext=o.
11911 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11912 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11913 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11914 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11917 1) echo "Test program failed using dlopen." >&4
11918 echo "Perhaps you should not use dynamic loading." >&4;;
11919 2) echo "Test program failed using dlsym." >&4
11920 echo "Perhaps you should not use dynamic loading." >&4;;
11921 3) echo "dlsym needs a leading underscore" >&4
11923 4) echo "dlsym doesn't need a leading underscore." >&4;;
11926 echo "I can't compile and run the test program." >&4
11927 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11932 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11937 : see if drand48_r exists
11938 set drand48_r d_drand48_r
11940 case "$d_drand48_r" in
11942 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11943 case "$d_drand48_r_proto:$usethreads" in
11944 ":define") d_drand48_r_proto=define
11945 set d_drand48_r_proto drand48_r $hdrs
11949 case "$d_drand48_r_proto" in
11951 case "$drand48_r_proto" in
11952 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11953 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11955 case "$drand48_r_proto" in
11956 ''|0) d_drand48_r=undef
11958 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11959 * ) case "$drand48_r_proto" in
11960 REENTRANT_PROTO*) ;;
11961 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11963 echo "Prototype: $try" ;;
11966 *) case "$usethreads" in
11967 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11974 *) drand48_r_proto=0
11978 : see if prototype for drand48 is available
11980 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11983 : see if dup2 exists
11987 : see if eaccess exists
11988 set eaccess d_eaccess
11991 : see if endgrent exists
11992 set endgrent d_endgrent
11995 : see if this is an grp system
12001 xxx=`./findhdr grp.h`
12002 $cppstdin $cppflags $cppminus < $xxx >$$.h
12004 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12016 set d_grpasswd; eval $setvar
12020 : see if endgrent_r exists
12021 set endgrent_r d_endgrent_r
12023 case "$d_endgrent_r" in
12025 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12026 case "$d_endgrent_r_proto:$usethreads" in
12027 ":define") d_endgrent_r_proto=define
12028 set d_endgrent_r_proto endgrent_r $hdrs
12032 case "$d_endgrent_r_proto" in
12034 case "$endgrent_r_proto" in
12035 ''|0) try='int endgrent_r(FILE**);'
12036 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12038 case "$endgrent_r_proto" in
12039 ''|0) try='void endgrent_r(FILE**);'
12040 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12042 case "$endgrent_r_proto" in
12043 ''|0) d_endgrent_r=undef
12045 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12046 * ) case "$endgrent_r_proto" in
12047 REENTRANT_PROTO*) ;;
12048 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12050 echo "Prototype: $try" ;;
12053 *) case "$usethreads" in
12054 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12061 *) endgrent_r_proto=0
12065 : see if endhostent exists
12066 set endhostent d_endhent
12069 : see if this is a netdb.h system
12070 set netdb.h i_netdb
12073 : see if endhostent_r exists
12074 set endhostent_r d_endhostent_r
12076 case "$d_endhostent_r" in
12078 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12079 case "$d_endhostent_r_proto:$usethreads" in
12080 ":define") d_endhostent_r_proto=define
12081 set d_endhostent_r_proto endhostent_r $hdrs
12085 case "$d_endhostent_r_proto" in
12087 case "$endhostent_r_proto" in
12088 ''|0) try='int endhostent_r(struct hostent_data*);'
12089 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12091 case "$endhostent_r_proto" in
12092 ''|0) try='void endhostent_r(struct hostent_data*);'
12093 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12095 case "$endhostent_r_proto" in
12096 ''|0) d_endhostent_r=undef
12097 endhostent_r_proto=0
12098 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12099 * ) case "$endhostent_r_proto" in
12100 REENTRANT_PROTO*) ;;
12101 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12103 echo "Prototype: $try" ;;
12106 *) case "$usethreads" in
12107 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12109 d_endhostent_r=undef
12110 endhostent_r_proto=0
12114 *) endhostent_r_proto=0
12118 : see if endnetent exists
12119 set endnetent d_endnent
12122 : see if endnetent_r exists
12123 set endnetent_r d_endnetent_r
12125 case "$d_endnetent_r" in
12127 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12128 case "$d_endnetent_r_proto:$usethreads" in
12129 ":define") d_endnetent_r_proto=define
12130 set d_endnetent_r_proto endnetent_r $hdrs
12134 case "$d_endnetent_r_proto" in
12136 case "$endnetent_r_proto" in
12137 ''|0) try='int endnetent_r(struct netent_data*);'
12138 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12140 case "$endnetent_r_proto" in
12141 ''|0) try='void endnetent_r(struct netent_data*);'
12142 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12144 case "$endnetent_r_proto" in
12145 ''|0) d_endnetent_r=undef
12146 endnetent_r_proto=0
12147 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12148 * ) case "$endnetent_r_proto" in
12149 REENTRANT_PROTO*) ;;
12150 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12152 echo "Prototype: $try" ;;
12155 *) case "$usethreads" in
12156 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12158 d_endnetent_r=undef
12159 endnetent_r_proto=0
12163 *) endnetent_r_proto=0
12167 : see if endprotoent exists
12168 set endprotoent d_endpent
12171 : see if endprotoent_r exists
12172 set endprotoent_r d_endprotoent_r
12174 case "$d_endprotoent_r" in
12176 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12177 case "$d_endprotoent_r_proto:$usethreads" in
12178 ":define") d_endprotoent_r_proto=define
12179 set d_endprotoent_r_proto endprotoent_r $hdrs
12183 case "$d_endprotoent_r_proto" in
12185 case "$endprotoent_r_proto" in
12186 ''|0) try='int endprotoent_r(struct protoent_data*);'
12187 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12189 case "$endprotoent_r_proto" in
12190 ''|0) try='void endprotoent_r(struct protoent_data*);'
12191 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12193 case "$endprotoent_r_proto" in
12194 ''|0) d_endprotoent_r=undef
12195 endprotoent_r_proto=0
12196 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12197 * ) case "$endprotoent_r_proto" in
12198 REENTRANT_PROTO*) ;;
12199 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12201 echo "Prototype: $try" ;;
12204 *) case "$usethreads" in
12205 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12207 d_endprotoent_r=undef
12208 endprotoent_r_proto=0
12212 *) endprotoent_r_proto=0
12216 : see if endpwent exists
12217 set endpwent d_endpwent
12220 : see if this is a pwd.h system
12226 xxx=`./findhdr pwd.h`
12227 $cppstdin $cppflags $cppminus < $xxx >$$.h
12229 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12237 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12245 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12253 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12261 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12269 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12277 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12285 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12297 set d_pwquota; eval $setvar
12298 set d_pwage; eval $setvar
12299 set d_pwchange; eval $setvar
12300 set d_pwclass; eval $setvar
12301 set d_pwexpire; eval $setvar
12302 set d_pwcomment; eval $setvar
12303 set d_pwgecos; eval $setvar
12304 set d_pwpasswd; eval $setvar
12308 : see if endpwent_r exists
12309 set endpwent_r d_endpwent_r
12311 case "$d_endpwent_r" in
12313 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12314 case "$d_endpwent_r_proto:$usethreads" in
12315 ":define") d_endpwent_r_proto=define
12316 set d_endpwent_r_proto endpwent_r $hdrs
12320 case "$d_endpwent_r_proto" in
12322 case "$endpwent_r_proto" in
12323 ''|0) try='int endpwent_r(FILE**);'
12324 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12326 case "$endpwent_r_proto" in
12327 ''|0) try='void endpwent_r(FILE**);'
12328 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12330 case "$endpwent_r_proto" in
12331 ''|0) d_endpwent_r=undef
12333 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12334 * ) case "$endpwent_r_proto" in
12335 REENTRANT_PROTO*) ;;
12336 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12338 echo "Prototype: $try" ;;
12341 *) case "$usethreads" in
12342 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12349 *) endpwent_r_proto=0
12353 : see if endservent exists
12354 set endservent d_endsent
12357 : see if endservent_r exists
12358 set endservent_r d_endservent_r
12360 case "$d_endservent_r" in
12362 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12363 case "$d_endservent_r_proto:$usethreads" in
12364 ":define") d_endservent_r_proto=define
12365 set d_endservent_r_proto endservent_r $hdrs
12369 case "$d_endservent_r_proto" in
12371 case "$endservent_r_proto" in
12372 ''|0) try='int endservent_r(struct servent_data*);'
12373 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12375 case "$endservent_r_proto" in
12376 ''|0) try='void endservent_r(struct servent_data*);'
12377 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12379 case "$endservent_r_proto" in
12380 ''|0) d_endservent_r=undef
12381 endservent_r_proto=0
12382 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12383 * ) case "$endservent_r_proto" in
12384 REENTRANT_PROTO*) ;;
12385 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12387 echo "Prototype: $try" ;;
12390 *) case "$usethreads" in
12391 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12393 d_endservent_r=undef
12394 endservent_r_proto=0
12398 *) endservent_r_proto=0
12402 : Locate the flags for 'open()'
12405 #include <sys/types.h>
12410 #include <sys/file.h>
12412 #$i_stdlib I_STDLIB
12414 #include <stdlib.h>
12425 : check sys/file.h first to get FREAD on Sun
12426 if $test `./findhdr sys/file.h` && \
12427 set try -DI_SYS_FILE && eval $compile; then
12429 echo "<sys/file.h> defines the O_* constants..." >&4
12430 if $run ./try; then
12431 echo "and you have the 3 argument form of open()." >&4
12434 echo "but not the 3 argument form of open(). Oh, well." >&4
12437 elif $test `./findhdr fcntl.h` && \
12438 set try -DI_FCNTL && eval $compile; then
12440 echo "<fcntl.h> defines the O_* constants..." >&4
12441 if $run ./try; then
12442 echo "and you have the 3 argument form of open()." >&4
12445 echo "but not the 3 argument form of open(). Oh, well." >&4
12450 echo "I can't find the O_* constant definitions! You got problems." >&4
12456 : see if this is a sys/file.h system
12461 : do we need to include sys/file.h ?
12465 if $h_sysfile; then
12467 echo "We'll be including <sys/file.h>." >&4
12470 echo "We won't be including <sys/file.h>." >&4
12480 : see if fcntl.h is there
12485 : see if we can include fcntl.h
12491 echo "We'll be including <fcntl.h>." >&4
12494 if $h_sysfile; then
12495 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12497 echo "We won't be including <fcntl.h>." >&4
12509 : see if fork exists
12513 : see if pipe exists
12517 : check for non-blocking I/O stuff
12518 case "$h_sysfile" in
12519 true) echo "#include <sys/file.h>" > head.c;;
12522 true) echo "#include <fcntl.h>" > head.c;;
12523 *) echo "#include <sys/fcntl.h>" > head.c;;
12528 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12529 case "$o_nonblock" in
12531 $cat head.c > try.c
12532 $cat >>try.c <<EOCP
12534 #$i_stdlib I_STDLIB
12536 #include <stdlib.h>
12544 printf("O_NONBLOCK\n");
12548 printf("O_NDELAY\n");
12552 printf("FNDELAY\n");
12559 if eval $compile_ok; then
12560 o_nonblock=`$run ./try`
12561 case "$o_nonblock" in
12562 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12563 *) echo "Seems like we can use $o_nonblock.";;
12566 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12569 *) echo "Using $hint value $o_nonblock.";;
12574 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12577 case "$d_fork:$d_pipe" in
12579 $cat head.c > try.c
12580 $cat >>try.c <<EOCP
12582 #include <sys/types.h>
12583 #include <signal.h>
12585 #$i_stdlib I_STDLIB
12587 #include <stdlib.h>
12593 #define MY_O_NONBLOCK $o_nonblock
12594 #ifndef errno /* XXX need better Configure test */
12597 #$i_unistd I_UNISTD
12599 #include <unistd.h>
12601 #$i_string I_STRING
12603 #include <string.h>
12605 #include <strings.h>
12607 $signal_t blech(int x) { exit(3); }
12609 $cat >> try.c <<'EOCP'
12617 pipe(pd); /* Down: child -> parent */
12618 pipe(pu); /* Up: parent -> child */
12621 close(pd[1]); /* Parent reads from pd[0] */
12622 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12624 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12629 signal(SIGALRM, blech);
12631 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12633 sprintf(string, "%d\n", ret);
12634 write(2, string, strlen(string));
12637 if (errno == EAGAIN) {
12638 printf("EAGAIN\n");
12643 if (errno == EWOULDBLOCK)
12644 printf("EWOULDBLOCK\n");
12647 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12648 sleep(2); /* Give it time to close our pipe */
12650 ret = read(pd[0], buf, 1); /* Should read EOF */
12652 sprintf(string, "%d\n", ret);
12653 write(4, string, strlen(string));
12657 close(pd[0]); /* We write to pd[1] */
12658 close(pu[1]); /* We read from pu[0] */
12659 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12660 close(pd[1]); /* Pipe pd is now fully closed! */
12661 exit(0); /* Bye bye, thank you for playing! */
12665 if eval $compile_ok; then
12666 echo "$startsh" >mtry
12667 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12669 ./mtry >/dev/null 2>&1
12671 0) eagain=`$cat try.out`;;
12672 1) echo "Could not perform non-blocking setting!";;
12673 2) echo "I did a successful read() for something that was not there!";;
12674 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12675 4) echo "Could not find F_SETFL!";;
12676 *) echo "Something terribly wrong happened during testing.";;
12678 rd_nodata=`$cat try.ret`
12679 echo "A read() system call with no data present returns $rd_nodata."
12680 case "$rd_nodata" in
12683 echo "(That's peculiar, fixing that to be -1.)"
12689 echo "Forcing errno EAGAIN on read() with no data available."
12693 echo "Your read() sets errno to $eagain when no data is available."
12696 status=`$cat try.err`
12698 0) echo "And it correctly returns 0 to signal EOF.";;
12699 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12700 *) echo "However, your read() returns '$status' on EOF??";;
12703 if test "$status" = "$rd_nodata"; then
12704 echo "WARNING: you can't distinguish between EOF and no data!"
12708 echo "I can't compile the test program--assuming errno EAGAIN will do."
12712 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12721 echo "Using $hint value $eagain."
12722 echo "Your read() returns $rd_nodata when no data is present."
12723 case "$d_eofnblk" in
12724 "$define") echo "And you can see EOF because read() returns 0.";;
12725 "$undef") echo "But you can't see EOF status from read() returned value.";;
12727 echo "(Assuming you can't see EOF status from read anyway.)"
12733 $rm_try head.c mtry
12735 : see if _ptr and _cnt from stdio act std
12738 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12739 echo "(Looks like you have stdio.h from BSD.)"
12740 case "$stdio_ptr" in
12741 '') stdio_ptr='((fp)->_p)'
12744 *) ptr_lval=$d_stdio_ptr_lval;;
12746 case "$stdio_cnt" in
12747 '') stdio_cnt='((fp)->_r)'
12750 *) cnt_lval=$d_stdio_cnt_lval;;
12752 case "$stdio_base" in
12753 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12755 case "$stdio_bufsiz" in
12756 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12758 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12759 echo "(Looks like you have stdio.h from Linux.)"
12760 case "$stdio_ptr" in
12761 '') stdio_ptr='((fp)->_IO_read_ptr)'
12764 *) ptr_lval=$d_stdio_ptr_lval;;
12766 case "$stdio_cnt" in
12767 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12770 *) cnt_lval=$d_stdio_cnt_lval;;
12772 case "$stdio_base" in
12773 '') stdio_base='((fp)->_IO_read_base)';;
12775 case "$stdio_bufsiz" in
12776 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12779 case "$stdio_ptr" in
12780 '') stdio_ptr='((fp)->_ptr)'
12783 *) ptr_lval=$d_stdio_ptr_lval;;
12785 case "$stdio_cnt" in
12786 '') stdio_cnt='((fp)->_cnt)'
12789 *) cnt_lval=$d_stdio_cnt_lval;;
12791 case "$stdio_base" in
12792 '') stdio_base='((fp)->_base)';;
12794 case "$stdio_bufsiz" in
12795 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12799 : test whether _ptr and _cnt really work
12800 echo "Checking how std your stdio is..." >&4
12803 #$i_stdlib I_STDLIB
12805 #include <stdlib.h>
12807 #define FILE_ptr(fp) $stdio_ptr
12808 #define FILE_cnt(fp) $stdio_cnt
12810 FILE *fp = fopen("try.c", "r");
12813 18 <= FILE_cnt(fp) &&
12814 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12822 if eval $compile && $to try.c; then
12823 if $run ./try; then
12824 echo "Your stdio acts pretty std."
12827 echo "Your stdio isn't very std."
12830 echo "Your stdio doesn't appear very std."
12834 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12835 # direct buffer manipulation no longer works. The Configure tests
12836 # should be changed to correctly detect this, but until then,
12837 # the following check should at least let perl compile and run.
12838 # (This quick fix should be updated before 5.8.1.)
12839 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12840 # A. Dougherty, June 3, 2002.
12841 case "$d_gnulibc" in
12843 case "$gnulibc_version" in
12847 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12856 : Can _ptr be used as an lvalue?
12857 case "$d_stdstdio$ptr_lval" in
12858 $define$define) val=$define ;;
12861 set d_stdio_ptr_lval
12864 : Can _cnt be used as an lvalue?
12865 case "$d_stdstdio$cnt_lval" in
12866 $define$define) val=$define ;;
12869 set d_stdio_cnt_lval
12873 : test whether setting _ptr sets _cnt as a side effect
12874 d_stdio_ptr_lval_sets_cnt="$undef"
12875 d_stdio_ptr_lval_nochange_cnt="$undef"
12876 case "$d_stdio_ptr_lval$d_stdstdio" in
12878 echo "Checking to see what happens if we set the stdio ptr..." >&4
12881 /* Can we scream? */
12882 /* Eat dust sed :-) */
12883 /* In the buffer space, no one can hear you scream. */
12884 #$i_stdlib I_STDLIB
12886 #include <stdlib.h>
12888 #define FILE_ptr(fp) $stdio_ptr
12889 #define FILE_cnt(fp) $stdio_cnt
12890 #include <sys/types.h>
12892 FILE *fp = fopen("try.c", "r");
12897 puts("Fail even to read");
12900 c = getc(fp); /* Read away the first # */
12902 puts("Fail even to read");
12906 18 <= FILE_cnt(fp) &&
12907 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12909 puts("Fail even to read");
12912 ptr = (char*) FILE_ptr(fp);
12913 cnt = (size_t)FILE_cnt(fp);
12915 FILE_ptr(fp) += 42;
12917 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12918 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12921 if (FILE_cnt(fp) <= 20) {
12922 printf ("Fail (<20 chars to test)");
12925 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12926 puts("Fail compare");
12929 if (cnt == FILE_cnt(fp)) {
12930 puts("Pass_unchanged");
12933 if (FILE_cnt(fp) == (cnt - 42)) {
12934 puts("Pass_changed");
12937 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12943 if eval $compile && $to try.c; then
12944 case `$run ./try` in
12946 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12947 d_stdio_ptr_lval_sets_cnt="$define" ;;
12949 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12950 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12952 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12954 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12957 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12963 : see if _base is also standard
12965 case "$d_stdstdio" in
12969 #$i_stdlib I_STDLIB
12971 #include <stdlib.h>
12973 #define FILE_base(fp) $stdio_base
12974 #define FILE_bufsiz(fp) $stdio_bufsiz
12976 FILE *fp = fopen("try.c", "r");
12979 19 <= FILE_bufsiz(fp) &&
12980 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12987 if eval $compile && $to try.c; then
12988 if $run ./try; then
12989 echo "And its _base field acts std."
12992 echo "But its _base field isn't std."
12995 echo "However, it seems to be lacking the _base field."
13003 : see if fast_stdio exists
13005 case "$d_stdstdio:$d_stdio_ptr_lval" in
13007 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13009 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13020 : see if fchdir exists
13021 set fchdir d_fchdir
13024 : see if fchmod exists
13025 set fchmod d_fchmod
13028 : see if fchown exists
13029 set fchown d_fchown
13032 : see if this is an fcntl system
13036 : See if fcntl-based locking works.
13039 #$i_stdlib I_STDLIB
13041 #include <stdlib.h>
13043 #include <unistd.h>
13045 #include <signal.h>
13046 $signal_t blech(int x) { exit(3); }
13048 #if defined(F_SETLK) && defined(F_SETLKW)
13049 struct flock flock;
13051 fd = open("try.c", O_RDONLY);
13052 flock.l_type = F_RDLCK;
13053 flock.l_whence = SEEK_SET;
13054 flock.l_start = flock.l_len = 0;
13055 signal(SIGALRM, blech);
13057 retval = fcntl(fd, F_SETLK, &flock);
13059 (retval < 0 ? exit(2) : exit(0));
13065 echo "Checking if fcntl-based file locking works... "
13069 if eval $compile_ok; then
13070 if $run ./try; then
13071 echo "Yes, it seems to work."
13074 echo "Nope, it didn't work."
13079 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13080 *** This is (almost) impossible.
13081 *** If your NFS lock daemons are not feeling well, something like
13082 *** this may happen, please investigate. Cannot continue, aborting.
13090 echo "I'm unable to compile the test program, so I'll assume not."
13095 echo "Nope, since you don't even have fcntl()."
13098 set d_fcntl_can_lock
13102 : check for fd_set items
13105 Checking to see how well your C compiler handles fd_set and friends ...
13108 #$i_stdlib I_STDLIB
13110 #include <stdlib.h>
13112 #$i_systime I_SYS_TIME
13113 #$i_sysselct I_SYS_SELECT
13114 #$d_socket HAS_SOCKET
13115 #include <sys/types.h>
13117 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13120 #include <sys/time.h>
13122 #ifdef I_SYS_SELECT
13123 #include <sys/select.h>
13132 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13140 if eval $compile; then
13141 d_fds_bits="$define"
13143 echo "Well, your system knows about the normal fd_set typedef..." >&4
13144 if $run ./try; then
13145 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13146 d_fd_macros="$define"
13149 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13151 d_fd_macros="$undef"
13155 Hmm, your compiler has some difficulty with fd_set. Checking further...
13158 if eval $compile; then
13159 d_fds_bits="$undef"
13161 echo "Well, your system has some sort of fd_set available..." >&4
13162 if $run ./try; then
13163 echo "and you have the normal fd_set macros." >&4
13164 d_fd_macros="$define"
13167 but not the normal fd_set macros! Gross! More work for me...
13169 d_fd_macros="$undef"
13172 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13174 d_fds_bits="$undef"
13175 d_fd_macros="$undef"
13180 : see if fgetpos exists
13181 set fgetpos d_fgetpos
13184 : see if finite exists
13185 set finite d_finite
13188 : see if finitel exists
13189 set finitel d_finitel
13192 : see if flock exists
13196 : see if prototype for flock is available
13198 set d_flockproto flock $i_sysfile sys/file.h
13201 : see if fp_class exists
13202 set fp_class d_fp_class
13205 : see if pathconf exists
13206 set pathconf d_pathconf
13209 : see if fpathconf exists
13210 set fpathconf d_fpathconf
13213 : see if fpclass exists
13214 set fpclass d_fpclass
13217 : see if fpclassify exists
13218 set fpclassify d_fpclassify
13221 : see if fpclassl exists
13222 set fpclassl d_fpclassl
13225 : check for fpos64_t
13227 echo "Checking to see if you have fpos64_t..." >&4
13230 int main() { fpos64_t x = 7; }
13233 if eval $compile; then
13235 echo "You have fpos64_t."
13238 echo "You do not have fpos64_t."
13239 case "$fpossize" in
13240 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13247 : see if frexpl exists
13248 set frexpl d_frexpl
13251 : see if this is a sys/param system
13252 set sys/param.h i_sysparam
13255 : see if this is a sys/mount.h system
13256 set sys/mount.h i_sysmount
13259 : Check for fs_data_s
13261 echo "Checking to see if your system supports struct fs_data..." >&4
13262 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13264 case "$d_fs_data_s" in
13265 "$define") echo "Yes, it does." ;;
13266 *) echo "No, it doesn't." ;;
13269 : see if fseeko exists
13270 set fseeko d_fseeko
13272 case "$longsize" in
13273 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13276 : see if fsetpos exists
13277 set fsetpos d_fsetpos
13280 : see if fstatfs exists
13281 set fstatfs d_fstatfs
13284 : see if statvfs exists
13285 set statvfs d_statvfs
13288 : see if fstatvfs exists
13289 set fstatvfs d_fstatvfs
13293 : see if fsync exists
13297 : see if ftello exists
13298 set ftello d_ftello
13300 case "$longsize" in
13301 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13304 : check for a working futimes
13307 echo "Checking if you have a working futimes()" >&4
13310 #include <sys/time.h>
13317 fd = open ("try.c", O_RDWR);
13318 if (-1 == fd) exit (1);
13319 rv = futimes (fd, NULL);
13320 exit (rv == -1 ? errno : 0);
13324 if eval $compile; then
13328 0) echo "Yes, you have" >&4
13329 d_futimes="$define"
13331 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13335 echo "No, it does not (probably harmless)" >&4
13339 : see if ndbm.h is available
13342 : Compatibility location for RedHat 7.1
13343 set gdbm/ndbm.h i_gdbmndbm
13345 : Compatibility location for Debian 4.0
13346 set gdbm-ndbm.h i_gdbm_ndbm
13350 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13351 : see if dbm_open exists
13352 set dbm_open d_dbm_open
13354 case "$d_dbm_open" in
13357 i_gdbmndbm="$undef"
13358 i_gdbm_ndbm="$undef"
13359 echo "We won't be including <ndbm.h>"
13369 ndbm_hdr_protochk='name=$1; hdr=$2;
13370 eval "ihdr=\$""i_$name";
13372 if $test "$ihdr" = "$define"; then
13373 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13374 case "$d_cplusplus" in
13375 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13376 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13379 $define) $echo "Your <$hdr> seems to have prototypes";;
13380 *) $echo "Your <$hdr> does not seem to have prototypes";;
13383 set "d_${name}_h_uses_prototypes";
13387 eval $ndbm_hdr_protochk
13388 set gdbmndbm gdbm/ndbm.h
13389 eval $ndbm_hdr_protochk
13390 set gdbm_ndbm gdbm-ndbm.h
13391 eval $ndbm_hdr_protochk
13393 : see if getaddrinfo exists
13394 set getaddrinfo d_getaddrinfo
13397 : see if getcwd exists
13398 set getcwd d_getcwd
13401 : see if getespwnam exists
13402 set getespwnam d_getespwnam
13405 : see if getfsstat exists
13406 set getfsstat d_getfsstat
13409 : see if getgrent exists
13410 set getgrent d_getgrent
13413 : see if getgrent_r exists
13414 set getgrent_r d_getgrent_r
13416 case "$d_getgrent_r" in
13418 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13419 case "$d_getgrent_r_proto:$usethreads" in
13420 ":define") d_getgrent_r_proto=define
13421 set d_getgrent_r_proto getgrent_r $hdrs
13425 case "$d_getgrent_r_proto" in
13427 case "$getgrent_r_proto" in
13428 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13429 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13431 case "$getgrent_r_proto" in
13432 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13433 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13435 case "$getgrent_r_proto" in
13436 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13437 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13439 case "$getgrent_r_proto" in
13440 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13441 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13443 case "$getgrent_r_proto" in
13444 ''|0) try='int getgrent_r(struct group*, char*, int);'
13445 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13447 case "$getgrent_r_proto" in
13448 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13449 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13451 case "$getgrent_r_proto" in
13452 ''|0) d_getgrent_r=undef
13454 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13455 * ) case "$getgrent_r_proto" in
13456 REENTRANT_PROTO*) ;;
13457 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13459 echo "Prototype: $try" ;;
13462 *) case "$usethreads" in
13463 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13470 *) getgrent_r_proto=0
13474 : see if getgrgid_r exists
13475 set getgrgid_r d_getgrgid_r
13477 case "$d_getgrgid_r" in
13479 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13480 case "$d_getgrgid_r_proto:$usethreads" in
13481 ":define") d_getgrgid_r_proto=define
13482 set d_getgrgid_r_proto getgrgid_r $hdrs
13486 case "$d_getgrgid_r_proto" in
13488 case "$getgrgid_r_proto" in
13489 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13490 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13492 case "$getgrgid_r_proto" in
13493 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13494 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13496 case "$getgrgid_r_proto" in
13497 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13498 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13500 case "$getgrgid_r_proto" in
13501 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13502 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13504 case "$getgrgid_r_proto" in
13505 ''|0) d_getgrgid_r=undef
13507 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13508 * ) case "$getgrgid_r_proto" in
13509 REENTRANT_PROTO*) ;;
13510 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13512 echo "Prototype: $try" ;;
13515 *) case "$usethreads" in
13516 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13523 *) getgrgid_r_proto=0
13527 : see if getgrnam_r exists
13528 set getgrnam_r d_getgrnam_r
13530 case "$d_getgrnam_r" in
13532 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13533 case "$d_getgrnam_r_proto:$usethreads" in
13534 ":define") d_getgrnam_r_proto=define
13535 set d_getgrnam_r_proto getgrnam_r $hdrs
13539 case "$d_getgrnam_r_proto" in
13541 case "$getgrnam_r_proto" in
13542 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13543 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13545 case "$getgrnam_r_proto" in
13546 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13547 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13549 case "$getgrnam_r_proto" in
13550 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13551 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13553 case "$getgrnam_r_proto" in
13554 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13555 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13557 case "$getgrnam_r_proto" in
13558 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13559 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13561 case "$getgrnam_r_proto" in
13562 ''|0) d_getgrnam_r=undef
13564 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13565 * ) case "$getgrnam_r_proto" in
13566 REENTRANT_PROTO*) ;;
13567 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13569 echo "Prototype: $try" ;;
13572 *) case "$usethreads" in
13573 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13580 *) getgrnam_r_proto=0
13584 : see if gethostbyaddr exists
13585 set gethostbyaddr d_gethbyaddr
13588 : see if gethostbyname exists
13589 set gethostbyname d_gethbyname
13592 : see if gethostent exists
13593 set gethostent d_gethent
13596 : see how we will look up host name
13599 if set gethostname val -f d_gethname; eval $csym; $val; then
13600 echo 'gethostname() found.' >&4
13601 d_gethname="$define"
13604 if set uname val -f d_uname; eval $csym; $val; then
13607 uname() was found, but you're running xenix, and older versions of xenix
13608 have a broken uname(). If you don't really know whether your xenix is old
13609 enough to have a broken system call, use the default answer.
13614 "$define") dflt=n;;
13616 rp='Is your uname() broken?'
13619 n*) d_uname="$define"; call=uname;;
13622 echo 'uname() found.' >&4
13629 case "$d_gethname" in
13630 '') d_gethname="$undef";;
13633 '') d_uname="$undef";;
13635 case "$d_uname$d_gethname" in
13640 Every now and then someone has a $call() that lies about the hostname
13641 but can't be fixed for political or economic reasons. If you wish, I can
13642 pretend $call() isn't there and maybe compute hostname at run-time
13643 thanks to the '$phostname' command.
13646 rp="Shall I ignore $call() from now on?"
13649 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13652 case "$phostname" in
13653 '') aphostname='';;
13654 *) case "$aphostname" in
13656 *) set X $phostname
13660 file=`./loc $file $file $pth`
13661 aphostname=`echo $file $*`
13666 case "$d_uname$d_gethname" in
13669 case "$phostname" in
13671 echo "There will be no way for $package to get your hostname." >&4;;
13673 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13677 case "$d_phostname" in
13678 '') d_phostname="$undef";;
13681 : see if gethostbyaddr_r exists
13682 set gethostbyaddr_r d_gethostbyaddr_r
13684 case "$d_gethostbyaddr_r" in
13686 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13687 case "$d_gethostbyaddr_r_proto:$usethreads" in
13688 ":define") d_gethostbyaddr_r_proto=define
13689 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13693 case "$d_gethostbyaddr_r_proto" in
13695 case "$gethostbyaddr_r_proto" in
13696 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13697 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13699 case "$gethostbyaddr_r_proto" in
13700 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13701 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13703 case "$gethostbyaddr_r_proto" in
13704 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13705 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13707 case "$gethostbyaddr_r_proto" in
13708 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13709 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13711 case "$gethostbyaddr_r_proto" in
13712 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13713 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13715 case "$gethostbyaddr_r_proto" in
13716 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13717 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13719 case "$gethostbyaddr_r_proto" in
13720 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13721 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13723 case "$gethostbyaddr_r_proto" in
13724 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13725 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13727 case "$gethostbyaddr_r_proto" in
13728 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13729 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13731 case "$gethostbyaddr_r_proto" in
13732 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13733 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13735 case "$gethostbyaddr_r_proto" in
13736 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13737 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13739 case "$gethostbyaddr_r_proto" in
13740 ''|0) d_gethostbyaddr_r=undef
13741 gethostbyaddr_r_proto=0
13742 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13743 * ) case "$gethostbyaddr_r_proto" in
13744 REENTRANT_PROTO*) ;;
13745 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13747 echo "Prototype: $try" ;;
13750 *) case "$usethreads" in
13751 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13753 d_gethostbyaddr_r=undef
13754 gethostbyaddr_r_proto=0
13758 *) gethostbyaddr_r_proto=0
13762 : see if gethostbyname_r exists
13763 set gethostbyname_r d_gethostbyname_r
13765 case "$d_gethostbyname_r" in
13767 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13768 case "$d_gethostbyname_r_proto:$usethreads" in
13769 ":define") d_gethostbyname_r_proto=define
13770 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13774 case "$d_gethostbyname_r_proto" in
13776 case "$gethostbyname_r_proto" in
13777 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13778 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13780 case "$gethostbyname_r_proto" in
13781 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13782 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13784 case "$gethostbyname_r_proto" in
13785 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13786 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13788 case "$gethostbyname_r_proto" in
13789 ''|0) d_gethostbyname_r=undef
13790 gethostbyname_r_proto=0
13791 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13792 * ) case "$gethostbyname_r_proto" in
13793 REENTRANT_PROTO*) ;;
13794 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13796 echo "Prototype: $try" ;;
13799 *) case "$usethreads" in
13800 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13802 d_gethostbyname_r=undef
13803 gethostbyname_r_proto=0
13807 *) gethostbyname_r_proto=0
13811 : see if gethostent_r exists
13812 set gethostent_r d_gethostent_r
13814 case "$d_gethostent_r" in
13816 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13817 case "$d_gethostent_r_proto:$usethreads" in
13818 ":define") d_gethostent_r_proto=define
13819 set d_gethostent_r_proto gethostent_r $hdrs
13823 case "$d_gethostent_r_proto" in
13825 case "$gethostent_r_proto" in
13826 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13827 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13829 case "$gethostent_r_proto" in
13830 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13831 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13833 case "$gethostent_r_proto" in
13834 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13835 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13837 case "$gethostent_r_proto" in
13838 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13839 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13841 case "$gethostent_r_proto" in
13842 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13843 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13845 case "$gethostent_r_proto" in
13846 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13847 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13849 case "$gethostent_r_proto" in
13850 ''|0) d_gethostent_r=undef
13851 gethostent_r_proto=0
13852 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13853 * ) case "$gethostent_r_proto" in
13854 REENTRANT_PROTO*) ;;
13855 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13857 echo "Prototype: $try" ;;
13860 *) case "$usethreads" in
13861 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13863 d_gethostent_r=undef
13864 gethostent_r_proto=0
13868 *) gethostent_r_proto=0
13872 : see if prototypes for various gethostxxx netdb.h functions are available
13874 set d_gethostprotos gethostent $i_netdb netdb.h
13877 : see if getitimer exists
13878 set getitimer d_getitimer
13881 : see if getlogin exists
13882 set getlogin d_getlogin
13885 : see if getlogin_r exists
13886 set getlogin_r d_getlogin_r
13888 case "$d_getlogin_r" in
13890 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13891 case "$d_getlogin_r_proto:$usethreads" in
13892 ":define") d_getlogin_r_proto=define
13893 set d_getlogin_r_proto getlogin_r $hdrs
13897 case "$d_getlogin_r_proto" in
13899 case "$getlogin_r_proto" in
13900 ''|0) try='int getlogin_r(char*, size_t);'
13901 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13903 case "$getlogin_r_proto" in
13904 ''|0) try='int getlogin_r(char*, int);'
13905 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13907 case "$getlogin_r_proto" in
13908 ''|0) try='char* getlogin_r(char*, size_t);'
13909 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13911 case "$getlogin_r_proto" in
13912 ''|0) try='char* getlogin_r(char*, int);'
13913 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13915 case "$getlogin_r_proto" in
13916 ''|0) d_getlogin_r=undef
13918 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13919 * ) case "$getlogin_r_proto" in
13920 REENTRANT_PROTO*) ;;
13921 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13923 echo "Prototype: $try" ;;
13926 *) case "$usethreads" in
13927 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13934 *) getlogin_r_proto=0
13938 : see if getmnt exists
13939 set getmnt d_getmnt
13942 : see if getmntent exists
13943 set getmntent d_getmntent
13946 : see if getnameinfo exists
13947 set getnameinfo d_getnameinfo
13950 : see if getnetbyaddr exists
13951 set getnetbyaddr d_getnbyaddr
13954 : see if getnetbyname exists
13955 set getnetbyname d_getnbyname
13958 : see if getnetent exists
13959 set getnetent d_getnent
13962 : see if getnetbyaddr_r exists
13963 set getnetbyaddr_r d_getnetbyaddr_r
13965 case "$d_getnetbyaddr_r" in
13967 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13968 case "$d_getnetbyaddr_r_proto:$usethreads" in
13969 ":define") d_getnetbyaddr_r_proto=define
13970 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13974 case "$d_getnetbyaddr_r_proto" in
13976 case "$getnetbyaddr_r_proto" in
13977 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13978 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13980 case "$getnetbyaddr_r_proto" in
13981 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13982 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13984 case "$getnetbyaddr_r_proto" in
13985 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13986 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13988 case "$getnetbyaddr_r_proto" in
13989 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13990 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13992 case "$getnetbyaddr_r_proto" in
13993 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13994 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13996 case "$getnetbyaddr_r_proto" in
13997 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13998 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14000 case "$getnetbyaddr_r_proto" in
14001 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14002 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14004 case "$getnetbyaddr_r_proto" in
14005 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14006 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14008 case "$getnetbyaddr_r_proto" in
14009 ''|0) d_getnetbyaddr_r=undef
14010 getnetbyaddr_r_proto=0
14011 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14012 * ) case "$getnetbyaddr_r_proto" in
14013 REENTRANT_PROTO*) ;;
14014 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14016 echo "Prototype: $try" ;;
14019 *) case "$usethreads" in
14020 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14022 d_getnetbyaddr_r=undef
14023 getnetbyaddr_r_proto=0
14027 *) getnetbyaddr_r_proto=0
14031 : see if getnetbyname_r exists
14032 set getnetbyname_r d_getnetbyname_r
14034 case "$d_getnetbyname_r" in
14036 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14037 case "$d_getnetbyname_r_proto:$usethreads" in
14038 ":define") d_getnetbyname_r_proto=define
14039 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14043 case "$d_getnetbyname_r_proto" in
14045 case "$getnetbyname_r_proto" in
14046 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14047 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14049 case "$getnetbyname_r_proto" in
14050 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14051 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14053 case "$getnetbyname_r_proto" in
14054 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14055 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14057 case "$getnetbyname_r_proto" in
14058 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14059 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14061 case "$getnetbyname_r_proto" in
14062 ''|0) d_getnetbyname_r=undef
14063 getnetbyname_r_proto=0
14064 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14065 * ) case "$getnetbyname_r_proto" in
14066 REENTRANT_PROTO*) ;;
14067 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14069 echo "Prototype: $try" ;;
14072 *) case "$usethreads" in
14073 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14075 d_getnetbyname_r=undef
14076 getnetbyname_r_proto=0
14080 *) getnetbyname_r_proto=0
14084 : see if getnetent_r exists
14085 set getnetent_r d_getnetent_r
14087 case "$d_getnetent_r" in
14089 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14090 case "$d_getnetent_r_proto:$usethreads" in
14091 ":define") d_getnetent_r_proto=define
14092 set d_getnetent_r_proto getnetent_r $hdrs
14096 case "$d_getnetent_r_proto" in
14098 case "$getnetent_r_proto" in
14099 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14100 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14102 case "$getnetent_r_proto" in
14103 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14104 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14106 case "$getnetent_r_proto" in
14107 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14108 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14110 case "$getnetent_r_proto" in
14111 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14112 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14114 case "$getnetent_r_proto" in
14115 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14116 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14118 case "$getnetent_r_proto" in
14119 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14120 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14122 case "$getnetent_r_proto" in
14123 ''|0) d_getnetent_r=undef
14124 getnetent_r_proto=0
14125 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14126 * ) case "$getnetent_r_proto" in
14127 REENTRANT_PROTO*) ;;
14128 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14130 echo "Prototype: $try" ;;
14133 *) case "$usethreads" in
14134 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14136 d_getnetent_r=undef
14137 getnetent_r_proto=0
14141 *) getnetent_r_proto=0
14145 : see if prototypes for various getnetxxx netdb.h functions are available
14147 set d_getnetprotos getnetent $i_netdb netdb.h
14150 : see if getpagesize exists
14151 set getpagesize d_getpagsz
14154 : Optional checks for getprotobyname and getprotobynumber
14156 : see if getprotobyname exists
14157 set getprotobyname d_getpbyname
14160 : see if getprotobynumber exists
14161 set getprotobynumber d_getpbynumber
14164 : see if getprotoent exists
14165 set getprotoent d_getpent
14168 : see if getpgid exists
14169 set getpgid d_getpgid
14172 : see if getpgrp2 exists
14173 set getpgrp2 d_getpgrp2
14176 : see if getppid exists
14177 set getppid d_getppid
14180 : see if getpriority exists
14181 set getpriority d_getprior
14184 : see if getprotobyname_r exists
14185 set getprotobyname_r d_getprotobyname_r
14187 case "$d_getprotobyname_r" in
14189 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14190 case "$d_getprotobyname_r_proto:$usethreads" in
14191 ":define") d_getprotobyname_r_proto=define
14192 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14196 case "$d_getprotobyname_r_proto" in
14198 case "$getprotobyname_r_proto" in
14199 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14200 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14202 case "$getprotobyname_r_proto" in
14203 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14204 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14206 case "$getprotobyname_r_proto" in
14207 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14208 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14210 case "$getprotobyname_r_proto" in
14211 ''|0) d_getprotobyname_r=undef
14212 getprotobyname_r_proto=0
14213 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14214 * ) case "$getprotobyname_r_proto" in
14215 REENTRANT_PROTO*) ;;
14216 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14218 echo "Prototype: $try" ;;
14221 *) case "$usethreads" in
14222 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14224 d_getprotobyname_r=undef
14225 getprotobyname_r_proto=0
14229 *) getprotobyname_r_proto=0
14233 : see if getprotobynumber_r exists
14234 set getprotobynumber_r d_getprotobynumber_r
14236 case "$d_getprotobynumber_r" in
14238 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14239 case "$d_getprotobynumber_r_proto:$usethreads" in
14240 ":define") d_getprotobynumber_r_proto=define
14241 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14245 case "$d_getprotobynumber_r_proto" in
14247 case "$getprotobynumber_r_proto" in
14248 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14249 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14251 case "$getprotobynumber_r_proto" in
14252 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14253 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14255 case "$getprotobynumber_r_proto" in
14256 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14257 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14259 case "$getprotobynumber_r_proto" in
14260 ''|0) d_getprotobynumber_r=undef
14261 getprotobynumber_r_proto=0
14262 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14263 * ) case "$getprotobynumber_r_proto" in
14264 REENTRANT_PROTO*) ;;
14265 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14267 echo "Prototype: $try" ;;
14270 *) case "$usethreads" in
14271 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14273 d_getprotobynumber_r=undef
14274 getprotobynumber_r_proto=0
14278 *) getprotobynumber_r_proto=0
14282 : see if getprotoent_r exists
14283 set getprotoent_r d_getprotoent_r
14285 case "$d_getprotoent_r" in
14287 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14288 case "$d_getprotoent_r_proto:$usethreads" in
14289 ":define") d_getprotoent_r_proto=define
14290 set d_getprotoent_r_proto getprotoent_r $hdrs
14294 case "$d_getprotoent_r_proto" in
14296 case "$getprotoent_r_proto" in
14297 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14298 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14300 case "$getprotoent_r_proto" in
14301 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14302 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14304 case "$getprotoent_r_proto" in
14305 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14306 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14308 case "$getprotoent_r_proto" in
14309 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14310 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14312 case "$getprotoent_r_proto" in
14313 ''|0) d_getprotoent_r=undef
14314 getprotoent_r_proto=0
14315 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14316 * ) case "$getprotoent_r_proto" in
14317 REENTRANT_PROTO*) ;;
14318 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14320 echo "Prototype: $try" ;;
14323 *) case "$usethreads" in
14324 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14326 d_getprotoent_r=undef
14327 getprotoent_r_proto=0
14331 *) getprotoent_r_proto=0
14335 : see if prototypes for various getprotoxxx netdb.h functions are available
14337 set d_getprotoprotos getprotoent $i_netdb netdb.h
14340 : see if getprpwnam exists
14341 set getprpwnam d_getprpwnam
14344 : see if getpwent exists
14345 set getpwent d_getpwent
14348 : see if getpwent_r exists
14349 set getpwent_r d_getpwent_r
14351 case "$d_getpwent_r" in
14353 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14354 case "$d_getpwent_r_proto:$usethreads" in
14355 ":define") d_getpwent_r_proto=define
14356 set d_getpwent_r_proto getpwent_r $hdrs
14360 case "$d_getpwent_r_proto" in
14362 case "$getpwent_r_proto" in
14363 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14364 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14366 case "$getpwent_r_proto" in
14367 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14368 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14370 case "$getpwent_r_proto" in
14371 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14372 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14374 case "$getpwent_r_proto" in
14375 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14376 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14378 case "$getpwent_r_proto" in
14379 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14380 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14382 case "$getpwent_r_proto" in
14383 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14384 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14386 case "$getpwent_r_proto" in
14387 ''|0) d_getpwent_r=undef
14389 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14390 * ) case "$getpwent_r_proto" in
14391 REENTRANT_PROTO*) ;;
14392 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14394 echo "Prototype: $try" ;;
14397 *) case "$usethreads" in
14398 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14405 *) getpwent_r_proto=0
14409 : see if getpwnam_r exists
14410 set getpwnam_r d_getpwnam_r
14412 case "$d_getpwnam_r" in
14414 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14415 case "$d_getpwnam_r_proto:$usethreads" in
14416 ":define") d_getpwnam_r_proto=define
14417 set d_getpwnam_r_proto getpwnam_r $hdrs
14421 case "$d_getpwnam_r_proto" in
14423 case "$getpwnam_r_proto" in
14424 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14425 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14427 case "$getpwnam_r_proto" in
14428 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14429 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14431 case "$getpwnam_r_proto" in
14432 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14433 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14435 case "$getpwnam_r_proto" in
14436 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14437 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14439 case "$getpwnam_r_proto" in
14440 ''|0) d_getpwnam_r=undef
14442 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14443 * ) case "$getpwnam_r_proto" in
14444 REENTRANT_PROTO*) ;;
14445 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14447 echo "Prototype: $try" ;;
14450 *) case "$usethreads" in
14451 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14458 *) getpwnam_r_proto=0
14462 : see if getpwuid_r exists
14463 set getpwuid_r d_getpwuid_r
14465 case "$d_getpwuid_r" in
14467 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14468 case "$d_getpwuid_r_proto:$usethreads" in
14469 ":define") d_getpwuid_r_proto=define
14470 set d_getpwuid_r_proto getpwuid_r $hdrs
14474 case "$d_getpwuid_r_proto" in
14476 case "$getpwuid_r_proto" in
14477 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14478 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14480 case "$getpwuid_r_proto" in
14481 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14482 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14484 case "$getpwuid_r_proto" in
14485 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14486 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14488 case "$getpwuid_r_proto" in
14489 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14490 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14492 case "$getpwuid_r_proto" in
14493 ''|0) d_getpwuid_r=undef
14495 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14496 * ) case "$getpwuid_r_proto" in
14497 REENTRANT_PROTO*) ;;
14498 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14500 echo "Prototype: $try" ;;
14503 *) case "$usethreads" in
14504 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14511 *) getpwuid_r_proto=0
14515 : Optional checks for getsbyname and getsbyport
14517 : see if getservbyname exists
14518 set getservbyname d_getsbyname
14521 : see if getservbyport exists
14522 set getservbyport d_getsbyport
14525 : see if getservent exists
14526 set getservent d_getsent
14529 : see if getservbyname_r exists
14530 set getservbyname_r d_getservbyname_r
14532 case "$d_getservbyname_r" in
14534 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14535 case "$d_getservbyname_r_proto:$usethreads" in
14536 ":define") d_getservbyname_r_proto=define
14537 set d_getservbyname_r_proto getservbyname_r $hdrs
14541 case "$d_getservbyname_r_proto" in
14543 case "$getservbyname_r_proto" in
14544 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14545 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14547 case "$getservbyname_r_proto" in
14548 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14549 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14551 case "$getservbyname_r_proto" in
14552 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14553 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14555 case "$getservbyname_r_proto" in
14556 ''|0) d_getservbyname_r=undef
14557 getservbyname_r_proto=0
14558 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14559 * ) case "$getservbyname_r_proto" in
14560 REENTRANT_PROTO*) ;;
14561 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14563 echo "Prototype: $try" ;;
14566 *) case "$usethreads" in
14567 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14569 d_getservbyname_r=undef
14570 getservbyname_r_proto=0
14574 *) getservbyname_r_proto=0
14578 : see if getservbyport_r exists
14579 set getservbyport_r d_getservbyport_r
14581 case "$d_getservbyport_r" in
14583 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14584 case "$d_getservbyport_r_proto:$usethreads" in
14585 ":define") d_getservbyport_r_proto=define
14586 set d_getservbyport_r_proto getservbyport_r $hdrs
14590 case "$d_getservbyport_r_proto" in
14592 case "$getservbyport_r_proto" in
14593 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14594 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14596 case "$getservbyport_r_proto" in
14597 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14598 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14600 case "$getservbyport_r_proto" in
14601 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14602 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14604 case "$getservbyport_r_proto" in
14605 ''|0) d_getservbyport_r=undef
14606 getservbyport_r_proto=0
14607 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14608 * ) case "$getservbyport_r_proto" in
14609 REENTRANT_PROTO*) ;;
14610 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14612 echo "Prototype: $try" ;;
14615 *) case "$usethreads" in
14616 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14618 d_getservbyport_r=undef
14619 getservbyport_r_proto=0
14623 *) getservbyport_r_proto=0
14627 : see if getservent_r exists
14628 set getservent_r d_getservent_r
14630 case "$d_getservent_r" in
14632 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14633 case "$d_getservent_r_proto:$usethreads" in
14634 ":define") d_getservent_r_proto=define
14635 set d_getservent_r_proto getservent_r $hdrs
14639 case "$d_getservent_r_proto" in
14641 case "$getservent_r_proto" in
14642 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14643 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14645 case "$getservent_r_proto" in
14646 ''|0) try='int getservent_r(struct servent*, char*, int);'
14647 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14649 case "$getservent_r_proto" in
14650 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14651 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14653 case "$getservent_r_proto" in
14654 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14655 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14657 case "$getservent_r_proto" in
14658 ''|0) d_getservent_r=undef
14659 getservent_r_proto=0
14660 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14661 * ) case "$getservent_r_proto" in
14662 REENTRANT_PROTO*) ;;
14663 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14665 echo "Prototype: $try" ;;
14668 *) case "$usethreads" in
14669 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14671 d_getservent_r=undef
14672 getservent_r_proto=0
14676 *) getservent_r_proto=0
14680 : see if prototypes for various getservxxx netdb.h functions are available
14682 set d_getservprotos getservent $i_netdb netdb.h
14685 : see if getspnam exists
14686 set getspnam d_getspnam
14689 : see if this is a shadow.h system
14690 set shadow.h i_shadow
14693 : see if getspnam_r exists
14694 set getspnam_r d_getspnam_r
14696 case "$d_getspnam_r" in
14698 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14699 case "$d_getspnam_r_proto:$usethreads" in
14700 ":define") d_getspnam_r_proto=define
14701 set d_getspnam_r_proto getspnam_r $hdrs
14705 case "$d_getspnam_r_proto" in
14707 case "$getspnam_r_proto" in
14708 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14709 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14711 case "$getspnam_r_proto" in
14712 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14713 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14715 case "$getspnam_r_proto" in
14716 ''|0) d_getspnam_r=undef
14718 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14719 * ) case "$getspnam_r_proto" in
14720 REENTRANT_PROTO*) ;;
14721 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14723 echo "Prototype: $try" ;;
14726 *) case "$usethreads" in
14727 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14734 *) getspnam_r_proto=0
14738 : see if gettimeofday or ftime exists
14739 set gettimeofday d_gettimeod
14741 case "$d_gettimeod" in
14747 val="$undef"; set d_ftime; eval $setvar
14750 case "$d_gettimeod$d_ftime" in
14753 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14757 : see if gmtime_r exists
14758 set gmtime_r d_gmtime_r
14760 case "$d_gmtime_r" in
14762 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14763 case "$d_gmtime_r_proto:$usethreads" in
14764 ":define") d_gmtime_r_proto=define
14765 set d_gmtime_r_proto gmtime_r $hdrs
14769 case "$d_gmtime_r_proto" in
14771 case "$gmtime_r_proto" in
14772 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14773 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14775 case "$gmtime_r_proto" in
14776 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14777 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14779 case "$gmtime_r_proto" in
14780 ''|0) d_gmtime_r=undef
14782 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14783 * ) case "$gmtime_r_proto" in
14784 REENTRANT_PROTO*) ;;
14785 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14787 echo "Prototype: $try" ;;
14790 *) case "$usethreads" in
14791 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14798 *) gmtime_r_proto=0
14802 : see if hasmntopt exists
14803 set hasmntopt d_hasmntopt
14806 : see if this is a netinet/in.h or sys/in.h system
14807 set netinet/in.h i_niin sys/in.h i_sysin
14810 : see if arpa/inet.h has to be included
14811 set arpa/inet.h i_arpainet
14814 : see if htonl --and friends-- exists
14819 : Maybe they are macros.
14822 $cat >htonl.c <<EOM
14824 #include <sys/types.h>
14825 #$i_niin I_NETINET_IN
14827 #$i_arpainet I_ARPA_INET
14828 #ifdef I_NETINET_IN
14829 #include <netinet/in.h>
14832 #include <sys/in.h>
14835 #include <arpa/inet.h>
14838 printf("Defined as a macro.");
14841 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14842 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14844 echo "But it seems to be defined as a macro." >&4
14852 : see if ilogbl exists
14853 set ilogbl d_ilogbl
14858 if set index val -f; eval $csym; $val; then
14859 if set strchr val -f d_strchr; eval $csym; $val; then
14860 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14863 echo "strchr() found." >&4
14867 echo "index() found." >&4
14872 echo "index() found." >&4
14875 if set strchr val -f d_strchr; eval $csym; $val; then
14878 echo "strchr() found." >&4
14880 echo "No index() or strchr() found!" >&4
14885 set d_strchr; eval $setvar
14887 set d_index; eval $setvar
14889 : check whether inet_aton exists
14890 set inet_aton d_inetaton
14893 : see if inet_ntop exists
14894 set inet_ntop d_inetntop
14897 : see if inet_pton exists
14898 set inet_pton d_inetpton
14903 $cat >isascii.c <<EOCP
14906 #$i_stdlib I_STDLIB
14908 #include <stdlib.h>
14919 if eval $compile; then
14920 echo "isascii() found." >&4
14923 echo "isascii() NOT found." >&4
14930 : see if isfinite exists
14931 set isfinite d_isfinite
14934 : see if isinf exists
14938 : see if isnan exists
14942 : see if isnanl exists
14943 set isnanl d_isnanl
14946 : see if killpg exists
14947 set killpg d_killpg
14950 : see if lchown exists
14952 $cat > try.c <<'EOCP'
14953 /* System header to define __stub macros and hopefully few prototypes,
14954 which can conflict with char lchown(); below. */
14955 #include <assert.h>
14956 /* Override any gcc2 internal prototype to avoid an error. */
14957 /* We use char because int might match the return type of a gcc2
14958 builtin and then its argument prototype would still apply. */
14961 /* The GNU C library defines this for functions which it implements
14962 to always fail with ENOSYS. Some functions are actually named
14963 something starting with __ and the normal name is an alias. */
14964 #if defined (__stub_lchown) || defined (__stub___lchown)
14972 if eval $compile; then
14973 $echo "lchown() found." >&4
14976 $echo "lchown() NOT found." >&4
14982 : See if number of significant digits in a double precision number is known
14984 $cat >ldbl_dig.c <<EOM
14985 #$i_limits I_LIMITS
14988 #include <limits.h>
14994 printf("Contains LDBL_DIG");
14997 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14998 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14999 echo "LDBL_DIG found." >&4
15002 echo "LDBL_DIG NOT found." >&4
15009 : see if this is a math.h system
15013 : check to see if math.h defines _LIB_VERSION
15014 d_libm_lib_version="$undef"
15018 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15020 #include <unistd.h>
15022 int main (int argc, char *argv[])
15024 printf ("%d\n", _LIB_VERSION);
15029 if eval $compile; then
15031 echo "Yes, it does ($foo)" >&4
15032 d_libm_lib_version="$define"
15034 echo "No, it does not (probably harmless)" >&4
15041 : see if link exists
15045 : see if localtime_r exists
15046 set localtime_r d_localtime_r
15048 case "$d_localtime_r" in
15050 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15051 case "$d_localtime_r_proto:$usethreads" in
15052 ":define") d_localtime_r_proto=define
15053 set d_localtime_r_proto localtime_r $hdrs
15057 case "$d_localtime_r_proto" in
15059 case "$localtime_r_proto" in
15060 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15061 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15063 case "$localtime_r_proto" in
15064 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15065 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15067 case "$localtime_r_proto" in
15068 ''|0) d_localtime_r=undef
15069 localtime_r_proto=0
15070 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15071 * ) case "$localtime_r_proto" in
15072 REENTRANT_PROTO*) ;;
15073 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15075 echo "Prototype: $try" ;;
15078 *) case "$usethreads" in
15079 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15081 d_localtime_r=undef
15082 localtime_r_proto=0
15086 *) localtime_r_proto=0
15090 : see if localtime_r calls tzset
15091 case "$localtime_r_proto" in
15094 /* Does our libc's localtime_r call tzset ?
15095 * return 0 if so, 1 otherwise.
15097 #$i_systypes I_SYS_TYPES
15098 #$i_unistd I_UNISTD
15100 #$i_stdlib I_STDLIB
15101 #$i_string I_STRING
15102 #$i_malloc I_MALLOC
15104 # include <sys/types.h>
15107 # include <unistd.h>
15113 #include <stdlib.h>
15116 # include <string.h>
15118 # include <strings.h>
15121 # include <malloc.h>
15125 time_t t = time(0L);
15126 char w_tz[]="TZ" "=GMT+5",
15127 e_tz[]="TZ" "=GMT-5",
15128 *tz_e = (char*)malloc(16),
15129 *tz_w = (char*)malloc(16);
15130 struct tm tm_e, tm_w;
15131 memset(&tm_e,'\0',sizeof(struct tm));
15132 memset(&tm_w,'\0',sizeof(struct tm));
15137 localtime_r(&t, &tm_e);
15140 localtime_r(&t, &tm_w);
15142 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15148 if eval $compile; then
15149 if $run ./try; then
15150 d_localtime_r_needs_tzset=undef;
15152 d_localtime_r_needs_tzset=define;
15155 d_localtime_r_needs_tzset=undef;
15159 d_localtime_r_needs_tzset=undef;
15164 : see if localeconv exists
15165 set localeconv d_locconv
15168 : see if lockf exists
15172 : see if prototype for lseek is available
15174 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15177 : see if lstat exists
15181 : see if madvise exists
15182 set madvise d_madvise
15185 : see if malloc_size exists
15186 set malloc_size d_malloc_size
15189 : see if malloc_size_good exists
15190 set malloc_good_size d_malloc_good_size
15193 : see if mblen exists
15197 : see if mbstowcs exists
15198 set mbstowcs d_mbstowcs
15201 : see if mbtowc exists
15202 set mbtowc d_mbtowc
15205 : see if memchr exists
15206 set memchr d_memchr
15209 : see if memcmp exists
15210 set memcmp d_memcmp
15213 : see if memcpy exists
15214 set memcpy d_memcpy
15217 : see if memmove exists
15218 set memmove d_memmove
15221 : see if memset exists
15222 set memset d_memset
15225 : see if mkdir exists
15229 : see if mkdtemp exists
15230 set mkdtemp d_mkdtemp
15233 : see if mkfifo exists
15234 set mkfifo d_mkfifo
15237 : see if mkstemp exists
15238 set mkstemp d_mkstemp
15241 : see if mkstemps exists
15242 set mkstemps d_mkstemps
15245 : see if mktime exists
15246 set mktime d_mktime
15249 : see if this is a sys/mman.h system
15250 set sys/mman.h i_sysmman
15253 : see if mmap exists
15256 : see what shmat returns
15257 : default to something harmless
15259 case "$i_sysmman$d_mmap" in
15261 $cat >mmap.c <<'END'
15262 #include <sys/mman.h>
15265 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15270 echo "and it returns ($mmaptype)." >&4
15276 : see if sqrtl exists
15280 : see if scalbnl exists
15281 set scalbnl d_scalbnl
15284 : see if modfl exists
15288 : see if prototype for modfl is available
15290 set d_modflproto modfl $i_math math.h
15293 d_modfl_pow32_bug="$undef"
15295 case "$d_longdbl$d_modfl" in
15298 Checking to see whether your modfl() is okay for large values...
15304 if $test "X$d_modflproto" != "X$define"; then
15305 $cat >>try.c <<EOCP
15306 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15307 long double modfl (long double, long double *);
15310 $cat >>try.c <<EOCP
15312 long double nv = 4294967303.15;
15318 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15322 case "$osname:$gccversion" in
15323 aix:) saveccflags="$ccflags"
15324 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15327 if eval $compile; then
15330 *" 4294967303.150000 1.150000 4294967302.000000")
15331 echo >&4 "Your modfl() is broken for large values."
15332 d_modfl_pow32_bug="$define"
15334 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15338 *" 4294967303.150000 0.150000 4294967303.000000")
15339 echo >&4 "Your modfl() seems okay for large values."
15341 *) echo >&4 "I don't understand your modfl() at all."
15347 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15350 case "$osname:$gccversion" in
15351 aix:) ccflags="$saveccflags" ;; # restore
15356 if $test "$uselongdouble" = "$define"; then
15358 if $test "$d_sqrtl" != "$define"; then
15359 message="$message sqrtl"
15361 if $test "$d_modfl" != "$define"; then
15362 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15363 echo "You have both aintl and copysignl, so I can emulate modfl."
15365 message="$message modfl"
15368 if $test "$d_frexpl" != "$define"; then
15369 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15370 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15372 message="$message frexpl"
15376 if $test "$message" != ""; then
15379 *** You requested the use of long doubles but you do not seem to have
15380 *** the following mathematical functions needed for long double support:
15382 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15383 *** Cannot continue, aborting.
15391 : see if mprotect exists
15392 set mprotect d_mprotect
15395 : see if msgctl exists
15396 set msgctl d_msgctl
15399 : see if msgget exists
15400 set msgget d_msgget
15403 : see if msgsnd exists
15404 set msgsnd d_msgsnd
15407 : see if msgrcv exists
15408 set msgrcv d_msgrcv
15411 : see how much of the 'msg*(2)' library is present.
15414 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15415 *"$undef"*) h_msg=false;;
15419 case "`ipcs 2>&1`" in
15420 "SVID messages"*"not configured"*)
15421 echo "Your $osname does not have the msg*(2) configured." >&4
15424 set msgctl d_msgctl
15426 set msgget d_msgget
15428 set msgsnd d_msgsnd
15430 set msgrcv d_msgrcv
15436 : we could also check for sys/ipc.h ...
15437 if $h_msg && $test `./findhdr sys/msg.h`; then
15438 echo "You have the full msg*(2) library." >&4
15441 echo "You don't have the full msg*(2) library." >&4
15447 : Check for msghdr_s
15449 echo "Checking to see if your system supports struct msghdr..." >&4
15450 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15452 case "$d_msghdr_s" in
15453 "$define") echo "Yes, it does." ;;
15454 *) echo "No, it doesn't." ;;
15458 : see if msync exists
15462 : see if munmap exists
15463 set munmap d_munmap
15466 : see if nice exists
15470 : see if this is a langinfo.h system
15471 set langinfo.h i_langinfo
15474 : see if nl_langinfo exists
15475 set nl_langinfo d_nl_langinfo
15478 : check for volatile keyword
15480 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15481 $cat >try.c <<'EOCP'
15484 typedef struct _goo_struct goo_struct;
15485 goo_struct * volatile goo = ((goo_struct *)0);
15486 struct _goo_struct {
15491 typedef unsigned short foo_t;
15492 char *volatile foo;
15494 volatile foo_t blech;
15498 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15500 echo "Yup, it does."
15503 echo "Nope, it doesn't."
15509 : Check basic sizes
15511 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15513 case "$use64bitint:$d_quad:$quadtype" in
15516 uvtype="$uquadtype"
15521 uvtype="unsigned long"
15527 case "$uselongdouble:$d_longdbl" in
15529 nvtype="long double"
15530 nvsize=$longdblsize
15537 $echo "(IV will be "$ivtype", $ivsize bytes)"
15538 $echo "(UV will be "$uvtype", $uvsize bytes)"
15539 $echo "(NV will be "$nvtype", $nvsize bytes)"
15542 #$i_inttypes I_INTTYPES
15544 #include <inttypes.h>
15549 int8_t i = INT8_MAX;
15550 uint8_t u = UINT8_MAX;
15551 printf("int8_t\n");
15554 int16_t i = INT16_MAX;
15555 uint16_t i = UINT16_MAX;
15556 printf("int16_t\n");
15559 int32_t i = INT32_MAX;
15560 uint32_t u = UINT32_MAX;
15561 printf("int32_t\n");
15566 i8type="signed char"
15567 u8type="unsigned char"
15572 '') case "$shortsize" in
15574 u16type="unsigned short"
15582 '') set try -DINT16
15583 if eval $compile; then
15584 case "`$run ./try`" in
15596 '') if $test $shortsize -ge 2; then
15598 u16type="unsigned short"
15606 '') case "$longsize" in
15608 u32type="unsigned long"
15612 *) case "$intsize" in
15614 u32type="unsigned int"
15624 '') set try -DINT32
15625 if eval $compile; then
15626 case "`$run ./try`" in
15638 '') if $test $intsize -ge 4; then
15640 u32type="unsigned int"
15648 '') case "$d_quad:$quadtype" in
15650 i64type="$quadtype"
15651 u64type="$uquadtype"
15659 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15660 : volatile so that the compiler has to store it out to memory.
15661 if test X"$d_volatile" = X"$define"; then
15666 #$i_stdlib I_STDLIB
15668 #include <stdlib.h>
15670 #include <sys/types.h>
15671 #include <signal.h>
15673 $volatile int bletched = 0;
15674 $signal_t blech(int s) { bletched = 1; }
15679 int n = 8 * $uvsize;
15682 signal(SIGFPE, blech);
15685 for (i = 0; i < n; i++) {
15686 u = u << 1 | ($uvtype)1;
15688 if (($uvtype)d != u)
15692 d = ($nvtype)(u - 1);
15693 if (($uvtype)d != (u - 1))
15700 printf("%d\n", ((i == n) ? -n : i));
15706 d_nv_preserves_uv="$undef"
15707 if eval $compile; then
15708 nv_preserves_uv_bits="`$run ./try`"
15710 case "$nv_preserves_uv_bits" in
15712 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15713 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15714 d_nv_preserves_uv="$define"
15716 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15717 d_nv_preserves_uv="$undef" ;;
15718 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15719 nv_preserves_uv_bits="0" ;;
15723 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15724 : volatile so that the compiler has to store it out to memory.
15725 if test X"$d_volatile" = X"$define"; then
15731 typedef $nvtype NV;
15738 while(count < 256) {
15739 $volatile NV up = value + 1.0;
15740 $volatile NV negated = -value;
15741 $volatile NV down = negated - 1.0;
15742 $volatile NV got_up = up - value;
15743 int up_good = got_up == 1.0;
15744 int got_down = down - negated;
15745 int down_good = got_down == -1.0;
15747 if (down_good != up_good) {
15749 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15750 up_good, (double) got_up, down_good, (double) got_down,
15751 count, (double) value);
15758 fputs("256.0", stdout);
15761 fputs("2.0", stdout);
15767 fputs("*", stdout);
15773 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15774 count, (double) value);
15780 nv_overflows_integers_at='0'
15781 if eval $compile; then
15787 The largest integer your NVs can preserve is equal to $xxx
15789 nv_overflows_integers_at="$xxx"
15792 Cannot determine the largest integer value your NVs can hold, unexpected output
15799 Cannot determine the largest integer value your NVs can hold
15806 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15807 : volatile so that the compiler has to store it out to memory.
15808 if test X"$d_volatile" = X"$define"; then
15813 #$i_stdlib I_STDLIB
15815 #include <stdlib.h>
15817 #$i_string I_STRING
15819 # include <string.h>
15821 # include <strings.h>
15823 #include <sys/types.h>
15824 #include <signal.h>
15826 $volatile int bletched = 0;
15827 $signal_t blech(int s) { bletched = 1; }
15830 int checkit($nvtype d, char *where) {
15831 unsigned char *p = (char *)&d;
15832 unsigned char *end = p + sizeof(d);
15842 printf("No - %s: 0x", where);
15844 printf ("%02X", *p++);
15849 int main(int argc, char **argv) {
15852 fail += checkit(d, "0.0");
15854 /* The compiler shouldn't be assuming that bletched is 0 */
15857 fail += checkit(d, "bleched");
15860 signal(SIGFPE, blech);
15863 /* Paranoia - the compiler should have no way of knowing that ANSI says
15864 that argv[argc] will always be NULL. Actually, if it did assume this it
15865 would be buggy, as this is C and main() can be called from elsewhere in
15867 d = argv[argc] ? 1 : 0;
15870 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15873 fail += checkit(d, "ternary");
15875 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15878 printf("No - memset doesn't give 0.0\n");
15879 /* This might just blow up: */
15880 printf("(gives %g)\n", d);
15886 printf("No - something bleched\n");
15891 printf("No - %d fail(s)\n", fail);
15900 d_nv_zero_is_allbits_zero="$undef"
15901 if eval $compile; then
15907 0.0 is represented as all bits zero in memory
15909 d_nv_zero_is_allbits_zero="$define"
15912 0.0 is not represented as all bits zero in memory
15914 d_nv_zero_is_allbits_zero="$undef"
15919 0.0 is not represented as all bits zero in memory
15921 d_nv_zero_is_allbits_zero="$undef"
15927 : check for off64_t
15929 echo "Checking to see if you have off64_t..." >&4
15931 #include <sys/types.h>
15932 #include <unistd.h>
15933 int main() { off64_t x = 7; }
15936 if eval $compile; then
15938 echo "You have off64_t."
15941 echo "You do not have off64_t."
15942 case "$lseeksize" in
15943 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15950 : how to create joinable pthreads
15951 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15953 echo "Checking what constant to use for creating joinable pthreads..." >&4
15954 $cat >try.c <<'EOCP'
15955 #include <pthread.h>
15957 int detachstate = JOINABLE;
15960 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15961 if eval $compile; then
15962 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15963 val="$undef" # Yes, undef.
15964 set d_old_pthread_create_joinable
15967 set old_pthread_create_joinable
15970 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15971 if eval $compile; then
15972 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15974 set d_old_pthread_create_joinable
15976 val=PTHREAD_CREATE_UNDETACHED
15977 set old_pthread_create_joinable
15980 set try -DJOINABLE=__UNDETACHED
15981 if eval $compile; then
15982 echo "You seem to use __UNDETACHED." >&4
15984 set d_old_pthread_create_joinable
15987 set old_pthread_create_joinable
15990 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15992 set d_old_pthread_create_joinable
15995 set old_pthread_create_joinable
16002 d_old_pthread_create_joinable="$undef"
16003 old_pthread_create_joinable=""
16006 : see if pause exists
16010 : see if poll exists
16014 : see if prctl exists
16018 : see if prctl supports PR_SET_NAME
16019 d_prctl_set_name=$undef
16023 #include <sys/prctl.h>
16025 int main (int argc, char *argv[])
16027 return (prctl (PR_SET_NAME, "Test"));
16031 if eval $compile_ok && $run ./try; then
16032 echo "Your prctl (PR_SET_NAME, ...) works"
16033 d_prctl_set_name=$define
16039 : see if readlink exists
16040 set readlink d_readlink
16043 : Check if exe is symlink to abs path of executing program
16047 case "$d_readlink" in
16049 if $issymlink /proc/self/exe ; then
16050 $ls -l /proc/self/exe > reflect
16051 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16052 echo "You have Linux-like /proc/self/exe."
16053 procselfexe='"/proc/self/exe"'
16057 if $issymlink /proc/curproc/file ; then
16058 $ls -l /proc/curproc/file > reflect
16059 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16060 echo "You have BSD-like /proc/curproc/file."
16061 procselfexe='"/proc/curproc/file"'
16071 : backward compatibility for d_hvfork
16072 if test X$d_hvfork != X; then
16073 d_vfork="$d_hvfork"
16076 : see if there is a vfork
16081 d_pseudofork=$undef
16083 : Ok, but do we want to use it. vfork is reportedly unreliable in
16084 : perl on Solaris 2.x, and probably elsewhere.
16088 case "$usevfork" in
16094 Perl can only use a vfork() that doesn't suffer from strict
16095 restrictions on calling functions or modifying global data in
16096 the child. For example, glibc-2.1 contains such a vfork()
16097 that is unsuitable. If your system provides a proper fork()
16098 call, chances are that you do NOT want perl to use vfork().
16101 rp="Do you still want to use vfork()?"
16106 echo "Ok, we won't use vfork()."
16115 $define) usevfork='true';;
16116 *) usevfork='false';;
16119 : see whether the pthread_atfork exists
16121 #include <pthread.h>
16124 #ifdef PTHREAD_ATFORK
16125 pthread_atfork(NULL,NULL,NULL);
16130 : see if pthread_atfork exists
16131 set try -DPTHREAD_ATFORK
16132 if eval $compile; then
16137 case "$usethreads" in
16140 $define) echo 'pthread_atfork found.' >&4 ;;
16141 *) echo 'pthread_atfork NOT found.' >&4 ;;
16144 set d_pthread_atfork
16147 : see if pthread_attr_setscope exists
16148 set pthread_attr_setscope d_pthread_attr_setscope
16151 : see whether the various POSIXish _yields exist
16153 #include <pthread.h>
16159 #ifdef PTHREAD_YIELD
16162 #ifdef PTHREAD_YIELD_NULL
16163 pthread_yield(NULL);
16169 : see if sched_yield exists
16170 set try -DSCHED_YIELD
16171 if eval $compile; then
16173 sched_yield='sched_yield()'
16177 case "$usethreads" in
16180 $define) echo 'sched_yield() found.' >&4 ;;
16181 *) echo 'sched_yield() NOT found.' >&4 ;;
16187 : see if pthread_yield exists
16188 set try -DPTHREAD_YIELD
16189 if eval $compile; then
16191 case "$sched_yield" in
16192 '') sched_yield='pthread_yield()' ;;
16195 set try -DPTHREAD_YIELD_NULL
16196 if eval $compile; then
16198 case "$sched_yield" in
16199 '') sched_yield='pthread_yield(NULL)' ;;
16205 case "$usethreads" in
16208 $define) echo 'pthread_yield() found.' >&4 ;;
16209 *) echo 'pthread_yield() NOT found.' >&4 ;;
16213 set d_pthread_yield
16215 case "$sched_yield" in
16216 '') sched_yield=undef ;;
16220 : see if random_r exists
16221 set random_r d_random_r
16223 case "$d_random_r" in
16225 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16226 case "$d_random_r_proto:$usethreads" in
16227 ":define") d_random_r_proto=define
16228 set d_random_r_proto random_r $hdrs
16232 case "$d_random_r_proto" in
16234 case "$random_r_proto" in
16235 ''|0) try='int random_r(int*, struct random_data*);'
16236 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16238 case "$random_r_proto" in
16239 ''|0) try='int random_r(long*, struct random_data*);'
16240 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16242 case "$random_r_proto" in
16243 ''|0) try='int random_r(struct random_data*, int32_t*);'
16244 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16246 case "$random_r_proto" in
16247 ''|0) d_random_r=undef
16249 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16250 * ) case "$random_r_proto" in
16251 REENTRANT_PROTO*) ;;
16252 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16254 echo "Prototype: $try" ;;
16257 *) case "$usethreads" in
16258 define) echo "random_r has no prototype, not using it." >&4 ;;
16265 *) random_r_proto=0
16269 : see if readdir and friends exist
16270 set readdir d_readdir
16272 set seekdir d_seekdir
16274 set telldir d_telldir
16276 set rewinddir d_rewinddir
16279 : see if readdir64_r exists
16280 set readdir64_r d_readdir64_r
16282 case "$d_readdir64_r" in
16284 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16285 case "$d_readdir64_r_proto:$usethreads" in
16286 ":define") d_readdir64_r_proto=define
16287 set d_readdir64_r_proto readdir64_r $hdrs
16291 case "$d_readdir64_r_proto" in
16293 case "$readdir64_r_proto" in
16294 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16295 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16297 case "$readdir64_r_proto" in
16298 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16299 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16301 case "$readdir64_r_proto" in
16302 ''|0) d_readdir64_r=undef
16303 readdir64_r_proto=0
16304 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16305 * ) case "$readdir64_r_proto" in
16306 REENTRANT_PROTO*) ;;
16307 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16309 echo "Prototype: $try" ;;
16312 *) case "$usethreads" in
16313 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16315 d_readdir64_r=undef
16316 readdir64_r_proto=0
16320 *) readdir64_r_proto=0
16324 : see if readdir_r exists
16325 set readdir_r d_readdir_r
16327 case "$d_readdir_r" in
16329 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16330 case "$d_readdir_r_proto:$usethreads" in
16331 ":define") d_readdir_r_proto=define
16332 set d_readdir_r_proto readdir_r $hdrs
16336 case "$d_readdir_r_proto" in
16338 case "$readdir_r_proto" in
16339 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16340 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16342 case "$readdir_r_proto" in
16343 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16344 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16346 case "$readdir_r_proto" in
16347 ''|0) d_readdir_r=undef
16349 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16350 * ) case "$readdir_r_proto" in
16351 REENTRANT_PROTO*) ;;
16352 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16354 echo "Prototype: $try" ;;
16357 *) case "$usethreads" in
16358 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16365 *) readdir_r_proto=0
16369 : see if readv exists
16373 : see if recvmsg exists
16374 set recvmsg d_recvmsg
16377 : see if rename exists
16378 set rename d_rename
16381 : see if rmdir exists
16385 : see if memory.h is available.
16390 : See if it conflicts with string.h
16396 $cppstdin $cppflags $cppminus < $strings > mem.h
16397 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16399 echo "We won't be including <memory.h>."
16409 : can bcopy handle overlapping blocks?
16412 case "$d_memmove" in
16413 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16414 *) case "$d_bcopy" in
16416 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16418 #$i_memory I_MEMORY
16419 #$i_stdlib I_STDLIB
16420 #$i_string I_STRING
16421 #$i_unistd I_UNISTD
16423 $cat >>try.c <<'EOCP'
16426 # include <memory.h>
16429 # include <stdlib.h>
16432 # include <string.h>
16434 # include <strings.h>
16437 # include <unistd.h> /* Needed for NetBSD */
16441 char buf[128], abc[128];
16447 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16448 try to store the string in read-only memory. */
16449 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16451 for (align = 7; align >= 0; align--) {
16452 for (len = 36; len; len--) {
16454 bcopy(abc, b, len);
16455 for (off = 1; off <= len; off++) {
16456 bcopy(b, b+off, len);
16457 bcopy(b+off, b, len);
16458 if (bcmp(b, abc, len))
16467 if eval $compile_ok; then
16468 if $run ./try 2>/dev/null; then
16469 echo "Yes, it can."
16472 echo "It can't, sorry."
16475 echo "(I can't compile the test program, so we'll assume not...)"
16485 : can memcpy handle overlapping blocks?
16488 case "$d_memmove" in
16489 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16490 *) case "$d_memcpy" in
16492 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16494 #$i_memory I_MEMORY
16495 #$i_stdlib I_STDLIB
16496 #$i_string I_STRING
16497 #$i_unistd I_UNISTD
16499 $cat >>try.c <<'EOCP'
16502 # include <memory.h>
16505 # include <stdlib.h>
16508 # include <string.h>
16510 # include <strings.h>
16513 # include <unistd.h> /* Needed for NetBSD */
16517 char buf[128], abc[128];
16523 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16524 try to store the string in read-only memory. */
16525 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16527 for (align = 7; align >= 0; align--) {
16528 for (len = 36; len; len--) {
16530 memcpy(b, abc, len);
16531 for (off = 1; off <= len; off++) {
16532 memcpy(b+off, b, len);
16533 memcpy(b, b+off, len);
16534 if (memcmp(b, abc, len))
16543 if eval $compile_ok; then
16544 if $run ./try 2>/dev/null; then
16545 echo "Yes, it can."
16548 echo "It can't, sorry."
16551 echo "(I can't compile the test program, so we'll assume not...)"
16561 : can memcmp be trusted to compare relative magnitude?
16563 case "$d_memcmp" in
16566 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16568 #$i_memory I_MEMORY
16569 #$i_stdlib I_STDLIB
16570 #$i_string I_STRING
16571 #$i_unistd I_UNISTD
16573 $cat >>try.c <<'EOCP'
16576 # include <memory.h>
16579 # include <stdlib.h>
16582 # include <string.h>
16584 # include <strings.h>
16587 # include <unistd.h> /* Needed for NetBSD */
16593 if ((a < b) && memcmp(&a, &b, 1) < 0)
16599 if eval $compile_ok; then
16600 if $run ./try 2>/dev/null; then
16601 echo "Yes, it can."
16604 echo "No, it can't (it uses signed chars)."
16607 echo "(I can't compile the test program, so we'll assume not...)"
16615 : see if prototype for sbrk is available
16617 set d_sbrkproto sbrk $i_unistd unistd.h
16620 : see if select exists
16621 set select d_select
16624 : see if semctl exists
16625 set semctl d_semctl
16628 : see if semget exists
16629 set semget d_semget
16632 : see if semop exists
16636 : see how much of the 'sem*(2)' library is present.
16639 case "$d_semctl$d_semget$d_semop" in
16640 *"$undef"*) h_sem=false;;
16644 case "`ipcs 2>&1`" in
16645 "SVID messages"*"not configured"*)
16646 echo "Your $osname does not have the sem*(2) configured." >&4
16649 set semctl d_semctl
16651 set semget d_semget
16659 : we could also check for sys/ipc.h ...
16660 if $h_sem && $test `./findhdr sys/sem.h`; then
16661 echo "You have the full sem*(2) library." >&4
16664 echo "You don't have the full sem*(2) library." >&4
16670 : see whether sys/sem.h defines union semun
16672 $cat > try.c <<'END'
16673 #include <sys/types.h>
16674 #include <sys/ipc.h>
16675 #include <sys/sem.h>
16676 int main () { union semun semun; semun.buf = 0; }
16679 if eval $compile; then
16680 echo "You have union semun in <sys/sem.h>." >&4
16683 echo "You do not have union semun in <sys/sem.h>." >&4
16690 : see how to do semctl IPC_STAT
16694 $cat > tryh.h <<END
16697 # define S_IRUSR S_IREAD
16698 # define S_IWUSR S_IWRITE
16699 # define S_IXUSR S_IEXEC
16701 # define S_IRUSR 0400
16702 # define S_IWUSR 0200
16703 # define S_IXUSR 0100
16705 # define S_IRGRP (S_IRUSR>>3)
16706 # define S_IWGRP (S_IWUSR>>3)
16707 # define S_IXGRP (S_IXUSR>>3)
16708 # define S_IROTH (S_IRUSR>>6)
16709 # define S_IWOTH (S_IWUSR>>6)
16710 # define S_IXOTH (S_IXUSR>>6)
16713 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16714 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16715 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16718 : see whether semctl IPC_STAT can use union semun
16719 case "$d_semctl_semun" in
16723 #include <sys/types.h>
16724 #include <sys/ipc.h>
16725 #include <sys/sem.h>
16726 #include <sys/stat.h>
16733 #$d_union_semun HAS_UNION_SEMUN
16736 #ifndef HAS_UNION_SEMUN
16739 struct semid_ds *buf;
16740 unsigned short *array;
16746 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16747 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16749 struct semid_ds argbuf;
16752 st = semctl(sem, 0, IPC_STAT, arg);
16756 # endif /* IPC_STAT */
16757 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16759 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16760 # endif /* IPC_RMID */
16761 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16763 #endif /* IPC_PRIVATE && ... */
16764 printf("semget failed: errno = %d\n", errno);
16769 if eval $compile; then
16772 semun) val="$define" ;;
16780 case "$d_semctl_semun" in
16782 echo "You can use union semun for semctl IPC_STAT." >&4
16785 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16790 : see whether semctl IPC_STAT can use struct semid_ds pointer
16791 case "$d_semctl_semid_ds" in
16794 $cat > try.c <<'END'
16795 #include <sys/types.h>
16796 #include <sys/ipc.h>
16797 #include <sys/sem.h>
16798 #include <sys/stat.h>
16806 struct semid_ds arg;
16809 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16810 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16813 st = semctl(sem, 0, IPC_STAT, &arg);
16815 printf("semid_ds\n");
16817 # endif /* IPC_STAT */
16818 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16820 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16821 # endif /* IPC_RMID */
16822 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16824 #endif /* IPC_PRIVATE && ... */
16825 printf("semget failed: errno = %d\n", errno);
16831 if eval $compile; then
16834 semid_ds) val="$define" ;;
16838 set d_semctl_semid_ds
16842 case "$d_semctl_semid_ds" in
16844 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16846 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16852 # We do not have the full sem*(2) library, so assume we can not
16858 set d_semctl_semid_ds
16864 : see if sendmsg exists
16865 set sendmsg d_sendmsg
16868 : see if setegid exists
16869 set setegid d_setegid
16872 : see if seteuid exists
16873 set seteuid d_seteuid
16876 : see if setgrent exists
16877 set setgrent d_setgrent
16880 : see if setgrent_r exists
16881 set setgrent_r d_setgrent_r
16883 case "$d_setgrent_r" in
16885 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16886 case "$d_setgrent_r_proto:$usethreads" in
16887 ":define") d_setgrent_r_proto=define
16888 set d_setgrent_r_proto setgrent_r $hdrs
16892 case "$d_setgrent_r_proto" in
16894 case "$setgrent_r_proto" in
16895 ''|0) try='int setgrent_r(FILE**);'
16896 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16898 case "$setgrent_r_proto" in
16899 ''|0) try='void setgrent_r(FILE**);'
16900 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16902 case "$setgrent_r_proto" in
16903 ''|0) d_setgrent_r=undef
16905 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16906 * ) case "$setgrent_r_proto" in
16907 REENTRANT_PROTO*) ;;
16908 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16910 echo "Prototype: $try" ;;
16913 *) case "$usethreads" in
16914 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16921 *) setgrent_r_proto=0
16925 : see if sethostent exists
16926 set sethostent d_sethent
16929 : see if sethostent_r exists
16930 set sethostent_r d_sethostent_r
16932 case "$d_sethostent_r" in
16934 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16935 case "$d_sethostent_r_proto:$usethreads" in
16936 ":define") d_sethostent_r_proto=define
16937 set d_sethostent_r_proto sethostent_r $hdrs
16941 case "$d_sethostent_r_proto" in
16943 case "$sethostent_r_proto" in
16944 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16945 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16947 case "$sethostent_r_proto" in
16948 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16949 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16951 case "$sethostent_r_proto" in
16952 ''|0) d_sethostent_r=undef
16953 sethostent_r_proto=0
16954 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16955 * ) case "$sethostent_r_proto" in
16956 REENTRANT_PROTO*) ;;
16957 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16959 echo "Prototype: $try" ;;
16962 *) case "$usethreads" in
16963 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16965 d_sethostent_r=undef
16966 sethostent_r_proto=0
16970 *) sethostent_r_proto=0
16974 : see if setitimer exists
16975 set setitimer d_setitimer
16978 : see if setlinebuf exists
16979 set setlinebuf d_setlinebuf
16982 : see if setlocale exists
16983 set setlocale d_setlocale
16986 : see if locale.h is available
16987 set locale.h i_locale
16990 : see if setlocale_r exists
16991 set setlocale_r d_setlocale_r
16993 case "$d_setlocale_r" in
16995 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16996 case "$d_setlocale_r_proto:$usethreads" in
16997 ":define") d_setlocale_r_proto=define
16998 set d_setlocale_r_proto setlocale_r $hdrs
17002 case "$d_setlocale_r_proto" in
17004 case "$setlocale_r_proto" in
17005 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17006 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17008 case "$setlocale_r_proto" in
17009 ''|0) d_setlocale_r=undef
17010 setlocale_r_proto=0
17011 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17012 * ) case "$setlocale_r_proto" in
17013 REENTRANT_PROTO*) ;;
17014 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17016 echo "Prototype: $try" ;;
17019 *) case "$usethreads" in
17020 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17022 d_setlocale_r=undef
17023 setlocale_r_proto=0
17027 *) setlocale_r_proto=0
17031 : see if setnetent exists
17032 set setnetent d_setnent
17035 : see if setnetent_r exists
17036 set setnetent_r d_setnetent_r
17038 case "$d_setnetent_r" in
17040 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17041 case "$d_setnetent_r_proto:$usethreads" in
17042 ":define") d_setnetent_r_proto=define
17043 set d_setnetent_r_proto setnetent_r $hdrs
17047 case "$d_setnetent_r_proto" in
17049 case "$setnetent_r_proto" in
17050 ''|0) try='int setnetent_r(int, struct netent_data*);'
17051 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17053 case "$setnetent_r_proto" in
17054 ''|0) try='void setnetent_r(int, struct netent_data*);'
17055 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17057 case "$setnetent_r_proto" in
17058 ''|0) d_setnetent_r=undef
17059 setnetent_r_proto=0
17060 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17061 * ) case "$setnetent_r_proto" in
17062 REENTRANT_PROTO*) ;;
17063 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17065 echo "Prototype: $try" ;;
17068 *) case "$usethreads" in
17069 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17071 d_setnetent_r=undef
17072 setnetent_r_proto=0
17076 *) setnetent_r_proto=0
17080 : see if setprotoent exists
17081 set setprotoent d_setpent
17084 : see if setpgid exists
17085 set setpgid d_setpgid
17088 : see if setpgrp2 exists
17089 set setpgrp2 d_setpgrp2
17092 : see if setpriority exists
17093 set setpriority d_setprior
17096 : see if setproctitle exists
17097 set setproctitle d_setproctitle
17100 : see if setprotoent_r exists
17101 set setprotoent_r d_setprotoent_r
17103 case "$d_setprotoent_r" in
17105 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17106 case "$d_setprotoent_r_proto:$usethreads" in
17107 ":define") d_setprotoent_r_proto=define
17108 set d_setprotoent_r_proto setprotoent_r $hdrs
17112 case "$d_setprotoent_r_proto" in
17114 case "$setprotoent_r_proto" in
17115 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17116 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17118 case "$setprotoent_r_proto" in
17119 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17120 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17122 case "$setprotoent_r_proto" in
17123 ''|0) d_setprotoent_r=undef
17124 setprotoent_r_proto=0
17125 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17126 * ) case "$setprotoent_r_proto" in
17127 REENTRANT_PROTO*) ;;
17128 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17130 echo "Prototype: $try" ;;
17133 *) case "$usethreads" in
17134 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17136 d_setprotoent_r=undef
17137 setprotoent_r_proto=0
17141 *) setprotoent_r_proto=0
17145 : see if setpwent exists
17146 set setpwent d_setpwent
17149 : see if setpwent_r exists
17150 set setpwent_r d_setpwent_r
17152 case "$d_setpwent_r" in
17154 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17155 case "$d_setpwent_r_proto:$usethreads" in
17156 ":define") d_setpwent_r_proto=define
17157 set d_setpwent_r_proto setpwent_r $hdrs
17161 case "$d_setpwent_r_proto" in
17163 case "$setpwent_r_proto" in
17164 ''|0) try='int setpwent_r(FILE**);'
17165 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17167 case "$setpwent_r_proto" in
17168 ''|0) try='void setpwent_r(FILE**);'
17169 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17171 case "$setpwent_r_proto" in
17172 ''|0) d_setpwent_r=undef
17174 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17175 * ) case "$setpwent_r_proto" in
17176 REENTRANT_PROTO*) ;;
17177 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17179 echo "Prototype: $try" ;;
17182 *) case "$usethreads" in
17183 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17190 *) setpwent_r_proto=0
17194 : see if setregid exists
17195 set setregid d_setregid
17197 set setresgid d_setresgid
17200 : see if setreuid exists
17201 set setreuid d_setreuid
17203 set setresuid d_setresuid
17206 : see if setrgid exists
17207 set setrgid d_setrgid
17210 : see if setruid exists
17211 set setruid d_setruid
17214 : see if setservent exists
17215 set setservent d_setsent
17218 : see if setservent_r exists
17219 set setservent_r d_setservent_r
17221 case "$d_setservent_r" in
17223 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17224 case "$d_setservent_r_proto:$usethreads" in
17225 ":define") d_setservent_r_proto=define
17226 set d_setservent_r_proto setservent_r $hdrs
17230 case "$d_setservent_r_proto" in
17232 case "$setservent_r_proto" in
17233 ''|0) try='int setservent_r(int, struct servent_data*);'
17234 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17236 case "$setservent_r_proto" in
17237 ''|0) try='void setservent_r(int, struct servent_data*);'
17238 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17240 case "$setservent_r_proto" in
17241 ''|0) d_setservent_r=undef
17242 setservent_r_proto=0
17243 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17244 * ) case "$setservent_r_proto" in
17245 REENTRANT_PROTO*) ;;
17246 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17248 echo "Prototype: $try" ;;
17251 *) case "$usethreads" in
17252 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17254 d_setservent_r=undef
17255 setservent_r_proto=0
17259 *) setservent_r_proto=0
17263 : see if setsid exists
17264 set setsid d_setsid
17267 : see if setvbuf exists
17268 set setvbuf d_setvbuf
17271 : see if sfio.h is available
17275 : see if sfio library is available
17286 : Ok, but do we want to use it.
17290 true|$define|[yY]*) dflt='y';;
17293 echo "$package can use the sfio library, but it is experimental."
17294 rp="You seem to have sfio available, do you want to try using it?"
17297 y|Y) echo "Ok, turning on sfio then."
17300 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17305 *) case "$usesfio" in
17306 true|$define|[yY]*)
17307 echo "Sorry, cannot find sfio on this machine." >&4
17308 echo "Ignoring your setting of usesfio=$usesfio." >&4
17317 $define) usesfio='true';;
17318 *) usesfio='false';;
17322 *) : Remove sfio from list of libraries to use
17325 echo "Removing unneeded -lsfio from library list" >&4
17326 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17329 echo "libs = $libs" >&4
17336 : see if shmctl exists
17337 set shmctl d_shmctl
17340 : see if shmget exists
17341 set shmget d_shmget
17344 : see if shmat exists
17347 : see what shmat returns
17350 $cat >shmat.c <<'END'
17351 #include <sys/shm.h>
17354 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17359 echo "and it returns ($shmattype)." >&4
17360 : see if a prototype for shmat is available
17361 xxx=`./findhdr sys/shm.h`
17362 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17363 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17374 set d_shmatprototype
17377 : see if shmdt exists
17381 : see how much of the 'shm*(2)' library is present.
17384 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17385 *"$undef"*) h_shm=false;;
17389 case "`ipcs 2>&1`" in
17390 "SVID shared memory"*"not configured"*)
17391 echo "Your $osname does not have the shm*(2) configured." >&4
17394 set shmctl d_shmctl
17396 set shmget d_shmget
17406 : we could also check for sys/ipc.h ...
17407 if $h_shm && $test `./findhdr sys/shm.h`; then
17408 echo "You have the full shm*(2) library." >&4
17411 echo "You don't have the full shm*(2) library." >&4
17417 : see if we have sigaction
17419 if set sigaction val -f d_sigaction; eval $csym; $val; then
17420 echo 'sigaction() found.' >&4
17423 #include <sys/types.h>
17424 #include <signal.h>
17425 #$i_stdlib I_STDLIB
17427 #include <stdlib.h>
17431 struct sigaction act, oact;
17433 oact.sa_handler = 0;
17434 /* so that act and oact are used */
17435 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17439 if eval $compile_ok; then
17442 echo "But you don't seem to have a useable struct sigaction." >&4
17446 echo 'sigaction NOT found.' >&4
17449 set d_sigaction; eval $setvar
17452 : see if this is a sunmath.h system
17453 set sunmath.h i_sunmath
17456 : see if signbit exists
17457 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17460 #$i_sunmath I_SUNMATH
17464 #ifdef I_SUNMATH /* Solaris special math library */
17465 # include <sunmath.h>
17468 int main(int argc, char **argv)
17472 if ((signbit(x) == 0) && (signbit(y) != 0))
17480 if eval $compile; then
17481 if $run ./try; then
17485 $echo "Signbit seems to be available, but doesn't work as I expected."
17486 $echo "I won't use it." >&4
17497 : see if sigprocmask exists
17498 set sigprocmask d_sigprocmask
17501 : see if sigsetjmp exists
17503 case "$d_sigsetjmp" in
17506 #include <setjmp.h>
17507 #$i_stdlib I_STDLIB
17509 #include <stdlib.h>
17515 if (sigsetjmp(env,1))
17518 siglongjmp(env, 1);
17523 if eval $compile; then
17524 if $run ./try >/dev/null 2>&1; then
17525 echo "POSIX sigsetjmp found." >&4
17529 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17535 echo "sigsetjmp not found." >&4
17539 *) val="$d_sigsetjmp"
17540 case "$d_sigsetjmp" in
17541 $define) echo "POSIX sigsetjmp found." >&4;;
17542 $undef) echo "sigsetjmp not found." >&4;;
17550 : see if snprintf exists
17551 set snprintf d_snprintf
17554 : see if vsnprintf exists
17555 set vsnprintf d_vsnprintf
17558 case "$d_snprintf-$d_vsnprintf" in
17561 Checking whether your snprintf() and vsnprintf() work okay...
17563 $cat >try.c <<'EOCP'
17564 /* v?snprintf testing logic courtesy of Russ Allbery.
17565 * According to C99:
17566 * - if the buffer is too short it still must be \0-terminated
17567 * - if the buffer is too short the potentially required length
17568 * must be returned and not -1
17569 * - if the buffer is NULL the potentially required length
17570 * must be returned and not -1 or core dump
17573 #include <stdarg.h>
17577 int test (char *format, ...)
17582 va_start (args, format);
17583 count = vsnprintf (buf, sizeof buf, format, args);
17590 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17591 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17595 if eval $compile; then
17598 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17600 Your snprintf() and snprintf() don't seem to be working okay.
17602 d_snprintf="$undef"
17603 d_vsnprintf="$undef"
17607 echo "(I can't seem to compile the test program--assuming they don't)"
17608 d_snprintf="$undef"
17609 d_vsnprintf="$undef"
17615 : see if sockatmark exists
17616 set sockatmark d_sockatmark
17619 : see if prototype for sockatmark is available
17621 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17624 : see if socks5_init exists
17625 set socks5_init d_socks5_init
17628 : see if sprintf returns the length of the string in the buffer as per ANSI
17629 $echo "Checking whether sprintf returns the length of the string..." >&4
17632 #$i_stdlib I_STDLIB
17634 #include <stdlib.h>
17636 #$i_string I_STRING
17638 # include <string.h>
17640 # include <strings.h>
17649 int check (size_t expect, int test) {
17650 size_t got = strlen(buffer);
17654 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17659 int main(int argc, char **argv) {
17662 check(sprintf(buffer, ""), ++test);
17663 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17664 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17671 if eval $compile; then
17675 sprintf returns the length of the string (as ANSI says it should)
17677 d_sprintf_returns_strlen="$define"
17680 sprintf does not return the length of the string (how old is this system?)
17682 d_sprintf_returns_strlen="$undef"
17686 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17687 d_sprintf_returns_strlen="$undef"
17691 : see if srand48_r exists
17692 set srand48_r d_srand48_r
17694 case "$d_srand48_r" in
17696 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17697 case "$d_srand48_r_proto:$usethreads" in
17698 ":define") d_srand48_r_proto=define
17699 set d_srand48_r_proto srand48_r $hdrs
17703 case "$d_srand48_r_proto" in
17705 case "$srand48_r_proto" in
17706 ''|0) try='int srand48_r(long, struct drand48_data*);'
17707 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17709 case "$srand48_r_proto" in
17710 ''|0) d_srand48_r=undef
17712 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17713 * ) case "$srand48_r_proto" in
17714 REENTRANT_PROTO*) ;;
17715 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17717 echo "Prototype: $try" ;;
17720 *) case "$usethreads" in
17721 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17728 *) srand48_r_proto=0
17732 : see if srandom_r exists
17733 set srandom_r d_srandom_r
17735 case "$d_srandom_r" in
17737 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17738 case "$d_srandom_r_proto:$usethreads" in
17739 ":define") d_srandom_r_proto=define
17740 set d_srandom_r_proto srandom_r $hdrs
17744 case "$d_srandom_r_proto" in
17746 case "$srandom_r_proto" in
17747 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17748 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17750 case "$srandom_r_proto" in
17751 ''|0) d_srandom_r=undef
17753 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17754 * ) case "$srandom_r_proto" in
17755 REENTRANT_PROTO*) ;;
17756 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17758 echo "Prototype: $try" ;;
17761 *) case "$usethreads" in
17762 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17769 *) srandom_r_proto=0
17773 : see if prototype for setresgid is available
17775 set d_sresgproto setresgid $i_unistd unistd.h
17778 : see if prototype for setresuid is available
17780 set d_sresuproto setresuid $i_unistd unistd.h
17783 : see if sys/stat.h is available
17784 set sys/stat.h i_sysstat
17787 : see if stat knows about block sizes
17789 echo "Checking to see if your struct stat has st_blocks field..." >&4
17790 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17793 : see if this is a sys/vfs.h system
17794 set sys/vfs.h i_sysvfs
17797 : see if this is a sys/statfs.h system
17798 set sys/statfs.h i_sysstatfs
17801 : Check for statfs_s
17803 echo "Checking to see if your system supports struct statfs..." >&4
17804 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
17806 case "$d_statfs_s" in
17807 "$define") echo "Yes, it does." ;;
17808 *) echo "No, it doesn't." ;;
17812 : see if struct statfs knows about f_flags
17813 case "$d_statfs_s" in
17816 echo "Checking to see if your struct statfs has f_flags field..." >&4
17817 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
17821 set d_statfs_f_flags
17825 case "$d_statfs_f_flags" in
17826 "$define") echo "Yes, it does." ;;
17827 *) echo "No, it doesn't." ;;
17830 : see what flavor, if any, of static inline is supported
17832 echo "Checking to see if your system supports static inline..."
17833 $cat > try.c <<'EOCP'
17834 #include <stdlib.h>
17835 extern int f_via_a(int x);
17836 extern int f_via_b(int x);
17837 int main(int argc, char **argv)
17846 return EXIT_SUCCESS;
17849 return EXIT_FAILURE;
17853 $cat > a.c <<'EOCP'
17854 static INLINE int f(int x) {
17865 $cat > b.c <<'EOCP'
17866 extern int f(int x);
17874 # Respect a hint (or previous) value for perl_static_inline, if there is one.
17875 case "$perl_static_inline" in
17876 '') # Check the various possibilities, and break out on success.
17877 # For gcc, prefer __inline__, which will still permit
17878 # cflags.SH to add in -ansi.
17879 case "$gccversion" in
17880 '') xxx="inline __inline__ __inline _inline";;
17881 *) xxx="__inline__ inline __inline _inline";;
17883 for inline in $xxx; do
17884 set try -DINLINE=$inline a.c
17885 if eval $compile && $run ./try; then
17886 # Now make sure there is no external linkage of static
17888 set try -DINLINE=$inline -DUSE_B a.c b.c
17889 if eval $compile && $run ./try; then
17890 $echo "Your compiler supports static $inline, " >&4
17891 $echo "but it also creates an external definition," >&4
17892 $echo "so I won't use it." >&4
17895 $echo "Your compiler supports static $inline." >&4
17897 perl_static_inline="static $inline";
17901 $echo "Your compiler does NOT support static $inline." >&4
17906 *inline*) # Some variant of inline exists.
17907 echo "Keeping your $hint value of $perl_static_inline."
17910 static) # No inline capabilities
17911 echo "Keeping your $hint value of $perl_static_inline."
17914 *) # Unrecognized previous value -- blindly trust the supplied
17915 # value and hope it makes sense. Use old value for
17916 # d_static_inline, if there is one.
17917 echo "Keeping your $hint value of $perl_static_inline."
17918 case "$d_static_inline" in
17920 *) val=$d_static_inline ;;
17924 # Fallback to plain 'static' if nothing worked.
17925 case "$perl_static_inline" in
17927 perl_static_inline="static"
17931 set d_static_inline
17933 $rm -f a.[co] b.[co]
17936 : Check stream access
17938 Checking how to access stdio streams by file descriptor number...
17940 case "$stdio_stream_array" in
17941 '') $cat >try.c <<EOCP
17944 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17948 for s in _iob __iob __sF
17950 set try -DSTDIO_STREAM_ARRAY=$s
17951 if eval $compile; then
17952 case "`$run ./try`" in
17953 yes) stdio_stream_array=$s; break ;;
17959 case "$stdio_stream_array" in
17961 I can't figure out how to access stdio streams by file descriptor number.
17963 d_stdio_stream_array="$undef"
17966 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17968 d_stdio_stream_array="$define"
17972 : see if strcoll exists
17973 set strcoll d_strcoll
17976 : check for structure copying
17978 echo "Checking to see if your C compiler can copy structs..." >&4
17979 $cat >try.c <<'EOCP'
17989 if $cc -c try.c >/dev/null 2>&1 ; then
17991 echo "Yup, it can."
17994 echo "Nope, it can't."
18000 : see if strerror and/or sys_errlist[] exist
18002 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18003 if set strerror val -f d_strerror; eval $csym; $val; then
18004 echo 'strerror() found.' >&4
18005 d_strerror="$define"
18006 d_strerrm='strerror(e)'
18007 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18008 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18009 d_syserrlst="$define"
18011 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
18012 d_syserrlst="$undef"
18014 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18015 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18016 echo 'strerror() found in string header.' >&4
18017 d_strerror="$define"
18018 d_strerrm='strerror(e)'
18019 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18020 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18021 d_syserrlst="$define"
18023 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18024 d_syserrlst="$undef"
18026 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18027 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18028 d_strerror="$undef"
18029 d_syserrlst="$define"
18030 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18032 echo 'strerror() and sys_errlist[] NOT found.' >&4
18033 d_strerror="$undef"
18034 d_syserrlst="$undef"
18035 d_strerrm='"unknown"'
18039 : see if strerror_r exists
18040 set strerror_r d_strerror_r
18042 case "$d_strerror_r" in
18044 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18045 case "$d_strerror_r_proto:$usethreads" in
18046 ":define") d_strerror_r_proto=define
18047 set d_strerror_r_proto strerror_r $hdrs
18051 case "$d_strerror_r_proto" in
18053 case "$strerror_r_proto" in
18054 ''|0) try='int strerror_r(int, char*, size_t);'
18055 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18057 case "$strerror_r_proto" in
18058 ''|0) try='int strerror_r(int, char*, int);'
18059 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18061 case "$strerror_r_proto" in
18062 ''|0) try='char* strerror_r(int, char*, size_t);'
18063 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18065 case "$strerror_r_proto" in
18066 ''|0) d_strerror_r=undef
18068 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18069 * ) case "$strerror_r_proto" in
18070 REENTRANT_PROTO*) ;;
18071 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18073 echo "Prototype: $try" ;;
18076 *) case "$usethreads" in
18077 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18084 *) strerror_r_proto=0
18088 : see if strftime exists
18089 set strftime d_strftime
18092 : see if strlcat exists
18093 set strlcat d_strlcat
18096 : see if strlcpy exists
18097 set strlcpy d_strlcpy
18100 : see if strtod exists
18101 set strtod d_strtod
18104 : see if strtol exists
18105 set strtol d_strtol
18108 : see if strtold exists
18109 set strtold d_strtold
18112 : see if strtoll exists
18113 set strtoll d_strtoll
18116 case "$d_longlong-$d_strtoll" in
18119 Checking whether your strtoll() works okay...
18121 $cat >try.c <<'EOCP'
18124 #define strtoll __strtoll
18127 #define strtoll _strtoll
18130 extern long long int strtoll(char *s, char **, int);
18131 static int bad = 0;
18132 int check(char *s, long long ell, int een) {
18135 gll = strtoll(s, 0, 10);
18136 if (!((gll == ell) && (errno == een)))
18140 check(" 1", 1LL, 0);
18141 check(" 0", 0LL, 0);
18142 check("-1", -1LL, 0);
18143 check("-9223372036854775808", -9223372036854775808LL, 0);
18144 check("-9223372036854775808", -9223372036854775808LL, 0);
18145 check(" 9223372036854775807", 9223372036854775807LL, 0);
18146 check("-9223372036854775808", -9223372036854775808LL, 0);
18147 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18148 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18154 if eval $compile; then
18157 ok) echo "Your strtoll() seems to be working okay." ;;
18159 Your strtoll() doesn't seem to be working okay.
18165 echo "(I can't seem to compile the test program--assuming it doesn't)"
18171 : see if strtoq exists
18172 set strtoq d_strtoq
18175 : see if strtoul exists
18176 set strtoul d_strtoul
18179 case "$d_strtoul" in
18182 Checking whether your strtoul() works okay...
18184 $cat >try.c <<'EOCP'
18187 extern unsigned long int strtoul(char *s, char **, int);
18188 static int bad = 0;
18189 void check(char *s, unsigned long eul, int een) {
18192 gul = strtoul(s, 0, 10);
18193 if (!((gul == eul) && (errno == een)))
18197 check(" 1", 1L, 0);
18198 check(" 0", 0L, 0);
18200 case "$longsize" in
18202 $cat >>try.c <<'EOCP'
18203 check("18446744073709551615", 18446744073709551615UL, 0);
18204 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18205 #if 0 /* strtoul() for /^-/ strings is undefined. */
18206 check("-1", 18446744073709551615UL, 0);
18207 check("-18446744073709551614", 2, 0);
18208 check("-18446744073709551615", 1, 0);
18209 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18210 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18215 $cat >>try.c <<'EOCP'
18216 check("4294967295", 4294967295UL, 0);
18217 check("4294967296", 4294967295UL, ERANGE);
18218 #if 0 /* strtoul() for /^-/ strings is undefined. */
18219 check("-1", 4294967295UL, 0);
18220 check("-4294967294", 2, 0);
18221 check("-4294967295", 1, 0);
18222 check("-4294967296", 4294967295UL, ERANGE);
18223 check("-4294967297", 4294967295UL, ERANGE);
18228 : Should we write these tests to be more portable by sprintf-ing
18229 : ~0 and then manipulating that char string as input for strtol?
18232 $cat >>try.c <<'EOCP'
18239 if eval $compile; then
18240 case "`$run ./try`" in
18241 ok) echo "Your strtoul() seems to be working okay." ;;
18243 Your strtoul() doesn't seem to be working okay.
18249 echo "(I can't seem to compile the test program--assuming it doesn't)"
18255 : see if strtoull exists
18256 set strtoull d_strtoull
18259 case "$d_longlong-$d_strtoull" in
18262 Checking whether your strtoull() works okay...
18264 $cat >try.c <<'EOCP'
18267 #define strtoull __strtoull
18270 extern unsigned long long int strtoull(char *s, char **, int);
18271 static int bad = 0;
18272 int check(char *s, long long eull, int een) {
18275 gull = strtoull(s, 0, 10);
18276 if (!((gull == eull) && (errno == een)))
18280 check(" 1", 1LL, 0);
18281 check(" 0", 0LL, 0);
18282 check("18446744073709551615", 18446744073709551615ULL, 0);
18283 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18284 #if 0 /* strtoull() for /^-/ strings is undefined. */
18285 check("-1", 18446744073709551615ULL, 0);
18286 check("-18446744073709551614", 2LL, 0);
18287 check("-18446744073709551615", 1LL, 0);
18288 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18289 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18296 if eval $compile; then
18297 case "`$run ./try`" in
18298 ok) echo "Your strtoull() seems to be working okay." ;;
18300 Your strtoull() doesn't seem to be working okay.
18302 d_strtoull="$undef"
18306 echo "(I can't seem to compile the test program--assuming it doesn't)"
18307 d_strtoull="$undef"
18312 : see if strtouq exists
18313 set strtouq d_strtouq
18316 case "$d_strtouq" in
18319 Checking whether your strtouq() works okay...
18321 $cat >try.c <<'EOCP'
18324 extern unsigned long long int strtouq(char *s, char **, int);
18325 static int bad = 0;
18326 void check(char *s, unsigned long long eull, int een) {
18327 unsigned long long gull;
18329 gull = strtouq(s, 0, 10);
18330 if (!((gull == eull) && (errno == een)))
18334 check(" 1", 1LL, 0);
18335 check(" 0", 0LL, 0);
18336 check("18446744073709551615", 18446744073709551615ULL, 0);
18337 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18338 #if 0 /* strtouq() for /^-/ strings is undefined. */
18339 check("-1", 18446744073709551615ULL, 0);
18340 check("-18446744073709551614", 2LL, 0);
18341 check("-18446744073709551615", 1LL, 0);
18342 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18343 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18351 if eval $compile; then
18352 case "`$run ./try`" in
18353 ok) echo "Your strtouq() seems to be working okay." ;;
18355 Your strtouq() doesn't seem to be working okay.
18361 echo "(I can't seem to compile the test program--assuming it doesn't)"
18367 : see if strxfrm exists
18368 set strxfrm d_strxfrm
18371 : see if symlink exists
18372 set symlink d_symlink
18375 : see if syscall exists
18376 set syscall d_syscall
18379 : see if prototype for syscall is available
18381 set d_syscallproto syscall $i_unistd unistd.h
18384 : see if sysconf exists
18385 set sysconf d_sysconf
18388 : see if system exists
18389 set system d_system
18392 : see if tcgetpgrp exists
18393 set tcgetpgrp d_tcgetpgrp
18396 : see if tcsetpgrp exists
18397 set tcsetpgrp d_tcsetpgrp
18400 : see if prototype for telldir is available
18402 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18405 : see if time exists
18407 if test "X$d_time" = X -o X"$timetype" = X; then
18408 if set time val -f d_time; eval $csym; $val; then
18409 echo 'time() found.' >&4
18411 rp="What is the type returned by time() on this system?"
18412 set time_t timetype long stdio.h sys/types.h
18415 echo 'time() not found, hope that will do.' >&4
18423 : see if timegm exists
18424 set timegm d_timegm
18427 : see if this is a sys/times.h system
18428 set sys/times.h i_systimes
18431 : see if times exists
18433 if set times val -f d_times; eval $csym; $val; then
18434 echo 'times() found.' >&4
18437 case "$i_systimes" in
18438 "$define") inc='sys/times.h';;
18440 rp="What is the type returned by times() on this system?"
18441 set clock_t clocktype long stdio.h sys/types.h $inc
18444 echo 'times() NOT found, hope that will do.' >&4
18449 : see if tmpnam_r exists
18450 set tmpnam_r d_tmpnam_r
18452 case "$d_tmpnam_r" in
18454 hdrs="$i_systypes sys/types.h define stdio.h "
18455 case "$d_tmpnam_r_proto:$usethreads" in
18456 ":define") d_tmpnam_r_proto=define
18457 set d_tmpnam_r_proto tmpnam_r $hdrs
18461 case "$d_tmpnam_r_proto" in
18463 case "$tmpnam_r_proto" in
18464 ''|0) try='char* tmpnam_r(char*);'
18465 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18467 case "$tmpnam_r_proto" in
18468 ''|0) d_tmpnam_r=undef
18470 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18471 * ) case "$tmpnam_r_proto" in
18472 REENTRANT_PROTO*) ;;
18473 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18475 echo "Prototype: $try" ;;
18478 *) case "$usethreads" in
18479 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18486 *) tmpnam_r_proto=0
18490 : see if truncate exists
18491 set truncate d_truncate
18494 : see if ttyname_r exists
18495 set ttyname_r d_ttyname_r
18497 case "$d_ttyname_r" in
18499 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18500 case "$d_ttyname_r_proto:$usethreads" in
18501 ":define") d_ttyname_r_proto=define
18502 set d_ttyname_r_proto ttyname_r $hdrs
18506 case "$d_ttyname_r_proto" in
18508 case "$ttyname_r_proto" in
18509 ''|0) try='int ttyname_r(int, char*, size_t);'
18510 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18512 case "$ttyname_r_proto" in
18513 ''|0) try='int ttyname_r(int, char*, int);'
18514 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18516 case "$ttyname_r_proto" in
18517 ''|0) try='char* ttyname_r(int, char*, int);'
18518 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18520 case "$ttyname_r_proto" in
18521 ''|0) d_ttyname_r=undef
18523 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18524 * ) case "$ttyname_r_proto" in
18525 REENTRANT_PROTO*) ;;
18526 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18528 echo "Prototype: $try" ;;
18531 *) case "$usethreads" in
18532 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18539 *) ttyname_r_proto=0
18543 : see if tzname[] exists
18545 if set tzname val -a d_tzname; eval $csym; $val; then
18547 echo 'tzname[] found.' >&4
18550 echo 'tzname[] NOT found.' >&4
18555 : Check if is a multiplatform env
18557 next|rhapsody|darwin) multiarch="$define" ;;
18559 case "$multiarch" in
18560 ''|[nN]*) multiarch="$undef" ;;
18563 : check for ordering of bytes in a UV
18565 case "$usecrosscompile$multiarch" in
18568 You seem to be either cross-compiling or doing a multiarchitecture build,
18569 skipping the byteorder check.
18575 case "$byteorder" in
18578 In the following, larger digits indicate more significance. A big-endian
18579 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18580 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18581 machines may have weird orders like 3412. A Cray will report 87654321,
18582 an Alpha will report 12345678. If the test program works the default is
18584 I'm now running the test program...
18588 #$i_stdlib I_STDLIB
18590 #include <stdlib.h>
18592 #include <sys/types.h>
18593 typedef $uvtype UV;
18603 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18605 u.l = (UV)0x04030201;
18606 for (i = 0; i < $uvsize; i++)
18607 printf("%c", u.c[i]+'0');
18614 if eval $compile && $run ./try > /dev/null; then
18617 [1-4][1-4][1-4][1-4]|12345678|87654321)
18618 echo "(The test program ran ok.)"
18619 echo "byteorder=$dflt"
18622 ????|????????) echo "(The test program ran ok.)" ;;
18623 *) echo "(The test program didn't run right for some reason.)" ;;
18628 (I can't seem to compile the test program. Guessing big-endian...)
18631 case "$xxx_prompt" in
18633 rp="What is the order of bytes in $uvtype?"
18646 : Checking 32bit alignedness
18649 Checking to see whether you can access character data unalignedly...
18651 case "$d_u32align" in
18652 '') $cat >try.c <<EOCP
18654 #$i_stdlib I_STDLIB
18656 #include <stdlib.h>
18658 #define U32 $u32type
18659 #define BYTEORDER 0x$byteorder
18661 #include <signal.h>
18663 $signal_t bletch(int s) { exit(4); }
18666 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18667 volatile U8 buf[8];
18671 if (sizeof(U32) != 4) {
18672 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18679 signal(SIGBUS, bletch);
18691 for (i = 0; i < 4; i++) {
18692 up = (U32*)(buf + i);
18693 if (! ((*up == 1 << (8*i)) || /* big-endian */
18694 (*up == 1 << (8*(3-i))) /* little-endian */
18698 printf("read failed (%x)\n", *up);
18704 for (i = 0; i < 4; i++) {
18705 up = (U32*)(buf + i);
18707 if (*up != 0xBeef) {
18708 printf("write failed (%x)\n", *up);
18722 if eval $compile_ok; then
18723 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18724 $run ./try 2>&1 >/dev/null
18727 You can access character data pretty unalignedly.
18729 d_u32align="$undef"
18732 It seems that you must access character data in an aligned manner.
18734 d_u32align="$define"
18738 rp='Can you access character data at unaligned addresses?'
18742 [yY]*) d_u32align="$undef" ;;
18743 *) d_u32align="$define" ;;
18750 : see if ualarm exists
18751 set ualarm d_ualarm
18754 : see if umask exists
18758 : see if unordered exists
18759 set unordered d_unordered
18762 : see if unsetenv exists
18763 set unsetenv d_unsetenv
18766 : see if usleep exists
18767 set usleep d_usleep
18770 : see if prototype for usleep is available
18772 set d_usleepproto usleep $i_unistd unistd.h
18775 : see if ustat exists
18779 : see if closedir exists
18780 set closedir d_closedir
18783 case "$d_closedir" in
18786 echo "Checking whether closedir() returns a status..." >&4
18788 #$i_dirent I_DIRENT /**/
18789 #$i_sysdir I_SYS_DIR /**/
18790 #$i_sysndir I_SYS_NDIR /**/
18791 #$i_systypes I_SYS_TYPES /**/
18793 #if defined(I_SYS_TYPES)
18794 #include <sys/types.h>
18796 #if defined(I_DIRENT)
18797 #include <dirent.h>
18798 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18799 #include <sys/dir.h>
18803 #include <sys/ndir.h>
18807 #include <ndir.h> /* may be wrong in the future */
18809 #include <sys/dir.h>
18814 int main() { return closedir(opendir(".")); }
18817 if eval $compile_ok; then
18818 if $run ./try > /dev/null 2>&1 ; then
18819 echo "Yes, it does."
18822 echo "No, it doesn't."
18826 echo "(I can't seem to compile the test program--assuming it doesn't)"
18834 set d_void_closedir
18838 : see if there is a wait4
18842 : see if waitpid exists
18843 set waitpid d_waitpid
18846 : see if wcstombs exists
18847 set wcstombs d_wcstombs
18850 : see if wctomb exists
18851 set wctomb d_wctomb
18854 : see if writev exists
18855 set writev d_writev
18858 : preserve RCS keywords in files with variable substitution, grrr
18863 Revision='$Revision'
18865 : check for alignment requirements
18867 case "$usecrosscompile$multiarch" in
18870 You seem to be either cross-compiling or doing a multiarchitecture build,
18871 skipping the memory alignment check.
18874 case "$alignbytes" in
18875 '') alignbytes=8 ;;
18879 case "$alignbytes" in
18880 '') echo "Checking alignment constraints..." >&4
18881 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18882 $cat >try.c <<'EOCP'
18883 typedef long double NV;
18886 $cat >try.c <<'EOCP'
18890 $cat >>try.c <<'EOCP'
18898 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18903 if eval $compile_ok; then
18907 echo "(I can't seem to compile the test program...)"
18910 *) dflt="$alignbytes"
18913 rp="Doubles must be aligned on a how-many-byte boundary?"
18921 : set the base revision
18924 : length of character in bytes. Is always 1, otherwise it isnt C
18925 : This used to be a test using sizeof
18928 : Check for the number of bits in a character
18929 case "$charbits" in
18930 '') echo "Checking how long a character is (in bits)..." >&4
18937 for (c = 1, n = 0; c; c <<= 1, n++) ;
18938 printf ("%d\n", n);
18943 if eval $compile_ok; then
18947 echo "(I can't seem to compile the test program. Guessing...)"
18954 rp="What is the length of a character (in bits)?"
18958 case "$charbits" in
18961 Your system has an unsigned character size of $charbits bits, which
18962 is rather unusual (normally it is 8 bits). Perl likely will not work
18963 correctly on your system, with subtle bugs in various places.
18965 rp='Do you really want to continue?'
18969 [yY]) echo >&4 "Okay, continuing." ;;
18974 : how do we concatenate cpp tokens here?
18976 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18977 $cat >cpp_stuff.c <<'EOCP'
18978 #define RCAT(a,b)a/**/b
18979 #define ACAT(a,b)a ## b
18983 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18984 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18985 echo "Oh! Smells like ANSI's been here." >&4
18986 echo "We can catify or stringify, separately or together!"
18988 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18989 echo "Ah, yes! The good old days!" >&4
18990 echo "However, in the good old days we don't know how to stringify and"
18991 echo "catify at the same time."
18995 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18996 You're going to have to edit the values of CAT[2-5] in config.h...
18998 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19002 : see if this is a db.h system
19008 : Check db version.
19010 echo "Checking Berkeley DB version ..." >&4
19016 #include <sys/types.h>
19018 #$i_stdlib I_STDLIB
19020 #include <stdlib.h>
19023 int main(int argc, char *argv[])
19025 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19026 int Major, Minor, Patch ;
19027 unsigned long Version ;
19028 (void)db_version(&Major, &Minor, &Patch) ;
19030 printf("%d %d %d %d %d %d\n",
19031 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19032 Major, Minor, Patch);
19035 printf("You have Berkeley DB Version 2 or greater.\n");
19037 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19038 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19039 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19040 Major, Minor, Patch) ;
19042 /* check that db.h & libdb are compatible */
19043 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19044 printf("db.h and libdb are incompatible.\n") ;
19048 printf("db.h and libdb are compatible.\n") ;
19050 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19051 + DB_VERSION_PATCH ;
19053 /* needs to be >= 2.3.4 */
19054 if (Version < 2003004) {
19055 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19056 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19062 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19067 printf("You have Berkeley DB Version 1.\n");
19068 exit(0); /* DB version < 2: the coast is clear. */
19070 exit(1); /* <db.h> not Berkeley DB? */
19076 if eval $compile_ok && $run ./try; then
19077 echo 'Looks OK.' >&4
19079 db_version_major=$1
19080 db_version_minor=$2
19081 db_version_patch=$3
19083 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19087 : Remove db from list of libraries to use
19088 echo "Removing unusable -ldb from library list" >&4
19089 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19092 echo "libs = $libs" >&4
19102 : Check the return type needed for hash
19104 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19110 #include <sys/types.h>
19113 #ifndef DB_VERSION_MAJOR
19114 u_int32_t hash_cb (ptr, size)
19122 info.hash = hash_cb;
19126 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19127 if $contains warning try.out >>/dev/null 2>&1 ; then
19130 db_hashtype='u_int32_t'
19133 : XXX Maybe we should just give up here.
19134 db_hashtype=u_int32_t
19136 echo "Help: I can't seem to compile the db test program." >&4
19137 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19140 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19142 *) db_hashtype=u_int32_t
19147 : Check the return type needed for prefix
19149 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19155 #include <sys/types.h>
19158 #ifndef DB_VERSION_MAJOR
19159 size_t prefix_cb (key1, key2)
19167 info.prefix = prefix_cb;
19171 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19172 if $contains warning try.out >>/dev/null 2>&1 ; then
19173 db_prefixtype='int'
19175 db_prefixtype='size_t'
19178 db_prefixtype='size_t'
19179 : XXX Maybe we should just give up here.
19181 echo "Help: I can't seem to compile the db test program." >&4
19182 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19185 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19187 *) db_prefixtype='size_t'
19191 : How can we generate normalized random numbers ?
19193 echo "Looking for a random number function..." >&4
19194 case "$randfunc" in
19196 if set drand48 val -f; eval $csym; $val; then
19198 echo "Good, found drand48()." >&4
19199 elif set random val -f; eval $csym; $val; then
19201 echo "OK, found random()." >&4
19204 echo "Yick, looks like I have to use rand()." >&4
19215 *-Dmy_rand=*|*-Dmy_srand=*)
19216 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19217 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19218 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19219 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19223 while $test "$cont"; do
19224 rp="Use which function to generate random numbers?"
19226 if $test "$ans" = "$dflt"; then
19232 if set $ans val -f; eval $csym; $val; then
19236 rp="I cannot find function $ans. Use that name anyway?"
19245 case "$randfunc" in
19247 drand01="drand48()"
19253 case "$randbits" in
19255 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19257 #$i_unistd I_UNISTD
19258 #$i_stdlib I_STDLIB
19261 # include <unistd.h>
19264 # include <stdlib.h>
19269 register unsigned long tmp;
19270 register unsigned long max = 0L;
19272 for (i = 1000; i; i--) {
19273 tmp = (unsigned long) $randfunc();
19274 if (tmp > max) max = tmp;
19276 for (i = 0; max; i++)
19282 if eval $compile_ok; then
19286 echo "(I can't seem to compile the test program...)"
19293 rp="How many bits does your $randfunc() function produce?"
19297 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19298 seedfunc="s$randfunc"
19299 randseedtype=unsigned
19303 rp="How many bits does your $randfunc() function produce?"
19306 seedfunc="s$randfunc"
19307 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19308 if set $seedfunc val -f; eval $csym; $val; then
19309 echo "(Using $seedfunc() to seed random generator)"
19311 echo "(Warning: no $seedfunc() to seed random generator)"
19314 randseedtype=unsigned
19321 : Determine if this is an EBCDIC system
19323 echo "Determining whether or not we are on an EBCDIC system..." >&4
19324 $cat >try.c <<'EOM'
19327 if ('M'==0xd4) return 0;
19334 if eval $compile_ok; then
19335 if $run ./try; then
19336 echo "You seem to speak EBCDIC." >&4
19339 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19342 echo "I'm unable to compile the test program." >&4
19343 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19349 : Check how to flush
19352 Checking how to flush all pending stdio output...
19354 # I only know how to find the first 32 possibly open files on SunOS.
19355 # See also hints/sunos_4_1.sh and util.c --AD
19357 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19359 $cat >>try.c <<EOCP
19361 #$i_stdlib I_STDLIB
19363 #include <stdlib.h>
19365 #$i_unistd I_UNISTD
19367 # include <unistd.h>
19369 #$d_sysconf HAS_SYSCONF
19370 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19371 #ifdef HAS_STDIO_STREAM_ARRAY
19372 # define STDIO_STREAM_ARRAY $stdio_stream_array
19377 p = fopen("try.out", "w");
19381 # ifdef TRY_FPRINTF
19385 #ifdef TRY_FFLUSH_NULL
19388 #ifdef TRY_FFLUSH_ALL
19390 long open_max = -1;
19391 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19392 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19394 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19395 open_max = sysconf(_SC_OPEN_MAX);
19398 open_max = FOPEN_MAX;
19401 open_max = OPEN_MAX;
19410 # ifdef HAS_STDIO_STREAM_ARRAY
19411 if (open_max > 0) {
19413 for (i = 0; i < open_max; i++)
19414 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19415 STDIO_STREAM_ARRAY[i]._file < open_max &&
19416 STDIO_STREAM_ARRAY[i]._flag)
19417 fflush(&STDIO_STREAM_ARRAY[i]);
19425 : first we have to find out how _not_ to flush
19427 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19429 set try -DTRY_FPUTC
19430 if eval $compile; then
19431 $run ./try 2>/dev/null
19434 if $test ! -s try.out -a "X$code" = X42; then
19440 set try -DTRY_FPRINTF
19441 if eval $compile; then
19442 $run ./try 2>/dev/null
19445 if $test ! -s try.out -a "X$code" = X42; then
19446 output=-DTRY_FPRINTF
19452 : check for fflush NULL behaviour
19453 case "$fflushNULL" in
19454 '') set try -DTRY_FFLUSH_NULL $output
19455 if eval $compile; then
19456 $run ./try 2>/dev/null
19459 if $test -s try.out -a "X$code" = X42; then
19460 fflushNULL="`$cat try.out`"
19462 if $test "X$code" != X42; then
19464 (If this test failed, don't worry, we'll try another method shortly.)
19469 $rm -f core try.core core.try.*
19470 case "$fflushNULL" in
19472 Your fflush(NULL) works okay for output streams.
19473 Let's see if it clobbers input pipes...
19475 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19476 # bug that improperly flushes the input end of pipes. So we avoid the
19477 # autoflush on fork/system/exec support for now. :-(
19478 $cat >tryp.c <<EOCP
19481 main(int argc, char **argv)
19487 while ((i = getc(stdin)) != -1
19488 && (*bp++ = i) != '\n'
19489 && bp < &buf[1024])
19492 fprintf(stdout, "%s", buf);
19500 fflushNULL="$define"
19502 if eval $compile; then
19504 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19505 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19507 fflush(NULL) seems to behave okay with input streams.
19509 fflushNULL="$define"
19512 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19514 fflushNULL="$undef"
19517 $rm -f core tryp.c tryp.core core.tryp.*
19520 Your fflush(NULL) isn't working (contrary to ANSI C).
19522 fflushNULL="$undef"
19525 Cannot figure out whether your fflush(NULL) works or not.
19526 I'm assuming it doesn't (contrary to ANSI C).
19528 fflushNULL="$undef"
19532 $define|true|[yY]*)
19533 fflushNULL="$define"
19536 fflushNULL="$undef"
19539 : check explicit looping only if NULL did not work, and if the pipe
19540 : bug does not show up on an explicit flush too
19541 case "$fflushNULL" in
19543 $cat >tryp.c <<EOCP
19546 main(int argc, char **argv)
19552 while ((i = getc(stdin)) != -1
19553 && (*bp++ = i) != '\n'
19554 && bp < &buf[1024])
19557 fprintf(stdout, "%s", buf);
19566 if eval $compile; then
19568 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19569 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19571 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19573 : now check for fflushall behaviour
19574 case "$fflushall" in
19575 '') set try -DTRY_FFLUSH_ALL $output
19576 if eval $compile; then
19578 (Now testing the other method--but note that this also may fail.)
19580 $run ./try 2>/dev/null
19583 if $test -s try.out -a "X$code" = X42; then
19584 fflushall="`$cat try.out`"
19588 case "$fflushall" in
19590 Whew. Flushing explicitly all the stdio streams works.
19592 fflushall="$define"
19595 Sigh. Flushing explicitly all the stdio streams doesn't work.
19600 Cannot figure out whether flushing stdio streams explicitly works or not.
19601 I'm assuming it doesn't.
19607 "$define"|true|[yY]*)
19608 fflushall="$define"
19616 All is futile. Even fflush(stdin) clobbers input pipes!
19623 $rm -f core tryp.c tryp.core core.tryp.*
19625 *) fflushall="$undef"
19629 case "$fflushNULL$fflushall" in
19632 OK, I give up. I cannot figure out how to flush pending stdio output.
19633 We won't be flushing handles at all before fork/exec/popen.
19639 : Store the full pathname to the ar program for use in the C program
19640 : Respect a hint or command line value for full_ar.
19645 : Store the full pathname to the sed program for use in the C program
19648 : see what type gids are declared as in the kernel
19650 echo "Looking for the type for group ids returned by getgid()."
19651 set gid_t gidtype xxx stdio.h sys/types.h
19655 xxx=`./findhdr sys/user.h`
19656 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19658 unsigned) dflt="$1 $2" ;;
19662 *) dflt="$gidtype";;
19665 gid_t) echo "gid_t found." ;;
19666 *) rp="What is the type for group ids returned by getgid()?"
19672 : Check the size of GID
19675 *_t) zzz="$gidtype" ;;
19678 echo "Checking the size of $zzz..." >&4
19680 #include <sys/types.h>
19682 #$i_stdlib I_STDLIB
19684 #include <stdlib.h>
19687 printf("%d\n", (int)sizeof($gidtype));
19692 if eval $compile_ok; then
19696 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19699 echo "Your $zzz is $gidsize bytes long."
19704 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19708 : Check if GID is signed
19711 *_t) zzz="$gidtype" ;;
19714 echo "Checking the sign of $zzz..." >&4
19716 #include <sys/types.h>
19727 if eval $compile; then
19731 echo "(I can't execute the test program--guessing unsigned.)" >&4
19735 1) echo "Your $zzz is unsigned." ;;
19736 -1) echo "Your $zzz is signed." ;;
19742 echo "(I can't compile the test program--guessing unsigned.)" >&4
19746 : Check 64bit sizes
19749 if $test X"$quadtype" != X; then
19751 echo "Checking how to print 64-bit integers..." >&4
19753 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19754 $cat >try.c <<'EOCP'
19755 #include <sys/types.h>
19758 int q = 12345678901;
19759 printf("%ld\n", q);
19763 if eval $compile; then
19767 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19768 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19769 echo "We will use %d."
19775 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19776 $cat >try.c <<'EOCP'
19777 #include <sys/types.h>
19780 long q = 12345678901;
19781 printf("%ld\n", q);
19785 if eval $compile; then
19789 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19790 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19791 echo "We will use %ld."
19797 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19798 $cat >try.c <<'EOCP'
19799 #include <sys/types.h>
19800 #include <inttypes.h>
19803 int64_t q = 12345678901;
19804 printf("%" PRId64 "\n", q);
19808 if eval $compile; then
19812 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19813 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19814 echo "We will use the C9X style."
19820 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19822 #include <sys/types.h>
19825 $quadtype q = 12345678901;
19826 printf("%Ld\n", q);
19830 if eval $compile; then
19834 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19835 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19836 echo "We will use %Ld."
19842 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19843 $cat >try.c <<'EOCP'
19844 #include <sys/types.h>
19847 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19848 printf("%lld\n", q);
19852 if eval $compile; then
19856 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19857 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19858 echo "We will use the %lld style."
19864 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19866 #include <sys/types.h>
19869 $quadtype q = 12345678901;
19870 printf("%qd\n", q);
19874 if eval $compile; then
19878 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19879 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19880 echo "We will use %qd."
19886 if $test X"$sPRId64" = X; then
19887 echo "Cannot figure out how to print 64-bit integers." >&4
19894 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19895 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19897 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19898 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19902 : Check format strings for internal types
19904 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19906 if $test X"$ivsize" = X8; then
19907 ivdformat="$sPRId64"
19908 uvuformat="$sPRIu64"
19909 uvoformat="$sPRIo64"
19910 uvxformat="$sPRIx64"
19911 uvXUformat="$sPRIXU64"
19913 if $test X"$ivsize" = X"$longsize"; then
19920 if $test X"$ivsize" = X"$intsize"; then
19928 if $test X"$ivsize" = X"$shortsize"; then
19939 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19940 nveformat="$sPRIeldbl"
19941 nvfformat="$sPRIfldbl"
19942 nvgformat="$sPRIgldbl"
19943 nvEUformat="$sPRIEUldbl"
19944 nvFUformat="$sPRIFUldbl"
19945 nvGUformat="$sPRIGUldbl"
19955 case "$ivdformat" in
19956 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19961 : Check format string for GID
19964 $echo "Checking the format string to be used for gids..." >&4
19967 -1) if $test X"$gidsize" = X"$ivsize"; then
19968 gidformat="$ivdformat"
19970 if $test X"$gidsize" = X"$longsize"; then
19973 if $test X"$gidsize" = X"$intsize"; then
19976 if $test X"$gidsize" = X"$shortsize"; then
19983 *) if $test X"$gidsize" = X"$uvsize"; then
19984 gidformat="$uvuformat"
19986 if $test X"$gidsize" = X"$longsize"; then
19989 if $test X"$gidsize" = X"$intsize"; then
19992 if $test X"$gidsize" = X"$shortsize"; then
20001 : see if getgroups exists
20002 set getgroups d_getgrps
20005 : see if setgroups exists
20006 set setgroups d_setgrps
20009 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20011 case "$d_getgrps$d_setgrps" in
20013 case "$groupstype" in
20014 '') dflt="$gidtype" ;;
20015 *) dflt="$groupstype" ;;
20018 What type of pointer is the second argument to getgroups() and setgroups()?
20019 Usually this is the same as group ids, $gidtype, but not always.
20022 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20026 *) groupstype="$gidtype";;
20029 : MAD = Misc Attribute Definition
20031 if $test $patchlevel -lt 9; then
20032 : MAD is not available in 5.8.x or earlier.
20036 $define|true|[yY]*) dflt='y' ;;
20041 Would you like to build with Misc Attribute Decoration? This is development
20042 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20043 overhead on the interpreter.
20045 If this doesn't make any sense to you, just accept the default '$dflt'.
20047 rp='Build Perl with MAD?'
20052 madlyh='madly.h madly.act madly.tab'
20054 madlyobj="madly$_o" ;;
20063 : check whether make sets MAKE
20065 echo "Checking if your $make program sets \$(MAKE)..." >&4
20066 case "$make_set_make" in
20068 $sed 's/^X //' > testmake.mak << 'EOF'
20070 X @echo 'maketemp="$(MAKE)"'
20072 case "`$make -f testmake.mak 2>/dev/null`" in
20073 *maketemp=*) make_set_make='#' ;;
20074 *) make_set_make="MAKE=$make" ;;
20076 $rm -f testmake.mak
20079 case "$make_set_make" in
20080 '#') echo "Yup, it does.";;
20081 *) echo "Nope, it doesn't.";;
20084 : see what type is used for mode_t
20085 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20086 set mode_t modetype int stdio.h sys/types.h
20089 : see if we need va_copy
20091 case "$i_stdarg" in
20094 #include <stdarg.h>
20096 #$i_stdlib I_STDLIB
20098 #include <stdlib.h>
20100 #include <signal.h>
20103 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20105 return vfprintf(f, fmt, *valp);
20109 myvfprintf(FILE *f, const char *fmt, va_list val)
20111 return ivfprintf(f, fmt, &val);
20115 myprintf(char *fmt, ...)
20118 va_start(val, fmt);
20119 return myvfprintf(stdout, fmt, val);
20123 main(int ac, char **av)
20125 signal(SIGSEGV, exit);
20127 myprintf("%s%cs all right, then\n", "that", '\'');
20132 if eval $compile && $run ./try 2>&1 >/dev/null; then
20133 case "`$run ./try`" in
20134 "that's all right, then")
20140 yes) echo "It seems that you don't need va_copy()." >&4
20141 need_va_copy="$undef"
20143 *) echo "It seems that va_copy() or similar will be needed." >&4
20144 need_va_copy="$define"
20149 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20153 : see what type is used for size_t
20154 rp="What is the type used for the length parameter for string functions?"
20155 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20158 : check for type of arguments to gethostbyaddr.
20159 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20160 case "$d_gethbyaddr" in
20164 Checking to see what type of arguments are accepted by gethostbyaddr().
20166 hdrs="$define sys/types.h
20167 $d_socket sys/socket.h
20168 $i_niin netinet/in.h
20170 $i_unistd unistd.h"
20171 : The first arg can 'char *' or 'void *'
20172 : The second arg is some of integral type
20173 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20174 for yyy in size_t long int; do
20175 case "$netdb_host_type" in
20176 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20177 if ./protochk "$try" $hdrs; then
20178 echo "Your system accepts $xxx for the first arg."
20179 echo "...and $yyy for the second arg."
20180 netdb_host_type="$xxx"
20181 netdb_hlen_type="$yyy"
20187 : In case none of those worked, prompt the user.
20188 case "$netdb_host_type" in
20189 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20192 netdb_host_type=$ans
20193 rp='What is the type for the 2nd argument to gethostbyaddr?'
20196 netdb_hlen_type=$ans
20200 *) : no gethostbyaddr, so pick harmless defaults
20201 netdb_host_type='char *'
20202 netdb_hlen_type="$sizetype"
20205 # Remove the "const" if needed. -- but then we'll have a
20207 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20210 : check for type of argument to gethostbyname.
20211 if test "X$netdb_name_type" = X ; then
20212 case "$d_gethbyname" in
20216 Checking to see what type of argument is accepted by gethostbyname().
20218 hdrs="$define sys/types.h
20219 $d_socket sys/socket.h
20220 $i_niin netinet/in.h
20222 $i_unistd unistd.h"
20223 for xxx in "const char *" "char *"; do
20224 case "$netdb_name_type" in
20225 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20226 if ./protochk "$try" $hdrs; then
20227 echo "Your system accepts $xxx."
20228 netdb_name_type="$xxx"
20233 : In case none of those worked, prompt the user.
20234 case "$netdb_name_type" in
20235 '') rp='What is the type for the 1st argument to gethostbyname?'
20238 netdb_name_type=$ans
20242 *) : no gethostbyname, so pick harmless default
20243 netdb_name_type='char *'
20248 : check for type of 1st argument to getnetbyaddr.
20249 if test "X$netdb_net_type" = X ; then
20250 case "$d_getnbyaddr" in
20254 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20256 hdrs="$define sys/types.h
20257 $d_socket sys/socket.h
20258 $i_niin netinet/in.h
20260 $i_unistd unistd.h"
20261 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20262 case "$netdb_net_type" in
20263 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20264 if ./protochk "$try" $hdrs; then
20265 echo "Your system accepts $xxx."
20266 netdb_net_type="$xxx"
20271 : In case none of those worked, prompt the user.
20272 case "$netdb_net_type" in
20273 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20276 netdb_net_type=$ans
20280 *) : no getnetbyaddr, so pick harmless default
20281 netdb_net_type='long'
20285 : locate the preferred pager for this system
20292 [a-zA-Z]:/*) dflt=$pg;;
20296 [a-zA-Z]:/*) dflt=$more;;
20300 [a-zA-Z]:/*) dflt=$less;;
20303 '') dflt=/usr/ucb/more;;
20311 rp='What pager is used on your system?'
20315 : see what type pids are declared as in the kernel
20316 rp="What is the type of process ids on this system?"
20317 set pid_t pidtype int stdio.h sys/types.h
20320 : see if ar generates random libraries by itself
20322 echo "Checking how to generate random libraries on your machine..." >&4
20323 echo 'int bar1() { return bar2(); }' > bar1.c
20324 echo 'int bar2() { return 2; }' > bar2.c
20326 #$i_stdlib I_STDLIB
20328 #include <stdlib.h>
20330 int main() { printf("%d\n", bar1()); exit(0); }
20332 $cc $ccflags -c bar1.c >/dev/null 2>&1
20333 $cc $ccflags -c bar2.c >/dev/null 2>&1
20334 $cc $ccflags -c foo.c >/dev/null 2>&1
20335 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20336 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20337 $run ./foobar >/dev/null 2>&1; then
20338 echo "$ar appears to generate random libraries itself."
20340 if [ "X$ranlib" = "X" ]; then
20343 elif $ar s bar$_a >/dev/null 2>&1 &&
20344 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20345 $run ./foobar >/dev/null 2>&1; then
20346 echo "a table of contents needs to be added with '$ar s'."
20349 elif $ar ts bar$_a >/dev/null 2>&1 &&
20350 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20351 $run ./foobar >/dev/null 2>&1; then
20352 echo "a table of contents needs to be added with '$ar ts'."
20359 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20360 $test -f $ranlib || ranlib=''
20363 if $test -n "$ranlib"; then
20364 echo "your system has '$ranlib'; we'll use that."
20367 echo "your system doesn't seem to support random libraries"
20368 echo "so we'll use lorder and tsort to order the libraries."
20375 : see if this is a values.h system
20376 set values.h i_values
20379 : Check the max offset that gmtime and localtime accept
20380 echo "Checking max offsets that gmtime () accepts"
20383 define) yyy="#include <values.h>" ;;
20387 case "$sGMTIME_min/$sGMTIME_max" in
20390 #include <sys/types.h>
20399 void gm_check (time_t t, int min_year, int max_year)
20402 if ( tmp == NULL ||
20403 /* Check tm_year overflow */
20404 tmp->tm_year < min_year || tmp->tm_year > max_year)
20415 gm_check (MAXLONG, 69, 0x7fffffff);
20417 if (tmp == NULL || tmp->tm_year < 0) {
20418 for (i = 63; i >= 0; i--) {
20419 time_t x = pt | ((time_t)1 << i);
20420 if (x < 0 || x < pt) continue;
20421 gm_check (x, 69, 0x7fffffff);
20424 printf ("sGMTIME_max=%ld\n", pt);
20433 gm_check (MINLONG, -1900, 70);
20436 for (i = 36; i >= 0; i--) {
20437 time_t x = pt - ((time_t)1 << i);
20438 if (x > 0) continue;
20439 gm_check (x, -1900, 70);
20442 printf ("sGMTIME_min=%ld\n", pt);
20446 int main (int argc, char *argv[])
20448 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20455 if eval $compile; then
20458 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20464 echo "Checking max offsets that localtime () accepts"
20466 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20469 #include <sys/types.h>
20478 void local_check (time_t t, int min_year, int max_year)
20480 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20483 tmp = localtime (&t);
20484 if ( tmp == NULL ||
20485 /* Check tm_year overflow */
20486 tmp->tm_year < min_year || tmp->tm_year > max_year)
20490 } /* local_check */
20497 local_check (MAXLONG, 69, 0x7fffffff);
20499 if (tmp == NULL || tmp->tm_year < 0) {
20500 for (i = 63; i >= 0; i--) {
20501 time_t x = pt | ((time_t)1 << i);
20502 if (x < 0 || x < pt) continue;
20503 local_check (x, 69, 0x7fffffff);
20506 printf ("sLOCALTIME_max=%ld\n", pt);
20515 local_check (MINLONG, -1900, 70);
20518 for (i = 36; i >= 0; i--) {
20519 time_t x = pt - ((time_t)1 << i);
20520 if (x > 0) continue;
20521 local_check (x, -1900, 70);
20524 printf ("sLOCALTIME_min=%ld\n", pt);
20528 int main (int argc, char *argv[])
20536 if eval $compile; then
20539 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20545 : check for type of arguments to select.
20546 case "$selecttype" in
20547 '') case "$d_select" in
20551 Checking to see what type of arguments are accepted by select().
20553 hdrs="$define sys/types.h
20554 $i_systime sys/time.h
20555 $i_sysselct sys/select.h
20556 $d_socket sys/socket.h"
20557 : The first arg can be int, unsigned, or size_t
20558 : The last arg may or may not be 'const'
20560 : void pointer has been seen but using that
20561 : breaks the selectminbits test
20562 for xxx in 'fd_set *' 'int *'; do
20563 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20564 for tmo in 'struct timeval *' 'const struct timeval *'; do
20566 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20567 if ./protochk "$try" $hdrs; then
20568 echo "Your system accepts $xxx."
20577 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20578 case "$d_fd_set" in
20579 $define) dflt="fd_set *" ;;
20588 *) : no select, so pick a harmless default
20595 : check for the select 'width'
20596 case "$selectminbits" in
20597 '') safebits=`expr $ptrsize \* 8`
20598 case "$d_select" in
20602 Checking to see on how many bits at a time your select() operates...
20605 #include <sys/types.h>
20607 #$i_systime I_SYS_TIME
20608 #$i_systimek I_SYS_TIME_KERNEL
20613 # ifdef I_SYS_TIME_KERNEL
20616 # include <sys/time.h>
20617 # ifdef I_SYS_TIME_KERNEL
20621 #$i_sysselct I_SYS_SELECT
20622 #ifdef I_SYS_SELECT
20623 #include <sys/select.h>
20625 #$d_socket HAS_SOCKET
20627 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20630 #$i_stdlib I_STDLIB
20632 #include <stdlib.h>
20635 #define S sizeof(*(b))
20637 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20638 #define NBITS (NBYTES * 8)
20640 char *s = (char *)malloc(NBYTES);
20649 fp = fopen("try.c", "r");
20655 b = ($selecttype)s;
20656 for (i = 0; i < NBITS; i++)
20660 select(fd + 1, b, 0, 0, &t);
20661 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20663 printf("%d\n", i + 1);
20668 if eval $compile_ok; then
20669 selectminbits=`$run ./try`
20670 case "$selectminbits" in
20672 Cannot figure out on how many bits at a time your select() operates.
20673 I'll play safe and guess it is $safebits bits.
20675 selectminbits=$safebits
20676 bits="$safebits bits"
20679 *) bits="$selectminbits bits" ;;
20681 echo "Your select() operates on $bits at a time." >&4
20683 rp='What is the minimum number of bits your select() operates on?'
20684 case "$byteorder" in
20685 12345678) dflt=64 ;;
20691 selectminbits="$val"
20695 *) : no select, so pick a harmless default
20696 selectminbits=$safebits
20702 : Trace out the files included by signal.h, then look for SIGxxx names.
20703 if [ "X$fieldn" = X ]; then
20704 : Just make some guesses. We check them later.
20705 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20707 xxx=`echo '#include <signal.h>' |
20708 $cppstdin $cppminus $cppflags 2>/dev/null |
20709 $grep '^[ ]*#.*include' |
20710 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20711 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20714 for xx in $xxx /dev/null ; do
20715 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20717 case "$xxxfiles" in
20718 '') xxxfiles=`./findhdr signal.h` ;;
20721 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20722 print substr($2, 4, 20)
20724 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20725 print substr($3, 4, 20)
20727 : Append some common names just in case the awk scan failed.
20728 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20729 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20730 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20731 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20732 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20734 : generate a few handy files for later
20735 $cat > signal.c <<EOCP
20736 #include <sys/types.h>
20737 #include <signal.h>
20738 #$i_stdlib I_STDLIB
20740 #include <stdlib.h>
20745 /* Strange style to avoid deeply-nested #if/#else/#endif */
20748 # define NSIG (_NSIG)
20754 # define NSIG (SIGMAX+1)
20760 # define NSIG (SIG_MAX+1)
20766 # define NSIG (_SIG_MAX+1)
20772 # define NSIG (MAXSIG+1)
20778 # define NSIG (MAX_SIG+1)
20783 # ifdef SIGARRAYSIZE
20784 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20790 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20794 /* Default to some arbitrary number that's big enough to get most
20795 of the common signals.
20801 printf("NSIG %d\n", NSIG);
20807 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20809 printf "#ifdef SIG"; printf $1; printf "\n"
20810 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20811 printf $1; printf ");\n"
20815 printf "#endif /* JUST_NSIG */\n";
20816 printf "exit(0);\n}\n";
20819 $cat >signal.awk <<'EOP'
20820 BEGIN { ndups = 0 }
20821 $1 ~ /^NSIG$/ { nsig = $2 }
20822 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20823 if ($2 > maxsig) { maxsig = $2 }
20824 if (sig_name[$2]) {
20825 dup_name[ndups] = $1
20826 dup_num[ndups] = $2
20838 printf("NSIG %d\n", nsig);
20839 for (n = 1; n < nsig; n++) {
20841 printf("%s %d\n", sig_name[n], sig_num[n])
20844 printf("NUM%d %d\n", n, n)
20847 for (n = 0; n < ndups; n++) {
20848 printf("%s %d\n", dup_name[n], dup_num[n])
20852 $cat >signal_cmd <<EOS
20854 if $test -s signal.lst; then
20855 echo "Using your existing signal.lst file"
20860 $cat >>signal_cmd <<'EOS'
20863 if eval $compile_ok; then
20864 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20865 $uniq | $awk -f signal.awk >signal.lst
20867 echo "(I can't seem be able to compile the whole test program)" >&4
20868 echo "(I'll try it in little pieces.)" >&4
20869 set signal -DJUST_NSIG
20870 if eval $compile_ok; then
20871 $run ./signal$_exe > signal.nsg
20874 echo "I can't seem to figure out how many signals you have." >&4
20875 echo "Guessing 50." >&4
20876 echo 'NSIG 50' > signal.nsg
20878 : Now look at all the signal names, one at a time.
20879 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20880 $cat > signal.c <<EOCP
20881 #include <sys/types.h>
20882 #include <signal.h>
20885 printf("$xx %d\n", SIG${xx});
20890 if eval $compile; then
20891 echo "SIG${xx} found."
20892 $run ./signal$_exe >> signal.ls1
20894 echo "SIG${xx} NOT found."
20897 if $test -s signal.ls1; then
20898 $cat signal.nsg signal.ls1 |
20899 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20903 if $test -s signal.lst; then
20906 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20907 echo 'kill -l' >signal
20908 set X `csh -f <signal`
20912 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20914 echo $@ | $tr ' ' $trnl | \
20915 $awk '{ printf "%s %d\n", $1, ++s; }
20916 END { printf "NSIG %d\n", ++s }' >signal.lst
20918 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20920 chmod a+x signal_cmd
20921 $eunicefix signal_cmd
20923 : generate list of signal names
20925 case "$sig_name_init" in
20927 *) case "$sig_num_init" in
20928 ''|*,*) doinit=yes ;;
20933 echo "Generating a list of signal names and numbers..." >&4
20935 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20936 sig_name=`$awk 'BEGIN { printf "ZERO " }
20937 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20938 sig_num=`$awk 'BEGIN { printf "0 " }
20939 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20940 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20941 !/^NSIG/ { printf "\"%s\", ", $1 }
20942 END { printf "0\n" }' signal.lst`
20943 sig_num_init=`$awk 'BEGIN { printf "0, " }
20944 !/^NSIG/ { printf "%d, ", $2}
20945 END { printf "0\n"}' signal.lst`
20948 echo "The following $sig_count signals are available:"
20950 echo $sig_name | $awk \
20951 'BEGIN { linelen = 0 }
20953 for (i = 1; i <= NF; i++) {
20954 name = "SIG" $i " "
20955 linelen = linelen + length(name)
20956 if (linelen > 70) {
20958 linelen = length(name)
20964 sig_size=`echo $sig_name | awk '{print NF}'`
20965 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20967 : Check size of size
20969 case "$sizetype" in
20970 *_t) zzz="$sizetype" ;;
20971 *) zzz="filesize" ;;
20973 echo "Checking the size of $zzz..." >&4
20975 #include <sys/types.h>
20977 #$i_stdlib I_STDLIB
20979 #include <stdlib.h>
20982 printf("%d\n", (int)sizeof($sizetype));
20987 if eval $compile_ok; then
20991 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20994 echo "Your $zzz size is $sizesize bytes."
20999 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21003 : check for socklen_t
21005 echo "Checking to see if you have socklen_t..." >&4
21007 #include <sys/types.h>
21008 #$d_socket HAS_SOCKET
21010 #include <sys/socket.h>
21012 int main() { socklen_t x = 16; }
21015 if eval $compile; then
21017 echo "You have socklen_t."
21020 echo "You do not have socklen_t."
21021 case "$sizetype" in
21022 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21029 : see if this is a socks.h system
21030 set socks.h i_socks
21033 : check for type of the size argument to socket calls
21034 case "$d_socket" in
21038 Checking to see what type is the last argument of accept().
21041 case "$d_socklen_t" in
21042 "$define") yyy="$yyy socklen_t"
21044 yyy="$yyy $sizetype int long unsigned"
21045 for xxx in $yyy; do
21046 case "$socksizetype" in
21047 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21048 case "$usesocks" in
21050 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21051 echo "Your system accepts '$xxx *' for the last argument of accept()."
21052 socksizetype="$xxx"
21055 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21056 echo "Your system accepts '$xxx *' for the last argument of accept()."
21057 socksizetype="$xxx"
21064 : In case none of those worked, prompt the user.
21065 case "$socksizetype" in
21066 '') rp='What is the type for socket address structure sizes?'
21073 *) : no sockets, so pick relatively harmless default
21078 : see what type is used for signed size_t
21079 set ssize_t ssizetype int stdio.h sys/types.h
21084 #$i_stdlib I_STDLIB
21086 #include <stdlib.h>
21088 #include <sys/types.h>
21089 #define Size_t $sizetype
21090 #define SSize_t $dflt
21093 if (sizeof(Size_t) == sizeof(SSize_t))
21095 else if (sizeof(Size_t) == sizeof(int))
21104 if eval $compile_ok && $run ./try > /dev/null; then
21105 ssizetype=`$run ./try`
21106 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21109 Help! I can't compile and run the ssize_t test program: please enlighten me!
21110 (This is probably a misconfiguration in your system or libraries, and
21111 you really ought to fix it. Still, I'll try anyway.)
21113 I need a type that is the same size as $sizetype, but is guaranteed to
21114 be signed. Common values are ssize_t, int and long.
21117 rp="What signed type is the same size as $sizetype?"
21123 : Check the size of st_ino
21125 $echo "Checking the size of st_ino..." >&4
21126 $cat > try.c <<EOCP
21127 #include <sys/stat.h>
21129 #$i_stdlib I_STDLIB
21131 #include <stdlib.h>
21135 printf("%d\n", (int)sizeof(st.st_ino));
21140 if eval $compile_ok; then
21144 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21146 *) st_ino_size=$val
21147 $echo "Your st_ino is $st_ino_size bytes long."
21152 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21156 : Check if st_ino is signed
21158 $echo "Checking the sign of st_ino..." >&4
21159 $cat > try.c <<EOCP
21160 #include <sys/stat.h>
21165 if (foo.st_ino < 0)
21172 if eval $compile; then
21176 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21178 *) st_ino_sign=$val
21179 case "$st_ino_sign" in
21180 1) $echo "Your st_ino is unsigned." ;;
21181 -1) $echo "Your st_ino is signed." ;;
21187 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21191 : see what type of char stdio uses.
21193 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21194 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21195 echo "Your stdio uses unsigned chars." >&4
21196 stdchar="unsigned char"
21198 echo "Your stdio uses signed chars." >&4
21203 : see what type uids are declared as in the kernel
21205 echo "Looking for the type for user ids returned by getuid()."
21206 set uid_t uidtype xxx stdio.h sys/types.h
21210 xxx=`./findhdr sys/user.h`
21211 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21213 unsigned) dflt="$1 $2" ;;
21217 *) dflt="$uidtype";;
21220 uid_t) echo "uid_t found." ;;
21221 *) rp="What is the type for user ids returned by getuid()?"
21227 : Check size of UID
21230 *_t) zzz="$uidtype" ;;
21233 echo "Checking the size of $zzz..." >&4
21235 #include <sys/types.h>
21237 #$i_stdlib I_STDLIB
21239 #include <stdlib.h>
21242 printf("%d\n", (int)sizeof($uidtype));
21247 if eval $compile_ok; then
21251 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21254 echo "Your $zzz is $uidsize bytes long."
21259 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21262 : Check if UID is signed
21265 *_t) zzz="$uidtype" ;;
21268 echo "Checking the sign of $zzz..." >&4
21270 #include <sys/types.h>
21281 if eval $compile; then
21285 echo "(I can't execute the test program--guessing unsigned.)" >&4
21289 1) echo "Your $zzz is unsigned." ;;
21290 -1) echo "Your $zzz is signed." ;;
21296 echo "(I can't compile the test program--guessing unsigned.)" >&4
21300 : Check format string for UID
21302 $echo "Checking the format string to be used for uids..." >&4
21305 -1) if $test X"$uidsize" = X"$ivsize"; then
21306 uidformat="$ivdformat"
21308 if $test X"$uidsize" = X"$longsize"; then
21311 if $test X"$uidsize" = X"$intsize"; then
21314 if $test X"$uidsize" = X"$shortsize"; then
21321 *) if $test X"$uidsize" = X"$uvsize"; then
21322 uidformat="$uvuformat"
21324 if $test X"$uidsize" = X"$longsize"; then
21327 if $test X"$uidsize" = X"$intsize"; then
21330 if $test X"$uidsize" = X"$shortsize"; then
21339 : Check if site customization support was requested
21340 case "$usesitecustomize" in
21341 $define|true|[Yy]*)
21342 usesitecustomize="$define"
21345 usesitecustomize="$undef"
21349 : see if prototypes support variable argument declarations
21351 case "$prototype$i_stdarg" in
21353 echo "It appears we'll be able to prototype varargs functions." >&4
21357 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21364 : determine compiler compiler
21373 if $test -f "$byacc$_exe"; then
21375 comp="byacc or $comp"
21377 if $test -f "$bison$_exe"; then
21378 comp="$comp or bison -y"
21380 rp="Which compiler compiler ($comp) shall I use?"
21389 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21395 : see if this is a assert.h system
21396 set assert.h i_assert
21399 : see if this is a fp.h system
21403 : see if this is a fp_class.h system
21404 set fp_class.h i_fp_class
21407 : see if gdbm.h is available
21412 : see if gdbm_open exists
21413 set gdbm_open d_gdbm_open
21415 case "$d_gdbm_open" in
21418 echo "We won't be including <gdbm.h>"
21427 : see if this is a ieeefp.h system
21428 case "$i_ieeefp" in
21429 '' ) set ieeefp.h i_ieeefp
21434 : see if this is a libutil.h system
21435 set libutil.h i_libutil
21438 : see if mach cthreads are available
21439 if test "X$usethreads" = "X$define"; then
21440 set mach/cthreads.h i_machcthr
21443 i_machcthr="$undef"
21446 : see if this is a mntent.h system
21447 set mntent.h i_mntent
21450 : see if net/errno.h is available
21452 set net/errno.h val
21455 : Unfortunately, it causes problems on some systems. Arrgh.
21458 cat > try.c <<'EOM'
21461 #include <net/errno.h>
21467 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21468 echo "We'll be including <net/errno.h>." >&4
21470 echo "We won't be including <net/errno.h>." >&4
21479 : see if netinet/tcp.h is available
21480 set netinet/tcp.h i_netinettcp
21483 : see if this is a poll.h system
21487 : see if this is a prot.h system
21491 : Preprocessor symbols
21493 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21494 $cat <<'EOSH' > Cppsym.know
21495 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21496 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21497 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21498 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21499 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21500 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21501 bull c cadmus clipper CMU COFF COMPILER_VERSION
21502 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21503 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21504 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21505 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21507 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21508 H3050R H3050RX hbullx20 hcx host_mips
21509 hp200 hp300 hp700 HP700 hp800 hp9000
21510 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21511 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21512 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21513 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21514 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21515 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21516 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21517 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21518 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21519 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21520 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21521 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21522 MATH_HAS_NO_SIDE_EFFECTS
21523 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21524 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21525 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21526 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21527 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21528 NetBSD news1500 news1700 news1800 news1900 news3700
21529 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21530 ns32016 ns32332 ns32k nsc32000
21531 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21532 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21533 pc532 pdp11 PGC PIC plexus PORTAR posix
21534 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21535 POSIX_C_SOURCE POSIX_SOURCE POWER
21536 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21537 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21538 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21539 sony sony_news sonyrisc sparc sparclite spectrum
21540 stardent stdc STDC_EXT stratos sun sun3 sun386
21541 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21542 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21543 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21544 sysV68 sysV88 Tek4132 Tek4300 titan
21545 TM3200 TM5400 TM5600
21546 tower tower32 tower32_200 tower32_600 tower32_700
21547 tower32_800 tower32_850 tss
21548 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21549 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21550 unix UNIX95 UNIX99 unixpc unos
21551 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21552 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21553 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21555 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21556 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21557 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21560 # Maybe put other stuff here too.
21561 cat <<EOSH >>Cppsym.know
21564 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21565 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21566 $cat Cppsym.know > Cppsym.c
21567 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21568 $rm -f Cppsym.a Cppsym.b Cppsym.c
21569 cat <<EOSH > Cppsym
21571 if $test \$# -gt 0; then
21572 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21573 if $test -s Cppsym.got; then
21580 $tr " " "$trnl" | ./Cppsym.try
21586 cat <<EOSH > Cppsym.try
21588 cat <<'EOCP' > try.c
21591 #define STRINGIFY(a) "a"
21593 #if cpp_stuff == 42
21594 #define StGiFy(a) #a
21595 #define STRINGIFY(a) StGiFy(a)
21597 #if $cpp_stuff != 1 && $cpp_stuff != 42
21598 # include "Bletch: How does this C preprocessor stringify macros?"
21604 cat <<'EOSH' >> Cppsym.try
21606 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21607 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21608 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21609 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21611 echo 'return 0;}' >> try.c
21613 cat <<EOSH >> Cppsym.try
21615 case "$osname-$gccversion" in
21616 irix-) ccflags="\$ccflags -woff 1178" ;;
21617 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21619 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21621 chmod +x Cppsym.try
21622 $eunicefix Cppsym.try
21623 ./Cppsym < Cppsym.know > Cppsym.true
21624 : Add in any linux cpp "predefined macros":
21625 case "$osname::$gccversion" in
21626 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
21628 rm -f $tHdrH'.h' $tHdrH
21630 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21631 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21632 if [ -s $tHdrH'_cppsym.real' ]; then
21633 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21636 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21639 : now check the C compiler for additional symbols
21640 postprocess_cc_v=''
21642 aix) postprocess_cc_v="|$tr , ' '" ;;
21649 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21652 -D*) echo "\$i" | $sed 's/^-D//';;
21653 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21658 postprocess_cc_v=''
21661 ./ccsym > ccsym1.raw
21662 if $test -s ccsym1.raw; then
21663 $sort ccsym1.raw | $uniq >ccsym.raw
21665 mv ccsym1.raw ccsym.raw
21668 $awk '/\=/ { print $0; next }
21669 { print $0"=1" }' ccsym.raw >ccsym.list
21670 $comm -13 Cppsym.true ccsym.list >ccsym.own
21671 $comm -12 Cppsym.true ccsym.list >ccsym.com
21672 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21674 if $test -z ccsym.raw; then
21675 echo "Your C compiler doesn't seem to define any symbols!" >&4
21677 echo "However, your C preprocessor defines the following symbols:"
21680 cppsymbols=`$cat Cppsym.true`
21681 cppsymbols=`echo $cppsymbols`
21682 cppccsymbols="$cppsymbols"
21684 if $test -s ccsym.com; then
21685 echo "Your C compiler and pre-processor define these symbols:"
21686 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21689 cppccsymbols=`$cat ccsym.com`
21690 cppccsymbols=`echo $cppccsymbols`
21691 $test "$silent" || sleep 1
21693 if $test -s ccsym.cpp; then
21694 $test "$also" && echo " "
21695 echo "Your C pre-processor ${also}defines the following symbols:"
21696 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21698 cppsymbols=`$cat ccsym.cpp`
21699 cppsymbols=`echo $cppsymbols`
21700 $test "$silent" || sleep 1
21702 if $test -s ccsym.own; then
21703 $test "$also" && echo " "
21704 echo "Your C compiler ${also}defines the following cpp symbols:"
21705 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21706 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21707 ccsymbols=`$cat ccsym.own`
21708 ccsymbols=`echo $ccsymbols`
21709 $test "$silent" || sleep 1
21713 : see if this is a termio system
21717 if $test `./findhdr termios.h`; then
21718 set tcsetattr i_termios
21724 "$define") echo "You have POSIX termios.h... good!" >&4;;
21725 *) if ./Cppsym pyr; then
21726 case "`/bin/universe`" in
21727 ucb) if $test `./findhdr sgtty.h`; then
21729 echo "<sgtty.h> found." >&4
21731 echo "System is pyramid with BSD universe."
21732 ./warn "<sgtty.h> not found--you could have problems."
21734 *) if $test `./findhdr termio.h`; then
21736 echo "<termio.h> found." >&4
21738 echo "System is pyramid with USG universe."
21739 ./warn "<termio.h> not found--you could have problems."
21743 if $test `./findhdr termio.h`; then
21744 echo "<termio.h> found." >&4
21746 elif $test `./findhdr sgtty.h`; then
21747 echo "<sgtty.h> found." >&4
21750 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21753 if $test `./findhdr sgtty.h`; then
21754 echo "<sgtty.h> found." >&4
21756 elif $test `./findhdr termio.h`; then
21757 echo "<termio.h> found." >&4
21760 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21764 set i_termio; eval $setvar
21765 val=$val2; set i_sgtty; eval $setvar
21766 val=$val3; set i_termios; eval $setvar
21768 : see if stdbool is available
21769 set stdbool.h i_stdbool
21772 : see if stddef is available
21773 set stddef.h i_stddef
21776 : see if sys/access.h is available
21777 set sys/access.h i_sysaccess
21780 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21781 set sys/filio.h i_sysfilio
21784 if $test `./findhdr sys/ioctl.h`; then
21786 echo '<sys/ioctl.h> found.' >&4
21789 if $test $i_sysfilio = "$define"; then
21790 echo '<sys/ioctl.h> NOT found.' >&4
21792 $test $i_sgtty = "$define" && xxx="sgtty.h"
21793 $test $i_termio = "$define" && xxx="termio.h"
21794 $test $i_termios = "$define" && xxx="termios.h"
21795 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21801 : see if socket ioctl defs are in sys/sockio.h
21803 xxx=`./findhdr sys/sockio.h`
21804 if $test "$xxx"; then
21805 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21807 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21810 echo "No socket ioctls found in <sys/sockio.h>." >&4
21815 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21821 : see if this is a syslog.h system
21822 set syslog.h i_syslog
21825 : see if this is a sys/mode.h system
21826 set sys/mode.h i_sysmode
21829 : see if there is a sys/poll.h file
21830 set sys/poll.h i_syspoll
21833 : see if sys/resource.h has to be included
21834 set sys/resource.h i_sysresrc
21837 : see if sys/security.h is available
21838 set sys/security.h i_syssecrt
21841 : see if this is a sys/statvfs.h system
21842 set sys/statvfs.h i_sysstatvfs
21845 : see if this is a sys/un.h system
21846 set sys/un.h i_sysun
21849 : see if this is a sys/utsname.h system
21850 set sys/utsname.h i_sysutsname
21853 : see if this is a syswait system
21854 set sys/wait.h i_syswait
21857 : see if this is a ustat.h system
21858 set ustat.h i_ustat
21861 : see if this is an utime system
21862 set utime.h i_utime
21865 : see if this is a vfork system
21868 set vfork.h i_vfork
21878 echo "Looking for extensions..." >&4
21879 : If we are using the old config.sh, known_extensions may contain
21880 : old or inaccurate or duplicate values.
21881 known_extensions=''
21882 nonxs_extensions=''
21883 : We do not use find because it might not be available.
21884 : We do not just use MANIFEST because the user may have dropped
21885 : some additional extensions into the source tree and expect them
21888 : Function to recursively find available extensions, ignoring DynaLoader
21889 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21890 : In 5.10.1 and later, extensions are stored in directories
21891 : like File-Glob instead of the older File/Glob/.
21895 DynaLoader|dynaload) ;;
21897 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
21898 leaf=`echo $xxx | $sed -e s/.*-//`;
21899 if $test -d File; then
21900 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21901 known_extensions="$known_extensions $1$this_ext";
21902 elif $test -f $xxx/Makefile.PL; then
21903 nonxs_extensions="$nonxs_extensions $1$this_ext";
21905 if $test -d $xxx -a $# -lt 10; then
21908 eval $find_extensions;
21914 $ls -1 $xxx > $$.tmp;
21915 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
21916 known_extensions="$known_extensions $this_ext";
21917 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
21918 known_extensions="$known_extensions $this_ext";
21919 elif $test -d $xxx; then
21920 nonxs_extensions="$nonxs_extensions $this_ext";
21931 eval $find_extensions
21935 eval $find_extensions
21939 eval $find_extensions
21940 if $test -d File-Glob; then
21941 : All ext/ flattened
21943 # Special case: Add in modules that nest beyond the first level.
21944 # Currently threads/shared and Hash/Util/FieldHash, since they are
21945 # not picked up by the recursive find above (and adding in general
21946 # recursive finding breaks SDBM_File/sdbm).
21947 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21948 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21950 set X $known_extensions
21952 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21953 set X $nonxs_extensions
21955 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21958 : Now see which are supported on this system.
21960 for xxx in $known_extensions ; do
21964 $define) avail_ext="$avail_ext $xxx" ;;
21967 GDBM_File|gdbm_fil)
21969 $define) avail_ext="$avail_ext $xxx" ;;
21972 I18N/Langinfo|i18n_lan)
21973 case "$i_langinfo$d_nl_langinfo" in
21974 $define$define) avail_ext="$avail_ext $xxx" ;;
21978 : XXX Do we need a useipcsysv variable here
21979 case "${d_msg}${d_sem}${d_shm}" in
21980 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21983 NDBM_File|ndbm_fil)
21986 case "$osname-$use64bitint" in
21989 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21992 *) avail_ext="$avail_ext $xxx" ;;
21997 ODBM_File|odbm_fil)
21998 case "${i_dbm}${i_rpcsvcdbm}" in
22000 case "$d_cplusplus" in
22001 define) ;; # delete as a function name will not work
22002 *) case "$osname-$use64bitint" in
22005 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22008 *) avail_ext="$avail_ext $xxx" ;;
22016 case "$useopcode" in
22017 true|define|y) avail_ext="$avail_ext $xxx" ;;
22021 case "$useposix" in
22022 true|define|y) avail_ext="$avail_ext $xxx" ;;
22026 case "$d_socket" in
22029 beos) ;; # not unless BONE
22030 *) avail_ext="$avail_ext $xxx" ;;
22035 Sys/Syslog|sys/syslog)
22036 : XXX syslog requires socket
22037 case "$d_socket" in
22038 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22042 case "$usethreads" in
22044 case "$use5005threads" in
22045 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22049 threads|threads/shared)
22050 # threads and threads::shared are special cases.
22051 # To stop people from asking "Perl 5.8.0 was supposed
22052 # to have this new fancy threads implementation but my
22053 # perl doesn't have it" and from people trying to
22054 # (re)install the threads module using CPAN.pm and
22055 # CPAN.pm then offering to reinstall Perl 5.8.0,
22056 # the threads.pm and threads/shared.pm will always be
22057 # there, croaking informatively ("you need to rebuild
22058 # all of Perl with threads, sorry") when threads haven't
22059 # been compiled in.
22061 avail_ext="$avail_ext $xxx"
22067 cygwin) avail_ext="$avail_ext $xxx" ;;
22070 XS/APItest|xs/apitest)
22071 # This is just for testing. Skip it unless we have dynamic loading.
22074 $define) avail_ext="$avail_ext $xxx" ;;
22077 XS/Typemap|xs/typemap)
22078 # This is just for testing. Skip it unless we have dynamic loading.
22080 $define) avail_ext="$avail_ext $xxx" ;;
22083 *) avail_ext="$avail_ext $xxx"
22092 case "$onlyextensions" in
22094 *) keepextensions=''
22095 echo "You have requested that only certain extensions be included..." >&4
22096 for i in $onlyextensions; do
22097 case " $avail_ext " in
22099 echo "Keeping extension $i."
22100 keepextensions="$keepextensions $i"
22102 *) echo "Ignoring extension $i." ;;
22105 avail_ext="$keepextensions"
22109 case "$noextensions" in
22111 *) keepextensions=''
22112 echo "You have requested that certain extensions be ignored..." >&4
22113 for i in $avail_ext; do
22114 case " $noextensions " in
22115 *" $i "*) echo "Ignoring extension $i." ;;
22116 *) echo "Keeping extension $i.";
22117 keepextensions="$keepextensions $i"
22121 avail_ext="$keepextensions"
22125 : Now see which nonxs extensions are supported on this system.
22126 : For now assume all are.
22128 for xxx in $nonxs_extensions ; do
22130 *) nonxs_ext="$nonxs_ext $xxx"
22142 A number of extensions are supplied with $package. You may choose to
22143 compile these extensions for dynamic loading (the default), compile
22144 them into the $package executable (static loading), or not include
22145 them at all. Answer "none" to include no extensions.
22146 Note that DynaLoader is always built and need not be mentioned here.
22149 case "$dynamic_ext" in
22151 : Exclude those listed in static_ext
22153 for xxx in $avail_ext; do
22154 case " $static_ext " in
22156 *) dflt="$dflt $xxx" ;;
22163 *) dflt="$dynamic_ext"
22164 # Perhaps we are reusing an old out-of-date config.sh.
22167 if test X"$dynamic_ext" != X"$avail_ext"; then
22169 NOTICE: Your previous config.sh list may be incorrect.
22170 The extensions now available to you are
22172 but the default list from your previous config.sh is
22184 rp="What extensions do you wish to load dynamically?"
22187 none) dynamic_ext=' ' ;;
22188 *) dynamic_ext="$ans" ;;
22191 case "$static_ext" in
22193 : Exclude those already listed in dynamic linking
22195 for xxx in $avail_ext; do
22196 case " $dynamic_ext " in
22198 *) dflt="$dflt $xxx" ;;
22205 *) dflt="$static_ext"
22212 rp="What extensions do you wish to load statically?"
22215 none) static_ext=' ' ;;
22216 *) static_ext="$ans" ;;
22221 A number of extensions are supplied with $package. Answer "none"
22222 to include no extensions.
22223 Note that DynaLoader is always built and need not be mentioned here.
22226 case "$static_ext" in
22227 '') dflt="$avail_ext" ;;
22228 *) dflt="$static_ext"
22229 # Perhaps we are reusing an old out-of-date config.sh.
22232 if test X"$static_ext" != X"$avail_ext"; then
22234 NOTICE: Your previous config.sh list may be incorrect.
22235 The extensions now available to you are
22237 but the default list from your previous config.sh is
22246 : Exclude those that are not xs extensions
22250 rp="What extensions do you wish to include?"
22253 none) static_ext=' ' ;;
22254 *) static_ext="$ans" ;;
22259 # Encode is a special case. If we are building Encode as a static
22260 # extension, we need to explicitly list its subextensions as well.
22261 # For other nested extensions, this is handled automatically by
22262 # the appropriate Makefile.PL.
22263 case " $static_ext " in
22264 *" Encode "*) # Add the subextensions of Encode
22266 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22267 static_ext="$static_ext Encode/$xxx"
22273 set X $dynamic_ext $static_ext $nonxs_ext
22277 # Sanity check: We require an extension suitable for use with
22278 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22279 # should show up as failures in the test suite, but it's helpful to
22280 # catch them now.) The 'extensions' list is normally sorted
22281 # alphabetically, so we need to accept either
22282 # DB_File ... Fcntl ... IO ....
22283 # or something like
22284 # Fcntl ... NDBM_File ... IO ....
22285 case " $extensions" in
22286 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22287 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22288 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22289 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22290 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22294 : Remove libraries needed only for extensions
22295 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22296 : The exception is SunOS 4.x, which needs them.
22297 case "${osname}X${osvers}" in
22301 *) case "$usedl" in
22302 $define|true|[yY]*)
22303 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22307 *) perllibs="$libs"
22313 : Remove build directory name from cppstdin so it can be used from
22314 : either the present location or the final installed location.
22316 : Get out of the UU directory to get correct path name.
22318 case "$cppstdin" in
22320 echo "Stripping down cppstdin path name"
22326 : end of configuration questions
22328 echo "End of configuration questions."
22331 : back to where it started
22332 if test -d ../UU; then
22336 : configuration may be unconditionally patched via a 'config.arch' file
22337 if $test -f config.arch; then
22338 echo "I see a config.arch file, loading it." >&4
22342 : configuration may be patched via a 'config.over' file
22343 if $test -f config.over; then
22346 rp='I see a config.over file. Do you wish to load it?'
22349 n*) echo "OK, I'll ignore it.";;
22351 echo "Configuration override changes have been loaded."
22356 : in case they want portability, strip down executable paths
22357 case "$d_portable" in
22360 echo "Stripping down executable paths..." >&4
22361 for file in $loclist $trylist; do
22363 eval $file=`basename $temp`
22368 : create config.sh file
22370 echo "Creating config.sh..." >&4
22371 $spitshell <<EOT >config.sh
22374 # This file was produced by running the Configure script. It holds all the
22375 # definitions figured out by Configure. Should you modify one of these values,
22376 # do not forget to propagate your changes by running "Configure -der". You may
22377 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22380 # Package name : $package
22381 # Source directory : $src
22382 # Configuration time: $cf_time
22383 # Configured by : $cf_by
22384 # Target system : $myuname
22387 : Add in command line options if available
22388 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22390 $spitshell <<EOT >>config.sh
22399 Revision='$Revision'
22407 alignbytes='$alignbytes'
22408 ansi2knr='$ansi2knr'
22409 aphostname='$aphostname'
22410 api_revision='$api_revision'
22411 api_subversion='$api_subversion'
22412 api_version='$api_version'
22413 api_versionstring='$api_versionstring'
22416 archlibexp='$archlibexp'
22417 archname64='$archname64'
22418 archname='$archname'
22419 archobjs='$archobjs'
22420 asctime_r_proto='$asctime_r_proto'
22429 byteorder='$byteorder'
22431 castflags='$castflags'
22434 cccdlflags='$cccdlflags'
22435 ccdlflags='$ccdlflags'
22437 ccflags_uselargefiles='$ccflags_uselargefiles'
22439 ccsymbols='$ccsymbols'
22440 ccversion='$ccversion'
22442 cf_email='$cf_email'
22444 charbits='$charbits'
22445 charsize='$charsize'
22449 clocktype='$clocktype'
22451 compress='$compress'
22452 contains='$contains'
22456 cpp_stuff='$cpp_stuff'
22457 cppccsymbols='$cppccsymbols'
22458 cppflags='$cppflags'
22460 cppminus='$cppminus'
22462 cppstdin='$cppstdin'
22463 cppsymbols='$cppsymbols'
22464 crypt_r_proto='$crypt_r_proto'
22465 cryptlib='$cryptlib'
22467 ctermid_r_proto='$ctermid_r_proto'
22468 ctime_r_proto='$ctime_r_proto'
22469 d_Gconvert='$d_Gconvert'
22470 d_PRIEUldbl='$d_PRIEUldbl'
22471 d_PRIFUldbl='$d_PRIFUldbl'
22472 d_PRIGUldbl='$d_PRIGUldbl'
22473 d_PRIXU64='$d_PRIXU64'
22474 d_PRId64='$d_PRId64'
22475 d_PRIeldbl='$d_PRIeldbl'
22476 d_PRIfldbl='$d_PRIfldbl'
22477 d_PRIgldbl='$d_PRIgldbl'
22478 d_PRIi64='$d_PRIi64'
22479 d_PRIo64='$d_PRIo64'
22480 d_PRIu64='$d_PRIu64'
22481 d_PRIx64='$d_PRIx64'
22482 d_SCNfldbl='$d_SCNfldbl'
22483 d__fwalk='$d__fwalk'
22484 d_access='$d_access'
22485 d_accessx='$d_accessx'
22488 d_archlib='$d_archlib'
22489 d_asctime64='$d_asctime64'
22490 d_asctime_r='$d_asctime_r'
22493 d_attribute_deprecated='$d_attribute_deprecated'
22494 d_attribute_format='$d_attribute_format'
22495 d_attribute_malloc='$d_attribute_malloc'
22496 d_attribute_nonnull='$d_attribute_nonnull'
22497 d_attribute_noreturn='$d_attribute_noreturn'
22498 d_attribute_pure='$d_attribute_pure'
22499 d_attribute_unused='$d_attribute_unused'
22500 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22504 d_bsdgetpgrp='$d_bsdgetpgrp'
22505 d_bsdsetpgrp='$d_bsdsetpgrp'
22506 d_builtin_choose_expr='$d_builtin_choose_expr'
22507 d_builtin_expect='$d_builtin_expect'
22509 d_c99_variadic_macros='$d_c99_variadic_macros'
22510 d_casti32='$d_casti32'
22511 d_castneg='$d_castneg'
22512 d_charvspr='$d_charvspr'
22514 d_chroot='$d_chroot'
22515 d_chsize='$d_chsize'
22517 d_clearenv='$d_clearenv'
22518 d_closedir='$d_closedir'
22519 d_cmsghdr_s='$d_cmsghdr_s'
22521 d_copysignl='$d_copysignl'
22522 d_cplusplus='$d_cplusplus'
22524 d_crypt_r='$d_crypt_r'
22526 d_ctermid='$d_ctermid'
22527 d_ctermid_r='$d_ctermid_r'
22528 d_ctime64='$d_ctime64'
22529 d_ctime_r='$d_ctime_r'
22530 d_cuserid='$d_cuserid'
22531 d_dbl_dig='$d_dbl_dig'
22532 d_dbminitproto='$d_dbminitproto'
22533 d_difftime64='$d_difftime64'
22534 d_difftime='$d_difftime'
22535 d_dir_dd_fd='$d_dir_dd_fd'
22537 d_dirnamlen='$d_dirnamlen'
22538 d_dlerror='$d_dlerror'
22539 d_dlopen='$d_dlopen'
22540 d_dlsymun='$d_dlsymun'
22541 d_dosuid='$d_dosuid'
22542 d_drand48_r='$d_drand48_r'
22543 d_drand48proto='$d_drand48proto'
22545 d_eaccess='$d_eaccess'
22546 d_endgrent='$d_endgrent'
22547 d_endgrent_r='$d_endgrent_r'
22548 d_endhent='$d_endhent'
22549 d_endhostent_r='$d_endhostent_r'
22550 d_endnent='$d_endnent'
22551 d_endnetent_r='$d_endnetent_r'
22552 d_endpent='$d_endpent'
22553 d_endprotoent_r='$d_endprotoent_r'
22554 d_endpwent='$d_endpwent'
22555 d_endpwent_r='$d_endpwent_r'
22556 d_endsent='$d_endsent'
22557 d_endservent_r='$d_endservent_r'
22558 d_eofnblk='$d_eofnblk'
22559 d_eunice='$d_eunice'
22560 d_faststdio='$d_faststdio'
22561 d_fchdir='$d_fchdir'
22562 d_fchmod='$d_fchmod'
22563 d_fchown='$d_fchown'
22565 d_fcntl_can_lock='$d_fcntl_can_lock'
22566 d_fd_macros='$d_fd_macros'
22567 d_fd_set='$d_fd_set'
22568 d_fds_bits='$d_fds_bits'
22569 d_fgetpos='$d_fgetpos'
22570 d_finite='$d_finite'
22571 d_finitel='$d_finitel'
22572 d_flexfnam='$d_flexfnam'
22574 d_flockproto='$d_flockproto'
22576 d_fp_class='$d_fp_class'
22577 d_fpathconf='$d_fpathconf'
22578 d_fpclass='$d_fpclass'
22579 d_fpclassify='$d_fpclassify'
22580 d_fpclassl='$d_fpclassl'
22581 d_fpos64_t='$d_fpos64_t'
22582 d_frexpl='$d_frexpl'
22583 d_fs_data_s='$d_fs_data_s'
22584 d_fseeko='$d_fseeko'
22585 d_fsetpos='$d_fsetpos'
22586 d_fstatfs='$d_fstatfs'
22587 d_fstatvfs='$d_fstatvfs'
22589 d_ftello='$d_ftello'
22591 d_futimes='$d_futimes'
22592 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22593 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22594 d_getaddrinfo='$d_getaddrinfo'
22595 d_getcwd='$d_getcwd'
22596 d_getespwnam='$d_getespwnam'
22597 d_getfsstat='$d_getfsstat'
22598 d_getgrent='$d_getgrent'
22599 d_getgrent_r='$d_getgrent_r'
22600 d_getgrgid_r='$d_getgrgid_r'
22601 d_getgrnam_r='$d_getgrnam_r'
22602 d_getgrps='$d_getgrps'
22603 d_gethbyaddr='$d_gethbyaddr'
22604 d_gethbyname='$d_gethbyname'
22605 d_gethent='$d_gethent'
22606 d_gethname='$d_gethname'
22607 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22608 d_gethostbyname_r='$d_gethostbyname_r'
22609 d_gethostent_r='$d_gethostent_r'
22610 d_gethostprotos='$d_gethostprotos'
22611 d_getitimer='$d_getitimer'
22612 d_getlogin='$d_getlogin'
22613 d_getlogin_r='$d_getlogin_r'
22614 d_getmnt='$d_getmnt'
22615 d_getmntent='$d_getmntent'
22616 d_getnameinfo='$d_getnameinfo'
22617 d_getnbyaddr='$d_getnbyaddr'
22618 d_getnbyname='$d_getnbyname'
22619 d_getnent='$d_getnent'
22620 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22621 d_getnetbyname_r='$d_getnetbyname_r'
22622 d_getnetent_r='$d_getnetent_r'
22623 d_getnetprotos='$d_getnetprotos'
22624 d_getpagsz='$d_getpagsz'
22625 d_getpbyname='$d_getpbyname'
22626 d_getpbynumber='$d_getpbynumber'
22627 d_getpent='$d_getpent'
22628 d_getpgid='$d_getpgid'
22629 d_getpgrp2='$d_getpgrp2'
22630 d_getpgrp='$d_getpgrp'
22631 d_getppid='$d_getppid'
22632 d_getprior='$d_getprior'
22633 d_getprotobyname_r='$d_getprotobyname_r'
22634 d_getprotobynumber_r='$d_getprotobynumber_r'
22635 d_getprotoent_r='$d_getprotoent_r'
22636 d_getprotoprotos='$d_getprotoprotos'
22637 d_getprpwnam='$d_getprpwnam'
22638 d_getpwent='$d_getpwent'
22639 d_getpwent_r='$d_getpwent_r'
22640 d_getpwnam_r='$d_getpwnam_r'
22641 d_getpwuid_r='$d_getpwuid_r'
22642 d_getsbyname='$d_getsbyname'
22643 d_getsbyport='$d_getsbyport'
22644 d_getsent='$d_getsent'
22645 d_getservbyname_r='$d_getservbyname_r'
22646 d_getservbyport_r='$d_getservbyport_r'
22647 d_getservent_r='$d_getservent_r'
22648 d_getservprotos='$d_getservprotos'
22649 d_getspnam='$d_getspnam'
22650 d_getspnam_r='$d_getspnam_r'
22651 d_gettimeod='$d_gettimeod'
22652 d_gmtime64='$d_gmtime64'
22653 d_gmtime_r='$d_gmtime_r'
22654 d_gnulibc='$d_gnulibc'
22655 d_grpasswd='$d_grpasswd'
22656 d_hasmntopt='$d_hasmntopt'
22658 d_ilogbl='$d_ilogbl'
22659 d_inc_version_list='$d_inc_version_list'
22661 d_inetaton='$d_inetaton'
22662 d_inetntop='$d_inetntop'
22663 d_inetpton='$d_inetpton'
22664 d_int64_t='$d_int64_t'
22665 d_isascii='$d_isascii'
22666 d_isfinite='$d_isfinite'
22669 d_isnanl='$d_isnanl'
22670 d_killpg='$d_killpg'
22671 d_lchown='$d_lchown'
22672 d_ldbl_dig='$d_ldbl_dig'
22673 d_libm_lib_version='$d_libm_lib_version'
22675 d_localtime64='$d_localtime64'
22676 d_localtime_r='$d_localtime_r'
22677 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22678 d_locconv='$d_locconv'
22680 d_longdbl='$d_longdbl'
22681 d_longlong='$d_longlong'
22682 d_lseekproto='$d_lseekproto'
22684 d_madvise='$d_madvise'
22685 d_malloc_good_size='$d_malloc_good_size'
22686 d_malloc_size='$d_malloc_size'
22688 d_mbstowcs='$d_mbstowcs'
22689 d_mbtowc='$d_mbtowc'
22690 d_memchr='$d_memchr'
22691 d_memcmp='$d_memcmp'
22692 d_memcpy='$d_memcpy'
22693 d_memmove='$d_memmove'
22694 d_memset='$d_memset'
22696 d_mkdtemp='$d_mkdtemp'
22697 d_mkfifo='$d_mkfifo'
22698 d_mkstemp='$d_mkstemp'
22699 d_mkstemps='$d_mkstemps'
22700 d_mktime64='$d_mktime64'
22701 d_mktime='$d_mktime'
22704 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22705 d_modflproto='$d_modflproto'
22706 d_mprotect='$d_mprotect'
22708 d_msg_ctrunc='$d_msg_ctrunc'
22709 d_msg_dontroute='$d_msg_dontroute'
22710 d_msg_oob='$d_msg_oob'
22711 d_msg_peek='$d_msg_peek'
22712 d_msg_proxy='$d_msg_proxy'
22713 d_msgctl='$d_msgctl'
22714 d_msgget='$d_msgget'
22715 d_msghdr_s='$d_msghdr_s'
22716 d_msgrcv='$d_msgrcv'
22717 d_msgsnd='$d_msgsnd'
22719 d_munmap='$d_munmap'
22720 d_mymalloc='$d_mymalloc'
22722 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22724 d_nl_langinfo='$d_nl_langinfo'
22725 d_nv_preserves_uv='$d_nv_preserves_uv'
22726 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22727 d_off64_t='$d_off64_t'
22728 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22729 d_oldpthreads='$d_oldpthreads'
22730 d_oldsock='$d_oldsock'
22732 d_pathconf='$d_pathconf'
22734 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22735 d_phostname='$d_phostname'
22738 d_portable='$d_portable'
22740 d_prctl_set_name='$d_prctl_set_name'
22741 d_printf_format_null='$d_printf_format_null'
22742 d_procselfexe='$d_procselfexe'
22743 d_pseudofork='$d_pseudofork'
22744 d_pthread_atfork='$d_pthread_atfork'
22745 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22746 d_pthread_yield='$d_pthread_yield'
22748 d_pwchange='$d_pwchange'
22749 d_pwclass='$d_pwclass'
22750 d_pwcomment='$d_pwcomment'
22751 d_pwexpire='$d_pwexpire'
22752 d_pwgecos='$d_pwgecos'
22753 d_pwpasswd='$d_pwpasswd'
22754 d_pwquota='$d_pwquota'
22757 d_random_r='$d_random_r'
22758 d_readdir64_r='$d_readdir64_r'
22759 d_readdir='$d_readdir'
22760 d_readdir_r='$d_readdir_r'
22761 d_readlink='$d_readlink'
22763 d_recvmsg='$d_recvmsg'
22764 d_rename='$d_rename'
22765 d_rewinddir='$d_rewinddir'
22767 d_safebcpy='$d_safebcpy'
22768 d_safemcpy='$d_safemcpy'
22769 d_sanemcmp='$d_sanemcmp'
22770 d_sbrkproto='$d_sbrkproto'
22771 d_scalbnl='$d_scalbnl'
22772 d_sched_yield='$d_sched_yield'
22773 d_scm_rights='$d_scm_rights'
22774 d_seekdir='$d_seekdir'
22775 d_select='$d_select'
22777 d_semctl='$d_semctl'
22778 d_semctl_semid_ds='$d_semctl_semid_ds'
22779 d_semctl_semun='$d_semctl_semun'
22780 d_semget='$d_semget'
22782 d_sendmsg='$d_sendmsg'
22783 d_setegid='$d_setegid'
22784 d_seteuid='$d_seteuid'
22785 d_setgrent='$d_setgrent'
22786 d_setgrent_r='$d_setgrent_r'
22787 d_setgrps='$d_setgrps'
22788 d_sethent='$d_sethent'
22789 d_sethostent_r='$d_sethostent_r'
22790 d_setitimer='$d_setitimer'
22791 d_setlinebuf='$d_setlinebuf'
22792 d_setlocale='$d_setlocale'
22793 d_setlocale_r='$d_setlocale_r'
22794 d_setnent='$d_setnent'
22795 d_setnetent_r='$d_setnetent_r'
22796 d_setpent='$d_setpent'
22797 d_setpgid='$d_setpgid'
22798 d_setpgrp2='$d_setpgrp2'
22799 d_setpgrp='$d_setpgrp'
22800 d_setprior='$d_setprior'
22801 d_setproctitle='$d_setproctitle'
22802 d_setprotoent_r='$d_setprotoent_r'
22803 d_setpwent='$d_setpwent'
22804 d_setpwent_r='$d_setpwent_r'
22805 d_setregid='$d_setregid'
22806 d_setresgid='$d_setresgid'
22807 d_setresuid='$d_setresuid'
22808 d_setreuid='$d_setreuid'
22809 d_setrgid='$d_setrgid'
22810 d_setruid='$d_setruid'
22811 d_setsent='$d_setsent'
22812 d_setservent_r='$d_setservent_r'
22813 d_setsid='$d_setsid'
22814 d_setvbuf='$d_setvbuf'
22818 d_shmatprototype='$d_shmatprototype'
22819 d_shmctl='$d_shmctl'
22821 d_shmget='$d_shmget'
22822 d_sigaction='$d_sigaction'
22823 d_signbit='$d_signbit'
22824 d_sigprocmask='$d_sigprocmask'
22825 d_sigsetjmp='$d_sigsetjmp'
22826 d_sin6_scope_id='$d_sin6_scope_id'
22827 d_sitearch='$d_sitearch'
22828 d_snprintf='$d_snprintf'
22829 d_sockaddr_sa_len='$d_sockaddr_sa_len'
22830 d_sockatmark='$d_sockatmark'
22831 d_sockatmarkproto='$d_sockatmarkproto'
22832 d_socket='$d_socket'
22833 d_socklen_t='$d_socklen_t'
22834 d_sockpair='$d_sockpair'
22835 d_socks5_init='$d_socks5_init'
22836 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22838 d_srand48_r='$d_srand48_r'
22839 d_srandom_r='$d_srandom_r'
22840 d_sresgproto='$d_sresgproto'
22841 d_sresuproto='$d_sresuproto'
22842 d_statblks='$d_statblks'
22843 d_statfs_f_flags='$d_statfs_f_flags'
22844 d_statfs_s='$d_statfs_s'
22845 d_static_inline='$d_static_inline'
22846 d_statvfs='$d_statvfs'
22847 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22848 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22849 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22850 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22851 d_stdio_stream_array='$d_stdio_stream_array'
22852 d_stdiobase='$d_stdiobase'
22853 d_stdstdio='$d_stdstdio'
22854 d_strchr='$d_strchr'
22855 d_strcoll='$d_strcoll'
22856 d_strctcpy='$d_strctcpy'
22857 d_strerrm='$d_strerrm'
22858 d_strerror='$d_strerror'
22859 d_strerror_r='$d_strerror_r'
22860 d_strftime='$d_strftime'
22861 d_strlcat='$d_strlcat'
22862 d_strlcpy='$d_strlcpy'
22863 d_strtod='$d_strtod'
22864 d_strtol='$d_strtol'
22865 d_strtold='$d_strtold'
22866 d_strtoll='$d_strtoll'
22867 d_strtoq='$d_strtoq'
22868 d_strtoul='$d_strtoul'
22869 d_strtoull='$d_strtoull'
22870 d_strtouq='$d_strtouq'
22871 d_strxfrm='$d_strxfrm'
22872 d_suidsafe='$d_suidsafe'
22873 d_symlink='$d_symlink'
22874 d_syscall='$d_syscall'
22875 d_syscallproto='$d_syscallproto'
22876 d_sysconf='$d_sysconf'
22877 d_sysernlst='$d_sysernlst'
22878 d_syserrlst='$d_syserrlst'
22879 d_system='$d_system'
22880 d_tcgetpgrp='$d_tcgetpgrp'
22881 d_tcsetpgrp='$d_tcsetpgrp'
22882 d_telldir='$d_telldir'
22883 d_telldirproto='$d_telldirproto'
22885 d_timegm='$d_timegm'
22887 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22888 d_tm_tm_zone='$d_tm_tm_zone'
22889 d_tmpnam_r='$d_tmpnam_r'
22890 d_truncate='$d_truncate'
22891 d_ttyname_r='$d_ttyname_r'
22892 d_tzname='$d_tzname'
22893 d_u32align='$d_u32align'
22894 d_ualarm='$d_ualarm'
22897 d_union_semun='$d_union_semun'
22898 d_unordered='$d_unordered'
22899 d_unsetenv='$d_unsetenv'
22900 d_usleep='$d_usleep'
22901 d_usleepproto='$d_usleepproto'
22903 d_vendorarch='$d_vendorarch'
22904 d_vendorbin='$d_vendorbin'
22905 d_vendorlib='$d_vendorlib'
22906 d_vendorscript='$d_vendorscript'
22908 d_void_closedir='$d_void_closedir'
22909 d_voidsig='$d_voidsig'
22910 d_voidtty='$d_voidtty'
22911 d_volatile='$d_volatile'
22912 d_vprintf='$d_vprintf'
22913 d_vsnprintf='$d_vsnprintf'
22915 d_waitpid='$d_waitpid'
22916 d_wcstombs='$d_wcstombs'
22917 d_wctomb='$d_wctomb'
22918 d_writev='$d_writev'
22921 db_hashtype='$db_hashtype'
22922 db_prefixtype='$db_prefixtype'
22923 db_version_major='$db_version_major'
22924 db_version_minor='$db_version_minor'
22925 db_version_patch='$db_version_patch'
22926 defvoidused='$defvoidused'
22927 direntrytype='$direntrytype'
22930 doublesize='$doublesize'
22932 drand48_r_proto='$drand48_r_proto'
22934 dynamic_ext='$dynamic_ext'
22940 endgrent_r_proto='$endgrent_r_proto'
22941 endhostent_r_proto='$endhostent_r_proto'
22942 endnetent_r_proto='$endnetent_r_proto'
22943 endprotoent_r_proto='$endprotoent_r_proto'
22944 endpwent_r_proto='$endpwent_r_proto'
22945 endservent_r_proto='$endservent_r_proto'
22946 eunicefix='$eunicefix'
22949 extensions='$extensions'
22950 extern_C='$extern_C'
22952 fflushNULL='$fflushNULL'
22953 fflushall='$fflushall'
22955 firstmakefile='$firstmakefile'
22957 fpossize='$fpossize'
22958 fpostype='$fpostype'
22959 freetype='$freetype'
22962 full_csh='$full_csh'
22963 full_sed='$full_sed'
22964 gccansipedantic='$gccansipedantic'
22965 gccosandvers='$gccosandvers'
22966 gccversion='$gccversion'
22967 getgrent_r_proto='$getgrent_r_proto'
22968 getgrgid_r_proto='$getgrgid_r_proto'
22969 getgrnam_r_proto='$getgrnam_r_proto'
22970 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22971 gethostbyname_r_proto='$gethostbyname_r_proto'
22972 gethostent_r_proto='$gethostent_r_proto'
22973 getlogin_r_proto='$getlogin_r_proto'
22974 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22975 getnetbyname_r_proto='$getnetbyname_r_proto'
22976 getnetent_r_proto='$getnetent_r_proto'
22977 getprotobyname_r_proto='$getprotobyname_r_proto'
22978 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22979 getprotoent_r_proto='$getprotoent_r_proto'
22980 getpwent_r_proto='$getpwent_r_proto'
22981 getpwnam_r_proto='$getpwnam_r_proto'
22982 getpwuid_r_proto='$getpwuid_r_proto'
22983 getservbyname_r_proto='$getservbyname_r_proto'
22984 getservbyport_r_proto='$getservbyport_r_proto'
22985 getservent_r_proto='$getservent_r_proto'
22986 getspnam_r_proto='$getspnam_r_proto'
22987 gidformat='$gidformat'
22993 gmtime_r_proto='$gmtime_r_proto'
22994 gnulibc_version='$gnulibc_version'
22996 groupcat='$groupcat'
22997 groupstype='$groupstype'
23000 h_sysfile='$h_sysfile'
23003 html1dir='$html1dir'
23004 html1direxp='$html1direxp'
23005 html3dir='$html3dir'
23006 html3direxp='$html3direxp'
23015 i_arpainet='$i_arpainet'
23016 i_assert='$i_assert'
23017 i_bsdioctl='$i_bsdioctl'
23021 i_dirent='$i_dirent'
23027 i_fp_class='$i_fp_class'
23029 i_gdbm_ndbm='$i_gdbm_ndbm'
23030 i_gdbmndbm='$i_gdbmndbm'
23032 i_ieeefp='$i_ieeefp'
23033 i_inttypes='$i_inttypes'
23034 i_langinfo='$i_langinfo'
23035 i_libutil='$i_libutil'
23036 i_limits='$i_limits'
23037 i_locale='$i_locale'
23038 i_machcthr='$i_machcthr'
23039 i_malloc='$i_malloc'
23040 i_mallocmalloc='$i_mallocmalloc'
23042 i_memory='$i_memory'
23043 i_mntent='$i_mntent'
23046 i_neterrno='$i_neterrno'
23047 i_netinettcp='$i_netinettcp'
23051 i_pthread='$i_pthread'
23053 i_rpcsvcdbm='$i_rpcsvcdbm'
23056 i_shadow='$i_shadow'
23058 i_stdarg='$i_stdarg'
23059 i_stdbool='$i_stdbool'
23060 i_stddef='$i_stddef'
23061 i_stdlib='$i_stdlib'
23062 i_string='$i_string'
23063 i_sunmath='$i_sunmath'
23064 i_sysaccess='$i_sysaccess'
23065 i_sysdir='$i_sysdir'
23066 i_sysfile='$i_sysfile'
23067 i_sysfilio='$i_sysfilio'
23069 i_sysioctl='$i_sysioctl'
23070 i_syslog='$i_syslog'
23071 i_sysmman='$i_sysmman'
23072 i_sysmode='$i_sysmode'
23073 i_sysmount='$i_sysmount'
23074 i_sysndir='$i_sysndir'
23075 i_sysparam='$i_sysparam'
23076 i_syspoll='$i_syspoll'
23077 i_sysresrc='$i_sysresrc'
23078 i_syssecrt='$i_syssecrt'
23079 i_sysselct='$i_sysselct'
23080 i_syssockio='$i_syssockio'
23081 i_sysstat='$i_sysstat'
23082 i_sysstatfs='$i_sysstatfs'
23083 i_sysstatvfs='$i_sysstatvfs'
23084 i_systime='$i_systime'
23085 i_systimek='$i_systimek'
23086 i_systimes='$i_systimes'
23087 i_systypes='$i_systypes'
23088 i_sysuio='$i_sysuio'
23090 i_sysutsname='$i_sysutsname'
23091 i_sysvfs='$i_sysvfs'
23092 i_syswait='$i_syswait'
23093 i_termio='$i_termio'
23094 i_termios='$i_termios'
23096 i_unistd='$i_unistd'
23099 i_values='$i_values'
23100 i_varargs='$i_varargs'
23101 i_varhdr='$i_varhdr'
23103 ignore_versioned_solibs='$ignore_versioned_solibs'
23104 inc_version_list='$inc_version_list'
23105 inc_version_list_init='$inc_version_list_init'
23108 initialinstalllocation='$initialinstalllocation'
23109 installarchlib='$installarchlib'
23110 installbin='$installbin'
23111 installhtml1dir='$installhtml1dir'
23112 installhtml3dir='$installhtml3dir'
23113 installman1dir='$installman1dir'
23114 installman3dir='$installman3dir'
23115 installprefix='$installprefix'
23116 installprefixexp='$installprefixexp'
23117 installprivlib='$installprivlib'
23118 installscript='$installscript'
23119 installsitearch='$installsitearch'
23120 installsitebin='$installsitebin'
23121 installsitehtml1dir='$installsitehtml1dir'
23122 installsitehtml3dir='$installsitehtml3dir'
23123 installsitelib='$installsitelib'
23124 installsiteman1dir='$installsiteman1dir'
23125 installsiteman3dir='$installsiteman3dir'
23126 installsitescript='$installsitescript'
23127 installstyle='$installstyle'
23128 installusrbinperl='$installusrbinperl'
23129 installvendorarch='$installvendorarch'
23130 installvendorbin='$installvendorbin'
23131 installvendorhtml1dir='$installvendorhtml1dir'
23132 installvendorhtml3dir='$installvendorhtml3dir'
23133 installvendorlib='$installvendorlib'
23134 installvendorman1dir='$installvendorman1dir'
23135 installvendorman3dir='$installvendorman3dir'
23136 installvendorscript='$installvendorscript'
23138 issymlink='$issymlink'
23139 ivdformat='$ivdformat'
23142 known_extensions='$known_extensions'
23145 lddlflags='$lddlflags'
23147 ldflags_uselargefiles='$ldflags_uselargefiles'
23148 ldlibpthname='$ldlibpthname'
23155 libsdirs='$libsdirs'
23156 libsfiles='$libsfiles'
23157 libsfound='$libsfound'
23158 libspath='$libspath'
23159 libswanted='$libswanted'
23160 libswanted_uselargefiles='$libswanted_uselargefiles'
23166 localtime_r_proto='$localtime_r_proto'
23167 locincpth='$locincpth'
23168 loclibpth='$loclibpth'
23169 longdblsize='$longdblsize'
23170 longlongsize='$longlongsize'
23171 longsize='$longsize'
23175 lseeksize='$lseeksize'
23176 lseektype='$lseektype'
23179 madlyobj='$madlyobj'
23180 madlysrc='$madlysrc'
23184 make_set_make='$make_set_make'
23185 mallocobj='$mallocobj'
23186 mallocsrc='$mallocsrc'
23187 malloctype='$malloctype'
23189 man1direxp='$man1direxp'
23192 man3direxp='$man3direxp'
23194 mips_type='$mips_type'
23195 mistrustnm='$mistrustnm'
23197 mmaptype='$mmaptype'
23198 modetype='$modetype'
23200 multiarch='$multiarch'
23202 myarchname='$myarchname'
23203 mydomain='$mydomain'
23204 myhostname='$myhostname'
23207 need_va_copy='$need_va_copy'
23208 netdb_hlen_type='$netdb_hlen_type'
23209 netdb_host_type='$netdb_host_type'
23210 netdb_name_type='$netdb_name_type'
23211 netdb_net_type='$netdb_net_type'
23214 nm_so_opt='$nm_so_opt'
23215 nonxs_ext='$nonxs_ext'
23217 nvEUformat='$nvEUformat'
23218 nvFUformat='$nvFUformat'
23219 nvGUformat='$nvGUformat'
23220 nv_overflows_integers_at='$nv_overflows_integers_at'
23221 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23222 nveformat='$nveformat'
23223 nvfformat='$nvfformat'
23224 nvgformat='$nvgformat'
23227 o_nonblock='$o_nonblock'
23229 old_pthread_create_joinable='$old_pthread_create_joinable'
23230 optimize='$optimize'
23231 orderlib='$orderlib'
23234 otherlibdirs='$otherlibdirs'
23238 patchlevel='$patchlevel'
23239 path_sep='$path_sep'
23242 perl_patchlevel='$perl_patchlevel'
23243 perl_static_inline='$perl_static_inline'
23244 perladmin='$perladmin'
23245 perllibs='$perllibs'
23246 perlpath='$perlpath'
23248 phostname='$phostname'
23254 prefixexp='$prefixexp'
23256 privlibexp='$privlibexp'
23257 procselfexe='$procselfexe'
23258 prototype='$prototype'
23260 quadkind='$quadkind'
23261 quadtype='$quadtype'
23262 randbits='$randbits'
23263 randfunc='$randfunc'
23264 random_r_proto='$random_r_proto'
23265 randseedtype='$randseedtype'
23267 rd_nodata='$rd_nodata'
23268 readdir64_r_proto='$readdir64_r_proto'
23269 readdir_r_proto='$readdir_r_proto'
23270 revision='$revision'
23276 sGMTIME_max='$sGMTIME_max'
23277 sGMTIME_min='$sGMTIME_min'
23278 sLOCALTIME_max='$sLOCALTIME_max'
23279 sLOCALTIME_min='$sLOCALTIME_min'
23280 sPRIEUldbl='$sPRIEUldbl'
23281 sPRIFUldbl='$sPRIFUldbl'
23282 sPRIGUldbl='$sPRIGUldbl'
23283 sPRIXU64='$sPRIXU64'
23285 sPRIeldbl='$sPRIeldbl'
23286 sPRIfldbl='$sPRIfldbl'
23287 sPRIgldbl='$sPRIgldbl'
23292 sSCNfldbl='$sSCNfldbl'
23293 sched_yield='$sched_yield'
23294 scriptdir='$scriptdir'
23295 scriptdirexp='$scriptdirexp'
23297 seedfunc='$seedfunc'
23298 selectminbits='$selectminbits'
23299 selecttype='$selecttype'
23300 sendmail='$sendmail'
23301 setgrent_r_proto='$setgrent_r_proto'
23302 sethostent_r_proto='$sethostent_r_proto'
23303 setlocale_r_proto='$setlocale_r_proto'
23304 setnetent_r_proto='$setnetent_r_proto'
23305 setprotoent_r_proto='$setprotoent_r_proto'
23306 setpwent_r_proto='$setpwent_r_proto'
23307 setservent_r_proto='$setservent_r_proto'
23310 sharpbang='$sharpbang'
23311 shmattype='$shmattype'
23312 shortsize='$shortsize'
23315 sig_count='$sig_count'
23316 sig_name='$sig_name'
23317 sig_name_init='$sig_name_init'
23319 sig_num_init='$sig_num_init'
23320 sig_size='$sig_size'
23321 signal_t='$signal_t'
23322 sitearch='$sitearch'
23323 sitearchexp='$sitearchexp'
23325 sitebinexp='$sitebinexp'
23326 sitehtml1dir='$sitehtml1dir'
23327 sitehtml1direxp='$sitehtml1direxp'
23328 sitehtml3dir='$sitehtml3dir'
23329 sitehtml3direxp='$sitehtml3direxp'
23331 sitelib_stem='$sitelib_stem'
23332 sitelibexp='$sitelibexp'
23333 siteman1dir='$siteman1dir'
23334 siteman1direxp='$siteman1direxp'
23335 siteman3dir='$siteman3dir'
23336 siteman3direxp='$siteman3direxp'
23337 siteprefix='$siteprefix'
23338 siteprefixexp='$siteprefixexp'
23339 sitescript='$sitescript'
23340 sitescriptexp='$sitescriptexp'
23341 sizesize='$sizesize'
23342 sizetype='$sizetype'
23346 sockethdr='$sockethdr'
23347 socketlib='$socketlib'
23348 socksizetype='$socksizetype'
23350 spackage='$spackage'
23351 spitshell='$spitshell'
23352 srand48_r_proto='$srand48_r_proto'
23353 srandom_r_proto='$srandom_r_proto'
23355 ssizetype='$ssizetype'
23356 st_ino_sign='$st_ino_sign'
23357 st_ino_size='$st_ino_size'
23358 startperl='$startperl'
23360 static_ext='$static_ext'
23362 stdio_base='$stdio_base'
23363 stdio_bufsiz='$stdio_bufsiz'
23364 stdio_cnt='$stdio_cnt'
23365 stdio_filbuf='$stdio_filbuf'
23366 stdio_ptr='$stdio_ptr'
23367 stdio_stream_array='$stdio_stream_array'
23368 strerror_r_proto='$strerror_r_proto'
23371 subversion='$subversion'
23375 targetarch='$targetarch'
23379 timeincl='$timeincl'
23380 timetype='$timetype'
23381 tmpnam_r_proto='$tmpnam_r_proto'
23387 ttyname_r_proto='$ttyname_r_proto'
23396 uidformat='$uidformat'
23402 uquadtype='$uquadtype'
23403 use5005threads='$use5005threads'
23404 use64bitall='$use64bitall'
23405 use64bitint='$use64bitint'
23406 usecrosscompile='$usecrosscompile'
23407 usedevel='$usedevel'
23409 usedtrace='$usedtrace'
23410 usefaststdio='$usefaststdio'
23411 useithreads='$useithreads'
23412 uselargefiles='$uselargefiles'
23413 uselongdouble='$uselongdouble'
23414 usemallocwrap='$usemallocwrap'
23415 usemorebits='$usemorebits'
23416 usemultiplicity='$usemultiplicity'
23417 usemymalloc='$usemymalloc'
23419 useopcode='$useopcode'
23420 useperlio='$useperlio'
23421 useposix='$useposix'
23422 usereentrant='$usereentrant'
23423 userelocatableinc='$userelocatableinc'
23425 useshrplib='$useshrplib'
23426 usesitecustomize='$usesitecustomize'
23427 usesocks='$usesocks'
23428 usethreads='$usethreads'
23429 usevendorprefix='$usevendorprefix'
23430 usevfork='$usevfork'
23433 uvXUformat='$uvXUformat'
23434 uvoformat='$uvoformat'
23437 uvuformat='$uvuformat'
23438 uvxformat='$uvxformat'
23440 vendorarch='$vendorarch'
23441 vendorarchexp='$vendorarchexp'
23442 vendorbin='$vendorbin'
23443 vendorbinexp='$vendorbinexp'
23444 vendorhtml1dir='$vendorhtml1dir'
23445 vendorhtml1direxp='$vendorhtml1direxp'
23446 vendorhtml3dir='$vendorhtml3dir'
23447 vendorhtml3direxp='$vendorhtml3direxp'
23448 vendorlib='$vendorlib'
23449 vendorlib_stem='$vendorlib_stem'
23450 vendorlibexp='$vendorlibexp'
23451 vendorman1dir='$vendorman1dir'
23452 vendorman1direxp='$vendorman1direxp'
23453 vendorman3dir='$vendorman3dir'
23454 vendorman3direxp='$vendorman3direxp'
23455 vendorprefix='$vendorprefix'
23456 vendorprefixexp='$vendorprefixexp'
23457 vendorscript='$vendorscript'
23458 vendorscriptexp='$vendorscriptexp'
23460 version_patchlevel_string='$version_patchlevel_string'
23461 versiononly='$versiononly'
23463 voidflags='$voidflags'
23466 yaccflags='$yaccflags'
23471 : add special variables
23472 $test -f $src/patchlevel.h && \
23473 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23474 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23475 echo "PERL_CONFIG_SH=true" >>config.sh
23477 : propagate old symbols
23478 if $test -f UU/config.sh; then
23479 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23480 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23481 config.sh config.sh UU/oldconfig.sh |\
23482 $sort | $uniq -u >UU/oldsyms
23483 set X `$cat UU/oldsyms`
23489 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23491 echo ": Variables propagated from previous config.sh file." >>config.sh
23492 for sym in `$cat UU/oldsyms`; do
23493 echo " Propagating $hint variable "'$'"$sym..."
23494 eval 'tmp="$'"${sym}"'"'
23496 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23502 : Finish up by extracting the .SH files
23506 echo "Extraction done."
23516 If you'd like to make any changes to the config.sh file before I begin
23517 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23520 rp="Press return or use a shell escape to edit config.sh:"
23525 *) : in case they cannot read
23526 sh 1>&4 -c "$ans";;
23531 : if this fails, just run all the .SH files by hand
23540 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23547 Now you need to generate make dependencies by running "$make depend".
23548 You might prefer to run it in background: "$make depend > makedepend.out &"
23549 It can take a while, so you might not want to run it right now.
23554 rp="Run $make depend now?"
23558 $make depend && echo "Now you must run '$make'."
23561 echo "You must run '$make depend' then '$make'."
23564 elif test -f [Mm]akefile; then
23566 echo "Now you must run a $make."
23568 echo "Configure done."
23571 if $test -f Policy.sh; then
23574 If you compile $package on a different machine or from a different object
23575 directory, copy the Policy.sh file from this object directory to the
23576 new one before you run Configure -- this will help you with most of
23577 the policy defaults.
23581 if $test -f config.msg; then
23582 echo "Hmm. I also noted the following information while running:"
23584 $cat config.msg >&4
23587 $rm -f kit*isdone ark*isdone