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 by the tool
15 # called "metaconfig". Rather than working with this copy of Configure,
16 # you may wish to get metaconfig. Perl uses a modified version of this
17 # tool, available in the "dist" folder in the checkout of the git repo
18 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
19 # The original dist package (including metaconfig) is available via SVN:
20 # $ svn co https://svn.code.sf.net/p/dist/code/trunk/dist
22 # Though this script was generated by metaconfig from metaunits, it is
23 # OK to send patches against Configure itself. It's up to the Configure
24 # pumpkin to backport the patch to the metaunits if it is accepted.
25 # For more information on patching Configure, see pod/perlhack.pod
27 # The metaunits are also available from the public git repository:
28 # http://perl5.git.perl.org/metaconfig.git/ or
29 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
31 # See Porting/pumpkin.pod for more information on metaconfig.
33 # Generated using [metaconfig 3.5 PL0]
34 # (with additional metaconfig patches by perlbug@perl.org)
39 SCO csh still thinks true is false. Write to SCO today and tell them that next
40 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
42 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
43 we'd have to do is go in and swap the && and || tokens, wherever they are.)
45 [End of diatribe. We now return you to your regularly scheduled programming...]
49 OOPS! You naughty creature! You didn't run Configure with sh!
50 I will attempt to remedy the situation by running sh for you...
54 true || exec sh $0 $argv:q
56 (exit $?0) || cat c2$$
57 (exit $?0) || exec sh $0 $argv:q
60 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
63 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
64 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
65 *** Please read the README.plan9 for further instructions.
66 *** Cannot continue, aborting.
72 if test ! -c /dev/null ; then
75 *** I'm sorry, but /dev/null appears to be a file rather than a device.
76 *** Please consult your operating sytem's notes for making a device
78 *** Cannot continue, aborting.
84 : compute my invocation name
88 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
93 : Proper separator for the PATH environment variable
95 : On OS/2 this directory should exist if this is not floppy only system ":-]"
96 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
97 if test -n "$OS2_SHELL"; then
99 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
100 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
102 elif test -n "$DJGPP"; then
103 case "X${MACHTYPE:-nonesuchmach}" in
110 : Proper PATH setting
111 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
112 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
113 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
114 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
115 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
116 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
117 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
118 paths="$paths /sbin /usr/sbin /usr/libexec"
119 paths="$paths /system/gnu_library/bin"
123 case "$p_$PATH$p_" in
125 *) test -d $p && PATH=$PATH$p_$p ;;
132 : shall we be using ksh?
138 if (PATH=.; alias -x) >/dev/null 2>&1; then
141 if test -f /hp-ux -a -f /bin/ksh; then
142 needksh='to avoid sh bug in "here document" expansion'
144 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
145 if test X`/usr/bin/uname -v` = X4; then
146 avoidksh="to avoid AIX 4's /bin/sh"
150 if test -f /osf_boot -a -f /usr/sbin/setld; then
151 if test X`/usr/bin/uname -s` = XOSF1; then
152 avoidksh="to avoid Digital UNIX' ksh"
157 case "$inksh/$needksh" in
164 case "$inksh/$avoidksh" in
170 case "$inksh/$needksh-$avoidksh-" in
173 (I see you are using the Korn shell. Some ksh's blow up on $me,
174 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
181 echo "(Feeding myself to $newsh $reason.)"
183 Configure|*/Configure) exec $newsh $0 "$@";;
184 *) exec $newsh Configure "$@";;
188 test -x "${newsh}" || unset newsh
190 : if needed, set CDPATH to a harmless value that is not chatty
191 : avoid bash 2.02 problems with empty CDPATH.
195 *bash*) CDPATH='.' ;;
201 : Configure runs within the UU subdirectory
202 test -d UU || mkdir UU
346 useversionedarchname=''
352 initialinstalllocation=''
384 d_attribute_deprecated=''
385 d_attribute_format=''
386 d_attribute_malloc=''
387 d_attribute_nonnull=''
388 d_attribute_noreturn=''
390 d_attribute_unused=''
391 d_attribute_warn_unused_result=''
392 d_printf_format_null=''
396 d_builtin_choose_expr=''
399 d_c99_variadic_macros=''
449 endhostent_r_proto=''
455 endprotoent_r_proto=''
461 endservent_r_proto=''
526 gethostbyaddr_r_proto=''
528 gethostbyname_r_proto=''
530 gethostent_r_proto=''
543 getnetbyaddr_r_proto=''
545 getnetbyname_r_proto=''
559 d_getprotobyname_r=''
560 getprotobyname_r_proto=''
561 d_getprotobynumber_r=''
562 getprotobynumber_r_proto=''
564 getprotoent_r_proto=''
576 getservbyname_r_proto=''
578 getservbyport_r_proto=''
580 getservent_r_proto=''
613 d_lc_monetary_2008=''
618 d_libm_lib_version=''
625 d_localtime_r_needs_tzset=''
645 d_malloc_good_size=''
693 d_old_pthread_create_joinable=''
694 old_pthread_create_joinable=''
696 d_pthread_attr_setscope=''
744 sethostent_r_proto=''
761 setprotoent_r_proto=''
773 setservent_r_proto=''
795 d_ipv6_mreq_source=''
812 d_sprintf_returns_strlen=''
825 perl_static_inline=''
830 d_stdio_ptr_lval_nochange_cnt=''
831 d_stdio_ptr_lval_sets_cnt=''
983 d_gdbm_ndbm_h_uses_prototypes=''
984 d_gdbmndbm_h_uses_prototypes=''
986 d_ndbm_h_uses_prototypes=''
1062 d_inc_version_list=''
1064 inc_version_list_init=''
1072 installusrbinperl=''
1088 ignore_versioned_solibs=''
1152 d_perl_otherlibdirs=''
1160 api_versionstring=''
1166 version_patchlevel_string=''
1170 d_nv_preserves_uv=''
1171 d_nv_zero_is_allbits_zero=''
1182 nv_overflows_integers_at=''
1183 nv_preserves_uv_bits=''
1256 installsitehtml1dir=''
1259 installsitehtml3dir=''
1266 installsiteman1dir=''
1269 installsiteman3dir=''
1274 installsitescript=''
1292 d_stdio_stream_array=''
1293 stdio_stream_array=''
1311 usekernprocpathname=''
1312 ccflags_uselargefiles=''
1313 ldflags_uselargefiles=''
1314 libswanted_uselargefiles=''
1323 usensgetexecutablepath=''
1337 installvendorarch=''
1344 installvendorhtml1dir=''
1346 vendorhtml1direxp=''
1347 installvendorhtml3dir=''
1349 vendorhtml3direxp=''
1355 installvendorman1dir=''
1358 installvendorman3dir=''
1365 installvendorscript=''
1376 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1379 : We must find out about Eunice early
1381 if test -f /etc/unixtovms; then
1382 eunicefix=/etc/unixtovms
1384 if test -f /etc/unixtovms.exe; then
1385 eunicefix=/etc/unixtovms.exe
1388 : Set executable suffix now -- needed before hints available
1389 if test -f "/libs/version.library"; then
1392 elif test -f "/system/gnu_library/bin/ar.pm"; then
1395 elif test -n "$DJGPP"; then
1398 elif test -f /kern/cookiejar; then
1401 elif test -d c:/. -o -n "$is_os2" ; then
1408 : Trailing extension. Override this in a hint file, if needed.
1409 : Extra object files, if any, needed on this platform.
1412 : Possible local include directories to search.
1413 : Set locincpth to "" in a hint file to defeat local include searches.
1414 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1415 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1417 : no include file wanted by default
1420 : Enable -DEBUGGING and -DDEBUGGING from the command line
1425 : change the next line if compiling for Xenix/286 on Xenix/386
1426 xlibpth='/usr/lib/386 /lib/386'
1427 : Possible local library directories to search.
1428 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1429 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1431 : general looking path for locating libraries
1432 glibpth="/lib /usr/lib $xlibpth"
1433 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1434 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1435 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1436 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1438 : Private path used by Configure to find libraries. Its value
1439 : is prepended to libpth. This variable takes care of special
1440 : machines, like the mips. Usually, it should be empty.
1443 : default library list
1445 : some systems want to use only the non-versioned libso:s
1446 ignore_versioned_solibs=''
1447 : set usethreads on the Configure command line to enable threads.
1448 usereentrant='undef'
1452 : set useposix=false in your hint file to disable the POSIX extension.
1454 : set useopcode=false in your hint file to disable the Opcode extension.
1457 ccflags_uselargefiles=''
1458 ldflags_uselargefiles=''
1459 libswanted_uselargefiles=''
1460 : set usemultiplicity on the Configure command line to enable multiplicity.
1461 : set usesocks on the Configure command line to enable socks.
1462 : List of libraries we want.
1463 : If anyone needs extra -lxxx, put those in a hint file.
1464 libswanted="cl pthread socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld"
1465 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1466 : We probably want to search /usr/shlib before most other libraries.
1467 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1468 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1469 glibpth="/usr/shlib $glibpth"
1470 : Do not use vfork unless overridden by a hint file.
1473 : Find the basic shell for Bourne shell scripts
1477 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1480 if test -f "$xxx"; then
1483 : Build up a list and do a single loop so we can 'break' out.
1484 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1485 for xxx in sh bash ksh pdksh ash; do
1487 try="$try ${p}/${xxx}"
1491 if test -f "$xxx"; then
1494 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1497 elif test -f "$xxx.exe"; then
1508 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1510 Usually it's in /bin/sh. How did you even get this far?
1511 Please contact me (Perl Maintainers) at perlbug@perl.org and
1512 we'll try to straighten this all out.
1518 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1519 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1522 : see if sh knows # comments
1523 if `$sh -c '#' >/dev/null 2>&1`; then
1527 test -f $xcat$_exe || xcat=/usr/bin/cat
1528 if test ! -f $xcat$_exe; then
1529 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1530 if test -f $p/cat$_exe; then
1535 if test ! -f $xcat$_exe; then
1536 echo "Can't find cat anywhere!"
1540 echo "#!$xcat" >sharp
1543 ./sharp > today 2>/dev/null
1544 if test -s today; then
1547 echo "#! $xcat" > sharp
1550 ./sharp > today 2>/dev/null
1551 if test -s today; then
1559 echo "Your $sh doesn't grok # comments--I will strip them later on."
1562 echo "exec grep -v '^[ ]*#'" >spitshell
1564 $eunicefix spitshell
1565 spitshell=`pwd`/spitshell
1567 echo "I presume that if # doesn't work, #! won't work either!"
1572 : figure out how to guarantee sh startup
1574 '') startsh=${sharpbang}${sh} ;;
1586 : echo "Yup, it does."
1588 echo "Hmm... '$startsh' does not guarantee sh startup..."
1589 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1593 : Save command line options in file UU/cmdline.opt for later use in
1594 : generating config.sh.
1595 cat > cmdline.opt <<EOSH
1596 : Configure command line arguments.
1605 cat >>cmdline.opt <<EOSH
1606 config_arg$argn='$arg'
1608 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1611 arg_exp=`cat cmdl.opt`
1612 args_exp="$args_exp$args_sep'$arg_exp'"
1613 argn=`expr $argn + 1`
1618 : produce awk script to parse command line options
1619 cat >options.awk <<'EOF'
1621 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1623 len = length(optstr);
1624 for (i = 1; i <= len; i++) {
1625 c = substr(optstr, i, 1);
1626 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1637 if (substr(str, 1, 1) != "-") {
1638 printf("'%s'\n", str);
1642 for (i = 2; i <= len; i++) {
1643 c = substr(str, i, 1);
1645 printf("-%s\n", substr(str, i));
1651 printf("'%s'\n", substr(str, i + 1));
1664 : process the command line options
1665 set X `for arg in "$@"; do echo "X$arg"; done |
1666 sed -e s/X// | awk -f options.awk`
1671 : set up default values
1681 rm -f optdef.sh posthint.sh
1682 cat >optdef.sh <<EOS
1688 while test $# -gt 0; do
1690 -d) shift; fastread=yes;;
1691 -e) shift; alldone=cont;;
1695 if test -r "$1"; then
1698 echo "$me: cannot read config file $1." >&2
1704 -h) shift; error=true;;
1705 -r) shift; reuseval=true;;
1706 -s) shift; silent=true; realsilent=true;;
1707 -E) shift; alldone=exit;;
1708 -K) shift; knowitall=true;;
1709 -O) shift; override=true;;
1710 -S) shift; silent=true; extractsh=true;;
1715 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1716 echo "$me: ignoring -D $1" >&2
1719 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1720 *) echo "$1='define'" >> optdef.sh;;
1727 *=) echo "$1" >> optdef.sh;;
1729 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1730 echo "$me: ignoring -U $1" >&2
1732 *) echo "$1='undef'" >> optdef.sh;;
1743 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1747 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1748 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1754 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1755 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1756 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1757 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1758 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1759 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1765 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1767 echo "$yyy=''" >> posthint.sh ;;
1772 echo "$yyy='$zzz'" >> posthint.sh ;;
1774 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1776 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1781 echo "$yyy=$zzz" >> posthint.sh ;;
1782 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1786 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1789 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1797 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1798 [-U symbol] [-U symbol=] [-A command:symbol...]
1799 -d : use defaults for all answers.
1800 -e : go on without questioning past the production of config.sh.
1801 -f : specify an alternate default configuration file.
1802 -h : print this help message and exit (with an error status).
1803 -r : reuse C symbols value if possible (skips costly nm extraction).
1804 -s : silent mode, only echoes questions and essential information.
1805 -D : define symbol to have some value:
1806 -D symbol symbol gets the value 'define'
1807 -D symbol=value symbol gets the value 'value'
1808 common used examples (see INSTALL for more info):
1809 -Duse64bitint use 64bit integers
1810 -Duse64bitall use 64bit integers and pointers
1811 -Dusethreads use thread support
1812 -Dinc_version_list=none do not include older perl trees in @INC
1813 -DEBUGGING=none DEBUGGING options
1814 -Dcc=gcc choose your compiler
1815 -Dprefix=/opt/perl5 choose your destination
1816 -E : stop at the end of questions, after having produced config.sh.
1817 -K : do not use unless you know what you are doing.
1818 -O : let -D and -U override definitions from loaded configuration file.
1819 -S : perform variable substitutions on all .SH files (can mix with -f)
1820 -U : undefine symbol:
1821 -U symbol symbol gets the value 'undef'
1822 -U symbol= symbol gets completely empty
1824 -A : manipulate symbol after the platform specific hints have been applied:
1825 -A append:symbol=value append value to symbol
1826 -A symbol=value like append:, but with a separating space
1827 -A define:symbol=value define symbol to have value
1828 -A clear:symbol define symbol to be ''
1829 -A define:symbol define symbol to be 'define'
1830 -A eval:symbol=value define symbol to be eval of value
1831 -A prepend:symbol=value prepend value to symbol
1832 -A undef:symbol define symbol to be 'undef'
1833 -A undef:symbol= define symbol to be ''
1834 e.g.: -A prepend:libswanted='cl pthread '
1835 -A ccflags=-DSOME_MACRO
1836 -V : print version number and exit (with a zero status).
1843 case "$fastread$alldone" in
1846 case "$extractsh" in
1849 if test ! -t 0; then
1850 echo "Say 'sh Configure', not 'sh <Configure'"
1860 true) exec 1>/dev/null;;
1863 : run the defines and the undefines, if any, but leave the file out there...
1865 grep -q '\\' optdef.sh
1866 if test $? = 0; then
1867 echo "Configure does not support \\ in -D arguments"
1871 : create the posthint manipulation script and leave the file out there...
1876 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1877 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1878 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1879 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1880 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1883 : Some greps do not return status, grrr.
1884 echo "grimblepritz" >grimble
1885 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1887 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1893 : the following should work in any shell
1897 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1898 cat >contains <<'EOSS'
1899 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1904 : Find the path to the source tree
1907 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1911 *) src=`cd ../$src && pwd` ;;
1924 if test -f $rsrc/Configure && \
1925 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1927 : found it, so we are ok.
1930 for src in . .. ../.. ../../.. ../../../..; do
1931 if test -f ../$src/Configure && \
1932 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1943 Sorry, I can't seem to locate the source dir for $package. Please start
1944 Configure with an explicit path -- i.e. /some/path/Configure.
1952 echo "Sources for $package found in \"$src\"." >&4
1956 : script used to extract .SH files with variable substitutions
1957 cat >extract <<'EOS'
1959 echo "Doing variable substitutions on .SH files..."
1960 if test -f MANIFEST; then
1961 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1963 echo "(Looking for .SH files under the source directory.)"
1964 set x `(cd "$src"; find . -name "*.SH" -print)`
1968 0) set x `(cd "$src"; echo *.SH)`; shift;;
1970 if test ! -f "$src/$1"; then
1976 while test $name; do
1977 if test ! -d "$name"; then
1978 create="$name $create";
1979 name=`echo $name | sed -e "s|^[^/]*$||"`;
1980 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1985 for file in $create; do
1994 dir=`expr X$file : 'X\(.*\)/'`
1995 file=`expr X$file : 'X.*/\(.*\)'`
1996 (cd "$dir" && . ./$file)
2006 dir=`expr X$file : 'X\(.*\)/'`
2007 file=`expr X$file : 'X.*/\(.*\)'`
2008 (set x $dir; shift; eval $mkdir_p)
2009 sh <"$src/$dir/$file"
2018 if test -f "$src/config_h.SH"; then
2019 if test ! -f config.h; then
2020 : oops, they left it out of MANIFEST, probably, so do it anyway.
2021 . "$src/config_h.SH"
2026 : extract files and exit if asked to do so
2027 case "$extractsh" in
2029 case "$realsilent" in
2033 case "$config_sh" in
2034 '') config_sh='config.sh';;
2037 echo "Fetching answers from $config_sh..."
2040 test "$override" && . ./optdef.sh
2044 echo "Extraction done."
2049 : Eunice requires " " instead of "", can you believe it
2052 echo "Beginning of configuration questions for $package."
2054 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2056 : first determine how to suppress newline on echo command
2058 echo "Checking echo to see how to suppress newlines..."
2059 (echo "hi there\c" ; echo " ") >.echotmp
2060 if $contains c .echotmp >/dev/null 2>&1 ; then
2071 echo $n "The star should be here-->$c"
2075 : Now test for existence of everything in MANIFEST
2077 if test -f "$rsrc/MANIFEST"; then
2078 echo "First let's make sure your kit is complete. Checking..." >&4
2079 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2080 (split -l 50 2>/dev/null || split -50)
2083 for filelist in x??; do
2084 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2085 >/dev/null 2>>"$tmppwd/missing")
2087 if test -s missing; then
2091 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2093 You have the option of continuing the configuration process, despite the
2094 distinct possibility that your kit is damaged, by typing 'y'es. If you
2095 do, don't blame me if something goes wrong. I advise you to type 'n'o
2096 and contact the author (perlbug@perl.org).
2099 echo $n "Continue? [n] $c" >&4
2103 echo "Continuing..." >&4
2107 echo "ABORTING..." >&4
2112 echo "Looks good..."
2115 echo "There is no MANIFEST file. I hope your kit is complete !"
2119 : Find the appropriate value for a newline for tr
2121 if test -n "$DJGPP"; then
2124 if test X"$trnl" = X; then
2125 case "`echo foo|tr '\n' x 2>/dev/null`" in
2129 if test X"$trnl" = X; then
2130 case "`echo foo|tr '\012' x 2>/dev/null`" in
2131 foox) trnl='\012' ;;
2134 if test X"$trnl" = X; then
2135 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2136 fooxy) trnl='\n\r' ;;
2139 if test X"$trnl" = X; then
2142 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2148 : compute the number of columns on the terminal for proper question formatting
2153 : set up the echo used in my read
2154 myecho="case \"\$xxxm\" in
2155 '') echo $n \"\$rp $c\" >&4;;
2157 '') echo $n \"[\$xxxm] $c\";;
2159 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2161 echo $n \"[\$xxxm] $c\" >&4
2163 echo $n \"\$rp [\$xxxm] $c\" >&4
2169 : now set up to do reads with possible shell escape and default assignment
2175 case "\$fastread" in
2176 yes) case "\$dflt" in
2179 case "\$silent-\$rp" in
2184 *) case "\$silent" in
2185 true) case "\$rp" in
2190 while expr "X\$ans" : "X!" >/dev/null; do
2194 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2202 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2211 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2216 echo "(OK, I'll run with -d after this question.)" >&4
2219 echo "*** Sorry, \$1 not supported yet." >&4
2229 echo "*** Substitution done -- please confirm."
2231 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2236 echo "*** Error -- try again."
2243 case "\$ans\$xxxm\$nostick" in
2255 : create .config dir to save info across Configure sessions
2256 test -d ../.config || mkdir ../.config
2257 cat >../.config/README <<EOF
2258 This directory created by Configure to save information that should
2259 persist across sessions for $package.
2261 You may safely delete it if you wish.
2264 : See if we are using a devel version and want that
2265 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2268 usedevel="$define" ;;
2269 *) case "$xversion" in
2272 *** WHOA THERE!!! ***
2274 This is an UNSTABLE DEVELOPMENT release.
2275 The version of this $package distribution is $xversion, that is, odd,
2276 (as opposed to even) and that signifies a development release.
2277 If you want a maintenance release, you want an even-numbered version.
2279 Do ***NOT*** install this into production use.
2280 Data corruption and crashes are possible.
2282 It is most seriously suggested that you do not continue any further
2283 unless you want to help in developing and debugging Perl.
2285 If you *still* want to build perl, you can answer 'y' now,
2286 or pass -Dusedevel to Configure.
2289 rp='Do you really want to continue?'
2293 [yY]) echo >&4 "Okay, continuing."
2294 usedevel="$define" ;;
2295 *) echo >&4 "Okay, bye."
2306 case "$versiononly" in
2307 '') versiononly="$define" ;;
2309 case "$installusrbinperl" in
2310 '') installusrbinperl="$undef" ;;
2315 : general instructions
2318 user=`(logname) 2>/dev/null`
2320 '') user=`whoami 2>&1`;;
2322 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2325 rp='Would you like to see the instructions?'
2336 This installation shell script will examine your system and ask you questions
2337 to determine how the perl5 package should be installed. If you get
2338 stuck on a question, you may use a ! shell escape to start a subshell or
2339 execute a command. Many of the questions will have default answers in square
2340 brackets; typing carriage return will give you the default.
2342 On some of the questions which ask for file or directory names you are allowed
2343 to use the ~name construct to specify the login directory belonging to "name",
2344 even if you don't have a shell which knows about that. Questions where this is
2345 allowed will be marked "(~name ok)".
2349 dflt='Type carriage return to continue'
2353 The prompter used in this script allows you to use shell variables and
2354 backticks in your answers. You may use $1, $2, etc... to refer to the words
2355 in the default answer, as if the default line was a set of arguments given to a
2356 script shell. This means you may also use $* to repeat the whole default line,
2357 so you do not have to re-type everything to add something to the default.
2359 Every time there is a substitution, you will have to confirm. If there is an
2360 error (e.g. an unmatched backtick), the default answer will remain unchanged
2361 and you will be prompted again.
2363 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2364 the questions and use the computed defaults (or the previous answers if there
2365 was already a config.sh file). Type 'Configure -h' for a list of options.
2366 You may also start interactively and then answer '& -d' at any prompt to turn
2367 on the non-interactive behaviour for the remainder of the execution.
2373 Much effort has been expended to ensure that this shell script will run on any
2374 Unix system. If despite that it blows up on yours, your best bet is to edit
2375 Configure and run it again. If you can't run Configure for some reason,
2376 you'll have to generate a config.sh file by hand. Whatever problems you
2377 have, let me (perlbug@perl.org) know how I blew it.
2379 This installation script affects things in two ways:
2381 1) it may do direct variable substitutions on some of the files included
2383 2) it builds a config.h file for inclusion in C programs. You may edit
2384 any of these files as the need arises after running this script.
2386 If you make a mistake on a question, there is no easy way to back up to it
2387 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2388 files. Configure will offer to let you do this before it runs the SH files.
2391 dflt='Type carriage return to continue'
2393 case "$firsttime" in
2394 true) echo $user >>../.config/instruct;;
2398 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2399 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2400 if test "X$sysroot" = X; then
2405 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2406 # _sysroot is used in places where we need --sysroot=foo
2407 # but using the rest of the flags could cause issues.
2408 _sysroot="--sysroot=$sysroot";
2412 ccflags="$ccflags $_sysroot"
2417 ldflags="$ldflags $_sysroot"
2422 cppflags="$cppflags $_sysroot"
2424 # lddlflags updated below in lddlflags section;
2425 # same with cccdlflags
2429 # Adjust some defaults to also use $sysroot
2430 for var in xlibpth loclibpth locincpth glibpth; do
2433 for path in $xxx; do
2434 eval $var=\"\$$var $sysroot$path\"
2440 : find out where common programs are
2442 echo "Locating common programs..." >&4
2455 if test -d \$dir/\$thing; then
2461 for thisthing in \$dir/\$thing; do
2462 : just loop through to pick last item
2464 if test -f \$thisthing; then
2467 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2470 elif test -f \$dir/\$thing.exe; then
2471 if test -n "$DJGPP"; then
2472 echo \$dir/\$thing.exe
2473 elif test "$eunicefix" != ":"; then
2474 : on Eunice apparently
2527 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2528 pth="$pth $sysroot/lib $sysroot/usr/lib"
2529 for file in $loclist; do
2533 if test -f "$xxx"; then
2536 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2537 xxx=`./loc $file $file $pth`
2540 '') xxx=`./loc $file $file $pth`;;
2541 *) xxx=`./loc $xxx $xxx $pth`;;
2543 eval $file=$xxx$_exe
2547 echo $file is in $xxx.
2550 echo $file is in $xxx.
2553 echo "I don't know where '$file' is, and my life depends on it." >&4
2554 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2560 echo "Don't worry if any of the following aren't found..."
2562 for file in $trylist; do
2566 if test -f "$xxx"; then
2569 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2570 xxx=`./loc $file $file $pth`
2573 '') xxx=`./loc $file $file $pth`;;
2574 *) xxx=`./loc $xxx $xxx $pth`;;
2576 eval $file=$xxx$_exe
2580 echo $file is in $xxx.
2583 echo $file is in $xxx.
2586 echo "I don't see $file out there, $say."
2593 echo "Substituting grep for egrep."
2600 *) if $less -R </dev/null >/dev/null 2>&1; then
2601 echo "Substituting less -R for less."
2609 echo "Substituting cp for ln."
2618 echo "I can't find make or gmake, and my life depends on it." >&4
2619 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2627 *) # We can't have osname yet.
2628 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2629 # Assume that gmake, if found, is definitely GNU make
2630 # and prefer it over the system make.
2631 echo "Substituting gmake for make."
2639 echo "Hopefully test is built into your sh."
2642 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2643 echo "Using the test built into your sh."
2651 echo "Hopefully echo is built into your sh."
2656 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2657 $echo $n "hi there$c" >foo1
2658 echo $n "hi there$c" >foo2
2659 if cmp foo1 foo2 >/dev/null 2>&1; then
2660 echo "They are compatible. In fact, they may be identical."
2667 They are not compatible! You are probably running ksh on a non-USG system.
2668 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2669 have echo built in and we may have to run some Bourne shell scripts. That
2670 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2673 $echo $n "The star should be here-->$c"
2680 # This question was auctioned at YAPC::Europe-2007 in Vienna
2681 # I never promised you could answer it. I only auctioned the question.
2683 The following message is sponsored by
2685 Dresden.pm<--The stars should be here.
2687 Dear Perl user, system administrator or package
2688 maintainer, the Perl community sends greetings to
2689 you. Do you (emblematical) greet back [Y/n]? n
2693 : Check what type of C compiler we use
2697 cat <<'EOSC' >>trygcc
2702 int main(int argc, char *argv[]) {
2706 if $cc -o try $ccflags $ldflags try.c; then
2709 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2715 # Skip this test because it gives a false match on output like:
2716 # ./trygcc: line 23: cc: command not found
2717 # case "`$cc -v -c try.c 2>&1`" in
2718 # *gcc*) trygcc=no ;;
2720 if $test X"$trygcc" = Xyes; then
2721 if gcc -o try -c try.c; then
2723 echo "You seem to have a working gcc, though." >&4
2724 # Switching compilers may undo the work of hints files.
2725 # The most common problem is -D_REENTRANT for threads.
2726 # This heuristic catches that case, but gets false positives
2727 # if -Dusethreads was not actually specified. Better to
2728 # bail out here with a useful message than fail
2729 # mysteriously later. Should we perhaps just try to
2730 # re-invoke Configure -Dcc=gcc config_args ?
2731 if $test -f usethreads.cbu; then
2734 *** However, any setting of the C compiler flags (e.g. for thread support)
2735 *** will be lost. It may be necessary for you to restart Configure and
2736 *** add -Dcc=gcc to your Configure command line.
2739 rp="Would you like to go ahead and try gcc anyway?"
2742 rp="Would you like to use it?"
2745 if $test -f myread; then
2748 if $test -f UU/myread; then
2751 echo "Cannot find myread, sorry. Aborting." >&2
2756 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2769 cat <<'EOSC' >>checkcc
2774 int main(int argc, char *argv[]) {
2778 if $cc -o try $ccflags $ldflags try.c; then
2781 if $test X"$despair" = Xyes; then
2782 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2785 You need to find a working C compiler.
2786 Either (purchase and) install the C compiler supplied by your OS vendor,
2787 or for a free C compiler try http://gcc.gnu.org/
2788 I cannot continue any further, aborting.
2797 : determine whether symbolic links are supported
2800 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2801 echo "Symbolic links are supported." >&4
2804 echo "Symbolic links are NOT supported." >&4
2809 : determine whether symbolic links are supported
2813 echo "Checking how to test for symbolic links..." >&4
2815 if $test "X$issymlink" = X; then
2817 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2818 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2820 if test $? = 0; then
2823 echo "Your builtin 'test -h' may be broken." >&4
2826 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2829 if test -f "$p/$test"; then
2838 echo "Trying external '$test -h'." >&4
2839 issymlink="$test -h"
2840 if $test ! -h sym >/dev/null 2>&1; then
2841 echo "External '$test -h' is broken, too." >&4
2849 if $test "X$issymlink" = X; then
2850 if $test -L sym 2>/dev/null; then
2851 issymlink="$test -L"
2852 echo "The builtin '$test -L' worked." >&4
2855 if $test "X$issymlink" != X; then
2856 echo "You can test for symbolic links with '$issymlink'." >&4
2858 echo "I do not know how you can test for symbolic links." >&4
2862 *) echo "No symbolic links, so not testing for their testing..." >&4
2867 : Make symlinks util
2868 case "$mksymlinks" in
2871 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2874 *) case "$lns:$issymlink" in
2875 *"ln"*" -s:"*"test -"?)
2876 echo "Creating the symbolic links..." >&4
2878 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2888 print "# dir = ", dir, "file = ", file
2889 mf[dir] = mf[dir]" "source"/"dir"/"file;
2892 if (d != ".") { print("mkdir -p "d) }
2893 print("ln -sf "mf[d]" "d);
2895 }' source="$src" > UU/mksymlinks.$$
2899 if test ! -d t/base; then
2900 echo "Failed to create the subdirectories. Aborting." >&4
2904 if test ! -f t/base/lex.t; then
2905 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2908 if test ! -f win32/win32.c; then
2909 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2914 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2922 : Check for Cross-Compilation
2923 if $test "X$targethost" = "X"; then
2926 if $test "X$targetenv" = "X"; then
2929 case "$usecrosscompile" in
2931 $echo "Cross-compiling..."
2934 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2935 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2936 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2937 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2938 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2939 # leave out ld, choosing it is more complex
2940 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2941 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2942 # We are in a weird spot. Just before us, some values
2943 # were 'saved', to be restored after the hints are
2944 # run. This means that the changes we made to ar,
2945 # nm and ranlib will get reverted.
2946 # To avoid that, we hijack the saving mechanism and
2947 # have it save our new values.
2948 for file in ar nm ranlib; do
2950 eval $file=$xxx$_exe
2955 case "$targetarch" in
2956 '') echo "Targetarch not defined." >&4; croak=y ;;
2957 *) echo "Using targetarch $targetarch." >&4 ;;
2959 case "$targethost" in
2960 '') echo "Targethost not defined." >&4; croak=y ;;
2961 *) echo "Using targethost $targethost." >&4
2966 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2968 : compile a host miniperl and generate_uudmap, unless we got passed them
2969 if $test "X$hostperl" = X; then
2970 echo "Building host miniperl and generate_uudmap binaries" >&4
2978 $src/Configure -des -Dusedevel -Dmksymlinks
2980 case "$hostgenerate" in
2981 '') $make generate_uudmap
2982 hostgenerate=$src/host/generate_uudmap
2984 "$undef") hostgenerate=''
2987 hostperl=$src/host/miniperl
2990 hostosname=`$hostperl -le 'print $^O'`
2993 usecrosscompile="$undef"
2997 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2998 case "$targethost" in
2999 '') echo "Checking for cross-compile" >&4
3000 case "$usecrosscompile$multiarch" in
3001 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3002 if [ -f Makefile ]; then
3004 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3006 echo "Configure done."
3010 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3017 *) echo "Using targethost $targethost." >&4
3019 /*) run=$src/Cross/run
3020 targetmkdir=$src/Cross/mkdir
3022 from=$src/Cross/from
3024 *) pwd=`$test -f ../Configure & cd ..; pwd`
3026 targetmkdir=$pwd/Cross/mkdir
3028 from=$pwd/Cross/from
3031 case "$targetrun" in
3032 '') targetrun=ssh ;;
3037 case "$targetfrom" in
3038 '') targetfrom=scp ;;
3042 from=$from-$targetfrom
3043 case "$targetdir" in
3045 echo "Guessing targetdir $targetdir." >&4
3048 case "$targetuser" in
3050 echo "Guessing targetuser $targetuser." >&4
3053 case "$targetport" in
3055 echo "Guessing targetport $targetport." >&4
3058 case "$targetfrom" in
3062 case "$targetrun" in
3082 '') cwd=$targetdir ;;
3087 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3093 *) echo "Unknown targetrun '$targetrun'" >&4
3097 case "$targetmkdir" in
3099 cat >$targetmkdir <<EOF
3101 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3103 $chmod a+rx $targetmkdir
3105 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3117 $targetmkdir \`dirname \$f\`
3118 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3121 $targetmkdir $targetdir/\`dirname \$f\`
3122 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3135 $mkdir -p $targetdir/\`dirname \$f\`
3136 $cp \$f $targetdir/\$f || exit 1
3139 $targetmkdir $targetdir/\`dirname \$f\`
3140 $cp \$f $targetdir/\$f || exit 1
3147 *) echo "Unknown targetto '$targetto'" >&4
3151 case "$targetfrom" in
3158 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3163 cp) cat >$from <<EOF
3168 cp $targetdir/\$f . || exit 1
3173 *) echo "Unknown targetfrom '$targetfrom'" >&4
3177 if $test ! -f $run; then
3178 echo "Target 'run' script '$run' not found." >&4
3182 if $test ! -f $to; then
3183 echo "Target 'to' script '$to' not found." >&4
3187 if $test ! -f $from; then
3188 echo "Target 'from' script '$from' not found." >&4
3192 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3196 Using '$run' for remote execution,
3197 and '$from' and '$to'
3198 for remote file transfer.
3204 usecrosscompile="$undef"
3209 : see whether [:lower:] and [:upper:] are supported character classes
3211 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3213 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3217 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3218 # (0xd9 and 0xe2), therefore that is a nice testing point.
3219 if test "X$up" = X -o "X$low" = X; then
3220 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3226 if test "X$up" = X -o "X$low" = X; then
3227 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3233 if test "X$up" = X -o "X$low" = X; then
3234 case "`echo RS | od -x 2>/dev/null`" in
3236 echo "Hey, this might be EBCDIC." >&4
3237 if test "X$up" = X -o "X$low" = X; then
3238 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3239 rs) up='[A-IJ-RS-Z]'
3244 if test "X$up" = X -o "X$low" = X; then
3245 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3255 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3257 echo "Using $up and $low to convert case." >&4
3260 echo "I don't know how to translate letters from upper to lower case." >&4
3261 echo "Your tr is not acting any way I know of." >&4
3265 : set up the translation script tr, must be called with ./tr of course
3269 '[A-Z][a-z]') exec $tr '$up' '$low';;
3270 '[a-z][A-Z]') exec $tr '$low' '$up';;
3277 : Try to determine whether config.sh was made on this system
3278 case "$config_sh" in
3280 myuname=`$uname -a 2>/dev/null`
3281 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3282 # Downcase everything to avoid ambiguity.
3283 # Remove slashes and single quotes so we can use parts of this in
3284 # directory and file names.
3285 # Remove newlines so myuname is sane to use elsewhere.
3286 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3287 # because the A-Z/a-z are not consecutive.
3288 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3289 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3290 newmyuname="$myuname"
3292 case "$knowitall" in
3294 if test -f ../config.sh; then
3295 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3296 eval "`grep myuname= ../config.sh`"
3298 if test "X$myuname" = "X$newmyuname"; then
3306 : Get old answers from old config file if Configure was run on the
3307 : same system, otherwise use the hints.
3310 if test -f config.sh; then
3312 rp="I see a config.sh file. Shall I use it to set the defaults?"
3315 n*|N*) echo "OK, I'll ignore it."
3316 mv config.sh config.sh.old
3317 myuname="$newmyuname"
3319 *) echo "Fetching default answers from your old config.sh file..." >&4
3327 : Older versions did not always set $sh. Catch re-use of such
3337 if test ! -f config.sh; then
3340 First time through, eh? I have some defaults handy for some systems
3341 that need some extra help getting the Configure answers right:
3344 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3346 : Half the following guesses are probably wrong... If you have better
3347 : tests or hints, please send them to perlbug@perl.org
3348 : The metaconfig authors would also appreciate a copy...
3349 $test -f /irix && osname=irix
3350 $test -f /xenix && osname=sco_xenix
3351 $test -f /dynix && osname=dynix
3352 $test -f /dnix && osname=dnix
3353 $test -f /lynx.os && osname=lynxos
3354 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3355 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3356 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3357 $test -f /bin/mips && /bin/mips && osname=mips
3358 $test -d /usr/apollo/bin && osname=apollo
3359 $test -f /etc/saf/_sactab && osname=svr4
3360 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3361 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3362 if $test -d /MachTen -o -d /MachTen_Folder; then
3364 if $test -x /sbin/version; then
3365 osvers=`/sbin/version | $awk '{print $2}' |
3366 $sed -e 's/[A-Za-z]$//'`
3367 elif $test -x /usr/etc/version; then
3368 osvers=`/usr/etc/version | $awk '{print $2}' |
3369 $sed -e 's/[A-Za-z]$//'`
3375 $test -f /sys/posix.dll &&
3376 $test -f /usr/bin/what &&
3377 set X `/usr/bin/what /sys/posix.dll` &&
3378 $test "$3" = UWIN &&
3382 if $test -f $uname; then
3390 umips) osname=umips ;;
3393 [23]100) osname=mips ;;
3395 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3396 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3399 elif $test -f /etc/kconfig; then
3401 if test "$lns" = "$ln -s"; then
3403 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3405 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3412 if test -n "$DJGPP"; then
3421 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3423 # oslevel can fail with:
3424 # oslevel: Unable to acquire lock.
3425 *not\ found) osvers="$4"."$3" ;;
3426 '<3240'|'<>3240') osvers=3.2.0 ;;
3427 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3428 '=3250'|'>3250') osvers=3.2.5 ;;
3432 bitrig) osname=bitrig
3435 bsd386) osname=bsd386
3438 cygwin*) osname=cygwin
3441 *dc.osx) osname=dcosx
3447 domainos) osname=apollo
3453 dragonfly) osname=dragonfly
3456 dynixptx*) osname=dynixptx
3457 osvers=`echo "$4"|sed 's/^v//'`
3459 freebsd) osname=freebsd
3461 genix) osname=genix ;;
3465 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3478 $test -f /system/lib/libandroid.so && osname=linux-android
3482 netbsd*) osname=netbsd
3485 news-os) osvers="$3"
3487 4*) osname=newsos4 ;;
3491 nonstop-ux) osname=nonstopux ;;
3492 openbsd) osname=openbsd
3498 POSIX-BC | posix-bc ) osname=posix-bc
3501 powerux | power_ux | powermax_os | powermaxos | \
3502 powerunix | power_unix) osname=powerux
3508 solaris) osname=solaris
3510 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3517 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3521 titanos) osname=titanos
3530 ultrix) osname=ultrix
3533 osf1|mls+) case "$5" in
3536 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3539 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3542 hp*) osname=hp_osf1 ;;
3543 mips) osname=mips_osf1 ;;
3546 # UnixWare 7.1.2 is known as Open UNIX 8
3547 openunix|unixware) osname=svr5
3555 $2) case "$osname" in
3559 : svr4.x or possibly later
3569 if test -f /stand/boot ; then
3570 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3571 if test -n "$INITPROG" -a -f "$INITPROG"; then
3572 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3573 if test -n "$isesix"; then
3581 *) if test -f /etc/systemid; then
3583 set `echo $3 | $sed 's/\./ /g'` $4
3584 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3586 elif $test -f $src/hints/sco_$1_$2.sh; then
3588 elif $test -f $src/hints/sco_$1.sh; then
3593 '') : Still unknown. Probably a generic Sys V.
3602 *) case "$osname" in
3603 '') : Still unknown. Probably a generic BSD.
3611 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3612 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3613 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3616 $rm -f UU/kernel.what
3617 elif test -d c:/. -o -n "$is_os2" ; then
3624 case "$targetarch" in
3627 case "$targetarch" in
3629 # Will load qnx.sh, which should change osname to nto
3634 # Catch arm-linux-androideabi, mipsel-linux-android,
3635 # and i686-linux-android
3636 osname=linux-android
3640 # Something like arm-linux-gnueabihf is really just
3647 # XXX perhaps we should just assume
3648 # osvers to be 2, or maybe take the value
3649 # from targetarch. Using $run before the
3650 # hints are run is somewhat icky.
3651 set X `$run $uname -a 2>/dev/null`
3654 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3659 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3666 : Now look for a hint file osname_osvers, unless one has been
3667 : specified already.
3670 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3671 : Also try without trailing minor version numbers.
3672 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3673 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3674 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3675 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3678 *) case "$osvers" in
3681 *) if $test -f $src/hints/$file.sh ; then
3683 elif $test -f $src/hints/$xfile.sh ; then
3685 elif $test -f $src/hints/$xxfile.sh ; then
3687 elif $test -f $src/hints/$xxxfile.sh ; then
3689 elif $test -f $src/hints/$xxxxfile.sh ; then
3691 elif $test -f "$src/hints/${osname}.sh" ; then
3700 if $test -f Policy.sh ; then
3703 none) dflt="Policy" ;;
3704 *) dflt="Policy $dflt" ;;
3709 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3713 if $test -f Policy.sh ; then
3716 There's also a Policy hint file available, which should make the
3717 site-specific (policy) questions easier to answer.
3724 You may give one or more space-separated answers, or "none" if appropriate.
3725 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3726 previous run of Configure, you may specify it as well as or instead of
3727 OS-specific hints. If hints are provided for your OS, you should use them:
3728 although Perl can probably be built without hints on many platforms, using
3729 hints often improve performance and may enable features that Configure can't
3730 set up on its own. If there are no hints that match your OS, specify "none";
3731 DO NOT give a wrong version or a wrong OS.
3735 rp="Which of these apply, if any?"
3738 for file in $tans; do
3739 if $test X$file = XPolicy -a -f Policy.sh; then
3741 $cat Policy.sh >> UU/config.sh
3742 elif $test -f $src/hints/$file.sh; then
3743 . $src/hints/$file.sh
3744 $cat $src/hints/$file.sh >> UU/config.sh
3745 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3748 : Give one chance to correct a possible typo.
3749 echo "$file.sh does not exist"
3751 rp="hint to use instead?"
3753 for file in $ans; do
3754 if $test -f "$src/hints/$file.sh"; then
3755 . $src/hints/$file.sh
3756 $cat $src/hints/$file.sh >> UU/config.sh
3757 elif $test X$ans = X -o X$ans = Xnone ; then
3760 echo "$file.sh does not exist -- ignored."
3767 : Remember our hint file for later.
3768 if $test -f "$src/hints/$file.sh" ; then
3778 echo "Fetching default answers from $config_sh..." >&4
3782 cp $config_sh config.sh 2>/dev/null
3792 test "$override" && . ./optdef.sh
3794 : Restore computed paths
3795 for file in $loclist $trylist; do
3796 eval $file="\$_$file"
3801 Configure uses the operating system name and version to set some defaults.
3802 The default value is probably right if the name rings a bell. Otherwise,
3803 since spelling matters for me, either accept the default or answer "none"
3810 ''|' '|none) dflt=none ;;
3811 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3814 *) dflt="$osname" ;;
3816 rp="Operating system name?"
3820 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3826 ''|' '|none) dflt=none ;;
3827 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3828 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3830 ''|' ') dflt=none ;;
3835 *) dflt="$osvers" ;;
3837 rp="Operating system version?"
3847 : who configured the system
3848 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3851 cf_by=`(logname) 2>/dev/null`
3854 cf_by=`(whoami) 2>/dev/null`
3856 "") cf_by=unknown ;;
3861 : decide how portable to be. Allow command line overrides.
3862 case "$d_portable" in
3864 *) d_portable="$define" ;;
3867 : set up shell script to do ~ expansion
3873 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3876 if $test -f /bin/csh; then
3877 /bin/csh -f -c "glob \$1"
3882 name=\`$expr x\$1 : '..\([^/]*\)'\`
3883 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3884 if $test ! -d "\$dir"; then
3886 echo "\$me: can't locate home directory for: \$name" >&2
3891 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3907 : now set up to get a file name
3911 cat <<'EOSC' >>getfile
3927 : getfile will accept an answer from the comma-separated list
3928 : enclosed in parentheses even if it does not meet other criteria.
3929 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3930 fn=`echo $fn | sed 's/(.*)//'`
3936 loc_file=`expr $fn : '.*:\(.*\)'`
3937 fn=`expr $fn : '\(.*\):.*'`
3945 */*) fullpath=true;;
3954 *e*) exp_file=true;;
3957 *p*) nopath_ok=true;;
3962 *d*) type='Directory';;
3963 *l*) type='Locate';;
3968 Locate) what='File';;
3973 case "$d_portable" in
3981 while test "$type"; do
3986 true) rp="$rp (~name ok)";;
3989 if test -f UU/getfile.ok && \
3990 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4009 value=`UU/filexp $ans`
4012 if test "$ans" != "$value"; then
4013 echo "(That expands to $value on this system.)"
4027 /*) value="$ansexp" ;;
4028 [a-zA-Z]:/*) value="$ansexp" ;;
4033 echo "I shall only accept a full path name, as in /bin/ls." >&4
4034 echo "Use a ! shell escape if you wish to check pathnames." >&4
4037 echo "Please give a full path name, starting with slash." >&4
4040 echo "Note that using ~name is ok provided it expands well." >&4
4053 for fp in $gfpth; do
4054 if test "X$fp" = X.; then
4059 if test -f "$pf"; then
4061 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4063 echo "($value is not a plain file, but that's ok.)"
4066 if test X"$type" = X; then
4073 for fp in $gfpth; do
4074 if test "X$fp" = X.; then
4079 direxp="$fp/$ansexp"
4081 if test -d "$direxp"; then
4089 if test -d "$ansexp"; then
4090 echo "(Looking for $loc_file in directory $value.)"
4091 value="$value/$loc_file"
4092 ansexp="$ansexp/$loc_file"
4094 if test -f "$ansexp"; then
4097 case "$nopath_ok" in
4098 true) case "$value" in
4100 *) echo "Assuming $value will be in people's path."
4116 if test "$fastread" = yes; then
4121 rp="$what $value doesn't exist. Use that name anyway?"
4140 test "X$gfpthkeep" != Xy && gfpth=""
4143 : determine root of directory hierarchy where package will be installed.
4146 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4149 dflt=`echo "$prefix" | sed 's/.$//'`
4157 By default, $package will be installed in $dflt/bin, manual pages
4158 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4159 installation directories. Typically this is something like /usr/local.
4160 If you wish to have binaries under /usr/bin but other parts of the
4161 installation under /usr/local, that's ok: you will be prompted
4162 separately for each of the installation directories, the prefix being
4163 only used to set the defaults.
4167 rp='Installation prefix to use?'
4175 *) oldprefix="$prefix";;
4182 : allow them to override the AFS root
4185 *) afsroot=$afsroot ;;
4191 $define|true) afs=true ;;
4192 $undef|false) afs=false ;;
4193 *) if $test -d $afsroot; then
4201 echo "AFS may be running... I'll be extra cautious then..." >&4
4203 echo "AFS does not seem to be running..." >&4
4206 : determine installation prefix for where package is to be installed.
4210 Since you are running AFS, I need to distinguish the directory in which
4211 files will reside from the directory in which they are installed (and from
4212 which they are presumably copied to the former directory by occult means).
4215 case "$installprefix" in
4216 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4217 *) dflt="$installprefix";;
4222 In some special cases, particularly when building $package for distribution,
4223 it is convenient to distinguish the directory in which files should be
4224 installed from the directory ($prefix) in which they will
4225 eventually reside. For most users, these two directories are the same.
4228 case "$installprefix" in
4230 *) dflt=$installprefix;;
4234 rp='What installation prefix should I use for installing files?'
4236 installprefix="$ans"
4237 installprefixexp="$ansexp"
4239 : Perform the prefixexp/installprefixexp correction if necessary
4240 cat <<EOS >installprefix
4243 cat <<'EOSC' >>installprefix
4244 : Change installation prefix, if necessary.
4245 if $test X"$prefix" != X"$installprefix"; then
4246 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4248 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4251 chmod +x installprefix
4252 $eunicefix installprefix
4254 : Set variables such as privlib and privlibexp from the output of ./getfile
4255 : performing the prefixexp/installprefixexp correction if necessary.
4256 cat <<EOS >setprefixvar
4259 cat <<'EOSC' >>setprefixvar
4260 eval "${prefixvar}=\"\$ans\""
4261 eval "${prefixvar}exp=\"\$ansexp\""
4264 chmod +x setprefixvar
4265 $eunicefix setprefixvar
4267 : set up the script used to warn in case of inconsistency
4276 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4278 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4279 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4284 echo "*** WHOA THERE!!! ***" >&4
4285 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4288 rp=" Keep the $hint value?"
4291 y) td=$was; tu=$was;;
4295 : function used to set '$1' to '$val'
4296 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4298 $define$undef) . ./whoa; eval "$var=\$td";;
4299 $undef$define) . ./whoa; eval "$var=\$tu";;
4300 *) eval "$var=$val";;
4303 : get the patchlevel
4305 echo "Getting the current patchlevel..." >&4
4306 if $test -r $rsrc/patchlevel.h;then
4307 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4308 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4309 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4310 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4311 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4312 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4313 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4322 $echo "(You do not have patchlevel.h. Eek.)"
4324 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4325 version_patchlevel_string="version $patchlevel subversion $subversion"
4326 case "$perl_patchlevel" in
4328 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4329 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4333 $echo "(You have $package $version_patchlevel_string.)"
4337 : XXX Should be a Configure test for double-dots in filenames.
4338 version=`echo $revision $patchlevel $subversion | \
4339 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4340 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4341 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4344 version=`echo $revision $patchlevel $subversion | \
4345 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4346 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4347 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4350 : Special case the 5.005_xx maintenance series, which used 5.005
4351 : without any subversion label as a subdirectory in $sitelib
4352 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4353 api_versionstring='5.005'
4356 : Do we want threads support and if so, what type
4357 case "$usethreads" in
4358 $define|true|[yY]*) dflt='y';;
4359 *) # Catch case where user specified ithreads or 5005threads but
4360 # forgot -Dusethreads (A.D. 4/2002)
4361 case "$useithreads$use5005threads" in
4362 *$define*) dflt='y';;
4369 Perl can be built to offer a form of threading support on some systems
4370 To do so, Configure can be run with -Dusethreads.
4372 Note that Perl built with threading support runs slightly slower
4373 and uses slightly more memory than plain Perl.
4375 If this doesn't make any sense to you, just accept the default '$dflt'.
4377 rp='Build a threading Perl?'
4380 y|Y) val="$define" ;;
4386 if $test $patchlevel -lt 9; then
4387 case "$usethreads" in
4389 : Default to ithreads unless overridden on command line or with
4392 case "$use5005threads" in
4394 echo "5.005 threads are no longer supported"
4398 case "$useithreads" in
4399 $undef|false|[nN]*) dflt='n';;
4401 rp='Use the newer interpreter-based ithreads?'
4404 y|Y) val="$define" ;;
4409 : Now set use5005threads to the opposite value.
4410 case "$useithreads" in
4411 $define) val="$undef" ;;
4418 useithreads="$undef"
4419 use5005threads="$undef"
4423 case "$useithreads$use5005threads" in
4427 You cannot have both the ithreads and the 5.005 threads enabled
4428 at the same time. Disabling the 5.005 threads since they are
4429 much less stable than the ithreads.
4432 use5005threads="$undef"
4437 : perl-5.9.x and later
4439 if test X"$usethreads" = "X$define"; then
4440 case "$use5005threads" in
4444 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4451 use5005threads="$undef"
4452 useithreads="$usethreads"
4455 case "$d_oldpthreads" in
4456 '') : Configure tests would be welcome here. For now, assume undef.
4458 *) val="$d_oldpthreads" ;;
4464 : Look for a hint-file generated 'call-back-unit'. If the
4465 : user has specified that a threading perl is to be built,
4466 : we may need to set or change some other defaults.
4467 if $test -f usethreads.cbu; then
4468 echo "Your platform has some specific hints regarding threaded builds, using them..."
4471 case "$usethreads" in
4472 "$define"|true|[yY]*)
4474 (Your platform does not have any specific hints for threaded builds.
4475 Assuming POSIX threads, then.)
4481 : Check if multiplicity is required
4484 Perl can be built so that multiple Perl interpreters can coexist
4485 within the same Perl executable.
4488 case "$useithreads" in
4491 This multiple interpreter support is required for interpreter-based threads.
4495 *) case "$usemultiplicity" in
4496 $define|true|[yY]*) dflt='y';;
4500 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4501 rp='Build Perl for multiplicity?'
4504 y|Y) val="$define" ;;
4512 : Check if morebits is requested
4513 case "$usemorebits" in
4514 "$define"|true|[yY]*)
4515 use64bitint="$define"
4516 uselongdouble="$define"
4517 usemorebits="$define"
4519 *) usemorebits="$undef"
4523 : Determine the C compiler to be used
4529 rp="Use which C compiler?"
4533 : See whether they have no cc but they do have gcc
4535 if $test -f cc.cbu; then
4540 : make some quick guesses about what we are up against
4542 $echo $n "Hmm... $c"
4552 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4553 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4555 echo "Looks kind of like an OSF/1 system, but we'll see..."
4557 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4558 xxx=`./loc addbib blurfl $pth`
4559 if $test -f $xxx; then
4560 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4564 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4565 echo "Looks kind of like an extended USG system, but we'll see..."
4567 echo "Looks kind of like a USG system, but we'll see..."
4571 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4572 echo "Looks kind of like a BSD system, but we'll see..."
4576 echo "Looks kind of like a Version 7 system, but we'll see..."
4579 case "$eunicefix" in
4582 There is, however, a strange, musty smell in the air that reminds me of
4583 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4587 : it so happens the Eunice I know will not run shell scripts in Unix format
4591 echo "Congratulations. You aren't running Eunice."
4595 : Detect OS2. The p_ variable is set above in the Head.U unit.
4596 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4597 : semicolon as a patch separator
4602 I have the feeling something is not exactly right, however...don't tell me...
4603 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4604 (Or you may be running DOS with DJGPP.)
4609 if test -f /xenix; then
4610 echo "Actually, this looks more like a XENIX system..."
4615 echo "It's not Xenix..."
4620 if test -f /venix; then
4621 echo "Actually, this looks more like a VENIX system..."
4628 echo "Nor is it Venix..."
4631 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4632 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4635 : Check if we are using GNU gcc and what its version is
4637 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4641 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4643 printf("%s\n", __VERSION__);
4645 printf("%s\n", "1");
4651 if $cc -o try $ccflags $ldflags try.c; then
4652 gccversion=`$run ./try`
4653 case "$gccversion" in
4654 '') echo "You are not using GNU cc." ;;
4655 *) echo "You are using GNU cc $gccversion."
4661 echo "*** WHOA THERE!!! ***" >&4
4662 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4663 case "$knowitall" in
4665 echo " You'd better start hunting for one and let me know about it." >&4
4671 case "$gccversion" in
4672 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4674 case "$gccversion" in
4675 '') gccosandvers='' ;;
4676 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4677 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4679 case "$gccosandvers" in
4680 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4681 $osname$osvers) ;; # looking good
4682 $osname*) cat <<EOM >&4
4684 *** WHOA THERE!!! ***
4686 Your gcc has not been compiled for the exact release of
4687 your operating system ($gccosandvers versus $osname$osvers).
4689 In general it is a good idea to keep gcc synchronized with
4690 the operating system because otherwise serious problems
4691 may ensue when trying to compile software, like Perl.
4693 I'm trying to be optimistic here, though, and will continue.
4694 If later during the configuration and build icky compilation
4695 problems appear (headerfile conflicts being the most common
4696 manifestation), I suggest reinstalling the gcc to match
4697 your operating system release.
4701 *) gccosandvers='' ;; # failed to parse, better be silent
4709 # gcc 3.* complain about adding -Idirectories that they already know about,
4710 # so we will take those off from locincpth.
4711 case "$gccversion" in
4713 echo "main(){}">try.c
4714 for incdir in $locincpth; do
4715 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4716 grep '^c[cp]p*[01]: warning: changing search order '`
4717 if test "X$warn" != X; then
4718 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4724 # gcc 4.9 by default does some optimizations that break perl.
4725 # see ticket 121505.
4727 # The -fwrapv disables those optimizations (and probably others,) so
4728 # for gcc 4.9 (and later, since the optimizations probably won't go
4729 # away), add -fwrapv unless the user requests -fno-wrapv, which
4730 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4731 # which turns the overflows -fwrapv ignores into runtime errors.
4732 case "$gccversion" in
4733 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4735 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4736 *) ccflags="$ccflags -fwrapv" ;;
4740 : What should the include directory be ?
4741 : Use sysroot if set, so findhdr looks in the right place.
4743 $echo $n "Hmm... $c"
4744 dflt="$sysroot/usr/include"
4747 if $test -f /bin/mips && /bin/mips; then
4748 echo "Looks like a MIPS system..."
4749 $cat >usr.c <<'EOCP'
4750 #ifdef SYSTYPE_BSD43
4754 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4755 dflt='/bsd43/usr/include'
4759 mips_type='System V'
4761 $rm -f usr.c usr.out
4762 echo "and you're compiling with the $mips_type compiler and libraries."
4766 echo "Doesn't look like a MIPS system."
4776 case "$xxx_prompt" in
4779 rp='Where are the include files you want to use?'
4787 : see how we invoke the C preprocessor
4789 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4790 cat <<'EOT' >testcpp.c
4796 if test ! -f cppstdin; then
4797 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4798 # AIX cc -E doesn't show the absolute headerfile
4799 # locations but we'll cheat by using the -M flag.
4800 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
4802 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4805 echo "Keeping your $hint cppstdin wrapper."
4808 wrapper=`pwd`/cppstdin
4812 if $test "X$cppstdin" != "X" && \
4813 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4814 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4816 echo "You used to use $cppstdin $cppminus so we'll use that again."
4818 '') echo "But let's see if we can live without a wrapper..." ;;
4820 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4821 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4823 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4826 echo "(However, $cpprun $cpplast does not work, let's see...)"
4834 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4841 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4842 $cc -E <testcpp.c >testcpp.out 2>&1; \
4843 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4844 echo "Yup, it does."
4845 x_cpp="$cc $cppflags -E"
4847 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4848 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4849 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4850 echo "Yup, it does."
4851 x_cpp="$cc $cppflags -E"
4853 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4854 $cc -P <testcpp.c >testcpp.out 2>&1; \
4855 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4856 echo "Yipee, that works!"
4857 x_cpp="$cc $cppflags -P"
4859 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4860 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4861 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4862 echo "At long last!"
4863 x_cpp="$cc $cppflags -P"
4865 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4866 $cpp <testcpp.c >testcpp.out 2>&1; \
4867 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4869 x_cpp="$cpp $cppflags"
4871 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4872 $cpp - <testcpp.c >testcpp.out 2>&1; \
4873 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4874 echo "Hooray, it works! I was beginning to wonder."
4875 x_cpp="$cpp $cppflags"
4877 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4878 $wrapper <testcpp.c >testcpp.out 2>&1; \
4879 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4885 rp="No dice. I can't find a C preprocessor. Name one:"
4889 $x_cpp <testcpp.c >testcpp.out 2>&1
4890 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4891 echo "OK, that will do." >&4
4893 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4908 echo "Perhaps can we force $cc -E using a wrapper..."
4909 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4910 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4916 echo "Nope, we'll have to live without it..."
4930 "$wrapper"|'cppstdin') ;;
4931 *) $rm -f $wrapper;;
4933 $rm -f testcpp.c testcpp.out
4935 : Adjust cppfilter for path component separator
4937 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4938 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4942 : Use gcc to determine libpth and incpth
4943 # If using gcc or clang, we can get better values for libpth, incpth
4944 # and usrinc directly from the compiler.
4945 # Note that ccname for clang is also gcc.
4948 $echo 'extern int foo;' > try.c
4949 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4951 if $test $# -gt 0; then
4953 incpth="`$echo $incpth|$sed 's/^ //'`"
4955 j="`$echo $i|$sed 's,/include$,/lib,'`"
4956 if $test -d $j; then
4960 libpth="`$echo $libpth|$sed 's/^ //'`"
4961 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4962 if $test -d $xxx; then
4965 *) libpth="$libpth $xxx";;
4972 '') for i in $incpth; do
4973 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4981 case "$usecrosscompile" in
4984 '') echo "Incpth not defined." >&4; croak=y ;;
4985 *) echo "Using incpth '$incpth'." >&4 ;;
4988 '') echo "Libpth not defined." >&4; croak=y ;;
4989 *) echo "Using libpth '$libpth'." >&4 ;;
4992 '') echo "Usrinc not defined." >&4; croak=y ;;
4993 *) echo "Using usrinc $usrinc." >&4 ;;
4997 if test "X$sysroot" = X; then
4998 echo "Cannot continue, aborting." >&4; exit 1
5000 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5009 : Default value for incpth is just usrinc
5011 '') incpth="$usrinc";;
5014 : Set private lib path
5017 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5022 '') dlist="$loclibpth $plibpth $glibpth";;
5023 *) dlist="$libpth";;
5026 : Now check and see which directories actually exist, avoiding duplicates
5029 if $test -d $xxx; then
5032 *) libpth="$libpth $xxx";;
5038 Some systems have incompatible or broken versions of libraries. Among
5039 the directories listed in the question below, please remove any you
5040 know not to be holding relevant libraries, and add any that are needed.
5041 Say "none" for none.
5045 if test "X$sysroot" != X; then
5047 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5060 rp="Directories to use for library searches?"
5067 : compute shared library extension
5070 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5080 On some systems, shared libraries may be available. Answer 'none' if
5081 you want to suppress searching of shared libraries for the remainder
5082 of this configuration.
5085 rp='What is the file extension used for shared libraries?'
5089 : Does target system insist that shared library basenames are unique
5092 Some dynamic loaders assume that the *basename* of shared library filenames
5093 are globally unique. We'll default this to undef as we assume your system
5094 is not this weird. Set to defined if you're on one of them.
5099 rp='Make shared library basenames unique?'
5102 y|Y) val="$define" ;;
5105 set d_libname_unique
5108 : Define several unixisms.
5109 : Hints files or command line option can be used to override them.
5110 : The convoluted testing is in case hints files set either the old
5113 '') case "$exe_ext" in
5115 *) _exe="$exe_ext" ;;
5120 '') case "$lib_ext" in
5127 '') case "$obj_ext" in
5134 '') case "$path_sep" in
5145 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5147 : Which makefile gets called first. This is used by make depend.
5148 case "$firstmakefile" in
5149 '') firstmakefile='makefile';;
5152 : Check is we will use socks
5154 $define|true|[yY]*) dflt='y';;
5159 Perl can be built to use the SOCKS proxy protocol library. To do so,
5160 Configure must be run with -Dusesocks. If you use SOCKS you also need
5161 to use the PerlIO abstraction layer, this will be implicitly selected.
5163 If this doesn't make any sense to you, just accept the default '$dflt'.
5165 rp='Build Perl for SOCKS?'
5168 y|Y) val="$define" ;;
5174 : Check for uselongdouble support
5176 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5179 case "$uselongdouble" in
5180 $define|true|[yY]*) dflt='y';;
5185 Perl can be built to take advantage of long doubles which
5186 (if available) may give more accuracy and range for floating point numbers.
5188 If this doesn't make any sense to you, just accept the default '$dflt'.
5190 rp='Try to use long doubles if available?'
5193 y|Y) val="$define" ;;
5199 case "$uselongdouble" in
5200 true|[yY]*) uselongdouble="$define" ;;
5203 : Look for a hint-file generated 'call-back-unit'. If the
5204 : user has specified that long doubles should be used,
5205 : we may need to set or change some other defaults.
5206 if $test -f uselongdouble.cbu; then
5207 echo "Your platform has some specific hints regarding long doubles, using them..."
5208 . ./uselongdouble.cbu
5210 case "$uselongdouble" in
5213 (Your platform does not have any specific hints for long doubles.)
5219 : Check if quadmath is requested
5220 case "$usequadmath" in
5221 "$define"|true|[yY]*) usequadmath="$define" ;;
5222 *) usequadmath="$undef" ;;
5225 : Looking for optional libraries
5227 echo "Checking for optional libraries..." >&4
5232 case "$libswanted" in
5233 '') libswanted='c_s';;
5236 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5238 case "$usecbacktrace" in
5239 "$define") libswanted="$libswanted bfd" ;;
5241 case "$usequadmath" in
5242 "$define") libswanted="$libswanted quadmath" ;;
5248 for thisdir in $libpth $xlibpth; do
5249 test -d $thisdir && libspath="$libspath $thisdir"
5251 for thislib in $libswanted; do
5252 for thisdir in $libspath; do
5254 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5255 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5256 $test -f "$xxx" && eval $libscheck
5257 $test -f "$xxx" && libstyle=shared
5258 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5259 $test -f "$xxx" && eval $libscheck
5260 $test -f "$xxx" && libstyle=shared
5262 if test ! -f "$xxx"; then
5263 xxx=$thisdir/lib$thislib.$so
5264 $test -f "$xxx" && eval $libscheck
5265 $test -f "$xxx" && libstyle=shared
5267 if test ! -f "$xxx"; then
5268 xxx=$thisdir/lib$thislib$_a
5269 $test -f "$xxx" && eval $libscheck
5270 $test -f "$xxx" && libstyle=static
5272 if test ! -f "$xxx"; then
5273 xxx=$thisdir/$thislib$_a
5274 $test -f "$xxx" && eval $libscheck
5275 $test -f "$xxx" && libstyle=static
5277 if test ! -f "$xxx"; then
5278 xxx=$thisdir/lib${thislib}_s$_a
5279 $test -f "$xxx" && eval $libscheck
5280 $test -f "$xxx" && libstyle=static
5281 $test -f "$xxx" && thislib=${thislib}_s
5283 if test ! -f "$xxx"; then
5284 xxx=$thisdir/Slib$thislib$_a
5285 $test -f "$xxx" && eval $libscheck
5286 $test -f "$xxx" && libstyle=static
5288 if $test -f "$xxx"; then
5290 shared) echo "Found -l$thislib (shared)." ;;
5291 static) echo "Found -l$thislib." ;;
5292 *) echo "Found -l$thislib ($libstyle)." ;;
5296 *) dflt="$dflt -l$thislib"
5297 libsfound="$libsfound $xxx"
5299 libsfiles="$libsfiles $yyy"
5300 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5301 case " $libsdirs " in
5303 *) libsdirs="$libsdirs $yyy" ;;
5310 if $test ! -f "$xxx"; then
5311 echo "No -l$thislib."
5322 ' '|'') dflt='none';;
5327 In order to compile $package on your machine, a number of libraries
5328 are usually needed. Include any other special libraries here as well.
5329 Say "none" for none. The default list is almost always right.
5333 rp="What libraries to use?"
5340 : determine optimization, if desired, or use for debug flag also
5342 ' '|$undef) dflt='none';;
5344 *) dflt="$optimize";;
5348 By default, $package compiles with the -O flag to use the optimizer.
5349 Alternately, you might want to use the symbolic debugger, which uses
5350 the -g flag (on traditional Unix systems). Either flag can be
5351 specified here. To use neither flag, specify the word "none".
5354 rp="What optimizer/debugger flag should be used?"
5358 'none') optimize=" ";;
5361 : Check what DEBUGGING is required from the command line
5362 : -DEBUGGING or -DDEBUGGING or
5363 : -DEBUGGING=both = -g + -DDEBUGGING
5364 : -DEBUGGING=-g or -Doptimize=-g = -g
5365 : -DEBUGGING=none or -UDEBUGGING =
5366 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5369 *) DEBUGGING=$EBUGGING ;;
5372 case "$DEBUGGING" in
5376 *) optimize="$optimize -g" ;;
5380 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5388 case "$DEBUGGING" in
5389 both|$define) dflt='-DDEBUGGING'
5392 : argument order is deliberate, as the flag will start with - which set could
5393 : think is an option
5394 checkccflag='check=$1; flag=$2; callback=$3;
5396 echo "Checking if your compiler accepts $flag" 2>&1;
5397 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5398 echo "int main(void) { return 0; }" > gcctest.c;
5399 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5400 echo "Yes, it does." 2>&1;
5401 if $test -s gcctest.out ; then
5402 echo "But your platform does not like it:";
5407 echo "Leaving current flags $ccflags alone." 2>&1
5409 *) dflt="$dflt $flag";
5415 echo "Nope, it does not, but that is ok." 2>&1;
5419 : We will not override a previous value, but we might want to
5420 : augment a hint file
5422 default|recommended)
5423 case "$gccversion" in
5424 1*) dflt="$dflt -fpcc-struct-return" ;;
5426 case "$optimize:$DEBUGGING" in
5427 *-g*:old) dflt="$dflt -DDEBUGGING";;
5429 case "$gccversion" in
5430 2*) if $test -d /etc/conf/kconfig.d &&
5431 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5433 # Interactive Systems (ISC) POSIX mode.
5438 case "$gccversion" in
5441 ?*) set strict-aliasing -fno-strict-aliasing
5445 # For gcc, adding -pipe speeds up compilations for some, but apparently
5446 # some assemblers can't read from stdin. (It also slows down compilations
5447 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5448 case "$gccversion" in
5454 # on x86_64 (at least) we require an extra library (libssp) in the
5455 # link command line. This library is not named, so I infer that it is
5456 # an implementation detail that may change. Hence the safest approach
5457 # is to add the flag to the flags passed to the compiler at link time,
5458 # as that way the compiler can do the right implementation dependant
5460 case "$gccversion" in
5461 ?*) set stack-protector-strong -fstack-protector-strong
5464 *-fstack-protector-strong*) ;; # It got added.
5465 *) # Try the plain/older -fstack-protector.
5466 set stack-protector -fstack-protector
5475 case "$mips_type" in
5476 *BSD*|'') inclwanted="$locincpth $usrinc";;
5477 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5479 for thisincl in $inclwanted; do
5480 if $test -d $thisincl; then
5481 if $test x$thisincl != x$usrinc; then
5483 *" -I$thisincl "*);;
5484 *) dflt="$dflt -I$thisincl ";;
5490 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5492 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5500 *) dflt="$dflt -D$2";;
5504 set signal.h LANGUAGE_C; eval $inctest
5508 ccflags="$ccflags -DSOCKS"
5513 default|recommended) dflt="$ccflags $dflt" ;;
5514 *) dflt="$ccflags";;
5523 Your C compiler may want other flags. For this question you should include
5524 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5525 but you should NOT include libraries or ld flags like -lwhatever. If you
5526 want $package to honor its debug switch, you should include -DDEBUGGING here.
5527 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5529 To use no flags, specify the word "none".
5535 rp="Any additional cc flags?"
5542 : the following weeds options from ccflags that are of no interest to cpp
5544 '') cppflags="$ccflags" ;;
5545 *) cppflags="$cppflags $ccflags" ;;
5547 case "$gccversion" in
5548 1*) cppflags="$cppflags -D__GNUC__"
5550 case "$mips_type" in
5552 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5558 echo "Let me guess what the preprocessor flags are..." >&4
5572 *) ftry="$previous $flag";;
5574 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5575 >cpp1.out 2>/dev/null && \
5576 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5577 >cpp2.out 2>/dev/null && \
5578 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5579 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5581 cppflags="$cppflags $ftry"
5591 *-*) echo "They appear to be: $cppflags";;
5593 $rm -f cpp.c cpp?.out
5597 : flags used in final linking phase
5599 '') if ./venix; then
5605 *-posix*) dflt="$dflt -posix" ;;
5608 *) dflt="$ldflags";;
5610 # See note above about -fstack-protector
5612 *-fstack-protector-strong*)
5614 *-fstack-protector-strong*) ;; # Don't add it again
5615 *) dflt="$dflt -fstack-protector-strong" ;;
5618 *-fstack-protector*)
5620 *-fstack-protector*) ;; # Don't add it again
5621 *) dflt="$dflt -fstack-protector" ;;
5626 : Try to guess additional flags to pick up local libraries.
5627 for thislibdir in $libpth; do
5628 case " $loclibpth " in
5631 *"-L$thislibdir "*) ;;
5632 *) dflt="$dflt -L$thislibdir" ;;
5644 Your C linker may need flags. For this question you should
5645 include -L/whatever and any other flags used by the C linker, but you
5646 should NOT include libraries like -lwhatever.
5648 Make sure you include the appropriate -L/path flags if your C linker
5649 does not normally search all of the directories you specified above,
5652 To use no flags, specify the word "none".
5656 rp="Any additional ld flags (NOT including libraries)?"
5662 rmlist="$rmlist pdp11"
5666 echo "Checking your choice of C compiler and flags for coherency..." >&4
5667 $cat > try.c <<'EOF'
5669 int main() { printf("Ok\n"); return(0); }
5671 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5673 $cat >try.msg <<'EOM'
5674 I've tried to compile and run the following simple program:
5677 $cat try.c >> try.msg
5679 $cat >> try.msg <<EOM
5686 and I got the following output:
5690 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5691 if $sh -c "$run ./try " >>try.msg 2>&1; then
5695 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5698 echo "The program compiled OK, but exited with status $?." >>try.msg
5699 rp="You have a problem. Shall I abort Configure"
5703 echo "I can't compile the test program." >>try.msg
5704 rp="You have a BIG problem. Shall I abort Configure"
5710 case "$knowitall" in
5712 echo "(The supplied flags or libraries might be incorrect.)"
5720 *) echo "Ok. Stopping Configure." >&4
5725 n) echo "OK, that should do.";;
5727 $rm_try gcctest gcctest.out
5729 : define a shorthand compile call
5733 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5734 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5738 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5739 : define a shorthand compile call for compilations that should be ok.
5743 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5745 : determine filename position in cpp output
5747 echo "Computing filename position in cpp output for #include directives..." >&4
5749 vos) testaccess=-e ;;
5752 echo '#include <stdio.h>' > foo.c
5755 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5756 $grep '^[ ]*#.*stdio\.h' | \
5757 while read cline; do
5760 while $test \$# -gt 0; do
5761 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5766 pos=\`expr \$pos + 1\`
5778 *) pos="${fieldn}th";;
5780 echo "Your cpp writes the filename in the $pos field of the line."
5782 : locate header file
5787 for usrincdir in $incpth
5789 if test -f \$usrincdir/\$wanted; then
5790 echo "\$usrincdir/\$wanted"
5794 awkprg='{ print \$$fieldn }'
5795 echo "#include <\$wanted>" > foo\$\$.c
5796 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5797 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5798 while read cline; do
5799 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5801 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5802 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5807 # status = 0: grep returned 0 lines, case statement not executed
5808 # status = 1: headerfile found
5809 # status = 2: while loop executed, no headerfile found
5813 if test \$status -eq 1; then
5820 : define an alternate in-header-list? function
5821 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5822 cont=true; xxf="echo \"<\$1> found.\" >&4";
5823 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5824 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5826 case $# in 4) instead=instead;; *) instead="at last";; esac;
5827 while $test "$cont"; do
5829 var=$2; eval "was=\$$2";
5830 if $test "$xxx" && $test -r "$xxx";
5832 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5835 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5836 set $yyy; shift; shift; yyy=$@;
5837 case $# in 0) cont="";;
5838 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5839 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5840 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5841 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5845 do set $yyy; var=$2; eval "was=\$$2";
5846 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5847 set $yyy; shift; shift; yyy=$@;
5850 : see if stdlib is available
5851 set stdlib.h i_stdlib
5854 : check for lengths of integral types
5858 echo "Checking to see how big your integers are..." >&4
5867 printf("intsize=%d;\n", (int)sizeof(int));
5868 printf("longsize=%d;\n", (int)sizeof(long));
5869 printf("shortsize=%d;\n", (int)sizeof(short));
5874 if eval $compile_ok && $run ./try > /dev/null; then
5876 echo "Your integers are $intsize bytes long."
5877 echo "Your long integers are $longsize bytes long."
5878 echo "Your short integers are $shortsize bytes long."
5882 Help! I can't compile and run the intsize test program: please enlighten me!
5883 (This is probably a misconfiguration in your system or libraries, and
5884 you really ought to fix it. Still, I'll try anyway.)
5888 rp="What is the size of an integer (in bytes)?"
5892 rp="What is the size of a long integer (in bytes)?"
5896 rp="What is the size of a short integer (in bytes)?"
5904 : check for long long
5906 echo "Checking to see if you have long long..." >&4
5907 echo 'int main() { long long x = 7; return 0; }' > try.c
5909 if eval $compile; then
5911 echo "You have long long."
5914 echo "You do not have long long."
5920 : check for length of long long
5921 case "${d_longlong}${longlongsize}" in
5924 echo "Checking to see how big your long longs are..." >&4
5925 $cat >try.c <<'EOCP'
5929 printf("%d\n", (int)sizeof(long long));
5934 if eval $compile_ok; then
5935 longlongsize=`$run ./try`
5936 echo "Your long longs are $longlongsize bytes long."
5940 echo "(I can't seem to compile the test program. Guessing...)"
5941 rp="What is the size of a long long (in bytes)?"
5945 if $test "X$longsize" = "X$longlongsize"; then
5946 echo "(That isn't any different from an ordinary long.)"
5952 : see if inttypes.h is available
5953 : we want a real compile instead of Inhdr because some systems
5954 : have an inttypes.h which includes non-existent headers
5957 #include <inttypes.h>
5959 static int32_t foo32 = 0x12345678;
5963 if eval $compile; then
5964 echo "<inttypes.h> found." >&4
5967 echo "<inttypes.h> NOT found." >&4
5976 echo "Checking to see if you have int64_t..." >&4
5978 #include <sys/types.h>
5979 #$i_inttypes I_INTTYPES
5981 #include <inttypes.h>
5983 int main() { int64_t x = 7; }
5986 if eval $compile; then
5988 echo "You have int64_t."
5991 echo "You do not have int64_t."
5997 : Check if 64bit ints have a quad type
5999 echo "Checking which 64-bit integer type we could use..." >&4
6005 val='"unsigned int"'
6010 *) case "$longsize" in
6014 val='"unsigned long"'
6019 *) case "$d_longlong:$longlongsize" in
6024 val='"unsigned long long"'
6029 *) case "$d_int64_t" in
6048 '') echo "Alas, no 64-bit integer types in sight." >&4
6051 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6056 : Do we want 64bit support
6057 case "$uselonglong" in
6058 "$define"|true|[yY]*)
6061 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6063 use64bitint="$define"
6066 case "$use64bits" in
6067 "$define"|true|[yY]*)
6070 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6072 use64bitint="$define"
6075 case "$use64bitints" in
6076 "$define"|true|[yY]*)
6079 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6081 use64bitint="$define"
6084 case "$use64bitsint" in
6085 "$define"|true|[yY]*)
6088 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6090 use64bitint="$define"
6093 case "$uselonglongs" in
6094 "$define"|true|[yY]*)
6097 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6099 use64bitint="$define"
6102 case "$use64bitsall" in
6103 "$define"|true|[yY]*)
6106 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6108 use64bitall="$define"
6113 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6115 case "$use64bitall" in
6116 "$define"|true|[yY]*) use64bitint="$define" ;;
6122 You have natively 64-bit long integers.
6126 *) case "$use64bitint" in
6127 "$define"|true|[yY]*) dflt='y';;
6136 Perl can be built to take advantage of 64-bit integer types
6137 on some systems. To do so, Configure can be run with -Duse64bitint.
6138 Choosing this option will most probably introduce binary incompatibilities.
6140 If this doesn't make any sense to you, just accept the default '$dflt'.
6141 (The default has been chosen based on your configuration.)
6143 rp='Try to use 64-bit integers, if available?'
6146 [yY]*) val="$define" ;;
6154 case "$use64bitall" in
6155 "$define"|true|[yY]*) dflt='y' ;;
6156 *) case "$longsize" in
6164 You may also choose to try maximal 64-bitness. It means using as much
6165 64-bitness as possible on the platform. This in turn means even more
6166 binary incompatibilities. On the other hand, your platform may not
6167 have any more 64-bitness available than what you already have chosen.
6169 If this doesn't make any sense to you, just accept the default '$dflt'.
6170 (The default has been chosen based on your configuration.)
6172 rp='Try to use maximal 64-bit support, if available?'
6175 [yY]*) val="$define" ;;
6180 case "$use64bitall" in
6182 case "$use64bitint" in
6186 Since you have chosen a maximally 64-bit build, I'm also turning on
6187 the use of 64-bit integers.
6189 use64bitint="$define" ;;
6194 : Look for a hint-file generated 'call-back-unit'. If the
6195 : user has specified that a 64-bit perl is to be built,
6196 : we may need to set or change some other defaults.
6197 if $test -f use64bitint.cbu; then
6198 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6201 case "$use64bitint" in
6202 "$define"|true|[yY]*)
6203 : This test was common to all the OpenBSD forks, and seems harmless for
6206 echo "Checking if your C library has broken 64-bit functions..." >&4
6209 typedef $uquadtype myULL;
6216 {4294967303.15, 4294967303ULL},
6217 {4294967294.2, 4294967294ULL},
6218 {4294967295.7, 4294967295ULL},
6221 for (p = test; p->u; p++) {
6222 myULL x = (myULL)p->d;
6233 if eval $compile_ok; then
6234 libcquad=`$run ./try`
6235 echo "Your C library's 64-bit functions are $libcquad."
6237 echo "(I can't seem to compile the test program.)"
6238 echo "Assuming that your C library's 64-bit functions are ok."
6247 *** You have a C library with broken 64-bit functions.
6248 *** 64-bit support does not work reliably in this configuration.
6249 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6250 *** Cannot continue, aborting.
6257 4) case "$archname64" in
6258 '') archname64=64int ;;
6265 : Look for a hint-file generated 'call-back-unit'. If the
6266 : user has specified that a maximally 64-bit perl is to be built,
6267 : we may need to set or change some other defaults.
6268 if $test -f use64bitall.cbu; then
6269 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6272 case "$use64bitall" in
6273 "$define"|true|[yY]*)
6275 4) case "$archname64" in
6276 ''|64int) archname64=64all ;;
6283 case "$d_quad:$use64bitint" in
6287 *** You have chosen to use 64-bit integers,
6288 *** but none can be found.
6289 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6290 *** Cannot continue, aborting.
6297 : Check if we are using the GNU C library
6299 echo "Checking for GNU C Library..." >&4
6301 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6302 alone are insufficient to distinguish different versions, such as
6303 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6304 libc version 2.1.0. A. Dougherty, June 3, 2002.
6310 # ifdef __GLIBC_MINOR__
6311 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6312 # include <gnu/libc-version.h>
6313 printf("%s\n", gnu_get_libc_version());
6315 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6318 printf("%d\n", __GLIBC__);
6327 if eval $compile_ok && $run ./try > glibc.ver; then
6329 gnulibc_version=`$cat glibc.ver`
6330 echo "You are using the GNU C Library version $gnulibc_version"
6334 echo "You are not using the GNU C Library"
6340 : see if nm is to be used to determine whether a symbol is defined or not
6344 case "$d_gnulibc" in
6347 echo "nm probably won't work on the GNU C Library." >&4
6353 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6355 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6356 echo "'nm' won't be sufficient on this system." >&4
6362 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6363 if $test $dflt -gt 20; then
6373 true|$define) dflt=y;;
6380 I can use $nm to extract the symbols from your C libraries. This
6381 is a time consuming task which may generate huge output on the disk (up
6382 to 3 megabytes) but that should make the symbols extraction faster. The
6383 alternative is to skip the 'nm' extraction part and to compile a small
6384 test program instead to determine whether each symbol is present. If
6385 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6386 this may be the best solution.
6388 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6391 rp="Shall I use $nm to extract C symbols from the libraries?"
6394 [Nn]*) usenm=false;;
6403 : nm options which may be necessary
6405 '') if $test -f /mach_boot; then
6407 elif $test -d /usr/ccs/lib; then
6408 nm_opt='-p' # Solaris (and SunOS?)
6409 elif $test -f /dgux; then
6411 elif $test -f /lib64/rld; then
6412 nm_opt='-p' # 64-bit Irix
6418 : nm options which may be necessary for shared libraries but illegal
6419 : for archive libraries. Thank you, Linux.
6420 case "$nm_so_opt" in
6421 '') case "$myuname" in
6423 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6424 nm_so_opt='--dynamic'
6431 : Figure out where the libc is located
6434 : get list of predefined functions in a handy place
6439 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6445 *) for thislib in $libs; do
6448 : Handle C library specially below.
6451 thislib=`echo $thislib | $sed -e 's/^-l//'`
6452 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6454 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6456 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6458 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6460 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6462 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6464 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6469 libnames="$libnames $try"
6471 *) libnames="$libnames $thislib" ;;
6480 for xxx in $libpth; do
6481 $test -r $1 || set $xxx/libc.$so
6482 : The messy sed command sorts on library version numbers.
6484 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6485 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6487 s/[0-9][0-9]*/0000&/g
6488 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6491 $sort | $sed -e 's/^.* //'`
6494 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6495 $test -r $1 || set $sysroot/lib/libsys_s$_a
6501 if $test -r "$1"; then
6502 echo "Your (shared) C library seems to be in $1."
6504 elif $test -r /lib/libc && $test -r /lib/clib; then
6505 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6507 libc='/lib/clib /lib/libc'
6508 if $test -r /lib/syslib; then
6509 echo "(Your math library is in /lib/syslib.)"
6510 libc="$libc /lib/syslib"
6512 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6513 echo "Your C library seems to be in $libc, as you said before."
6514 elif $test -r $incpath/usr/lib/libc$_a; then
6515 libc=$incpath/usr/lib/libc$_a;
6516 echo "Your C library seems to be in $libc. That's fine."
6517 elif $test -r /lib/libc$_a; then
6519 echo "Your C library seems to be in $libc. You're normal."
6521 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6523 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6524 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6525 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6527 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6529 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6532 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6534 if $test -r "$tans"; then
6535 echo "Your C library seems to be in $tans, of all places."
6541 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6545 If the guess above is wrong (which it might be if you're using a strange
6546 compiler, or your machine supports multiple models), you can override it here.
6551 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6553 I can't seem to find your C library. I've looked in the following places:
6556 $sed 's/^/ /' libpath
6559 None of these seems to contain your C library. I need to get its name...
6564 rp='Where is your C library?'
6569 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6570 set X `cat libnames`
6573 case $# in 1) xxx=file; esac
6574 echo "Extracting names from the following $xxx for later perusal:" >&4
6576 $sed 's/^/ /' libnames >&4
6578 $echo $n "This may take a while...$c" >&4
6582 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6583 *) $nm $nm_opt $file 2>/dev/null;;
6588 $grep fprintf libc.tmp > libc.ptf
6589 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6590 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6592 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6594 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6596 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6598 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6600 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6602 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6604 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6606 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6608 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6610 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6612 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6614 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6616 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6617 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6619 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6621 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6623 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6625 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6627 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6629 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6631 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6633 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6635 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6637 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6639 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6641 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6643 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6645 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6647 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6650 $nm -p $* 2>/dev/null >libc.tmp
6651 $grep fprintf libc.tmp > libc.ptf
6652 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6653 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6659 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6661 if $ar t $libc > libc.tmp && \
6662 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6664 for thisname in $libnames $libc; do
6665 $ar t $thisname >>libc.tmp
6667 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6669 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6670 for thisname in $libnames $libc; do
6671 $ar tv $thisname >>libc.tmp
6672 emximp -o tmp.imp $thisname \
6674 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6675 < tmp.imp >>libc.tmp
6678 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6681 echo "$ar didn't seem to work right." >&4
6682 echo "Maybe this is a Cray...trying bld instead..." >&4
6684 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6687 for thisname in $libnames; do
6689 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6690 $ar t $thisname >>libc.tmp
6694 echo "That didn't work either. Giving up." >&4
6704 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6705 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6707 *) if $test -f /lib/syscalls.exp; then
6709 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6710 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6711 /lib/syscalls.exp >>libc.list
6717 $rm -f libnames libpath
6719 : Check if we are using C++
6721 echo "Checking for C++..." >&4
6722 $cat >try.c <<'EOCP'
6734 if eval $compile_ok && $run ./try; then
6736 echo "You are using a C++ compiler."
6739 echo "You are not using a C++ compiler."
6745 : is a C symbol defined?
6748 -v) tf=libc.tmp; tdc="";;
6749 -a) tf=libc.tmp; tdc="[]";;
6750 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6752 case "$d_cplusplus" in
6753 $define) extern_C="extern \"C\"" ;;
6754 *) extern_C="extern" ;;
6757 case "$reuseval-$4" in
6759 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6764 if $test "$runnm" = true; then
6765 if $contains $tlook $tf >/dev/null 2>&1; then
6767 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6768 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
6769 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6770 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6774 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
6775 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6781 $define) tval=true;;
6788 : define an is-in-libc? function
6789 inlibc='echo " "; td=$define; tu=$undef;
6790 sym=$1; var=$2; eval "was=\$$2";
6792 case "$reuseval$was" in
6802 echo "$sym() found." >&4;
6803 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6805 echo "$sym() NOT found." >&4;
6806 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6810 $define) echo "$sym() found." >&4;;
6811 *) echo "$sym() NOT found." >&4;;
6815 : check for length of double
6817 case "$doublesize" in
6819 echo "Checking to see how big your double precision numbers are..." >&4
6828 printf("%d\n", (int)sizeof(double));
6833 if eval $compile_ok; then
6834 doublesize=`$run ./try`
6835 echo "Your double is $doublesize bytes long."
6838 echo "(I can't seem to compile the test program. Guessing...)"
6839 rp="What is the size of a double precision number (in bytes)?"
6847 : see if this is a float.h system
6851 : check for long doubles
6853 echo "Checking to see if you have long double..." >&4
6854 echo 'int main() { long double x = 7.0; }' > try.c
6856 if eval $compile; then
6858 echo "You have long double."
6861 echo "You do not have long double."
6867 : see if ldexpl exists
6871 : check for length of long double
6872 case "${d_longdbl}${longdblsize}" in
6875 echo "Checking to see how big your long doubles are..." >&4
6876 $cat >try.c <<'EOCP'
6880 printf("%d\n", sizeof(long double));
6885 if eval $compile; then
6886 longdblsize=`$run ./try`
6887 echo "Your long doubles are $longdblsize bytes long."
6891 echo "(I can't seem to compile the test program. Guessing...)" >&4
6892 rp="What is the size of a long double (in bytes)?"
6896 if $test "X$doublesize" = "X$longdblsize"; then
6897 echo "That isn't any different from an ordinary double."
6898 echo "I'll keep your setting anyway, but you may see some"
6899 echo "harmless compilation warnings."
6905 $echo "Checking the kind of long doubles you have..." >&4
6906 case "$d_longdbl" in
6911 #define LONGDBLSIZE $longdblsize
6912 #define DOUBLESIZE $doublesize
6920 static const long double d = -0.1L;
6922 unsigned const char* b = (unsigned const char*)(&d);
6923 #if DOUBLESIZE == LONGDBLSIZE
6924 printf("0\n"); /* if it floats like double */
6927 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6928 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6929 /* IEEE 754 128-bit little-endian */
6933 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6934 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6939 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6940 * while 64-bits platforms have it in 16 bytes. */
6941 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6942 if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) {
6943 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6944 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6945 * Also known as "extended precision". */
6949 if (b[0] == 0xBF && b[9] == 0xCD && b[10] == 0x00) {
6950 /* is there ever big-endian 80-bit, really? */
6955 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6956 /* software "double double", the 106 is 53+53.
6957 * but irix thinks it is 107. */
6958 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
6959 /* double double 128-bit little-endian,
6960 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
6964 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
6965 /* double double 128-bit big-endian, e.g. PPC/Power and MIPS:
6966 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
6971 printf("-1\n"); /* unknown */
6976 if eval $compile; then
6977 longdblkind=`$run ./try`
6984 case "$longdblkind" in
6985 0) echo "Your long doubles are doubles." >&4 ;;
6986 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
6987 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
6988 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
6989 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
6990 5) echo "You have 128-bit little-endian double-double long doubles." >& 4 ;;
6991 6) echo "You have 128-bit big-endian double-double long doubles." >& 4 ;;
6992 *) echo "Cannot figure out your long double." >&4 ;;
6996 : determine the architecture name
6998 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6999 tarch=`arch`"-$osname"
7000 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7001 if uname -m > tmparch 2>&1 ; then
7002 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7003 -e 's/$/'"-$osname/" tmparch`
7011 case "$myarchname" in
7014 echo "(Your architecture name used to be $myarchname.)"
7018 case "$targetarch" in
7020 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7025 *) dflt="$archname";;
7027 rp='What is your architecture name'
7031 : optionally add API version to the architecture for versioned archlibs
7032 case "$useversionedarchname" in
7033 $define|true|[yY]*) dflt='y';;
7036 rp='Add the Perl API version to your archname?'
7039 y|Y) useversionedarchname="$define" ;;
7040 *) useversionedarchname="$undef" ;;
7042 case "$useversionedarchname" in
7045 *-$api_versionstring)
7046 echo "...and architecture name already has -$api_versionstring" >&4
7049 archname="$archname-$api_versionstring"
7050 echo "...setting architecture name to $archname." >&4
7056 case "$usethreads" in
7058 echo "Threads selected." >&4
7060 *-thread*) echo "...and architecture name already has -thread." >&4
7062 *) archname="$archname-thread"
7063 echo "...setting architecture name to $archname." >&4
7068 case "$usemultiplicity" in
7070 echo "Multiplicity selected." >&4
7072 *-multi*) echo "...and architecture name already has -multi." >&4
7074 *) archname="$archname-multi"
7075 echo "...setting architecture name to $archname." >&4
7080 case "$use64bitint$use64bitall" in
7082 case "$archname64" in
7084 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7087 case "$use64bitint" in
7088 "$define") echo "64 bit integers selected." >&4 ;;
7090 case "$use64bitall" in
7091 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7094 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7096 *) archname="$archname-$archname64"
7097 echo "...setting architecture name to $archname." >&4
7103 case "$uselongdouble" in
7105 echo "Long doubles selected." >&4
7106 case "$longdblsize" in
7108 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7112 *-ld*) echo "...and architecture name already has -ld." >&4
7114 *) archname="$archname-ld"
7115 echo "...setting architecture name to $archname." >&4
7122 case "$usequadmath" in
7124 echo "quadmath selected." >&4
7126 *-ld*) echo "...and architecture name already has -quadmath." >&4
7128 *) archname="$archname-quadmath"
7129 echo "...setting architecture name to $archname." >&4
7134 if $test -f archname.cbu; then
7135 echo "Your platform has some specific hints for architecture name, using them..."
7139 : set the prefixit variable, to compute a suitable default value
7140 prefixit='case "$3" in
7142 case "$oldprefix" in
7143 "") eval "$1=\"\$$2\"";;
7150 ""|" ") eval "$1=\"\$$2\"";;
7156 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7158 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7159 /*-$oldprefix/*|\~*-$oldprefix/*)
7160 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7161 *) eval "$1=\"\$$2\"";;
7165 : determine installation style
7166 : For now, try to deduce it from prefix unless it is already set.
7167 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7168 case "$installstyle" in
7169 '') case "$prefix" in
7170 *perl*) dflt='lib';;
7171 *) dflt='lib/perl5' ;;
7174 *) dflt="$installstyle" ;;
7176 : Probably not worth prompting for this since we prompt for all
7177 : the directories individually, and the prompt would be too long and
7181 : determine where public executables go
7186 rp='Pathname where the public executables will reside?'
7188 if $test "X$ansexp" != "X$binexp"; then
7192 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7193 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7194 : this via initialinstalllocation
7197 case "$userelocatableinc" in
7198 $define|true|[yY]*) dflt='y' ;;
7203 Would you like to build Perl so that the installation is relocatable, so that
7204 library paths in @INC are determined relative to the path of the perl binary?
7205 This is not advised for system Perl installs, or if you need to run setid
7206 scripts or scripts under taint mode.
7208 If this doesn't make any sense to you, just accept the default '$dflt'.
7210 rp='Use relocatable @INC?'
7213 y|Y) val="$define" ;;
7216 set userelocatableinc
7219 initialinstalllocation="$binexp"
7220 : Default prefix is now "up one level from where the binaries are"
7221 case "$userelocatableinc" in
7227 installprefixexp=".../.."
7231 : determine where private library files go
7232 : Usual default is /usr/local/lib/perl5/$version.
7233 : Also allow things like /opt/perl/lib/$version, since
7234 : /opt/perl/lib/perl5... would be redundant.
7235 : The default "style" setting is made in installstyle.U
7236 case "$installstyle" in
7237 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7238 *) set dflt privlib lib/$version ;;
7243 There are some auxiliary files for $package that need to be put into a
7244 private library directory that is accessible by everyone.
7249 rp='Pathname where the private library files will reside?'
7254 : set the prefixup variable, to restore leading tilda escape
7255 prefixup='case "$prefixexp" in
7257 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7260 : determine where public architecture dependent libraries go
7263 : privlib default is /usr/local/lib/$package/$version
7264 : archlib default is /usr/local/lib/$package/$version/$archname
7265 : privlib may have an optional trailing /share.
7266 tdflt=`echo $privlib | $sed 's,/share$,,'`
7267 tdflt=$tdflt/$archname
7276 $spackage contains architecture-dependent library files. If you are
7277 sharing libraries in a heterogeneous environment, you might store
7278 these files in a separate location. Otherwise, you can just include
7279 them with the rest of the public library files.
7284 rp='Where do you want to put the public architecture-dependent libraries?'
7288 if $test X"$archlib" = X"$privlib"; then
7294 : see if setuid scripts can be secure
7297 Some kernels have a bug that prevents setuid #! scripts from being
7298 secure. Some sites have disabled setuid #! scripts because of this.
7300 First let's decide if your kernel supports secure setuid #! scripts.
7301 (If setuid #! scripts would be secure but have been disabled anyway,
7302 don't say that they are secure if asked.)
7307 if $test -d /dev/fd; then
7308 echo "#!$ls" >reflect
7309 chmod +x,u+s reflect
7310 ./reflect >flect 2>&1
7311 if $contains "/dev/fd" flect >/dev/null; then
7312 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7316 If you are not sure if they are secure, I can check but I'll need a
7317 username and password different from the one you are using right now.
7318 If you don't have such a username or don't want me to test, simply
7322 rp='Other username to test security of setuid scripts with?'
7327 case "$d_suidsafe" in
7328 '') echo "I'll assume setuid scripts are *not* secure." >&4
7331 echo "Well, the $hint value is *not* secure." >&4
7333 *) echo "Well, the $hint value *is* secure." >&4
7338 $rm -f reflect flect
7339 echo "#!$ls" >reflect
7340 chmod +x,u+s reflect
7343 echo '"su" will (probably) prompt you for '"$ans's password."
7344 su $ans -c './reflect >flect'
7345 if $contains "/dev/fd" flect >/dev/null; then
7346 echo "Okay, it looks like setuid scripts are secure." >&4
7349 echo "I don't think setuid scripts are secure." >&4
7354 rp='Does your kernel have *secure* setuid scripts?'
7357 [yY]*) val="$define";;
7362 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7363 echo "(That's for file descriptors, not floppy disks.)"
7369 $rm -f reflect flect
7371 : now see if they want to do setuid emulation
7372 if $test $patchlevel -lt 11; then
7375 case "$d_suidsafe" in
7378 echo "No need to emulate SUID scripts since they are secure here." >&4
7382 Some systems have disabled setuid scripts, especially systems where
7383 setuid scripts cannot be secure. On systems where setuid scripts have
7384 been disabled, the setuid/setgid bits on scripts are currently
7385 useless. It is possible for $package to detect those bits and emulate
7386 setuid/setgid in a secure fashion. This emulation will only work if
7387 setuid scripts have been disabled in your kernel.
7391 "$define") dflt=y ;;
7394 rp="Do you want to do setuid/setgid emulation?"
7397 [yY]*) val="$define";;
7409 SUID emulation has been removed for 5.12
7410 Please re-run Configure without -Dd_dosuid
7419 : Find perl5.005 or later.
7420 echo "Looking for a previously installed perl5.005 or later... "
7422 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7423 : Check if this perl is recent and can load a simple module
7424 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7427 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7437 '') echo "None found. That's ok.";;
7438 *) echo "Using $perl5." ;;
7441 : Set the siteprefix variables
7444 After $package is installed, you may wish to install various
7445 add-on modules and utilities. Typically, these add-ons will
7446 be installed under $prefix with the rest
7447 of this package. However, you may wish to install such add-ons
7448 elsewhere under a different prefix.
7450 If you do not wish to put everything under a single prefix, that's
7451 ok. You will be prompted for the individual locations; this siteprefix
7452 is only used to suggest the defaults.
7454 The default should be fine for most people.
7458 rp='Installation prefix to use for add-on modules and utilities?'
7459 : XXX Here might be another good place for an installstyle setting.
7460 case "$siteprefix" in
7462 *) dflt=$siteprefix ;;
7465 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7467 case "$siteprefix" in
7471 *) oldsiteprefix="$prefix";;
7476 siteprefixexp="$ansexp"
7478 : determine where site specific libraries go.
7479 : Usual default is /usr/local/lib/perl5/site_perl/$version
7480 : The default "style" setting is made in installstyle.U
7481 : XXX No longer works with Prefixit stuff.
7482 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7484 '') case "$installstyle" in
7485 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7486 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7494 The installation process will create a directory for
7495 site-specific extensions and modules. Most users find it convenient
7496 to place all site-specific files in this directory rather than in the
7497 main distribution directory.
7501 rp='Pathname for the site-specific library files?'
7505 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7507 : Determine list of previous versions to include in @INC
7508 $cat > getverlist <<EOPL
7511 \$api_versionstring = "$api_versionstring";
7512 \$version = "$version";
7513 \$stem = "$sitelib_stem";
7514 \$archname = "$archname";
7516 $cat >> getverlist <<'EOPL'
7517 # The list found is store twice for each entry: the original name, and
7518 # the binary broken down version as pack "sss", so sorting is easy and
7519 # unambiguous. This will work for all versions that have a maximum of
7520 # three digit groups, separate by '.'s or '_'s. Names are extended with
7521 # ".0.0" to ensure at least three elements for the pack.
7522 # -- H.Merijn Brand (m)'06 23-10-2006
7524 # Can't have leading @ because metaconfig interprets it as a command!
7525 ;@inc_version_list=();
7526 # XXX Redo to do opendir/readdir?
7529 ;@candidates = map {
7530 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7531 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7537 ($pversion, $aversion, $vsn5005) = map {
7538 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7539 foreach $d (@candidates) {
7540 if ($d->[1] lt $pversion) {
7541 if ($d->[1] ge $aversion) {
7542 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7544 elsif ($d->[1] ge $vsn5005) {
7545 unshift(@inc_version_list, grep { -d } $d->[0]);
7549 # Skip newer version. I.e. don't look in
7550 # 5.7.0 if we're installing 5.6.1.
7554 if (@inc_version_list) {
7555 print join(' ', @inc_version_list);
7558 # Blank space to preserve value for next Configure run.
7563 case "$inc_version_list" in
7564 '') if test -x "$perl5$exe_ext"; then
7565 dflt=`$perl5 getverlist`
7570 $undef) dflt='none' ;;
7571 *) eval dflt=\"$inc_version_list\" ;;
7574 ''|' ') dflt=none ;;
7581 In order to ease the process of upgrading, this version of perl
7582 can be configured to use modules built and installed with earlier
7583 versions of perl that were installed under $prefix. Specify here
7584 the list of earlier versions that this version of perl should check.
7585 If Configure detected no earlier versions of perl installed under
7586 $prefix, then the list will be empty. Answer 'none' to tell perl
7587 to not search earlier versions.
7589 The default should almost always be sensible, so if you're not sure,
7590 just accept the default.
7593 rp='List of earlier versions to include in @INC?'
7596 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7597 *) inc_version_list="$ans" ;;
7599 case "$inc_version_list" in
7601 inc_version_list_init='0'
7602 d_inc_version_list="$undef"
7604 *) inc_version_list_init=`echo $inc_version_list |
7605 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7606 d_inc_version_list="$define"
7611 : see if malloc/malloc.h has to be included
7612 set malloc/malloc.h i_mallocmalloc
7615 : see if this is a malloc.h system
7616 : we want a real compile instead of Inhdr because some systems have a
7617 : malloc.h that just gives a compile error saying to use stdlib.h instead
7622 #$i_mallocmalloc I_MALLOCMALLOC
7623 #ifdef I_MALLOCMALLOC
7624 # include <malloc/malloc.h>
7627 int main () { return 0; }
7630 if eval $compile; then
7631 echo "<malloc.h> found." >&4
7634 echo "<malloc.h> NOT found." >&4
7641 : check for length of pointer
7645 echo "Checking to see how big your pointers are..." >&4
7654 printf("%d\n", (int)sizeof(void *));
7659 if eval $compile_ok; then
7660 ptrsize=`$run ./try`
7661 echo "Your pointers are $ptrsize bytes long."
7664 echo "(I can't seem to compile the test program. Guessing...)" >&4
7665 rp="What is the size of a pointer (in bytes)?"
7672 case "$use64bitall" in
7673 "$define"|true|[yY]*)
7677 *** You have chosen a maximally 64-bit build,
7678 *** but your pointers are only 4 bytes wide.
7679 *** Please rerun Configure without -Duse64bitall.
7684 *** Since you have quads, you could possibly try with -Duse64bitint.
7689 *** Cannot continue, aborting.
7700 : determine whether to use malloc wrapping
7702 case "$usemallocwrap" in
7703 [yY]*|true|$define) dflt='y' ;;
7704 [nN]*|false|$undef) dflt='n' ;;
7705 *) case "$usedevel" in
7706 [yY]*|true|$define) dflt='y' ;;
7711 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7713 usemallocwrap="$ans"
7716 usemallocwrap="$define" ;;
7718 usemallocwrap="$undef" ;;
7721 : determine which malloc to compile in
7723 case "$usemymalloc" in
7724 [yY]*|true|$define) dflt='y' ;;
7725 [nN]*|false|$undef) dflt='n' ;;
7726 *) case "$ptrsize" in
7730 if test "$useithreads" = "$define"; then dflt='n'; fi
7733 rp="Do you wish to attempt to use the malloc that comes with $package?"
7739 mallocsrc='malloc.c'
7740 mallocobj="malloc$_o"
7741 d_mymalloc="$define"
7744 : Remove malloc from list of libraries to use
7745 echo "Removing unneeded -lmalloc from library list" >&4
7746 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7749 echo "libs = $libs" >&4
7761 : compute the return types of malloc and free
7763 $cat >malloc.c <<END
7767 #include <sys/types.h>
7781 case "$malloctype" in
7783 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7790 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7794 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7801 echo "Your system uses $freetype free(), it would seem." >&4
7803 : determine where site specific architecture-dependent libraries go.
7804 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7805 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7806 : sitelib may have an optional trailing /share.
7808 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7809 dflt="$dflt/$archname"
7814 set sitearch sitearch none
7818 The installation process will also create a directory for
7819 architecture-dependent site-specific extensions and modules.
7823 rp='Pathname for the site-specific architecture-dependent library files?'
7827 if $test X"$sitearch" = X"$sitelib"; then
7830 d_sitearch="$define"
7833 : Set the vendorprefix variables
7836 The installation process will also create a directory for
7837 vendor-supplied add-ons. Vendors who supply perl with their system
7838 may find it convenient to place all vendor-supplied files in this
7839 directory rather than in the main distribution directory. This will
7840 ease upgrades between binary-compatible maintenance versions of perl.
7842 Of course you may also use these directories in whatever way you see
7843 fit. For example, you might use them to access modules shared over a
7844 company-wide network.
7846 The default answer should be fine for most people.
7847 This causes further questions about vendor add-ons to be skipped
7848 and no vendor-specific directories will be configured for perl.
7851 rp='Do you want to configure vendor-specific add-on directories?'
7852 case "$usevendorprefix" in
7853 define|true|[yY]*) dflt=y ;;
7854 *) : User may have set vendorprefix directly on Configure command line.
7855 case "$vendorprefix" in
7864 rp='Installation prefix to use for vendor-supplied add-ons?'
7865 case "$vendorprefix" in
7866 '') dflt="$prefix" ;;
7867 *) dflt=$vendorprefix ;;
7870 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7872 case "$vendorprefix" in
7876 *) oldvendorprefix="$prefix";;
7880 usevendorprefix="$define"
7882 vendorprefixexp="$ansexp"
7884 *) usevendorprefix="$undef"
7890 : Set the vendorlib variables
7891 case "$vendorprefix" in
7892 '') d_vendorlib="$undef"
7896 *) d_vendorlib="$define"
7897 : determine where vendor-supplied modules go.
7898 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7899 case "$vendorlib" in
7901 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7902 case "$installstyle" in
7903 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7904 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7907 *) dflt="$vendorlib"
7911 rp='Pathname for the vendor-supplied library files?'
7914 vendorlibexp="$ansexp"
7917 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7921 : Set the vendorarch variables
7922 case "$vendorprefix" in
7923 '') d_vendorarch="$undef"
7927 *) d_vendorarch="$define"
7928 : determine where vendor-supplied architecture-dependent libraries go.
7929 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7930 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7931 : vendorlib may have an optional trailing /share.
7932 case "$vendorarch" in
7933 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7934 dflt="$dflt/$archname"
7936 *) dflt="$vendorarch" ;;
7939 rp='Pathname for vendor-supplied architecture-dependent files?'
7942 vendorarchexp="$ansexp"
7945 prefixvar=vendorarch
7947 if $test X"$vendorarch" = X"$vendorlib"; then
7948 d_vendorarch="$undef"
7950 d_vendorarch="$define"
7953 : Final catch-all directories to search
7956 Lastly, you can have perl look in other directories for extensions and
7957 modules in addition to those already specified.
7958 These directories will be searched after
7962 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7963 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7965 case "$otherlibdirs" in
7966 ''|' ') dflt='none' ;;
7967 *) dflt="$otherlibdirs" ;;
7970 Enter a colon-separated set of extra paths to include in perl's @INC
7971 search path, or enter 'none' for no extra paths.
7975 rp='Colon-separated list of additional directories for perl to search?'
7978 ' '|''|none) otherlibdirs=' ' ;;
7979 *) otherlibdirs="$ans" ;;
7981 case "$otherlibdirs" in
7985 set d_perl_otherlibdirs
7988 : Cruising for prototypes
7990 echo "Checking out function prototypes..." >&4
7991 $cat >prototype.c <<EOCP
7996 int main(int argc, char *argv[]) {
7999 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8000 echo "Your C compiler appears to support function prototypes."
8003 echo "Your C compiler doesn't seem to understand function prototypes."
8010 : Check if ansi2knr is required
8011 case "$prototype" in
8013 *) ansi2knr='ansi2knr'
8018 This version of $package can only be compiled by a compiler that
8019 understands function prototypes. Unfortunately, your C compiler
8021 doesn't seem to understand them. Sorry about that.
8023 If GNU cc is available for your system, perhaps you could try that instead.
8025 Eventually, we hope to support building Perl with pre-ANSI compilers.
8026 If you would like to help in that effort, please contact <perlbug@perl.org>.
8028 Aborting Configure now.
8035 dflt_dtrace='/usr/sbin/dtrace'
8036 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8040 Perl can be built to support DTrace on platforms that support it.
8041 DTrace is a diagnosis and performance analysis tool from Sun.
8043 If this doesn't make any sense to you, just accept the default '$dflt'.
8047 case "$usedtrace" in
8053 dflt_dtrace=$usedtrace
8060 rp='Support DTrace if available?'
8063 y|Y) val="$define" ;;
8069 test "X$usedtrace" != "X$define" && break
8072 rp='Where is the dtrace executable?'
8081 if $dtrace -h -s ../perldtrace.d \
8082 -o perldtrace.tmp >/dev/null 2>&1 \
8083 && rm -f perldtrace.tmp
8086 echo "Good: your $dtrace knows about the -h flag."
8090 *** $me: Fatal Error: $dtrace doesn't support -h flag
8092 *** Your installed dtrace doesn't support the -h switch to compile a D
8093 *** program into a C header. Can't continue.
8105 *** $me: Fatal Error: $dtrace not found.
8112 echo "*** $dtrace was not found."
8118 : See if we want extra modules installed
8125 Perl can be built with extra modules or bundles of modules which
8126 will be fetched from the CPAN and installed alongside Perl.
8128 Notice that you will need access to the CPAN; either via the Internet,
8129 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8130 be asked later to configure the CPAN.pm module which will in turn do
8131 the installation of the rest of the extra modules or bundles.)
8133 Notice also that if the modules require any external software such as
8134 libraries and headers (the libz library and the zlib.h header for the
8135 Compress::Zlib module, for example) you MUST have any such software
8136 already installed, this configuration process will NOT install such
8139 If this doesn't make any sense to you, just accept the default '$dflt'.
8141 rp='Install any extra modules (y or n)?'
8147 Please list any extra modules or bundles to be installed from CPAN,
8148 with spaces between the names. The names can be in any format the
8149 'install' command of CPAN.pm will understand. (Answer 'none',
8150 without the quotes, to install no extra modules or bundles.)
8160 $rm -f ../extras.lst
8162 *) echo "(Saving the list of extras for later...)"
8163 echo "$extras" > ../extras.lst
8171 : determine where html pages for programs go
8172 set html1dir html1dir none
8176 If you wish to install html files for programs in $spackage, indicate
8177 the appropriate directory here. To skip installing html files,
8181 ''|none|$undef|' ') dflt=none ;;
8182 *) dflt=$html1dir ;;
8185 rp="Directory for the main $spackage html pages?"
8189 : Use ' ' for none so value is preserved next time through Configure
8190 $test X"$html1dir" = "X" && html1dir=' '
8192 : determine where html pages for libraries and modules go
8193 set html3dir html3dir none
8197 If you wish to install html files for modules associated with $spackage,
8198 indicate the appropriate directory here. To skip installing html files,
8201 : There is no obvious default. If they have specified html1dir, then
8202 : try to key off that, possibly changing .../html1 into .../html3.
8204 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8205 *) dflt=$html3dir ;;
8208 rp="Directory for the $spackage module html pages?"
8212 : Use ' ' for none so value is preserved next time through Configure
8213 $test X"$html3dir" = "X" && html3dir=' '
8215 : determine whether to install perl also as /usr/bin/perl
8218 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8220 Many scripts expect perl to be installed as /usr/bin/perl.
8222 If you want to, I can install the perl you are about to compile
8223 as /usr/bin/perl (in addition to $bin/perl).
8225 if test -f /usr/bin/perl; then
8228 However, please note that because you already have a /usr/bin/perl,
8229 overwriting that with a new Perl would very probably cause problems.
8230 Therefore I'm assuming you don't want to do that (unless you insist).
8233 case "$installusrbinperl" in
8234 "$define"|[yY]*) dflt='y';;
8240 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8243 case "$installusrbinperl" in
8244 "$undef"|[nN]*) dflt='n';;
8248 rp="Do you want to install perl as /usr/bin/perl?"
8251 [yY]*) val="$define";;
8257 set installusrbinperl
8260 : see if dlopen exists
8262 xxx_ccflags="$ccflags"
8264 : with g++ one needs -shared to get is-in-libc to work for dlopen
8265 case "$gccversion" in
8267 *) case "$d_cplusplus" in
8268 "$define") ccflags="$ccflags -shared" ;;
8275 ccflags="$xxx_ccflags"
8277 : see if this is a unistd.h system
8278 set unistd.h i_unistd
8281 : determine which dynamic loading, if any, to compile in
8283 dldir="ext/DynaLoader"
8296 $define) dflt='y' ;;
8298 : Does a dl_xxx.xs file exist for this operating system
8299 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8302 rp="Do you wish to use dynamic loading?"
8309 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8310 dflt="$dldir/dl_${osname}.xs"
8311 elif $test "$d_dlopen" = "$define" ; then
8312 dflt="$dldir/dl_dlopen.xs"
8317 *) dflt="$dldir/$dlsrc"
8320 echo "The following dynamic loading files are available:"
8321 : Can not go over to $dldir because getfile has path hard-coded in.
8322 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8323 rp="Source file to use for dynamic loading"
8329 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8333 Some systems may require passing special flags to $cc -c to
8334 compile modules that will be used to create a shared library.
8335 To use no flags, say "none".
8338 case "$cccdlflags" in
8339 '') case "$gccversion" in
8340 '') case "$osname" in
8342 irix*) dflt='-KPIC' ;;
8343 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8344 sunos) dflt='-pic' ;;
8348 *) case "$osname" in
8349 darwin) dflt='none' ;;
8350 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8355 *) dflt="$cccdlflags" ;;
8362 # If -Dsysroot was specified, now's the time to add it
8364 if test "X$sysroot" != X; then
8365 case "$gccversion" in
8370 dflt="$dflt --sysroot=$sysroot" ;;
8380 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8383 none) cccdlflags=' ' ;;
8384 *) cccdlflags="$ans" ;;
8389 Some systems use ld to create libraries that can be dynamically loaded,
8390 while other systems (such as those using ELF) use $cc.
8394 : Determine if this is ELF
8396 /* Test for whether ELF binaries are produced */
8408 int i = open("a.out",O_RDONLY);
8411 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8412 exit(0); /* succeed (yes, it is ELF) */
8416 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8422 '') if $test $bin_ELF = "$define"; then
8424 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8428 echo "I'll use ld to build dynamic libraries."
8436 rp="What command should be used to create dynamic libraries?"
8442 Some systems may require passing special flags to $ld to create a
8443 library that can be dynamically loaded. If your ld flags include
8444 -L/other/path options to locate libraries outside your loader's normal
8445 search path, you may need to specify those -L options here as well. To
8446 use no flags, say "none".
8449 case "$lddlflags" in
8450 '') case "$osname" in
8451 haiku) dflt='-shared' ;;
8453 case "$gccversion" in
8454 '') dflt="$dflt +vnocompatwarnings" ;;
8457 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8458 solaris) # See [perl #66604].
8459 # On Solaris 11, gcc -m64 on amd64
8460 # appears not to understand -G. gcc versions at
8461 # least as old as 3.4.3 support -shared, so just
8462 # use that with Solaris 11 and later, but keep
8463 # the old behavior for older Solaris versions.
8464 case "$gccversion" in
8466 *) case "$osvers" in
8467 2.?|2.10) dflt='-G' ;;
8468 *) dflt='-shared' ;;
8473 sunos) dflt='-assert nodefinitions' ;;
8474 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8478 *) dflt="$lddlflags" ;;
8481 : Only do this for gcc, since, for example, qcc has no concept
8483 if $test "X$sysroot" != X; then
8484 case "$gccversion" in
8486 *) dflt="$dflt --sysroot $sysroot" ;;
8490 : Try to guess additional flags to pick up local libraries.
8491 : Be careful not to append to a plain 'none'
8495 for thisflag in $ldflags; do
8500 *) dflt="$dflt $thisflag" ;;
8507 ''|' ') dflt='none' ;;
8511 *-fstack-protector-strong*)
8513 *-fstack-protector-strong*) ;; # Don't add it again
8514 *) dflt="$dflt -fstack-protector-strong" ;;
8517 *-fstack-protector*)
8519 *-fstack-protector*) ;; # Don't add it again
8520 *) dflt="$dflt -fstack-protector" ;;
8525 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8528 none) lddlflags=' ' ;;
8529 *) lddlflags="$ans" ;;
8534 Some systems may require passing special flags to $cc to indicate that
8535 the resulting executable will use dynamic linking. To use no flags,
8539 case "$ccdlflags" in
8540 '') case "$osname" in
8541 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8542 sunos) dflt='none' ;;
8546 *) dflt="$ccdlflags" ;;
8548 rp="Any special flags to pass to $cc to use dynamic linking?"
8551 none) ccdlflags=' ' ;;
8552 *) ccdlflags="$ans" ;;
8564 ld_can_script="$undef"
8565 case "$bin_ELF$usedl" in
8567 # Abuse try.h and a.out names for neat cleanup
8579 if $cc $cccdlflags $ccdlflags $ccflags \
8580 $ldflags $lddlflags -o a.out try.c \
8581 -Wl,--version-script=try.h >/dev/null 2>&1 \
8582 && $test -s a.out ; then
8583 echo "ld supports scripting" >&4
8584 ld_can_script="$define"
8586 echo "ld does not support scripting" >&4
8592 : Do we want a shared libperl?
8596 # No dynamic loading being used, so don't bother even to prompt.
8599 *) case "$useshrplib" in
8600 '') case "$osname" in
8601 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8603 also='Building a shared libperl is required for dynamic loading to work on your system.'
8617 The perl executable is normally obtained by linking perlmain.c with
8618 libperl${_a}, any static extensions (usually just DynaLoader), and
8619 any other libraries needed on this system (such as -lm, etc.). Since
8620 your system supports dynamic loading, it is probably possible to build
8621 a shared libperl.$so. If you will have more than one executable linked
8622 to libperl.$so, this will significantly reduce the size of each
8623 executable, but it may have a noticeable effect on performance. The
8624 default is probably sensible for your system.
8628 rp="Build a shared libperl.$so (y/n)"
8632 useshrplib='true' ;;
8633 *) useshrplib='false' ;;
8638 case "$useshrplib" in
8640 case "$userelocatableinc" in
8642 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8643 echo "See INSTALL for an explanation why that won't work." >&4
8649 # Figure out a good name for libperl.so. Since it gets stored in
8650 # a version-specific architecture-dependent library, the version
8651 # number isn't really that important, except for making cc/ld happy.
8653 # A name such as libperl.so.10.1
8654 majmin="libperl.$so.$patchlevel.$subversion"
8655 # A name such as libperl.so.100
8656 majonly=`echo $patchlevel $subversion |
8657 $awk '{printf "%d%02d", $1, $2}'`
8658 majonly=libperl.$so.$majonly
8659 # I'd prefer to keep the os-specific stuff here to a minimum, and
8660 # rely on figuring it out from the naming of libc.
8661 case "${osname}${osvers}" in
8662 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8665 cygwin*) # ld links now against the dll directly
8666 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8667 majonly=`echo $patchlevel $subversion |
8668 $awk '{printf "%03d%03d", $1, $2}'`
8669 majonly=cygperl5.$majonly.$so
8672 *) # Try to guess based on whether libc has major.minor.
8674 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8675 *libc.$so.[0-9]*) dflt=$majonly ;;
8676 *) dflt=libperl.$so ;;
8686 I need to select a good name for the shared libperl. If your system uses
8687 library names with major and minor numbers, then you might want something
8688 like $majmin. Alternatively, if your system uses a single version
8689 number for shared libraries, then you might want to use $majonly.
8690 Or, your system might be quite happy with a simple libperl.$so.
8692 Since the shared libperl will get installed into a version-specific
8693 architecture-dependent directory, the version number of the shared perl
8694 library probably isn't important, so the default should be o.k.
8697 rp='What name do you want to give to the shared libperl?'
8700 echo "Ok, I'll use $libperl"
8703 libperl="libperl${_a}"
8707 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8711 WARNING: Use of the shrpdir variable for the installation location of
8712 the shared $libperl is not supported. It was never documented and
8713 will not work in this version. Let me (perlbug@perl.org)
8714 know of any problems this may cause.
8720 But your current setting of $shrpdir is
8721 the default anyway, so it's harmless.
8726 Further, your current attempted setting of $shrpdir
8727 conflicts with the value of $archlibexp/CORE
8728 that installperl will use.
8735 # How will the perl executable find the installed shared $libperl?
8736 # Add $xxx to ccdlflags.
8737 # If we can't figure out a command-line option, use $shrpenv to
8738 # set env LD_RUN_PATH. The main perl makefile uses this.
8739 shrpdir=$archlibexp/CORE
8742 if "$useshrplib"; then
8745 # We'll set it in Makefile.SH...
8750 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8751 xxx="-Wl,-R$shrpdir"
8753 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8754 xxx="-Wl,-rpath,$shrpdir"
8757 # hpux doesn't like the default, either.
8758 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8761 # cygwin needs only ldlibpth
8764 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8770 # Only add $xxx if it isn't already in ccdlflags.
8771 case " $ccdlflags " in
8773 *) ccdlflags="$ccdlflags $xxx"
8776 Adding $xxx to the flags
8777 passed to $ld so that the perl executable will find the
8778 installed shared $libperl.
8786 # Fix ccdlflags in AIX for building external extensions.
8787 # (For building Perl itself bare -bE:perl.exp is needed,
8788 # Makefile.SH takes care of this.)
8790 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8792 # Respect a hint or command-line value.
8794 '') shrpenv="$tmp_shrpenv" ;;
8796 case "$ldlibpthname" in
8797 '') ldlibpthname=LD_LIBRARY_PATH ;;
8798 none) ldlibpthname='' ;;
8801 : determine where manual pages are on this system
8805 syspath='/usr/share/man/man1 /usr/man/man1'
8806 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8807 syspath="$syspath /usr/man/u_man/man1"
8808 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8809 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8810 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8811 sysman=`./loc . /usr/man/man1 $syspath`
8814 if $test -d "$sysman"; then
8815 echo "System manual is in $sysman." >&4
8817 echo "Could not find manual pages in source form." >&4
8820 : determine where manual pages go
8821 set man1dir man1dir none
8825 $spackage has manual pages available in source form.
8829 echo "However, you don't have nroff, so they're probably useless to you."
8831 '') man1dir="none";;
8834 echo "If you don't want the manual sources installed, answer 'none'."
8839 lookpath="$prefixexp/share/man/man1"
8840 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8841 lookpath="$lookpath $prefixexp/man/p_man/man1"
8842 lookpath="$lookpath $prefixexp/man/u_man/man1"
8843 lookpath="$lookpath $prefixexp/man/man.1"
8845 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8846 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8856 rp="Where do the main $spackage manual pages (source) go?"
8858 if $test "X$man1direxp" != "X$ansexp"; then
8869 : What suffix to use on installed man pages
8876 rp="What suffix should be used for the main $spackage man pages?"
8878 '') case "$man1dir" in
8892 *) dflt="$man1ext";;
8899 : see if we can have long filenames
8901 first=123456789abcdef
8903 if (echo hi >$first) 2>/dev/null; then
8904 if $test -f 123456789abcde; then
8905 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8908 echo 'You can have filenames longer than 14 characters.'>&4
8913 You can't have filenames longer than 14 chars.
8914 You can't even think about them!
8920 $rm -rf 123456789abcde*
8922 : determine where library module manual pages go
8923 set man3dir man3dir none
8927 $spackage has manual pages for many of the library modules.
8933 However, you don't have nroff, so they're probably useless to you.
8936 '') man3dir="none";;
8940 case "$d_flexfnam" in
8943 However, your system can't handle the long file names like File::Basename.3.
8946 '') man3dir="none";;
8950 echo "If you don't want the manual sources installed, answer 'none'."
8951 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8953 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8954 if $test -d "$privlib/man/man3"; then
8957 WARNING: Previous versions of perl installed man3 pages into
8958 $privlib/man/man3. This version will suggest a
8959 new default of $dflt.
8963 rp='Do you wish to preserve the old behavior?(y/n)'
8966 y*) dflt="$privlib/man/man3" ;;
8971 *) dflt="$man3dir" ;;
8978 rp="Where do the $package library man pages (source) go?"
8988 : What suffix to use on installed man pages
8994 rp="What suffix should be used for the $package library man pages?"
8996 '') case "$man3dir" in
9010 *) dflt="$man3ext";;
9017 : see if we have to deal with yellow pages, now NIS.
9018 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9024 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9032 rp='Are you getting the hosts file via yellow pages?'
9035 y*) hostcat='ypcat hosts';;
9036 *) hostcat='cat /etc/hosts';;
9042 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9045 '') test -f /etc/group && groupcat='cat /etc/group';;
9048 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9051 : now get the host name
9053 echo "Figuring out host name..." >&4
9054 case "$myhostname" in
9056 echo 'Maybe "hostname" will work...'
9057 if tans=`sh -c hostname 2>&1` ; then
9065 if $test "$cont"; then
9067 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9068 if tans=`cat /etc/systemid 2>&1` ; then
9070 phostname='cat /etc/systemid'
9071 echo "Whadyaknow. Xenix always was a bit strange..."
9074 elif $test -r /etc/systemid; then
9075 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9078 if $test "$cont"; then
9079 echo 'No, maybe "uuname -l" will work...'
9080 if tans=`sh -c 'uuname -l' 2>&1` ; then
9082 phostname='uuname -l'
9084 echo 'Strange. Maybe "uname -n" will work...'
9085 if tans=`sh -c 'uname -n' 2>&1` ; then
9087 phostname='uname -n'
9089 echo 'Oh well, maybe I can mine it out of whoami.h...'
9090 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9091 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9092 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9094 case "$myhostname" in
9095 '') echo "Does this machine have an identity crisis or something?"
9098 echo "Well, you said $myhostname before..."
9099 phostname='echo $myhostname';;
9105 case "$myhostname" in
9106 '') myhostname=noname ;;
9108 : you do not want to know about this
9113 if $test "$myhostname" ; then
9115 rp='Your host name appears to be "'$myhostname'".'" Right?"
9123 : bad guess or no guess
9124 while $test "X$myhostname" = X ; do
9126 rp="Please type the (one word) name of your host:"
9131 : translate upper to lower if necessary
9132 case "$myhostname" in
9134 echo "(Normalizing case in your host name)"
9135 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9139 case "$myhostname" in
9141 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9142 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9143 echo "(Trimming domain name from host name--host name is now $myhostname)"
9145 *) case "$mydomain" in
9148 test "X$hostcat" = "Xypcat hosts" &&
9149 ypmatch "$myhostname" hosts 2>/dev/null |\
9150 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9153 test "X$hostcat" != "X" &&
9154 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9155 /[ ]$myhostname[ . ]/p" > hosts
9158 if $test -f hosts; then
9159 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9160 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9161 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9162 hosts | $sort | $uniq | \
9163 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9164 case `$echo X$dflt` in
9165 X*\ *) echo "(Several hosts in the database matched hostname)"
9168 X.) echo "(You do not have fully-qualified names in the hosts database)"
9172 echo "(I cannot locate a hosts database anywhere)"
9177 tans=`./loc resolv.conf X /etc /usr/etc`
9178 if $test -f "$tans"; then
9179 echo "(Attempting domain name extraction from $tans)"
9180 dflt=.`$sed -n -e 's/ / /g' \
9181 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9184 .) dflt=.`$sed -n -e 's/ / /g' \
9185 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9193 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9194 dflt=.`sh -c domainname 2>/dev/null`
9197 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9201 case "$dflt$osname" in
9202 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9203 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9207 .) echo "(Lost all hope -- silly guess then)"
9213 *) dflt="$mydomain";;
9217 rp="What is your domain name?"
9227 : translate upper to lower if necessary
9230 echo "(Normalizing case in your domain name)"
9231 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9235 : a little sanity check here
9236 case "$phostname" in
9239 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9240 $myhostname$mydomain|$myhostname) ;;
9242 case "$phostname" in
9244 echo "(That doesn't agree with your whoami.h file, by the way.)"
9247 echo "(That doesn't agree with your $phostname command, by the way.)"
9255 : determine the e-mail address of the user who is running us
9258 I need to get your e-mail address in Internet format if possible, i.e.
9259 something like user@host.domain. Please answer accurately since I have
9260 no easy means to double check it. The default value provided below
9261 is most probably close to reality but may not be valid from outside
9262 your organization...
9266 while test "$cont"; do
9267 case "$MAILDOMAIN" in
9269 if $test -s /etc/mailname; then
9270 maildomain=`$cat /etc/mailname`
9272 maildomain="$myhostname$mydomain"
9275 *) maildomain="$MAILDOMAIN";;
9278 '') dflt="$cf_by@$maildomain";;
9279 *) dflt="$cf_email";;
9281 rp='What is your e-mail address?'
9287 rp='Address does not look like an Internet one. Use it anyway?'
9301 : Ask e-mail of administrator
9304 If you or somebody else will be maintaining perl at your site, please
9305 fill in the correct e-mail address here so that they may be contacted
9306 if necessary. Currently, the "perlbug" program included with perl
9307 will send mail to this address in addition to perlbug@perl.org. You may
9308 enter "none" for no administrator.
9311 case "$perladmin" in
9312 '') dflt="$cf_email";;
9313 *) dflt="$perladmin";;
9315 rp='Perl administrator e-mail address'
9319 : determine whether to only install version-specific parts.
9322 Do you want to install only the version-specific parts of the perl
9323 distribution? Usually you do *not* want to do this.
9325 case "$versiononly" in
9326 "$define"|[Yy]*|true) dflt='y' ;;
9329 rp="Do you want to install only the version-specific parts of perl?"
9332 [yY]*) val="$define";;
9338 case "$versiononly" in
9339 "$define") inc_version_list=''
9340 inc_version_list_init=0
9344 : figure out how to guarantee perl startup
9345 : XXX Note that this currently takes advantage of the bug that binexp ignores
9346 : the Configure -Dinstallprefix setting, which in turn means that under
9347 : relocatable @INC, initialinstalllocation is what binexp started as.
9348 case "$startperl" in
9350 case "$sharpbang" in
9354 I can use the #! construct to start perl on your system. This will
9355 make startup of perl scripts faster, but may cause problems if you
9356 want to share those scripts and perl is not in a standard place
9357 ($initialinstalllocation/perl) on all your platforms. The alternative
9358 is to force a shell by starting the script with a single ':' character.
9361 case "$versiononly" in
9362 "$define") dflt="$initialinstalllocation/perl$version";;
9363 *) dflt="$initialinstalllocation/perl";;
9365 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9368 none) startperl=": # use perl";;
9369 *) startperl="#!$ans"
9370 if $test 30 -lt `echo "$ans" | wc -c`; then
9373 WARNING: Some systems limit the #! command to 32 characters.
9374 If you experience difficulty running Perl scripts with #!, try
9375 installing Perl in a directory with a shorter pathname.
9381 *) startperl=": # use perl"
9386 echo "I'll use $startperl to start perl scripts."
9388 : figure best path for perl in scripts
9391 case "$versiononly" in
9392 "$define") perlpath="$initialinstalllocation/perl$version";;
9393 *) perlpath="$initialinstalllocation/perl";;
9395 case "$startperl" in
9400 I will use the "eval 'exec'" idiom to start Perl on your system.
9401 I can use the full path of your Perl binary for this purpose, but
9402 doing so may cause problems if you want to share those scripts and
9403 Perl is not always in a standard place ($initialinstalllocation/perl).
9406 dflt="$initialinstalllocation/perl"
9407 rp="What path shall I use in \"eval 'exec'\"?"
9414 case "$startperl" in
9416 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9419 : determine where public executable scripts go
9420 set scriptdir scriptdir
9422 case "$scriptdir" in
9425 : guess some guesses
9426 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9427 $test -d /usr/share/bin && dflt=/usr/share/bin
9428 $test -d /usr/local/script && dflt=/usr/local/script
9429 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9430 $test -d $prefixexp/script && dflt=$prefixexp/script
9434 *) dflt="$scriptdir"
9439 Some installations have a separate directory just for executable scripts so
9440 that they can mount it across multiple architectures but keep the scripts in
9441 one spot. You might, for example, have a subdirectory of /usr/share for this.
9442 Or you might just lump your scripts in with all your other executables.
9446 rp='Where do you keep publicly executable scripts?'
9448 if $test "X$ansexp" != "X$scriptdirexp"; then
9454 : A little fix up for an irregularly named variable.
9455 installscript="$installscriptdir"
9457 : determine where add-on public executables go
9459 '') dflt=$siteprefix/bin ;;
9463 rp='Pathname where the add-on public executables should be installed?'
9468 : determine where add-on html pages go
9469 : There is no standard location, so try to copy the previously-selected
9470 : directory structure for the core html pages.
9471 case "$sitehtml1dir" in
9472 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9473 *) dflt=$sitehtml1dir ;;
9476 ''|' ') dflt=none ;;
9479 rp='Pathname where the site-specific html pages should be installed?'
9481 prefixvar=sitehtml1dir
9484 : determine where add-on library html pages go
9485 : There is no standard location, so try to copy the previously-selected
9486 : directory structure for the core html pages.
9487 case "$sitehtml3dir" in
9488 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9489 *) dflt=$sitehtml3dir ;;
9492 ''|' ') dflt=none ;;
9495 rp='Pathname where the site-specific library html pages should be installed?'
9497 prefixvar=sitehtml3dir
9500 : determine where add-on manual pages go
9501 case "$siteman1dir" in
9502 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9503 *) dflt=$siteman1dir ;;
9506 ''|' ') dflt=none ;;
9509 rp='Pathname where the site-specific manual pages should be installed?'
9511 prefixvar=siteman1dir
9514 : determine where add-on library man pages go
9515 case "$siteman3dir" in
9516 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9517 *) dflt=$siteman3dir ;;
9520 ''|' ') dflt=none ;;
9523 rp='Pathname where the site-specific library manual pages should be installed?'
9525 prefixvar=siteman3dir
9528 : determine where add-on public executable scripts go
9529 case "$sitescript" in
9530 '') dflt=$siteprefix/script
9531 $test -d $dflt || dflt=$sitebin ;;
9532 *) dflt="$sitescript" ;;
9535 rp='Pathname where add-on public executable scripts should be installed?'
9537 prefixvar=sitescript
9540 : see if backtrace exists
9541 set backtrace d_backtrace
9544 : add flags if using c backtrace
9545 case "$usecbacktrace" in
9546 "") usecbacktrace=$undef ;;
9548 case "$d_backtrace" in
9550 case " $ccflags " in
9551 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9552 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9556 echo "This system does not support backtrace" >&4
9557 usecbacktrace=$undef
9563 : Check if faststdio is requested and available
9564 case "$usefaststdio" in
9565 $define|true|[yY]*|'')
9566 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9576 Perl can be built to use 'fast stdio', which means using the stdio
9577 library but also directly manipulating the stdio buffers to enable
9578 faster I/O. Using stdio is better for backward compatibility (especially
9579 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9580 interface has been preferred instead of stdio.
9582 If this doesn't make any sense to you, just accept the default '$dflt'.
9584 rp='Use the "fast stdio" if available?'
9587 y|Y) val="$define" ;;
9594 : define an is-a-typedef? function
9595 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9597 "") inclist="sys/types.h";;
9599 eval "varval=\$$var";
9603 for inc in $inclist; do
9604 echo "#include <$inc>" >>temp.c;
9606 echo "#ifdef $type" >> temp.c;
9607 echo "printf(\"We have $type\");" >> temp.c;
9608 echo "#endif" >> temp.c;
9609 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9610 if $contains $type temp.E >/dev/null 2>&1; then
9616 *) eval "$var=\$varval";;
9619 : define an is-a-typedef? function that prompts if the type is not available.
9620 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9622 "") inclist="sys/types.h";;
9624 eval "varval=\$$var";
9628 for inc in $inclist; do
9629 echo "#include <$inc>" >>temp.c;
9631 echo "#ifdef $type" >> temp.c;
9632 echo "printf(\"We have $type\");" >> temp.c;
9633 echo "#endif" >> temp.c;
9634 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9636 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9637 if $contains $type temp.E >/dev/null 2>&1; then
9638 echo "$type found." >&4;
9641 echo "$type NOT found." >&4;
9647 *) eval "$var=\$varval";;
9650 : see what type lseek is declared as in the kernel
9651 rp="What is the type used for lseek's offset on this system?"
9652 set off_t lseektype long stdio.h sys/types.h
9656 echo "Checking to see how big your file offsets are..." >&4
9658 #include <sys/types.h>
9662 printf("%d\n", (int)sizeof($lseektype));
9667 if eval $compile_ok; then
9668 lseeksize=`$run ./try`
9669 echo "Your file offsets are $lseeksize bytes long."
9673 echo "(I can't seem to compile the test program. Guessing...)"
9674 rp="What is the size of your file offsets (in bytes)?"
9680 : see what type file positions are declared as in the library
9681 rp="What is the type for file position used by fsetpos()?"
9682 set fpos_t fpostype long stdio.h sys/types.h
9685 : Check size for Fpos_t
9688 *_t) zzz="$fpostype" ;;
9691 echo "Checking the size of $zzz..." >&4
9693 #include <sys/types.h>
9700 printf("%d\n", (int)sizeof($fpostype));
9705 if eval $compile_ok; then
9709 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9712 echo "Your $zzz is $fpossize bytes long."
9718 echo "(I can't compile the test program. Guessing...)" >&4
9719 rp="What is the size of your file positions (in bytes)?"
9724 : Check for large file support
9725 # Backward compatibility (uselfs is deprecated).
9727 "$define"|true|[yY]*)
9730 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9732 uselargefiles="$define"
9736 case "$lseeksize:$fpossize" in
9739 You can have files larger than 2 gigabytes.
9742 *) case "$uselargefiles" in
9743 "$undef"|false|[nN]*) dflt='n' ;;
9748 Perl can be built to understand large files (files larger than 2 gigabytes)
9749 on some systems. To do so, Configure can be run with -Duselargefiles.
9751 If this doesn't make any sense to you, just accept the default '$dflt'.
9753 rp='Try to understand large files, if available?'
9756 y|Y) val="$define" ;;
9763 : Look for a hint-file generated 'call-back-unit'. If the
9764 : user has specified that a large files perl is to be built,
9765 : we may need to set or change some other defaults.
9766 if $test -f uselargefiles.cbu; then
9767 echo "Your platform has some specific hints regarding large file builds, using them..."
9768 . ./uselargefiles.cbu
9770 case "$uselargefiles" in
9772 if $test -f uselargefiles.cbu; then
9774 echo "Rechecking to see how big your file offsets are..." >&4
9776 #include <sys/types.h>
9780 printf("%d\n", (int)sizeof($lseektype));
9785 if eval $compile_ok; then
9786 lseeksize=`$run ./try`
9787 $echo "Your file offsets are now $lseeksize bytes long."
9791 echo "(I can't seem to compile the test program. Guessing...)"
9792 rp="What is the size of your file offsets (in bytes)?"
9797 *_t) zzz="$fpostype" ;;
9800 $echo $n "Rechecking the size of $zzz...$c" >&4
9802 #include <sys/types.h>
9809 printf("%d\n", (int)sizeof($fpostype));
9814 if eval $compile_ok; then
9819 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9822 echo " $fpossize bytes." >&4
9828 echo "(I can't compile the test program. Guessing...)" >&4
9829 rp="What is the size of your file positions (in bytes)?"
9838 : Check if we want perlio
9841 : Set the vendorbin variables
9842 case "$vendorprefix" in
9843 '') d_vendorbin="$undef"
9847 *) d_vendorbin="$define"
9848 : determine where vendor-supplied executables go.
9849 case "$vendorbin" in
9850 '') dflt=$vendorprefix/bin ;;
9851 *) dflt="$vendorbin" ;;
9854 rp='Pathname for the vendor-supplied executables directory?'
9857 vendorbinexp="$ansexp"
9863 : Set the vendorhtml1dir variables
9864 case "$vendorprefix" in
9865 '') vendorhtml1dir=''
9866 vendorhtml1direxp=''
9868 *) : determine where vendor-supplied html pages go.
9869 : There is no standard location, so try to copy the previously-selected
9870 : directory structure for the core html pages.
9871 : XXX Better default suggestions would be welcome.
9872 case "$vendorhtml1dir" in
9873 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9874 *) dflt=$vendorhtml1dir ;;
9877 ''|' ') dflt=none ;;
9880 rp='Pathname for the vendor-supplied html pages?'
9882 vendorhtml1dir="$ans"
9883 vendorhtml1direxp="$ansexp"
9886 : Use ' ' for none so value is preserved next time through Configure
9887 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9888 prefixvar=vendorhtml1dir
9891 : Set the vendorhtml3dir variables
9892 case "$vendorprefix" in
9893 '') vendorhtml3dir=''
9894 vendorhtml3direxp=''
9896 *) : determine where vendor-supplied module html pages go.
9897 : There is no standard location, so try to copy the previously-selected
9898 : directory structure for the core html pages.
9899 : XXX Better default suggestions would be welcome.
9900 case "$vendorhtml3dir" in
9901 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9902 *) dflt=$vendorhtml3dir ;;
9905 ''|' ') dflt=none ;;
9908 rp='Pathname for the vendor-supplied html pages?'
9910 vendorhtml3dir="$ans"
9911 vendorhtml3direxp="$ansexp"
9914 : Use ' ' for none so value is preserved next time through Configure
9915 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9916 prefixvar=vendorhtml3dir
9919 : Set the vendorman1dir variables
9920 case "$vendorprefix" in
9921 '') vendorman1dir=''
9924 *) : determine where vendor-supplied manual pages go.
9925 case "$vendorman1dir" in
9926 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9927 *) dflt=$vendorman1dir ;;
9930 ''|' ') dflt=none ;;
9933 rp='Pathname for the vendor-supplied manual section 1 pages?'
9935 vendorman1dir="$ans"
9936 vendorman1direxp="$ansexp"
9939 : Use ' ' for none so value is preserved next time through Configure
9940 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9941 prefixvar=vendorman1dir
9944 : Set the vendorman3dir variables
9945 case "$vendorprefix" in
9946 '') vendorman3dir=''
9949 *) : determine where vendor-supplied module manual pages go.
9950 case "$vendorman3dir" in
9951 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9952 *) dflt=$vendorman3dir ;;
9955 ''|' ') dflt=none ;;
9958 rp='Pathname for the vendor-supplied manual section 3 pages?'
9960 vendorman3dir="$ans"
9961 vendorman3direxp="$ansexp"
9964 : Use ' ' for none so value is preserved next time through Configure
9965 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9966 prefixvar=vendorman3dir
9969 : Set the vendorscript variables
9970 case "$vendorprefix" in
9971 '') d_vendorscript="$undef"
9975 *) d_vendorscript="$define"
9976 : determine where vendor-supplied scripts go.
9977 case "$vendorscript" in
9978 '') dflt=$vendorprefix/script
9979 $test -d $dflt || dflt=$vendorbin ;;
9980 *) dflt="$vendorscript" ;;
9984 The installation process will create a directory for
9985 vendor-supplied scripts.
9989 rp='Pathname for the vendor-supplied scripts directory?'
9992 vendorscriptexp="$ansexp"
9995 prefixvar=vendorscript
9998 : script used to emit important warnings
10001 if test \$# -gt 0; then
10006 echo "*** WARNING:" >&4
10007 sed -e 's/^/*** /' <msg >&4
10009 cat msg >>config.msg
10010 echo " " >>config.msg
10016 : see which of string.h or strings.h is needed
10018 strings=`./findhdr string.h`
10019 if $test "$strings" && $test -r "$strings"; then
10020 echo "Using <string.h> instead of <strings.h>." >&4
10024 strings=`./findhdr strings.h`
10025 if $test "$strings" && $test -r "$strings"; then
10026 echo "Using <strings.h> instead of <string.h>." >&4
10028 ./warn "No string header found -- You'll surely have problems."
10033 case "$i_string" in
10034 "$undef") strings=`./findhdr strings.h`;;
10035 *) strings=`./findhdr string.h`;;
10038 : see if qgcvt exists
10042 : Check what kind of doubles your system has
10043 $echo "Checking the kind of doubles you have..." >&4
10045 #$i_stdlib I_STDLIB
10046 #define DOUBLESIZE $doublesize
10048 #include <stdlib.h>
10051 static const double d = -0.1;
10053 unsigned const char* b = (unsigned const char*)(&d);
10054 #if DOUBLESIZE == 4
10055 if (b[0] == 0xCD && b[3] == 0xBD) {
10056 /* IEEE 754 32-bit little-endian */
10060 if (b[0] == 0xBD && b[3] == 0xCD) {
10061 /* IEEE 754 32-bit big-endian */
10066 #if DOUBLESIZE == 8
10067 if (b[0] == 0x9A && b[7] == 0xBF) {
10068 /* IEEE 754 64-bit little-endian */
10072 if (b[0] == 0xBF && b[7] == 0x9A) {
10073 /* IEEE 754 64-bit big-endian */
10077 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10078 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10079 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10080 * 99 99 b9 bf 9a 99 99 99 */
10084 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10085 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10086 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10087 * 99 99 99 9a bf b9 99 99 */
10092 #if DOUBLESIZE == 16
10093 if (b[0] == 0x9A && b[15] == 0xBF) {
10094 /* IEEE 754 128-bit little-endian */
10098 if (b[0] == 0xBF && b[15] == 0x9A) {
10099 /* IEEE 754 128-bit big-endian */
10104 /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY.
10105 * Whether those environments can still build Perl is debatable. */
10106 printf("-1\n"); /* unknown */
10111 if eval $compile; then
10112 doublekind=`$run ./try`
10116 case "$doublekind" in
10117 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10118 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10119 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10120 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10121 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10122 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10123 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10124 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10125 *) echo "Cannot figure out your double. You VAX, or something?" >&4 ;;
10129 : Check print/scan long double stuff
10132 if $test X"$d_longdbl" = X"$define"; then
10134 echo "Checking how to print long doubles..." >&4
10136 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10137 $cat >try.c <<'EOCP'
10138 #include <sys/types.h>
10141 double d = 123.456;
10142 printf("%.3f\n", d);
10146 if eval $compile; then
10150 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10151 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10152 echo "We will use %f."
10158 if $test X"$sPRIfldbl" = X; then
10159 $cat >try.c <<'EOCP'
10160 #include <sys/types.h>
10163 long double d = 123.456;
10164 printf("%.3Lf\n", d);
10168 if eval $compile; then
10172 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10173 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10174 echo "We will use %Lf."
10180 if $test X"$sPRIfldbl" = X; then
10181 $cat >try.c <<'EOCP'
10182 #include <sys/types.h>
10185 long double d = 123.456;
10186 printf("%.3llf\n", d);
10190 if eval $compile; then
10194 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10195 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10196 echo "We will use %llf."
10202 if $test X"$sPRIfldbl" = X; then
10203 $cat >try.c <<'EOCP'
10204 #include <sys/types.h>
10207 long double d = 123.456;
10208 printf("%.3lf\n", d);
10212 if eval $compile; then
10216 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10217 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10218 echo "We will use %lf."
10224 if $test X"$sPRIfldbl" = X; then
10225 echo "Cannot figure out how to print long doubles." >&4
10227 sSCNfldbl=$sPRIfldbl # expect consistency
10234 case "$sPRIfldbl" in
10235 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10236 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10237 d_SCNfldbl="$undef";
10239 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10240 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10241 d_SCNfldbl="$define";
10245 : Before committing on uselongdouble, see whether that looks sane.
10246 if $test "$uselongdouble" = "$define"; then
10249 echo "Checking if your long double math functions work right..." >&4
10254 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10257 case "$osname:$gccversion" in
10258 aix:) saveccflags="$ccflags"
10259 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10262 if eval $compile_ok; then
10266 3) echo "Your long double math functions are working correctly." >&4 ;;
10267 *) echo "Your long double math functions are broken, not using long doubles." >&4
10268 uselongdouble=$undef
10272 case "$osname:$gccversion" in
10273 aix:) ccflags="$saveccflags" ;; # restore
10277 : Check how to convert floats to strings.
10279 if test "X$d_Gconvert" = X; then
10282 echo "Checking for an efficient way to convert floats to strings."
10284 case "$uselongdouble" in
10285 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10287 case "$d_longdbl" in
10288 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10290 case "$d_PRIgldbl" in
10291 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10294 #ifdef TRY_gconvert
10295 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10296 char *myname = "gconvert";
10299 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10300 char *myname = "gcvt";
10303 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10304 char *myname = "qgcvt";
10305 #define DOUBLETYPE long double
10308 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10309 #ifdef HAS_PRIgldbl
10310 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10312 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10315 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10317 char *myname = "sprintf";
10321 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10322 #define DOUBLETYPE long double
10324 #define DOUBLETYPE double
10330 #$i_stdlib I_STDLIB
10332 #include <stdlib.h>
10334 #$i_string I_STRING
10336 # include <string.h>
10338 # include <strings.h>
10341 int checkit(char *expect, char *got)
10343 if (strcmp(expect, got)) {
10344 printf("%s oddity: Expected %s, got %s\n",
10345 myname, expect, got);
10355 /* This must be 1st test on (which?) platform */
10356 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10357 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10358 checkit("0.1", buf);
10360 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10361 checkit("0.01", buf);
10363 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10364 checkit("0.001", buf);
10366 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10367 checkit("0.0001", buf);
10369 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10370 if (strlen(buf) > 5)
10371 checkit("9e-005", buf); /* for Microsoft ?? */
10373 checkit("9e-05", buf);
10375 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10378 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10379 checkit("1.1", buf);
10381 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10382 checkit("1.01", buf);
10384 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10385 checkit("1.001", buf);
10387 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10388 checkit("1.0001", buf);
10390 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10391 checkit("1.00001", buf);
10393 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10394 checkit("1.000001", buf);
10396 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10399 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10400 checkit("-1", buf);
10402 /* Some Linux gcvt's give 1.e+5 here. */
10403 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10404 checkit("100000", buf);
10406 /* Some Linux gcvt's give -1.e+5 here. */
10407 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10408 checkit("-100000", buf);
10410 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10411 checkit("123.456", buf);
10413 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10414 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10415 /* 34 should be enough to scare even long double
10416 * places into using the e notation. */
10417 if (strlen(buf) > 5)
10418 checkit("1e+034", buf); /* for Microsoft */
10420 checkit("1e+34", buf);
10422 /* For Perl, if you add additional tests here, also add them to
10423 * t/base/num.t for benefit of platforms not using Configure or
10424 * overriding d_Gconvert */
10429 : first add preferred functions to our list
10431 for xxx_convert in $gconvert_preference; do
10432 case $xxx_convert in
10433 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10434 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10437 : then add any others
10438 for xxx_convert in gconvert gcvt sprintf; do
10439 case "$xxx_list" in
10441 *) xxx_list="$xxx_list $xxx_convert" ;;
10445 case "$d_longdbl$uselongdouble" in
10447 : again, add preferred functions to our list first
10449 for xxx_convert in $gconvert_ld_preference; do
10450 case $xxx_convert in
10451 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10452 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10455 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10456 for xxx_convert in qgcvt sprintf $xxx_list; do
10457 case "$xxx_ld_list" in
10458 $xxx_convert*|*" $xxx_convert"*) ;;
10459 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10462 : if sprintf cannot do long doubles, move it to the end
10463 if test "$d_PRIgldbl" != "$define"; then
10464 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10466 : if no qgcvt, remove it
10467 if test "$d_qgcvt" != "$define"; then
10468 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10471 xxx_list="$xxx_ld_list"
10475 for xxx_convert in $xxx_list; do
10476 echo "Trying $xxx_convert..."
10477 $rm -f try try$_o core
10478 set try -DTRY_$xxx_convert
10479 if eval $compile; then
10480 echo "$xxx_convert() found." >&4
10481 if $run ./try; then
10482 echo "I'll use $xxx_convert to convert floats into a string." >&4
10485 echo "...But $xxx_convert didn't work as I expected."
10489 echo "$xxx_convert NOT found." >&4
10493 if test X$xxx_convert = X; then
10494 echo "*** WHOA THERE!!! ***" >&4
10495 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10496 xxx_convert=sprintf
10499 case "$xxx_convert" in
10500 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10501 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10502 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10503 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10504 "$define$define$define")
10505 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10506 "$define$define$undef")
10507 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10508 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10516 : see if _fwalk exists
10520 : Initialize h_fcntl
10523 : Initialize h_sysfile
10526 : access call always available on UNIX
10527 set access d_access
10530 : locate the flags for 'access()'
10531 case "$d_access" in
10534 $cat >access.c <<EOCP
10535 #include <sys/types.h>
10540 #include <sys/file.h>
10543 #include <unistd.h>
10545 #$i_stdlib I_STDLIB
10547 #include <stdlib.h>
10553 : check sys/file.h first, no particular reason here
10554 if $test `./findhdr sys/file.h` && \
10555 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10557 echo "<sys/file.h> defines the *_OK access constants." >&4
10558 elif $test `./findhdr fcntl.h` && \
10559 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10561 echo "<fcntl.h> defines the *_OK access constants." >&4
10562 elif $test `./findhdr unistd.h` && \
10563 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10564 echo "<unistd.h> defines the *_OK access constants." >&4
10566 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10572 : see if accessx exists
10573 set accessx d_accessx
10576 : see if acosh exists
10580 : see if aintl exists
10584 : see if alarm exists
10588 : see if 64bit time functions exists
10590 set ctime64 d_ctime64
10593 set localtime64 d_localtime64
10596 set gmtime64 d_gmtime64
10599 set mktime64 d_mktime64
10602 set difftime64 d_difftime64
10605 set asctime64 d_asctime64
10608 : see if POSIX threads are available
10609 set pthread.h i_pthread
10612 : define a function to check prototypes
10613 $cat > protochk <<EOSH
10616 optimize="$optimize"
10618 prototype="$prototype"
10621 usethreads=$usethreads
10622 i_pthread=$i_pthread
10623 pthread_h_first=$pthread_h_first
10626 $cat >> protochk <<'EOSH'
10631 while test $# -ge 2; do
10633 $define) echo "#include <$2>" >> try.c ;;
10634 literal) echo "$2" >> try.c ;;
10636 # Extra magic for the benefit of systems that need pthread.h
10637 # to be included early to correctly detect threadsafe functions.
10638 # Such functions must guarantee themselves, though, that the usethreads
10639 # and i_pthread have been defined, before calling protochk.
10640 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10641 echo "#include <pthread.h>" >> try.c
10646 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10647 cat >> try.c <<'EOCP'
10648 #ifdef CAN_PROTOTYPE
10649 #define _(args) args
10654 echo "$foo" >> try.c
10655 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10656 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10662 $eunicefix protochk
10664 : Define hasproto macro for Configure internal use
10665 hasproto='varname=$1; func=$2; shift; shift;
10666 while $test $# -ge 2; do
10668 $define) echo "#include <$2>";;
10672 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10673 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10674 echo "$func() prototype found.";
10677 echo "$func() prototype NOT found.";
10684 : see if sys/types.h has to be included
10685 set sys/types.h i_systypes
10688 : see if sys/select.h has to be included
10689 set sys/select.h i_sysselct
10692 : Define hasfield macro for Configure internal use
10693 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10694 while $test $# -ge 2; do
10696 $define) echo "#include <$2>";;
10700 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10702 if eval $compile; then
10711 : see if we should include time.h, sys/time.h, or both
10713 if test "X$timeincl" = X; then
10714 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10715 $echo $n "I'm now running the test program...$c"
10717 #include <sys/types.h>
10722 #ifdef SYSTIMEKERNEL
10725 #include <sys/time.h>
10728 #include <sys/select.h>
10730 #$i_stdlib I_STDLIB
10732 #include <stdlib.h>
10738 struct timeval bar;
10741 struct timezone tzp;
10743 if (foo.tm_sec == foo.tm_sec)
10746 if (bar.tv_sec == bar.tv_sec)
10753 for s_timezone in '-DS_TIMEZONE' ''; do
10755 for s_timeval in '-DS_TIMEVAL' ''; do
10756 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10757 for i_time in '' '-DI_TIME'; do
10758 for i_systime in '-DI_SYSTIME' ''; do
10761 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10762 if eval $compile; then
10763 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10767 $echo $n "Succeeded with $flags$c"
10779 *SYSTIMEKERNEL*) i_systimek="$define"
10780 timeincl=`./findhdr sys/time.h`
10781 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10782 *) i_systimek="$undef";;
10785 *I_TIME*) i_time="$define"
10786 timeincl=`./findhdr time.h`" $timeincl"
10787 echo "We'll include <time.h>." >&4;;
10788 *) i_time="$undef";;
10791 *I_SYSTIME*) i_systime="$define"
10792 timeincl=`./findhdr sys/time.h`" $timeincl"
10793 echo "We'll include <sys/time.h>." >&4;;
10794 *) i_systime="$undef";;
10798 : see if struct tm knows about tm_zone
10799 case "$i_systime$i_time" in
10802 echo "Checking to see if your struct tm has tm_zone field..." >&4
10803 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10811 case "$d_tm_tm_zone" in
10812 "$define") echo "Yes, it does." ;;
10813 *) echo "No, it doesn't." ;;
10815 : see if struct tm knows about tm_gmtoff
10816 case "$i_systime$i_time" in
10819 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10820 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10828 case "$d_tm_tm_gmtoff" in
10829 "$define") echo "Yes, it does." ;;
10830 *) echo "No, it doesn't." ;;
10833 : see if asctime_r exists
10834 set asctime_r d_asctime_r
10836 case "$d_asctime_r" in
10838 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10839 case "$d_asctime_r_proto:$usethreads" in
10840 ":define") d_asctime_r_proto=define
10841 set d_asctime_r_proto asctime_r $hdrs
10845 case "$d_asctime_r_proto" in
10847 case "$asctime_r_proto" in
10848 ''|0) try='char* asctime_r(const struct tm*, char*);'
10849 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10851 case "$asctime_r_proto" in
10852 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10853 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10855 case "$asctime_r_proto" in
10856 ''|0) try='int asctime_r(const struct tm*, char*);'
10857 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10859 case "$asctime_r_proto" in
10860 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10861 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10863 case "$asctime_r_proto" in
10864 ''|0) d_asctime_r=undef
10866 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10867 * ) case "$asctime_r_proto" in
10868 REENTRANT_PROTO*) ;;
10869 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10871 echo "Prototype: $try" ;;
10874 *) case "$usethreads" in
10875 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10882 *) asctime_r_proto=0
10886 : see if asinh exists
10890 : see if atanh exists
10894 : see if atolf exists
10898 : see if atoll exists
10902 : Look for GCC-style attribute format
10903 case "$d_attribute_format" in
10906 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10907 $cat >attrib.c <<'EOCP'
10909 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10911 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10912 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10913 echo "Your C compiler doesn't support __attribute__((format))."
10916 echo "Your C compiler supports __attribute__((format))."
10920 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10924 *) val="$d_attribute_format" ;;
10926 set d_attribute_format
10930 : Look for GCC-style attribute format with null format allowed
10931 case "$d_printf_format_null" in
10932 '') case "$d_attribute_format" in
10935 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10936 $cat >attrib.c <<EOCP
10938 #$i_stdlib I_STDLIB
10940 #include <stdlib.h>
10942 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10943 int null_printf (char* pat,...) { return (int)pat; }
10944 int main () { exit(null_printf(NULL)); }
10946 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10947 : run the executable in case it produces a run-time warning
10948 if $run ./attrib >>attrib.out 2>&1; then
10949 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10950 echo "Your C compiler doesn't allow __printf__ format to be null."
10953 echo "Your C compiler allows __printf__ format to be null."
10957 echo "Your C compiler executable failed with __printf__ format null."
10961 echo "Your C compiler fails with __printf__ format null."
10968 *) val="$d_printf_format_null" ;;
10970 set d_printf_format_null
10974 : Look for GCC-style attribute malloc
10975 case "$d_attribute_malloc" in
10978 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10979 $cat >attrib.c <<'EOCP'
10981 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10983 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10984 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10985 echo "Your C compiler doesn't support __attribute__((malloc))."
10988 echo "Your C compiler supports __attribute__((malloc))."
10992 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10996 *) val="$d_attribute_malloc" ;;
10998 set d_attribute_malloc
11002 : Look for GCC-style attribute nonnull
11003 case "$d_attribute_nonnull" in
11006 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11007 $cat >attrib.c <<'EOCP'
11009 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11011 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11012 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11013 echo "Your C compiler doesn't support __attribute__((nonnull))."
11016 echo "Your C compiler supports __attribute__((nonnull))."
11020 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11024 *) val="$d_attribute_nonnull" ;;
11026 set d_attribute_nonnull
11030 : Look for GCC-style attribute noreturn
11031 case "$d_attribute_noreturn" in
11034 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11035 $cat >attrib.c <<'EOCP'
11037 void fall_over_dead( void ) __attribute__((noreturn));
11039 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11040 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11041 echo "Your C compiler doesn't support __attribute__((noreturn))."
11044 echo "Your C compiler supports __attribute__((noreturn))."
11048 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11052 *) val="$d_attribute_noreturn" ;;
11054 set d_attribute_noreturn
11058 : Look for GCC-style attribute pure
11059 case "$d_attribute_pure" in
11062 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11063 $cat >attrib.c <<'EOCP'
11065 int square( int n ) __attribute__((pure));
11067 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11068 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11069 echo "Your C compiler doesn't support __attribute__((pure))."
11072 echo "Your C compiler supports __attribute__((pure))."
11076 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11080 *) val="$d_attribute_pure" ;;
11082 set d_attribute_pure
11086 : Look for GCC-style attribute unused
11087 case "$d_attribute_unused" in
11090 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11091 $cat >attrib.c <<'EOCP'
11093 int do_something( int dummy __attribute__((unused)), int n );
11095 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11096 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11097 echo "Your C compiler doesn't support __attribute__((unused))."
11100 echo "Your C compiler supports __attribute__((unused))."
11104 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11108 *) val="$d_attribute_unused" ;;
11110 set d_attribute_unused
11114 : Look for GCC-style attribute deprecated
11115 case "$d_attribute_deprecated" in
11118 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11119 $cat >attrib.c <<'EOCP'
11121 int I_am_deprecated(void) __attribute__((deprecated));
11123 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11124 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11125 echo "Your C compiler doesn't support __attribute__((deprecated))."
11128 echo "Your C compiler supports __attribute__((deprecated))."
11132 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11136 *) val="$d_attribute_deprecated" ;;
11138 set d_attribute_deprecated
11142 : Look for GCC-style attribute warn_unused_result
11143 case "$d_attribute_warn_unused_result" in
11146 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11147 $cat >attrib.c <<'EOCP'
11149 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11151 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11152 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11153 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11156 echo "Your C compiler supports __attribute__((warn_unused_result))."
11160 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11164 *) val="$d_attribute_warn_unused_result" ;;
11166 set d_attribute_warn_unused_result
11170 : see if bcmp exists
11174 : see if bcopy exists
11178 : see if getpgrp exists
11179 set getpgrp d_getpgrp
11182 case "$d_getpgrp" in
11185 echo "Checking to see which flavor of getpgrp is in use..."
11187 #$i_unistd I_UNISTD
11188 #include <sys/types.h>
11190 # include <unistd.h>
11192 #$i_stdlib I_STDLIB
11194 #include <stdlib.h>
11198 if (getuid() == 0) {
11199 printf("(I see you are running Configure as super-user...)\n");
11202 #ifdef TRY_BSD_PGRP
11203 if (getpgrp(1) == 0)
11212 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11213 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11215 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11216 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11219 echo "I can't seem to compile and run the test program."
11221 xxx="a USG one, i.e. you use getpgrp()."
11223 # SVR4 systems can appear rather BSD-ish.
11224 case "$i_unistd" in
11226 xxx="a BSD one, i.e. you use getpgrp(pid)."
11230 xxx="probably a USG one, i.e. you use getpgrp()."
11235 echo "Assuming your getpgrp is $xxx" >&4
11244 : see if setpgrp exists
11245 set setpgrp d_setpgrp
11248 case "$d_setpgrp" in
11251 echo "Checking to see which flavor of setpgrp is in use..."
11253 #$i_unistd I_UNISTD
11254 #include <sys/types.h>
11256 # include <unistd.h>
11258 #$i_stdlib I_STDLIB
11260 #include <stdlib.h>
11264 if (getuid() == 0) {
11265 printf("(I see you are running Configure as super-user...)\n");
11268 #ifdef TRY_BSD_PGRP
11269 if (-1 == setpgrp(1, 1))
11272 if (setpgrp() != -1)
11278 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11279 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11281 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11282 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11285 echo "(I can't seem to compile and run the test program.)"
11287 xxx="a USG one, i.e. you use setpgrp()."
11289 # SVR4 systems can appear rather BSD-ish.
11290 case "$i_unistd" in
11292 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11296 xxx="probably a USG one, i.e. you use setpgrp()."
11301 echo "Assuming your setpgrp is $xxx" >&4
11310 : Look for GCC-style __builtin_choose_expr
11311 case "$d_builtin_choose_expr" in
11314 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11315 $cat >try.c <<'EOCP'
11316 #include <assert.h>
11317 #include <stdlib.h>
11320 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11323 assert( SYRINX(1) == 2112 );
11324 assert( SYRINX(1) != 5150 );
11325 assert( SYRINX(0) == 5150 );
11326 assert( SYRINX(0) != 2112 );
11327 puts( "All good!" );
11333 if eval $compile && $run ./try; then
11334 echo "Your C compiler supports __builtin_choose_expr."
11337 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11341 *) val="$d_builtin_choose_expr" ;;
11344 set d_builtin_choose_expr
11348 : Look for GCC-style __builtin_expect
11349 case "$d_builtin_expect" in
11352 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11353 $cat >try.c <<'EOCP'
11356 if ( __builtin_expect(n, 0) ) n = 1;
11357 /* Remember shell exit code truth is 0, C truth is non-zero */
11362 if eval $compile && $run ./try; then
11363 echo "Your C compiler supports __builtin_expect."
11366 echo "Your C compiler doesn't seem to understand __builtin_expect."
11370 *) val="$d_builtin_expect" ;;
11373 set d_builtin_expect
11377 : see if bzero exists
11381 : see if stdarg is available
11383 if $test `./findhdr stdarg.h`; then
11384 echo "<stdarg.h> found." >&4
11387 echo "<stdarg.h> NOT found." >&4
11391 : see if varargs is available
11393 if $test `./findhdr varargs.h`; then
11394 echo "<varargs.h> found." >&4
11396 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11399 : set up the varargs testing programs
11400 $cat > varargs.c <<EOP
11402 #include <stdarg.h>
11405 #include <varargs.h>
11409 int f(char *p, ...)
11423 p = va_arg(ap, char *);
11429 $cat > varargs <<EOP
11431 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11440 : now check which varargs header should be included
11446 if `./varargs I_STDARG`; then
11448 elif `./varargs I_VARARGS`; then
11453 if `./varargs I_VARARGS`; then
11461 echo "*** WHOA THERE!!! ***" >&4
11462 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11463 case "$knowitall" in
11465 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11469 echo "I could not find the definition for va_dcl... You have problems..." >&4
11470 val="$undef"; set i_stdarg; eval $setvar
11471 val="$undef"; set i_varargs; eval $setvar
11476 case "$i_varhdr" in
11478 val="$define"; set i_stdarg; eval $setvar
11479 val="$undef"; set i_varargs; eval $setvar
11482 val="$undef"; set i_stdarg; eval $setvar
11483 val="$define"; set i_varargs; eval $setvar
11486 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11490 : see if the Compiler supports C99 variadic macros
11491 case "$i_stdarg$i_stdlib" in
11493 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11496 #include <stdarg.h>
11498 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11502 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11508 if eval $compile && $run ./try 2>&1 >/dev/null; then
11509 case "`$run ./try`" in
11511 echo "You have C99 variadic macros." >&4
11512 d_c99_variadic_macros="$define"
11515 echo "You don't have functional C99 variadic macros." >&4
11516 d_c99_variadic_macros="$undef"
11520 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11521 d_c99_variadic_macros="$undef"
11526 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11527 d_c99_variadic_macros="$undef"
11531 : see if signal is declared as pointer to function returning int or void
11533 xxx=`./findhdr signal.h`
11534 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11535 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11536 echo "You have int (*signal())() instead of void." >&4
11538 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11539 echo "You have void (*signal())()." >&4
11541 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11542 echo "You have int (*signal())() instead of void." >&4
11544 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11545 echo "You have void (*signal())()." >&4
11548 case "$d_voidsig" in
11550 echo "I can't determine whether signal handler returns void or int..." >&4
11552 rp="What type does your signal handler return?"
11555 v*) val="$define";;
11559 echo "As you already told me, signal handler returns void." >&4
11562 *) echo "As you already told me, signal handler returns int." >&4
11569 case "$d_voidsig" in
11570 "$define") signal_t="void";;
11571 *) signal_t="int";;
11575 : check for ability to cast large floats to 32-bit ints.
11577 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11578 if $test "$intsize" -ge 4; then
11585 #$i_stdlib I_STDLIB
11587 #include <stdlib.h>
11589 #include <sys/types.h>
11590 #include <signal.h>
11591 $signal_t blech(int s) { exit(3); }
11598 signal(SIGFPE, blech);
11600 /* Don't let compiler optimize the test away. Store the number
11601 in a writable string for gcc to pass to sscanf under HP-UX.
11603 sprintf(str, "2147483647");
11604 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11608 /* x86 processors will probably give 0x8000 0000, which is a
11609 sign change. We don't want that. We want to mimic SPARC
11610 behavior here, which is to preserve the sign and give
11613 if (i32 != ($xxx) f)
11619 if eval $compile_ok; then
11620 $run ./try 2>/dev/null
11623 echo "(I can't seem to compile the test program--assuming it can't)"
11628 echo "Yup, it can."
11631 echo "Nope, it can't."
11638 : check for ability to cast negative floats to unsigned
11640 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11643 #$i_stdlib I_STDLIB
11645 #include <stdlib.h>
11647 #include <sys/types.h>
11648 #include <signal.h>
11649 $signal_t blech(int s) { exit(7); }
11650 $signal_t blech_in_list(int s) { exit(4); }
11651 unsigned long dummy_long(unsigned long p) { return p; }
11652 unsigned int dummy_int(unsigned int p) { return p; }
11653 unsigned short dummy_short(unsigned short p) { return p; }
11657 unsigned long along;
11659 unsigned short ashort;
11663 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11664 a direct f = -123. assignment. gcc-2.8.0 reportedly
11665 optimized the whole file away
11667 /* Store the number in a writable string for gcc to pass to
11668 sscanf under HP-UX.
11670 sprintf(str, "-123");
11671 sscanf(str, "%lf", &f); /* f = -123.; */
11673 signal(SIGFPE, blech);
11674 along = (unsigned long)f;
11675 aint = (unsigned int)f;
11676 ashort = (unsigned short)f;
11677 if (along != (unsigned long)-123)
11679 if (aint != (unsigned int)-123)
11681 if (ashort != (unsigned short)-123)
11683 sprintf(str, "1073741824.");
11684 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11687 along = (unsigned long)f;
11688 if (along != 0x80000000)
11692 along = (unsigned long)f;
11693 if (along != 0x7fffffff)
11697 along = (unsigned long)f;
11698 if (along != 0x80000001)
11702 signal(SIGFPE, blech_in_list);
11703 sprintf(str, "123.");
11704 sscanf(str, "%lf", &f); /* f = 123.; */
11705 along = dummy_long((unsigned long)f);
11706 aint = dummy_int((unsigned int)f);
11707 ashort = dummy_short((unsigned short)f);
11708 if (along != (unsigned long)123)
11710 if (aint != (unsigned int)123)
11712 if (ashort != (unsigned short)123)
11719 if eval $compile_ok; then
11720 $run ./try 2>/dev/null
11723 echo "(I can't seem to compile the test program--assuming it can't)"
11726 case "$castflags" in
11728 echo "Yup, it can."
11731 echo "Nope, it can't."
11738 : see if cbrt exists
11742 : see if vprintf exists
11744 if set vprintf val -f d_vprintf; eval $csym; $val; then
11745 echo 'vprintf() found.' >&4
11748 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11749 #$i_varargs I_VARARGS
11751 #$i_stdlib I_STDLIB
11752 #$i_unistd I_UNISTD
11755 # include <stdarg.h>
11756 #else /* I_VARARGS */
11757 # include <varargs.h>
11761 # include <unistd.h>
11765 # include <stdlib.h>
11768 #include <stdio.h> /* vsprintf prototype */
11771 void xxx(int n, ...)
11776 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11778 int main() { xxx(1, "foo"); }
11780 #else /* I_VARARGS */
11788 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11790 int main() { xxx("foo"); }
11796 if eval $compile_ok; then
11797 if $run ./try; then
11798 echo "Your vsprintf() returns (int)." >&4
11801 echo "Your vsprintf() returns (char*)." >&4
11805 echo 'I am unable to compile the vsprintf() test program.' >&4
11806 # We shouldn't get here. If we do, assume the standard signature,
11807 # not the old BSD one.
11808 echo 'Guessing that vsprintf() returns (int).' >&4
11812 echo 'vprintf() NOT found.' >&4
11823 : see if chown exists
11827 : see if chroot exists
11828 set chroot d_chroot
11831 : see if chsize exists
11832 set chsize d_chsize
11835 : see if class exists
11839 : see if clearenv exists
11840 set clearenv d_clearenv
11843 : Define hasstruct macro for Configure internal use
11844 hasstruct='varname=$1; struct=$2; shift; shift;
11845 while $test $# -ge 2; do
11847 $define) echo "#include <$2>";;
11851 echo "int main () { struct $struct foo; }" >> try.c;
11853 if eval $compile; then
11862 : see whether socket exists
11866 $echo $n "Hmm... $c" >&4
11867 if set socket val -f d_socket; eval $csym; $val; then
11868 echo "Looks like you have Berkeley networking support." >&4
11870 if set setsockopt val -f; eval $csym; $val; then
11873 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11874 d_oldsock="$define"
11877 if $contains socklib libc.list >/dev/null 2>&1; then
11878 echo "Looks like you have Berkeley networking support." >&4
11880 : we will have to assume that it supports the 4.2 BSD interface
11883 echo "You don't have Berkeley networking in libc$_a..." >&4
11884 if test "X$d_socket" = "X$define"; then
11885 echo "...but you seem to believe that you have sockets." >&4
11887 for net in net socket
11889 if test -f $sysroot/usr/lib/lib$net$_a; then
11890 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11891 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11892 if $contains socket libc.list >/dev/null 2>&1; then
11897 echo "...but the Wollongong group seems to have hacked it in." >&4
11898 sockethdr="-I$sysroot/usr/netinclude"
11901 echo "Found Berkeley sockets interface in lib$net." >&4
11902 if $contains setsockopt libc.list >/dev/null 2>&1; then
11905 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11906 d_oldsock="$define"
11912 if test "X$d_socket" != "X$define"; then
11913 echo "or anywhere else I see." >&4
11921 : see if socketpair exists
11922 set socketpair d_sockpair
11927 echo "Checking the availability sa_len in the sock struct ..." >&4
11929 #include <sys/types.h>
11930 #include <sys/socket.h>
11932 struct sockaddr sa;
11933 return (sa.sa_len);
11937 set try; if eval $compile; then
11940 set d_sockaddr_sa_len; eval $setvar
11944 echo "Checking the availability struct sockaddr_in6 ..." >&4
11946 #include <sys/types.h>
11947 #include <sys/socket.h>
11948 #include <netinet/in.h>
11950 struct sockaddr_in6 sin6;
11951 return (sin6.sin6_family);
11955 set try; if eval $compile; then
11958 set d_sockaddr_in6; eval $setvar
11962 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11964 #include <sys/types.h>
11965 #include <sys/socket.h>
11966 #include <netinet/in.h>
11968 struct sockaddr_in6 sin6;
11969 return (sin6.sin6_scope_id);
11973 set try; if eval $compile; then
11976 set d_sin6_scope_id; eval $setvar
11980 echo "Checking the availability struct ip_mreq ..." >&4
11982 #include <sys/types.h>
11983 #include <sys/socket.h>
11984 #include <netinet/in.h>
11986 struct ip_mreq mreq;
11987 return (mreq.imr_multiaddr.s_addr);
11991 set try; if eval $compile; then
11994 set d_ip_mreq; eval $setvar
11998 echo "Checking the availability struct ip_mreq_source ..." >&4
12000 #include <sys/types.h>
12001 #include <sys/socket.h>
12002 #include <netinet/in.h>
12004 struct ip_mreq_source mreq;
12005 return (mreq.imr_multiaddr.s_addr);
12009 set try; if eval $compile; then
12012 set d_ip_mreq_source; eval $setvar
12016 echo "Checking the availability struct ipv6_mreq ..." >&4
12018 #include <sys/types.h>
12019 #include <sys/socket.h>
12020 #include <netinet/in.h>
12022 struct ipv6_mreq mreq;
12023 return (mreq.ipv6mr_interface);
12027 set try; if eval $compile; then
12030 set d_ipv6_mreq; eval $setvar
12034 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12036 #include <sys/types.h>
12037 #include <sys/socket.h>
12038 #include <netinet/in.h>
12040 struct ipv6_mreq_source mreq;
12041 return (mreq.imr_multiaddr.s_addr);
12045 set try; if eval $compile; then
12048 set d_ipv6_mreq_source; eval $setvar
12052 echo "Checking the availability of certain socket constants..." >&4
12053 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12054 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12056 #include <sys/types.h>
12057 #include <sys/socket.h>
12063 set try; if eval $compile; then
12066 set d_${enum}; eval $setvar
12070 : see if this is a sys/uio.h system
12071 set sys/uio.h i_sysuio
12074 : Check for cmsghdr support
12076 echo "Checking to see if your system supports struct cmsghdr..." >&4
12077 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12079 case "$d_cmsghdr_s" in
12080 "$define") echo "Yes, it does." ;;
12081 *) echo "No, it doesn't." ;;
12085 : check for const keyword
12087 echo 'Checking to see if your C compiler knows about "const"...' >&4
12088 $cat >const.c <<'EOCP'
12089 typedef struct spug { int drokk; } spug;
12093 const spug y = { 0 };
12096 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12098 echo "Yup, it does."
12101 echo "Nope, it doesn't."
12106 : see if copysign exists
12107 set copysign d_copysign
12110 : see if copysignl exists
12111 set copysignl d_copysignl
12114 : see if crypt exists
12119 $define) cryptlib='' ;;
12120 *) if set crypt val -f d_crypt; eval $csym; $val; then
12121 echo 'crypt() found.' >&4
12125 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12126 if $test -z "$cryptlib"; then
12127 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12131 if $test -z "$cryptlib"; then
12132 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12136 if $test -z "$cryptlib"; then
12137 cryptlib=`./loc libcrypt$_a "" $libpth`
12141 if $test -z "$cryptlib"; then
12142 echo 'crypt() NOT found.' >&4
12153 : see if this is a crypt.h system
12154 set crypt.h i_crypt
12157 : see if crypt_r exists
12158 set crypt_r d_crypt_r
12160 case "$d_crypt_r" in
12162 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12163 case "$d_crypt_r_proto:$usethreads" in
12164 ":define") d_crypt_r_proto=define
12165 set d_crypt_r_proto crypt_r $hdrs
12169 case "$d_crypt_r_proto" in
12171 case "$crypt_r_proto" in
12172 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12173 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12175 case "$crypt_r_proto" in
12176 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12177 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12179 case "$crypt_r_proto" in
12180 ''|0) d_crypt_r=undef
12182 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12183 * ) case "$crypt_r_proto" in
12184 REENTRANT_PROTO*) ;;
12185 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12187 echo "Prototype: $try" ;;
12190 *) case "$usethreads" in
12191 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12202 : get csh whereabouts
12204 'csh') val="$undef" ;;
12205 *) val="$define" ;;
12209 : Respect a hint or command line value for full_csh.
12210 case "$full_csh" in
12211 '') full_csh=$csh ;;
12214 : see if ctermid exists
12215 set ctermid d_ctermid
12218 : see if ctermid_r exists
12219 set ctermid_r d_ctermid_r
12221 case "$d_ctermid_r" in
12223 hdrs="$i_systypes sys/types.h define stdio.h "
12224 case "$d_ctermid_r_proto:$usethreads" in
12225 ":define") d_ctermid_r_proto=define
12226 set d_ctermid_r_proto ctermid_r $hdrs
12230 case "$d_ctermid_r_proto" in
12232 case "$ctermid_r_proto" in
12233 ''|0) try='char* ctermid_r(char*);'
12234 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12236 case "$ctermid_r_proto" in
12237 ''|0) d_ctermid_r=undef
12239 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12240 * ) case "$ctermid_r_proto" in
12241 REENTRANT_PROTO*) ;;
12242 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12244 echo "Prototype: $try" ;;
12247 *) case "$usethreads" in
12248 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12255 *) ctermid_r_proto=0
12259 : see if ctime_r exists
12260 set ctime_r d_ctime_r
12262 case "$d_ctime_r" in
12264 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12265 case "$d_ctime_r_proto:$usethreads" in
12266 ":define") d_ctime_r_proto=define
12267 set d_ctime_r_proto ctime_r $hdrs
12271 case "$d_ctime_r_proto" in
12273 case "$ctime_r_proto" in
12274 ''|0) try='char* ctime_r(const time_t*, char*);'
12275 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12277 case "$ctime_r_proto" in
12278 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12279 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12281 case "$ctime_r_proto" in
12282 ''|0) try='int ctime_r(const time_t*, char*);'
12283 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12285 case "$ctime_r_proto" in
12286 ''|0) try='int ctime_r(const time_t*, char*, int);'
12287 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12289 case "$ctime_r_proto" in
12290 ''|0) d_ctime_r=undef
12292 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12293 * ) case "$ctime_r_proto" in
12294 REENTRANT_PROTO*) ;;
12295 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12297 echo "Prototype: $try" ;;
12300 *) case "$usethreads" in
12301 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12312 : see if cuserid exists
12313 set cuserid d_cuserid
12316 : see if this is a limits.h system
12317 set limits.h i_limits
12320 : See if number of significant digits in a double precision number is known
12322 $cat >dbl_dig.c <<EOM
12323 #$i_limits I_LIMITS
12326 #include <limits.h>
12332 printf("Contains DBL_DIG");
12335 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12336 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12337 echo "DBL_DIG found." >&4
12340 echo "DBL_DIG NOT found." >&4
12347 : see if dbm.h is available
12348 : see if dbmclose exists
12349 set dbmclose d_dbmclose
12352 case "$d_dbmclose" in
12362 *) set rpcsvc/dbm.h i_rpcsvcdbm
12367 *) echo "We won't be including <dbm.h>"
12377 : see if prototype for dbminit is available
12379 set d_dbminitproto dbminit $i_dbm dbm.h
12382 : see if difftime exists
12383 set difftime d_difftime
12386 : see if this is a dirent system
12388 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12390 echo "<dirent.h> found." >&4
12393 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12394 echo "<sys/dir.h> found." >&4
12397 xinc=`./findhdr sys/ndir.h`
12399 echo "<dirent.h> NOT found." >&4
12404 : Look for type of directory structure.
12406 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12408 case "$direntrytype" in
12410 case "$i_dirent" in
12411 $define) guess1='struct dirent' ;;
12412 *) guess1='struct direct' ;;
12415 *) guess1="$direntrytype"
12420 'struct dirent') guess2='struct direct' ;;
12421 *) guess2='struct dirent' ;;
12424 if $contains "$guess1" try.c >/dev/null 2>&1; then
12425 direntrytype="$guess1"
12426 echo "Your directory entries are $direntrytype." >&4
12427 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12428 direntrytype="$guess2"
12429 echo "Your directory entries seem to be $direntrytype." >&4
12431 echo "I don't recognize your system's directory entries." >&4
12432 rp="What type is used for directory entries on this system?"
12435 direntrytype="$ans"
12439 : see if the directory entry stores field length
12441 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12442 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12443 echo "Good, your directory entry keeps length information in d_namlen." >&4
12446 echo "Your directory entry does not know about the d_namlen field." >&4
12453 : Look for DIR.dd_fd
12454 case "$i_dirent" in
12456 echo "Checking to see if DIR has a dd_fd member variable" >&4
12458 #$i_stdlib I_STDLIB
12460 #include <stdlib.h>
12462 #include <dirent.h>
12472 if eval $compile; then
12473 echo "Yes, it does."
12476 echo "No, it does not."
12481 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12489 : see if this is an sysdir system
12490 set sys/dir.h i_sysdir
12493 : see if this is an sysndir system
12494 set sys/ndir.h i_sysndir
12499 $cat >dirfd.c <<EOM
12501 #$i_stdlib I_STDLIB
12503 #include <stdlib.h>
12505 #$i_dirent I_DIRENT /**/
12506 #$i_sysdir I_SYS_DIR /**/
12507 #$i_sysndir I_SYS_NDIR /**/
12508 #$i_systypes I_SYS_TYPES /**/
12509 #if defined(I_SYS_TYPES)
12510 #include <sys/types.h>
12512 #if defined(I_DIRENT)
12513 #include <dirent.h>
12516 #include <sys/ndir.h>
12520 #include <ndir.h> /* may be wrong in the future */
12522 #include <sys/dir.h>
12528 DIR *dirp = opendir(".");
12529 if (dirfd(dirp) >= 0)
12537 if eval $compile; then
12541 $define) echo "dirfd() found." >&4 ;;
12542 *) echo "dirfd() NOT found." >&4 ;;
12548 : see if dladdr exists
12549 set dladdr d_dladdr
12552 : see if dlerror exists
12555 set dlerror d_dlerror
12559 : see if dlfcn is available
12560 set dlfcn.h i_dlfcn
12563 : Check what extension to use for shared libs
12568 On a few systems, the dynamically loaded modules that perl generates and uses
12569 will need a different extension than shared libs. The default will probably
12575 *) dflt="$dlext" ;;
12577 rp='What is the extension of dynamically loaded modules'
12586 : Check if dlsym need a leading underscore
12592 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12593 $cat >dyna.c <<'EOM'
12600 #$i_stdlib I_STDLIB
12602 #include <stdlib.h>
12606 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12608 #include <sys/types.h>
12613 extern int fred() ;
12622 int mode = RTLD_LAZY ;
12624 handle = dlopen("./dyna.$dlext", mode) ;
12625 if (handle == NULL) {
12630 symbol = dlsym(handle, "fred") ;
12631 if (symbol == NULL) {
12632 /* try putting a leading underscore */
12633 symbol = dlsym(handle, "_fred") ;
12634 if (symbol == NULL) {
12647 : Call the object file tmp-dyna.o in case dlext=o.
12648 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12649 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12650 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12651 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12654 1) echo "Test program failed using dlopen." >&4
12655 echo "Perhaps you should not use dynamic loading." >&4;;
12656 2) echo "Test program failed using dlsym." >&4
12657 echo "Perhaps you should not use dynamic loading." >&4;;
12658 3) echo "dlsym needs a leading underscore" >&4
12660 4) echo "dlsym doesn't need a leading underscore." >&4;;
12663 echo "I can't compile and run the test program." >&4
12664 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12669 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12674 : see if drand48_r exists
12675 set drand48_r d_drand48_r
12677 case "$d_drand48_r" in
12679 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12680 case "$d_drand48_r_proto:$usethreads" in
12681 ":define") d_drand48_r_proto=define
12682 set d_drand48_r_proto drand48_r $hdrs
12686 case "$d_drand48_r_proto" in
12688 case "$drand48_r_proto" in
12689 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12690 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12692 case "$drand48_r_proto" in
12693 ''|0) d_drand48_r=undef
12695 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12696 * ) case "$drand48_r_proto" in
12697 REENTRANT_PROTO*) ;;
12698 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12700 echo "Prototype: $try" ;;
12703 *) case "$usethreads" in
12704 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12711 *) drand48_r_proto=0
12715 : see if prototype for drand48 is available
12717 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12720 : see if dup2 exists
12724 : see if eaccess exists
12725 set eaccess d_eaccess
12728 : see if endgrent exists
12729 set endgrent d_endgrent
12732 : see if this is an grp system
12738 xxx=`./findhdr grp.h`
12739 $cppstdin $cppflags $cppminus < $xxx >$$.h
12741 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12753 set d_grpasswd; eval $setvar
12757 : see if endgrent_r exists
12758 set endgrent_r d_endgrent_r
12760 case "$d_endgrent_r" in
12762 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12763 case "$d_endgrent_r_proto:$usethreads" in
12764 ":define") d_endgrent_r_proto=define
12765 set d_endgrent_r_proto endgrent_r $hdrs
12769 case "$d_endgrent_r_proto" in
12771 case "$endgrent_r_proto" in
12772 ''|0) try='int endgrent_r(FILE**);'
12773 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12775 case "$endgrent_r_proto" in
12776 ''|0) try='void endgrent_r(FILE**);'
12777 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12779 case "$endgrent_r_proto" in
12780 ''|0) d_endgrent_r=undef
12782 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12783 * ) case "$endgrent_r_proto" in
12784 REENTRANT_PROTO*) ;;
12785 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12787 echo "Prototype: $try" ;;
12790 *) case "$usethreads" in
12791 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12798 *) endgrent_r_proto=0
12802 : see if endhostent exists
12803 set endhostent d_endhent
12806 : see if this is a netdb.h system
12807 set netdb.h i_netdb
12810 : see if endhostent_r exists
12811 set endhostent_r d_endhostent_r
12813 case "$d_endhostent_r" in
12815 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12816 case "$d_endhostent_r_proto:$usethreads" in
12817 ":define") d_endhostent_r_proto=define
12818 set d_endhostent_r_proto endhostent_r $hdrs
12822 case "$d_endhostent_r_proto" in
12824 case "$endhostent_r_proto" in
12825 ''|0) try='int endhostent_r(struct hostent_data*);'
12826 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12828 case "$endhostent_r_proto" in
12829 ''|0) try='void endhostent_r(struct hostent_data*);'
12830 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12832 case "$endhostent_r_proto" in
12833 ''|0) d_endhostent_r=undef
12834 endhostent_r_proto=0
12835 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12836 * ) case "$endhostent_r_proto" in
12837 REENTRANT_PROTO*) ;;
12838 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12840 echo "Prototype: $try" ;;
12843 *) case "$usethreads" in
12844 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12846 d_endhostent_r=undef
12847 endhostent_r_proto=0
12851 *) endhostent_r_proto=0
12855 : see if endnetent exists
12856 set endnetent d_endnent
12859 : see if endnetent_r exists
12860 set endnetent_r d_endnetent_r
12862 case "$d_endnetent_r" in
12864 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12865 case "$d_endnetent_r_proto:$usethreads" in
12866 ":define") d_endnetent_r_proto=define
12867 set d_endnetent_r_proto endnetent_r $hdrs
12871 case "$d_endnetent_r_proto" in
12873 case "$endnetent_r_proto" in
12874 ''|0) try='int endnetent_r(struct netent_data*);'
12875 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12877 case "$endnetent_r_proto" in
12878 ''|0) try='void endnetent_r(struct netent_data*);'
12879 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12881 case "$endnetent_r_proto" in
12882 ''|0) d_endnetent_r=undef
12883 endnetent_r_proto=0
12884 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12885 * ) case "$endnetent_r_proto" in
12886 REENTRANT_PROTO*) ;;
12887 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12889 echo "Prototype: $try" ;;
12892 *) case "$usethreads" in
12893 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12895 d_endnetent_r=undef
12896 endnetent_r_proto=0
12900 *) endnetent_r_proto=0
12904 : see if endprotoent exists
12905 set endprotoent d_endpent
12908 : see if endprotoent_r exists
12909 set endprotoent_r d_endprotoent_r
12911 case "$d_endprotoent_r" in
12913 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12914 case "$d_endprotoent_r_proto:$usethreads" in
12915 ":define") d_endprotoent_r_proto=define
12916 set d_endprotoent_r_proto endprotoent_r $hdrs
12920 case "$d_endprotoent_r_proto" in
12922 case "$endprotoent_r_proto" in
12923 ''|0) try='int endprotoent_r(struct protoent_data*);'
12924 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12926 case "$endprotoent_r_proto" in
12927 ''|0) try='void endprotoent_r(struct protoent_data*);'
12928 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12930 case "$endprotoent_r_proto" in
12931 ''|0) d_endprotoent_r=undef
12932 endprotoent_r_proto=0
12933 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12934 * ) case "$endprotoent_r_proto" in
12935 REENTRANT_PROTO*) ;;
12936 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12938 echo "Prototype: $try" ;;
12941 *) case "$usethreads" in
12942 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12944 d_endprotoent_r=undef
12945 endprotoent_r_proto=0
12949 *) endprotoent_r_proto=0
12953 : see if endpwent exists
12954 set endpwent d_endpwent
12957 : see if this is a pwd.h system
12963 xxx=`./findhdr pwd.h`
12964 $cppstdin $cppflags $cppminus < $xxx >$$.h
12966 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12974 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12982 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12990 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12998 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13006 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13014 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13022 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13034 set d_pwquota; eval $setvar
13035 set d_pwage; eval $setvar
13036 set d_pwchange; eval $setvar
13037 set d_pwclass; eval $setvar
13038 set d_pwexpire; eval $setvar
13039 set d_pwcomment; eval $setvar
13040 set d_pwgecos; eval $setvar
13041 set d_pwpasswd; eval $setvar
13045 : see if endpwent_r exists
13046 set endpwent_r d_endpwent_r
13048 case "$d_endpwent_r" in
13050 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13051 case "$d_endpwent_r_proto:$usethreads" in
13052 ":define") d_endpwent_r_proto=define
13053 set d_endpwent_r_proto endpwent_r $hdrs
13057 case "$d_endpwent_r_proto" in
13059 case "$endpwent_r_proto" in
13060 ''|0) try='int endpwent_r(FILE**);'
13061 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13063 case "$endpwent_r_proto" in
13064 ''|0) try='void endpwent_r(FILE**);'
13065 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13067 case "$endpwent_r_proto" in
13068 ''|0) d_endpwent_r=undef
13070 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13071 * ) case "$endpwent_r_proto" in
13072 REENTRANT_PROTO*) ;;
13073 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13075 echo "Prototype: $try" ;;
13078 *) case "$usethreads" in
13079 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13086 *) endpwent_r_proto=0
13090 : see if endservent exists
13091 set endservent d_endsent
13094 : see if endservent_r exists
13095 set endservent_r d_endservent_r
13097 case "$d_endservent_r" in
13099 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13100 case "$d_endservent_r_proto:$usethreads" in
13101 ":define") d_endservent_r_proto=define
13102 set d_endservent_r_proto endservent_r $hdrs
13106 case "$d_endservent_r_proto" in
13108 case "$endservent_r_proto" in
13109 ''|0) try='int endservent_r(struct servent_data*);'
13110 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13112 case "$endservent_r_proto" in
13113 ''|0) try='void endservent_r(struct servent_data*);'
13114 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13116 case "$endservent_r_proto" in
13117 ''|0) d_endservent_r=undef
13118 endservent_r_proto=0
13119 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13120 * ) case "$endservent_r_proto" in
13121 REENTRANT_PROTO*) ;;
13122 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13124 echo "Prototype: $try" ;;
13127 *) case "$usethreads" in
13128 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13130 d_endservent_r=undef
13131 endservent_r_proto=0
13135 *) endservent_r_proto=0
13139 : Locate the flags for 'open()'
13142 #include <sys/types.h>
13147 #include <sys/file.h>
13149 #$i_stdlib I_STDLIB
13151 #include <stdlib.h>
13162 : check sys/file.h first to get FREAD on Sun
13163 if $test `./findhdr sys/file.h` && \
13164 set try -DI_SYS_FILE && eval $compile; then
13166 echo "<sys/file.h> defines the O_* constants..." >&4
13167 if $run ./try; then
13168 echo "and you have the 3 argument form of open()." >&4
13171 echo "but not the 3 argument form of open(). Oh, well." >&4
13174 elif $test `./findhdr fcntl.h` && \
13175 set try -DI_FCNTL && eval $compile; then
13177 echo "<fcntl.h> defines the O_* constants..." >&4
13178 if $run ./try; then
13179 echo "and you have the 3 argument form of open()." >&4
13182 echo "but not the 3 argument form of open(). Oh, well." >&4
13187 echo "I can't find the O_* constant definitions! You got problems." >&4
13193 : see if this is a sys/file.h system
13198 : do we need to include sys/file.h ?
13202 if $h_sysfile; then
13204 echo "We'll be including <sys/file.h>." >&4
13207 echo "We won't be including <sys/file.h>." >&4
13217 : see if fcntl.h is there
13222 : see if we can include fcntl.h
13228 echo "We'll be including <fcntl.h>." >&4
13231 if $h_sysfile; then
13232 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13234 echo "We won't be including <fcntl.h>." >&4
13246 : see if fork exists
13250 : see if pipe exists
13254 : check for non-blocking I/O stuff
13255 case "$h_sysfile" in
13256 true) echo "#include <sys/file.h>" > head.c;;
13259 true) echo "#include <fcntl.h>" > head.c;;
13260 *) echo "#include <sys/fcntl.h>" > head.c;;
13265 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13266 case "$o_nonblock" in
13268 $cat head.c > try.c
13269 $cat >>try.c <<EOCP
13271 #$i_stdlib I_STDLIB
13273 #include <stdlib.h>
13281 printf("O_NONBLOCK\n");
13285 printf("O_NDELAY\n");
13289 printf("FNDELAY\n");
13296 if eval $compile_ok; then
13297 o_nonblock=`$run ./try`
13298 case "$o_nonblock" in
13299 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13300 *) echo "Seems like we can use $o_nonblock.";;
13303 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13306 *) echo "Using $hint value $o_nonblock.";;
13311 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13314 case "$d_fork:$d_pipe" in
13316 $cat head.c > try.c
13317 $cat >>try.c <<EOCP
13319 #include <sys/types.h>
13320 #include <signal.h>
13322 #$i_stdlib I_STDLIB
13324 #include <stdlib.h>
13330 #define MY_O_NONBLOCK $o_nonblock
13331 #ifndef errno /* XXX need better Configure test */
13334 #$i_unistd I_UNISTD
13336 #include <unistd.h>
13338 #$i_string I_STRING
13340 #include <string.h>
13342 #include <strings.h>
13344 $signal_t blech(int x) { exit(3); }
13346 $cat >> try.c <<'EOCP'
13355 ret = pipe(pd); /* Down: child -> parent */
13358 ret = pipe(pu); /* Up: parent -> child */
13362 close(pd[1]); /* Parent reads from pd[0] */
13363 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13365 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13370 signal(SIGALRM, blech);
13372 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13374 sprintf(string, "%d\n", ret);
13375 ret = write(2, string, strlen(string));
13376 if (ret != strlen(string))
13380 if (errno == EAGAIN) {
13381 printf("EAGAIN\n");
13386 if (errno == EWOULDBLOCK)
13387 printf("EWOULDBLOCK\n");
13390 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13393 sleep(2); /* Give it time to close our pipe */
13395 ret = read(pd[0], buf, 1); /* Should read EOF */
13397 sprintf(string, "%d\n", ret);
13398 ret = write(4, string, strlen(string));
13399 if (ret != strlen(string))
13404 close(pd[0]); /* We write to pd[1] */
13405 close(pu[1]); /* We read from pu[0] */
13406 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13409 close(pd[1]); /* Pipe pd is now fully closed! */
13410 exit(0); /* Bye bye, thank you for playing! */
13414 if eval $compile_ok; then
13415 echo "$startsh" >mtry
13416 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13418 $run ./mtry >/dev/null 2>&1
13420 0) eagain=`$cat try.out`;;
13421 1) echo "Could not perform non-blocking setting!";;
13422 2) echo "I did a successful read() for something that was not there!";;
13423 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13424 4) echo "Could not find F_SETFL!";;
13425 *) echo "Something terribly wrong happened during testing.";;
13427 rd_nodata=`$cat try.ret`
13428 echo "A read() system call with no data present returns $rd_nodata."
13429 case "$rd_nodata" in
13432 echo "(That's peculiar, fixing that to be -1.)"
13438 echo "Forcing errno EAGAIN on read() with no data available."
13442 echo "Your read() sets errno to $eagain when no data is available."
13445 status=`$cat try.err`
13447 0) echo "And it correctly returns 0 to signal EOF.";;
13448 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13449 *) echo "However, your read() returns '$status' on EOF??";;
13452 if test "$status" = "$rd_nodata"; then
13453 echo "WARNING: you can't distinguish between EOF and no data!"
13457 echo "I can't compile the test program--assuming errno EAGAIN will do."
13461 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13470 echo "Using $hint value $eagain."
13471 echo "Your read() returns $rd_nodata when no data is present."
13472 case "$d_eofnblk" in
13473 "$define") echo "And you can see EOF because read() returns 0.";;
13474 "$undef") echo "But you can't see EOF status from read() returned value.";;
13476 echo "(Assuming you can't see EOF status from read anyway.)"
13482 $rm_try head.c mtry
13484 : see if erf exists
13488 : see if erfc exists
13492 : see if exp2 exists
13496 : see if expm1 exists
13500 : see if _ptr and _cnt from stdio act std
13503 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13504 echo "(Looks like you have stdio.h from BSD.)"
13505 case "$stdio_ptr" in
13506 '') stdio_ptr='((fp)->_p)'
13509 *) ptr_lval=$d_stdio_ptr_lval;;
13511 case "$stdio_cnt" in
13512 '') stdio_cnt='((fp)->_r)'
13515 *) cnt_lval=$d_stdio_cnt_lval;;
13517 case "$stdio_base" in
13518 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13520 case "$stdio_bufsiz" in
13521 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13523 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13524 echo "(Looks like you have stdio.h from Linux.)"
13525 case "$stdio_ptr" in
13526 '') stdio_ptr='((fp)->_IO_read_ptr)'
13529 *) ptr_lval=$d_stdio_ptr_lval;;
13531 case "$stdio_cnt" in
13532 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13535 *) cnt_lval=$d_stdio_cnt_lval;;
13537 case "$stdio_base" in
13538 '') stdio_base='((fp)->_IO_read_base)';;
13540 case "$stdio_bufsiz" in
13541 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13544 case "$stdio_ptr" in
13545 '') stdio_ptr='((fp)->_ptr)'
13548 *) ptr_lval=$d_stdio_ptr_lval;;
13550 case "$stdio_cnt" in
13551 '') stdio_cnt='((fp)->_cnt)'
13554 *) cnt_lval=$d_stdio_cnt_lval;;
13556 case "$stdio_base" in
13557 '') stdio_base='((fp)->_base)';;
13559 case "$stdio_bufsiz" in
13560 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13564 : test whether _ptr and _cnt really work
13565 echo "Checking how std your stdio is..." >&4
13568 #$i_stdlib I_STDLIB
13570 #include <stdlib.h>
13572 #define FILE_ptr(fp) $stdio_ptr
13573 #define FILE_cnt(fp) $stdio_cnt
13575 FILE *fp = fopen("try.c", "r");
13578 18 <= FILE_cnt(fp) &&
13579 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13587 if eval $compile && $to try.c; then
13588 if $run ./try; then
13589 echo "Your stdio acts pretty std."
13592 echo "Your stdio isn't very std."
13595 echo "Your stdio doesn't appear very std."
13599 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13600 # direct buffer manipulation no longer works. The Configure tests
13601 # should be changed to correctly detect this, but until then,
13602 # the following check should at least let perl compile and run.
13603 # (This quick fix should be updated before 5.8.1.)
13604 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13605 # A. Dougherty, June 3, 2002.
13606 case "$d_gnulibc" in
13608 case "$gnulibc_version" in
13612 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13621 : Can _ptr be used as an lvalue?
13622 case "$d_stdstdio$ptr_lval" in
13623 $define$define) val=$define ;;
13626 set d_stdio_ptr_lval
13629 : Can _cnt be used as an lvalue?
13630 case "$d_stdstdio$cnt_lval" in
13631 $define$define) val=$define ;;
13634 set d_stdio_cnt_lval
13638 : test whether setting _ptr sets _cnt as a side effect
13639 d_stdio_ptr_lval_sets_cnt="$undef"
13640 d_stdio_ptr_lval_nochange_cnt="$undef"
13641 case "$d_stdio_ptr_lval$d_stdstdio" in
13643 echo "Checking to see what happens if we set the stdio ptr..." >&4
13646 /* Can we scream? */
13647 /* Eat dust sed :-) */
13648 /* In the buffer space, no one can hear you scream. */
13649 #$i_stdlib I_STDLIB
13651 #include <stdlib.h>
13653 #define FILE_ptr(fp) $stdio_ptr
13654 #define FILE_cnt(fp) $stdio_cnt
13655 #include <sys/types.h>
13657 FILE *fp = fopen("try.c", "r");
13662 puts("Fail even to read");
13665 c = getc(fp); /* Read away the first # */
13667 puts("Fail even to read");
13671 18 <= FILE_cnt(fp) &&
13672 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13674 puts("Fail even to read");
13677 ptr = (char*) FILE_ptr(fp);
13678 cnt = (size_t)FILE_cnt(fp);
13680 FILE_ptr(fp) += 42;
13682 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13683 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13686 if (FILE_cnt(fp) <= 20) {
13687 printf ("Fail (<20 chars to test)");
13690 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13691 puts("Fail compare");
13694 if (cnt == FILE_cnt(fp)) {
13695 puts("Pass_unchanged");
13698 if (FILE_cnt(fp) == (cnt - 42)) {
13699 puts("Pass_changed");
13702 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13708 if eval $compile && $to try.c; then
13709 case `$run ./try` in
13711 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13712 d_stdio_ptr_lval_sets_cnt="$define" ;;
13714 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13715 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13717 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13719 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13722 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13728 : see if _base is also standard
13730 case "$d_stdstdio" in
13734 #$i_stdlib I_STDLIB
13736 #include <stdlib.h>
13738 #define FILE_base(fp) $stdio_base
13739 #define FILE_bufsiz(fp) $stdio_bufsiz
13741 FILE *fp = fopen("try.c", "r");
13744 19 <= FILE_bufsiz(fp) &&
13745 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13752 if eval $compile && $to try.c; then
13753 if $run ./try; then
13754 echo "And its _base field acts std."
13757 echo "But its _base field isn't std."
13760 echo "However, it seems to be lacking the _base field."
13768 : see if fast_stdio exists
13770 case "$d_stdstdio:$d_stdio_ptr_lval" in
13772 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13774 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13785 : see if fchdir exists
13786 set fchdir d_fchdir
13789 : see if fchmod exists
13790 set fchmod d_fchmod
13793 : see if fchown exists
13794 set fchown d_fchown
13797 : see if this is an fcntl system
13801 : See if fcntl-based locking works.
13804 #$i_stdlib I_STDLIB
13806 #include <stdlib.h>
13808 #include <unistd.h>
13810 #include <signal.h>
13811 $signal_t blech(int x) { exit(3); }
13813 #if defined(F_SETLK) && defined(F_SETLKW)
13814 struct flock flock;
13816 fd = open("try.c", O_RDONLY);
13817 flock.l_type = F_RDLCK;
13818 flock.l_whence = SEEK_SET;
13819 flock.l_start = flock.l_len = 0;
13820 signal(SIGALRM, blech);
13822 retval = fcntl(fd, F_SETLK, &flock);
13824 (retval < 0 ? exit(2) : exit(0));
13830 echo "Checking if fcntl-based file locking works... "
13834 if eval $compile_ok; then
13835 if $run ./try; then
13836 echo "Yes, it seems to work."
13839 echo "Nope, it didn't work."
13844 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13845 *** This is (almost) impossible.
13846 *** If your NFS lock daemons are not feeling well, something like
13847 *** this may happen, please investigate. Cannot continue, aborting.
13855 echo "I'm unable to compile the test program, so I'll assume not."
13860 echo "Nope, since you don't even have fcntl()."
13863 set d_fcntl_can_lock
13867 : check for fd_set items
13870 Checking to see how well your C compiler handles fd_set and friends ...
13873 #$i_stdlib I_STDLIB
13875 #include <stdlib.h>
13877 #$i_systime I_SYS_TIME
13878 #$i_sysselct I_SYS_SELECT
13879 #$d_socket HAS_SOCKET
13880 #include <sys/types.h>
13882 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13885 #include <sys/time.h>
13887 #ifdef I_SYS_SELECT
13888 #include <sys/select.h>
13897 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13905 if eval $compile; then
13906 d_fds_bits="$define"
13908 echo "Well, your system knows about the normal fd_set typedef..." >&4
13909 if $run ./try; then
13910 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13911 d_fd_macros="$define"
13914 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13916 d_fd_macros="$undef"
13920 Hmm, your compiler has some difficulty with fd_set. Checking further...
13923 if eval $compile; then
13924 d_fds_bits="$undef"
13926 echo "Well, your system has some sort of fd_set available..." >&4
13927 if $run ./try; then
13928 echo "and you have the normal fd_set macros." >&4
13929 d_fd_macros="$define"
13932 but not the normal fd_set macros! Gross! More work for me...
13934 d_fd_macros="$undef"
13937 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13939 d_fds_bits="$undef"
13940 d_fd_macros="$undef"
13945 : see if fdim exists
13949 : see if fegetround exists
13950 set fegetround d_fegetround
13953 : see if fgetpos exists
13954 set fgetpos d_fgetpos
13957 : see if finite exists
13958 set finite d_finite
13961 : see if finitel exists
13962 set finitel d_finitel
13965 : see if flock exists
13969 : see if prototype for flock is available
13971 set d_flockproto flock $i_sysfile sys/file.h
13974 : see if fma exists
13978 : see if fmax exists
13982 : see if fmin exists
13986 : see if fp_class exists
13987 set fp_class d_fp_class
13990 : see if this is a math.h system
13994 : check for fpclassify
13995 echo "Checking to see if you have fpclassify..." >&4
14001 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14004 if eval $compile; then
14006 echo "You have fpclassify."
14009 echo "You do not have fpclassify."
14015 : see if fp_classify exists
14016 set fp_classify d_fp_classify
14019 : see if fp_classl exists
14020 set fp_classl d_fp_classl
14023 : see if pathconf exists
14024 set pathconf d_pathconf
14027 : see if fpathconf exists
14028 set fpathconf d_fpathconf
14031 : see if fpclass exists
14032 set fpclass d_fpclass
14035 : see if fpclassl exists
14036 set fpclassl d_fpclassl
14039 : see if fpgetround exists
14040 set fpgetround d_fpgetround
14043 : check for fpos64_t
14045 echo "Checking to see if you have fpos64_t..." >&4
14048 int main() { fpos64_t x = 7; }
14051 if eval $compile; then
14053 echo "You have fpos64_t."
14056 echo "You do not have fpos64_t."
14057 case "$fpossize" in
14058 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14065 : see if frexpl exists
14066 set frexpl d_frexpl
14069 : see if this is a sys/param system
14070 set sys/param.h i_sysparam
14073 : see if this is a sys/mount.h system
14074 set sys/mount.h i_sysmount
14077 : Check for fs_data_s
14079 echo "Checking to see if your system supports struct fs_data..." >&4
14080 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14082 case "$d_fs_data_s" in
14083 "$define") echo "Yes, it does." ;;
14084 *) echo "No, it doesn't." ;;
14087 : see if fseeko exists
14088 set fseeko d_fseeko
14090 case "$longsize" in
14091 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14094 : see if fsetpos exists
14095 set fsetpos d_fsetpos
14098 : see if fstatfs exists
14099 set fstatfs d_fstatfs
14102 : see if statvfs exists
14103 set statvfs d_statvfs
14106 : see if fstatvfs exists
14107 set fstatvfs d_fstatvfs
14111 : see if fsync exists
14115 : see if ftello exists
14116 set ftello d_ftello
14118 case "$longsize" in
14119 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14122 : check for a working futimes
14125 echo "Checking if you have a working futimes()" >&4
14128 #include <sys/time.h>
14135 fd = open ("try.c", O_RDWR);
14136 if (-1 == fd) exit (1);
14137 rv = futimes (fd, NULL);
14138 exit (rv == -1 ? errno : 0);
14142 if eval $compile; then
14146 0) echo "Yes, you have" >&4
14147 d_futimes="$define"
14149 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14153 echo "No, it does not (probably harmless)" >&4
14157 : see if ndbm.h is available
14160 : Compatibility location for RedHat 7.1
14161 set gdbm/ndbm.h i_gdbmndbm
14163 : Compatibility location for Debian 4.0
14164 set gdbm-ndbm.h i_gdbm_ndbm
14168 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14169 : see if dbm_open exists
14170 set dbm_open d_dbm_open
14172 case "$d_dbm_open" in
14175 i_gdbmndbm="$undef"
14176 i_gdbm_ndbm="$undef"
14177 echo "We won't be including <ndbm.h>"
14187 ndbm_hdr_protochk='name=$1; hdr=$2;
14188 eval "ihdr=\$""i_$name";
14190 if $test "$ihdr" = "$define"; then
14191 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14192 case "$d_cplusplus" in
14193 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14194 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14197 $define) $echo "Your <$hdr> seems to have prototypes";;
14198 *) $echo "Your <$hdr> does not seem to have prototypes";;
14201 set "d_${name}_h_uses_prototypes";
14205 eval $ndbm_hdr_protochk
14206 set gdbmndbm gdbm/ndbm.h
14207 eval $ndbm_hdr_protochk
14208 set gdbm_ndbm gdbm-ndbm.h
14209 eval $ndbm_hdr_protochk
14211 : see if getaddrinfo exists
14212 set getaddrinfo d_getaddrinfo
14215 : see if getcwd exists
14216 set getcwd d_getcwd
14219 : see if getespwnam exists
14220 set getespwnam d_getespwnam
14223 : see if getfsstat exists
14224 set getfsstat d_getfsstat
14227 : see if getgrent exists
14228 set getgrent d_getgrent
14231 : see if getgrent_r exists
14232 set getgrent_r d_getgrent_r
14234 case "$d_getgrent_r" in
14236 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14237 case "$d_getgrent_r_proto:$usethreads" in
14238 ":define") d_getgrent_r_proto=define
14239 set d_getgrent_r_proto getgrent_r $hdrs
14243 case "$d_getgrent_r_proto" in
14245 case "$getgrent_r_proto" in
14246 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14247 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14249 case "$getgrent_r_proto" in
14250 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14251 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14253 case "$getgrent_r_proto" in
14254 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14255 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14257 case "$getgrent_r_proto" in
14258 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14259 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14261 case "$getgrent_r_proto" in
14262 ''|0) try='int getgrent_r(struct group*, char*, int);'
14263 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14265 case "$getgrent_r_proto" in
14266 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14267 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14269 case "$getgrent_r_proto" in
14270 ''|0) d_getgrent_r=undef
14272 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14273 * ) case "$getgrent_r_proto" in
14274 REENTRANT_PROTO*) ;;
14275 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14277 echo "Prototype: $try" ;;
14280 *) case "$usethreads" in
14281 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14288 *) getgrent_r_proto=0
14292 : see if getgrgid_r exists
14293 set getgrgid_r d_getgrgid_r
14295 case "$d_getgrgid_r" in
14297 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14298 case "$d_getgrgid_r_proto:$usethreads" in
14299 ":define") d_getgrgid_r_proto=define
14300 set d_getgrgid_r_proto getgrgid_r $hdrs
14304 case "$d_getgrgid_r_proto" in
14306 case "$getgrgid_r_proto" in
14307 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14308 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14310 case "$getgrgid_r_proto" in
14311 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14312 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14314 case "$getgrgid_r_proto" in
14315 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14316 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14318 case "$getgrgid_r_proto" in
14319 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14320 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14322 case "$getgrgid_r_proto" in
14323 ''|0) d_getgrgid_r=undef
14325 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14326 * ) case "$getgrgid_r_proto" in
14327 REENTRANT_PROTO*) ;;
14328 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14330 echo "Prototype: $try" ;;
14333 *) case "$usethreads" in
14334 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14341 *) getgrgid_r_proto=0
14345 : see if getgrnam_r exists
14346 set getgrnam_r d_getgrnam_r
14348 case "$d_getgrnam_r" in
14350 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14351 case "$d_getgrnam_r_proto:$usethreads" in
14352 ":define") d_getgrnam_r_proto=define
14353 set d_getgrnam_r_proto getgrnam_r $hdrs
14357 case "$d_getgrnam_r_proto" in
14359 case "$getgrnam_r_proto" in
14360 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14361 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14363 case "$getgrnam_r_proto" in
14364 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14365 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14367 case "$getgrnam_r_proto" in
14368 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14369 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14371 case "$getgrnam_r_proto" in
14372 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14373 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14375 case "$getgrnam_r_proto" in
14376 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14377 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14379 case "$getgrnam_r_proto" in
14380 ''|0) d_getgrnam_r=undef
14382 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14383 * ) case "$getgrnam_r_proto" in
14384 REENTRANT_PROTO*) ;;
14385 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14387 echo "Prototype: $try" ;;
14390 *) case "$usethreads" in
14391 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14398 *) getgrnam_r_proto=0
14402 : see if gethostbyaddr exists
14403 set gethostbyaddr d_gethbyaddr
14406 : see if gethostbyname exists
14407 set gethostbyname d_gethbyname
14410 : see if gethostent exists
14411 set gethostent d_gethent
14414 : see how we will look up host name
14417 if set gethostname val -f d_gethname; eval $csym; $val; then
14418 echo 'gethostname() found.' >&4
14419 d_gethname="$define"
14422 if set uname val -f d_uname; eval $csym; $val; then
14425 uname() was found, but you're running xenix, and older versions of xenix
14426 have a broken uname(). If you don't really know whether your xenix is old
14427 enough to have a broken system call, use the default answer.
14432 "$define") dflt=n;;
14434 rp='Is your uname() broken?'
14437 n*) d_uname="$define"; call=uname;;
14440 echo 'uname() found.' >&4
14447 case "$d_gethname" in
14448 '') d_gethname="$undef";;
14451 '') d_uname="$undef";;
14453 case "$d_uname$d_gethname" in
14458 Every now and then someone has a $call() that lies about the hostname
14459 but can't be fixed for political or economic reasons. If you wish, I can
14460 pretend $call() isn't there and maybe compute hostname at run-time
14461 thanks to the '$phostname' command.
14464 rp="Shall I ignore $call() from now on?"
14467 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14470 case "$phostname" in
14471 '') aphostname='';;
14472 *) case "$aphostname" in
14474 *) set X $phostname
14478 file=`./loc $file $file $pth`
14479 aphostname=`echo $file $*`
14484 case "$d_uname$d_gethname" in
14487 case "$phostname" in
14489 echo "There will be no way for $package to get your hostname." >&4;;
14491 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14495 case "$d_phostname" in
14496 '') d_phostname="$undef";;
14499 : see if gethostbyaddr_r exists
14500 set gethostbyaddr_r d_gethostbyaddr_r
14502 case "$d_gethostbyaddr_r" in
14504 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14505 case "$d_gethostbyaddr_r_proto:$usethreads" in
14506 ":define") d_gethostbyaddr_r_proto=define
14507 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14511 case "$d_gethostbyaddr_r_proto" in
14513 case "$gethostbyaddr_r_proto" in
14514 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14515 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14517 case "$gethostbyaddr_r_proto" in
14518 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14519 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14521 case "$gethostbyaddr_r_proto" in
14522 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14523 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14525 case "$gethostbyaddr_r_proto" in
14526 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14527 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14529 case "$gethostbyaddr_r_proto" in
14530 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14531 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14533 case "$gethostbyaddr_r_proto" in
14534 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14535 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14537 case "$gethostbyaddr_r_proto" in
14538 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14539 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14541 case "$gethostbyaddr_r_proto" in
14542 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14543 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14545 case "$gethostbyaddr_r_proto" in
14546 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14547 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14549 case "$gethostbyaddr_r_proto" in
14550 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14551 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14553 case "$gethostbyaddr_r_proto" in
14554 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14555 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14557 case "$gethostbyaddr_r_proto" in
14558 ''|0) d_gethostbyaddr_r=undef
14559 gethostbyaddr_r_proto=0
14560 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14561 * ) case "$gethostbyaddr_r_proto" in
14562 REENTRANT_PROTO*) ;;
14563 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14565 echo "Prototype: $try" ;;
14568 *) case "$usethreads" in
14569 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14571 d_gethostbyaddr_r=undef
14572 gethostbyaddr_r_proto=0
14576 *) gethostbyaddr_r_proto=0
14580 : see if gethostbyname_r exists
14581 set gethostbyname_r d_gethostbyname_r
14583 case "$d_gethostbyname_r" in
14585 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14586 case "$d_gethostbyname_r_proto:$usethreads" in
14587 ":define") d_gethostbyname_r_proto=define
14588 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14592 case "$d_gethostbyname_r_proto" in
14594 case "$gethostbyname_r_proto" in
14595 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14596 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14598 case "$gethostbyname_r_proto" in
14599 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14600 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14602 case "$gethostbyname_r_proto" in
14603 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14604 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14606 case "$gethostbyname_r_proto" in
14607 ''|0) d_gethostbyname_r=undef
14608 gethostbyname_r_proto=0
14609 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14610 * ) case "$gethostbyname_r_proto" in
14611 REENTRANT_PROTO*) ;;
14612 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14614 echo "Prototype: $try" ;;
14617 *) case "$usethreads" in
14618 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14620 d_gethostbyname_r=undef
14621 gethostbyname_r_proto=0
14625 *) gethostbyname_r_proto=0
14629 : see if gethostent_r exists
14630 set gethostent_r d_gethostent_r
14632 case "$d_gethostent_r" in
14634 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14635 case "$d_gethostent_r_proto:$usethreads" in
14636 ":define") d_gethostent_r_proto=define
14637 set d_gethostent_r_proto gethostent_r $hdrs
14641 case "$d_gethostent_r_proto" in
14643 case "$gethostent_r_proto" in
14644 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14645 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14647 case "$gethostent_r_proto" in
14648 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14649 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14651 case "$gethostent_r_proto" in
14652 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14653 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14655 case "$gethostent_r_proto" in
14656 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14657 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14659 case "$gethostent_r_proto" in
14660 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14661 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14663 case "$gethostent_r_proto" in
14664 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14665 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14667 case "$gethostent_r_proto" in
14668 ''|0) d_gethostent_r=undef
14669 gethostent_r_proto=0
14670 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14671 * ) case "$gethostent_r_proto" in
14672 REENTRANT_PROTO*) ;;
14673 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14675 echo "Prototype: $try" ;;
14678 *) case "$usethreads" in
14679 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14681 d_gethostent_r=undef
14682 gethostent_r_proto=0
14686 *) gethostent_r_proto=0
14690 : see if prototypes for various gethostxxx netdb.h functions are available
14692 set d_gethostprotos gethostent $i_netdb netdb.h
14695 : see if getitimer exists
14696 set getitimer d_getitimer
14699 : see if getlogin exists
14700 set getlogin d_getlogin
14703 : see if getlogin_r exists
14704 set getlogin_r d_getlogin_r
14706 case "$d_getlogin_r" in
14708 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14709 case "$d_getlogin_r_proto:$usethreads" in
14710 ":define") d_getlogin_r_proto=define
14711 set d_getlogin_r_proto getlogin_r $hdrs
14715 case "$d_getlogin_r_proto" in
14717 case "$getlogin_r_proto" in
14718 ''|0) try='int getlogin_r(char*, size_t);'
14719 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14721 case "$getlogin_r_proto" in
14722 ''|0) try='int getlogin_r(char*, int);'
14723 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14725 case "$getlogin_r_proto" in
14726 ''|0) try='char* getlogin_r(char*, size_t);'
14727 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14729 case "$getlogin_r_proto" in
14730 ''|0) try='char* getlogin_r(char*, int);'
14731 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14733 case "$getlogin_r_proto" in
14734 ''|0) d_getlogin_r=undef
14736 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14737 * ) case "$getlogin_r_proto" in
14738 REENTRANT_PROTO*) ;;
14739 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14741 echo "Prototype: $try" ;;
14744 *) case "$usethreads" in
14745 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14752 *) getlogin_r_proto=0
14756 : see if getmnt exists
14757 set getmnt d_getmnt
14760 : see if getmntent exists
14761 set getmntent d_getmntent
14764 : see if getnameinfo exists
14765 set getnameinfo d_getnameinfo
14768 : see if getnetbyaddr exists
14769 set getnetbyaddr d_getnbyaddr
14772 : see if getnetbyname exists
14773 set getnetbyname d_getnbyname
14776 : see if getnetent exists
14777 set getnetent d_getnent
14780 : see if getnetbyaddr_r exists
14781 set getnetbyaddr_r d_getnetbyaddr_r
14783 case "$d_getnetbyaddr_r" in
14785 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14786 case "$d_getnetbyaddr_r_proto:$usethreads" in
14787 ":define") d_getnetbyaddr_r_proto=define
14788 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14792 case "$d_getnetbyaddr_r_proto" in
14794 case "$getnetbyaddr_r_proto" in
14795 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14796 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14798 case "$getnetbyaddr_r_proto" in
14799 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14800 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14802 case "$getnetbyaddr_r_proto" in
14803 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14804 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14806 case "$getnetbyaddr_r_proto" in
14807 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14808 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14810 case "$getnetbyaddr_r_proto" in
14811 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14812 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14814 case "$getnetbyaddr_r_proto" in
14815 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14816 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14818 case "$getnetbyaddr_r_proto" in
14819 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14820 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14822 case "$getnetbyaddr_r_proto" in
14823 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14824 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14826 case "$getnetbyaddr_r_proto" in
14827 ''|0) d_getnetbyaddr_r=undef
14828 getnetbyaddr_r_proto=0
14829 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14830 * ) case "$getnetbyaddr_r_proto" in
14831 REENTRANT_PROTO*) ;;
14832 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14834 echo "Prototype: $try" ;;
14837 *) case "$usethreads" in
14838 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14840 d_getnetbyaddr_r=undef
14841 getnetbyaddr_r_proto=0
14845 *) getnetbyaddr_r_proto=0
14849 : see if getnetbyname_r exists
14850 set getnetbyname_r d_getnetbyname_r
14852 case "$d_getnetbyname_r" in
14854 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14855 case "$d_getnetbyname_r_proto:$usethreads" in
14856 ":define") d_getnetbyname_r_proto=define
14857 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14861 case "$d_getnetbyname_r_proto" in
14863 case "$getnetbyname_r_proto" in
14864 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14865 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14867 case "$getnetbyname_r_proto" in
14868 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14869 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14871 case "$getnetbyname_r_proto" in
14872 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14873 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14875 case "$getnetbyname_r_proto" in
14876 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14877 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14879 case "$getnetbyname_r_proto" in
14880 ''|0) d_getnetbyname_r=undef
14881 getnetbyname_r_proto=0
14882 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14883 * ) case "$getnetbyname_r_proto" in
14884 REENTRANT_PROTO*) ;;
14885 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14887 echo "Prototype: $try" ;;
14890 *) case "$usethreads" in
14891 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14893 d_getnetbyname_r=undef
14894 getnetbyname_r_proto=0
14898 *) getnetbyname_r_proto=0
14902 : see if getnetent_r exists
14903 set getnetent_r d_getnetent_r
14905 case "$d_getnetent_r" in
14907 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14908 case "$d_getnetent_r_proto:$usethreads" in
14909 ":define") d_getnetent_r_proto=define
14910 set d_getnetent_r_proto getnetent_r $hdrs
14914 case "$d_getnetent_r_proto" in
14916 case "$getnetent_r_proto" in
14917 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14918 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14920 case "$getnetent_r_proto" in
14921 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14922 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14924 case "$getnetent_r_proto" in
14925 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14926 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14928 case "$getnetent_r_proto" in
14929 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14930 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14932 case "$getnetent_r_proto" in
14933 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14934 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14936 case "$getnetent_r_proto" in
14937 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14938 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14940 case "$getnetent_r_proto" in
14941 ''|0) d_getnetent_r=undef
14942 getnetent_r_proto=0
14943 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14944 * ) case "$getnetent_r_proto" in
14945 REENTRANT_PROTO*) ;;
14946 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14948 echo "Prototype: $try" ;;
14951 *) case "$usethreads" in
14952 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14954 d_getnetent_r=undef
14955 getnetent_r_proto=0
14959 *) getnetent_r_proto=0
14963 : see if prototypes for various getnetxxx netdb.h functions are available
14965 set d_getnetprotos getnetent $i_netdb netdb.h
14968 : see if getpagesize exists
14969 set getpagesize d_getpagsz
14972 : Optional checks for getprotobyname and getprotobynumber
14974 : see if getprotobyname exists
14975 set getprotobyname d_getpbyname
14978 : see if getprotobynumber exists
14979 set getprotobynumber d_getpbynumber
14982 : see if getprotoent exists
14983 set getprotoent d_getpent
14986 : see if getpgid exists
14987 set getpgid d_getpgid
14990 : see if getpgrp2 exists
14991 set getpgrp2 d_getpgrp2
14994 : see if getppid exists
14995 set getppid d_getppid
14998 : see if getpriority exists
14999 set getpriority d_getprior
15002 : see if getprotobyname_r exists
15003 set getprotobyname_r d_getprotobyname_r
15005 case "$d_getprotobyname_r" in
15007 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15008 case "$d_getprotobyname_r_proto:$usethreads" in
15009 ":define") d_getprotobyname_r_proto=define
15010 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15014 case "$d_getprotobyname_r_proto" in
15016 case "$getprotobyname_r_proto" in
15017 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15018 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15020 case "$getprotobyname_r_proto" in
15021 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15022 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15024 case "$getprotobyname_r_proto" in
15025 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15026 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15028 case "$getprotobyname_r_proto" in
15029 ''|0) d_getprotobyname_r=undef
15030 getprotobyname_r_proto=0
15031 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15032 * ) case "$getprotobyname_r_proto" in
15033 REENTRANT_PROTO*) ;;
15034 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15036 echo "Prototype: $try" ;;
15039 *) case "$usethreads" in
15040 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15042 d_getprotobyname_r=undef
15043 getprotobyname_r_proto=0
15047 *) getprotobyname_r_proto=0
15051 : see if getprotobynumber_r exists
15052 set getprotobynumber_r d_getprotobynumber_r
15054 case "$d_getprotobynumber_r" in
15056 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15057 case "$d_getprotobynumber_r_proto:$usethreads" in
15058 ":define") d_getprotobynumber_r_proto=define
15059 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15063 case "$d_getprotobynumber_r_proto" in
15065 case "$getprotobynumber_r_proto" in
15066 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15067 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15069 case "$getprotobynumber_r_proto" in
15070 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15071 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15073 case "$getprotobynumber_r_proto" in
15074 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15075 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15077 case "$getprotobynumber_r_proto" in
15078 ''|0) d_getprotobynumber_r=undef
15079 getprotobynumber_r_proto=0
15080 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15081 * ) case "$getprotobynumber_r_proto" in
15082 REENTRANT_PROTO*) ;;
15083 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15085 echo "Prototype: $try" ;;
15088 *) case "$usethreads" in
15089 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15091 d_getprotobynumber_r=undef
15092 getprotobynumber_r_proto=0
15096 *) getprotobynumber_r_proto=0
15100 : see if getprotoent_r exists
15101 set getprotoent_r d_getprotoent_r
15103 case "$d_getprotoent_r" in
15105 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15106 case "$d_getprotoent_r_proto:$usethreads" in
15107 ":define") d_getprotoent_r_proto=define
15108 set d_getprotoent_r_proto getprotoent_r $hdrs
15112 case "$d_getprotoent_r_proto" in
15114 case "$getprotoent_r_proto" in
15115 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15116 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15118 case "$getprotoent_r_proto" in
15119 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15120 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15122 case "$getprotoent_r_proto" in
15123 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15124 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15126 case "$getprotoent_r_proto" in
15127 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15128 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15130 case "$getprotoent_r_proto" in
15131 ''|0) d_getprotoent_r=undef
15132 getprotoent_r_proto=0
15133 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15134 * ) case "$getprotoent_r_proto" in
15135 REENTRANT_PROTO*) ;;
15136 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15138 echo "Prototype: $try" ;;
15141 *) case "$usethreads" in
15142 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15144 d_getprotoent_r=undef
15145 getprotoent_r_proto=0
15149 *) getprotoent_r_proto=0
15153 : see if prototypes for various getprotoxxx netdb.h functions are available
15155 set d_getprotoprotos getprotoent $i_netdb netdb.h
15158 : see if getprpwnam exists
15159 set getprpwnam d_getprpwnam
15162 : see if getpwent exists
15163 set getpwent d_getpwent
15166 : see if getpwent_r exists
15167 set getpwent_r d_getpwent_r
15169 case "$d_getpwent_r" in
15171 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15172 case "$d_getpwent_r_proto:$usethreads" in
15173 ":define") d_getpwent_r_proto=define
15174 set d_getpwent_r_proto getpwent_r $hdrs
15178 case "$d_getpwent_r_proto" in
15180 case "$getpwent_r_proto" in
15181 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15182 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15184 case "$getpwent_r_proto" in
15185 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15186 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15188 case "$getpwent_r_proto" in
15189 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15190 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15192 case "$getpwent_r_proto" in
15193 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15194 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15196 case "$getpwent_r_proto" in
15197 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15198 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15200 case "$getpwent_r_proto" in
15201 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15202 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15204 case "$getpwent_r_proto" in
15205 ''|0) d_getpwent_r=undef
15207 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15208 * ) case "$getpwent_r_proto" in
15209 REENTRANT_PROTO*) ;;
15210 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15212 echo "Prototype: $try" ;;
15215 *) case "$usethreads" in
15216 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15223 *) getpwent_r_proto=0
15227 : see if getpwnam_r exists
15228 set getpwnam_r d_getpwnam_r
15230 case "$d_getpwnam_r" in
15232 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15233 case "$d_getpwnam_r_proto:$usethreads" in
15234 ":define") d_getpwnam_r_proto=define
15235 set d_getpwnam_r_proto getpwnam_r $hdrs
15239 case "$d_getpwnam_r_proto" in
15241 case "$getpwnam_r_proto" in
15242 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15243 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15245 case "$getpwnam_r_proto" in
15246 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15247 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15249 case "$getpwnam_r_proto" in
15250 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15251 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15253 case "$getpwnam_r_proto" in
15254 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15255 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15257 case "$getpwnam_r_proto" in
15258 ''|0) d_getpwnam_r=undef
15260 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15261 * ) case "$getpwnam_r_proto" in
15262 REENTRANT_PROTO*) ;;
15263 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15265 echo "Prototype: $try" ;;
15268 *) case "$usethreads" in
15269 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15276 *) getpwnam_r_proto=0
15280 : see if getpwuid_r exists
15281 set getpwuid_r d_getpwuid_r
15283 case "$d_getpwuid_r" in
15285 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15286 case "$d_getpwuid_r_proto:$usethreads" in
15287 ":define") d_getpwuid_r_proto=define
15288 set d_getpwuid_r_proto getpwuid_r $hdrs
15292 case "$d_getpwuid_r_proto" in
15294 case "$getpwuid_r_proto" in
15295 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15296 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15298 case "$getpwuid_r_proto" in
15299 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15300 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15302 case "$getpwuid_r_proto" in
15303 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15304 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15306 case "$getpwuid_r_proto" in
15307 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15308 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15310 case "$getpwuid_r_proto" in
15311 ''|0) d_getpwuid_r=undef
15313 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15314 * ) case "$getpwuid_r_proto" in
15315 REENTRANT_PROTO*) ;;
15316 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15318 echo "Prototype: $try" ;;
15321 *) case "$usethreads" in
15322 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15329 *) getpwuid_r_proto=0
15333 : Optional checks for getsbyname and getsbyport
15335 : see if getservbyname exists
15336 set getservbyname d_getsbyname
15339 : see if getservbyport exists
15340 set getservbyport d_getsbyport
15343 : see if getservent exists
15344 set getservent d_getsent
15347 : see if getservbyname_r exists
15348 set getservbyname_r d_getservbyname_r
15350 case "$d_getservbyname_r" in
15352 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15353 case "$d_getservbyname_r_proto:$usethreads" in
15354 ":define") d_getservbyname_r_proto=define
15355 set d_getservbyname_r_proto getservbyname_r $hdrs
15359 case "$d_getservbyname_r_proto" in
15361 case "$getservbyname_r_proto" in
15362 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15363 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15365 case "$getservbyname_r_proto" in
15366 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15367 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15369 case "$getservbyname_r_proto" in
15370 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15371 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15373 case "$getservbyname_r_proto" in
15374 ''|0) d_getservbyname_r=undef
15375 getservbyname_r_proto=0
15376 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15377 * ) case "$getservbyname_r_proto" in
15378 REENTRANT_PROTO*) ;;
15379 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15381 echo "Prototype: $try" ;;
15384 *) case "$usethreads" in
15385 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15387 d_getservbyname_r=undef
15388 getservbyname_r_proto=0
15392 *) getservbyname_r_proto=0
15396 : see if getservbyport_r exists
15397 set getservbyport_r d_getservbyport_r
15399 case "$d_getservbyport_r" in
15401 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15402 case "$d_getservbyport_r_proto:$usethreads" in
15403 ":define") d_getservbyport_r_proto=define
15404 set d_getservbyport_r_proto getservbyport_r $hdrs
15408 case "$d_getservbyport_r_proto" in
15410 case "$getservbyport_r_proto" in
15411 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15412 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15414 case "$getservbyport_r_proto" in
15415 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15416 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15418 case "$getservbyport_r_proto" in
15419 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15420 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15422 case "$getservbyport_r_proto" in
15423 ''|0) d_getservbyport_r=undef
15424 getservbyport_r_proto=0
15425 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15426 * ) case "$getservbyport_r_proto" in
15427 REENTRANT_PROTO*) ;;
15428 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15430 echo "Prototype: $try" ;;
15433 *) case "$usethreads" in
15434 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15436 d_getservbyport_r=undef
15437 getservbyport_r_proto=0
15441 *) getservbyport_r_proto=0
15445 : see if getservent_r exists
15446 set getservent_r d_getservent_r
15448 case "$d_getservent_r" in
15450 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15451 case "$d_getservent_r_proto:$usethreads" in
15452 ":define") d_getservent_r_proto=define
15453 set d_getservent_r_proto getservent_r $hdrs
15457 case "$d_getservent_r_proto" in
15459 case "$getservent_r_proto" in
15460 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15461 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15463 case "$getservent_r_proto" in
15464 ''|0) try='int getservent_r(struct servent*, char*, int);'
15465 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15467 case "$getservent_r_proto" in
15468 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15469 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15471 case "$getservent_r_proto" in
15472 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15473 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15475 case "$getservent_r_proto" in
15476 ''|0) d_getservent_r=undef
15477 getservent_r_proto=0
15478 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15479 * ) case "$getservent_r_proto" in
15480 REENTRANT_PROTO*) ;;
15481 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15483 echo "Prototype: $try" ;;
15486 *) case "$usethreads" in
15487 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15489 d_getservent_r=undef
15490 getservent_r_proto=0
15494 *) getservent_r_proto=0
15498 : see if prototypes for various getservxxx netdb.h functions are available
15500 set d_getservprotos getservent $i_netdb netdb.h
15503 : see if getspnam exists
15504 set getspnam d_getspnam
15507 : see if this is a shadow.h system
15508 set shadow.h i_shadow
15511 : see if getspnam_r exists
15512 set getspnam_r d_getspnam_r
15514 case "$d_getspnam_r" in
15516 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15517 case "$d_getspnam_r_proto:$usethreads" in
15518 ":define") d_getspnam_r_proto=define
15519 set d_getspnam_r_proto getspnam_r $hdrs
15523 case "$d_getspnam_r_proto" in
15525 case "$getspnam_r_proto" in
15526 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15527 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15529 case "$getspnam_r_proto" in
15530 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15531 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15533 case "$getspnam_r_proto" in
15534 ''|0) d_getspnam_r=undef
15536 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15537 * ) case "$getspnam_r_proto" in
15538 REENTRANT_PROTO*) ;;
15539 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15541 echo "Prototype: $try" ;;
15544 *) case "$usethreads" in
15545 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15552 *) getspnam_r_proto=0
15556 : see if gettimeofday or ftime exists
15557 set gettimeofday d_gettimeod
15559 case "$d_gettimeod" in
15565 val="$undef"; set d_ftime; eval $setvar
15568 case "$d_gettimeod$d_ftime" in
15571 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15575 : see if gmtime_r exists
15576 set gmtime_r d_gmtime_r
15578 case "$d_gmtime_r" in
15580 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15581 case "$d_gmtime_r_proto:$usethreads" in
15582 ":define") d_gmtime_r_proto=define
15583 set d_gmtime_r_proto gmtime_r $hdrs
15587 case "$d_gmtime_r_proto" in
15589 case "$gmtime_r_proto" in
15590 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15591 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15593 case "$gmtime_r_proto" in
15594 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15595 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15597 case "$gmtime_r_proto" in
15598 ''|0) d_gmtime_r=undef
15600 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15601 * ) case "$gmtime_r_proto" in
15602 REENTRANT_PROTO*) ;;
15603 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15605 echo "Prototype: $try" ;;
15608 *) case "$usethreads" in
15609 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15616 *) gmtime_r_proto=0
15620 : see if hasmntopt exists
15621 set hasmntopt d_hasmntopt
15624 : see if this is a netinet/in.h or sys/in.h system
15625 set netinet/in.h i_niin sys/in.h i_sysin
15628 : see if arpa/inet.h has to be included
15629 set arpa/inet.h i_arpainet
15632 : see if htonl --and friends-- exists
15637 : Maybe they are macros.
15640 $cat >htonl.c <<EOM
15642 #include <sys/types.h>
15643 #$i_niin I_NETINET_IN
15645 #$i_arpainet I_ARPA_INET
15646 #ifdef I_NETINET_IN
15647 #include <netinet/in.h>
15650 #include <sys/in.h>
15653 #include <arpa/inet.h>
15656 printf("Defined as a macro.");
15659 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15660 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15662 echo "But it seems to be defined as a macro." >&4
15670 : see if hypot exists
15674 : see if ilogb exists
15678 : see if ilogbl exists
15679 set ilogbl d_ilogbl
15684 if set index val -f; eval $csym; $val; then
15685 if set strchr val -f d_strchr; eval $csym; $val; then
15686 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15689 echo "strchr() found." >&4
15693 echo "index() found." >&4
15698 echo "index() found." >&4
15701 if set strchr val -f d_strchr; eval $csym; $val; then
15704 echo "strchr() found." >&4
15706 echo "No index() or strchr() found!" >&4
15711 set d_strchr; eval $setvar
15713 set d_index; eval $setvar
15715 : check whether inet_aton exists
15716 set inet_aton d_inetaton
15719 : see if inet_ntop exists
15720 set inet_ntop d_inetntop
15723 : see if inet_pton exists
15724 set inet_pton d_inetpton
15729 $cat >isascii.c <<EOCP
15732 #$i_stdlib I_STDLIB
15734 #include <stdlib.h>
15745 if eval $compile; then
15746 echo "isascii() found." >&4
15749 echo "isascii() NOT found." >&4
15758 $cat >isblank.c <<'EOCP'
15769 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15770 echo "isblank() found." >&4
15773 echo "isblank() NOT found." >&4
15780 : check for isfinite
15781 echo "Checking to see if you have isfinite..." >&4
15787 int main() { return isfinite(0.0); }
15790 if eval $compile; then
15792 echo "You have isfinite."
15795 echo "You do not have isfinite."
15801 : see if isfinitel exists
15802 set isfinitel d_isfinitel
15806 echo "Checking to see if you have isinf..." >&4
15812 int main() { return isinf(0.0); }
15815 if eval $compile; then
15817 echo "You have isinf."
15820 echo "You do not have isinf."
15826 : see if isinfl exists
15827 set isinfl d_isinfl
15831 echo "Checking to see if you have isless..." >&4
15837 int main() { return isless(0.0); }
15840 if eval $compile; then
15842 echo "You have isless."
15845 echo "You do not have isless."
15852 echo "Checking to see if you have isnan..." >&4
15858 int main() { return isnan(0.0); }
15861 if eval $compile; then
15863 echo "You have isnan."
15866 echo "You do not have isnan."
15872 : see if isnanl exists
15873 set isnanl d_isnanl
15876 : check for isnormal
15877 echo "Checking to see if you have isnormal..." >&4
15883 int main() { return isnormal(0.0); }
15886 if eval $compile; then
15888 echo "You have isnormal."
15891 echo "You do not have isnormal."
15901 : see if j0l exists
15905 : see if killpg exists
15906 set killpg d_killpg
15909 : see if localeconv exists
15910 set localeconv d_locconv
15913 : see if libc has the POSIX.1-2008 currency locale rules
15914 case "$d_locconv:$d_lc_monetary_2008" in
15917 #include <locale.h>
15919 struct lconv *lc = localeconv();
15920 char int_p_cs_precedes = lc->int_p_cs_precedes;
15925 if eval $compile; then
15926 d_lc_monetary_2008="$define"
15928 d_lc_monetary_2008="$undef"
15934 : see if lchown exists
15936 $cat > try.c <<'EOCP'
15937 /* System header to define __stub macros and hopefully few prototypes,
15938 which can conflict with char lchown(); below. */
15939 #include <assert.h>
15940 /* Override any gcc2 internal prototype to avoid an error. */
15941 /* We use char because int might match the return type of a gcc2
15942 builtin and then its argument prototype would still apply. */
15945 /* The GNU C library defines this for functions which it implements
15946 to always fail with ENOSYS. Some functions are actually named
15947 something starting with __ and the normal name is an alias. */
15948 #if defined (__stub_lchown) || defined (__stub___lchown)
15956 if eval $compile; then
15957 $echo "lchown() found." >&4
15960 $echo "lchown() NOT found." >&4
15966 : See if number of significant digits in a double precision number is known
15968 $cat >ldbl_dig.c <<EOM
15969 #$i_limits I_LIMITS
15972 #include <limits.h>
15978 printf("Contains LDBL_DIG");
15981 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15982 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15983 echo "LDBL_DIG found." >&4
15986 echo "LDBL_DIG NOT found." >&4
15993 : see if lgamma exists
15994 set lgamma d_lgamma
15997 : see if lgamma_r exists
15998 set lgamma_r d_lgamma_r
16001 : check to see if math.h defines _LIB_VERSION
16002 d_libm_lib_version="$undef"
16006 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16008 #include <unistd.h>
16010 int main (int argc, char *argv[])
16012 printf ("%d\n", _LIB_VERSION);
16017 if eval $compile; then
16019 echo "Yes, it does ($foo)" >&4
16020 d_libm_lib_version="$define"
16022 echo "No, it does not (probably harmless)" >&4
16029 : see if link exists
16033 : see if llrint exists
16034 set llrint d_llrint
16037 : see if llrintl exists
16038 set llrintl d_llrintl
16041 : see if llround exists
16042 set llround d_llround
16045 : see if llroundl exists
16046 set llroundl d_llroundl
16049 : see if localtime_r exists
16050 set localtime_r d_localtime_r
16052 case "$d_localtime_r" in
16054 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16055 case "$d_localtime_r_proto:$usethreads" in
16056 ":define") d_localtime_r_proto=define
16057 set d_localtime_r_proto localtime_r $hdrs
16061 case "$d_localtime_r_proto" in
16063 case "$localtime_r_proto" in
16064 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16065 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16067 case "$localtime_r_proto" in
16068 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16069 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16071 case "$localtime_r_proto" in
16072 ''|0) d_localtime_r=undef
16073 localtime_r_proto=0
16074 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16075 * ) case "$localtime_r_proto" in
16076 REENTRANT_PROTO*) ;;
16077 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16079 echo "Prototype: $try" ;;
16082 *) case "$usethreads" in
16083 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16085 d_localtime_r=undef
16086 localtime_r_proto=0
16090 *) localtime_r_proto=0
16094 : see if localtime_r calls tzset
16095 case "$localtime_r_proto" in
16098 /* Does our libc's localtime_r call tzset ?
16099 * return 0 if so, 1 otherwise.
16101 #$i_systypes I_SYS_TYPES
16102 #$i_unistd I_UNISTD
16104 #$i_stdlib I_STDLIB
16105 #$i_string I_STRING
16106 #$i_malloc I_MALLOC
16108 # include <sys/types.h>
16111 # include <unistd.h>
16117 #include <stdlib.h>
16120 # include <string.h>
16122 # include <strings.h>
16125 # include <malloc.h>
16129 time_t t = time(0L);
16130 char w_tz[]="TZ" "=GMT+5",
16131 e_tz[]="TZ" "=GMT-5",
16132 *tz_e = (char*)malloc(16),
16133 *tz_w = (char*)malloc(16);
16134 struct tm tm_e, tm_w;
16135 memset(&tm_e,'\0',sizeof(struct tm));
16136 memset(&tm_w,'\0',sizeof(struct tm));
16141 localtime_r(&t, &tm_e);
16144 localtime_r(&t, &tm_w);
16146 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16152 if eval $compile; then
16153 if $run ./try; then
16154 d_localtime_r_needs_tzset=undef;
16156 d_localtime_r_needs_tzset=define;
16159 d_localtime_r_needs_tzset=undef;
16163 d_localtime_r_needs_tzset=undef;
16168 : see if lockf exists
16172 : see if log1p exists
16176 : see if log2 exists
16180 : see if logb exists
16184 : see if lrint exists
16188 : see if lrintl exists
16189 set lrintl d_lrintl
16192 : see if lround exists
16193 set lround d_lround
16196 : see if lroundl exists
16197 set lroundl d_lroundl
16200 : see if prototype for lseek is available
16202 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16205 : see if lstat exists
16209 : see if madvise exists
16210 set madvise d_madvise
16213 : see if malloc_size exists
16214 set malloc_size d_malloc_size
16217 : see if malloc_size_good exists
16218 set malloc_good_size d_malloc_good_size
16221 : see if mblen exists
16225 : see if mbstowcs exists
16226 set mbstowcs d_mbstowcs
16229 : see if mbtowc exists
16230 set mbtowc d_mbtowc
16233 : see if memchr exists
16234 set memchr d_memchr
16237 : see if memcmp exists
16238 set memcmp d_memcmp
16241 : see if memcpy exists
16242 set memcpy d_memcpy
16245 : see if memmove exists
16246 set memmove d_memmove
16249 : see if memset exists
16250 set memset d_memset
16253 : see if mkdir exists
16257 : see if mkdtemp exists
16258 set mkdtemp d_mkdtemp
16261 : see if mkfifo exists
16262 set mkfifo d_mkfifo
16265 : see if mkstemp exists
16266 set mkstemp d_mkstemp
16269 : see if mkstemps exists
16270 set mkstemps d_mkstemps
16273 : see if mktime exists
16274 set mktime d_mktime
16277 : see if this is a sys/mman.h system
16278 set sys/mman.h i_sysmman
16281 : see if mmap exists
16284 : see what shmat returns
16285 : default to something harmless
16287 case "$i_sysmman$d_mmap" in
16289 $cat >mmap.c <<'END'
16290 #include <sys/mman.h>
16293 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16298 echo "and it returns ($mmaptype)." >&4
16304 : see if sqrtl exists
16308 : see if scalbnl exists
16309 set scalbnl d_scalbnl
16312 : see if truncl exists
16313 set truncl d_truncl
16316 : see if modfl exists
16320 : see if prototype for modfl is available
16322 set d_modflproto modfl $i_math math.h
16325 d_modfl_pow32_bug="$undef"
16327 case "$d_longdbl$d_modfl" in
16330 Checking to see whether your modfl() is okay for large values...
16336 if $test "X$d_modflproto" != "X$define"; then
16337 $cat >>try.c <<EOCP
16338 /* Sigh. many current glibcs provide the function, but do not prototype it. */
16339 long double modfl (long double, long double *);
16342 $cat >>try.c <<EOCP
16344 long double nv = 4294967303.15;
16350 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
16354 case "$osname:$gccversion" in
16355 aix:) saveccflags="$ccflags"
16356 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
16359 if eval $compile; then
16362 *" 4294967303.150000 1.150000 4294967302.000000")
16363 echo >&4 "Your modfl() is broken for large values."
16364 d_modfl_pow32_bug="$define"
16366 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
16370 *" 4294967303.150000 0.150000 4294967303.000000")
16371 echo >&4 "Your modfl() seems okay for large values."
16373 *) echo >&4 "I don't understand your modfl() at all."
16379 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
16382 case "$osname:$gccversion" in
16383 aix:) ccflags="$saveccflags" ;; # restore
16388 if $test "$uselongdouble" = "$define"; then
16390 if $test "$d_sqrtl" != "$define"; then
16391 message="$message sqrtl"
16393 if $test "$d_modfl" != "$define"; then
16394 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16395 echo "You have both truncl and copysignl, so I can emulate modfl."
16397 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16398 echo "You have both aintl and copysignl, so I can emulate modfl."
16400 message="$message modfl"
16404 if $test "$d_frexpl" != "$define"; then
16405 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16406 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16408 message="$message frexpl"
16411 if $test "$d_ldexpl" != "$define"; then
16412 message="$message ldexpl"
16415 if $test "$message" != ""; then
16418 *** You requested the use of long doubles but you do not seem to have
16419 *** the following mathematical functions needed for long double support:
16421 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16422 *** Cannot continue, aborting.
16430 : see if mprotect exists
16431 set mprotect d_mprotect
16434 : see if msgctl exists
16435 set msgctl d_msgctl
16438 : see if msgget exists
16439 set msgget d_msgget
16442 : see if msgsnd exists
16443 set msgsnd d_msgsnd
16446 : see if msgrcv exists
16447 set msgrcv d_msgrcv
16450 : see how much of the 'msg*(2)' library is present.
16453 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16454 *"$undef"*) h_msg=false;;
16458 case "`ipcs 2>&1`" in
16459 "SVID messages"*"not configured"*)
16460 echo "Your $osname does not have the msg*(2) configured." >&4
16463 set msgctl d_msgctl
16465 set msgget d_msgget
16467 set msgsnd d_msgsnd
16469 set msgrcv d_msgrcv
16475 : we could also check for sys/ipc.h ...
16476 if $h_msg && $test `./findhdr sys/msg.h`; then
16477 echo "You have the full msg*(2) library." >&4
16480 echo "You don't have the full msg*(2) library." >&4
16486 : Check for msghdr_s
16488 echo "Checking to see if your system supports struct msghdr..." >&4
16489 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16491 case "$d_msghdr_s" in
16492 "$define") echo "Yes, it does." ;;
16493 *) echo "No, it doesn't." ;;
16497 : see if msync exists
16501 : see if munmap exists
16502 set munmap d_munmap
16505 : see if nan exists
16509 : see if nearbyint exists
16510 set nearbyint d_nearbyint
16513 : see if nextafter exists
16514 set nextafter d_nextafter
16517 : see if nexttoward exists
16518 set nexttoward d_nexttoward
16521 : see if nice exists
16525 : see if this is a langinfo.h system
16526 set langinfo.h i_langinfo
16529 : see if nl_langinfo exists
16530 set nl_langinfo d_nl_langinfo
16533 : see if this is a quadmath.h system
16534 set quadmath.h i_quadmath
16537 : check for volatile keyword
16539 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16540 $cat >try.c <<'EOCP'
16543 typedef struct _goo_struct goo_struct;
16544 goo_struct * volatile goo = ((goo_struct *)0);
16545 struct _goo_struct {
16550 typedef unsigned short foo_t;
16551 char *volatile foo;
16553 volatile foo_t blech;
16557 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16559 echo "Yup, it does."
16562 echo "Nope, it doesn't."
16568 : Check basic sizes
16570 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16572 case "$use64bitint:$d_quad:$quadtype" in
16575 uvtype="$uquadtype"
16580 uvtype="unsigned long"
16586 case "$uselongdouble:$d_longdbl" in
16588 nvtype="long double"
16589 nvsize=$longdblsize
16596 case "$usequadmath:$i_quadmath" in
16598 nvtype="__float128"
16604 *** You requested the use of the quadmath library, but you
16605 *** do not seem to have the quadmath library installed.
16606 *** Cannot continue, aborting.
16612 define:*) $cat <<EOM >&4
16614 *** You requested the use of the quadmath library, but you
16615 *** do not seem to have the required header, <quadmath.h>.
16617 case "$gccversion" in
16620 *** Your gcc looks a bit old:
16626 *** You are not running a gcc.
16631 *** For the quadmath library you need at least gcc 4.6.
16632 *** Cannot continue, aborting.
16638 $echo "(IV will be "$ivtype", $ivsize bytes)"
16639 $echo "(UV will be "$uvtype", $uvsize bytes)"
16640 $echo "(NV will be "$nvtype", $nvsize bytes)"
16643 #$i_inttypes I_INTTYPES
16645 #include <inttypes.h>
16650 int8_t i = INT8_MAX;
16651 uint8_t u = UINT8_MAX;
16652 printf("int8_t\n");
16655 int16_t i = INT16_MAX;
16656 uint16_t u = UINT16_MAX;
16657 printf("int16_t\n");
16660 int32_t i = INT32_MAX;
16661 uint32_t u = UINT32_MAX;
16662 printf("int32_t\n");
16667 i8type="signed char"
16668 u8type="unsigned char"
16673 '') case "$shortsize" in
16675 u16type="unsigned short"
16683 '') set try -DINT16
16684 if eval $compile; then
16685 case "`$run ./try`" in
16697 '') if $test $shortsize -ge 2; then
16699 u16type="unsigned short"
16707 '') case "$longsize" in
16709 u32type="unsigned long"
16713 *) case "$intsize" in
16715 u32type="unsigned int"
16725 '') set try -DINT32
16726 if eval $compile; then
16727 case "`$run ./try`" in
16739 '') if $test $intsize -ge 4; then
16741 u32type="unsigned int"
16749 '') case "$d_quad:$quadtype" in
16751 i64type="$quadtype"
16752 u64type="$uquadtype"
16760 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16761 : volatile so that the compiler has to store it out to memory.
16762 if test X"$d_volatile" = X"$define"; then
16767 #$i_stdlib I_STDLIB
16769 #include <stdlib.h>
16771 #include <sys/types.h>
16772 #include <signal.h>
16774 $volatile int bletched = 0;
16775 $signal_t blech(int s) { bletched = 1; }
16780 int n = 8 * $uvsize;
16783 signal(SIGFPE, blech);
16786 for (i = 0; i < n; i++) {
16787 u = u << 1 | ($uvtype)1;
16789 if (($uvtype)d != u)
16793 d = ($nvtype)(u - 1);
16794 if (($uvtype)d != (u - 1))
16801 printf("%d\n", ((i == n) ? -n : i));
16807 d_nv_preserves_uv="$undef"
16808 if eval $compile; then
16809 nv_preserves_uv_bits="`$run ./try`"
16811 case "$nv_preserves_uv_bits" in
16813 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16814 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16815 d_nv_preserves_uv="$define"
16817 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16818 d_nv_preserves_uv="$undef" ;;
16819 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16820 nv_preserves_uv_bits="0" ;;
16824 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16825 : volatile so that the compiler has to store it out to memory.
16826 if test X"$d_volatile" = X"$define"; then
16832 typedef $nvtype NV;
16839 while(count < 256) {
16840 $volatile NV up = value + 1.0;
16841 $volatile NV negated = -value;
16842 $volatile NV down = negated - 1.0;
16843 $volatile NV got_up = up - value;
16844 int up_good = got_up == 1.0;
16845 int got_down = down - negated;
16846 int down_good = got_down == -1.0;
16848 if (down_good != up_good) {
16850 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16851 up_good, (double) got_up, down_good, (double) got_down,
16852 count, (double) value);
16859 fputs("256.0", stdout);
16862 fputs("2.0", stdout);
16868 fputs("*", stdout);
16874 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16875 count, (double) value);
16881 nv_overflows_integers_at='0'
16882 if eval $compile; then
16888 The largest integer your NVs can preserve is equal to $xxx
16890 nv_overflows_integers_at="$xxx"
16893 Cannot determine the largest integer value your NVs can hold, unexpected output
16900 Cannot determine the largest integer value your NVs can hold
16907 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16908 : volatile so that the compiler has to store it out to memory.
16909 if test X"$d_volatile" = X"$define"; then
16914 #$i_stdlib I_STDLIB
16916 #include <stdlib.h>
16918 #$i_string I_STRING
16920 # include <string.h>
16922 # include <strings.h>
16924 #include <sys/types.h>
16925 #include <signal.h>
16927 $volatile int bletched = 0;
16928 $signal_t blech(int s) { bletched = 1; }
16931 int checkit($nvtype d, char *where) {
16932 unsigned char *p = (char *)&d;
16933 unsigned char *end = p + sizeof(d);
16943 printf("No - %s: 0x", where);
16945 printf ("%02X", *p++);
16950 int main(int argc, char **argv) {
16953 fail += checkit(d, "0.0");
16955 /* The compiler shouldn't be assuming that bletched is 0 */
16958 fail += checkit(d, "bleched");
16961 signal(SIGFPE, blech);
16964 /* Paranoia - the compiler should have no way of knowing that ANSI says
16965 that argv[argc] will always be NULL. Actually, if it did assume this it
16966 would be buggy, as this is C and main() can be called from elsewhere in
16968 d = argv[argc] ? 1 : 0;
16971 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16974 fail += checkit(d, "ternary");
16976 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16979 printf("No - memset doesn't give 0.0\n");
16980 /* This might just blow up: */
16981 printf("(gives %g)\n", d);
16987 printf("No - something bleched\n");
16992 printf("No - %d fail(s)\n", fail);
17001 d_nv_zero_is_allbits_zero="$undef"
17002 if eval $compile; then
17008 0.0 is represented as all bits zero in memory
17010 d_nv_zero_is_allbits_zero="$define"
17013 0.0 is not represented as all bits zero in memory
17015 d_nv_zero_is_allbits_zero="$undef"
17020 0.0 is not represented as all bits zero in memory
17022 d_nv_zero_is_allbits_zero="$undef"
17028 : check for off64_t
17030 echo "Checking to see if you have off64_t..." >&4
17032 #include <sys/types.h>
17033 #include <unistd.h>
17034 int main() { off64_t x = 7; }
17037 if eval $compile; then
17039 echo "You have off64_t."
17042 echo "You do not have off64_t."
17043 case "$lseeksize" in
17044 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17051 : how to create joinable pthreads
17052 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17054 echo "Checking what constant to use for creating joinable pthreads..." >&4
17055 $cat >try.c <<'EOCP'
17056 #include <pthread.h>
17058 int detachstate = JOINABLE;
17061 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17062 if eval $compile; then
17063 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17064 val="$undef" # Yes, undef.
17065 set d_old_pthread_create_joinable
17068 set old_pthread_create_joinable
17071 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17072 if eval $compile; then
17073 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17075 set d_old_pthread_create_joinable
17077 val=PTHREAD_CREATE_UNDETACHED
17078 set old_pthread_create_joinable
17081 set try -DJOINABLE=__UNDETACHED
17082 if eval $compile; then
17083 echo "You seem to use __UNDETACHED." >&4
17085 set d_old_pthread_create_joinable
17088 set old_pthread_create_joinable
17091 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17093 set d_old_pthread_create_joinable
17096 set old_pthread_create_joinable
17103 d_old_pthread_create_joinable="$undef"
17104 old_pthread_create_joinable=""
17107 : see if pause exists
17111 : see if poll exists
17115 : see if prctl exists
17119 : see if prctl supports PR_SET_NAME
17120 d_prctl_set_name=$undef
17125 #include <unistd.h>
17127 #include <sys/prctl.h>
17129 int main (int argc, char *argv[])
17131 return (prctl (PR_SET_NAME, "Test"));
17135 if eval $compile_ok && $run ./try; then
17136 echo "Your prctl (PR_SET_NAME, ...) works"
17137 d_prctl_set_name=$define
17143 : see if readlink exists
17144 set readlink d_readlink
17147 : Check if exe is symlink to abs path of executing program
17151 case "$d_readlink" in
17153 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
17154 : more tidy to avoid an extra level of symlink
17155 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17156 while test $# -gt 0; do
17159 if $issymlink $try; then
17160 $ls -l $try > reflect
17161 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17162 echo "You have $type-like $try."
17163 procselfexe='"'$try'"'
17165 : This will break out of the loop
17176 : backward compatibility for d_hvfork
17177 if test X$d_hvfork != X; then
17178 d_vfork="$d_hvfork"
17181 : see if there is a vfork
17186 d_pseudofork=$undef
17188 : Ok, but do we want to use it. vfork is reportedly unreliable in
17189 : perl on Solaris 2.x, and probably elsewhere.
17193 case "$usevfork" in
17199 Perl can only use a vfork() that doesn't suffer from strict
17200 restrictions on calling functions or modifying global data in
17201 the child. For example, glibc-2.1 contains such a vfork()
17202 that is unsuitable. If your system provides a proper fork()
17203 call, chances are that you do NOT want perl to use vfork().
17206 rp="Do you still want to use vfork()?"
17211 echo "Ok, we won't use vfork()."
17220 $define) usevfork='true';;
17221 *) usevfork='false';;
17224 : see whether the pthread_atfork exists
17226 #include <pthread.h>
17229 #ifdef PTHREAD_ATFORK
17230 pthread_atfork(NULL,NULL,NULL);
17235 : see if pthread_atfork exists
17236 set try -DPTHREAD_ATFORK
17237 if eval $compile; then
17242 case "$usethreads" in
17245 $define) echo 'pthread_atfork found.' >&4 ;;
17246 *) echo 'pthread_atfork NOT found.' >&4 ;;
17249 set d_pthread_atfork
17252 : see if pthread_attr_setscope exists
17253 set pthread_attr_setscope d_pthread_attr_setscope
17256 : see whether the various POSIXish _yields exist
17258 #include <pthread.h>
17264 #ifdef PTHREAD_YIELD
17267 #ifdef PTHREAD_YIELD_NULL
17268 pthread_yield(NULL);
17274 : see if sched_yield exists
17275 set try -DSCHED_YIELD
17276 if eval $compile; then
17278 sched_yield='sched_yield()'
17282 case "$usethreads" in
17285 $define) echo 'sched_yield() found.' >&4 ;;
17286 *) echo 'sched_yield() NOT found.' >&4 ;;
17292 : see if pthread_yield exists
17293 set try -DPTHREAD_YIELD
17294 if eval $compile; then
17296 case "$sched_yield" in
17297 '') sched_yield='pthread_yield()' ;;
17300 set try -DPTHREAD_YIELD_NULL
17301 if eval $compile; then
17303 case "$sched_yield" in
17304 '') sched_yield='pthread_yield(NULL)' ;;
17310 case "$usethreads" in
17313 $define) echo 'pthread_yield() found.' >&4 ;;
17314 *) echo 'pthread_yield() NOT found.' >&4 ;;
17318 set d_pthread_yield
17320 case "$sched_yield" in
17321 '') sched_yield=undef ;;
17325 : check for ptrdiff_t
17327 echo "Checking to see if you have ptrdiff_t..." >&4
17329 #include <stddef.h>
17330 int main() { ptrdiff_t x = 7; }
17333 if eval $compile; then
17335 echo "You have ptrdiff_t."
17338 echo "You do not have ptrdiff_t."
17344 : see if random_r exists
17345 set random_r d_random_r
17347 case "$d_random_r" in
17349 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17350 case "$d_random_r_proto:$usethreads" in
17351 ":define") d_random_r_proto=define
17352 set d_random_r_proto random_r $hdrs
17356 case "$d_random_r_proto" in
17358 case "$random_r_proto" in
17359 ''|0) try='int random_r(int*, struct random_data*);'
17360 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17362 case "$random_r_proto" in
17363 ''|0) try='int random_r(long*, struct random_data*);'
17364 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17366 case "$random_r_proto" in
17367 ''|0) try='int random_r(struct random_data*, int32_t*);'
17368 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17370 case "$random_r_proto" in
17371 ''|0) d_random_r=undef
17373 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17374 * ) case "$random_r_proto" in
17375 REENTRANT_PROTO*) ;;
17376 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17378 echo "Prototype: $try" ;;
17381 *) case "$usethreads" in
17382 define) echo "random_r has no prototype, not using it." >&4 ;;
17389 *) random_r_proto=0
17393 : see if readdir and friends exist
17394 set readdir d_readdir
17396 set seekdir d_seekdir
17398 set telldir d_telldir
17400 set rewinddir d_rewinddir
17403 : see if readdir64_r exists
17404 set readdir64_r d_readdir64_r
17406 case "$d_readdir64_r" in
17408 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17409 case "$d_readdir64_r_proto:$usethreads" in
17410 ":define") d_readdir64_r_proto=define
17411 set d_readdir64_r_proto readdir64_r $hdrs
17415 case "$d_readdir64_r_proto" in
17417 case "$readdir64_r_proto" in
17418 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17419 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17421 case "$readdir64_r_proto" in
17422 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17423 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17425 case "$readdir64_r_proto" in
17426 ''|0) d_readdir64_r=undef
17427 readdir64_r_proto=0
17428 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17429 * ) case "$readdir64_r_proto" in
17430 REENTRANT_PROTO*) ;;
17431 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17433 echo "Prototype: $try" ;;
17436 *) case "$usethreads" in
17437 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17439 d_readdir64_r=undef
17440 readdir64_r_proto=0
17444 *) readdir64_r_proto=0
17448 : see if readdir_r exists
17449 set readdir_r d_readdir_r
17451 case "$d_readdir_r" in
17453 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17454 case "$d_readdir_r_proto:$usethreads" in
17455 ":define") d_readdir_r_proto=define
17456 set d_readdir_r_proto readdir_r $hdrs
17460 case "$d_readdir_r_proto" in
17462 case "$readdir_r_proto" in
17463 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17464 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17466 case "$readdir_r_proto" in
17467 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17468 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17470 case "$readdir_r_proto" in
17471 ''|0) d_readdir_r=undef
17473 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17474 * ) case "$readdir_r_proto" in
17475 REENTRANT_PROTO*) ;;
17476 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17478 echo "Prototype: $try" ;;
17481 *) case "$usethreads" in
17482 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17489 *) readdir_r_proto=0
17493 : see if readv exists
17497 : see if recvmsg exists
17498 set recvmsg d_recvmsg
17501 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17503 if set regcomp val -f d_regcomp; eval $csym; $val; then
17504 echo 'regcomp() found.' >&4
17505 d_regcomp="$define"
17508 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17509 echo 'regcmp() found.' >&4
17513 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17514 echo 're_comp() found, assuming re_exec() also exists.' >&4
17515 d_re_comp="$define"
17520 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17527 : see if remainder exists
17528 set remainder d_remainder
17531 : see if remquo exists
17532 set remquo d_remquo
17535 : see if rename exists
17536 set rename d_rename
17539 : see if rint exists
17543 : see if rmdir exists
17547 : see if round exists
17551 : see if memory.h is available.
17556 : See if it conflicts with string.h
17562 $cppstdin $cppflags $cppminus < $strings > mem.h
17563 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17565 echo "We won't be including <memory.h>."
17575 : can bcopy handle overlapping blocks?
17578 case "$d_memmove" in
17579 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17580 *) case "$d_bcopy" in
17582 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17584 #$i_memory I_MEMORY
17585 #$i_stdlib I_STDLIB
17586 #$i_string I_STRING
17587 #$i_unistd I_UNISTD
17589 $cat >>try.c <<'EOCP'
17592 # include <memory.h>
17595 # include <stdlib.h>
17598 # include <string.h>
17600 # include <strings.h>
17603 # include <unistd.h> /* Needed for NetBSD */
17607 char buf[128], abc[128];
17613 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17614 try to store the string in read-only memory. */
17615 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17617 for (align = 7; align >= 0; align--) {
17618 for (len = 36; len; len--) {
17620 bcopy(abc, b, len);
17621 for (off = 1; off <= len; off++) {
17622 bcopy(b, b+off, len);
17623 bcopy(b+off, b, len);
17624 if (bcmp(b, abc, len))
17633 if eval $compile_ok; then
17634 if $run ./try 2>/dev/null; then
17635 echo "Yes, it can."
17638 echo "It can't, sorry."
17641 echo "(I can't compile the test program, so we'll assume not...)"
17651 : can memcpy handle overlapping blocks?
17654 case "$d_memmove" in
17655 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17656 *) case "$d_memcpy" in
17658 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17660 #$i_memory I_MEMORY
17661 #$i_stdlib I_STDLIB
17662 #$i_string I_STRING
17663 #$i_unistd I_UNISTD
17665 $cat >>try.c <<'EOCP'
17668 # include <memory.h>
17671 # include <stdlib.h>
17674 # include <string.h>
17676 # include <strings.h>
17679 # include <unistd.h> /* Needed for NetBSD */
17683 char buf[128], abc[128];
17689 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17690 try to store the string in read-only memory. */
17691 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17693 for (align = 7; align >= 0; align--) {
17694 for (len = 36; len; len--) {
17696 memcpy(b, abc, len);
17697 for (off = 1; off <= len; off++) {
17698 memcpy(b+off, b, len);
17699 memcpy(b, b+off, len);
17700 if (memcmp(b, abc, len))
17709 if eval $compile_ok; then
17710 if $run ./try 2>/dev/null; then
17711 echo "Yes, it can."
17714 echo "It can't, sorry."
17717 echo "(I can't compile the test program, so we'll assume not...)"
17727 : can memcmp be trusted to compare relative magnitude?
17729 case "$d_memcmp" in
17732 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17734 #$i_memory I_MEMORY
17735 #$i_stdlib I_STDLIB
17736 #$i_string I_STRING
17737 #$i_unistd I_UNISTD
17739 $cat >>try.c <<'EOCP'
17742 # include <memory.h>
17745 # include <stdlib.h>
17748 # include <string.h>
17750 # include <strings.h>
17753 # include <unistd.h> /* Needed for NetBSD */
17759 if ((a < b) && memcmp(&a, &b, 1) < 0)
17765 if eval $compile_ok; then
17766 if $run ./try 2>/dev/null; then
17767 echo "Yes, it can."
17770 echo "No, it can't (it uses signed chars)."
17773 echo "(I can't compile the test program, so we'll assume not...)"
17781 : see if prototype for sbrk is available
17783 set d_sbrkproto sbrk $i_unistd unistd.h
17786 : see if scalbn exists
17787 set scalbn d_scalbn
17790 : see if select exists
17791 set select d_select
17794 : see if semctl exists
17795 set semctl d_semctl
17798 : see if semget exists
17799 set semget d_semget
17802 : see if semop exists
17806 : see how much of the 'sem*(2)' library is present.
17809 case "$d_semctl$d_semget$d_semop" in
17810 *"$undef"*) h_sem=false;;
17814 case "`ipcs 2>&1`" in
17815 "SVID messages"*"not configured"*)
17816 echo "Your $osname does not have the sem*(2) configured." >&4
17819 set semctl d_semctl
17821 set semget d_semget
17829 : we could also check for sys/ipc.h ...
17830 if $h_sem && $test `./findhdr sys/sem.h`; then
17831 echo "You have the full sem*(2) library." >&4
17834 echo "You don't have the full sem*(2) library." >&4
17840 : see whether sys/sem.h defines union semun
17842 $cat > try.c <<'END'
17843 #include <sys/types.h>
17844 #include <sys/ipc.h>
17845 #include <sys/sem.h>
17846 int main () { union semun semun; semun.buf = 0; }
17849 if eval $compile; then
17850 echo "You have union semun in <sys/sem.h>." >&4
17853 echo "You do not have union semun in <sys/sem.h>." >&4
17860 : see how to do semctl IPC_STAT
17864 $cat > tryh.h <<END
17867 # define S_IRUSR S_IREAD
17868 # define S_IWUSR S_IWRITE
17869 # define S_IXUSR S_IEXEC
17871 # define S_IRUSR 0400
17872 # define S_IWUSR 0200
17873 # define S_IXUSR 0100
17875 # define S_IRGRP (S_IRUSR>>3)
17876 # define S_IWGRP (S_IWUSR>>3)
17877 # define S_IXGRP (S_IXUSR>>3)
17878 # define S_IROTH (S_IRUSR>>6)
17879 # define S_IWOTH (S_IWUSR>>6)
17880 # define S_IXOTH (S_IXUSR>>6)
17883 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17884 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17885 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17888 : see whether semctl IPC_STAT can use union semun
17889 case "$d_semctl_semun" in
17893 #include <sys/types.h>
17894 #include <sys/ipc.h>
17895 #include <sys/sem.h>
17896 #include <sys/stat.h>
17903 #$d_union_semun HAS_UNION_SEMUN
17906 #ifndef HAS_UNION_SEMUN
17909 struct semid_ds *buf;
17910 unsigned short *array;
17916 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17917 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17919 struct semid_ds argbuf;
17922 st = semctl(sem, 0, IPC_STAT, arg);
17926 # endif /* IPC_STAT */
17927 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17929 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17930 # endif /* IPC_RMID */
17931 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17933 #endif /* IPC_PRIVATE && ... */
17934 printf("semget failed: errno = %d\n", errno);
17939 if eval $compile; then
17942 semun) val="$define" ;;
17950 case "$d_semctl_semun" in
17952 echo "You can use union semun for semctl IPC_STAT." >&4
17955 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17960 : see whether semctl IPC_STAT can use struct semid_ds pointer
17961 case "$d_semctl_semid_ds" in
17964 $cat > try.c <<'END'
17965 #include <sys/types.h>
17966 #include <sys/ipc.h>
17967 #include <sys/sem.h>
17968 #include <sys/stat.h>
17976 struct semid_ds arg;
17979 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17980 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17983 st = semctl(sem, 0, IPC_STAT, &arg);
17985 printf("semid_ds\n");
17987 # endif /* IPC_STAT */
17988 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17990 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17991 # endif /* IPC_RMID */
17992 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17994 #endif /* IPC_PRIVATE && ... */
17995 printf("semget failed: errno = %d\n", errno);
18001 if eval $compile; then
18004 semid_ds) val="$define" ;;
18008 set d_semctl_semid_ds
18012 case "$d_semctl_semid_ds" in
18014 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18016 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18022 # We do not have the full sem*(2) library, so assume we can not
18028 set d_semctl_semid_ds
18034 : see if sendmsg exists
18035 set sendmsg d_sendmsg
18038 : see if setegid exists
18039 set setegid d_setegid
18042 : see if seteuid exists
18043 set seteuid d_seteuid
18046 : see if setgrent exists
18047 set setgrent d_setgrent
18050 : see if setgrent_r exists
18051 set setgrent_r d_setgrent_r
18053 case "$d_setgrent_r" in
18055 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18056 case "$d_setgrent_r_proto:$usethreads" in
18057 ":define") d_setgrent_r_proto=define
18058 set d_setgrent_r_proto setgrent_r $hdrs
18062 case "$d_setgrent_r_proto" in
18064 case "$setgrent_r_proto" in
18065 ''|0) try='int setgrent_r(FILE**);'
18066 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18068 case "$setgrent_r_proto" in
18069 ''|0) try='void setgrent_r(FILE**);'
18070 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18072 case "$setgrent_r_proto" in
18073 ''|0) d_setgrent_r=undef
18075 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18076 * ) case "$setgrent_r_proto" in
18077 REENTRANT_PROTO*) ;;
18078 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18080 echo "Prototype: $try" ;;
18083 *) case "$usethreads" in
18084 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18091 *) setgrent_r_proto=0
18095 : see if sethostent exists
18096 set sethostent d_sethent
18099 : see if sethostent_r exists
18100 set sethostent_r d_sethostent_r
18102 case "$d_sethostent_r" in
18104 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18105 case "$d_sethostent_r_proto:$usethreads" in
18106 ":define") d_sethostent_r_proto=define
18107 set d_sethostent_r_proto sethostent_r $hdrs
18111 case "$d_sethostent_r_proto" in
18113 case "$sethostent_r_proto" in
18114 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18115 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18117 case "$sethostent_r_proto" in
18118 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18119 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18121 case "$sethostent_r_proto" in
18122 ''|0) d_sethostent_r=undef
18123 sethostent_r_proto=0
18124 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18125 * ) case "$sethostent_r_proto" in
18126 REENTRANT_PROTO*) ;;
18127 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18129 echo "Prototype: $try" ;;
18132 *) case "$usethreads" in
18133 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18135 d_sethostent_r=undef
18136 sethostent_r_proto=0
18140 *) sethostent_r_proto=0
18144 : see if setitimer exists
18145 set setitimer d_setitimer
18148 : see if setlinebuf exists
18149 set setlinebuf d_setlinebuf
18152 : see if setlocale exists
18153 set setlocale d_setlocale
18156 : see if locale.h is available
18157 set locale.h i_locale
18160 : see if setlocale_r exists
18161 set setlocale_r d_setlocale_r
18163 case "$d_setlocale_r" in
18165 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18166 case "$d_setlocale_r_proto:$usethreads" in
18167 ":define") d_setlocale_r_proto=define
18168 set d_setlocale_r_proto setlocale_r $hdrs
18172 case "$d_setlocale_r_proto" in
18174 case "$setlocale_r_proto" in
18175 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18176 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18178 case "$setlocale_r_proto" in
18179 ''|0) d_setlocale_r=undef
18180 setlocale_r_proto=0
18181 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18182 * ) case "$setlocale_r_proto" in
18183 REENTRANT_PROTO*) ;;
18184 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18186 echo "Prototype: $try" ;;
18189 *) case "$usethreads" in
18190 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18192 d_setlocale_r=undef
18193 setlocale_r_proto=0
18197 *) setlocale_r_proto=0
18201 : see if setnetent exists
18202 set setnetent d_setnent
18205 : see if setnetent_r exists
18206 set setnetent_r d_setnetent_r
18208 case "$d_setnetent_r" in
18210 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18211 case "$d_setnetent_r_proto:$usethreads" in
18212 ":define") d_setnetent_r_proto=define
18213 set d_setnetent_r_proto setnetent_r $hdrs
18217 case "$d_setnetent_r_proto" in
18219 case "$setnetent_r_proto" in
18220 ''|0) try='int setnetent_r(int, struct netent_data*);'
18221 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18223 case "$setnetent_r_proto" in
18224 ''|0) try='void setnetent_r(int, struct netent_data*);'
18225 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18227 case "$setnetent_r_proto" in
18228 ''|0) d_setnetent_r=undef
18229 setnetent_r_proto=0
18230 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18231 * ) case "$setnetent_r_proto" in
18232 REENTRANT_PROTO*) ;;
18233 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18235 echo "Prototype: $try" ;;
18238 *) case "$usethreads" in
18239 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18241 d_setnetent_r=undef
18242 setnetent_r_proto=0
18246 *) setnetent_r_proto=0
18250 : see if setprotoent exists
18251 set setprotoent d_setpent
18254 : see if setpgid exists
18255 set setpgid d_setpgid
18258 : see if setpgrp2 exists
18259 set setpgrp2 d_setpgrp2
18262 : see if setpriority exists
18263 set setpriority d_setprior
18266 : see if setproctitle exists
18267 set setproctitle d_setproctitle
18270 : see if setprotoent_r exists
18271 set setprotoent_r d_setprotoent_r
18273 case "$d_setprotoent_r" in
18275 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18276 case "$d_setprotoent_r_proto:$usethreads" in
18277 ":define") d_setprotoent_r_proto=define
18278 set d_setprotoent_r_proto setprotoent_r $hdrs
18282 case "$d_setprotoent_r_proto" in
18284 case "$setprotoent_r_proto" in
18285 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18286 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18288 case "$setprotoent_r_proto" in
18289 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18290 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18292 case "$setprotoent_r_proto" in
18293 ''|0) d_setprotoent_r=undef
18294 setprotoent_r_proto=0
18295 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18296 * ) case "$setprotoent_r_proto" in
18297 REENTRANT_PROTO*) ;;
18298 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18300 echo "Prototype: $try" ;;
18303 *) case "$usethreads" in
18304 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18306 d_setprotoent_r=undef
18307 setprotoent_r_proto=0
18311 *) setprotoent_r_proto=0
18315 : see if setpwent exists
18316 set setpwent d_setpwent
18319 : see if setpwent_r exists
18320 set setpwent_r d_setpwent_r
18322 case "$d_setpwent_r" in
18324 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18325 case "$d_setpwent_r_proto:$usethreads" in
18326 ":define") d_setpwent_r_proto=define
18327 set d_setpwent_r_proto setpwent_r $hdrs
18331 case "$d_setpwent_r_proto" in
18333 case "$setpwent_r_proto" in
18334 ''|0) try='int setpwent_r(FILE**);'
18335 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18337 case "$setpwent_r_proto" in
18338 ''|0) try='void setpwent_r(FILE**);'
18339 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18341 case "$setpwent_r_proto" in
18342 ''|0) d_setpwent_r=undef
18344 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18345 * ) case "$setpwent_r_proto" in
18346 REENTRANT_PROTO*) ;;
18347 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18349 echo "Prototype: $try" ;;
18352 *) case "$usethreads" in
18353 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18360 *) setpwent_r_proto=0
18364 : see if setregid exists
18365 set setregid d_setregid
18367 set setresgid d_setresgid
18370 : see if setreuid exists
18371 set setreuid d_setreuid
18373 set setresuid d_setresuid
18376 : see if setrgid exists
18377 set setrgid d_setrgid
18380 : see if setruid exists
18381 set setruid d_setruid
18384 : see if setservent exists
18385 set setservent d_setsent
18388 : see if setservent_r exists
18389 set setservent_r d_setservent_r
18391 case "$d_setservent_r" in
18393 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18394 case "$d_setservent_r_proto:$usethreads" in
18395 ":define") d_setservent_r_proto=define
18396 set d_setservent_r_proto setservent_r $hdrs
18400 case "$d_setservent_r_proto" in
18402 case "$setservent_r_proto" in
18403 ''|0) try='int setservent_r(int, struct servent_data*);'
18404 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18406 case "$setservent_r_proto" in
18407 ''|0) try='void setservent_r(int, struct servent_data*);'
18408 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18410 case "$setservent_r_proto" in
18411 ''|0) d_setservent_r=undef
18412 setservent_r_proto=0
18413 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18414 * ) case "$setservent_r_proto" in
18415 REENTRANT_PROTO*) ;;
18416 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18418 echo "Prototype: $try" ;;
18421 *) case "$usethreads" in
18422 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18424 d_setservent_r=undef
18425 setservent_r_proto=0
18429 *) setservent_r_proto=0
18433 : see if setsid exists
18434 set setsid d_setsid
18437 : see if setvbuf exists
18438 set setvbuf d_setvbuf
18441 : see if shmctl exists
18442 set shmctl d_shmctl
18445 : see if shmget exists
18446 set shmget d_shmget
18449 : see if shmat exists
18452 : see what shmat returns
18455 $cat >shmat.c <<'END'
18456 #include <sys/shm.h>
18459 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18464 echo "and it returns ($shmattype)." >&4
18465 : see if a prototype for shmat is available
18466 xxx=`./findhdr sys/shm.h`
18467 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18468 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18479 set d_shmatprototype
18482 : see if shmdt exists
18486 : see how much of the 'shm*(2)' library is present.
18489 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18490 *"$undef"*) h_shm=false;;
18494 case "`ipcs 2>&1`" in
18495 "SVID shared memory"*"not configured"*)
18496 echo "Your $osname does not have the shm*(2) configured." >&4
18499 set shmctl d_shmctl
18501 set shmget d_shmget
18511 : we could also check for sys/ipc.h ...
18512 if $h_shm && $test `./findhdr sys/shm.h`; then
18513 echo "You have the full shm*(2) library." >&4
18516 echo "You don't have the full shm*(2) library." >&4
18522 : see if we have sigaction
18524 if set sigaction val -f d_sigaction; eval $csym; $val; then
18525 echo 'sigaction() found.' >&4
18528 #include <sys/types.h>
18529 #include <signal.h>
18530 #$i_stdlib I_STDLIB
18532 #include <stdlib.h>
18536 struct sigaction act, oact;
18538 oact.sa_handler = 0;
18539 /* so that act and oact are used */
18540 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18544 if eval $compile_ok; then
18547 echo "But you don't seem to have a usable struct sigaction." >&4
18551 echo 'sigaction NOT found.' >&4
18554 set d_sigaction; eval $setvar
18557 : see if this is a sunmath.h system
18558 set sunmath.h i_sunmath
18561 : see if signbit exists
18562 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18565 #$i_sunmath I_SUNMATH
18569 #ifdef I_SUNMATH /* Solaris special math library */
18570 # include <sunmath.h>
18573 int main(int argc, char **argv)
18577 if ((signbit(x) == 0) && (signbit(y) != 0))
18585 if eval $compile; then
18586 if $run ./try; then
18590 $echo "Signbit seems to be available, but doesn't work as I expected."
18591 $echo "I won't use it." >&4
18602 : see if sigprocmask exists
18603 set sigprocmask d_sigprocmask
18606 : see if sigsetjmp exists
18608 case "$d_sigsetjmp" in
18611 #include <setjmp.h>
18612 #$i_stdlib I_STDLIB
18614 #include <stdlib.h>
18620 if (sigsetjmp(env,1))
18623 siglongjmp(env, 1);
18628 if eval $compile; then
18629 if $run ./try >/dev/null 2>&1; then
18630 echo "POSIX sigsetjmp found." >&4
18634 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18640 echo "sigsetjmp not found." >&4
18644 *) val="$d_sigsetjmp"
18645 case "$d_sigsetjmp" in
18646 $define) echo "POSIX sigsetjmp found." >&4;;
18647 $undef) echo "sigsetjmp not found." >&4;;
18655 : see if snprintf exists
18656 set snprintf d_snprintf
18659 : see if vsnprintf exists
18660 set vsnprintf d_vsnprintf
18663 case "$d_snprintf-$d_vsnprintf" in
18666 Checking whether your snprintf() and vsnprintf() work okay...
18668 $cat >try.c <<'EOCP'
18669 /* v?snprintf testing logic courtesy of Russ Allbery.
18670 * According to C99:
18671 * - if the buffer is too short it still must be \0-terminated
18672 * - if the buffer is too short the potentially required length
18673 * must be returned and not -1
18674 * - if the buffer is NULL the potentially required length
18675 * must be returned and not -1 or core dump
18678 #include <stdarg.h>
18682 int test (char *format, ...)
18687 va_start (args, format);
18688 count = vsnprintf (buf, sizeof buf, format, args);
18695 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18696 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18700 if eval $compile; then
18703 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18705 Your snprintf() and snprintf() don't seem to be working okay.
18707 d_snprintf="$undef"
18708 d_vsnprintf="$undef"
18712 echo "(I can't seem to compile the test program--assuming they don't)"
18713 d_snprintf="$undef"
18714 d_vsnprintf="$undef"
18720 : see if sockatmark exists
18721 set sockatmark d_sockatmark
18724 : see if prototype for sockatmark is available
18726 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18729 : see if socks5_init exists
18730 set socks5_init d_socks5_init
18733 : see if sprintf returns the length of the string in the buffer as per ANSI
18734 $echo "Checking whether sprintf returns the length of the string..." >&4
18737 #$i_stdlib I_STDLIB
18739 #include <stdlib.h>
18741 #$i_string I_STRING
18743 # include <string.h>
18745 # include <strings.h>
18754 int check (size_t expect, int test) {
18755 size_t got = strlen(buffer);
18759 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18764 int main(int argc, char **argv) {
18767 check(sprintf(buffer, ""), ++test);
18768 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18769 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18776 if eval $compile; then
18780 sprintf returns the length of the string (as ANSI says it should)
18782 d_sprintf_returns_strlen="$define"
18785 sprintf does not return the length of the string (how old is this system?)
18787 d_sprintf_returns_strlen="$undef"
18791 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18792 d_sprintf_returns_strlen="$undef"
18796 : see if srand48_r exists
18797 set srand48_r d_srand48_r
18799 case "$d_srand48_r" in
18801 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18802 case "$d_srand48_r_proto:$usethreads" in
18803 ":define") d_srand48_r_proto=define
18804 set d_srand48_r_proto srand48_r $hdrs
18808 case "$d_srand48_r_proto" in
18810 case "$srand48_r_proto" in
18811 ''|0) try='int srand48_r(long, struct drand48_data*);'
18812 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18814 case "$srand48_r_proto" in
18815 ''|0) d_srand48_r=undef
18817 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18818 * ) case "$srand48_r_proto" in
18819 REENTRANT_PROTO*) ;;
18820 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18822 echo "Prototype: $try" ;;
18825 *) case "$usethreads" in
18826 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18833 *) srand48_r_proto=0
18837 : see if srandom_r exists
18838 set srandom_r d_srandom_r
18840 case "$d_srandom_r" in
18842 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18843 case "$d_srandom_r_proto:$usethreads" in
18844 ":define") d_srandom_r_proto=define
18845 set d_srandom_r_proto srandom_r $hdrs
18849 case "$d_srandom_r_proto" in
18851 case "$srandom_r_proto" in
18852 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18853 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18855 case "$srandom_r_proto" in
18856 ''|0) d_srandom_r=undef
18858 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18859 * ) case "$srandom_r_proto" in
18860 REENTRANT_PROTO*) ;;
18861 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18863 echo "Prototype: $try" ;;
18866 *) case "$usethreads" in
18867 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18874 *) srandom_r_proto=0
18878 : see if prototype for setresgid is available
18880 set d_sresgproto setresgid $i_unistd unistd.h
18883 : see if prototype for setresuid is available
18885 set d_sresuproto setresuid $i_unistd unistd.h
18888 : see if stat exists
18892 : see if sys/stat.h is available
18893 set sys/stat.h i_sysstat
18896 : see if stat knows about block sizes
18898 echo "Checking to see if your struct stat has st_blocks field..." >&4
18899 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18902 : see if this is a sys/vfs.h system
18903 set sys/vfs.h i_sysvfs
18906 : see if this is a sys/statfs.h system
18907 set sys/statfs.h i_sysstatfs
18910 : Check for statfs_s
18912 echo "Checking to see if your system supports struct statfs..." >&4
18913 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
18915 case "$d_statfs_s" in
18916 "$define") echo "Yes, it does." ;;
18917 *) echo "No, it doesn't." ;;
18921 : see if struct statfs knows about f_flags
18922 case "$d_statfs_s" in
18925 echo "Checking to see if your struct statfs has f_flags field..." >&4
18926 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
18930 set d_statfs_f_flags
18934 case "$d_statfs_f_flags" in
18935 "$define") echo "Yes, it does." ;;
18936 *) echo "No, it doesn't." ;;
18939 : see what flavor, if any, of static inline is supported
18941 echo "Checking to see if your system supports static inline..."
18942 $cat > try.c <<'EOCP'
18943 #include <stdlib.h>
18944 extern int f_via_a(int x);
18945 extern int f_via_b(int x);
18946 int main(int argc, char **argv)
18955 return EXIT_SUCCESS;
18958 return EXIT_FAILURE;
18962 $cat > a.c <<'EOCP'
18963 static INLINE int f(int x) {
18974 $cat > b.c <<'EOCP'
18975 extern int f(int x);
18983 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18984 case "$perl_static_inline" in
18985 '') # Check the various possibilities, and break out on success.
18986 # For gcc, prefer __inline__, which will still permit
18987 # cflags.SH to add in -ansi.
18988 case "$gccversion" in
18989 '') xxx="inline __inline__ __inline _inline";;
18990 *) xxx="__inline__ inline __inline _inline";;
18992 for inline in $xxx; do
18993 set try -DINLINE=$inline a.c
18994 if eval $compile && $run ./try; then
18995 # Now make sure there is no external linkage of static
18997 set try -DINLINE=$inline -DUSE_B a.c b.c
18998 if eval $compile && $run ./try; then
18999 $echo "Your compiler supports static $inline, " >&4
19000 $echo "but it also creates an external definition," >&4
19001 $echo "so I won't use it." >&4
19004 $echo "Your compiler supports static $inline." >&4
19006 perl_static_inline="static $inline";
19010 $echo "Your compiler does NOT support static $inline." >&4
19015 *inline*) # Some variant of inline exists.
19016 echo "Keeping your $hint value of $perl_static_inline."
19019 static) # No inline capabilities
19020 echo "Keeping your $hint value of $perl_static_inline."
19023 *) # Unrecognized previous value -- blindly trust the supplied
19024 # value and hope it makes sense. Use old value for
19025 # d_static_inline, if there is one.
19026 echo "Keeping your $hint value of $perl_static_inline."
19027 case "$d_static_inline" in
19029 *) val=$d_static_inline ;;
19033 # Fallback to plain 'static' if nothing worked.
19034 case "$perl_static_inline" in
19036 perl_static_inline="static"
19040 set d_static_inline
19042 $rm -f a.[co] b.[co]
19045 : Check stream access
19047 Checking how to access stdio streams by file descriptor number...
19049 case "$stdio_stream_array" in
19050 '') $cat >try.c <<EOCP
19053 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19057 for s in _iob __iob __sF
19059 set try -DSTDIO_STREAM_ARRAY=$s
19060 if eval $compile; then
19061 case "`$run ./try`" in
19062 yes) stdio_stream_array=$s; break ;;
19068 case "$stdio_stream_array" in
19070 I can't figure out how to access stdio streams by file descriptor number.
19072 d_stdio_stream_array="$undef"
19075 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19077 d_stdio_stream_array="$define"
19081 : see if strcoll exists
19082 set strcoll d_strcoll
19085 : check for structure copying
19087 echo "Checking to see if your C compiler can copy structs..." >&4
19088 $cat >try.c <<'EOCP'
19098 if $cc -c try.c >/dev/null 2>&1 ; then
19100 echo "Yup, it can."
19103 echo "Nope, it can't."
19109 : see if strerror and/or sys_errlist[] exist
19111 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19112 if set strerror val -f d_strerror; eval $csym; $val; then
19113 echo 'strerror() found.' >&4
19114 d_strerror="$define"
19115 d_strerrm='strerror(e)'
19116 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19117 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19118 d_syserrlst="$define"
19120 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19121 d_syserrlst="$undef"
19123 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19124 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19125 echo 'strerror() found in string header.' >&4
19126 d_strerror="$define"
19127 d_strerrm='strerror(e)'
19128 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19129 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19130 d_syserrlst="$define"
19132 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19133 d_syserrlst="$undef"
19135 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19136 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19137 d_strerror="$undef"
19138 d_syserrlst="$define"
19139 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19141 echo 'strerror() and sys_errlist[] NOT found.' >&4
19142 d_strerror="$undef"
19143 d_syserrlst="$undef"
19144 d_strerrm='"unknown"'
19148 : see if strerror_r exists
19149 set strerror_r d_strerror_r
19151 case "$d_strerror_r" in
19153 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19154 case "$d_strerror_r_proto:$usethreads" in
19155 ":define") d_strerror_r_proto=define
19156 set d_strerror_r_proto strerror_r $hdrs
19160 case "$d_strerror_r_proto" in
19162 case "$strerror_r_proto" in
19163 ''|0) try='int strerror_r(int, char*, size_t);'
19164 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19166 case "$strerror_r_proto" in
19167 ''|0) try='int strerror_r(int, char*, int);'
19168 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19170 case "$strerror_r_proto" in
19171 ''|0) try='char* strerror_r(int, char*, size_t);'
19172 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19174 case "$strerror_r_proto" in
19175 ''|0) d_strerror_r=undef
19177 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19178 * ) case "$strerror_r_proto" in
19179 REENTRANT_PROTO*) ;;
19180 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19182 echo "Prototype: $try" ;;
19185 *) case "$usethreads" in
19186 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19193 *) strerror_r_proto=0
19197 : see if strftime exists
19198 set strftime d_strftime
19201 : see if strlcat exists
19202 set strlcat d_strlcat
19205 : see if strlcpy exists
19206 set strlcpy d_strlcpy
19209 : see if strtod exists
19210 set strtod d_strtod
19213 : see if strtol exists
19214 set strtol d_strtol
19217 : see if strtold exists
19218 set strtold d_strtold
19221 : see if strtoll exists
19222 set strtoll d_strtoll
19225 case "$d_longlong-$d_strtoll" in
19228 Checking whether your strtoll() works okay...
19230 $cat >try.c <<'EOCP'
19233 #define strtoll __strtoll
19236 #define strtoll _strtoll
19239 extern long long int strtoll(char *s, char **, int);
19240 static int bad = 0;
19241 int check(char *s, long long ell, int een) {
19244 gll = strtoll(s, 0, 10);
19245 if (!((gll == ell) && (errno == een)))
19249 check(" 1", 1LL, 0);
19250 check(" 0", 0LL, 0);
19251 check("-1", -1LL, 0);
19252 check("-9223372036854775808", -9223372036854775808LL, 0);
19253 check("-9223372036854775808", -9223372036854775808LL, 0);
19254 check(" 9223372036854775807", 9223372036854775807LL, 0);
19255 check("-9223372036854775808", -9223372036854775808LL, 0);
19256 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19257 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19263 if eval $compile; then
19266 ok) echo "Your strtoll() seems to be working okay." ;;
19268 Your strtoll() doesn't seem to be working okay.
19274 echo "(I can't seem to compile the test program--assuming it doesn't)"
19280 : see if strtoq exists
19281 set strtoq d_strtoq
19284 : see if strtoul exists
19285 set strtoul d_strtoul
19288 case "$d_strtoul" in
19291 Checking whether your strtoul() works okay...
19293 $cat >try.c <<'EOCP'
19296 extern unsigned long int strtoul(char *s, char **, int);
19297 static int bad = 0;
19298 void check(char *s, unsigned long eul, int een) {
19301 gul = strtoul(s, 0, 10);
19302 if (!((gul == eul) && (errno == een)))
19306 check(" 1", 1L, 0);
19307 check(" 0", 0L, 0);
19309 case "$longsize" in
19311 $cat >>try.c <<'EOCP'
19312 check("18446744073709551615", 18446744073709551615UL, 0);
19313 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19314 #if 0 /* strtoul() for /^-/ strings is undefined. */
19315 check("-1", 18446744073709551615UL, 0);
19316 check("-18446744073709551614", 2, 0);
19317 check("-18446744073709551615", 1, 0);
19318 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19319 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19324 $cat >>try.c <<'EOCP'
19325 check("4294967295", 4294967295UL, 0);
19326 check("4294967296", 4294967295UL, ERANGE);
19327 #if 0 /* strtoul() for /^-/ strings is undefined. */
19328 check("-1", 4294967295UL, 0);
19329 check("-4294967294", 2, 0);
19330 check("-4294967295", 1, 0);
19331 check("-4294967296", 4294967295UL, ERANGE);
19332 check("-4294967297", 4294967295UL, ERANGE);
19337 : Should we write these tests to be more portable by sprintf-ing
19338 : ~0 and then manipulating that char string as input for strtol?
19341 $cat >>try.c <<'EOCP'
19348 if eval $compile; then
19349 case "`$run ./try`" in
19350 ok) echo "Your strtoul() seems to be working okay." ;;
19352 Your strtoul() doesn't seem to be working okay.
19358 echo "(I can't seem to compile the test program--assuming it doesn't)"
19364 : see if strtoull exists
19365 set strtoull d_strtoull
19368 case "$d_longlong-$d_strtoull" in
19371 Checking whether your strtoull() works okay...
19373 $cat >try.c <<'EOCP'
19376 #define strtoull __strtoull
19379 extern unsigned long long int strtoull(char *s, char **, int);
19380 static int bad = 0;
19381 int check(char *s, long long eull, int een) {
19384 gull = strtoull(s, 0, 10);
19385 if (!((gull == eull) && (errno == een)))
19389 check(" 1", 1LL, 0);
19390 check(" 0", 0LL, 0);
19391 check("18446744073709551615", 18446744073709551615ULL, 0);
19392 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19393 #if 0 /* strtoull() for /^-/ strings is undefined. */
19394 check("-1", 18446744073709551615ULL, 0);
19395 check("-18446744073709551614", 2LL, 0);
19396 check("-18446744073709551615", 1LL, 0);
19397 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19398 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19405 if eval $compile; then
19406 case "`$run ./try`" in
19407 ok) echo "Your strtoull() seems to be working okay." ;;
19409 Your strtoull() doesn't seem to be working okay.
19411 d_strtoull="$undef"
19415 echo "(I can't seem to compile the test program--assuming it doesn't)"
19416 d_strtoull="$undef"
19421 : see if strtouq exists
19422 set strtouq d_strtouq
19425 case "$d_strtouq" in
19428 Checking whether your strtouq() works okay...
19430 $cat >try.c <<'EOCP'
19433 extern unsigned long long int strtouq(char *s, char **, int);
19434 static int bad = 0;
19435 void check(char *s, unsigned long long eull, int een) {
19436 unsigned long long gull;
19438 gull = strtouq(s, 0, 10);
19439 if (!((gull == eull) && (errno == een)))
19443 check(" 1", 1LL, 0);
19444 check(" 0", 0LL, 0);
19445 check("18446744073709551615", 18446744073709551615ULL, 0);
19446 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19447 #if 0 /* strtouq() for /^-/ strings is undefined. */
19448 check("-1", 18446744073709551615ULL, 0);
19449 check("-18446744073709551614", 2LL, 0);
19450 check("-18446744073709551615", 1LL, 0);
19451 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19452 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19460 if eval $compile; then
19461 case "`$run ./try`" in
19462 ok) echo "Your strtouq() seems to be working okay." ;;
19464 Your strtouq() doesn't seem to be working okay.
19470 echo "(I can't seem to compile the test program--assuming it doesn't)"
19476 : see if strxfrm exists
19477 set strxfrm d_strxfrm
19480 : see if symlink exists
19481 set symlink d_symlink
19484 : see if syscall exists
19485 set syscall d_syscall
19488 : see if prototype for syscall is available
19490 set d_syscallproto syscall $i_unistd unistd.h
19493 : see if sysconf exists
19494 set sysconf d_sysconf
19497 : see if system exists
19498 set system d_system
19501 : see if tcgetpgrp exists
19502 set tcgetpgrp d_tcgetpgrp
19505 : see if tcsetpgrp exists
19506 set tcsetpgrp d_tcsetpgrp
19509 : see if prototype for telldir is available
19511 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19514 : see if tgamma exists
19515 set tgamma d_tgamma
19518 : see if time exists
19520 if test "X$d_time" = X -o X"$timetype" = X; then
19521 if set time val -f d_time; eval $csym; $val; then
19522 echo 'time() found.' >&4
19524 rp="What is the type returned by time() on this system?"
19525 set time_t timetype long stdio.h sys/types.h
19528 echo 'time() not found, hope that will do.' >&4
19536 : see if timegm exists
19537 set timegm d_timegm
19540 : see if this is a sys/times.h system
19541 set sys/times.h i_systimes
19544 : see if times exists
19546 if set times val -f d_times; eval $csym; $val; then
19547 echo 'times() found.' >&4
19550 case "$i_systimes" in
19551 "$define") inc='sys/times.h';;
19553 rp="What is the type returned by times() on this system?"
19554 set clock_t clocktype long stdio.h sys/types.h $inc
19557 echo 'times() NOT found, hope that will do.' >&4
19562 : see if tmpnam_r exists
19563 set tmpnam_r d_tmpnam_r
19565 case "$d_tmpnam_r" in
19567 hdrs="$i_systypes sys/types.h define stdio.h "
19568 case "$d_tmpnam_r_proto:$usethreads" in
19569 ":define") d_tmpnam_r_proto=define
19570 set d_tmpnam_r_proto tmpnam_r $hdrs
19574 case "$d_tmpnam_r_proto" in
19576 case "$tmpnam_r_proto" in
19577 ''|0) try='char* tmpnam_r(char*);'
19578 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19580 case "$tmpnam_r_proto" in
19581 ''|0) d_tmpnam_r=undef
19583 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19584 * ) case "$tmpnam_r_proto" in
19585 REENTRANT_PROTO*) ;;
19586 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19588 echo "Prototype: $try" ;;
19591 *) case "$usethreads" in
19592 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19599 *) tmpnam_r_proto=0
19603 : see if trunc exists
19607 : see if truncate exists
19608 set truncate d_truncate
19611 : see if ttyname_r exists
19612 set ttyname_r d_ttyname_r
19614 case "$d_ttyname_r" in
19616 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19617 case "$d_ttyname_r_proto:$usethreads" in
19618 ":define") d_ttyname_r_proto=define
19619 set d_ttyname_r_proto ttyname_r $hdrs
19623 case "$d_ttyname_r_proto" in
19625 case "$ttyname_r_proto" in
19626 ''|0) try='int ttyname_r(int, char*, size_t);'
19627 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19629 case "$ttyname_r_proto" in
19630 ''|0) try='int ttyname_r(int, char*, int);'
19631 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19633 case "$ttyname_r_proto" in
19634 ''|0) try='char* ttyname_r(int, char*, int);'
19635 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19637 case "$ttyname_r_proto" in
19638 ''|0) d_ttyname_r=undef
19640 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19641 * ) case "$ttyname_r_proto" in
19642 REENTRANT_PROTO*) ;;
19643 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19645 echo "Prototype: $try" ;;
19648 *) case "$usethreads" in
19649 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19656 *) ttyname_r_proto=0
19660 : see if tzname[] exists
19662 if set tzname val -a d_tzname; eval $csym; $val; then
19664 echo 'tzname[] found.' >&4
19667 echo 'tzname[] NOT found.' >&4
19672 : Check if is a multiplatform env
19674 darwin) multiarch="$define" ;;
19676 case "$multiarch" in
19677 ''|[nN]*) multiarch="$undef" ;;
19680 : check for ordering of bytes in a UV
19682 case "$multiarch" in
19685 You seem to be doing a multiarchitecture build,
19686 skipping the byteorder check.
19692 case "$byteorder" in
19695 In the following, larger digits indicate more significance. A big-endian
19696 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19697 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19698 machines may have weird orders like 3412. A Cray will report 87654321,
19699 an Alpha will report 12345678. If the test program works the default is
19701 I'm now running the test program...
19705 #$i_stdlib I_STDLIB
19707 #include <stdlib.h>
19709 #include <sys/types.h>
19710 typedef $uvtype UV;
19720 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19722 u.l = (UV)0x04030201;
19723 for (i = 0; i < $uvsize; i++)
19724 printf("%c", u.c[i]+'0');
19731 if eval $compile && $run ./try > /dev/null; then
19734 [1-4][1-4][1-4][1-4]|12345678|87654321)
19735 echo "(The test program ran ok.)"
19736 echo "byteorder=$dflt"
19739 ????|????????) echo "(The test program ran ok.)" ;;
19740 *) echo "(The test program didn't run right for some reason.)" ;;
19745 (I can't seem to compile the test program. Guessing big-endian...)
19748 case "$xxx_prompt" in
19750 rp="What is the order of bytes in $uvtype?"
19763 : Checking 32bit alignedness
19766 Checking to see whether you can access character data unalignedly...
19768 case "$d_u32align" in
19769 '') $cat >try.c <<EOCP
19771 #$i_stdlib I_STDLIB
19773 #include <stdlib.h>
19775 #define U32 $u32type
19776 #define BYTEORDER 0x$byteorder
19778 #include <signal.h>
19780 $signal_t bletch(int s) { exit(4); }
19783 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19784 volatile U8 buf[8];
19788 if (sizeof(U32) != 4) {
19789 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19796 signal(SIGBUS, bletch);
19808 for (i = 0; i < 4; i++) {
19809 up = (U32*)(buf + i);
19810 if (! ((*up == 1 << (8*i)) || /* big-endian */
19811 (*up == 1 << (8*(3-i))) /* little-endian */
19815 printf("read failed (%x)\n", *up);
19821 for (i = 0; i < 4; i++) {
19822 up = (U32*)(buf + i);
19824 if (*up != 0xBeef) {
19825 printf("write failed (%x)\n", *up);
19839 if eval $compile_ok; then
19840 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19841 $run ./try 2>&1 >/dev/null
19844 You can access character data pretty unalignedly.
19846 d_u32align="$undef"
19849 It seems that you must access character data in an aligned manner.
19851 d_u32align="$define"
19855 rp='Can you access character data at unaligned addresses?'
19859 [yY]*) d_u32align="$undef" ;;
19860 *) d_u32align="$define" ;;
19867 : see if ualarm exists
19868 set ualarm d_ualarm
19871 : see if umask exists
19875 : see if unordered exists
19876 set unordered d_unordered
19879 : see if unsetenv exists
19880 set unsetenv d_unsetenv
19883 : see if usleep exists
19884 set usleep d_usleep
19887 : see if prototype for usleep is available
19889 set d_usleepproto usleep $i_unistd unistd.h
19892 : see if ustat exists
19896 : see if closedir exists
19897 set closedir d_closedir
19900 case "$d_closedir" in
19903 echo "Checking whether closedir() returns a status..." >&4
19905 #$i_dirent I_DIRENT /**/
19906 #$i_sysdir I_SYS_DIR /**/
19907 #$i_sysndir I_SYS_NDIR /**/
19908 #$i_systypes I_SYS_TYPES /**/
19910 #if defined(I_SYS_TYPES)
19911 #include <sys/types.h>
19913 #if defined(I_DIRENT)
19914 #include <dirent.h>
19917 #include <sys/ndir.h>
19921 #include <ndir.h> /* may be wrong in the future */
19923 #include <sys/dir.h>
19928 int main() { return closedir(opendir(".")); }
19931 if eval $compile_ok; then
19932 if $run ./try > /dev/null 2>&1 ; then
19933 echo "Yes, it does."
19936 echo "No, it doesn't."
19940 echo "(I can't seem to compile the test program--assuming it doesn't)"
19948 set d_void_closedir
19952 : see if there is a wait4
19956 : see if waitpid exists
19957 set waitpid d_waitpid
19962 $cat >try.c <<'EOCP'
19968 return (wcscmp (s, s) ? 1 : 0);
19973 if eval $compile; then
19976 0) echo "A working wcscmp() found." >&4
19978 *) echo "wcscmp() found, but it doesn't work" >&4
19982 echo "wcscmp() NOT found." >&4
19988 : see if wcstombs exists
19989 set wcstombs d_wcstombs
19994 $cat >try.c <<'EOCP'
19999 wchar_t dst[4], *src = L" ";
20001 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20006 if eval $compile; then
20009 0) echo "A working wcsxfrm() found." >&4
20011 *) echo "wcsxfrm() found, but it doesn't work" >&4
20015 echo "wcsxfrm() NOT found." >&4
20021 : see if wctomb exists
20022 set wctomb d_wctomb
20025 : see if writev exists
20026 set writev d_writev
20029 : check for alignment requirements
20031 case "$alignbytes" in
20032 '') echo "Checking alignment constraints..." >&4
20033 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
20034 $cat >try.c <<'EOCP'
20035 typedef long double NV;
20038 $cat >try.c <<'EOCP'
20042 $cat >>try.c <<'EOCP'
20050 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20055 if eval $compile_ok; then
20059 echo "(I can't seem to compile the test program...)"
20061 case "$multiarch" in
20063 : The usual safe value is 8, but Darwin with -Duselongdouble
20064 : needs 16. Hence, we will take 8 as a minimum, but allow
20065 : Configure to pick a larger value if needed.
20066 if $test "$dflt" -lt 8; then
20068 echo "Setting alignment to 8 for multiarch support.">&4
20073 *) dflt="$alignbytes"
20076 rp="Doubles must be aligned on a how-many-byte boundary?"
20081 : set the base revision
20084 : length of character in bytes. Is always 1, otherwise it is not C
20085 : This used to be a test using sizeof
20088 : Check for the number of bits in a character
20089 case "$charbits" in
20090 '') echo "Checking how long a character is (in bits)..." >&4
20097 for (c = 1, n = 0; c; c <<= 1, n++) ;
20098 printf ("%d\n", n);
20103 if eval $compile_ok; then
20107 echo "(I can't seem to compile the test program. Guessing...)"
20114 rp="What is the length of a character (in bits)?"
20118 case "$charbits" in
20121 Your system has an unsigned character size of $charbits bits, which
20122 is rather unusual (normally it is 8 bits). Perl likely will not work
20123 correctly on your system, with subtle bugs in various places.
20125 rp='Do you really want to continue?'
20129 [yY]) echo >&4 "Okay, continuing." ;;
20134 : how do we concatenate cpp tokens here?
20136 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20137 $cat >cpp_stuff.c <<'EOCP'
20138 #define RCAT(a,b)a/**/b
20139 #define ACAT(a,b)a ## b
20143 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20144 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20145 echo "Oh! Smells like ANSI's been here." >&4
20146 echo "We can catify or stringify, separately or together!"
20148 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20149 echo "Ah, yes! The good old days!" >&4
20150 echo "However, in the good old days we don't know how to stringify and"
20151 echo "catify at the same time."
20155 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20156 You're going to have to edit the values of CAT[2-5] in config.h...
20158 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20162 : see if this is a db.h system
20168 : Check db version.
20170 echo "Checking Berkeley DB version ..." >&4
20176 #include <sys/types.h>
20178 #$i_stdlib I_STDLIB
20180 #include <stdlib.h>
20183 int main(int argc, char *argv[])
20185 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20186 int Major, Minor, Patch ;
20187 unsigned long Version ;
20188 (void)db_version(&Major, &Minor, &Patch) ;
20190 printf("%d %d %d %d %d %d\n",
20191 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20192 Major, Minor, Patch);
20195 printf("You have Berkeley DB Version 2 or greater.\n");
20197 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20198 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20199 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20200 Major, Minor, Patch) ;
20202 /* check that db.h & libdb are compatible */
20203 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20204 printf("db.h and libdb are incompatible.\n") ;
20208 printf("db.h and libdb are compatible.\n") ;
20210 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20211 + DB_VERSION_PATCH ;
20213 /* needs to be >= 2.3.4 */
20214 if (Version < 2003004) {
20215 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20216 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20222 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20227 printf("You have Berkeley DB Version 1.\n");
20228 exit(0); /* DB version < 2: the coast is clear. */
20230 exit(1); /* <db.h> not Berkeley DB? */
20236 if eval $compile_ok && $run ./try; then
20237 echo 'Looks OK.' >&4
20239 db_version_major=$1
20240 db_version_minor=$2
20241 db_version_patch=$3
20243 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20247 : Remove db from list of libraries to use
20248 echo "Removing unusable -ldb from library list" >&4
20249 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20252 echo "libs = $libs" >&4
20262 : Check the return type needed for hash
20264 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20270 #include <sys/types.h>
20273 #ifndef DB_VERSION_MAJOR
20274 u_int32_t hash_cb (const void* ptr, size_t size)
20280 info.hash = hash_cb;
20284 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20285 if $contains warning try.out >>/dev/null 2>&1 ; then
20288 db_hashtype='u_int32_t'
20291 : XXX Maybe we should just give up here.
20292 db_hashtype=u_int32_t
20294 echo "Help: I can't seem to compile the db test program." >&4
20295 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20298 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20300 *) db_hashtype=u_int32_t
20305 : Check the return type needed for prefix
20307 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20313 #include <sys/types.h>
20316 #ifndef DB_VERSION_MAJOR
20317 size_t prefix_cb (const DBT *key1, const DBT *key2)
20323 info.prefix = prefix_cb;
20327 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20328 if $contains warning try.out >>/dev/null 2>&1 ; then
20329 db_prefixtype='int'
20331 db_prefixtype='size_t'
20334 db_prefixtype='size_t'
20335 : XXX Maybe we should just give up here.
20337 echo "Help: I can't seem to compile the db test program." >&4
20338 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20341 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20343 *) db_prefixtype='size_t'
20347 : Check what kind of inf/nan your system has
20348 $echo "Checking the kind of infinities and nans you have..." >&4
20350 #define DOUBLESIZE $doublesize
20351 #$d_longdbl HAS_LONG_DOUBLE
20352 #ifdef HAS_LONG_DOUBLE
20353 #define LONGDBLSIZE $longdblsize
20354 #define LONGDBLKIND $longdblkind
20361 /* Note that whether the sign bit is on or off
20362 * for NaN depends on the CPU/FPU, and possibly
20363 * can be affected by the build toolchain.
20365 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20366 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20367 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20368 * (respectively) as opposed to the more usual
20369 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20371 static void bytes(unsigned char *p, unsigned int n) {
20373 for (i = 0; i < n; i++) {
20374 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20377 int main(int argc, char *argv[]) {
20378 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20379 * because some compilers are 'smart' and not only warn but refuse to
20380 * compile such 'illegal' values. */
20381 double dinf = exp(1e9);
20382 double dnan = sqrt(-1.0);
20383 #ifdef HAS_LONG_DOUBLE
20384 long double ldinf = (long double)exp(1e9);
20385 long double ldnan = (long double)sqrt(-1.0);
20388 switch (argv[1][0]) {
20389 case '1': bytes(&dinf, sizeof(dinf)); break;
20390 case '2': bytes(&dnan, sizeof(dnan)); break;
20391 #ifdef HAS_LONG_DOUBLE
20392 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20393 /* the 80-bit long doubles might have garbage in their excess bytes */
20394 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20396 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20397 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20405 if eval $compile; then
20406 doubleinfbytes=`$run ./try 1`
20407 doublenanbytes=`$run ./try 2`
20408 case "$d_longdbl" in
20410 longdblinfbytes=`$run ./try 3`
20411 longdblnanbytes=`$run ./try 4`
20415 # Defaults in case the above test program failed.
20416 case "$doublekind" in
20417 1) # IEEE 754 32-bit LE
20418 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20419 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20421 2) # IEEE 754 32-bit BE
20422 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20423 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20425 3) # IEEE 754 64-bit LE
20426 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20427 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20429 4) # IEEE 754 64-bit BE
20430 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20431 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20433 5) # IEEE 754 128-bit LE
20434 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20435 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20437 6) # IEEE 754 128-bit BE
20438 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20439 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20441 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20442 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20443 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20445 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20446 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20447 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20450 doubleinfbytes=$undef
20451 doublenanbytes=$undef
20454 case "$longdblkind" in
20455 1) # IEEE 754 128-bit LE
20456 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20457 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20459 2) # IEEE 754 128-bit BE
20460 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20461 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20463 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20464 case "$longdblsize" in
20465 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20466 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20467 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20470 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20471 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20474 longdblinfbytes=$undef
20475 longdblnanbytes=$undef
20479 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20480 case "$longdblsize" in
20481 12) # 32-bit system
20482 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20483 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20485 16) # 64-bit system
20486 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20487 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20490 longdblinfbytes=$undef
20491 longdblnanbytes=$undef
20495 5) # 128-bit LE "double double"
20496 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20497 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20499 6) # 128-bit BE "double double"
20500 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20501 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20504 longdblinfbytes=$undef
20505 longdblnanbytes=$undef
20511 : Check the length of the double mantissa
20512 $echo "Checking how many mantissa bits your doubles have..." >&4
20515 #$i_sunmath I_SUNMATH
20517 # include <float.h>
20520 # include <sunmath.h>
20522 #ifdef DBL_MANT_DIG
20523 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20526 int main(int argc, char *argv[]) {
20528 printf("%d\n", BITS);
20534 if eval $compile; then
20535 doublemantbits=`$run ./try`
20537 doublemantbits="$undef"
20541 : Check the length of the longdouble mantissa
20542 $echo "Checking how many mantissa bits your long doubles have..." >&4
20545 #$i_sunmath I_SUNMATH
20547 # include <float.h>
20550 # include <sunmath.h>
20552 #$d_longdbl HAS_LONG_DOUBLE
20553 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20554 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20555 /* This format has no implicit bit. Beware, however, that for
20556 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20557 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20558 * and the top bit must have been one since 387, zero is plain invalid.
20559 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20560 # define BITS LDBL_MANT_DIG
20561 # elif ($longdblkind == 5 || $longdblkind == 6) /* double double */
20562 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20563 * reason e.g. Irix thinks 107. But in any case, we want only
20564 * the number of real bits, the implicit bits are of no interest. */
20565 # define BITS 2 * (DBL_MANT_DIG - 1)
20567 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20571 int main(int argc, char *argv[]) {
20573 printf("%d\n", BITS);
20579 if eval $compile; then
20580 longdblmantbits=`$run ./try`
20582 longdblmantbits="$undef"
20586 : Check the length of the NV mantissa
20587 $echo "Checking how many mantissa bits your NVs have..." >&4
20588 if test "X$usequadmath" = "X$define"; then
20589 nvmantbits=112 # 128-1-15
20591 if test "X$nvsize" = "X$doublesize"; then
20592 nvmantbits="$doublemantbits"
20594 if test "X$nvsize" = "X$longdblsize"; then
20595 nvmantbits="$longdblmantbits"
20597 nvmantbits="$undef"
20602 : How can we generate normalized random numbers ?
20604 echo "Using our internal random number implementation..." >&4
20607 *-Dmy_rand=*|*-Dmy_srand=*)
20608 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20609 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20610 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20611 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20615 randfunc=Perl_drand48
20616 drand01="Perl_drand48()"
20617 seedfunc="Perl_drand48_init"
20621 : Determine if this is an EBCDIC system
20623 echo "Determining whether or not we are on an EBCDIC system..." >&4
20624 $cat >try.c <<'EOM'
20627 if ('M'==0xd4) return 0;
20634 if eval $compile_ok; then
20635 if $run ./try; then
20636 echo "You seem to speak EBCDIC." >&4
20639 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20642 echo "I'm unable to compile the test program." >&4
20643 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20649 : Check how to flush
20652 Checking how to flush all pending stdio output...
20654 # I only know how to find the first 32 possibly open files on SunOS.
20655 # See also hints/sunos_4_1.sh and util.c --AD
20657 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20659 $cat >>try.c <<EOCP
20661 #$i_stdlib I_STDLIB
20663 #include <stdlib.h>
20665 #$i_unistd I_UNISTD
20667 # include <unistd.h>
20669 #$d_sysconf HAS_SYSCONF
20670 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20671 #ifdef HAS_STDIO_STREAM_ARRAY
20672 # define STDIO_STREAM_ARRAY $stdio_stream_array
20677 p = fopen("try.out", "w");
20681 # ifdef TRY_FPRINTF
20685 #ifdef TRY_FFLUSH_NULL
20688 #ifdef TRY_FFLUSH_ALL
20690 long open_max = -1;
20691 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20692 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20694 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20695 open_max = sysconf(_SC_OPEN_MAX);
20698 open_max = FOPEN_MAX;
20701 open_max = OPEN_MAX;
20710 # ifdef HAS_STDIO_STREAM_ARRAY
20711 if (open_max > 0) {
20713 for (i = 0; i < open_max; i++)
20714 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20715 STDIO_STREAM_ARRAY[i]._file < open_max &&
20716 STDIO_STREAM_ARRAY[i]._flag)
20717 fflush(&STDIO_STREAM_ARRAY[i]);
20725 : first we have to find out how _not_ to flush
20727 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20729 set try -DTRY_FPUTC
20730 if eval $compile; then
20731 $run ./try 2>/dev/null
20734 if $test ! -s try.out -a "X$code" = X42; then
20740 set try -DTRY_FPRINTF
20741 if eval $compile; then
20742 $run ./try 2>/dev/null
20745 if $test ! -s try.out -a "X$code" = X42; then
20746 output=-DTRY_FPRINTF
20752 : check for fflush NULL behavior
20753 case "$fflushNULL" in
20754 '') set try -DTRY_FFLUSH_NULL $output
20755 if eval $compile; then
20756 $run ./try 2>/dev/null
20759 if $test -s try.out -a "X$code" = X42; then
20760 fflushNULL="`$cat try.out`"
20762 if $test "X$code" != X42; then
20764 (If this test failed, don't worry, we'll try another method shortly.)
20769 $rm -f core try.core core.try.*
20770 case "$fflushNULL" in
20772 Your fflush(NULL) works okay for output streams.
20773 Let's see if it clobbers input pipes...
20775 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20776 # bug that improperly flushes the input end of pipes. So we avoid the
20777 # autoflush on fork/system/exec support for now. :-(
20778 $cat >tryp.c <<EOCP
20781 main(int argc, char **argv)
20787 while ((i = getc(stdin)) != -1
20788 && (*bp++ = i) != '\n'
20789 && bp < &buf[1024])
20792 fprintf(stdout, "%s", buf);
20800 fflushNULL="$define"
20802 if eval $compile; then
20804 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20805 if $test "X$targethost" != X; then
20808 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20810 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20812 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20814 fflush(NULL) seems to behave okay with input streams.
20816 fflushNULL="$define"
20819 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20821 fflushNULL="$undef"
20824 $rm -f core tryp.c tryp.core core.tryp.*
20827 Your fflush(NULL) isn't working (contrary to ANSI C).
20829 fflushNULL="$undef"
20832 Cannot figure out whether your fflush(NULL) works or not.
20833 I'm assuming it doesn't (contrary to ANSI C).
20835 fflushNULL="$undef"
20839 $define|true|[yY]*)
20840 fflushNULL="$define"
20843 fflushNULL="$undef"
20846 : check explicit looping only if NULL did not work, and if the pipe
20847 : bug does not show up on an explicit flush too
20848 case "$fflushNULL" in
20850 $cat >tryp.c <<EOCP
20853 main(int argc, char **argv)
20859 while ((i = getc(stdin)) != -1
20860 && (*bp++ = i) != '\n'
20861 && bp < &buf[1024])
20864 fprintf(stdout, "%s", buf);
20873 if eval $compile; then
20875 if $test "X$targethost" != X; then
20878 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20880 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20882 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20884 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20886 : now check for fflushall behaviour
20887 case "$fflushall" in
20888 '') set try -DTRY_FFLUSH_ALL $output
20889 if eval $compile; then
20891 (Now testing the other method--but note that this also may fail.)
20893 $run ./try 2>/dev/null
20896 if $test -s try.out -a "X$code" = X42; then
20897 fflushall="`$cat try.out`"
20901 case "$fflushall" in
20903 Whew. Flushing explicitly all the stdio streams works.
20905 fflushall="$define"
20908 Sigh. Flushing explicitly all the stdio streams doesn't work.
20913 Cannot figure out whether flushing stdio streams explicitly works or not.
20914 I'm assuming it doesn't.
20920 "$define"|true|[yY]*)
20921 fflushall="$define"
20929 All is futile. Even fflush(stdin) clobbers input pipes!
20936 $rm -f core tryp.c tryp.core core.tryp.*
20938 *) fflushall="$undef"
20942 case "$fflushNULL$fflushall" in
20945 OK, I give up. I cannot figure out how to flush pending stdio output.
20946 We won't be flushing handles at all before fork/exec/popen.
20952 : Store the full pathname to the ar program for use in the C program
20953 : Respect a hint or command line value for full_ar.
20958 : Store the full pathname to the sed program for use in the C program
20961 : see what type gids are declared as in the kernel
20963 echo "Looking for the type for group ids returned by getgid()."
20964 set gid_t gidtype xxx stdio.h sys/types.h
20968 xxx=`./findhdr sys/user.h`
20969 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20971 unsigned) dflt="$1 $2" ;;
20975 *) dflt="$gidtype";;
20978 gid_t) echo "gid_t found." ;;
20979 *) rp="What is the type for group ids returned by getgid()?"
20985 : Check the size of GID
20988 *_t) zzz="$gidtype" ;;
20991 echo "Checking the size of $zzz..." >&4
20993 #include <sys/types.h>
20995 #$i_stdlib I_STDLIB
20997 #include <stdlib.h>
21000 printf("%d\n", (int)sizeof($gidtype));
21005 if eval $compile_ok; then
21009 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21012 echo "Your $zzz is $gidsize bytes long."
21017 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21021 : Check if GID is signed
21024 *_t) zzz="$gidtype" ;;
21027 echo "Checking the sign of $zzz..." >&4
21029 #include <sys/types.h>
21040 if eval $compile; then
21044 echo "(I can't execute the test program--guessing unsigned.)" >&4
21048 1) echo "Your $zzz is unsigned." ;;
21049 -1) echo "Your $zzz is signed." ;;
21055 echo "(I can't compile the test program--guessing unsigned.)" >&4
21059 : Check 64bit sizes
21062 if $test X"$quadtype" != X; then
21064 echo "Checking how to print 64-bit integers..." >&4
21066 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21067 $cat >try.c <<'EOCP'
21068 #include <sys/types.h>
21071 int q = 12345678901;
21072 printf("%ld\n", q);
21076 if eval $compile; then
21080 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21081 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21082 echo "We will use %d."
21088 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21089 $cat >try.c <<'EOCP'
21090 #include <sys/types.h>
21093 long q = 12345678901;
21094 printf("%ld\n", q);
21098 if eval $compile; then
21102 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21103 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21104 echo "We will use %ld."
21110 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21111 $cat >try.c <<'EOCP'
21112 #include <sys/types.h>
21113 #include <inttypes.h>
21116 int64_t q = 12345678901;
21117 printf("%" PRId64 "\n", q);
21121 if eval $compile; then
21125 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21126 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21127 echo "We will use the C9X style."
21133 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21135 #include <sys/types.h>
21138 $quadtype q = 12345678901;
21139 printf("%Ld\n", q);
21143 if eval $compile; then
21147 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21148 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21149 echo "We will use %Ld."
21155 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21156 $cat >try.c <<'EOCP'
21157 #include <sys/types.h>
21160 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21161 printf("%lld\n", q);
21165 if eval $compile; then
21169 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21170 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21171 echo "We will use the %lld style."
21177 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21179 #include <sys/types.h>
21182 $quadtype q = 12345678901;
21183 printf("%qd\n", q);
21187 if eval $compile; then
21191 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21192 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21193 echo "We will use %qd."
21199 if $test X"$sPRId64" = X; then
21200 echo "Cannot figure out how to print 64-bit integers." >&4
21207 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21208 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21210 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21211 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21215 : Check format strings for internal types
21217 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21219 if $test X"$ivsize" = X8; then
21220 ivdformat="$sPRId64"
21221 uvuformat="$sPRIu64"
21222 uvoformat="$sPRIo64"
21223 uvxformat="$sPRIx64"
21224 uvXUformat="$sPRIXU64"
21226 if $test X"$ivsize" = X"$longsize"; then
21233 if $test X"$ivsize" = X"$intsize"; then
21241 if $test X"$ivsize" = X"$shortsize"; then
21252 if $test X"$usequadmath" = X"$define"; then
21260 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21261 nveformat="$sPRIeldbl"
21262 nvfformat="$sPRIfldbl"
21263 nvgformat="$sPRIgldbl"
21264 nvEUformat="$sPRIEUldbl"
21265 nvFUformat="$sPRIFUldbl"
21266 nvGUformat="$sPRIGUldbl"
21277 case "$ivdformat" in
21278 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21283 : Check format string for GID
21286 $echo "Checking the format string to be used for gids..." >&4
21289 -1) if $test X"$gidsize" = X"$ivsize"; then
21290 gidformat="$ivdformat"
21292 if $test X"$gidsize" = X"$longsize"; then
21295 if $test X"$gidsize" = X"$intsize"; then
21298 if $test X"$gidsize" = X"$shortsize"; then
21305 *) if $test X"$gidsize" = X"$uvsize"; then
21306 gidformat="$uvuformat"
21308 if $test X"$gidsize" = X"$longsize"; then
21311 if $test X"$gidsize" = X"$intsize"; then
21314 if $test X"$gidsize" = X"$shortsize"; then
21323 : see if getgroups exists
21324 set getgroups d_getgrps
21327 : see if setgroups exists
21328 set setgroups d_setgrps
21331 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21333 case "$d_getgrps$d_setgrps" in
21335 case "$groupstype" in
21336 '') dflt="$gidtype" ;;
21337 *) dflt="$groupstype" ;;
21340 What type of pointer is the second argument to getgroups() and setgroups()?
21341 Usually this is the same as group ids, $gidtype, but not always.
21344 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21348 *) groupstype="$gidtype";;
21351 : check whether make sets MAKE
21353 echo "Checking if your $make program sets \$(MAKE)..." >&4
21354 case "$make_set_make" in
21356 $sed 's/^X //' > testmake.mak << 'EOF'
21358 X @echo 'maketemp="$(MAKE)"'
21360 case "`$make -f testmake.mak 2>/dev/null`" in
21361 *maketemp=*) make_set_make='#' ;;
21362 *) make_set_make="MAKE=$make" ;;
21364 $rm -f testmake.mak
21367 case "$make_set_make" in
21368 '#') echo "Yup, it does.";;
21369 *) echo "Nope, it doesn't.";;
21372 : see what type is used for mode_t
21373 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21374 set mode_t modetype int stdio.h sys/types.h
21377 : see if we need va_copy
21379 case "$i_stdarg" in
21382 #include <stdarg.h>
21384 #$i_stdlib I_STDLIB
21386 #include <stdlib.h>
21388 #include <signal.h>
21391 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21393 return vfprintf(f, fmt, *valp);
21397 myvfprintf(FILE *f, const char *fmt, va_list val)
21399 return ivfprintf(f, fmt, &val);
21403 myprintf(char *fmt, ...)
21406 va_start(val, fmt);
21407 return myvfprintf(stdout, fmt, val);
21411 main(int ac, char **av)
21413 signal(SIGSEGV, exit);
21415 myprintf("%s%cs all right, then\n", "that", '\'');
21420 if eval $compile && $run ./try 2>&1 >/dev/null; then
21421 case "`$run ./try`" in
21422 "that's all right, then")
21428 yes) echo "It seems that you don't need va_copy()." >&4
21429 need_va_copy="$undef"
21431 *) echo "It seems that va_copy() or similar will be needed." >&4
21432 need_va_copy="$define"
21437 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21438 need_va_copy="$undef"
21442 : see what type is used for size_t
21443 rp="What is the type used for the length parameter for string functions?"
21444 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21447 : check for type of arguments to gethostbyaddr.
21448 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21449 case "$d_gethbyaddr" in
21453 Checking to see what type of arguments are accepted by gethostbyaddr().
21455 hdrs="$define sys/types.h
21456 $d_socket sys/socket.h
21457 $i_niin netinet/in.h
21459 $i_unistd unistd.h"
21460 : The first arg can 'char *' or 'void *'
21461 : The second arg is some of integral type
21462 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21463 for yyy in size_t long int; do
21464 case "$netdb_host_type" in
21465 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21466 if ./protochk "$try" $hdrs; then
21467 echo "Your system accepts $xxx for the first arg."
21468 echo "...and $yyy for the second arg."
21469 netdb_host_type="$xxx"
21470 netdb_hlen_type="$yyy"
21476 : In case none of those worked, prompt the user.
21477 case "$netdb_host_type" in
21478 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21481 netdb_host_type=$ans
21482 rp='What is the type for the 2nd argument to gethostbyaddr?'
21485 netdb_hlen_type=$ans
21489 *) : no gethostbyaddr, so pick harmless defaults
21490 netdb_host_type='char *'
21491 netdb_hlen_type="$sizetype"
21494 # Remove the "const" if needed. -- but then we'll have a
21496 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21499 : check for type of argument to gethostbyname.
21500 if test "X$netdb_name_type" = X ; then
21501 case "$d_gethbyname" in
21505 Checking to see what type of argument is accepted by gethostbyname().
21507 hdrs="$define sys/types.h
21508 $d_socket sys/socket.h
21509 $i_niin netinet/in.h
21511 $i_unistd unistd.h"
21512 for xxx in "const char *" "char *"; do
21513 case "$netdb_name_type" in
21514 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21515 if ./protochk "$try" $hdrs; then
21516 echo "Your system accepts $xxx."
21517 netdb_name_type="$xxx"
21522 : In case none of those worked, prompt the user.
21523 case "$netdb_name_type" in
21524 '') rp='What is the type for the 1st argument to gethostbyname?'
21527 netdb_name_type=$ans
21531 *) : no gethostbyname, so pick harmless default
21532 netdb_name_type='char *'
21537 : check for type of 1st argument to getnetbyaddr.
21538 if test "X$netdb_net_type" = X ; then
21539 case "$d_getnbyaddr" in
21543 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21545 hdrs="$define sys/types.h
21546 $d_socket sys/socket.h
21547 $i_niin netinet/in.h
21549 $i_unistd unistd.h"
21550 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21551 case "$netdb_net_type" in
21552 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21553 if ./protochk "$try" $hdrs; then
21554 echo "Your system accepts $xxx."
21555 netdb_net_type="$xxx"
21560 : In case none of those worked, prompt the user.
21561 case "$netdb_net_type" in
21562 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21565 netdb_net_type=$ans
21569 *) : no getnetbyaddr, so pick harmless default
21570 netdb_net_type='long'
21574 : locate the preferred pager for this system
21581 [a-zA-Z]:/*) dflt=$pg;;
21585 [a-zA-Z]:/*) dflt=$more;;
21589 [a-zA-Z]:/*) dflt=$less;;
21592 '') dflt=/usr/ucb/more;;
21600 rp='What pager is used on your system?'
21604 : see what type pids are declared as in the kernel
21605 rp="What is the type of process ids on this system?"
21606 set pid_t pidtype int stdio.h sys/types.h
21609 : see if ar generates random libraries by itself
21611 echo "Checking how to generate random libraries on your machine..." >&4
21612 echo 'int bar1() { return bar2(); }' > bar1.c
21613 echo 'int bar2() { return 2; }' > bar2.c
21615 #$i_stdlib I_STDLIB
21617 #include <stdlib.h>
21619 int main() { printf("%d\n", bar1()); exit(0); }
21621 $cc $ccflags -c bar1.c >/dev/null 2>&1
21622 $cc $ccflags -c bar2.c >/dev/null 2>&1
21623 $cc $ccflags -c foo.c >/dev/null 2>&1
21624 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21625 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21626 $run ./foobar >/dev/null 2>&1; then
21627 echo "$ar appears to generate random libraries itself."
21629 if [ "X$ranlib" = "X" ]; then
21632 elif $ar s bar$_a >/dev/null 2>&1 &&
21633 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21634 $run ./foobar >/dev/null 2>&1; then
21635 echo "a table of contents needs to be added with '$ar s'."
21638 elif $ar ts bar$_a >/dev/null 2>&1 &&
21639 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21640 $run ./foobar >/dev/null 2>&1; then
21641 echo "a table of contents needs to be added with '$ar ts'."
21648 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21649 $test -f $ranlib || ranlib=''
21652 if $test -n "$ranlib"; then
21653 echo "your system has '$ranlib'; we'll use that."
21656 echo "your system doesn't seem to support random libraries"
21657 echo "so we'll use lorder and tsort to order the libraries."
21664 : see if this is a values.h system
21665 set values.h i_values
21668 : Check the max offset that gmtime and localtime accept
21669 echo "Checking max offsets that gmtime () accepts"
21672 define) yyy="#include <values.h>" ;;
21676 case "$sGMTIME_min/$sGMTIME_max" in
21679 #include <sys/types.h>
21688 void gm_check (time_t t, int min_year, int max_year)
21691 if ( tmp == NULL ||
21692 /* Check tm_year overflow */
21693 tmp->tm_year < min_year || tmp->tm_year > max_year)
21704 gm_check (MAXLONG, 69, 0x7fffffff);
21706 if (tmp == NULL || tmp->tm_year < 0) {
21707 for (i = 63; i >= 0; i--) {
21708 time_t x = pt | ((time_t)1 << i);
21709 if (x < 0 || x < pt) continue;
21710 gm_check (x, 69, 0x7fffffff);
21713 printf ("sGMTIME_max=%ld\n", pt);
21722 gm_check (MINLONG, -1900, 70);
21725 for (i = 36; i >= 0; i--) {
21726 time_t x = pt - ((time_t)1 << i);
21727 if (x > 0) continue;
21728 gm_check (x, -1900, 70);
21731 printf ("sGMTIME_min=%ld\n", pt);
21735 int main (int argc, char *argv[])
21737 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21744 if eval $compile; then
21745 eval `$run ./try 2>/dev/null`
21747 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21753 echo "Checking max offsets that localtime () accepts"
21755 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21758 #include <sys/types.h>
21767 void local_check (time_t t, int min_year, int max_year)
21769 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21772 tmp = localtime (&t);
21773 if ( tmp == NULL ||
21774 /* Check tm_year overflow */
21775 tmp->tm_year < min_year || tmp->tm_year > max_year)
21779 } /* local_check */
21786 local_check (MAXLONG, 69, 0x7fffffff);
21788 if (tmp == NULL || tmp->tm_year < 0) {
21789 for (i = 63; i >= 0; i--) {
21790 time_t x = pt | ((time_t)1 << i);
21791 if (x < 0 || x < pt) continue;
21792 local_check (x, 69, 0x7fffffff);
21795 printf ("sLOCALTIME_max=%ld\n", pt);
21804 local_check (MINLONG, -1900, 70);
21807 for (i = 36; i >= 0; i--) {
21808 time_t x = pt - ((time_t)1 << i);
21809 if (x > 0) continue;
21810 local_check (x, -1900, 70);
21813 printf ("sLOCALTIME_min=%ld\n", pt);
21817 int main (int argc, char *argv[])
21825 if eval $compile; then
21826 eval `$run ./try 2>/dev/null`
21828 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21834 : check for type of arguments to select.
21835 case "$selecttype" in
21836 '') case "$d_select" in
21840 Checking to see what type of arguments are accepted by select().
21842 hdrs="$define sys/types.h
21843 $i_systime sys/time.h
21844 $i_sysselct sys/select.h
21845 $d_socket sys/socket.h"
21846 : The first arg can be int, unsigned, or size_t
21847 : The last arg may or may not be 'const'
21849 : void pointer has been seen but using that
21850 : breaks the selectminbits test
21851 for xxx in 'fd_set *' 'int *'; do
21852 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21853 for tmo in 'struct timeval *' 'const struct timeval *'; do
21855 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21856 if ./protochk "$try" $hdrs; then
21857 echo "Your system accepts $xxx."
21866 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21867 case "$d_fd_set" in
21868 $define) dflt="fd_set *" ;;
21877 *) : no select, so pick a harmless default
21884 : check for the select 'width'
21885 case "$selectminbits" in
21886 '') safebits=`expr $ptrsize \* 8`
21887 case "$d_select" in
21891 Checking to see on how many bits at a time your select() operates...
21894 #include <sys/types.h>
21896 #$i_systime I_SYS_TIME
21897 #$i_systimek I_SYS_TIME_KERNEL
21902 # ifdef I_SYS_TIME_KERNEL
21905 # include <sys/time.h>
21906 # ifdef I_SYS_TIME_KERNEL
21910 #$i_sysselct I_SYS_SELECT
21911 #ifdef I_SYS_SELECT
21912 #include <sys/select.h>
21914 #$d_socket HAS_SOCKET
21916 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21919 #$i_stdlib I_STDLIB
21921 #include <stdlib.h>
21924 #define S sizeof(*(b))
21926 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21927 #define NBITS (NBYTES * 8)
21929 char *s = (char *)malloc(NBYTES);
21938 fp = fopen("try.c", "r");
21944 b = ($selecttype)s;
21945 for (i = 0; i < NBITS; i++)
21949 select(fd + 1, b, 0, 0, &t);
21950 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21952 printf("%d\n", i + 1);
21957 if eval $compile_ok; then
21958 selectminbits=`$run ./try 2>/dev/null`
21959 case "$selectminbits" in
21961 Cannot figure out on how many bits at a time your select() operates.
21962 I'll play safe and guess it is $safebits bits.
21964 selectminbits=$safebits
21965 bits="$safebits bits"
21968 *) bits="$selectminbits bits" ;;
21970 echo "Your select() operates on $bits at a time." >&4
21972 rp='What is the minimum number of bits your select() operates on?'
21973 case "$byteorder" in
21974 12345678) dflt=64 ;;
21980 selectminbits="$val"
21984 *) : no select, so pick a harmless default
21985 selectminbits=$safebits
21991 : Trace out the files included by signal.h, then look for SIGxxx names.
21992 if [ "X$fieldn" = X ]; then
21993 : Just make some guesses. We check them later.
21994 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21996 xxx=`echo '#include <signal.h>' |
21997 $cppstdin $cppminus $cppflags 2>/dev/null |
21998 $grep '^[ ]*#.*include' |
21999 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22000 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22003 for xx in $xxx /dev/null ; do
22004 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22006 case "$xxxfiles" in
22007 '') xxxfiles=`./findhdr signal.h` ;;
22010 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22011 print substr($2, 4, 20)
22013 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22014 print substr($3, 4, 20)
22016 : Append some common names just in case the awk scan failed.
22017 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22018 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22019 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22020 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22021 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22023 : generate a few handy files for later
22024 $cat > signal.c <<EOCP
22025 #include <sys/types.h>
22026 #include <signal.h>
22027 #$i_stdlib I_STDLIB
22029 #include <stdlib.h>
22034 /* Strange style to avoid deeply-nested #if/#else/#endif */
22037 # define NSIG (_NSIG)
22043 # define NSIG (SIGMAX+1)
22049 # define NSIG (SIG_MAX+1)
22055 # define NSIG (_SIG_MAX+1)
22061 # define NSIG (MAXSIG+1)
22067 # define NSIG (MAX_SIG+1)
22072 # ifdef SIGARRAYSIZE
22073 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22079 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22083 /* Default to some arbitrary number that's big enough to get most
22084 of the common signals.
22090 printf("NSIG %d\n", NSIG);
22096 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22098 printf "#ifdef SIG"; printf $1; printf "\n"
22099 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22100 printf $1; printf ");\n"
22104 printf "#endif /* JUST_NSIG */\n";
22105 printf "exit(0);\n}\n";
22108 $cat >signal.awk <<'EOP'
22109 BEGIN { ndups = 0 }
22110 $1 ~ /^NSIG$/ { nsig = $2 }
22111 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22112 if ($2 > maxsig) { maxsig = $2 }
22113 if (sig_name[$2]) {
22114 dup_name[ndups] = $1
22115 dup_num[ndups] = $2
22127 printf("NSIG %d\n", nsig);
22128 for (n = 1; n < nsig; n++) {
22130 printf("%s %d\n", sig_name[n], sig_num[n])
22133 printf("NUM%d %d\n", n, n)
22136 for (n = 0; n < ndups; n++) {
22137 printf("%s %d\n", dup_name[n], dup_num[n])
22141 $cat >signal_cmd <<EOS
22143 if $test -s signal.lst; then
22144 echo "Using your existing signal.lst file"
22149 $cat >>signal_cmd <<'EOS'
22152 if eval $compile_ok; then
22153 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22154 $uniq | $awk -f signal.awk >signal.lst
22156 echo "(I can't seem be able to compile the whole test program)" >&4
22157 echo "(I'll try it in little pieces.)" >&4
22158 set signal -DJUST_NSIG
22159 if eval $compile_ok; then
22160 $run ./signal$_exe > signal.nsg
22163 echo "I can't seem to figure out how many signals you have." >&4
22164 echo "Guessing 50." >&4
22165 echo 'NSIG 50' > signal.nsg
22167 : Now look at all the signal names, one at a time.
22168 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22169 $cat > signal.c <<EOCP
22170 #include <sys/types.h>
22171 #include <signal.h>
22174 printf("$xx %d\n", SIG${xx});
22179 if eval $compile; then
22180 echo "SIG${xx} found."
22181 $run ./signal$_exe >> signal.ls1
22183 echo "SIG${xx} NOT found."
22186 if $test -s signal.ls1; then
22187 $cat signal.nsg signal.ls1 |
22188 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22192 if $test -s signal.lst; then
22195 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22196 echo 'kill -l' >signal
22197 set X `csh -f <signal`
22201 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22203 echo $@ | $tr ' ' $trnl | \
22204 $awk '{ printf "%s %d\n", $1, ++s; }
22205 END { printf "NSIG %d\n", ++s }' >signal.lst
22207 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22209 chmod a+x signal_cmd
22210 $eunicefix signal_cmd
22212 : generate list of signal names
22214 case "$sig_name_init" in
22216 *) case "$sig_num_init" in
22217 ''|*,*) doinit=yes ;;
22222 echo "Generating a list of signal names and numbers..." >&4
22224 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22225 sig_name=`$awk 'BEGIN { printf "ZERO " }
22226 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22227 sig_num=`$awk 'BEGIN { printf "0 " }
22228 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22229 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22230 !/^NSIG/ { printf "\"%s\", ", $1 }
22231 END { printf "0\n" }' signal.lst`
22232 sig_num_init=`$awk 'BEGIN { printf "0, " }
22233 !/^NSIG/ { printf "%d, ", $2}
22234 END { printf "0\n"}' signal.lst`
22237 echo "The following $sig_count signals are available:"
22239 echo $sig_name | $awk \
22240 'BEGIN { linelen = 0 }
22242 for (i = 1; i <= NF; i++) {
22243 name = "SIG" $i " "
22244 linelen = linelen + length(name)
22245 if (linelen > 70) {
22247 linelen = length(name)
22253 sig_size=`echo $sig_name | awk '{print NF}'`
22254 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22256 : Check size of size
22258 case "$sizetype" in
22259 *_t) zzz="$sizetype" ;;
22260 *) zzz="filesize" ;;
22262 echo "Checking the size of $zzz..." >&4
22264 #include <sys/types.h>
22266 #$i_stdlib I_STDLIB
22268 #include <stdlib.h>
22271 printf("%d\n", (int)sizeof($sizetype));
22276 if eval $compile_ok; then
22280 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22283 echo "Your $zzz size is $sizesize bytes."
22288 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22292 : check for socklen_t
22294 echo "Checking to see if you have socklen_t..." >&4
22296 #include <sys/types.h>
22297 #$d_socket HAS_SOCKET
22299 #include <sys/socket.h>
22301 int main() { socklen_t x = 16; }
22304 if eval $compile; then
22306 echo "You have socklen_t."
22309 echo "You do not have socklen_t."
22310 case "$sizetype" in
22311 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22318 : see if this is a socks.h system
22319 set socks.h i_socks
22322 : check for type of the size argument to socket calls
22323 case "$d_socket" in
22327 Checking to see what type is the last argument of accept().
22330 case "$d_socklen_t" in
22331 "$define") yyy="$yyy socklen_t"
22333 yyy="$yyy $sizetype int long unsigned"
22334 for xxx in $yyy; do
22335 case "$socksizetype" in
22336 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22337 case "$usesocks" in
22339 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22340 echo "Your system accepts '$xxx *' for the last argument of accept()."
22341 socksizetype="$xxx"
22344 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22345 echo "Your system accepts '$xxx *' for the last argument of accept()."
22346 socksizetype="$xxx"
22353 : In case none of those worked, prompt the user.
22354 case "$socksizetype" in
22355 '') rp='What is the type for socket address structure sizes?'
22362 *) : no sockets, so pick relatively harmless default
22367 : see what type is used for signed size_t
22368 set ssize_t ssizetype int stdio.h sys/types.h
22373 #$i_stdlib I_STDLIB
22375 #include <stdlib.h>
22377 #include <sys/types.h>
22378 #define Size_t $sizetype
22379 #define SSize_t $dflt
22382 if (sizeof(Size_t) == sizeof(SSize_t))
22384 else if (sizeof(Size_t) == sizeof(int))
22393 if eval $compile_ok && $run ./try > /dev/null; then
22394 ssizetype=`$run ./try`
22395 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22398 Help! I can't compile and run the ssize_t test program: please enlighten me!
22399 (This is probably a misconfiguration in your system or libraries, and
22400 you really ought to fix it. Still, I'll try anyway.)
22402 I need a type that is the same size as $sizetype, but is guaranteed to
22403 be signed. Common values are ssize_t, int and long.
22406 rp="What signed type is the same size as $sizetype?"
22412 : Check the size of st_ino
22414 $echo "Checking the size of st_ino..." >&4
22415 $cat > try.c <<EOCP
22416 #include <sys/stat.h>
22418 #$i_stdlib I_STDLIB
22420 #include <stdlib.h>
22424 printf("%d\n", (int)sizeof(st.st_ino));
22429 if eval $compile_ok; then
22433 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22435 *) st_ino_size=$val
22436 $echo "Your st_ino is $st_ino_size bytes long."
22441 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22445 : Check if st_ino is signed
22447 $echo "Checking the sign of st_ino..." >&4
22448 $cat > try.c <<EOCP
22449 #include <sys/stat.h>
22454 if (foo.st_ino < 0)
22461 if eval $compile; then
22465 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22467 *) st_ino_sign=$val
22468 case "$st_ino_sign" in
22469 1) $echo "Your st_ino is unsigned." ;;
22470 -1) $echo "Your st_ino is signed." ;;
22476 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22480 : see what type of char stdio uses.
22482 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22483 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22484 echo "Your stdio uses unsigned chars." >&4
22485 stdchar="unsigned char"
22487 echo "Your stdio uses signed chars." >&4
22492 : see what type uids are declared as in the kernel
22494 echo "Looking for the type for user ids returned by getuid()."
22495 set uid_t uidtype xxx stdio.h sys/types.h
22499 xxx=`./findhdr sys/user.h`
22500 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
22502 unsigned) dflt="$1 $2" ;;
22506 *) dflt="$uidtype";;
22509 uid_t) echo "uid_t found." ;;
22510 *) rp="What is the type for user ids returned by getuid()?"
22516 : Check size of UID
22519 *_t) zzz="$uidtype" ;;
22522 echo "Checking the size of $zzz..." >&4
22524 #include <sys/types.h>
22526 #$i_stdlib I_STDLIB
22528 #include <stdlib.h>
22531 printf("%d\n", (int)sizeof($uidtype));
22536 if eval $compile_ok; then
22540 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22543 echo "Your $zzz is $uidsize bytes long."
22548 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22551 : Check if UID is signed
22554 *_t) zzz="$uidtype" ;;
22557 echo "Checking the sign of $zzz..." >&4
22559 #include <sys/types.h>
22570 if eval $compile; then
22574 echo "(I can't execute the test program--guessing unsigned.)" >&4
22578 1) echo "Your $zzz is unsigned." ;;
22579 -1) echo "Your $zzz is signed." ;;
22585 echo "(I can't compile the test program--guessing unsigned.)" >&4
22589 : Check format string for UID
22591 $echo "Checking the format string to be used for uids..." >&4
22594 -1) if $test X"$uidsize" = X"$ivsize"; then
22595 uidformat="$ivdformat"
22597 if $test X"$uidsize" = X"$longsize"; then
22600 if $test X"$uidsize" = X"$intsize"; then
22603 if $test X"$uidsize" = X"$shortsize"; then
22610 *) if $test X"$uidsize" = X"$uvsize"; then
22611 uidformat="$uvuformat"
22613 if $test X"$uidsize" = X"$longsize"; then
22616 if $test X"$uidsize" = X"$intsize"; then
22619 if $test X"$uidsize" = X"$shortsize"; then
22628 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22630 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22631 $cat >try.c <<'EOM'
22632 /* Intentionally a long probe as I'd like to sanity check that the exact
22633 approach is going to work, as thinking it will work, but only having it
22634 part working at runtime is worse than not having it. */
22636 #include <sys/types.h>
22637 #include <sys/sysctl.h>
22638 #include <sys/param.h>
22640 #include <string.h>
22641 #include <stdlib.h>
22642 #include <unistd.h>
22645 main(int argc, char **argv) {
22647 char *argv_leaf = strrchr(argv[0], '/');
22653 mib[1] = KERN_PROC;
22654 mib[2] = KERN_PROC_PATHNAME;
22658 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22662 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22667 if (size < strlen(argv_leaf) + 1) {
22668 fprintf(stderr, "size %lu is too short for a path\n",
22669 (unsigned long) size);
22673 if (size > MAXPATHLEN * MAXPATHLEN) {
22674 fprintf(stderr, "size %lu is too long for a path\n",
22675 (unsigned long) size);
22679 buffer = malloc(size);
22685 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22690 if (strlen(buffer) + 1 != size) {
22691 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22692 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22697 if (*buffer != '/') {
22698 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22702 if (strstr(buffer, "/./")) {
22703 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22707 if (strstr(buffer, "/../")) {
22708 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22712 buffer_leaf = strrchr(buffer, '/');
22713 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22714 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22726 if eval $compile; then
22727 if $run ./try; then
22728 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22731 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22735 echo "I'm unable to compile the test program." >&4
22736 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22740 set usekernprocpathname
22743 : Determine if we can use _NSGetExecutablePath to find executing program
22745 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22746 $cat >try.c <<'EOM'
22747 /* Intentionally a long probe as I'd like to sanity check that the exact
22748 approach is going to work, as thinking it will work, but only having it
22749 part working at runtime is worse than not having it. */
22750 #include <mach-o/dyld.h>
22752 #include <stdlib.h>
22753 #include <sys/param.h>
22754 #include <string.h>
22757 main(int argc, char **argv) {
22759 uint32_t size = sizeof(buf);
22763 char *argv_leaf = strrchr(argv[0], '/');
22767 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22771 _NSGetExecutablePath(buf, &size);
22772 if (size > MAXPATHLEN * MAXPATHLEN) {
22773 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22774 (unsigned int) size);
22778 buffer = malloc(size);
22784 result = _NSGetExecutablePath(buffer, &size);
22786 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22787 result, (unsigned int) size);
22791 tidied = realpath(buffer, NULL);
22793 perror("realpath");
22799 if (*tidied != '/') {
22800 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22804 if (strstr(tidied, "/./")) {
22805 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22809 if (strstr(tidied, "/../")) {
22810 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22814 tidied_leaf = strrchr(tidied, '/');
22815 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22816 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22828 if eval $compile; then
22829 if $run ./try; then
22830 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22833 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22836 echo "I'm unable to compile the test program." >&4
22837 echo "I'll assume no _NSGetExecutablePath here." >&4
22840 set usensgetexecutablepath
22843 : Check if site customization support was requested
22844 case "$usesitecustomize" in
22845 $define|true|[Yy]*)
22846 usesitecustomize="$define"
22849 usesitecustomize="$undef"
22853 : see if prototypes support variable argument declarations
22855 case "$prototype$i_stdarg" in
22857 echo "It appears we'll be able to prototype varargs functions." >&4
22861 echo "Too bad... We won't be using prototyped varargs functions..." >&4
22868 : determine compiler compiler
22877 if $test -f "$byacc$_exe"; then
22879 comp="byacc or $comp"
22881 if $test -f "$bison$_exe"; then
22882 comp="$comp or bison -y"
22884 rp="Which compiler compiler ($comp) shall I use?"
22893 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22899 : see if this is a assert.h system
22900 set assert.h i_assert
22903 : see if this is a bfd.h system
22907 : see if this is an execinfo.h system
22908 set execinfo.h i_execinfo
22911 : see if this is a fenv.h system
22915 : see if this is a fp.h system
22919 : see if this is a fp_class.h system
22920 set fp_class.h i_fp_class
22923 : see if gdbm.h is available
22928 : see if gdbm_open exists
22929 set gdbm_open d_gdbm_open
22931 case "$d_gdbm_open" in
22934 echo "We won't be including <gdbm.h>"
22943 : see if this is a ieeefp.h system
22944 case "$i_ieeefp" in
22945 '' ) set ieeefp.h i_ieeefp
22950 : see if this is a libutil.h system
22951 set libutil.h i_libutil
22954 : see if mach cthreads are available
22955 if test "X$usethreads" = "X$define"; then
22956 set mach/cthreads.h i_machcthr
22959 i_machcthr="$undef"
22962 : see if this is a mntent.h system
22963 set mntent.h i_mntent
22966 : see if net/errno.h is available
22968 set net/errno.h val
22971 : Unfortunately, it causes problems on some systems. Arrgh.
22974 cat > try.c <<'EOM'
22977 #include <net/errno.h>
22983 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22984 echo "We'll be including <net/errno.h>." >&4
22986 echo "We won't be including <net/errno.h>." >&4
22995 : see if netinet/tcp.h is available
22996 set netinet/tcp.h i_netinettcp
22999 : see if this is a poll.h system
23003 : see if this is a prot.h system
23007 : Preprocessor symbols
23009 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23010 $cat <<'EOSH' > Cppsym.know
23011 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23012 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23013 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23014 arch_pwr ardent ARM ARM32 atarist att386 att3b
23015 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23016 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23017 byteorder byte_order
23018 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23019 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23020 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23021 ELF encore EPI EXTENSIONS
23022 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23023 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23024 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23025 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23026 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23027 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23028 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23029 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23030 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23032 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23033 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23034 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23036 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23037 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23038 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23039 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23040 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23041 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23042 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23043 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23044 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23045 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23046 ns32000 ns32016 ns32332 ns32k nsc32000
23047 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23048 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23049 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23050 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23052 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23053 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23054 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23055 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23056 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23057 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23058 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23059 SYSV4 SYSV5 sysV68 sysV88
23060 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23061 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23062 tower32_800 tower32_850 tss
23063 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23064 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23065 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23066 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23067 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23068 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23070 vax venix VMESA vms
23071 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23072 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23075 # Maybe put other stuff here too.
23076 ./tr '-' '_' <<EOSH >>Cppsym.know
23079 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23080 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23081 $cat Cppsym.know > Cppsym.c
23082 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23083 $rm -f Cppsym.a Cppsym.b Cppsym.c
23084 cat <<EOSH > Cppsym
23086 if $test \$# -gt 0; then
23087 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23088 if $test -s Cppsym.got; then
23095 $tr " " "$trnl" | ./Cppsym.try
23101 cat <<EOSH > Cppsym.try
23103 cat <<'EOCP' > try.c
23106 #define STRINGIFY(a) "a"
23108 #if cpp_stuff == 42
23109 #define StGiFy(a) #a
23110 #define STRINGIFY(a) StGiFy(a)
23112 #if $cpp_stuff != 1 && $cpp_stuff != 42
23113 # include "Bletch: How does this C preprocessor stringify macros?"
23119 cat <<'EOSH' >> Cppsym.try
23121 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23122 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23123 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23124 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23126 echo 'return 0;}' >> try.c
23128 cat <<EOSH >> Cppsym.try
23130 case "$osname-$gccversion" in
23131 irix-) ccflags="\$ccflags -woff 1178" ;;
23132 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23134 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
23136 chmod +x Cppsym.try
23137 $eunicefix Cppsym.try
23138 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23139 : Add in any Linux cpp "predefined macros":
23140 case "$osname::$gccversion" in
23141 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23143 rm -f $tHdrH'.h' $tHdrH
23145 # Filter out macro arguments, such as Linux's __INT8_C(c)
23146 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23147 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23148 if [ -s $tHdrH'_cppsym.real' ]; then
23149 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23152 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23155 : now check the C compiler for additional symbols
23156 postprocess_cc_v=''
23158 aix) postprocess_cc_v="|$tr , ' '" ;;
23165 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23168 -D*) echo "\$i" | $sed 's/^-D//';;
23169 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23174 postprocess_cc_v=''
23177 ./ccsym > ccsym1.raw
23178 if $test -s ccsym1.raw; then
23179 $sort ccsym1.raw | $uniq >ccsym.raw
23181 mv ccsym1.raw ccsym.raw
23184 $awk '/\=/ { print $0; next }
23185 { print $0"=1" }' ccsym.raw >ccsym.list
23186 $comm -13 Cppsym.true ccsym.list >ccsym.own
23187 $comm -12 Cppsym.true ccsym.list >ccsym.com
23188 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23190 if $test -z ccsym.raw; then
23191 echo "Your C compiler doesn't seem to define any symbols!" >&4
23193 echo "However, your C preprocessor defines the following symbols:"
23196 cppsymbols=`$cat Cppsym.true`
23197 cppsymbols=`echo $cppsymbols`
23198 cppccsymbols="$cppsymbols"
23200 if $test -s ccsym.com; then
23201 echo "Your C compiler and pre-processor define these symbols:"
23202 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23205 cppccsymbols=`$cat ccsym.com`
23206 cppccsymbols=`echo $cppccsymbols`
23207 $test "$silent" || sleep 1
23209 if $test -s ccsym.cpp; then
23210 $test "$also" && echo " "
23211 echo "Your C pre-processor ${also}defines the following symbols:"
23212 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23214 cppsymbols=`$cat ccsym.cpp`
23215 cppsymbols=`echo $cppsymbols`
23216 $test "$silent" || sleep 1
23218 if $test -s ccsym.own; then
23219 $test "$also" && echo " "
23220 echo "Your C compiler ${also}defines the following cpp symbols:"
23221 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23222 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23223 ccsymbols=`$cat ccsym.own`
23224 ccsymbols=`echo $ccsymbols`
23225 $test "$silent" || sleep 1
23229 : add -D_FORTIFY_SOURCE if feasible and not already there
23230 case "$gccversion" in
23231 4.*) case "$optimize$ccflags" in
23232 *-O*) case "$ccflags$cppsymbols" in
23233 *_FORTIFY_SOURCE=*) # Don't add it again.
23234 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23236 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23237 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23241 *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23245 *) echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4
23249 : see if this is a termio system
23253 if $test `./findhdr termios.h`; then
23254 set tcsetattr i_termios
23260 "$define") echo "You have POSIX termios.h... good!" >&4;;
23261 *) if ./Cppsym pyr; then
23262 case "`$run /bin/universe`" in
23263 ucb) if $test `./findhdr sgtty.h`; then
23265 echo "<sgtty.h> found." >&4
23267 echo "System is pyramid with BSD universe."
23268 ./warn "<sgtty.h> not found--you could have problems."
23270 *) if $test `./findhdr termio.h`; then
23272 echo "<termio.h> found." >&4
23274 echo "System is pyramid with USG universe."
23275 ./warn "<termio.h> not found--you could have problems."
23279 if $test `./findhdr termio.h`; then
23280 echo "<termio.h> found." >&4
23282 elif $test `./findhdr sgtty.h`; then
23283 echo "<sgtty.h> found." >&4
23286 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23289 if $test `./findhdr sgtty.h`; then
23290 echo "<sgtty.h> found." >&4
23292 elif $test `./findhdr termio.h`; then
23293 echo "<termio.h> found." >&4
23296 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23300 set i_termio; eval $setvar
23301 val=$val2; set i_sgtty; eval $setvar
23302 val=$val3; set i_termios; eval $setvar
23304 : see if stdbool is available
23305 : we want a real compile instead of Inhdr because some Solaris systems
23306 : have stdbool.h, but it can only be used if the compiler indicates it
23307 : is sufficiently c99-compliant.
23311 #include <stdbool.h>
23316 int main(int argc, char **argv)
23322 if eval $compile; then
23323 echo "<stdbool.h> found." >&4
23326 echo "<stdbool.h> NOT found." >&4
23333 : see if stddef is available
23334 set stddef.h i_stddef
23337 : see if stdint is available
23338 set stdint.h i_stdint
23341 : see if sys/access.h is available
23342 set sys/access.h i_sysaccess
23345 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23346 set sys/filio.h i_sysfilio
23349 if $test `./findhdr sys/ioctl.h`; then
23351 echo '<sys/ioctl.h> found.' >&4
23354 if $test $i_sysfilio = "$define"; then
23355 echo '<sys/ioctl.h> NOT found.' >&4
23357 $test $i_sgtty = "$define" && xxx="sgtty.h"
23358 $test $i_termio = "$define" && xxx="termio.h"
23359 $test $i_termios = "$define" && xxx="termios.h"
23360 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23366 : see if socket ioctl defs are in sys/sockio.h
23368 xxx=`./findhdr sys/sockio.h`
23369 if $test "$xxx"; then
23370 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23372 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23375 echo "No socket ioctls found in <sys/sockio.h>." >&4
23380 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23386 : see if this is a syslog.h system
23387 set syslog.h i_syslog
23390 : see if this is a sys/mode.h system
23391 set sys/mode.h i_sysmode
23394 : see if there is a sys/poll.h file
23395 set sys/poll.h i_syspoll
23398 : see if sys/resource.h has to be included
23399 set sys/resource.h i_sysresrc
23402 : see if sys/security.h is available
23403 set sys/security.h i_syssecrt
23406 : see if this is a sys/statvfs.h system
23407 set sys/statvfs.h i_sysstatvfs
23410 : see if this is a sys/un.h system
23411 set sys/un.h i_sysun
23414 : see if this is a sys/utsname.h system
23415 set sys/utsname.h i_sysutsname
23418 : see if this is a syswait system
23419 set sys/wait.h i_syswait
23422 : see if this is a ustat.h system
23423 set ustat.h i_ustat
23426 : see if this is an utime system
23427 set utime.h i_utime
23430 : see if this is a vfork system
23433 set vfork.h i_vfork
23443 echo "Looking for extensions..." >&4
23444 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23445 : contain old or inaccurate or duplicate values.
23446 nonxs_extensions=''
23448 : We do not use find because it might not be available.
23449 : We do not just use MANIFEST because the user may have dropped
23450 : some additional extensions into the source tree and expect them
23453 : Function to recursively find available extensions, ignoring DynaLoader
23454 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23455 : In 5.10.1 and later, extensions are stored in directories
23456 : like File-Glob instead of the older File/Glob/.
23460 DynaLoader|dynaload) ;;
23462 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
23463 case "$this_ext" in
23464 Scalar/List/Utils) this_ext="List/Util" ;;
23465 PathTools) this_ext="Cwd" ;;
23467 echo " $xs_extensions $nonxs_extensions" > $tdir/$$.tmp;
23468 if $contains " $this_ext " $tdir/$$.tmp; then
23470 echo "Duplicate directories detected for extension $xxx" >&4;
23471 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23472 case "$knowitall" in
23480 echo "Ok. Stopping Configure." >&4;
23481 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23484 echo "Ok. You will need to correct config.sh before running make." >&4;
23486 $ls -1 $xxx > $tdir/$$.tmp;
23487 if $contains "\.xs$" $tdir/$$.tmp > /dev/null 2>&1; then
23488 xs_extensions="$xs_extensions $this_ext";
23489 elif $contains "\.c$" $tdir/$$.tmp > /dev/null 2>&1; then
23490 xs_extensions="$xs_extensions $this_ext";
23491 elif $test -d $xxx; then
23492 nonxs_extensions="$nonxs_extensions $this_ext";
23494 $rm -f $tdir/$$.tmp;
23502 eval $find_extensions
23506 eval $find_extensions
23510 eval $find_extensions
23511 set X $xs_extensions
23513 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23514 set X $nonxs_extensions
23516 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23518 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23520 : Now see which are supported on this system.
23522 for xxx in $xs_extensions ; do
23526 $define) avail_ext="$avail_ext $xxx" ;;
23529 GDBM_File|gdbm_fil)
23531 $define) avail_ext="$avail_ext $xxx" ;;
23534 I18N/Langinfo|i18n_lan)
23535 case "$i_langinfo$d_nl_langinfo" in
23536 $define$define) avail_ext="$avail_ext $xxx" ;;
23540 : XXX Do we need a useipcsysv variable here
23541 case "${d_msg}${d_sem}${d_shm}" in
23542 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23545 NDBM_File|ndbm_fil)
23548 case "$osname-$use64bitint" in
23551 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23554 *) avail_ext="$avail_ext $xxx" ;;
23559 ODBM_File|odbm_fil)
23560 case "${i_dbm}${i_rpcsvcdbm}" in
23562 case "$d_cplusplus" in
23563 define) ;; # delete as a function name will not work
23564 *) case "$osname-$use64bitint" in
23567 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23570 *) avail_ext="$avail_ext $xxx" ;;
23578 case "$useopcode" in
23579 true|define|y) avail_ext="$avail_ext $xxx" ;;
23583 case "$useposix" in
23584 true|define|y) avail_ext="$avail_ext $xxx" ;;
23588 case "$d_socket" in
23589 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23592 Sys/Syslog|sys/syslog)
23593 : XXX syslog requires socket
23594 case "$d_socket" in
23595 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23599 case "$usethreads" in
23601 case "$use5005threads" in
23602 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23606 threads|threads/shared)
23607 # threads and threads::shared are special cases.
23608 # To stop people from asking "Perl 5.8.0 was supposed
23609 # to have this new fancy threads implementation but my
23610 # perl doesn't have it" and from people trying to
23611 # (re)install the threads module using CPAN.pm and
23612 # CPAN.pm then offering to reinstall Perl 5.8.0,
23613 # the threads.pm and threads/shared.pm will always be
23614 # there, croaking informatively ("you need to rebuild
23615 # all of Perl with threads, sorry") when threads haven't
23616 # been compiled in.
23618 avail_ext="$avail_ext $xxx"
23624 cygwin) avail_ext="$avail_ext $xxx" ;;
23627 XS/APItest|xs/apitest)
23628 # This is just for testing. Skip it unless we have dynamic loading.
23631 $define) avail_ext="$avail_ext $xxx" ;;
23634 XS/Typemap|xs/typemap)
23635 # This is just for testing. Skip it unless we have dynamic loading.
23637 $define) avail_ext="$avail_ext $xxx" ;;
23640 *) avail_ext="$avail_ext $xxx"
23649 case "$onlyextensions" in
23651 *) keepextensions=''
23652 echo "You have requested that only certain extensions be included..." >&4
23653 for i in $onlyextensions; do
23654 case " $avail_ext " in
23656 echo "Keeping extension $i."
23657 keepextensions="$keepextensions $i"
23659 *) echo "Ignoring extension $i." ;;
23662 avail_ext="$keepextensions"
23666 case "$noextensions" in
23668 *) keepextensions=''
23669 echo "You have requested that certain extensions be ignored..." >&4
23670 for i in $avail_ext; do
23671 case " $noextensions " in
23672 *" $i "*) echo "Ignoring extension $i." ;;
23673 *) echo "Keeping extension $i.";
23674 keepextensions="$keepextensions $i"
23678 avail_ext="$keepextensions"
23682 : Now see which nonxs extensions are supported on this system.
23683 : For now assume all are.
23685 for xxx in $nonxs_extensions ; do
23689 *) nonxs_ext="$nonxs_ext $xxx"
23701 A number of extensions are supplied with $package. You may choose to
23702 compile these extensions for dynamic loading (the default), compile
23703 them into the $package executable (static loading), or not include
23704 them at all. Answer "none" to include no extensions.
23705 Note that DynaLoader is always built and need not be mentioned here.
23708 case "$dynamic_ext" in
23710 : Exclude those listed in static_ext
23712 for xxx in $avail_ext; do
23713 case " $static_ext " in
23715 *) dflt="$dflt $xxx" ;;
23722 *) dflt="$dynamic_ext"
23723 # Perhaps we are reusing an old out-of-date config.sh.
23726 if test X"$dynamic_ext" != X"$avail_ext"; then
23728 NOTICE: Your previous config.sh list may be incorrect.
23729 The extensions now available to you are
23731 but the default list from your previous config.sh is
23743 rp="What extensions do you wish to load dynamically?"
23746 none) dynamic_ext=' ' ;;
23747 *) dynamic_ext="$ans" ;;
23750 case "$static_ext" in
23752 : Exclude those already listed in dynamic linking
23754 for xxx in $avail_ext; do
23755 case " $dynamic_ext " in
23757 *) dflt="$dflt $xxx" ;;
23764 *) dflt="$static_ext"
23771 rp="What extensions do you wish to load statically?"
23774 none) static_ext=' ' ;;
23775 *) static_ext="$ans" ;;
23780 A number of extensions are supplied with $package. Answer "none"
23781 to include no extensions.
23782 Note that DynaLoader is always built and need not be mentioned here.
23785 case "$static_ext" in
23786 '') dflt="$avail_ext" ;;
23787 *) dflt="$static_ext"
23788 # Perhaps we are reusing an old out-of-date config.sh.
23791 if test X"$static_ext" != X"$avail_ext"; then
23793 NOTICE: Your previous config.sh list may be incorrect.
23794 The extensions now available to you are
23796 but the default list from your previous config.sh is
23805 : Exclude those that are not xs extensions
23809 rp="What extensions do you wish to include?"
23812 none) static_ext=' ' ;;
23813 *) static_ext="$ans" ;;
23818 # Encode is a special case. If we are building Encode as a static
23819 # extension, we need to explicitly list its subextensions as well.
23820 # For other nested extensions, this is handled automatically by
23821 # the appropriate Makefile.PL.
23822 case " $static_ext " in
23823 *" Encode "*) # Add the subextensions of Encode
23825 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23826 static_ext="$static_ext Encode/$xxx"
23827 known_extensions="$known_extensions Encode/$xxx"
23833 set X $dynamic_ext $static_ext $nonxs_ext
23837 # Sanity check: We require an extension suitable for use with
23838 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23839 # should show up as failures in the test suite, but it's helpful to
23840 # catch them now.) The 'extensions' list is normally sorted
23841 # alphabetically, so we need to accept either
23842 # DB_File ... Fcntl ... IO ....
23843 # or something like
23844 # Fcntl ... NDBM_File ... IO ....
23845 case " $extensions" in
23846 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23847 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23848 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23849 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23850 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23854 : Remove libraries needed only for extensions
23855 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23856 : The exception is SunOS 4.x, which needs them.
23857 case "${osname}X${osvers}" in
23861 *) case "$usedl" in
23862 $define|true|[yY]*)
23863 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23867 *) perllibs="$libs"
23873 : Remove build directory name from cppstdin so it can be used from
23874 : either the present location or the final installed location.
23876 : Get out of the UU directory to get correct path name.
23878 case "$cppstdin" in
23880 echo "Stripping down cppstdin path name"
23886 : end of configuration questions
23888 echo "End of configuration questions."
23891 : back to where it started
23892 if test -d ../UU; then
23896 : configuration may be unconditionally patched via a 'config.arch' file
23897 if $test -f config.arch; then
23898 echo "I see a config.arch file, loading it." >&4
23902 : configuration may be patched via a 'config.over' file
23903 if $test -f config.over; then
23906 rp='I see a config.over file. Do you wish to load it?'
23909 n*) echo "OK, I'll ignore it.";;
23911 echo "Configuration override changes have been loaded."
23916 : in case they want portability, strip down executable paths
23917 case "$d_portable" in
23920 echo "Stripping down executable paths..." >&4
23921 for file in $loclist $trylist; do
23923 eval $file=`basename $temp`
23928 : create config.sh file
23930 echo "Creating config.sh..." >&4
23931 $spitshell <<EOT >config.sh
23934 # This file was produced by running the Configure script. It holds all the
23935 # definitions figured out by Configure. Should you modify one of these values,
23936 # do not forget to propagate your changes by running "Configure -der". You may
23937 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23940 # Package name : $package
23941 # Source directory : $src
23942 # Configuration time: $cf_time
23943 # Configured by : $cf_by
23944 # Target system : $myuname
23947 : Add in command line options if available
23948 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23950 $spitshell <<EOT >>config.sh
23959 Revision='$Revision'
23967 alignbytes='$alignbytes'
23968 ansi2knr='$ansi2knr'
23969 aphostname='$aphostname'
23970 api_revision='$api_revision'
23971 api_subversion='$api_subversion'
23972 api_version='$api_version'
23973 api_versionstring='$api_versionstring'
23976 archlibexp='$archlibexp'
23977 archname64='$archname64'
23978 archname='$archname'
23979 archobjs='$archobjs'
23980 asctime_r_proto='$asctime_r_proto'
23989 byteorder='$byteorder'
23991 castflags='$castflags'
23994 cccdlflags='$cccdlflags'
23995 ccdlflags='$ccdlflags'
23997 ccflags_uselargefiles='$ccflags_uselargefiles'
23999 ccsymbols='$ccsymbols'
24000 ccversion='$ccversion'
24002 cf_email='$cf_email'
24004 charbits='$charbits'
24005 charsize='$charsize'
24009 clocktype='$clocktype'
24011 compress='$compress'
24012 contains='$contains'
24016 cpp_stuff='$cpp_stuff'
24017 cppccsymbols='$cppccsymbols'
24018 cppflags='$cppflags'
24020 cppminus='$cppminus'
24022 cppstdin='$cppstdin'
24023 cppsymbols='$cppsymbols'
24024 crypt_r_proto='$crypt_r_proto'
24025 cryptlib='$cryptlib'
24027 ctermid_r_proto='$ctermid_r_proto'
24028 ctime_r_proto='$ctime_r_proto'
24029 d_Gconvert='$d_Gconvert'
24030 d_PRIEUldbl='$d_PRIEUldbl'
24031 d_PRIFUldbl='$d_PRIFUldbl'
24032 d_PRIGUldbl='$d_PRIGUldbl'
24033 d_PRIXU64='$d_PRIXU64'
24034 d_PRId64='$d_PRId64'
24035 d_PRIeldbl='$d_PRIeldbl'
24036 d_PRIfldbl='$d_PRIfldbl'
24037 d_PRIgldbl='$d_PRIgldbl'
24038 d_PRIi64='$d_PRIi64'
24039 d_PRIo64='$d_PRIo64'
24040 d_PRIu64='$d_PRIu64'
24041 d_PRIx64='$d_PRIx64'
24042 d_SCNfldbl='$d_SCNfldbl'
24043 d__fwalk='$d__fwalk'
24044 d_access='$d_access'
24045 d_accessx='$d_accessx'
24049 d_archlib='$d_archlib'
24050 d_asctime64='$d_asctime64'
24051 d_asctime_r='$d_asctime_r'
24056 d_attribute_deprecated='$d_attribute_deprecated'
24057 d_attribute_format='$d_attribute_format'
24058 d_attribute_malloc='$d_attribute_malloc'
24059 d_attribute_nonnull='$d_attribute_nonnull'
24060 d_attribute_noreturn='$d_attribute_noreturn'
24061 d_attribute_pure='$d_attribute_pure'
24062 d_attribute_unused='$d_attribute_unused'
24063 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24064 d_backtrace='$d_backtrace'
24068 d_bsdgetpgrp='$d_bsdgetpgrp'
24069 d_bsdsetpgrp='$d_bsdsetpgrp'
24070 d_builtin_choose_expr='$d_builtin_choose_expr'
24071 d_builtin_expect='$d_builtin_expect'
24073 d_c99_variadic_macros='$d_c99_variadic_macros'
24074 d_casti32='$d_casti32'
24075 d_castneg='$d_castneg'
24077 d_charvspr='$d_charvspr'
24079 d_chroot='$d_chroot'
24080 d_chsize='$d_chsize'
24082 d_clearenv='$d_clearenv'
24083 d_closedir='$d_closedir'
24084 d_cmsghdr_s='$d_cmsghdr_s'
24086 d_copysign='$d_copysign'
24087 d_copysignl='$d_copysignl'
24088 d_cplusplus='$d_cplusplus'
24090 d_crypt_r='$d_crypt_r'
24092 d_ctermid='$d_ctermid'
24093 d_ctermid_r='$d_ctermid_r'
24094 d_ctime64='$d_ctime64'
24095 d_ctime_r='$d_ctime_r'
24096 d_cuserid='$d_cuserid'
24097 d_dbl_dig='$d_dbl_dig'
24098 d_dbminitproto='$d_dbminitproto'
24099 d_difftime64='$d_difftime64'
24100 d_difftime='$d_difftime'
24101 d_dir_dd_fd='$d_dir_dd_fd'
24103 d_dirnamlen='$d_dirnamlen'
24104 d_dladdr='$d_dladdr'
24105 d_dlerror='$d_dlerror'
24106 d_dlopen='$d_dlopen'
24107 d_dlsymun='$d_dlsymun'
24108 d_dosuid='$d_dosuid'
24109 d_drand48_r='$d_drand48_r'
24110 d_drand48proto='$d_drand48proto'
24112 d_eaccess='$d_eaccess'
24113 d_endgrent='$d_endgrent'
24114 d_endgrent_r='$d_endgrent_r'
24115 d_endhent='$d_endhent'
24116 d_endhostent_r='$d_endhostent_r'
24117 d_endnent='$d_endnent'
24118 d_endnetent_r='$d_endnetent_r'
24119 d_endpent='$d_endpent'
24120 d_endprotoent_r='$d_endprotoent_r'
24121 d_endpwent='$d_endpwent'
24122 d_endpwent_r='$d_endpwent_r'
24123 d_endsent='$d_endsent'
24124 d_endservent_r='$d_endservent_r'
24125 d_eofnblk='$d_eofnblk'
24128 d_eunice='$d_eunice'
24131 d_faststdio='$d_faststdio'
24132 d_fchdir='$d_fchdir'
24133 d_fchmod='$d_fchmod'
24134 d_fchown='$d_fchown'
24136 d_fcntl_can_lock='$d_fcntl_can_lock'
24137 d_fd_macros='$d_fd_macros'
24138 d_fd_set='$d_fd_set'
24140 d_fds_bits='$d_fds_bits'
24141 d_fegetround='$d_fegetround'
24142 d_fgetpos='$d_fgetpos'
24143 d_finite='$d_finite'
24144 d_finitel='$d_finitel'
24145 d_flexfnam='$d_flexfnam'
24147 d_flockproto='$d_flockproto'
24152 d_fp_class='$d_fp_class'
24153 d_fp_classify='$d_fp_classify'
24154 d_fp_classl='$d_fp_classl'
24155 d_fpathconf='$d_fpathconf'
24156 d_fpclass='$d_fpclass'
24157 d_fpclassify='$d_fpclassify'
24158 d_fpclassl='$d_fpclassl'
24159 d_fpgetround='$d_fpgetround'
24160 d_fpos64_t='$d_fpos64_t'
24161 d_frexpl='$d_frexpl'
24162 d_fs_data_s='$d_fs_data_s'
24163 d_fseeko='$d_fseeko'
24164 d_fsetpos='$d_fsetpos'
24165 d_fstatfs='$d_fstatfs'
24166 d_fstatvfs='$d_fstatvfs'
24168 d_ftello='$d_ftello'
24170 d_futimes='$d_futimes'
24171 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24172 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24173 d_getaddrinfo='$d_getaddrinfo'
24174 d_getcwd='$d_getcwd'
24175 d_getespwnam='$d_getespwnam'
24176 d_getfsstat='$d_getfsstat'
24177 d_getgrent='$d_getgrent'
24178 d_getgrent_r='$d_getgrent_r'
24179 d_getgrgid_r='$d_getgrgid_r'
24180 d_getgrnam_r='$d_getgrnam_r'
24181 d_getgrps='$d_getgrps'
24182 d_gethbyaddr='$d_gethbyaddr'
24183 d_gethbyname='$d_gethbyname'
24184 d_gethent='$d_gethent'
24185 d_gethname='$d_gethname'
24186 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24187 d_gethostbyname_r='$d_gethostbyname_r'
24188 d_gethostent_r='$d_gethostent_r'
24189 d_gethostprotos='$d_gethostprotos'
24190 d_getitimer='$d_getitimer'
24191 d_getlogin='$d_getlogin'
24192 d_getlogin_r='$d_getlogin_r'
24193 d_getmnt='$d_getmnt'
24194 d_getmntent='$d_getmntent'
24195 d_getnameinfo='$d_getnameinfo'
24196 d_getnbyaddr='$d_getnbyaddr'
24197 d_getnbyname='$d_getnbyname'
24198 d_getnent='$d_getnent'
24199 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24200 d_getnetbyname_r='$d_getnetbyname_r'
24201 d_getnetent_r='$d_getnetent_r'
24202 d_getnetprotos='$d_getnetprotos'
24203 d_getpagsz='$d_getpagsz'
24204 d_getpbyname='$d_getpbyname'
24205 d_getpbynumber='$d_getpbynumber'
24206 d_getpent='$d_getpent'
24207 d_getpgid='$d_getpgid'
24208 d_getpgrp2='$d_getpgrp2'
24209 d_getpgrp='$d_getpgrp'
24210 d_getppid='$d_getppid'
24211 d_getprior='$d_getprior'
24212 d_getprotobyname_r='$d_getprotobyname_r'
24213 d_getprotobynumber_r='$d_getprotobynumber_r'
24214 d_getprotoent_r='$d_getprotoent_r'
24215 d_getprotoprotos='$d_getprotoprotos'
24216 d_getprpwnam='$d_getprpwnam'
24217 d_getpwent='$d_getpwent'
24218 d_getpwent_r='$d_getpwent_r'
24219 d_getpwnam_r='$d_getpwnam_r'
24220 d_getpwuid_r='$d_getpwuid_r'
24221 d_getsbyname='$d_getsbyname'
24222 d_getsbyport='$d_getsbyport'
24223 d_getsent='$d_getsent'
24224 d_getservbyname_r='$d_getservbyname_r'
24225 d_getservbyport_r='$d_getservbyport_r'
24226 d_getservent_r='$d_getservent_r'
24227 d_getservprotos='$d_getservprotos'
24228 d_getspnam='$d_getspnam'
24229 d_getspnam_r='$d_getspnam_r'
24230 d_gettimeod='$d_gettimeod'
24231 d_gmtime64='$d_gmtime64'
24232 d_gmtime_r='$d_gmtime_r'
24233 d_gnulibc='$d_gnulibc'
24234 d_grpasswd='$d_grpasswd'
24235 d_hasmntopt='$d_hasmntopt'
24239 d_ilogbl='$d_ilogbl'
24240 d_inc_version_list='$d_inc_version_list'
24242 d_inetaton='$d_inetaton'
24243 d_inetntop='$d_inetntop'
24244 d_inetpton='$d_inetpton'
24245 d_int64_t='$d_int64_t'
24246 d_ip_mreq='$d_ip_mreq'
24247 d_ip_mreq_source='$d_ip_mreq_source'
24248 d_ipv6_mreq='$d_ipv6_mreq'
24249 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24250 d_isascii='$d_isascii'
24251 d_isblank='$d_isblank'
24252 d_isfinite='$d_isfinite'
24253 d_isfinitel='$d_isfinitel'
24255 d_isinfl='$d_isinfl'
24256 d_isless='$d_isless'
24258 d_isnanl='$d_isnanl'
24259 d_isnormal='$d_isnormal'
24262 d_killpg='$d_killpg'
24263 d_lc_monetary_2008='$d_lc_monetary_2008'
24264 d_lchown='$d_lchown'
24265 d_ldbl_dig='$d_ldbl_dig'
24266 d_ldexpl='$d_ldexpl'
24267 d_lgamma='$d_lgamma'
24268 d_lgamma_r='$d_lgamma_r'
24269 d_libm_lib_version='$d_libm_lib_version'
24270 d_libname_unique='$d_libname_unique'
24272 d_llrint='$d_llrint'
24273 d_llrintl='$d_llrintl'
24274 d_llround='$d_llround'
24275 d_llroundl='$d_llroundl'
24276 d_localtime64='$d_localtime64'
24277 d_localtime_r='$d_localtime_r'
24278 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24279 d_locconv='$d_locconv'
24284 d_longdbl='$d_longdbl'
24285 d_longlong='$d_longlong'
24287 d_lrintl='$d_lrintl'
24288 d_lround='$d_lround'
24289 d_lroundl='$d_lroundl'
24290 d_lseekproto='$d_lseekproto'
24292 d_madvise='$d_madvise'
24293 d_malloc_good_size='$d_malloc_good_size'
24294 d_malloc_size='$d_malloc_size'
24296 d_mbstowcs='$d_mbstowcs'
24297 d_mbtowc='$d_mbtowc'
24298 d_memchr='$d_memchr'
24299 d_memcmp='$d_memcmp'
24300 d_memcpy='$d_memcpy'
24301 d_memmove='$d_memmove'
24302 d_memset='$d_memset'
24304 d_mkdtemp='$d_mkdtemp'
24305 d_mkfifo='$d_mkfifo'
24306 d_mkstemp='$d_mkstemp'
24307 d_mkstemps='$d_mkstemps'
24308 d_mktime64='$d_mktime64'
24309 d_mktime='$d_mktime'
24312 d_modfl_pow32_bug='$d_modfl_pow32_bug'
24313 d_modflproto='$d_modflproto'
24314 d_mprotect='$d_mprotect'
24316 d_msg_ctrunc='$d_msg_ctrunc'
24317 d_msg_dontroute='$d_msg_dontroute'
24318 d_msg_oob='$d_msg_oob'
24319 d_msg_peek='$d_msg_peek'
24320 d_msg_proxy='$d_msg_proxy'
24321 d_msgctl='$d_msgctl'
24322 d_msgget='$d_msgget'
24323 d_msghdr_s='$d_msghdr_s'
24324 d_msgrcv='$d_msgrcv'
24325 d_msgsnd='$d_msgsnd'
24327 d_munmap='$d_munmap'
24328 d_mymalloc='$d_mymalloc'
24331 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24332 d_nearbyint='$d_nearbyint'
24333 d_nextafter='$d_nextafter'
24334 d_nexttoward='$d_nexttoward'
24336 d_nl_langinfo='$d_nl_langinfo'
24337 d_nv_preserves_uv='$d_nv_preserves_uv'
24338 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24339 d_off64_t='$d_off64_t'
24340 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24341 d_oldpthreads='$d_oldpthreads'
24342 d_oldsock='$d_oldsock'
24344 d_pathconf='$d_pathconf'
24346 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24347 d_phostname='$d_phostname'
24350 d_portable='$d_portable'
24352 d_prctl_set_name='$d_prctl_set_name'
24353 d_printf_format_null='$d_printf_format_null'
24354 d_procselfexe='$d_procselfexe'
24355 d_pseudofork='$d_pseudofork'
24356 d_pthread_atfork='$d_pthread_atfork'
24357 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24358 d_pthread_yield='$d_pthread_yield'
24359 d_ptrdiff_t='$d_ptrdiff_t'
24361 d_pwchange='$d_pwchange'
24362 d_pwclass='$d_pwclass'
24363 d_pwcomment='$d_pwcomment'
24364 d_pwexpire='$d_pwexpire'
24365 d_pwgecos='$d_pwgecos'
24366 d_pwpasswd='$d_pwpasswd'
24367 d_pwquota='$d_pwquota'
24370 d_random_r='$d_random_r'
24371 d_re_comp='$d_re_comp'
24372 d_readdir64_r='$d_readdir64_r'
24373 d_readdir='$d_readdir'
24374 d_readdir_r='$d_readdir_r'
24375 d_readlink='$d_readlink'
24377 d_recvmsg='$d_recvmsg'
24378 d_regcmp='$d_regcmp'
24379 d_regcomp='$d_regcomp'
24380 d_remainder='$d_remainder'
24381 d_remquo='$d_remquo'
24382 d_rename='$d_rename'
24383 d_rewinddir='$d_rewinddir'
24387 d_safebcpy='$d_safebcpy'
24388 d_safemcpy='$d_safemcpy'
24389 d_sanemcmp='$d_sanemcmp'
24390 d_sbrkproto='$d_sbrkproto'
24391 d_scalbn='$d_scalbn'
24392 d_scalbnl='$d_scalbnl'
24393 d_sched_yield='$d_sched_yield'
24394 d_scm_rights='$d_scm_rights'
24395 d_seekdir='$d_seekdir'
24396 d_select='$d_select'
24398 d_semctl='$d_semctl'
24399 d_semctl_semid_ds='$d_semctl_semid_ds'
24400 d_semctl_semun='$d_semctl_semun'
24401 d_semget='$d_semget'
24403 d_sendmsg='$d_sendmsg'
24404 d_setegid='$d_setegid'
24405 d_seteuid='$d_seteuid'
24406 d_setgrent='$d_setgrent'
24407 d_setgrent_r='$d_setgrent_r'
24408 d_setgrps='$d_setgrps'
24409 d_sethent='$d_sethent'
24410 d_sethostent_r='$d_sethostent_r'
24411 d_setitimer='$d_setitimer'
24412 d_setlinebuf='$d_setlinebuf'
24413 d_setlocale='$d_setlocale'
24414 d_setlocale_r='$d_setlocale_r'
24415 d_setnent='$d_setnent'
24416 d_setnetent_r='$d_setnetent_r'
24417 d_setpent='$d_setpent'
24418 d_setpgid='$d_setpgid'
24419 d_setpgrp2='$d_setpgrp2'
24420 d_setpgrp='$d_setpgrp'
24421 d_setprior='$d_setprior'
24422 d_setproctitle='$d_setproctitle'
24423 d_setprotoent_r='$d_setprotoent_r'
24424 d_setpwent='$d_setpwent'
24425 d_setpwent_r='$d_setpwent_r'
24426 d_setregid='$d_setregid'
24427 d_setresgid='$d_setresgid'
24428 d_setresuid='$d_setresuid'
24429 d_setreuid='$d_setreuid'
24430 d_setrgid='$d_setrgid'
24431 d_setruid='$d_setruid'
24432 d_setsent='$d_setsent'
24433 d_setservent_r='$d_setservent_r'
24434 d_setsid='$d_setsid'
24435 d_setvbuf='$d_setvbuf'
24438 d_shmatprototype='$d_shmatprototype'
24439 d_shmctl='$d_shmctl'
24441 d_shmget='$d_shmget'
24442 d_sigaction='$d_sigaction'
24443 d_signbit='$d_signbit'
24444 d_sigprocmask='$d_sigprocmask'
24445 d_sigsetjmp='$d_sigsetjmp'
24446 d_sin6_scope_id='$d_sin6_scope_id'
24447 d_sitearch='$d_sitearch'
24448 d_snprintf='$d_snprintf'
24449 d_sockaddr_in6='$d_sockaddr_in6'
24450 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24451 d_sockatmark='$d_sockatmark'
24452 d_sockatmarkproto='$d_sockatmarkproto'
24453 d_socket='$d_socket'
24454 d_socklen_t='$d_socklen_t'
24455 d_sockpair='$d_sockpair'
24456 d_socks5_init='$d_socks5_init'
24457 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24459 d_srand48_r='$d_srand48_r'
24460 d_srandom_r='$d_srandom_r'
24461 d_sresgproto='$d_sresgproto'
24462 d_sresuproto='$d_sresuproto'
24464 d_statblks='$d_statblks'
24465 d_statfs_f_flags='$d_statfs_f_flags'
24466 d_statfs_s='$d_statfs_s'
24467 d_static_inline='$d_static_inline'
24468 d_statvfs='$d_statvfs'
24469 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24470 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24471 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24472 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24473 d_stdio_stream_array='$d_stdio_stream_array'
24474 d_stdiobase='$d_stdiobase'
24475 d_stdstdio='$d_stdstdio'
24476 d_strchr='$d_strchr'
24477 d_strcoll='$d_strcoll'
24478 d_strctcpy='$d_strctcpy'
24479 d_strerrm='$d_strerrm'
24480 d_strerror='$d_strerror'
24481 d_strerror_r='$d_strerror_r'
24482 d_strftime='$d_strftime'
24483 d_strlcat='$d_strlcat'
24484 d_strlcpy='$d_strlcpy'
24485 d_strtod='$d_strtod'
24486 d_strtol='$d_strtol'
24487 d_strtold='$d_strtold'
24488 d_strtoll='$d_strtoll'
24489 d_strtoq='$d_strtoq'
24490 d_strtoul='$d_strtoul'
24491 d_strtoull='$d_strtoull'
24492 d_strtouq='$d_strtouq'
24493 d_strxfrm='$d_strxfrm'
24494 d_suidsafe='$d_suidsafe'
24495 d_symlink='$d_symlink'
24496 d_syscall='$d_syscall'
24497 d_syscallproto='$d_syscallproto'
24498 d_sysconf='$d_sysconf'
24499 d_sysernlst='$d_sysernlst'
24500 d_syserrlst='$d_syserrlst'
24501 d_system='$d_system'
24502 d_tcgetpgrp='$d_tcgetpgrp'
24503 d_tcsetpgrp='$d_tcsetpgrp'
24504 d_telldir='$d_telldir'
24505 d_telldirproto='$d_telldirproto'
24506 d_tgamma='$d_tgamma'
24508 d_timegm='$d_timegm'
24510 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24511 d_tm_tm_zone='$d_tm_tm_zone'
24512 d_tmpnam_r='$d_tmpnam_r'
24514 d_truncate='$d_truncate'
24515 d_truncl='$d_truncl'
24516 d_ttyname_r='$d_ttyname_r'
24517 d_tzname='$d_tzname'
24518 d_u32align='$d_u32align'
24519 d_ualarm='$d_ualarm'
24522 d_union_semun='$d_union_semun'
24523 d_unordered='$d_unordered'
24524 d_unsetenv='$d_unsetenv'
24525 d_usleep='$d_usleep'
24526 d_usleepproto='$d_usleepproto'
24528 d_vendorarch='$d_vendorarch'
24529 d_vendorbin='$d_vendorbin'
24530 d_vendorlib='$d_vendorlib'
24531 d_vendorscript='$d_vendorscript'
24533 d_void_closedir='$d_void_closedir'
24534 d_voidsig='$d_voidsig'
24535 d_voidtty='$d_voidtty'
24536 d_volatile='$d_volatile'
24537 d_vprintf='$d_vprintf'
24538 d_vsnprintf='$d_vsnprintf'
24540 d_waitpid='$d_waitpid'
24541 d_wcscmp='$d_wcscmp'
24542 d_wcstombs='$d_wcstombs'
24543 d_wcsxfrm='$d_wcsxfrm'
24544 d_wctomb='$d_wctomb'
24545 d_writev='$d_writev'
24548 db_hashtype='$db_hashtype'
24549 db_prefixtype='$db_prefixtype'
24550 db_version_major='$db_version_major'
24551 db_version_minor='$db_version_minor'
24552 db_version_patch='$db_version_patch'
24553 direntrytype='$direntrytype'
24556 doubleinfbytes='$doubleinfbytes'
24557 doublekind='$doublekind'
24558 doublemantbits='$doublemantbits'
24559 doublenanbytes='$doublenanbytes'
24560 doublesize='$doublesize'
24562 drand48_r_proto='$drand48_r_proto'
24564 dynamic_ext='$dynamic_ext'
24570 endgrent_r_proto='$endgrent_r_proto'
24571 endhostent_r_proto='$endhostent_r_proto'
24572 endnetent_r_proto='$endnetent_r_proto'
24573 endprotoent_r_proto='$endprotoent_r_proto'
24574 endpwent_r_proto='$endpwent_r_proto'
24575 endservent_r_proto='$endservent_r_proto'
24576 eunicefix='$eunicefix'
24579 extensions='$extensions'
24580 extern_C='$extern_C'
24582 fflushNULL='$fflushNULL'
24583 fflushall='$fflushall'
24585 firstmakefile='$firstmakefile'
24587 fpossize='$fpossize'
24588 fpostype='$fpostype'
24589 freetype='$freetype'
24592 full_csh='$full_csh'
24593 full_sed='$full_sed'
24594 gccansipedantic='$gccansipedantic'
24595 gccosandvers='$gccosandvers'
24596 gccversion='$gccversion'
24597 getgrent_r_proto='$getgrent_r_proto'
24598 getgrgid_r_proto='$getgrgid_r_proto'
24599 getgrnam_r_proto='$getgrnam_r_proto'
24600 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24601 gethostbyname_r_proto='$gethostbyname_r_proto'
24602 gethostent_r_proto='$gethostent_r_proto'
24603 getlogin_r_proto='$getlogin_r_proto'
24604 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24605 getnetbyname_r_proto='$getnetbyname_r_proto'
24606 getnetent_r_proto='$getnetent_r_proto'
24607 getprotobyname_r_proto='$getprotobyname_r_proto'
24608 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24609 getprotoent_r_proto='$getprotoent_r_proto'
24610 getpwent_r_proto='$getpwent_r_proto'
24611 getpwnam_r_proto='$getpwnam_r_proto'
24612 getpwuid_r_proto='$getpwuid_r_proto'
24613 getservbyname_r_proto='$getservbyname_r_proto'
24614 getservbyport_r_proto='$getservbyport_r_proto'
24615 getservent_r_proto='$getservent_r_proto'
24616 getspnam_r_proto='$getspnam_r_proto'
24617 gidformat='$gidformat'
24623 gmtime_r_proto='$gmtime_r_proto'
24624 gnulibc_version='$gnulibc_version'
24626 groupcat='$groupcat'
24627 groupstype='$groupstype'
24630 h_sysfile='$h_sysfile'
24633 hostgenerate='$hostgenerate'
24634 hostosname='$hostosname'
24635 hostperl='$hostperl'
24636 html1dir='$html1dir'
24637 html1direxp='$html1direxp'
24638 html3dir='$html3dir'
24639 html3direxp='$html3direxp'
24648 i_arpainet='$i_arpainet'
24649 i_assert='$i_assert'
24651 i_bsdioctl='$i_bsdioctl'
24655 i_dirent='$i_dirent'
24657 i_execinfo='$i_execinfo'
24662 i_fp_class='$i_fp_class'
24664 i_gdbm_ndbm='$i_gdbm_ndbm'
24665 i_gdbmndbm='$i_gdbmndbm'
24667 i_ieeefp='$i_ieeefp'
24668 i_inttypes='$i_inttypes'
24669 i_langinfo='$i_langinfo'
24670 i_libutil='$i_libutil'
24671 i_limits='$i_limits'
24672 i_locale='$i_locale'
24673 i_machcthr='$i_machcthr'
24674 i_malloc='$i_malloc'
24675 i_mallocmalloc='$i_mallocmalloc'
24677 i_memory='$i_memory'
24678 i_mntent='$i_mntent'
24681 i_neterrno='$i_neterrno'
24682 i_netinettcp='$i_netinettcp'
24686 i_pthread='$i_pthread'
24688 i_quadmath='$i_quadmath'
24689 i_rpcsvcdbm='$i_rpcsvcdbm'
24691 i_shadow='$i_shadow'
24693 i_stdarg='$i_stdarg'
24694 i_stdbool='$i_stdbool'
24695 i_stddef='$i_stddef'
24696 i_stdint='$i_stdint'
24697 i_stdlib='$i_stdlib'
24698 i_string='$i_string'
24699 i_sunmath='$i_sunmath'
24700 i_sysaccess='$i_sysaccess'
24701 i_sysdir='$i_sysdir'
24702 i_sysfile='$i_sysfile'
24703 i_sysfilio='$i_sysfilio'
24705 i_sysioctl='$i_sysioctl'
24706 i_syslog='$i_syslog'
24707 i_sysmman='$i_sysmman'
24708 i_sysmode='$i_sysmode'
24709 i_sysmount='$i_sysmount'
24710 i_sysndir='$i_sysndir'
24711 i_sysparam='$i_sysparam'
24712 i_syspoll='$i_syspoll'
24713 i_sysresrc='$i_sysresrc'
24714 i_syssecrt='$i_syssecrt'
24715 i_sysselct='$i_sysselct'
24716 i_syssockio='$i_syssockio'
24717 i_sysstat='$i_sysstat'
24718 i_sysstatfs='$i_sysstatfs'
24719 i_sysstatvfs='$i_sysstatvfs'
24720 i_systime='$i_systime'
24721 i_systimek='$i_systimek'
24722 i_systimes='$i_systimes'
24723 i_systypes='$i_systypes'
24724 i_sysuio='$i_sysuio'
24726 i_sysutsname='$i_sysutsname'
24727 i_sysvfs='$i_sysvfs'
24728 i_syswait='$i_syswait'
24729 i_termio='$i_termio'
24730 i_termios='$i_termios'
24732 i_unistd='$i_unistd'
24735 i_values='$i_values'
24736 i_varargs='$i_varargs'
24737 i_varhdr='$i_varhdr'
24739 ignore_versioned_solibs='$ignore_versioned_solibs'
24740 inc_version_list='$inc_version_list'
24741 inc_version_list_init='$inc_version_list_init'
24745 initialinstalllocation='$initialinstalllocation'
24746 installarchlib='$installarchlib'
24747 installbin='$installbin'
24748 installhtml1dir='$installhtml1dir'
24749 installhtml3dir='$installhtml3dir'
24750 installman1dir='$installman1dir'
24751 installman3dir='$installman3dir'
24752 installprefix='$installprefix'
24753 installprefixexp='$installprefixexp'
24754 installprivlib='$installprivlib'
24755 installscript='$installscript'
24756 installsitearch='$installsitearch'
24757 installsitebin='$installsitebin'
24758 installsitehtml1dir='$installsitehtml1dir'
24759 installsitehtml3dir='$installsitehtml3dir'
24760 installsitelib='$installsitelib'
24761 installsiteman1dir='$installsiteman1dir'
24762 installsiteman3dir='$installsiteman3dir'
24763 installsitescript='$installsitescript'
24764 installstyle='$installstyle'
24765 installusrbinperl='$installusrbinperl'
24766 installvendorarch='$installvendorarch'
24767 installvendorbin='$installvendorbin'
24768 installvendorhtml1dir='$installvendorhtml1dir'
24769 installvendorhtml3dir='$installvendorhtml3dir'
24770 installvendorlib='$installvendorlib'
24771 installvendorman1dir='$installvendorman1dir'
24772 installvendorman3dir='$installvendorman3dir'
24773 installvendorscript='$installvendorscript'
24775 issymlink='$issymlink'
24776 ivdformat='$ivdformat'
24779 known_extensions='$known_extensions'
24782 ld_can_script='$ld_can_script'
24783 lddlflags='$lddlflags'
24785 ldflags_uselargefiles='$ldflags_uselargefiles'
24786 ldlibpthname='$ldlibpthname'
24793 libsdirs='$libsdirs'
24794 libsfiles='$libsfiles'
24795 libsfound='$libsfound'
24796 libspath='$libspath'
24797 libswanted='$libswanted'
24798 libswanted_uselargefiles='$libswanted_uselargefiles'
24804 localtime_r_proto='$localtime_r_proto'
24805 locincpth='$locincpth'
24806 loclibpth='$loclibpth'
24807 longdblinfbytes='$longdblinfbytes'
24808 longdblkind='$longdblkind'
24809 longdblmantbits='$longdblmantbits'
24810 longdblnanbytes='$longdblnanbytes'
24811 longdblsize='$longdblsize'
24812 longlongsize='$longlongsize'
24813 longsize='$longsize'
24817 lseeksize='$lseeksize'
24818 lseektype='$lseektype'
24822 make_set_make='$make_set_make'
24823 mallocobj='$mallocobj'
24824 mallocsrc='$mallocsrc'
24825 malloctype='$malloctype'
24827 man1direxp='$man1direxp'
24830 man3direxp='$man3direxp'
24832 mips_type='$mips_type'
24833 mistrustnm='$mistrustnm'
24835 mmaptype='$mmaptype'
24836 modetype='$modetype'
24838 multiarch='$multiarch'
24840 myarchname='$myarchname'
24841 mydomain='$mydomain'
24842 myhostname='$myhostname'
24845 need_va_copy='$need_va_copy'
24846 netdb_hlen_type='$netdb_hlen_type'
24847 netdb_host_type='$netdb_host_type'
24848 netdb_name_type='$netdb_name_type'
24849 netdb_net_type='$netdb_net_type'
24852 nm_so_opt='$nm_so_opt'
24853 nonxs_ext='$nonxs_ext'
24855 nvEUformat='$nvEUformat'
24856 nvFUformat='$nvFUformat'
24857 nvGUformat='$nvGUformat'
24858 nv_overflows_integers_at='$nv_overflows_integers_at'
24859 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24860 nveformat='$nveformat'
24861 nvfformat='$nvfformat'
24862 nvgformat='$nvgformat'
24863 nvmantbits='$nvmantbits'
24866 o_nonblock='$o_nonblock'
24868 old_pthread_create_joinable='$old_pthread_create_joinable'
24869 optimize='$optimize'
24870 orderlib='$orderlib'
24873 otherlibdirs='$otherlibdirs'
24877 patchlevel='$patchlevel'
24878 path_sep='$path_sep'
24881 perl_patchlevel='$perl_patchlevel'
24882 perl_static_inline='$perl_static_inline'
24883 perladmin='$perladmin'
24884 perllibs='$perllibs'
24885 perlpath='$perlpath'
24887 phostname='$phostname'
24893 prefixexp='$prefixexp'
24895 privlibexp='$privlibexp'
24896 procselfexe='$procselfexe'
24897 prototype='$prototype'
24899 quadkind='$quadkind'
24900 quadtype='$quadtype'
24901 randbits='$randbits'
24902 randfunc='$randfunc'
24903 random_r_proto='$random_r_proto'
24904 randseedtype='$randseedtype'
24906 rd_nodata='$rd_nodata'
24907 readdir64_r_proto='$readdir64_r_proto'
24908 readdir_r_proto='$readdir_r_proto'
24909 revision='$revision'
24915 sGMTIME_max='$sGMTIME_max'
24916 sGMTIME_min='$sGMTIME_min'
24917 sLOCALTIME_max='$sLOCALTIME_max'
24918 sLOCALTIME_min='$sLOCALTIME_min'
24919 sPRIEUldbl='$sPRIEUldbl'
24920 sPRIFUldbl='$sPRIFUldbl'
24921 sPRIGUldbl='$sPRIGUldbl'
24922 sPRIXU64='$sPRIXU64'
24924 sPRIeldbl='$sPRIeldbl'
24925 sPRIfldbl='$sPRIfldbl'
24926 sPRIgldbl='$sPRIgldbl'
24931 sSCNfldbl='$sSCNfldbl'
24932 sched_yield='$sched_yield'
24933 scriptdir='$scriptdir'
24934 scriptdirexp='$scriptdirexp'
24936 seedfunc='$seedfunc'
24937 selectminbits='$selectminbits'
24938 selecttype='$selecttype'
24939 sendmail='$sendmail'
24940 setgrent_r_proto='$setgrent_r_proto'
24941 sethostent_r_proto='$sethostent_r_proto'
24942 setlocale_r_proto='$setlocale_r_proto'
24943 setnetent_r_proto='$setnetent_r_proto'
24944 setprotoent_r_proto='$setprotoent_r_proto'
24945 setpwent_r_proto='$setpwent_r_proto'
24946 setservent_r_proto='$setservent_r_proto'
24949 sharpbang='$sharpbang'
24950 shmattype='$shmattype'
24951 shortsize='$shortsize'
24954 sig_count='$sig_count'
24955 sig_name='$sig_name'
24956 sig_name_init='$sig_name_init'
24958 sig_num_init='$sig_num_init'
24959 sig_size='$sig_size'
24960 signal_t='$signal_t'
24961 sitearch='$sitearch'
24962 sitearchexp='$sitearchexp'
24964 sitebinexp='$sitebinexp'
24965 sitehtml1dir='$sitehtml1dir'
24966 sitehtml1direxp='$sitehtml1direxp'
24967 sitehtml3dir='$sitehtml3dir'
24968 sitehtml3direxp='$sitehtml3direxp'
24970 sitelib_stem='$sitelib_stem'
24971 sitelibexp='$sitelibexp'
24972 siteman1dir='$siteman1dir'
24973 siteman1direxp='$siteman1direxp'
24974 siteman3dir='$siteman3dir'
24975 siteman3direxp='$siteman3direxp'
24976 siteprefix='$siteprefix'
24977 siteprefixexp='$siteprefixexp'
24978 sitescript='$sitescript'
24979 sitescriptexp='$sitescriptexp'
24980 sizesize='$sizesize'
24981 sizetype='$sizetype'
24985 sockethdr='$sockethdr'
24986 socketlib='$socketlib'
24987 socksizetype='$socksizetype'
24989 spackage='$spackage'
24990 spitshell='$spitshell'
24991 srand48_r_proto='$srand48_r_proto'
24992 srandom_r_proto='$srandom_r_proto'
24994 ssizetype='$ssizetype'
24995 st_ino_sign='$st_ino_sign'
24996 st_ino_size='$st_ino_size'
24997 startperl='$startperl'
24999 static_ext='$static_ext'
25001 stdio_base='$stdio_base'
25002 stdio_bufsiz='$stdio_bufsiz'
25003 stdio_cnt='$stdio_cnt'
25004 stdio_filbuf='$stdio_filbuf'
25005 stdio_ptr='$stdio_ptr'
25006 stdio_stream_array='$stdio_stream_array'
25007 strerror_r_proto='$strerror_r_proto'
25010 subversion='$subversion'
25015 targetarch='$targetarch'
25016 targetdir='$targetdir'
25017 targetenv='$targetenv'
25018 targethost='$targethost'
25019 targetmkdir='$targetmkdir'
25020 targetport='$targetport'
25021 targetsh='$targetsh'
25025 timeincl='$timeincl'
25026 timetype='$timetype'
25027 tmpnam_r_proto='$tmpnam_r_proto'
25033 ttyname_r_proto='$ttyname_r_proto'
25042 uidformat='$uidformat'
25048 uquadtype='$uquadtype'
25049 use5005threads='$use5005threads'
25050 use64bitall='$use64bitall'
25051 use64bitint='$use64bitint'
25052 usecbacktrace='$usecbacktrace'
25053 usecrosscompile='$usecrosscompile'
25054 usedevel='$usedevel'
25056 usedtrace='$usedtrace'
25057 usefaststdio='$usefaststdio'
25058 useithreads='$useithreads'
25059 usekernprocpathname='$usekernprocpathname'
25060 uselargefiles='$uselargefiles'
25061 uselongdouble='$uselongdouble'
25062 usemallocwrap='$usemallocwrap'
25063 usemorebits='$usemorebits'
25064 usemultiplicity='$usemultiplicity'
25065 usemymalloc='$usemymalloc'
25067 usensgetexecutablepath='$usensgetexecutablepath'
25068 useopcode='$useopcode'
25069 useperlio='$useperlio'
25070 useposix='$useposix'
25071 usequadmath='$usequadmath'
25072 usereentrant='$usereentrant'
25073 userelocatableinc='$userelocatableinc'
25074 useshrplib='$useshrplib'
25075 usesitecustomize='$usesitecustomize'
25076 usesocks='$usesocks'
25077 usethreads='$usethreads'
25078 usevendorprefix='$usevendorprefix'
25079 useversionedarchname='$useversionedarchname'
25080 usevfork='$usevfork'
25083 uvXUformat='$uvXUformat'
25084 uvoformat='$uvoformat'
25087 uvuformat='$uvuformat'
25088 uvxformat='$uvxformat'
25090 vendorarch='$vendorarch'
25091 vendorarchexp='$vendorarchexp'
25092 vendorbin='$vendorbin'
25093 vendorbinexp='$vendorbinexp'
25094 vendorhtml1dir='$vendorhtml1dir'
25095 vendorhtml1direxp='$vendorhtml1direxp'
25096 vendorhtml3dir='$vendorhtml3dir'
25097 vendorhtml3direxp='$vendorhtml3direxp'
25098 vendorlib='$vendorlib'
25099 vendorlib_stem='$vendorlib_stem'
25100 vendorlibexp='$vendorlibexp'
25101 vendorman1dir='$vendorman1dir'
25102 vendorman1direxp='$vendorman1direxp'
25103 vendorman3dir='$vendorman3dir'
25104 vendorman3direxp='$vendorman3direxp'
25105 vendorprefix='$vendorprefix'
25106 vendorprefixexp='$vendorprefixexp'
25107 vendorscript='$vendorscript'
25108 vendorscriptexp='$vendorscriptexp'
25110 version_patchlevel_string='$version_patchlevel_string'
25111 versiononly='$versiononly'
25115 yaccflags='$yaccflags'
25120 : add special variables
25121 $test -f $src/patchlevel.h && \
25122 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25123 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25124 echo "PERL_CONFIG_SH=true" >>config.sh
25126 : propagate old symbols
25127 if $test -f UU/config.sh; then
25128 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25129 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25130 config.sh config.sh UU/oldconfig.sh |\
25131 $sort | $uniq -u >UU/oldsyms
25132 set X `$cat UU/oldsyms`
25138 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25140 echo ": Variables propagated from previous config.sh file." >>config.sh
25141 for sym in `$cat UU/oldsyms`; do
25142 echo " Propagating $hint variable "'$'"$sym..."
25143 eval 'tmp="$'"${sym}"'"'
25145 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25151 : preserve RCS keywords in files with variable substitution, grrr
25154 : Finish up by extracting the .SH files
25158 echo "Extraction done."
25168 If you'd like to make any changes to the config.sh file before I begin
25169 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25172 rp="Press return or use a shell escape to edit config.sh:"
25177 *) : in case they cannot read
25178 sh 1>&4 -c "$ans";;
25183 : if this fails, just run all the .SH files by hand
25192 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25199 Now you need to generate make dependencies by running "$make depend".
25200 You might prefer to run it in background: "$make depend > makedepend.out &"
25201 It can take a while, so you might not want to run it right now.
25206 rp="Run $make depend now?"
25210 $make depend && echo "Now you must run '$make'."
25213 echo "You must run '$make depend' then '$make'."
25216 elif test -f [Mm]akefile; then
25218 echo "Now you must run a $make."
25220 echo "Configure done."
25223 if $test -f Policy.sh; then
25226 If you compile $package on a different machine or from a different object
25227 directory, copy the Policy.sh file from this object directory to the
25228 new one before you run Configure -- this will help you with most of
25229 the policy defaults.
25233 if $test -f config.msg; then
25234 echo "Hmm. I also noted the following information while running:"
25236 $cat config.msg >&4
25239 $rm -f kit*isdone ark*isdone