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 -f /sys/utilities/MultiView ; then
73 # AmigaOS, test -c for /dev/null is not useful
75 elif test ! -c /dev/null ; then
78 *** I'm sorry, but /dev/null appears to be a file rather than a device.
79 *** Please consult your operating sytem's notes for making a device
81 *** Cannot continue, aborting.
87 : compute my invocation name
91 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
96 : Proper separator for the PATH environment variable
98 : On OS/2 this directory should exist if this is not floppy only system ":-]"
99 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
100 if test -n "$OS2_SHELL"; then
102 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
103 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
105 elif test -n "$DJGPP"; then
106 case "X${MACHTYPE:-nonesuchmach}" in
113 : Proper PATH setting
114 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
115 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
116 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
117 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
118 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
119 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
120 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
121 paths="$paths /sbin /usr/sbin /usr/libexec"
122 paths="$paths /system/gnu_library/bin"
126 case "$p_$PATH$p_" in
128 *) test -d $p && PATH=$PATH$p_$p ;;
135 : shall we be using ksh?
141 if (PATH=.; alias -x) >/dev/null 2>&1; then
144 if test -f /hp-ux -a -f /bin/ksh; then
145 needksh='to avoid sh bug in "here document" expansion'
147 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
148 if test X`/usr/bin/uname -v` = X4; then
149 avoidksh="to avoid AIX 4's /bin/sh"
153 if test -f /osf_boot -a -f /usr/sbin/setld; then
154 if test X`/usr/bin/uname -s` = XOSF1; then
155 avoidksh="to avoid Digital UNIX' ksh"
160 case "$inksh/$needksh" in
167 case "$inksh/$avoidksh" in
173 case "$inksh/$needksh-$avoidksh-" in
176 (I see you are using the Korn shell. Some ksh's blow up on $me,
177 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
184 echo "(Feeding myself to $newsh $reason.)"
186 Configure|*/Configure) exec $newsh $0 "$@";;
187 *) exec $newsh Configure "$@";;
191 test -x "${newsh}" || unset newsh
193 : if needed, set CDPATH to a harmless value that is not chatty
194 : avoid bash 2.02 problems with empty CDPATH.
198 *bash*) CDPATH='.' ;;
204 : Configure runs within the UU subdirectory
205 test -d UU || mkdir UU
349 useversionedarchname=''
355 initialinstalllocation=''
387 d_attribute_deprecated=''
388 d_attribute_format=''
389 d_attribute_malloc=''
390 d_attribute_nonnull=''
391 d_attribute_noreturn=''
393 d_attribute_unused=''
394 d_attribute_warn_unused_result=''
395 d_printf_format_null=''
399 d_builtin_choose_expr=''
402 d_c99_variadic_macros=''
452 endhostent_r_proto=''
458 endprotoent_r_proto=''
464 endservent_r_proto=''
529 gethostbyaddr_r_proto=''
531 gethostbyname_r_proto=''
533 gethostent_r_proto=''
546 getnetbyaddr_r_proto=''
548 getnetbyname_r_proto=''
562 d_getprotobyname_r=''
563 getprotobyname_r_proto=''
564 d_getprotobynumber_r=''
565 getprotobynumber_r_proto=''
567 getprotoent_r_proto=''
579 getservbyname_r_proto=''
581 getservbyport_r_proto=''
583 getservent_r_proto=''
616 d_lc_monetary_2008=''
621 d_libm_lib_version=''
628 d_localtime_r_needs_tzset=''
648 d_malloc_good_size=''
696 d_old_pthread_create_joinable=''
697 old_pthread_create_joinable=''
699 d_pthread_attr_setscope=''
747 sethostent_r_proto=''
764 setprotoent_r_proto=''
776 setservent_r_proto=''
798 d_ipv6_mreq_source=''
815 d_sprintf_returns_strlen=''
828 perl_static_inline=''
833 d_stdio_ptr_lval_nochange_cnt=''
834 d_stdio_ptr_lval_sets_cnt=''
986 d_gdbm_ndbm_h_uses_prototypes=''
987 d_gdbmndbm_h_uses_prototypes=''
989 d_ndbm_h_uses_prototypes=''
1065 d_inc_version_list=''
1067 inc_version_list_init=''
1075 installusrbinperl=''
1091 ignore_versioned_solibs=''
1155 d_perl_otherlibdirs=''
1163 api_versionstring=''
1169 version_patchlevel_string=''
1173 d_nv_preserves_uv=''
1174 d_nv_zero_is_allbits_zero=''
1185 nv_overflows_integers_at=''
1186 nv_preserves_uv_bits=''
1259 installsitehtml1dir=''
1262 installsitehtml3dir=''
1269 installsiteman1dir=''
1272 installsiteman3dir=''
1277 installsitescript=''
1295 d_stdio_stream_array=''
1296 stdio_stream_array=''
1314 usekernprocpathname=''
1315 ccflags_uselargefiles=''
1316 ldflags_uselargefiles=''
1317 libswanted_uselargefiles=''
1326 usensgetexecutablepath=''
1340 installvendorarch=''
1347 installvendorhtml1dir=''
1349 vendorhtml1direxp=''
1350 installvendorhtml3dir=''
1352 vendorhtml3direxp=''
1358 installvendorman1dir=''
1361 installvendorman3dir=''
1368 installvendorscript=''
1379 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1382 : We must find out about Eunice early
1384 if test -f /etc/unixtovms; then
1385 eunicefix=/etc/unixtovms
1387 if test -f /etc/unixtovms.exe; then
1388 eunicefix=/etc/unixtovms.exe
1391 : Set executable suffix now -- needed before hints available
1392 if test -f "/libs/version.library"; then
1395 elif test -f "/system/gnu_library/bin/ar.pm"; then
1398 elif test -n "$DJGPP"; then
1401 elif test -f /kern/cookiejar; then
1404 elif test -d c:/. -o -n "$is_os2" ; then
1411 : Trailing extension. Override this in a hint file, if needed.
1412 : Extra object files, if any, needed on this platform.
1415 : Possible local include directories to search.
1416 : Set locincpth to "" in a hint file to defeat local include searches.
1417 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1418 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1420 : no include file wanted by default
1423 : Enable -DEBUGGING and -DDEBUGGING from the command line
1428 : change the next line if compiling for Xenix/286 on Xenix/386
1429 xlibpth='/usr/lib/386 /lib/386'
1430 : Possible local library directories to search.
1431 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1432 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1434 : general looking path for locating libraries
1435 glibpth="/lib /usr/lib $xlibpth"
1436 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1437 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1438 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1439 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1441 : Private path used by Configure to find libraries. Its value
1442 : is prepended to libpth. This variable takes care of special
1443 : machines, like the mips. Usually, it should be empty.
1446 : default library list
1448 : some systems want to use only the non-versioned libso:s
1449 ignore_versioned_solibs=''
1450 : set usethreads on the Configure command line to enable threads.
1451 usereentrant='undef'
1455 : set useposix=false in your hint file to disable the POSIX extension.
1457 : set useopcode=false in your hint file to disable the Opcode extension.
1460 ccflags_uselargefiles=''
1461 ldflags_uselargefiles=''
1462 libswanted_uselargefiles=''
1463 : set usemultiplicity on the Configure command line to enable multiplicity.
1464 : set usesocks on the Configure command line to enable socks.
1465 : List of libraries we want.
1466 : If anyone needs extra -lxxx, put those in a hint file.
1467 libswanted="cl pthread socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld"
1468 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1469 : We probably want to search /usr/shlib before most other libraries.
1470 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1471 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1472 glibpth="/usr/shlib $glibpth"
1473 : Do not use vfork unless overridden by a hint file.
1476 : Find the basic shell for Bourne shell scripts
1480 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1483 if test -f "$xxx"; then
1486 : Build up a list and do a single loop so we can 'break' out.
1487 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1488 for xxx in sh bash ksh pdksh ash; do
1490 try="$try ${p}/${xxx}"
1494 if test -f "$xxx"; then
1497 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1500 elif test -f "$xxx.exe"; then
1511 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1513 Usually it's in /bin/sh. How did you even get this far?
1514 Please contact me (Perl Maintainers) at perlbug@perl.org and
1515 we'll try to straighten this all out.
1521 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1522 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1525 : see if sh knows # comments
1526 if `$sh -c '#' >/dev/null 2>&1`; then
1530 test -f $xcat$_exe || xcat=/usr/bin/cat
1531 if test ! -f $xcat$_exe; then
1532 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1533 if test -f $p/cat$_exe; then
1538 if test ! -f $xcat$_exe; then
1539 echo "Can't find cat anywhere!"
1543 echo "#!$xcat" >sharp
1546 ./sharp > today 2>/dev/null
1547 if test -s today; then
1550 echo "#! $xcat" > sharp
1553 ./sharp > today 2>/dev/null
1554 if test -s today; then
1562 echo "Your $sh doesn't grok # comments--I will strip them later on."
1565 echo "exec grep -v '^[ ]*#'" >spitshell
1567 $eunicefix spitshell
1568 spitshell=`pwd`/spitshell
1570 echo "I presume that if # doesn't work, #! won't work either!"
1575 : figure out how to guarantee sh startup
1577 '') startsh=${sharpbang}${sh} ;;
1589 : echo "Yup, it does."
1591 echo "Hmm... '$startsh' does not guarantee sh startup..."
1592 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1596 : Save command line options in file UU/cmdline.opt for later use in
1597 : generating config.sh.
1598 cat > cmdline.opt <<EOSH
1599 : Configure command line arguments.
1608 cat >>cmdline.opt <<EOSH
1609 config_arg$argn='$arg'
1611 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1614 arg_exp=`cat cmdl.opt`
1615 args_exp="$args_exp$args_sep'$arg_exp'"
1616 argn=`expr $argn + 1`
1621 : produce awk script to parse command line options
1622 cat >options.awk <<'EOF'
1624 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1626 len = length(optstr);
1627 for (i = 1; i <= len; i++) {
1628 c = substr(optstr, i, 1);
1629 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1640 if (substr(str, 1, 1) != "-") {
1641 printf("'%s'\n", str);
1645 for (i = 2; i <= len; i++) {
1646 c = substr(str, i, 1);
1648 printf("-%s\n", substr(str, i));
1654 printf("'%s'\n", substr(str, i + 1));
1667 : process the command line options
1668 set X `for arg in "$@"; do echo "X$arg"; done |
1669 sed -e s/X// | awk -f options.awk`
1674 : set up default values
1684 rm -f optdef.sh posthint.sh
1685 cat >optdef.sh <<EOS
1691 while test $# -gt 0; do
1693 -d) shift; fastread=yes;;
1694 -e) shift; alldone=cont;;
1698 if test -r "$1"; then
1701 echo "$me: cannot read config file $1." >&2
1707 -h) shift; error=true;;
1708 -r) shift; reuseval=true;;
1709 -s) shift; silent=true; realsilent=true;;
1710 -E) shift; alldone=exit;;
1711 -K) shift; knowitall=true;;
1712 -O) shift; override=true;;
1713 -S) shift; silent=true; extractsh=true;;
1718 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1719 echo "$me: ignoring -D $1" >&2
1722 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1723 *) echo "$1='define'" >> optdef.sh;;
1730 *=) echo "$1" >> optdef.sh;;
1732 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1733 echo "$me: ignoring -U $1" >&2
1735 *) echo "$1='undef'" >> optdef.sh;;
1746 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1750 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1751 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1757 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1758 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1759 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1760 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1761 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1762 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1768 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1770 echo "$yyy=''" >> posthint.sh ;;
1775 echo "$yyy='$zzz'" >> posthint.sh ;;
1777 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1779 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1784 echo "$yyy=$zzz" >> posthint.sh ;;
1785 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1789 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1792 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1800 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1801 [-U symbol] [-U symbol=] [-A command:symbol...]
1802 -d : use defaults for all answers.
1803 -e : go on without questioning past the production of config.sh.
1804 -f : specify an alternate default configuration file.
1805 -h : print this help message and exit (with an error status).
1806 -r : reuse C symbols value if possible (skips costly nm extraction).
1807 -s : silent mode, only echoes questions and essential information.
1808 -D : define symbol to have some value:
1809 -D symbol symbol gets the value 'define'
1810 -D symbol=value symbol gets the value 'value'
1811 common used examples (see INSTALL for more info):
1812 -Duse64bitint use 64bit integers
1813 -Duse64bitall use 64bit integers and pointers
1814 -Dusethreads use thread support
1815 -Dinc_version_list=none do not include older perl trees in @INC
1816 -DEBUGGING=none DEBUGGING options
1817 -Dcc=gcc choose your compiler
1818 -Dprefix=/opt/perl5 choose your destination
1819 -E : stop at the end of questions, after having produced config.sh.
1820 -K : do not use unless you know what you are doing.
1821 -O : let -D and -U override definitions from loaded configuration file.
1822 -S : perform variable substitutions on all .SH files (can mix with -f)
1823 -U : undefine symbol:
1824 -U symbol symbol gets the value 'undef'
1825 -U symbol= symbol gets completely empty
1827 -A : manipulate symbol after the platform specific hints have been applied:
1828 -A append:symbol=value append value to symbol
1829 -A symbol=value like append:, but with a separating space
1830 -A define:symbol=value define symbol to have value
1831 -A clear:symbol define symbol to be ''
1832 -A define:symbol define symbol to be 'define'
1833 -A eval:symbol=value define symbol to be eval of value
1834 -A prepend:symbol=value prepend value to symbol
1835 -A undef:symbol define symbol to be 'undef'
1836 -A undef:symbol= define symbol to be ''
1837 e.g.: -A prepend:libswanted='cl pthread '
1838 -A ccflags=-DSOME_MACRO
1839 -V : print version number and exit (with a zero status).
1846 case "$fastread$alldone" in
1849 case "$extractsh" in
1852 if test ! -t 0; then
1853 echo "Say 'sh Configure', not 'sh <Configure'"
1863 true) exec 1>/dev/null;;
1866 : run the defines and the undefines, if any, but leave the file out there...
1868 grep -q '\\' optdef.sh
1869 if test $? = 0; then
1870 echo "Configure does not support \\ in -D arguments"
1874 : create the posthint manipulation script and leave the file out there...
1879 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1880 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1881 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1882 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1883 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1886 : Some greps do not return status, grrr.
1887 echo "grimblepritz" >grimble
1888 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1890 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1896 : the following should work in any shell
1900 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1901 cat >contains <<'EOSS'
1902 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1907 : Find the path to the source tree
1910 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1914 *) src=`cd ../$src && pwd` ;;
1927 if test -f $rsrc/Configure && \
1928 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1930 : found it, so we are ok.
1933 for src in . .. ../.. ../../.. ../../../..; do
1934 if test -f ../$src/Configure && \
1935 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1946 Sorry, I can't seem to locate the source dir for $package. Please start
1947 Configure with an explicit path -- i.e. /some/path/Configure.
1955 echo "Sources for $package found in \"$src\"." >&4
1959 : script used to extract .SH files with variable substitutions
1960 cat >extract <<'EOS'
1962 echo "Doing variable substitutions on .SH files..."
1963 if test -f MANIFEST; then
1964 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1966 echo "(Looking for .SH files under the source directory.)"
1967 set x `(cd "$src"; find . -name "*.SH" -print)`
1971 0) set x `(cd "$src"; echo *.SH)`; shift;;
1973 if test ! -f "$src/$1"; then
1979 while test $name; do
1980 if test ! -d "$name"; then
1981 create="$name $create";
1982 name=`echo $name | sed -e "s|^[^/]*$||"`;
1983 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1988 for file in $create; do
1997 dir=`expr X$file : 'X\(.*\)/'`
1998 file=`expr X$file : 'X.*/\(.*\)'`
1999 (cd "$dir" && . ./$file)
2009 dir=`expr X$file : 'X\(.*\)/'`
2010 file=`expr X$file : 'X.*/\(.*\)'`
2011 (set x $dir; shift; eval $mkdir_p)
2012 sh <"$src/$dir/$file"
2021 if test -f "$src/config_h.SH"; then
2022 if test ! -f config.h; then
2023 : oops, they left it out of MANIFEST, probably, so do it anyway.
2024 . "$src/config_h.SH"
2029 : extract files and exit if asked to do so
2030 case "$extractsh" in
2032 case "$realsilent" in
2036 case "$config_sh" in
2037 '') config_sh='config.sh';;
2040 echo "Fetching answers from $config_sh..."
2043 test "$override" && . ./optdef.sh
2047 echo "Extraction done."
2052 : Eunice requires " " instead of "", can you believe it
2055 echo "Beginning of configuration questions for $package."
2057 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2059 : first determine how to suppress newline on echo command
2061 echo "Checking echo to see how to suppress newlines..."
2062 (echo "hi there\c" ; echo " ") >.echotmp
2063 if $contains c .echotmp >/dev/null 2>&1 ; then
2074 echo $n "The star should be here-->$c"
2078 : Now test for existence of everything in MANIFEST
2080 if test -f "$rsrc/MANIFEST"; then
2081 echo "First let's make sure your kit is complete. Checking..." >&4
2082 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2083 (split -l 50 2>/dev/null || split -50)
2086 for filelist in x??; do
2087 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2088 >/dev/null 2>>"$tmppwd/missing")
2090 if test -s missing; then
2094 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2096 You have the option of continuing the configuration process, despite the
2097 distinct possibility that your kit is damaged, by typing 'y'es. If you
2098 do, don't blame me if something goes wrong. I advise you to type 'n'o
2099 and contact the author (perlbug@perl.org).
2102 echo $n "Continue? [n] $c" >&4
2106 echo "Continuing..." >&4
2110 echo "ABORTING..." >&4
2115 echo "Looks good..."
2118 echo "There is no MANIFEST file. I hope your kit is complete !"
2122 : Find the appropriate value for a newline for tr
2124 if test -n "$DJGPP"; then
2127 if test X"$trnl" = X; then
2128 case "`echo foo|tr '\n' x 2>/dev/null`" in
2132 if test X"$trnl" = X; then
2133 case "`echo foo|tr '\012' x 2>/dev/null`" in
2134 foox) trnl='\012' ;;
2137 if test X"$trnl" = X; then
2138 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2139 fooxy) trnl='\n\r' ;;
2142 if test X"$trnl" = X; then
2145 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2151 : compute the number of columns on the terminal for proper question formatting
2156 : set up the echo used in my read
2157 myecho="case \"\$xxxm\" in
2158 '') echo $n \"\$rp $c\" >&4;;
2160 '') echo $n \"[\$xxxm] $c\";;
2162 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2164 echo $n \"[\$xxxm] $c\" >&4
2166 echo $n \"\$rp [\$xxxm] $c\" >&4
2172 : now set up to do reads with possible shell escape and default assignment
2178 case "\$fastread" in
2179 yes) case "\$dflt" in
2182 case "\$silent-\$rp" in
2187 *) case "\$silent" in
2188 true) case "\$rp" in
2193 while expr "X\$ans" : "X!" >/dev/null; do
2197 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2205 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2214 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2219 echo "(OK, I'll run with -d after this question.)" >&4
2222 echo "*** Sorry, \$1 not supported yet." >&4
2232 echo "*** Substitution done -- please confirm."
2234 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2239 echo "*** Error -- try again."
2246 case "\$ans\$xxxm\$nostick" in
2258 : create .config dir to save info across Configure sessions
2259 test -d ../.config || mkdir ../.config
2260 cat >../.config/README <<EOF
2261 This directory created by Configure to save information that should
2262 persist across sessions for $package.
2264 You may safely delete it if you wish.
2267 : See if we are using a devel version and want that
2268 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2271 usedevel="$define" ;;
2272 *) case "$xversion" in
2275 *** WHOA THERE!!! ***
2277 This is an UNSTABLE DEVELOPMENT release.
2278 The version of this $package distribution is $xversion, that is, odd,
2279 (as opposed to even) and that signifies a development release.
2280 If you want a maintenance release, you want an even-numbered version.
2282 Do ***NOT*** install this into production use.
2283 Data corruption and crashes are possible.
2285 It is most seriously suggested that you do not continue any further
2286 unless you want to help in developing and debugging Perl.
2288 If you *still* want to build perl, you can answer 'y' now,
2289 or pass -Dusedevel to Configure.
2292 rp='Do you really want to continue?'
2296 [yY]) echo >&4 "Okay, continuing."
2297 usedevel="$define" ;;
2298 *) echo >&4 "Okay, bye."
2309 case "$versiononly" in
2310 '') versiononly="$define" ;;
2312 case "$installusrbinperl" in
2313 '') installusrbinperl="$undef" ;;
2318 : general instructions
2321 user=`(logname) 2>/dev/null`
2323 '') user=`whoami 2>&1`;;
2325 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2328 rp='Would you like to see the instructions?'
2339 This installation shell script will examine your system and ask you questions
2340 to determine how the perl5 package should be installed. If you get
2341 stuck on a question, you may use a ! shell escape to start a subshell or
2342 execute a command. Many of the questions will have default answers in square
2343 brackets; typing carriage return will give you the default.
2345 On some of the questions which ask for file or directory names you are allowed
2346 to use the ~name construct to specify the login directory belonging to "name",
2347 even if you don't have a shell which knows about that. Questions where this is
2348 allowed will be marked "(~name ok)".
2352 dflt='Type carriage return to continue'
2356 The prompter used in this script allows you to use shell variables and
2357 backticks in your answers. You may use $1, $2, etc... to refer to the words
2358 in the default answer, as if the default line was a set of arguments given to a
2359 script shell. This means you may also use $* to repeat the whole default line,
2360 so you do not have to re-type everything to add something to the default.
2362 Every time there is a substitution, you will have to confirm. If there is an
2363 error (e.g. an unmatched backtick), the default answer will remain unchanged
2364 and you will be prompted again.
2366 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2367 the questions and use the computed defaults (or the previous answers if there
2368 was already a config.sh file). Type 'Configure -h' for a list of options.
2369 You may also start interactively and then answer '& -d' at any prompt to turn
2370 on the non-interactive behaviour for the remainder of the execution.
2376 Much effort has been expended to ensure that this shell script will run on any
2377 Unix system. If despite that it blows up on yours, your best bet is to edit
2378 Configure and run it again. If you can't run Configure for some reason,
2379 you'll have to generate a config.sh file by hand. Whatever problems you
2380 have, let me (perlbug@perl.org) know how I blew it.
2382 This installation script affects things in two ways:
2384 1) it may do direct variable substitutions on some of the files included
2386 2) it builds a config.h file for inclusion in C programs. You may edit
2387 any of these files as the need arises after running this script.
2389 If you make a mistake on a question, there is no easy way to back up to it
2390 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2391 files. Configure will offer to let you do this before it runs the SH files.
2394 dflt='Type carriage return to continue'
2396 case "$firsttime" in
2397 true) echo $user >>../.config/instruct;;
2401 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2402 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2403 if test "X$sysroot" = X; then
2408 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2409 # _sysroot is used in places where we need --sysroot=foo
2410 # but using the rest of the flags could cause issues.
2411 _sysroot="--sysroot=$sysroot";
2415 ccflags="$ccflags $_sysroot"
2420 ldflags="$ldflags $_sysroot"
2425 cppflags="$cppflags $_sysroot"
2427 # lddlflags updated below in lddlflags section;
2428 # same with cccdlflags
2432 # Adjust some defaults to also use $sysroot
2433 for var in xlibpth loclibpth locincpth glibpth; do
2436 for path in $xxx; do
2437 eval $var=\"\$$var $sysroot$path\"
2443 : find out where common programs are
2445 echo "Locating common programs..." >&4
2458 if test -d \$dir/\$thing; then
2464 for thisthing in \$dir/\$thing; do
2465 : just loop through to pick last item
2467 if test -f \$thisthing; then
2470 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2473 elif test -f \$dir/\$thing.exe; then
2474 if test -n "$DJGPP"; then
2475 echo \$dir/\$thing.exe
2476 elif test "$eunicefix" != ":"; then
2477 : on Eunice apparently
2530 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2531 pth="$pth $sysroot/lib $sysroot/usr/lib"
2532 for file in $loclist; do
2536 if test -f "$xxx"; then
2539 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2540 xxx=`./loc $file $file $pth`
2543 '') xxx=`./loc $file $file $pth`;;
2544 *) xxx=`./loc $xxx $xxx $pth`;;
2546 eval $file=$xxx$_exe
2550 echo $file is in $xxx.
2553 echo $file is in $xxx.
2556 echo "I don't know where '$file' is, and my life depends on it." >&4
2557 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2563 echo "Don't worry if any of the following aren't found..."
2565 for file in $trylist; do
2569 if test -f "$xxx"; then
2572 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2573 xxx=`./loc $file $file $pth`
2576 '') xxx=`./loc $file $file $pth`;;
2577 *) xxx=`./loc $xxx $xxx $pth`;;
2579 eval $file=$xxx$_exe
2583 echo $file is in $xxx.
2586 echo $file is in $xxx.
2589 echo "I don't see $file out there, $say."
2596 echo "Substituting grep for egrep."
2603 *) if $less -R </dev/null >/dev/null 2>&1; then
2604 echo "Substituting less -R for less."
2612 echo "Substituting cp for ln."
2621 echo "I can't find make or gmake, and my life depends on it." >&4
2622 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2630 *) # We can't have osname yet.
2631 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2632 # Assume that gmake, if found, is definitely GNU make
2633 # and prefer it over the system make.
2634 echo "Substituting gmake for make."
2642 echo "Hopefully test is built into your sh."
2645 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2646 echo "Using the test built into your sh."
2654 echo "Hopefully echo is built into your sh."
2659 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2660 $echo $n "hi there$c" >foo1
2661 echo $n "hi there$c" >foo2
2662 if cmp foo1 foo2 >/dev/null 2>&1; then
2663 echo "They are compatible. In fact, they may be identical."
2670 They are not compatible! You are probably running ksh on a non-USG system.
2671 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2672 have echo built in and we may have to run some Bourne shell scripts. That
2673 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2676 $echo $n "The star should be here-->$c"
2683 # This question was auctioned at YAPC::Europe-2007 in Vienna
2684 # I never promised you could answer it. I only auctioned the question.
2686 The following message is sponsored by
2688 Dresden.pm<--The stars should be here.
2690 Dear Perl user, system administrator or package
2691 maintainer, the Perl community sends greetings to
2692 you. Do you (emblematical) greet back [Y/n]? n
2696 : Check what type of C compiler we use
2700 cat <<'EOSC' >>trygcc
2705 int main(int argc, char *argv[]) {
2709 if $cc -o try $ccflags $ldflags try.c; then
2712 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2718 # Skip this test because it gives a false match on output like:
2719 # ./trygcc: line 23: cc: command not found
2720 # case "`$cc -v -c try.c 2>&1`" in
2721 # *gcc*) trygcc=no ;;
2723 if $test X"$trygcc" = Xyes; then
2724 if gcc -o try -c try.c; then
2726 echo "You seem to have a working gcc, though." >&4
2727 # Switching compilers may undo the work of hints files.
2728 # The most common problem is -D_REENTRANT for threads.
2729 # This heuristic catches that case, but gets false positives
2730 # if -Dusethreads was not actually specified. Better to
2731 # bail out here with a useful message than fail
2732 # mysteriously later. Should we perhaps just try to
2733 # re-invoke Configure -Dcc=gcc config_args ?
2734 if $test -f usethreads.cbu; then
2737 *** However, any setting of the C compiler flags (e.g. for thread support)
2738 *** will be lost. It may be necessary for you to restart Configure and
2739 *** add -Dcc=gcc to your Configure command line.
2742 rp="Would you like to go ahead and try gcc anyway?"
2745 rp="Would you like to use it?"
2748 if $test -f myread; then
2751 if $test -f UU/myread; then
2754 echo "Cannot find myread, sorry. Aborting." >&2
2759 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2772 cat <<'EOSC' >>checkcc
2777 int main(int argc, char *argv[]) {
2781 if $cc -o try $ccflags $ldflags try.c; then
2784 if $test X"$despair" = Xyes; then
2785 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2788 You need to find a working C compiler.
2789 Either (purchase and) install the C compiler supplied by your OS vendor,
2790 or for a free C compiler try http://gcc.gnu.org/
2791 I cannot continue any further, aborting.
2800 : determine whether symbolic links are supported
2803 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2804 echo "Symbolic links are supported." >&4
2807 echo "Symbolic links are NOT supported." >&4
2812 : determine whether symbolic links are supported
2816 echo "Checking how to test for symbolic links..." >&4
2818 if $test "X$issymlink" = X; then
2820 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2821 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2823 if test $? = 0; then
2826 echo "Your builtin 'test -h' may be broken." >&4
2829 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2832 if test -f "$p/$test"; then
2841 echo "Trying external '$test -h'." >&4
2842 issymlink="$test -h"
2843 if $test ! -h sym >/dev/null 2>&1; then
2844 echo "External '$test -h' is broken, too." >&4
2852 if $test "X$issymlink" = X; then
2853 if $test -L sym 2>/dev/null; then
2854 issymlink="$test -L"
2855 echo "The builtin '$test -L' worked." >&4
2858 if $test "X$issymlink" != X; then
2859 echo "You can test for symbolic links with '$issymlink'." >&4
2861 echo "I do not know how you can test for symbolic links." >&4
2865 *) echo "No symbolic links, so not testing for their testing..." >&4
2870 : Make symlinks util
2871 case "$mksymlinks" in
2874 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2877 *) case "$lns:$issymlink" in
2878 *"ln"*" -s:"*"test -"?)
2879 echo "Creating the symbolic links..." >&4
2881 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2891 print "# dir = ", dir, "file = ", file
2892 mf[dir] = mf[dir]" "source"/"dir"/"file;
2895 if (d != ".") { print("mkdir -p "d) }
2896 print("ln -sf "mf[d]" "d);
2898 }' source="$src" > UU/mksymlinks.$$
2902 if test ! -d t/base; then
2903 echo "Failed to create the subdirectories. Aborting." >&4
2907 if test ! -f t/base/lex.t; then
2908 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2911 if test ! -f win32/win32.c; then
2912 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2917 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2925 : Check for Cross-Compilation
2926 if $test "X$targethost" = "X"; then
2929 if $test "X$targetenv" = "X"; then
2932 case "$usecrosscompile" in
2934 $echo "Cross-compiling..."
2937 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2938 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2939 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2940 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2941 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2942 # leave out ld, choosing it is more complex
2943 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2944 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2945 # We are in a weird spot. Just before us, some values
2946 # were 'saved', to be restored after the hints are
2947 # run. This means that the changes we made to ar,
2948 # nm and ranlib will get reverted.
2949 # To avoid that, we hijack the saving mechanism and
2950 # have it save our new values.
2951 for file in ar nm ranlib; do
2953 eval $file=$xxx$_exe
2958 case "$targetarch" in
2959 '') echo "Targetarch not defined." >&4; croak=y ;;
2960 *) echo "Using targetarch $targetarch." >&4 ;;
2962 case "$targethost" in
2963 '') echo "Targethost not defined." >&4; croak=y ;;
2964 *) echo "Using targethost $targethost." >&4
2969 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2971 : compile a host miniperl and generate_uudmap, unless we got passed them
2972 if $test "X$hostperl" = X; then
2973 echo "Building host miniperl and generate_uudmap binaries" >&4
2981 $src/Configure -des -Dusedevel -Dmksymlinks
2983 case "$hostgenerate" in
2984 '') $make generate_uudmap
2985 hostgenerate=$src/host/generate_uudmap
2987 "$undef") hostgenerate=''
2990 hostperl=$src/host/miniperl
2993 hostosname=`$hostperl -le 'print $^O'`
2996 usecrosscompile="$undef"
3000 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3001 case "$targethost" in
3002 '') echo "Checking for cross-compile" >&4
3003 case "$usecrosscompile$multiarch" in
3004 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3005 if [ -f Makefile ]; then
3007 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3009 echo "Configure done."
3013 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3020 *) echo "Using targethost $targethost." >&4
3022 /*) run=$src/Cross/run
3023 targetmkdir=$src/Cross/mkdir
3025 from=$src/Cross/from
3027 *) pwd=`$test -f ../Configure & cd ..; pwd`
3029 targetmkdir=$pwd/Cross/mkdir
3031 from=$pwd/Cross/from
3034 case "$targetrun" in
3035 '') targetrun=ssh ;;
3040 case "$targetfrom" in
3041 '') targetfrom=scp ;;
3045 from=$from-$targetfrom
3046 case "$targetdir" in
3048 echo "Guessing targetdir $targetdir." >&4
3051 case "$targetuser" in
3053 echo "Guessing targetuser $targetuser." >&4
3056 case "$targetport" in
3058 echo "Guessing targetport $targetport." >&4
3061 case "$targetfrom" in
3065 case "$targetrun" in
3085 '') cwd=$targetdir ;;
3090 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3096 *) echo "Unknown targetrun '$targetrun'" >&4
3100 case "$targetmkdir" in
3102 cat >$targetmkdir <<EOF
3104 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3106 $chmod a+rx $targetmkdir
3108 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3120 $targetmkdir \`dirname \$f\`
3121 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3124 $targetmkdir $targetdir/\`dirname \$f\`
3125 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3138 $mkdir -p $targetdir/\`dirname \$f\`
3139 $cp \$f $targetdir/\$f || exit 1
3142 $targetmkdir $targetdir/\`dirname \$f\`
3143 $cp \$f $targetdir/\$f || exit 1
3150 *) echo "Unknown targetto '$targetto'" >&4
3154 case "$targetfrom" in
3161 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3166 cp) cat >$from <<EOF
3171 cp $targetdir/\$f . || exit 1
3176 *) echo "Unknown targetfrom '$targetfrom'" >&4
3180 if $test ! -f $run; then
3181 echo "Target 'run' script '$run' not found." >&4
3185 if $test ! -f $to; then
3186 echo "Target 'to' script '$to' not found." >&4
3190 if $test ! -f $from; then
3191 echo "Target 'from' script '$from' not found." >&4
3195 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3199 Using '$run' for remote execution,
3200 and '$from' and '$to'
3201 for remote file transfer.
3207 usecrosscompile="$undef"
3212 : see whether [:lower:] and [:upper:] are supported character classes
3214 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3216 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3220 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3221 # (0xd9 and 0xe2), therefore that is a nice testing point.
3222 if test "X$up" = X -o "X$low" = X; then
3223 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3229 if test "X$up" = X -o "X$low" = X; then
3230 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3236 if test "X$up" = X -o "X$low" = X; then
3237 case "`echo RS | od -x 2>/dev/null`" in
3239 echo "Hey, this might be EBCDIC." >&4
3240 if test "X$up" = X -o "X$low" = X; then
3241 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3242 rs) up='[A-IJ-RS-Z]'
3247 if test "X$up" = X -o "X$low" = X; then
3248 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3258 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3260 echo "Using $up and $low to convert case." >&4
3263 echo "I don't know how to translate letters from upper to lower case." >&4
3264 echo "Your tr is not acting any way I know of." >&4
3268 : set up the translation script tr, must be called with ./tr of course
3272 '[A-Z][a-z]') exec $tr '$up' '$low';;
3273 '[a-z][A-Z]') exec $tr '$low' '$up';;
3280 : Try to determine whether config.sh was made on this system
3281 case "$config_sh" in
3283 myuname=`$uname -a 2>/dev/null`
3284 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3285 # Downcase everything to avoid ambiguity.
3286 # Remove slashes and single quotes so we can use parts of this in
3287 # directory and file names.
3288 # Remove newlines so myuname is sane to use elsewhere.
3289 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3290 # because the A-Z/a-z are not consecutive.
3291 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3292 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3293 newmyuname="$myuname"
3295 case "$knowitall" in
3297 if test -f ../config.sh; then
3298 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3299 eval "`grep myuname= ../config.sh`"
3301 if test "X$myuname" = "X$newmyuname"; then
3309 : Get old answers from old config file if Configure was run on the
3310 : same system, otherwise use the hints.
3313 if test -f config.sh; then
3315 rp="I see a config.sh file. Shall I use it to set the defaults?"
3318 n*|N*) echo "OK, I'll ignore it."
3319 mv config.sh config.sh.old
3320 myuname="$newmyuname"
3322 *) echo "Fetching default answers from your old config.sh file..." >&4
3330 : Older versions did not always set $sh. Catch re-use of such
3340 if test ! -f config.sh; then
3343 First time through, eh? I have some defaults handy for some systems
3344 that need some extra help getting the Configure answers right:
3347 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3349 : Half the following guesses are probably wrong... If you have better
3350 : tests or hints, please send them to perlbug@perl.org
3351 : The metaconfig authors would also appreciate a copy...
3352 $test -f /irix && osname=irix
3353 $test -f /xenix && osname=sco_xenix
3354 $test -f /dynix && osname=dynix
3355 $test -f /dnix && osname=dnix
3356 $test -f /lynx.os && osname=lynxos
3357 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3358 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3359 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3360 $test -f /bin/mips && /bin/mips && osname=mips
3361 $test -d /usr/apollo/bin && osname=apollo
3362 $test -f /etc/saf/_sactab && osname=svr4
3363 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3364 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3365 $test -f /sys/utilities/MultiView && osname=amigaos
3366 if $test -d /MachTen -o -d /MachTen_Folder; then
3368 if $test -x /sbin/version; then
3369 osvers=`/sbin/version | $awk '{print $2}' |
3370 $sed -e 's/[A-Za-z]$//'`
3371 elif $test -x /usr/etc/version; then
3372 osvers=`/usr/etc/version | $awk '{print $2}' |
3373 $sed -e 's/[A-Za-z]$//'`
3379 $test -f /sys/posix.dll &&
3380 $test -f /usr/bin/what &&
3381 set X `/usr/bin/what /sys/posix.dll` &&
3382 $test "$3" = UWIN &&
3386 if $test -f $uname; then
3394 umips) osname=umips ;;
3397 [23]100) osname=mips ;;
3399 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3400 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3403 elif $test -f /etc/kconfig; then
3405 if test "$lns" = "$ln -s"; then
3407 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3409 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3416 if test -n "$DJGPP"; then
3425 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3427 # oslevel can fail with:
3428 # oslevel: Unable to acquire lock.
3429 *not\ found) osvers="$4"."$3" ;;
3430 '<3240'|'<>3240') osvers=3.2.0 ;;
3431 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3432 '=3250'|'>3250') osvers=3.2.5 ;;
3436 bitrig) osname=bitrig
3439 bsd386) osname=bsd386
3442 cygwin*) osname=cygwin
3445 *dc.osx) osname=dcosx
3451 domainos) osname=apollo
3457 dragonfly) osname=dragonfly
3460 dynixptx*) osname=dynixptx
3461 osvers=`echo "$4"|sed 's/^v//'`
3463 freebsd) osname=freebsd
3465 genix) osname=genix ;;
3469 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3482 $test -f /system/lib/libandroid.so && osname=linux-android
3486 netbsd*) osname=netbsd
3489 news-os) osvers="$3"
3491 4*) osname=newsos4 ;;
3495 nonstop-ux) osname=nonstopux ;;
3496 openbsd) osname=openbsd
3502 POSIX-BC | posix-bc ) osname=posix-bc
3505 powerux | power_ux | powermax_os | powermaxos | \
3506 powerunix | power_unix) osname=powerux
3512 solaris) osname=solaris
3514 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3521 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3525 titanos) osname=titanos
3534 ultrix) osname=ultrix
3537 osf1|mls+) case "$5" in
3540 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3543 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3546 hp*) osname=hp_osf1 ;;
3547 mips) osname=mips_osf1 ;;
3550 # UnixWare 7.1.2 is known as Open UNIX 8
3551 openunix|unixware) osname=svr5
3559 $2) case "$osname" in
3563 : svr4.x or possibly later
3573 if test -f /stand/boot ; then
3574 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3575 if test -n "$INITPROG" -a -f "$INITPROG"; then
3576 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3577 if test -n "$isesix"; then
3585 *) if test -f /etc/systemid; then
3587 set `echo $3 | $sed 's/\./ /g'` $4
3588 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3590 elif $test -f $src/hints/sco_$1_$2.sh; then
3592 elif $test -f $src/hints/sco_$1.sh; then
3597 '') : Still unknown. Probably a generic Sys V.
3606 *) case "$osname" in
3607 '') : Still unknown. Probably a generic BSD.
3615 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3616 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3617 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3620 $rm -f UU/kernel.what
3621 elif test -d c:/. -o -n "$is_os2" ; then
3628 case "$targetarch" in
3631 case "$targetarch" in
3633 # Will load qnx.sh, which should change osname to nto
3638 # Catch arm-linux-androideabi, mipsel-linux-android,
3639 # and i686-linux-android
3640 osname=linux-android
3644 # Something like arm-linux-gnueabihf is really just
3651 # XXX perhaps we should just assume
3652 # osvers to be 2, or maybe take the value
3653 # from targetarch. Using $run before the
3654 # hints are run is somewhat icky.
3655 set X `$run $uname -a 2>/dev/null`
3658 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3663 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3670 : Now look for a hint file osname_osvers, unless one has been
3671 : specified already.
3674 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3675 : Also try without trailing minor version numbers.
3676 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3677 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3678 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3679 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3682 *) case "$osvers" in
3685 *) if $test -f $src/hints/$file.sh ; then
3687 elif $test -f $src/hints/$xfile.sh ; then
3689 elif $test -f $src/hints/$xxfile.sh ; then
3691 elif $test -f $src/hints/$xxxfile.sh ; then
3693 elif $test -f $src/hints/$xxxxfile.sh ; then
3695 elif $test -f "$src/hints/${osname}.sh" ; then
3704 if $test -f Policy.sh ; then
3707 none) dflt="Policy" ;;
3708 *) dflt="Policy $dflt" ;;
3713 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3717 if $test -f Policy.sh ; then
3720 There's also a Policy hint file available, which should make the
3721 site-specific (policy) questions easier to answer.
3728 You may give one or more space-separated answers, or "none" if appropriate.
3729 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3730 previous run of Configure, you may specify it as well as or instead of
3731 OS-specific hints. If hints are provided for your OS, you should use them:
3732 although Perl can probably be built without hints on many platforms, using
3733 hints often improve performance and may enable features that Configure can't
3734 set up on its own. If there are no hints that match your OS, specify "none";
3735 DO NOT give a wrong version or a wrong OS.
3739 rp="Which of these apply, if any?"
3742 for file in $tans; do
3743 if $test X$file = XPolicy -a -f Policy.sh; then
3745 $cat Policy.sh >> UU/config.sh
3746 elif $test -f $src/hints/$file.sh; then
3747 . $src/hints/$file.sh
3748 $cat $src/hints/$file.sh >> UU/config.sh
3749 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3752 : Give one chance to correct a possible typo.
3753 echo "$file.sh does not exist"
3755 rp="hint to use instead?"
3757 for file in $ans; do
3758 if $test -f "$src/hints/$file.sh"; then
3759 . $src/hints/$file.sh
3760 $cat $src/hints/$file.sh >> UU/config.sh
3761 elif $test X$ans = X -o X$ans = Xnone ; then
3764 echo "$file.sh does not exist -- ignored."
3771 : Remember our hint file for later.
3772 if $test -f "$src/hints/$file.sh" ; then
3782 echo "Fetching default answers from $config_sh..." >&4
3786 cp $config_sh config.sh 2>/dev/null
3796 test "$override" && . ./optdef.sh
3798 : Restore computed paths
3799 for file in $loclist $trylist; do
3800 eval $file="\$_$file"
3805 Configure uses the operating system name and version to set some defaults.
3806 The default value is probably right if the name rings a bell. Otherwise,
3807 since spelling matters for me, either accept the default or answer "none"
3814 ''|' '|none) dflt=none ;;
3815 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3818 *) dflt="$osname" ;;
3820 rp="Operating system name?"
3824 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3830 ''|' '|none) dflt=none ;;
3831 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3832 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3834 ''|' ') dflt=none ;;
3839 *) dflt="$osvers" ;;
3841 rp="Operating system version?"
3851 : who configured the system
3852 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3855 cf_by=`(logname) 2>/dev/null`
3858 cf_by=`(whoami) 2>/dev/null`
3860 "") cf_by=unknown ;;
3865 : decide how portable to be. Allow command line overrides.
3866 case "$d_portable" in
3868 *) d_portable="$define" ;;
3871 : set up shell script to do ~ expansion
3877 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3880 if $test -f /bin/csh; then
3881 /bin/csh -f -c "glob \$1"
3886 name=\`$expr x\$1 : '..\([^/]*\)'\`
3887 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3888 if $test ! -d "\$dir"; then
3890 echo "\$me: can't locate home directory for: \$name" >&2
3895 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3911 : now set up to get a file name
3915 cat <<'EOSC' >>getfile
3931 : getfile will accept an answer from the comma-separated list
3932 : enclosed in parentheses even if it does not meet other criteria.
3933 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3934 fn=`echo $fn | sed 's/(.*)//'`
3940 loc_file=`expr $fn : '.*:\(.*\)'`
3941 fn=`expr $fn : '\(.*\):.*'`
3949 */*) fullpath=true;;
3958 *e*) exp_file=true;;
3961 *p*) nopath_ok=true;;
3966 *d*) type='Directory';;
3967 *l*) type='Locate';;
3972 Locate) what='File';;
3977 case "$d_portable" in
3985 while test "$type"; do
3990 true) rp="$rp (~name ok)";;
3993 if test -f UU/getfile.ok && \
3994 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4013 value=`UU/filexp $ans`
4016 if test "$ans" != "$value"; then
4017 echo "(That expands to $value on this system.)"
4031 /*) value="$ansexp" ;;
4032 [a-zA-Z]:/*) value="$ansexp" ;;
4037 echo "I shall only accept a full path name, as in /bin/ls." >&4
4038 echo "Use a ! shell escape if you wish to check pathnames." >&4
4041 echo "Please give a full path name, starting with slash." >&4
4044 echo "Note that using ~name is ok provided it expands well." >&4
4057 for fp in $gfpth; do
4058 if test "X$fp" = X.; then
4063 if test -f "$pf"; then
4065 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4067 echo "($value is not a plain file, but that's ok.)"
4070 if test X"$type" = X; then
4077 for fp in $gfpth; do
4078 if test "X$fp" = X.; then
4083 direxp="$fp/$ansexp"
4085 if test -d "$direxp"; then
4093 if test -d "$ansexp"; then
4094 echo "(Looking for $loc_file in directory $value.)"
4095 value="$value/$loc_file"
4096 ansexp="$ansexp/$loc_file"
4098 if test -f "$ansexp"; then
4101 case "$nopath_ok" in
4102 true) case "$value" in
4104 *) echo "Assuming $value will be in people's path."
4120 if test "$fastread" = yes; then
4125 rp="$what $value doesn't exist. Use that name anyway?"
4144 test "X$gfpthkeep" != Xy && gfpth=""
4147 : determine root of directory hierarchy where package will be installed.
4150 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4153 dflt=`echo "$prefix" | sed 's/.$//'`
4161 By default, $package will be installed in $dflt/bin, manual pages
4162 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4163 installation directories. Typically this is something like /usr/local.
4164 If you wish to have binaries under /usr/bin but other parts of the
4165 installation under /usr/local, that's ok: you will be prompted
4166 separately for each of the installation directories, the prefix being
4167 only used to set the defaults.
4171 rp='Installation prefix to use?'
4179 *) oldprefix="$prefix";;
4186 : allow them to override the AFS root
4189 *) afsroot=$afsroot ;;
4195 $define|true) afs=true ;;
4196 $undef|false) afs=false ;;
4197 *) if $test -d $afsroot; then
4205 echo "AFS may be running... I'll be extra cautious then..." >&4
4207 echo "AFS does not seem to be running..." >&4
4210 : determine installation prefix for where package is to be installed.
4214 Since you are running AFS, I need to distinguish the directory in which
4215 files will reside from the directory in which they are installed (and from
4216 which they are presumably copied to the former directory by occult means).
4219 case "$installprefix" in
4220 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4221 *) dflt="$installprefix";;
4226 In some special cases, particularly when building $package for distribution,
4227 it is convenient to distinguish the directory in which files should be
4228 installed from the directory ($prefix) in which they will
4229 eventually reside. For most users, these two directories are the same.
4232 case "$installprefix" in
4234 *) dflt=$installprefix;;
4238 rp='What installation prefix should I use for installing files?'
4240 installprefix="$ans"
4241 installprefixexp="$ansexp"
4243 : Perform the prefixexp/installprefixexp correction if necessary
4244 cat <<EOS >installprefix
4247 cat <<'EOSC' >>installprefix
4248 : Change installation prefix, if necessary.
4249 if $test X"$prefix" != X"$installprefix"; then
4250 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4252 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4255 chmod +x installprefix
4256 $eunicefix installprefix
4258 : Set variables such as privlib and privlibexp from the output of ./getfile
4259 : performing the prefixexp/installprefixexp correction if necessary.
4260 cat <<EOS >setprefixvar
4263 cat <<'EOSC' >>setprefixvar
4264 eval "${prefixvar}=\"\$ans\""
4265 eval "${prefixvar}exp=\"\$ansexp\""
4268 chmod +x setprefixvar
4269 $eunicefix setprefixvar
4271 : set up the script used to warn in case of inconsistency
4280 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4282 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4283 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4288 echo "*** WHOA THERE!!! ***" >&4
4289 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4292 rp=" Keep the $hint value?"
4295 y) td=$was; tu=$was;;
4299 : function used to set '$1' to '$val'
4300 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4302 $define$undef) . ./whoa; eval "$var=\$td";;
4303 $undef$define) . ./whoa; eval "$var=\$tu";;
4304 *) eval "$var=$val";;
4307 : get the patchlevel
4309 echo "Getting the current patchlevel..." >&4
4310 if $test -r $rsrc/patchlevel.h;then
4311 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4312 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4313 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4314 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4315 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4316 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4317 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4326 $echo "(You do not have patchlevel.h. Eek.)"
4328 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4329 version_patchlevel_string="version $patchlevel subversion $subversion"
4330 case "$perl_patchlevel" in
4332 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4333 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4337 $echo "(You have $package $version_patchlevel_string.)"
4341 : XXX Should be a Configure test for double-dots in filenames.
4342 version=`echo $revision $patchlevel $subversion | \
4343 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4344 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4345 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4348 version=`echo $revision $patchlevel $subversion | \
4349 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4350 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4351 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4354 : Special case the 5.005_xx maintenance series, which used 5.005
4355 : without any subversion label as a subdirectory in $sitelib
4356 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4357 api_versionstring='5.005'
4360 : Do we want threads support and if so, what type
4361 case "$usethreads" in
4362 $define|true|[yY]*) dflt='y';;
4363 *) # Catch case where user specified ithreads or 5005threads but
4364 # forgot -Dusethreads (A.D. 4/2002)
4365 case "$useithreads$use5005threads" in
4366 *$define*) dflt='y';;
4373 Perl can be built to offer a form of threading support on some systems
4374 To do so, Configure can be run with -Dusethreads.
4376 Note that Perl built with threading support runs slightly slower
4377 and uses slightly more memory than plain Perl.
4379 If this doesn't make any sense to you, just accept the default '$dflt'.
4381 rp='Build a threading Perl?'
4384 y|Y) val="$define" ;;
4390 if $test $patchlevel -lt 9; then
4391 case "$usethreads" in
4393 : Default to ithreads unless overridden on command line or with
4396 case "$use5005threads" in
4398 echo "5.005 threads are no longer supported"
4402 case "$useithreads" in
4403 $undef|false|[nN]*) dflt='n';;
4405 rp='Use the newer interpreter-based ithreads?'
4408 y|Y) val="$define" ;;
4413 : Now set use5005threads to the opposite value.
4414 case "$useithreads" in
4415 $define) val="$undef" ;;
4422 useithreads="$undef"
4423 use5005threads="$undef"
4427 case "$useithreads$use5005threads" in
4431 You cannot have both the ithreads and the 5.005 threads enabled
4432 at the same time. Disabling the 5.005 threads since they are
4433 much less stable than the ithreads.
4436 use5005threads="$undef"
4441 : perl-5.9.x and later
4443 if test X"$usethreads" = "X$define"; then
4444 case "$use5005threads" in
4448 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4455 use5005threads="$undef"
4456 useithreads="$usethreads"
4459 case "$d_oldpthreads" in
4460 '') : Configure tests would be welcome here. For now, assume undef.
4462 *) val="$d_oldpthreads" ;;
4468 : Look for a hint-file generated 'call-back-unit'. If the
4469 : user has specified that a threading perl is to be built,
4470 : we may need to set or change some other defaults.
4471 if $test -f usethreads.cbu; then
4472 echo "Your platform has some specific hints regarding threaded builds, using them..."
4475 case "$usethreads" in
4476 "$define"|true|[yY]*)
4478 (Your platform does not have any specific hints for threaded builds.
4479 Assuming POSIX threads, then.)
4485 : Check if multiplicity is required
4488 Perl can be built so that multiple Perl interpreters can coexist
4489 within the same Perl executable.
4492 case "$useithreads" in
4495 This multiple interpreter support is required for interpreter-based threads.
4499 *) case "$usemultiplicity" in
4500 $define|true|[yY]*) dflt='y';;
4504 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4505 rp='Build Perl for multiplicity?'
4508 y|Y) val="$define" ;;
4516 : Check if morebits is requested
4517 case "$usemorebits" in
4518 "$define"|true|[yY]*)
4519 use64bitint="$define"
4520 uselongdouble="$define"
4521 usemorebits="$define"
4523 *) usemorebits="$undef"
4527 : Determine the C compiler to be used
4533 rp="Use which C compiler?"
4537 : See whether they have no cc but they do have gcc
4539 if $test -f cc.cbu; then
4544 : make some quick guesses about what we are up against
4546 $echo $n "Hmm... $c"
4556 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4557 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4559 echo "Looks kind of like an OSF/1 system, but we'll see..."
4561 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4562 xxx=`./loc addbib blurfl $pth`
4563 if $test -f $xxx; then
4564 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4568 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4569 echo "Looks kind of like an extended USG system, but we'll see..."
4571 echo "Looks kind of like a USG system, but we'll see..."
4575 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4576 echo "Looks kind of like a BSD system, but we'll see..."
4580 echo "Looks kind of like a Version 7 system, but we'll see..."
4583 case "$eunicefix" in
4586 There is, however, a strange, musty smell in the air that reminds me of
4587 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4591 : it so happens the Eunice I know will not run shell scripts in Unix format
4595 echo "Congratulations. You aren't running Eunice."
4599 : Detect OS2. The p_ variable is set above in the Head.U unit.
4600 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4601 : semicolon as a patch separator
4606 I have the feeling something is not exactly right, however...don't tell me...
4607 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4608 (Or you may be running DOS with DJGPP.)
4613 if test -f /xenix; then
4614 echo "Actually, this looks more like a XENIX system..."
4619 echo "It's not Xenix..."
4624 if test -f /venix; then
4625 echo "Actually, this looks more like a VENIX system..."
4632 echo "Nor is it Venix..."
4635 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4636 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4639 : Check if we are using GNU gcc and what its version is
4641 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4645 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4647 printf("%s\n", __VERSION__);
4649 printf("%s\n", "1");
4655 if $cc -o try $ccflags $ldflags try.c; then
4656 gccversion=`$run ./try`
4657 case "$gccversion" in
4658 '') echo "You are not using GNU cc." ;;
4659 *) echo "You are using GNU cc $gccversion."
4665 echo "*** WHOA THERE!!! ***" >&4
4666 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4667 case "$knowitall" in
4669 echo " You'd better start hunting for one and let me know about it." >&4
4675 case "$gccversion" in
4676 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4678 case "$gccversion" in
4679 '') gccosandvers='' ;;
4680 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4681 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4683 case "$gccosandvers" in
4684 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4685 $osname$osvers) ;; # looking good
4686 $osname*) cat <<EOM >&4
4688 *** WHOA THERE!!! ***
4690 Your gcc has not been compiled for the exact release of
4691 your operating system ($gccosandvers versus $osname$osvers).
4693 In general it is a good idea to keep gcc synchronized with
4694 the operating system because otherwise serious problems
4695 may ensue when trying to compile software, like Perl.
4697 I'm trying to be optimistic here, though, and will continue.
4698 If later during the configuration and build icky compilation
4699 problems appear (headerfile conflicts being the most common
4700 manifestation), I suggest reinstalling the gcc to match
4701 your operating system release.
4705 *) gccosandvers='' ;; # failed to parse, better be silent
4713 # gcc 3.* complain about adding -Idirectories that they already know about,
4714 # so we will take those off from locincpth.
4715 case "$gccversion" in
4717 echo "main(){}">try.c
4718 for incdir in $locincpth; do
4719 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4720 grep '^c[cp]p*[01]: warning: changing search order '`
4721 if test "X$warn" != X; then
4722 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4728 # gcc 4.9 by default does some optimizations that break perl.
4729 # see ticket 121505.
4731 # The -fwrapv disables those optimizations (and probably others,) so
4732 # for gcc 4.9 (and later, since the optimizations probably won't go
4733 # away), add -fwrapv unless the user requests -fno-wrapv, which
4734 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4735 # which turns the overflows -fwrapv ignores into runtime errors.
4736 case "$gccversion" in
4737 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4739 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4740 *) ccflags="$ccflags -fwrapv" ;;
4744 : What should the include directory be ?
4745 : Use sysroot if set, so findhdr looks in the right place.
4747 $echo $n "Hmm... $c"
4748 dflt="$sysroot/usr/include"
4751 if $test -f /bin/mips && /bin/mips; then
4752 echo "Looks like a MIPS system..."
4753 $cat >usr.c <<'EOCP'
4754 #ifdef SYSTYPE_BSD43
4758 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4759 dflt='/bsd43/usr/include'
4763 mips_type='System V'
4765 $rm -f usr.c usr.out
4766 echo "and you're compiling with the $mips_type compiler and libraries."
4770 echo "Doesn't look like a MIPS system."
4780 case "$xxx_prompt" in
4783 rp='Where are the include files you want to use?'
4791 : see how we invoke the C preprocessor
4793 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4794 cat <<'EOT' >testcpp.c
4800 if test ! -f cppstdin; then
4801 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4802 # AIX cc -E doesn't show the absolute headerfile
4803 # locations but we'll cheat by using the -M flag.
4804 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
4806 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4809 echo "Keeping your $hint cppstdin wrapper."
4812 wrapper=`pwd`/cppstdin
4816 if $test "X$cppstdin" != "X" && \
4817 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4818 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4820 echo "You used to use $cppstdin $cppminus so we'll use that again."
4822 '') echo "But let's see if we can live without a wrapper..." ;;
4824 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4825 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4827 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4830 echo "(However, $cpprun $cpplast does not work, let's see...)"
4838 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4845 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4846 $cc -E <testcpp.c >testcpp.out 2>&1; \
4847 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4848 echo "Yup, it does."
4849 x_cpp="$cc $cppflags -E"
4851 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4852 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4853 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4854 echo "Yup, it does."
4855 x_cpp="$cc $cppflags -E"
4857 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4858 $cc -P <testcpp.c >testcpp.out 2>&1; \
4859 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4860 echo "Yipee, that works!"
4861 x_cpp="$cc $cppflags -P"
4863 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4864 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4865 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4866 echo "At long last!"
4867 x_cpp="$cc $cppflags -P"
4869 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4870 $cpp <testcpp.c >testcpp.out 2>&1; \
4871 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4873 x_cpp="$cpp $cppflags"
4875 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4876 $cpp - <testcpp.c >testcpp.out 2>&1; \
4877 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4878 echo "Hooray, it works! I was beginning to wonder."
4879 x_cpp="$cpp $cppflags"
4881 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4882 $wrapper <testcpp.c >testcpp.out 2>&1; \
4883 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4889 rp="No dice. I can't find a C preprocessor. Name one:"
4893 $x_cpp <testcpp.c >testcpp.out 2>&1
4894 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4895 echo "OK, that will do." >&4
4897 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4912 echo "Perhaps can we force $cc -E using a wrapper..."
4913 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4914 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4920 echo "Nope, we'll have to live without it..."
4934 "$wrapper"|'cppstdin') ;;
4935 *) $rm -f $wrapper;;
4937 $rm -f testcpp.c testcpp.out
4939 : Adjust cppfilter for path component separator
4941 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4942 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4946 : Use gcc to determine libpth and incpth
4947 # If using gcc or clang, we can get better values for libpth, incpth
4948 # and usrinc directly from the compiler.
4949 # Note that ccname for clang is also gcc.
4952 $echo 'extern int foo;' > try.c
4953 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4955 if $test $# -gt 0; then
4957 incpth="`$echo $incpth|$sed 's/^ //'`"
4959 j="`$echo $i|$sed 's,/include$,/lib,'`"
4960 if $test -d $j; then
4964 libpth="`$echo $libpth|$sed 's/^ //'`"
4965 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4966 if $test -d $xxx; then
4969 *) libpth="$libpth $xxx";;
4976 '') for i in $incpth; do
4977 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4985 case "$usecrosscompile" in
4988 '') echo "Incpth not defined." >&4; croak=y ;;
4989 *) echo "Using incpth '$incpth'." >&4 ;;
4992 '') echo "Libpth not defined." >&4; croak=y ;;
4993 *) echo "Using libpth '$libpth'." >&4 ;;
4996 '') echo "Usrinc not defined." >&4; croak=y ;;
4997 *) echo "Using usrinc $usrinc." >&4 ;;
5001 if test "X$sysroot" = X; then
5002 echo "Cannot continue, aborting." >&4; exit 1
5004 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5013 : Default value for incpth is just usrinc
5015 '') incpth="$usrinc";;
5018 : Set private lib path
5021 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5026 '') dlist="$loclibpth $plibpth $glibpth";;
5027 *) dlist="$libpth";;
5030 : Now check and see which directories actually exist, avoiding duplicates
5033 if $test -d $xxx; then
5036 *) libpth="$libpth $xxx";;
5042 Some systems have incompatible or broken versions of libraries. Among
5043 the directories listed in the question below, please remove any you
5044 know not to be holding relevant libraries, and add any that are needed.
5045 Say "none" for none.
5049 if test "X$sysroot" != X; then
5051 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5064 rp="Directories to use for library searches?"
5071 : compute shared library extension
5074 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5084 On some systems, shared libraries may be available. Answer 'none' if
5085 you want to suppress searching of shared libraries for the remainder
5086 of this configuration.
5089 rp='What is the file extension used for shared libraries?'
5093 : Does target system insist that shared library basenames are unique
5096 Some dynamic loaders assume that the *basename* of shared library filenames
5097 are globally unique. We'll default this to undef as we assume your system
5098 is not this weird. Set to defined if you're on one of them.
5103 rp='Make shared library basenames unique?'
5106 y|Y) val="$define" ;;
5109 set d_libname_unique
5112 : Define several unixisms.
5113 : Hints files or command line option can be used to override them.
5114 : The convoluted testing is in case hints files set either the old
5117 '') case "$exe_ext" in
5119 *) _exe="$exe_ext" ;;
5124 '') case "$lib_ext" in
5131 '') case "$obj_ext" in
5138 '') case "$path_sep" in
5149 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5151 : Which makefile gets called first. This is used by make depend.
5152 case "$firstmakefile" in
5153 '') firstmakefile='makefile';;
5156 : Check is we will use socks
5158 $define|true|[yY]*) dflt='y';;
5163 Perl can be built to use the SOCKS proxy protocol library. To do so,
5164 Configure must be run with -Dusesocks. If you use SOCKS you also need
5165 to use the PerlIO abstraction layer, this will be implicitly selected.
5167 If this doesn't make any sense to you, just accept the default '$dflt'.
5169 rp='Build Perl for SOCKS?'
5172 y|Y) val="$define" ;;
5178 : Check for uselongdouble support
5180 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5183 case "$uselongdouble" in
5184 $define|true|[yY]*) dflt='y';;
5189 Perl can be built to take advantage of long doubles which
5190 (if available) may give more accuracy and range for floating point numbers.
5192 If this doesn't make any sense to you, just accept the default '$dflt'.
5194 rp='Try to use long doubles if available?'
5197 y|Y) val="$define" ;;
5203 case "$uselongdouble" in
5204 true|[yY]*) uselongdouble="$define" ;;
5207 : Look for a hint-file generated 'call-back-unit'. If the
5208 : user has specified that long doubles should be used,
5209 : we may need to set or change some other defaults.
5210 if $test -f uselongdouble.cbu; then
5211 echo "Your platform has some specific hints regarding long doubles, using them..."
5212 . ./uselongdouble.cbu
5214 case "$uselongdouble" in
5217 (Your platform does not have any specific hints for long doubles.)
5223 : Check if quadmath is requested
5224 case "$usequadmath" in
5225 "$define"|true|[yY]*) usequadmath="$define" ;;
5226 *) usequadmath="$undef" ;;
5229 : Looking for optional libraries
5231 echo "Checking for optional libraries..." >&4
5236 case "$libswanted" in
5237 '') libswanted='c_s';;
5240 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5242 case "$usecbacktrace" in
5243 "$define") libswanted="$libswanted bfd" ;;
5245 case "$usequadmath" in
5246 "$define") libswanted="$libswanted quadmath" ;;
5252 for thisdir in $libpth $xlibpth; do
5253 test -d $thisdir && libspath="$libspath $thisdir"
5255 for thislib in $libswanted; do
5256 for thisdir in $libspath; do
5258 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5259 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5260 $test -f "$xxx" && eval $libscheck
5261 $test -f "$xxx" && libstyle=shared
5262 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5263 $test -f "$xxx" && eval $libscheck
5264 $test -f "$xxx" && libstyle=shared
5266 if test ! -f "$xxx"; then
5267 xxx=$thisdir/lib$thislib.$so
5268 $test -f "$xxx" && eval $libscheck
5269 $test -f "$xxx" && libstyle=shared
5271 if test ! -f "$xxx"; then
5272 xxx=$thisdir/lib$thislib$_a
5273 $test -f "$xxx" && eval $libscheck
5274 $test -f "$xxx" && libstyle=static
5276 if test ! -f "$xxx"; then
5277 xxx=$thisdir/$thislib$_a
5278 $test -f "$xxx" && eval $libscheck
5279 $test -f "$xxx" && libstyle=static
5281 if test ! -f "$xxx"; then
5282 xxx=$thisdir/lib${thislib}_s$_a
5283 $test -f "$xxx" && eval $libscheck
5284 $test -f "$xxx" && libstyle=static
5285 $test -f "$xxx" && thislib=${thislib}_s
5287 if test ! -f "$xxx"; then
5288 xxx=$thisdir/Slib$thislib$_a
5289 $test -f "$xxx" && eval $libscheck
5290 $test -f "$xxx" && libstyle=static
5292 if $test -f "$xxx"; then
5294 shared) echo "Found -l$thislib (shared)." ;;
5295 static) echo "Found -l$thislib." ;;
5296 *) echo "Found -l$thislib ($libstyle)." ;;
5300 *) dflt="$dflt -l$thislib"
5301 libsfound="$libsfound $xxx"
5303 libsfiles="$libsfiles $yyy"
5304 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5305 case " $libsdirs " in
5307 *) libsdirs="$libsdirs $yyy" ;;
5314 if $test ! -f "$xxx"; then
5315 echo "No -l$thislib."
5326 ' '|'') dflt='none';;
5331 In order to compile $package on your machine, a number of libraries
5332 are usually needed. Include any other special libraries here as well.
5333 Say "none" for none. The default list is almost always right.
5337 rp="What libraries to use?"
5344 : determine optimization, if desired, or use for debug flag also
5346 ' '|$undef) dflt='none';;
5348 *) dflt="$optimize";;
5352 By default, $package compiles with the -O flag to use the optimizer.
5353 Alternately, you might want to use the symbolic debugger, which uses
5354 the -g flag (on traditional Unix systems). Either flag can be
5355 specified here. To use neither flag, specify the word "none".
5358 rp="What optimizer/debugger flag should be used?"
5362 'none') optimize=" ";;
5365 : Check what DEBUGGING is required from the command line
5366 : -DEBUGGING or -DDEBUGGING or
5367 : -DEBUGGING=both = -g + -DDEBUGGING
5368 : -DEBUGGING=-g or -Doptimize=-g = -g
5369 : -DEBUGGING=none or -UDEBUGGING =
5370 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5373 *) DEBUGGING=$EBUGGING ;;
5376 case "$DEBUGGING" in
5380 *) optimize="$optimize -g" ;;
5384 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5392 case "$DEBUGGING" in
5393 both|$define) dflt='-DDEBUGGING'
5396 : argument order is deliberate, as the flag will start with - which set could
5397 : think is an option
5398 checkccflag='check=$1; flag=$2; callback=$3;
5400 echo "Checking if your compiler accepts $flag" 2>&1;
5401 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5402 echo "int main(void) { return 0; }" > gcctest.c;
5403 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5404 echo "Yes, it does." 2>&1;
5405 if $test -s gcctest.out ; then
5406 echo "But your platform does not like it:";
5411 echo "Leaving current flags $ccflags alone." 2>&1
5413 *) dflt="$dflt $flag";
5419 echo "Nope, it does not, but that is ok." 2>&1;
5423 : We will not override a previous value, but we might want to
5424 : augment a hint file
5426 default|recommended)
5427 case "$gccversion" in
5428 1*) dflt="$dflt -fpcc-struct-return" ;;
5430 case "$optimize:$DEBUGGING" in
5431 *-g*:old) dflt="$dflt -DDEBUGGING";;
5433 case "$gccversion" in
5434 2*) if $test -d /etc/conf/kconfig.d &&
5435 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5437 # Interactive Systems (ISC) POSIX mode.
5442 case "$gccversion" in
5445 ?*) set strict-aliasing -fno-strict-aliasing
5449 # For gcc, adding -pipe speeds up compilations for some, but apparently
5450 # some assemblers can't read from stdin. (It also slows down compilations
5451 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5452 case "$gccversion" in
5458 # on x86_64 (at least) we require an extra library (libssp) in the
5459 # link command line. This library is not named, so I infer that it is
5460 # an implementation detail that may change. Hence the safest approach
5461 # is to add the flag to the flags passed to the compiler at link time,
5462 # as that way the compiler can do the right implementation dependant
5465 amigaos) ;; # -fstack-protector builds but doesn't work
5466 *) case "$gccversion" in
5467 ?*) set stack-protector-strong -fstack-protector-strong
5470 *-fstack-protector-strong*) ;; # It got added.
5471 *) # Try the plain/older -fstack-protector.
5472 set stack-protector -fstack-protector
5483 case "$mips_type" in
5484 *BSD*|'') inclwanted="$locincpth $usrinc";;
5485 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5487 for thisincl in $inclwanted; do
5488 if $test -d $thisincl; then
5489 if $test x$thisincl != x$usrinc; then
5491 *" -I$thisincl "*);;
5492 *) dflt="$dflt -I$thisincl ";;
5498 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5500 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5508 *) dflt="$dflt -D$2";;
5512 set signal.h LANGUAGE_C; eval $inctest
5516 ccflags="$ccflags -DSOCKS"
5521 default|recommended) dflt="$ccflags $dflt" ;;
5522 *) dflt="$ccflags";;
5531 Your C compiler may want other flags. For this question you should include
5532 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5533 but you should NOT include libraries or ld flags like -lwhatever. If you
5534 want $package to honor its debug switch, you should include -DDEBUGGING here.
5535 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5537 To use no flags, specify the word "none".
5543 rp="Any additional cc flags?"
5550 : the following weeds options from ccflags that are of no interest to cpp
5552 '') cppflags="$ccflags" ;;
5553 *) cppflags="$cppflags $ccflags" ;;
5555 case "$gccversion" in
5556 1*) cppflags="$cppflags -D__GNUC__"
5558 case "$mips_type" in
5560 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5566 echo "Let me guess what the preprocessor flags are..." >&4
5580 *) ftry="$previous $flag";;
5582 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5583 >cpp1.out 2>/dev/null && \
5584 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5585 >cpp2.out 2>/dev/null && \
5586 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5587 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5589 cppflags="$cppflags $ftry"
5599 *-*) echo "They appear to be: $cppflags";;
5601 $rm -f cpp.c cpp?.out
5605 : flags used in final linking phase
5607 '') if ./venix; then
5613 *-posix*) dflt="$dflt -posix" ;;
5616 *) dflt="$ldflags";;
5618 # See note above about -fstack-protector
5620 *-fstack-protector-strong*)
5622 *-fstack-protector-strong*) ;; # Don't add it again
5623 *) dflt="$dflt -fstack-protector-strong" ;;
5626 *-fstack-protector*)
5628 *-fstack-protector*) ;; # Don't add it again
5629 *) dflt="$dflt -fstack-protector" ;;
5634 : Try to guess additional flags to pick up local libraries.
5635 for thislibdir in $libpth; do
5636 case " $loclibpth " in
5639 *"-L$thislibdir "*) ;;
5640 *) dflt="$dflt -L$thislibdir" ;;
5652 Your C linker may need flags. For this question you should
5653 include -L/whatever and any other flags used by the C linker, but you
5654 should NOT include libraries like -lwhatever.
5656 Make sure you include the appropriate -L/path flags if your C linker
5657 does not normally search all of the directories you specified above,
5660 To use no flags, specify the word "none".
5664 rp="Any additional ld flags (NOT including libraries)?"
5670 rmlist="$rmlist pdp11"
5674 echo "Checking your choice of C compiler and flags for coherency..." >&4
5675 $cat > try.c <<'EOF'
5677 int main() { printf("Ok\n"); return(0); }
5679 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5681 $cat >try.msg <<'EOM'
5682 I've tried to compile and run the following simple program:
5685 $cat try.c >> try.msg
5687 $cat >> try.msg <<EOM
5694 and I got the following output:
5698 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5699 if $sh -c "$run ./try " >>try.msg 2>&1; then
5703 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5706 echo "The program compiled OK, but exited with status $?." >>try.msg
5707 rp="You have a problem. Shall I abort Configure"
5711 echo "I can't compile the test program." >>try.msg
5712 rp="You have a BIG problem. Shall I abort Configure"
5718 case "$knowitall" in
5720 echo "(The supplied flags or libraries might be incorrect.)"
5728 *) echo "Ok. Stopping Configure." >&4
5733 n) echo "OK, that should do.";;
5735 $rm_try gcctest gcctest.out
5737 : define a shorthand compile call
5741 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5742 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5746 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5747 : define a shorthand compile call for compilations that should be ok.
5751 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5753 : determine filename position in cpp output
5755 echo "Computing filename position in cpp output for #include directives..." >&4
5757 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5762 vos) testaccess=-e ;;
5765 echo '#include <stdio.h>' > foo.c
5768 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5769 $grep '^[ ]*#.*stdio\.h' | \
5770 while read cline; do
5773 while $test \$# -gt 0; do
5774 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5779 pos=\`expr \$pos + 1\`
5793 *) pos="${fieldn}th";;
5795 echo "Your cpp writes the filename in the $pos field of the line."
5797 : locate header file
5802 for usrincdir in $incpth
5804 if test -f \$usrincdir/\$wanted; then
5805 echo "\$usrincdir/\$wanted"
5809 awkprg='{ print \$$fieldn }'
5810 echo "#include <\$wanted>" > foo\$\$.c
5811 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5812 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5813 while read cline; do
5814 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5816 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5817 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5822 # status = 0: grep returned 0 lines, case statement not executed
5823 # status = 1: headerfile found
5824 # status = 2: while loop executed, no headerfile found
5828 if test \$status -eq 1; then
5835 : define an alternate in-header-list? function
5836 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5837 cont=true; xxf="echo \"<\$1> found.\" >&4";
5838 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5839 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5841 case $# in 4) instead=instead;; *) instead="at last";; esac;
5842 while $test "$cont"; do
5844 var=$2; eval "was=\$$2";
5845 if $test "$xxx" && $test -r "$xxx";
5847 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5850 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5851 set $yyy; shift; shift; yyy=$@;
5852 case $# in 0) cont="";;
5853 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5854 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5855 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5856 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5860 do set $yyy; var=$2; eval "was=\$$2";
5861 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5862 set $yyy; shift; shift; yyy=$@;
5865 : see if stdlib is available
5866 set stdlib.h i_stdlib
5869 : check for lengths of integral types
5873 echo "Checking to see how big your integers are..." >&4
5882 printf("intsize=%d;\n", (int)sizeof(int));
5883 printf("longsize=%d;\n", (int)sizeof(long));
5884 printf("shortsize=%d;\n", (int)sizeof(short));
5889 if eval $compile_ok && $run ./try > /dev/null; then
5891 echo "Your integers are $intsize bytes long."
5892 echo "Your long integers are $longsize bytes long."
5893 echo "Your short integers are $shortsize bytes long."
5897 Help! I can't compile and run the intsize test program: please enlighten me!
5898 (This is probably a misconfiguration in your system or libraries, and
5899 you really ought to fix it. Still, I'll try anyway.)
5903 rp="What is the size of an integer (in bytes)?"
5907 rp="What is the size of a long integer (in bytes)?"
5911 rp="What is the size of a short integer (in bytes)?"
5919 : check for long long
5921 echo "Checking to see if you have long long..." >&4
5922 echo 'int main() { long long x = 7; return 0; }' > try.c
5924 if eval $compile; then
5926 echo "You have long long."
5929 echo "You do not have long long."
5935 : check for length of long long
5936 case "${d_longlong}${longlongsize}" in
5939 echo "Checking to see how big your long longs are..." >&4
5940 $cat >try.c <<'EOCP'
5944 printf("%d\n", (int)sizeof(long long));
5949 if eval $compile_ok; then
5950 longlongsize=`$run ./try`
5951 echo "Your long longs are $longlongsize bytes long."
5955 echo "(I can't seem to compile the test program. Guessing...)"
5956 rp="What is the size of a long long (in bytes)?"
5960 if $test "X$longsize" = "X$longlongsize"; then
5961 echo "(That isn't any different from an ordinary long.)"
5967 : see if inttypes.h is available
5968 : we want a real compile instead of Inhdr because some systems
5969 : have an inttypes.h which includes non-existent headers
5972 #include <inttypes.h>
5974 static int32_t foo32 = 0x12345678;
5978 if eval $compile; then
5979 echo "<inttypes.h> found." >&4
5982 echo "<inttypes.h> NOT found." >&4
5991 echo "Checking to see if you have int64_t..." >&4
5993 #include <sys/types.h>
5994 #$i_inttypes I_INTTYPES
5996 #include <inttypes.h>
5998 int main() { int64_t x = 7; }
6001 if eval $compile; then
6003 echo "You have int64_t."
6006 echo "You do not have int64_t."
6012 : Check if 64bit ints have a quad type
6014 echo "Checking which 64-bit integer type we could use..." >&4
6020 val='"unsigned int"'
6025 *) case "$longsize" in
6029 val='"unsigned long"'
6034 *) case "$d_longlong:$longlongsize" in
6039 val='"unsigned long long"'
6044 *) case "$d_int64_t" in
6063 '') echo "Alas, no 64-bit integer types in sight." >&4
6066 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6071 : Do we want 64bit support
6072 case "$uselonglong" in
6073 "$define"|true|[yY]*)
6076 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6078 use64bitint="$define"
6081 case "$use64bits" in
6082 "$define"|true|[yY]*)
6085 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6087 use64bitint="$define"
6090 case "$use64bitints" in
6091 "$define"|true|[yY]*)
6094 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6096 use64bitint="$define"
6099 case "$use64bitsint" in
6100 "$define"|true|[yY]*)
6103 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6105 use64bitint="$define"
6108 case "$uselonglongs" in
6109 "$define"|true|[yY]*)
6112 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6114 use64bitint="$define"
6117 case "$use64bitsall" in
6118 "$define"|true|[yY]*)
6121 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6123 use64bitall="$define"
6128 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6130 case "$use64bitall" in
6131 "$define"|true|[yY]*) use64bitint="$define" ;;
6137 You have natively 64-bit long integers.
6141 *) case "$use64bitint" in
6142 "$define"|true|[yY]*) dflt='y';;
6151 Perl can be built to take advantage of 64-bit integer types
6152 on some systems. To do so, Configure can be run with -Duse64bitint.
6153 Choosing this option will most probably introduce binary incompatibilities.
6155 If this doesn't make any sense to you, just accept the default '$dflt'.
6156 (The default has been chosen based on your configuration.)
6158 rp='Try to use 64-bit integers, if available?'
6161 [yY]*) val="$define" ;;
6169 case "$use64bitall" in
6170 "$define"|true|[yY]*) dflt='y' ;;
6171 *) case "$longsize" in
6179 You may also choose to try maximal 64-bitness. It means using as much
6180 64-bitness as possible on the platform. This in turn means even more
6181 binary incompatibilities. On the other hand, your platform may not
6182 have any more 64-bitness available than what you already have chosen.
6184 If this doesn't make any sense to you, just accept the default '$dflt'.
6185 (The default has been chosen based on your configuration.)
6187 rp='Try to use maximal 64-bit support, if available?'
6190 [yY]*) val="$define" ;;
6195 case "$use64bitall" in
6197 case "$use64bitint" in
6201 Since you have chosen a maximally 64-bit build, I'm also turning on
6202 the use of 64-bit integers.
6204 use64bitint="$define" ;;
6209 : Look for a hint-file generated 'call-back-unit'. If the
6210 : user has specified that a 64-bit perl is to be built,
6211 : we may need to set or change some other defaults.
6212 if $test -f use64bitint.cbu; then
6213 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6216 case "$use64bitint" in
6217 "$define"|true|[yY]*)
6218 : This test was common to all the OpenBSD forks, and seems harmless for
6221 echo "Checking if your C library has broken 64-bit functions..." >&4
6224 typedef $uquadtype myULL;
6231 {4294967303.15, 4294967303ULL},
6232 {4294967294.2, 4294967294ULL},
6233 {4294967295.7, 4294967295ULL},
6236 for (p = test; p->u; p++) {
6237 myULL x = (myULL)p->d;
6248 if eval $compile_ok; then
6249 libcquad=`$run ./try`
6250 echo "Your C library's 64-bit functions are $libcquad."
6252 echo "(I can't seem to compile the test program.)"
6253 echo "Assuming that your C library's 64-bit functions are ok."
6262 *** You have a C library with broken 64-bit functions.
6263 *** 64-bit support does not work reliably in this configuration.
6264 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6265 *** Cannot continue, aborting.
6272 4) case "$archname64" in
6273 '') archname64=64int ;;
6280 : Look for a hint-file generated 'call-back-unit'. If the
6281 : user has specified that a maximally 64-bit perl is to be built,
6282 : we may need to set or change some other defaults.
6283 if $test -f use64bitall.cbu; then
6284 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6287 case "$use64bitall" in
6288 "$define"|true|[yY]*)
6290 4) case "$archname64" in
6291 ''|64int) archname64=64all ;;
6298 case "$d_quad:$use64bitint" in
6302 *** You have chosen to use 64-bit integers,
6303 *** but none can be found.
6304 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6305 *** Cannot continue, aborting.
6312 : Check if we are using the GNU C library
6314 echo "Checking for GNU C Library..." >&4
6316 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6317 alone are insufficient to distinguish different versions, such as
6318 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6319 libc version 2.1.0. A. Dougherty, June 3, 2002.
6325 # ifdef __GLIBC_MINOR__
6326 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6327 # include <gnu/libc-version.h>
6328 printf("%s\n", gnu_get_libc_version());
6330 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6333 printf("%d\n", __GLIBC__);
6342 if eval $compile_ok && $run ./try > glibc.ver; then
6344 gnulibc_version=`$cat glibc.ver`
6345 echo "You are using the GNU C Library version $gnulibc_version"
6349 echo "You are not using the GNU C Library"
6355 : see if nm is to be used to determine whether a symbol is defined or not
6359 case "$d_gnulibc" in
6362 echo "nm probably won't work on the GNU C Library." >&4
6368 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6370 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6371 echo "'nm' won't be sufficient on this system." >&4
6377 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6378 if $test $dflt -gt 20; then
6388 true|$define) dflt=y;;
6395 I can use $nm to extract the symbols from your C libraries. This
6396 is a time consuming task which may generate huge output on the disk (up
6397 to 3 megabytes) but that should make the symbols extraction faster. The
6398 alternative is to skip the 'nm' extraction part and to compile a small
6399 test program instead to determine whether each symbol is present. If
6400 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6401 this may be the best solution.
6403 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6406 rp="Shall I use $nm to extract C symbols from the libraries?"
6409 [Nn]*) usenm=false;;
6418 : nm options which may be necessary
6420 '') if $test -f /mach_boot; then
6422 elif $test -d /usr/ccs/lib; then
6423 nm_opt='-p' # Solaris (and SunOS?)
6424 elif $test -f /dgux; then
6426 elif $test -f /lib64/rld; then
6427 nm_opt='-p' # 64-bit Irix
6433 : nm options which may be necessary for shared libraries but illegal
6434 : for archive libraries. Thank you, Linux.
6435 case "$nm_so_opt" in
6436 '') case "$myuname" in
6438 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6439 nm_so_opt='--dynamic'
6446 : Figure out where the libc is located
6449 : get list of predefined functions in a handy place
6454 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6460 *) for thislib in $libs; do
6463 : Handle C library specially below.
6466 thislib=`echo $thislib | $sed -e 's/^-l//'`
6467 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6469 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6471 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6473 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6475 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6477 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6479 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6484 libnames="$libnames $try"
6486 *) libnames="$libnames $thislib" ;;
6495 for xxx in $libpth; do
6496 $test -r $1 || set $xxx/libc.$so
6497 : The messy sed command sorts on library version numbers.
6499 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6500 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6502 s/[0-9][0-9]*/0000&/g
6503 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6506 $sort | $sed -e 's/^.* //'`
6509 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6510 $test -r $1 || set $sysroot/lib/libsys_s$_a
6516 if $test -r "$1"; then
6517 echo "Your (shared) C library seems to be in $1."
6519 elif $test -r /lib/libc && $test -r /lib/clib; then
6520 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6522 libc='/lib/clib /lib/libc'
6523 if $test -r /lib/syslib; then
6524 echo "(Your math library is in /lib/syslib.)"
6525 libc="$libc /lib/syslib"
6527 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6528 echo "Your C library seems to be in $libc, as you said before."
6529 elif $test -r $incpath/usr/lib/libc$_a; then
6530 libc=$incpath/usr/lib/libc$_a;
6531 echo "Your C library seems to be in $libc. That's fine."
6532 elif $test -r /lib/libc$_a; then
6534 echo "Your C library seems to be in $libc. You're normal."
6536 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6538 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6539 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6540 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6542 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6544 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6547 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6549 if $test -r "$tans"; then
6550 echo "Your C library seems to be in $tans, of all places."
6556 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6560 If the guess above is wrong (which it might be if you're using a strange
6561 compiler, or your machine supports multiple models), you can override it here.
6566 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6568 I can't seem to find your C library. I've looked in the following places:
6571 $sed 's/^/ /' libpath
6574 None of these seems to contain your C library. I need to get its name...
6579 rp='Where is your C library?'
6584 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6585 set X `cat libnames`
6588 case $# in 1) xxx=file; esac
6589 echo "Extracting names from the following $xxx for later perusal:" >&4
6591 $sed 's/^/ /' libnames >&4
6593 $echo $n "This may take a while...$c" >&4
6597 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6598 *) $nm $nm_opt $file 2>/dev/null;;
6603 $grep fprintf libc.tmp > libc.ptf
6604 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6605 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6607 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6609 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6611 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6613 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6615 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6617 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6619 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6621 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6623 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6625 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6627 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6629 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6631 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6632 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6634 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6636 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6638 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6640 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6644 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6648 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6652 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6656 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6660 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6665 $nm -p $* 2>/dev/null >libc.tmp
6666 $grep fprintf libc.tmp > libc.ptf
6667 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6668 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6674 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6676 if $ar t $libc > libc.tmp && \
6677 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6679 for thisname in $libnames $libc; do
6680 $ar t $thisname >>libc.tmp
6682 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6684 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6685 for thisname in $libnames $libc; do
6686 $ar tv $thisname >>libc.tmp
6687 emximp -o tmp.imp $thisname \
6689 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6690 < tmp.imp >>libc.tmp
6693 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6696 echo "$ar didn't seem to work right." >&4
6697 echo "Maybe this is a Cray...trying bld instead..." >&4
6699 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6702 for thisname in $libnames; do
6704 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6705 $ar t $thisname >>libc.tmp
6709 echo "That didn't work either. Giving up." >&4
6719 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6720 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6722 *) if $test -f /lib/syscalls.exp; then
6724 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6725 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6726 /lib/syscalls.exp >>libc.list
6732 $rm -f libnames libpath
6734 : Check if we are using C++
6736 echo "Checking for C++..." >&4
6737 $cat >try.c <<'EOCP'
6749 if eval $compile_ok && $run ./try; then
6751 echo "You are using a C++ compiler."
6754 echo "You are not using a C++ compiler."
6760 : is a C symbol defined?
6763 -v) tf=libc.tmp; tdc="";;
6764 -a) tf=libc.tmp; tdc="[]";;
6765 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6767 case "$d_cplusplus" in
6768 $define) extern_C="extern \"C\"" ;;
6769 *) extern_C="extern" ;;
6772 case "$reuseval-$4" in
6774 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6779 if $test "$runnm" = true; then
6780 if $contains $tlook $tf >/dev/null 2>&1; then
6782 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6783 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;
6784 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6785 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6789 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;
6790 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6796 $define) tval=true;;
6803 : define an is-in-libc? function
6804 inlibc='echo " "; td=$define; tu=$undef;
6805 sym=$1; var=$2; eval "was=\$$2";
6807 case "$reuseval$was" in
6817 echo "$sym() found." >&4;
6818 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6820 echo "$sym() NOT found." >&4;
6821 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6825 $define) echo "$sym() found." >&4;;
6826 *) echo "$sym() NOT found." >&4;;
6830 : check for length of double
6832 case "$doublesize" in
6834 echo "Checking to see how big your double precision numbers are..." >&4
6843 printf("%d\n", (int)sizeof(double));
6848 if eval $compile_ok; then
6849 doublesize=`$run ./try`
6850 echo "Your double is $doublesize bytes long."
6853 echo "(I can't seem to compile the test program. Guessing...)"
6854 rp="What is the size of a double precision number (in bytes)?"
6862 : see if this is a float.h system
6866 : check for long doubles
6868 echo "Checking to see if you have long double..." >&4
6869 echo 'int main() { long double x = 7.0; }' > try.c
6871 if eval $compile; then
6873 echo "You have long double."
6876 echo "You do not have long double."
6882 : see if ldexpl exists
6886 : check for length of long double
6887 case "${d_longdbl}${longdblsize}" in
6890 echo "Checking to see how big your long doubles are..." >&4
6891 $cat >try.c <<'EOCP'
6895 printf("%d\n", sizeof(long double));
6900 if eval $compile; then
6901 longdblsize=`$run ./try`
6902 echo "Your long doubles are $longdblsize bytes long."
6906 echo "(I can't seem to compile the test program. Guessing...)" >&4
6907 rp="What is the size of a long double (in bytes)?"
6911 if $test "X$doublesize" = "X$longdblsize"; then
6912 echo "That isn't any different from an ordinary double."
6913 echo "I'll keep your setting anyway, but you may see some"
6914 echo "harmless compilation warnings."
6920 $echo "Checking the kind of long doubles you have..." >&4
6921 case "$d_longdbl" in
6926 #define LONGDBLSIZE $longdblsize
6927 #define DOUBLESIZE $doublesize
6935 static const long double d = -0.1L;
6937 unsigned const char* b = (unsigned const char*)(&d);
6938 #if DOUBLESIZE == LONGDBLSIZE
6939 printf("0\n"); /* if it floats like double */
6942 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6943 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6944 /* IEEE 754 128-bit little-endian */
6948 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6949 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6954 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6955 * while 64-bits platforms have it in 16 bytes. */
6956 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6957 if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) {
6958 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6959 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6960 * Also known as "extended precision". */
6964 if (b[0] == 0xBF && b[9] == 0xCD && b[10] == 0x00) {
6965 /* is there ever big-endian 80-bit, really? */
6970 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6971 /* software "double double", the 106 is 53+53.
6972 * but irix thinks it is 107. */
6973 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
6974 /* double double 128-bit little-endian,
6975 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
6979 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
6980 /* double double 128-bit big-endian, e.g. PPC/Power and MIPS:
6981 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
6986 printf("-1\n"); /* unknown */
6991 if eval $compile; then
6992 longdblkind=`$run ./try`
6999 case "$longdblkind" in
7000 0) echo "Your long doubles are doubles." >&4 ;;
7001 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7002 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7003 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7004 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7005 5) echo "You have 128-bit little-endian double-double long doubles." >& 4 ;;
7006 6) echo "You have 128-bit big-endian double-double long doubles." >& 4 ;;
7007 *) echo "Cannot figure out your long double." >&4 ;;
7011 : determine the architecture name
7013 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7014 tarch=`arch`"-$osname"
7015 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7016 if uname -m > tmparch 2>&1 ; then
7017 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7018 -e 's/$/'"-$osname/" tmparch`
7026 case "$myarchname" in
7029 echo "(Your architecture name used to be $myarchname.)"
7033 case "$targetarch" in
7035 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7040 *) dflt="$archname";;
7042 rp='What is your architecture name'
7046 : optionally add API version to the architecture for versioned archlibs
7047 case "$useversionedarchname" in
7048 $define|true|[yY]*) dflt='y';;
7051 rp='Add the Perl API version to your archname?'
7054 y|Y) useversionedarchname="$define" ;;
7055 *) useversionedarchname="$undef" ;;
7057 case "$useversionedarchname" in
7060 *-$api_versionstring)
7061 echo "...and architecture name already has -$api_versionstring" >&4
7064 archname="$archname-$api_versionstring"
7065 echo "...setting architecture name to $archname." >&4
7071 case "$usethreads" in
7073 echo "Threads selected." >&4
7075 *-thread*) echo "...and architecture name already has -thread." >&4
7077 *) archname="$archname-thread"
7078 echo "...setting architecture name to $archname." >&4
7083 case "$usemultiplicity" in
7085 echo "Multiplicity selected." >&4
7087 *-multi*) echo "...and architecture name already has -multi." >&4
7089 *) archname="$archname-multi"
7090 echo "...setting architecture name to $archname." >&4
7095 case "$use64bitint$use64bitall" in
7097 case "$archname64" in
7099 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7102 case "$use64bitint" in
7103 "$define") echo "64 bit integers selected." >&4 ;;
7105 case "$use64bitall" in
7106 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7109 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7111 *) archname="$archname-$archname64"
7112 echo "...setting architecture name to $archname." >&4
7118 case "$uselongdouble" in
7120 echo "Long doubles selected." >&4
7121 case "$longdblsize" in
7123 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7127 *-ld*) echo "...and architecture name already has -ld." >&4
7129 *) archname="$archname-ld"
7130 echo "...setting architecture name to $archname." >&4
7137 case "$usequadmath" in
7139 echo "quadmath selected." >&4
7141 *-ld*) echo "...and architecture name already has -quadmath." >&4
7143 *) archname="$archname-quadmath"
7144 echo "...setting architecture name to $archname." >&4
7149 if $test -f archname.cbu; then
7150 echo "Your platform has some specific hints for architecture name, using them..."
7154 : set the prefixit variable, to compute a suitable default value
7155 prefixit='case "$3" in
7157 case "$oldprefix" in
7158 "") eval "$1=\"\$$2\"";;
7165 ""|" ") eval "$1=\"\$$2\"";;
7171 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7173 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7174 /*-$oldprefix/*|\~*-$oldprefix/*)
7175 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7176 *) eval "$1=\"\$$2\"";;
7180 : determine installation style
7181 : For now, try to deduce it from prefix unless it is already set.
7182 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7183 case "$installstyle" in
7184 '') case "$prefix" in
7185 *perl*) dflt='lib';;
7186 *) dflt='lib/perl5' ;;
7189 *) dflt="$installstyle" ;;
7191 : Probably not worth prompting for this since we prompt for all
7192 : the directories individually, and the prompt would be too long and
7196 : determine where public executables go
7201 rp='Pathname where the public executables will reside?'
7203 if $test "X$ansexp" != "X$binexp"; then
7207 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7208 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7209 : this via initialinstalllocation
7212 case "$userelocatableinc" in
7213 $define|true|[yY]*) dflt='y' ;;
7218 Would you like to build Perl so that the installation is relocatable, so that
7219 library paths in @INC are determined relative to the path of the perl binary?
7220 This is not advised for system Perl installs, or if you need to run setid
7221 scripts or scripts under taint mode.
7223 If this doesn't make any sense to you, just accept the default '$dflt'.
7225 rp='Use relocatable @INC?'
7228 y|Y) val="$define" ;;
7231 set userelocatableinc
7234 initialinstalllocation="$binexp"
7235 : Default prefix is now "up one level from where the binaries are"
7236 case "$userelocatableinc" in
7242 installprefixexp=".../.."
7246 : determine where private library files go
7247 : Usual default is /usr/local/lib/perl5/$version.
7248 : Also allow things like /opt/perl/lib/$version, since
7249 : /opt/perl/lib/perl5... would be redundant.
7250 : The default "style" setting is made in installstyle.U
7251 case "$installstyle" in
7252 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7253 *) set dflt privlib lib/$version ;;
7258 There are some auxiliary files for $package that need to be put into a
7259 private library directory that is accessible by everyone.
7264 rp='Pathname where the private library files will reside?'
7269 : set the prefixup variable, to restore leading tilda escape
7270 prefixup='case "$prefixexp" in
7272 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7275 : determine where public architecture dependent libraries go
7278 : privlib default is /usr/local/lib/$package/$version
7279 : archlib default is /usr/local/lib/$package/$version/$archname
7280 : privlib may have an optional trailing /share.
7281 tdflt=`echo $privlib | $sed 's,/share$,,'`
7282 tdflt=$tdflt/$archname
7291 $spackage contains architecture-dependent library files. If you are
7292 sharing libraries in a heterogeneous environment, you might store
7293 these files in a separate location. Otherwise, you can just include
7294 them with the rest of the public library files.
7299 rp='Where do you want to put the public architecture-dependent libraries?'
7303 if $test X"$archlib" = X"$privlib"; then
7309 : see if setuid scripts can be secure
7312 Some kernels have a bug that prevents setuid #! scripts from being
7313 secure. Some sites have disabled setuid #! scripts because of this.
7315 First let's decide if your kernel supports secure setuid #! scripts.
7316 (If setuid #! scripts would be secure but have been disabled anyway,
7317 don't say that they are secure if asked.)
7322 if $test -d /dev/fd; then
7323 echo "#!$ls" >reflect
7324 chmod +x,u+s reflect
7325 ./reflect >flect 2>&1
7326 if $contains "/dev/fd" flect >/dev/null; then
7327 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7331 If you are not sure if they are secure, I can check but I'll need a
7332 username and password different from the one you are using right now.
7333 If you don't have such a username or don't want me to test, simply
7337 rp='Other username to test security of setuid scripts with?'
7342 case "$d_suidsafe" in
7343 '') echo "I'll assume setuid scripts are *not* secure." >&4
7346 echo "Well, the $hint value is *not* secure." >&4
7348 *) echo "Well, the $hint value *is* secure." >&4
7353 $rm -f reflect flect
7354 echo "#!$ls" >reflect
7355 chmod +x,u+s reflect
7358 echo '"su" will (probably) prompt you for '"$ans's password."
7359 su $ans -c './reflect >flect'
7360 if $contains "/dev/fd" flect >/dev/null; then
7361 echo "Okay, it looks like setuid scripts are secure." >&4
7364 echo "I don't think setuid scripts are secure." >&4
7369 rp='Does your kernel have *secure* setuid scripts?'
7372 [yY]*) val="$define";;
7377 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7378 echo "(That's for file descriptors, not floppy disks.)"
7384 $rm -f reflect flect
7386 : now see if they want to do setuid emulation
7387 if $test $patchlevel -lt 11; then
7390 case "$d_suidsafe" in
7393 echo "No need to emulate SUID scripts since they are secure here." >&4
7397 Some systems have disabled setuid scripts, especially systems where
7398 setuid scripts cannot be secure. On systems where setuid scripts have
7399 been disabled, the setuid/setgid bits on scripts are currently
7400 useless. It is possible for $package to detect those bits and emulate
7401 setuid/setgid in a secure fashion. This emulation will only work if
7402 setuid scripts have been disabled in your kernel.
7406 "$define") dflt=y ;;
7409 rp="Do you want to do setuid/setgid emulation?"
7412 [yY]*) val="$define";;
7424 SUID emulation has been removed for 5.12
7425 Please re-run Configure without -Dd_dosuid
7434 : Find perl5.005 or later.
7435 echo "Looking for a previously installed perl5.005 or later... "
7437 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7438 : Check if this perl is recent and can load a simple module
7439 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7442 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7452 '') echo "None found. That's ok.";;
7453 *) echo "Using $perl5." ;;
7456 : Set the siteprefix variables
7459 After $package is installed, you may wish to install various
7460 add-on modules and utilities. Typically, these add-ons will
7461 be installed under $prefix with the rest
7462 of this package. However, you may wish to install such add-ons
7463 elsewhere under a different prefix.
7465 If you do not wish to put everything under a single prefix, that's
7466 ok. You will be prompted for the individual locations; this siteprefix
7467 is only used to suggest the defaults.
7469 The default should be fine for most people.
7473 rp='Installation prefix to use for add-on modules and utilities?'
7474 : XXX Here might be another good place for an installstyle setting.
7475 case "$siteprefix" in
7477 *) dflt=$siteprefix ;;
7480 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7482 case "$siteprefix" in
7486 *) oldsiteprefix="$prefix";;
7491 siteprefixexp="$ansexp"
7493 : determine where site specific libraries go.
7494 : Usual default is /usr/local/lib/perl5/site_perl/$version
7495 : The default "style" setting is made in installstyle.U
7496 : XXX No longer works with Prefixit stuff.
7497 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7499 '') case "$installstyle" in
7500 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7501 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7509 The installation process will create a directory for
7510 site-specific extensions and modules. Most users find it convenient
7511 to place all site-specific files in this directory rather than in the
7512 main distribution directory.
7516 rp='Pathname for the site-specific library files?'
7520 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7522 : Determine list of previous versions to include in @INC
7523 $cat > getverlist <<EOPL
7526 \$api_versionstring = "$api_versionstring";
7527 \$version = "$version";
7528 \$stem = "$sitelib_stem";
7529 \$archname = "$archname";
7531 $cat >> getverlist <<'EOPL'
7532 # The list found is store twice for each entry: the original name, and
7533 # the binary broken down version as pack "sss", so sorting is easy and
7534 # unambiguous. This will work for all versions that have a maximum of
7535 # three digit groups, separate by '.'s or '_'s. Names are extended with
7536 # ".0.0" to ensure at least three elements for the pack.
7537 # -- H.Merijn Brand (m)'06 23-10-2006
7539 # Can't have leading @ because metaconfig interprets it as a command!
7540 ;@inc_version_list=();
7541 # XXX Redo to do opendir/readdir?
7544 ;@candidates = map {
7545 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7546 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7552 ($pversion, $aversion, $vsn5005) = map {
7553 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7554 foreach $d (@candidates) {
7555 if ($d->[1] lt $pversion) {
7556 if ($d->[1] ge $aversion) {
7557 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7559 elsif ($d->[1] ge $vsn5005) {
7560 unshift(@inc_version_list, grep { -d } $d->[0]);
7564 # Skip newer version. I.e. don't look in
7565 # 5.7.0 if we're installing 5.6.1.
7569 if (@inc_version_list) {
7570 print join(' ', @inc_version_list);
7573 # Blank space to preserve value for next Configure run.
7578 case "$inc_version_list" in
7579 '') if test -x "$perl5$exe_ext"; then
7580 dflt=`$perl5 getverlist`
7585 $undef) dflt='none' ;;
7586 *) eval dflt=\"$inc_version_list\" ;;
7589 ''|' ') dflt=none ;;
7596 In order to ease the process of upgrading, this version of perl
7597 can be configured to use modules built and installed with earlier
7598 versions of perl that were installed under $prefix. Specify here
7599 the list of earlier versions that this version of perl should check.
7600 If Configure detected no earlier versions of perl installed under
7601 $prefix, then the list will be empty. Answer 'none' to tell perl
7602 to not search earlier versions.
7604 The default should almost always be sensible, so if you're not sure,
7605 just accept the default.
7608 rp='List of earlier versions to include in @INC?'
7611 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7612 *) inc_version_list="$ans" ;;
7614 case "$inc_version_list" in
7616 inc_version_list_init='0'
7617 d_inc_version_list="$undef"
7619 *) inc_version_list_init=`echo $inc_version_list |
7620 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7621 d_inc_version_list="$define"
7626 : see if malloc/malloc.h has to be included
7627 set malloc/malloc.h i_mallocmalloc
7630 : see if this is a malloc.h system
7631 : we want a real compile instead of Inhdr because some systems have a
7632 : malloc.h that just gives a compile error saying to use stdlib.h instead
7637 #$i_mallocmalloc I_MALLOCMALLOC
7638 #ifdef I_MALLOCMALLOC
7639 # include <malloc/malloc.h>
7642 int main () { return 0; }
7645 if eval $compile; then
7646 echo "<malloc.h> found." >&4
7649 echo "<malloc.h> NOT found." >&4
7656 : check for length of pointer
7660 echo "Checking to see how big your pointers are..." >&4
7669 printf("%d\n", (int)sizeof(void *));
7674 if eval $compile_ok; then
7675 ptrsize=`$run ./try`
7676 echo "Your pointers are $ptrsize bytes long."
7679 echo "(I can't seem to compile the test program. Guessing...)" >&4
7680 rp="What is the size of a pointer (in bytes)?"
7687 case "$use64bitall" in
7688 "$define"|true|[yY]*)
7692 *** You have chosen a maximally 64-bit build,
7693 *** but your pointers are only 4 bytes wide.
7694 *** Please rerun Configure without -Duse64bitall.
7699 *** Since you have quads, you could possibly try with -Duse64bitint.
7704 *** Cannot continue, aborting.
7715 : determine whether to use malloc wrapping
7717 case "$usemallocwrap" in
7718 [yY]*|true|$define) dflt='y' ;;
7719 [nN]*|false|$undef) dflt='n' ;;
7720 *) case "$usedevel" in
7721 [yY]*|true|$define) dflt='y' ;;
7726 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7728 usemallocwrap="$ans"
7731 usemallocwrap="$define" ;;
7733 usemallocwrap="$undef" ;;
7736 : determine which malloc to compile in
7738 case "$usemymalloc" in
7739 [yY]*|true|$define) dflt='y' ;;
7740 [nN]*|false|$undef) dflt='n' ;;
7741 *) case "$ptrsize" in
7745 if test "$useithreads" = "$define"; then dflt='n'; fi
7748 rp="Do you wish to attempt to use the malloc that comes with $package?"
7754 mallocsrc='malloc.c'
7755 mallocobj="malloc$_o"
7756 d_mymalloc="$define"
7759 : Remove malloc from list of libraries to use
7760 echo "Removing unneeded -lmalloc from library list" >&4
7761 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7764 echo "libs = $libs" >&4
7776 : compute the return types of malloc and free
7778 $cat >malloc.c <<END
7782 #include <sys/types.h>
7796 case "$malloctype" in
7798 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7805 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7809 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7816 echo "Your system uses $freetype free(), it would seem." >&4
7818 : determine where site specific architecture-dependent libraries go.
7819 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7820 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7821 : sitelib may have an optional trailing /share.
7823 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7824 dflt="$dflt/$archname"
7829 set sitearch sitearch none
7833 The installation process will also create a directory for
7834 architecture-dependent site-specific extensions and modules.
7838 rp='Pathname for the site-specific architecture-dependent library files?'
7842 if $test X"$sitearch" = X"$sitelib"; then
7845 d_sitearch="$define"
7848 : Set the vendorprefix variables
7851 The installation process will also create a directory for
7852 vendor-supplied add-ons. Vendors who supply perl with their system
7853 may find it convenient to place all vendor-supplied files in this
7854 directory rather than in the main distribution directory. This will
7855 ease upgrades between binary-compatible maintenance versions of perl.
7857 Of course you may also use these directories in whatever way you see
7858 fit. For example, you might use them to access modules shared over a
7859 company-wide network.
7861 The default answer should be fine for most people.
7862 This causes further questions about vendor add-ons to be skipped
7863 and no vendor-specific directories will be configured for perl.
7866 rp='Do you want to configure vendor-specific add-on directories?'
7867 case "$usevendorprefix" in
7868 define|true|[yY]*) dflt=y ;;
7869 *) : User may have set vendorprefix directly on Configure command line.
7870 case "$vendorprefix" in
7879 rp='Installation prefix to use for vendor-supplied add-ons?'
7880 case "$vendorprefix" in
7881 '') dflt="$prefix" ;;
7882 *) dflt=$vendorprefix ;;
7885 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7887 case "$vendorprefix" in
7891 *) oldvendorprefix="$prefix";;
7895 usevendorprefix="$define"
7897 vendorprefixexp="$ansexp"
7899 *) usevendorprefix="$undef"
7905 : Set the vendorlib variables
7906 case "$vendorprefix" in
7907 '') d_vendorlib="$undef"
7911 *) d_vendorlib="$define"
7912 : determine where vendor-supplied modules go.
7913 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7914 case "$vendorlib" in
7916 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7917 case "$installstyle" in
7918 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7919 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7922 *) dflt="$vendorlib"
7926 rp='Pathname for the vendor-supplied library files?'
7929 vendorlibexp="$ansexp"
7932 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7936 : Set the vendorarch variables
7937 case "$vendorprefix" in
7938 '') d_vendorarch="$undef"
7942 *) d_vendorarch="$define"
7943 : determine where vendor-supplied architecture-dependent libraries go.
7944 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7945 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7946 : vendorlib may have an optional trailing /share.
7947 case "$vendorarch" in
7948 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7949 dflt="$dflt/$archname"
7951 *) dflt="$vendorarch" ;;
7954 rp='Pathname for vendor-supplied architecture-dependent files?'
7957 vendorarchexp="$ansexp"
7960 prefixvar=vendorarch
7962 if $test X"$vendorarch" = X"$vendorlib"; then
7963 d_vendorarch="$undef"
7965 d_vendorarch="$define"
7968 : Final catch-all directories to search
7971 Lastly, you can have perl look in other directories for extensions and
7972 modules in addition to those already specified.
7973 These directories will be searched after
7977 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7978 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7980 case "$otherlibdirs" in
7981 ''|' ') dflt='none' ;;
7982 *) dflt="$otherlibdirs" ;;
7985 Enter a colon-separated set of extra paths to include in perl's @INC
7986 search path, or enter 'none' for no extra paths.
7990 rp='Colon-separated list of additional directories for perl to search?'
7993 ' '|''|none) otherlibdirs=' ' ;;
7994 *) otherlibdirs="$ans" ;;
7996 case "$otherlibdirs" in
8000 set d_perl_otherlibdirs
8003 : Cruising for prototypes
8005 echo "Checking out function prototypes..." >&4
8006 $cat >prototype.c <<EOCP
8011 int main(int argc, char *argv[]) {
8014 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8015 echo "Your C compiler appears to support function prototypes."
8018 echo "Your C compiler doesn't seem to understand function prototypes."
8025 : Check if ansi2knr is required
8026 case "$prototype" in
8028 *) ansi2knr='ansi2knr'
8033 This version of $package can only be compiled by a compiler that
8034 understands function prototypes. Unfortunately, your C compiler
8036 doesn't seem to understand them. Sorry about that.
8038 If GNU cc is available for your system, perhaps you could try that instead.
8040 Eventually, we hope to support building Perl with pre-ANSI compilers.
8041 If you would like to help in that effort, please contact <perlbug@perl.org>.
8043 Aborting Configure now.
8050 dflt_dtrace='/usr/sbin/dtrace'
8051 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8055 Perl can be built to support DTrace on platforms that support it.
8056 DTrace is a diagnosis and performance analysis tool from Sun.
8058 If this doesn't make any sense to you, just accept the default.
8062 case "$usedtrace" in
8068 dflt_dtrace=$usedtrace
8075 rp='Support DTrace if available?'
8078 y|Y) val="$define" ;;
8084 test "X$usedtrace" != "X$define" && break
8087 rp='Where is the dtrace executable?'
8096 if $dtrace -h -s ../perldtrace.d \
8097 -o perldtrace.tmp >/dev/null 2>&1 \
8098 && rm -f perldtrace.tmp
8101 echo "Good: your $dtrace knows about the -h flag."
8105 *** $me: Fatal Error: $dtrace doesn't support -h flag
8107 *** Your installed dtrace doesn't support the -h switch to compile a D
8108 *** program into a C header. Can't continue.
8120 *** $me: Fatal Error: $dtrace not found.
8127 echo "*** $dtrace was not found."
8133 : See if we want extra modules installed
8140 Perl can be built with extra modules or bundles of modules which
8141 will be fetched from the CPAN and installed alongside Perl.
8143 Notice that you will need access to the CPAN; either via the Internet,
8144 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8145 be asked later to configure the CPAN.pm module which will in turn do
8146 the installation of the rest of the extra modules or bundles.)
8148 Notice also that if the modules require any external software such as
8149 libraries and headers (the libz library and the zlib.h header for the
8150 Compress::Zlib module, for example) you MUST have any such software
8151 already installed, this configuration process will NOT install such
8154 If this doesn't make any sense to you, just accept the default '$dflt'.
8156 rp='Install any extra modules (y or n)?'
8162 Please list any extra modules or bundles to be installed from CPAN,
8163 with spaces between the names. The names can be in any format the
8164 'install' command of CPAN.pm will understand. (Answer 'none',
8165 without the quotes, to install no extra modules or bundles.)
8175 $rm -f ../extras.lst
8177 *) echo "(Saving the list of extras for later...)"
8178 echo "$extras" > ../extras.lst
8186 : determine where html pages for programs go
8187 set html1dir html1dir none
8191 If you wish to install html files for programs in $spackage, indicate
8192 the appropriate directory here. To skip installing html files,
8196 ''|none|$undef|' ') dflt=none ;;
8197 *) dflt=$html1dir ;;
8200 rp="Directory for the main $spackage html pages?"
8204 : Use ' ' for none so value is preserved next time through Configure
8205 $test X"$html1dir" = "X" && html1dir=' '
8207 : determine where html pages for libraries and modules go
8208 set html3dir html3dir none
8212 If you wish to install html files for modules associated with $spackage,
8213 indicate the appropriate directory here. To skip installing html files,
8216 : There is no obvious default. If they have specified html1dir, then
8217 : try to key off that, possibly changing .../html1 into .../html3.
8219 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8220 *) dflt=$html3dir ;;
8223 rp="Directory for the $spackage module html pages?"
8227 : Use ' ' for none so value is preserved next time through Configure
8228 $test X"$html3dir" = "X" && html3dir=' '
8230 : determine whether to install perl also as /usr/bin/perl
8233 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8235 Many scripts expect perl to be installed as /usr/bin/perl.
8237 If you want to, I can install the perl you are about to compile
8238 as /usr/bin/perl (in addition to $bin/perl).
8240 if test -f /usr/bin/perl; then
8243 However, please note that because you already have a /usr/bin/perl,
8244 overwriting that with a new Perl would very probably cause problems.
8245 Therefore I'm assuming you don't want to do that (unless you insist).
8248 case "$installusrbinperl" in
8249 "$define"|[yY]*) dflt='y';;
8255 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8258 case "$installusrbinperl" in
8259 "$undef"|[nN]*) dflt='n';;
8263 rp="Do you want to install perl as /usr/bin/perl?"
8266 [yY]*) val="$define";;
8272 set installusrbinperl
8275 : see if dlopen exists
8277 xxx_ccflags="$ccflags"
8279 : with g++ one needs -shared to get is-in-libc to work for dlopen
8280 case "$gccversion" in
8282 *) case "$d_cplusplus" in
8283 "$define") ccflags="$ccflags -shared" ;;
8290 ccflags="$xxx_ccflags"
8292 : see if this is a unistd.h system
8293 set unistd.h i_unistd
8296 : determine which dynamic loading, if any, to compile in
8298 dldir="ext/DynaLoader"
8311 $define) dflt='y' ;;
8313 : Does a dl_xxx.xs file exist for this operating system
8314 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8317 rp="Do you wish to use dynamic loading?"
8324 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8325 dflt="$dldir/dl_${osname}.xs"
8326 elif $test "$d_dlopen" = "$define" ; then
8327 dflt="$dldir/dl_dlopen.xs"
8332 *) dflt="$dldir/$dlsrc"
8335 echo "The following dynamic loading files are available:"
8336 : Can not go over to $dldir because getfile has path hard-coded in.
8337 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8338 rp="Source file to use for dynamic loading"
8344 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8348 Some systems may require passing special flags to $cc -c to
8349 compile modules that will be used to create a shared library.
8350 To use no flags, say "none".
8353 case "$cccdlflags" in
8354 '') case "$gccversion" in
8355 '') case "$osname" in
8357 irix*) dflt='-KPIC' ;;
8358 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8359 sunos) dflt='-pic' ;;
8363 *) case "$osname" in
8364 darwin) dflt='none' ;;
8365 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8370 *) dflt="$cccdlflags" ;;
8377 # If -Dsysroot was specified, now's the time to add it
8379 if test "X$sysroot" != X; then
8380 case "$gccversion" in
8385 dflt="$dflt --sysroot=$sysroot" ;;
8395 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8398 none) cccdlflags=' ' ;;
8399 *) cccdlflags="$ans" ;;
8404 Some systems use ld to create libraries that can be dynamically loaded,
8405 while other systems (such as those using ELF) use $cc.
8409 : Determine if this is ELF
8411 /* Test for whether ELF binaries are produced */
8423 int i = open("a.out",O_RDONLY);
8426 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8427 exit(0); /* succeed (yes, it is ELF) */
8431 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8437 '') if $test $bin_ELF = "$define"; then
8439 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8443 echo "I'll use ld to build dynamic libraries."
8451 rp="What command should be used to create dynamic libraries?"
8457 Some systems may require passing special flags to $ld to create a
8458 library that can be dynamically loaded. If your ld flags include
8459 -L/other/path options to locate libraries outside your loader's normal
8460 search path, you may need to specify those -L options here as well. To
8461 use no flags, say "none".
8464 case "$lddlflags" in
8465 '') case "$osname" in
8466 haiku) dflt='-shared' ;;
8468 case "$gccversion" in
8469 '') dflt="$dflt +vnocompatwarnings" ;;
8472 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8473 solaris) # See [perl #66604].
8474 # On Solaris 11, gcc -m64 on amd64
8475 # appears not to understand -G. gcc versions at
8476 # least as old as 3.4.3 support -shared, so just
8477 # use that with Solaris 11 and later, but keep
8478 # the old behavior for older Solaris versions.
8479 case "$gccversion" in
8481 *) case "$osvers" in
8482 2.?|2.10) dflt='-G' ;;
8483 *) dflt='-shared' ;;
8488 sunos) dflt='-assert nodefinitions' ;;
8489 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8493 *) dflt="$lddlflags" ;;
8496 : Only do this for gcc, since, for example, qcc has no concept
8498 if $test "X$sysroot" != X; then
8499 case "$gccversion" in
8501 *) dflt="$dflt --sysroot $sysroot" ;;
8505 : Try to guess additional flags to pick up local libraries.
8506 : Be careful not to append to a plain 'none'
8510 for thisflag in $ldflags; do
8515 *) dflt="$dflt $thisflag" ;;
8522 ''|' ') dflt='none' ;;
8526 *-fstack-protector-strong*)
8528 *-fstack-protector-strong*) ;; # Don't add it again
8529 *) dflt="$dflt -fstack-protector-strong" ;;
8532 *-fstack-protector*)
8534 *-fstack-protector*) ;; # Don't add it again
8535 *) dflt="$dflt -fstack-protector" ;;
8540 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8543 none) lddlflags=' ' ;;
8544 *) lddlflags="$ans" ;;
8549 Some systems may require passing special flags to $cc to indicate that
8550 the resulting executable will use dynamic linking. To use no flags,
8554 case "$ccdlflags" in
8555 '') case "$osname" in
8556 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8557 sunos) dflt='none' ;;
8561 *) dflt="$ccdlflags" ;;
8563 rp="Any special flags to pass to $cc to use dynamic linking?"
8566 none) ccdlflags=' ' ;;
8567 *) ccdlflags="$ans" ;;
8579 ld_can_script="$undef"
8580 case "$bin_ELF$usedl" in
8582 # Abuse try.h and a.out names for neat cleanup
8594 if $cc $cccdlflags $ccdlflags $ccflags \
8595 $ldflags $lddlflags -o a.out try.c \
8596 -Wl,--version-script=try.h >/dev/null 2>&1 \
8597 && $test -s a.out ; then
8598 echo "ld supports scripting" >&4
8599 ld_can_script="$define"
8601 echo "ld does not support scripting" >&4
8607 : Do we want a shared libperl?
8611 # No dynamic loading being used, so don't bother even to prompt.
8614 *) case "$useshrplib" in
8615 '') case "$osname" in
8616 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8618 also='Building a shared libperl is required for dynamic loading to work on your system.'
8632 The perl executable is normally obtained by linking perlmain.c with
8633 libperl${_a}, any static extensions (usually just DynaLoader), and
8634 any other libraries needed on this system (such as -lm, etc.). Since
8635 your system supports dynamic loading, it is probably possible to build
8636 a shared libperl.$so. If you will have more than one executable linked
8637 to libperl.$so, this will significantly reduce the size of each
8638 executable, but it may have a noticeable effect on performance. The
8639 default is probably sensible for your system.
8643 rp="Build a shared libperl.$so (y/n)"
8647 useshrplib='true' ;;
8648 *) useshrplib='false' ;;
8653 case "$useshrplib" in
8655 case "$userelocatableinc" in
8657 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8658 echo "See INSTALL for an explanation why that won't work." >&4
8664 # Figure out a good name for libperl.so. Since it gets stored in
8665 # a version-specific architecture-dependent library, the version
8666 # number isn't really that important, except for making cc/ld happy.
8668 # A name such as libperl.so.10.1
8669 majmin="libperl.$so.$patchlevel.$subversion"
8670 # A name such as libperl.so.100
8671 majonly=`echo $patchlevel $subversion |
8672 $awk '{printf "%d%02d", $1, $2}'`
8673 majonly=libperl.$so.$majonly
8674 # I'd prefer to keep the os-specific stuff here to a minimum, and
8675 # rely on figuring it out from the naming of libc.
8676 case "${osname}${osvers}" in
8677 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8680 cygwin*) # ld links now against the dll directly
8681 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8682 majonly=`echo $patchlevel $subversion |
8683 $awk '{printf "%03d%03d", $1, $2}'`
8684 majonly=cygperl5.$majonly.$so
8687 *) # Try to guess based on whether libc has major.minor.
8689 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8690 *libc.$so.[0-9]*) dflt=$majonly ;;
8691 *) dflt=libperl.$so ;;
8701 I need to select a good name for the shared libperl. If your system uses
8702 library names with major and minor numbers, then you might want something
8703 like $majmin. Alternatively, if your system uses a single version
8704 number for shared libraries, then you might want to use $majonly.
8705 Or, your system might be quite happy with a simple libperl.$so.
8707 Since the shared libperl will get installed into a version-specific
8708 architecture-dependent directory, the version number of the shared perl
8709 library probably isn't important, so the default should be o.k.
8712 rp='What name do you want to give to the shared libperl?'
8715 echo "Ok, I'll use $libperl"
8718 libperl="libperl${_a}"
8722 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8726 WARNING: Use of the shrpdir variable for the installation location of
8727 the shared $libperl is not supported. It was never documented and
8728 will not work in this version. Let me (perlbug@perl.org)
8729 know of any problems this may cause.
8735 But your current setting of $shrpdir is
8736 the default anyway, so it's harmless.
8741 Further, your current attempted setting of $shrpdir
8742 conflicts with the value of $archlibexp/CORE
8743 that installperl will use.
8750 # How will the perl executable find the installed shared $libperl?
8751 # Add $xxx to ccdlflags.
8752 # If we can't figure out a command-line option, use $shrpenv to
8753 # set env LD_RUN_PATH. The main perl makefile uses this.
8754 shrpdir=$archlibexp/CORE
8757 if "$useshrplib"; then
8760 # We'll set it in Makefile.SH...
8765 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8766 xxx="-Wl,-R$shrpdir"
8768 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8769 xxx="-Wl,-rpath,$shrpdir"
8772 # hpux doesn't like the default, either.
8773 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8776 # cygwin needs only ldlibpth
8779 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8785 # Only add $xxx if it isn't already in ccdlflags.
8786 case " $ccdlflags " in
8788 *) ccdlflags="$ccdlflags $xxx"
8791 Adding $xxx to the flags
8792 passed to $ld so that the perl executable will find the
8793 installed shared $libperl.
8801 # Fix ccdlflags in AIX for building external extensions.
8802 # (For building Perl itself bare -bE:perl.exp is needed,
8803 # Makefile.SH takes care of this.)
8805 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8807 # Respect a hint or command-line value.
8809 '') shrpenv="$tmp_shrpenv" ;;
8811 case "$ldlibpthname" in
8812 '') ldlibpthname=LD_LIBRARY_PATH ;;
8813 none) ldlibpthname='' ;;
8816 : determine where manual pages are on this system
8820 syspath='/usr/share/man/man1 /usr/man/man1'
8821 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8822 syspath="$syspath /usr/man/u_man/man1"
8823 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8824 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8825 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8826 sysman=`./loc . /usr/man/man1 $syspath`
8829 if $test -d "$sysman"; then
8830 echo "System manual is in $sysman." >&4
8832 echo "Could not find manual pages in source form." >&4
8835 : determine where manual pages go
8836 set man1dir man1dir none
8840 $spackage has manual pages available in source form.
8844 echo "However, you don't have nroff, so they're probably useless to you."
8846 '') man1dir="none";;
8849 echo "If you don't want the manual sources installed, answer 'none'."
8854 lookpath="$prefixexp/share/man/man1"
8855 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8856 lookpath="$lookpath $prefixexp/man/p_man/man1"
8857 lookpath="$lookpath $prefixexp/man/u_man/man1"
8858 lookpath="$lookpath $prefixexp/man/man.1"
8860 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8861 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8871 rp="Where do the main $spackage manual pages (source) go?"
8873 if $test "X$man1direxp" != "X$ansexp"; then
8884 : What suffix to use on installed man pages
8891 rp="What suffix should be used for the main $spackage man pages?"
8893 '') case "$man1dir" in
8907 *) dflt="$man1ext";;
8914 : see if we can have long filenames
8916 first=123456789abcdef
8918 if (echo hi >$first) 2>/dev/null; then
8919 if $test -f 123456789abcde; then
8920 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8923 echo 'You can have filenames longer than 14 characters.'>&4
8928 You can't have filenames longer than 14 chars.
8929 You can't even think about them!
8935 $rm -rf 123456789abcde*
8937 : determine where library module manual pages go
8938 set man3dir man3dir none
8942 $spackage has manual pages for many of the library modules.
8948 However, you don't have nroff, so they're probably useless to you.
8951 '') man3dir="none";;
8955 case "$d_flexfnam" in
8958 However, your system can't handle the long file names like File::Basename.3.
8961 '') man3dir="none";;
8965 echo "If you don't want the manual sources installed, answer 'none'."
8966 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8968 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8969 if $test -d "$privlib/man/man3"; then
8972 WARNING: Previous versions of perl installed man3 pages into
8973 $privlib/man/man3. This version will suggest a
8974 new default of $dflt.
8978 rp='Do you wish to preserve the old behavior?(y/n)'
8981 y*) dflt="$privlib/man/man3" ;;
8986 *) dflt="$man3dir" ;;
8993 rp="Where do the $package library man pages (source) go?"
9003 : What suffix to use on installed man pages
9009 rp="What suffix should be used for the $package library man pages?"
9011 '') case "$man3dir" in
9025 *) dflt="$man3ext";;
9032 : see if we have to deal with yellow pages, now NIS.
9033 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9039 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9047 rp='Are you getting the hosts file via yellow pages?'
9050 y*) hostcat='ypcat hosts';;
9051 *) hostcat='cat /etc/hosts';;
9057 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9060 '') test -f /etc/group && groupcat='cat /etc/group';;
9063 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9066 : now get the host name
9068 echo "Figuring out host name..." >&4
9069 case "$myhostname" in
9071 echo 'Maybe "hostname" will work...'
9072 if tans=`sh -c hostname 2>&1` ; then
9080 if $test "$cont"; then
9082 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9083 if tans=`cat /etc/systemid 2>&1` ; then
9085 phostname='cat /etc/systemid'
9086 echo "Whadyaknow. Xenix always was a bit strange..."
9089 elif $test -r /etc/systemid; then
9090 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9093 if $test "$cont"; then
9094 echo 'No, maybe "uuname -l" will work...'
9095 if tans=`sh -c 'uuname -l' 2>&1` ; then
9097 phostname='uuname -l'
9099 echo 'Strange. Maybe "uname -n" will work...'
9100 if tans=`sh -c 'uname -n' 2>&1` ; then
9102 phostname='uname -n'
9104 echo 'Oh well, maybe I can mine it out of whoami.h...'
9105 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9106 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9107 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9109 case "$myhostname" in
9110 '') echo "Does this machine have an identity crisis or something?"
9113 echo "Well, you said $myhostname before..."
9114 phostname='echo $myhostname';;
9120 case "$myhostname" in
9121 '') myhostname=noname ;;
9123 : you do not want to know about this
9128 if $test "$myhostname" ; then
9130 rp='Your host name appears to be "'$myhostname'".'" Right?"
9138 : bad guess or no guess
9139 while $test "X$myhostname" = X ; do
9141 rp="Please type the (one word) name of your host:"
9146 : translate upper to lower if necessary
9147 case "$myhostname" in
9149 echo "(Normalizing case in your host name)"
9150 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9154 case "$myhostname" in
9156 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9157 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9158 echo "(Trimming domain name from host name--host name is now $myhostname)"
9160 *) case "$mydomain" in
9163 test "X$hostcat" = "Xypcat hosts" &&
9164 ypmatch "$myhostname" hosts 2>/dev/null |\
9165 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9168 test "X$hostcat" != "X" &&
9169 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9170 /[ ]$myhostname[ . ]/p" > hosts
9173 if $test -f hosts; then
9174 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9175 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9176 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9177 hosts | $sort | $uniq | \
9178 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9179 case `$echo X$dflt` in
9180 X*\ *) echo "(Several hosts in the database matched hostname)"
9183 X.) echo "(You do not have fully-qualified names in the hosts database)"
9187 echo "(I cannot locate a hosts database anywhere)"
9192 tans=`./loc resolv.conf X /etc /usr/etc`
9193 if $test -f "$tans"; then
9194 echo "(Attempting domain name extraction from $tans)"
9195 dflt=.`$sed -n -e 's/ / /g' \
9196 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9199 .) dflt=.`$sed -n -e 's/ / /g' \
9200 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9208 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9209 dflt=.`sh -c domainname 2>/dev/null`
9212 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9216 case "$dflt$osname" in
9217 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9218 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9222 .) echo "(Lost all hope -- silly guess then)"
9228 *) dflt="$mydomain";;
9232 rp="What is your domain name?"
9242 : translate upper to lower if necessary
9245 echo "(Normalizing case in your domain name)"
9246 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9250 : a little sanity check here
9251 case "$phostname" in
9254 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9255 $myhostname$mydomain|$myhostname) ;;
9257 case "$phostname" in
9259 echo "(That doesn't agree with your whoami.h file, by the way.)"
9262 echo "(That doesn't agree with your $phostname command, by the way.)"
9270 : determine the e-mail address of the user who is running us
9273 I need to get your e-mail address in Internet format if possible, i.e.
9274 something like user@host.domain. Please answer accurately since I have
9275 no easy means to double check it. The default value provided below
9276 is most probably close to reality but may not be valid from outside
9277 your organization...
9281 while test "$cont"; do
9282 case "$MAILDOMAIN" in
9284 if $test -s /etc/mailname; then
9285 maildomain=`$cat /etc/mailname`
9287 maildomain="$myhostname$mydomain"
9290 *) maildomain="$MAILDOMAIN";;
9293 '') dflt="$cf_by@$maildomain";;
9294 *) dflt="$cf_email";;
9296 rp='What is your e-mail address?'
9302 rp='Address does not look like an Internet one. Use it anyway?'
9316 : Ask e-mail of administrator
9319 If you or somebody else will be maintaining perl at your site, please
9320 fill in the correct e-mail address here so that they may be contacted
9321 if necessary. Currently, the "perlbug" program included with perl
9322 will send mail to this address in addition to perlbug@perl.org. You may
9323 enter "none" for no administrator.
9326 case "$perladmin" in
9327 '') dflt="$cf_email";;
9328 *) dflt="$perladmin";;
9330 rp='Perl administrator e-mail address'
9334 : determine whether to only install version-specific parts.
9337 Do you want to install only the version-specific parts of the perl
9338 distribution? Usually you do *not* want to do this.
9340 case "$versiononly" in
9341 "$define"|[Yy]*|true) dflt='y' ;;
9344 rp="Do you want to install only the version-specific parts of perl?"
9347 [yY]*) val="$define";;
9353 case "$versiononly" in
9354 "$define") inc_version_list=''
9355 inc_version_list_init=0
9359 : figure out how to guarantee perl startup
9360 : XXX Note that this currently takes advantage of the bug that binexp ignores
9361 : the Configure -Dinstallprefix setting, which in turn means that under
9362 : relocatable @INC, initialinstalllocation is what binexp started as.
9363 case "$startperl" in
9365 case "$sharpbang" in
9369 I can use the #! construct to start perl on your system. This will
9370 make startup of perl scripts faster, but may cause problems if you
9371 want to share those scripts and perl is not in a standard place
9372 ($initialinstalllocation/perl) on all your platforms. The alternative
9373 is to force a shell by starting the script with a single ':' character.
9376 case "$versiononly" in
9377 "$define") dflt="$initialinstalllocation/perl$version";;
9378 *) dflt="$initialinstalllocation/perl";;
9380 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9383 none) startperl=": # use perl";;
9384 *) startperl="#!$ans"
9385 if $test 30 -lt `echo "$ans" | wc -c`; then
9388 WARNING: Some systems limit the #! command to 32 characters.
9389 If you experience difficulty running Perl scripts with #!, try
9390 installing Perl in a directory with a shorter pathname.
9396 *) startperl=": # use perl"
9401 echo "I'll use $startperl to start perl scripts."
9403 : figure best path for perl in scripts
9406 case "$versiononly" in
9407 "$define") perlpath="$initialinstalllocation/perl$version";;
9408 *) perlpath="$initialinstalllocation/perl";;
9410 case "$startperl" in
9415 I will use the "eval 'exec'" idiom to start Perl on your system.
9416 I can use the full path of your Perl binary for this purpose, but
9417 doing so may cause problems if you want to share those scripts and
9418 Perl is not always in a standard place ($initialinstalllocation/perl).
9421 dflt="$initialinstalllocation/perl"
9422 rp="What path shall I use in \"eval 'exec'\"?"
9429 case "$startperl" in
9431 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9434 : determine where public executable scripts go
9435 set scriptdir scriptdir
9437 case "$scriptdir" in
9440 : guess some guesses
9441 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9442 $test -d /usr/share/bin && dflt=/usr/share/bin
9443 $test -d /usr/local/script && dflt=/usr/local/script
9444 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9445 $test -d $prefixexp/script && dflt=$prefixexp/script
9449 *) dflt="$scriptdir"
9454 Some installations have a separate directory just for executable scripts so
9455 that they can mount it across multiple architectures but keep the scripts in
9456 one spot. You might, for example, have a subdirectory of /usr/share for this.
9457 Or you might just lump your scripts in with all your other executables.
9461 rp='Where do you keep publicly executable scripts?'
9463 if $test "X$ansexp" != "X$scriptdirexp"; then
9469 : A little fix up for an irregularly named variable.
9470 installscript="$installscriptdir"
9472 : determine where add-on public executables go
9474 '') dflt=$siteprefix/bin ;;
9478 rp='Pathname where the add-on public executables should be installed?'
9483 : determine where add-on html pages go
9484 : There is no standard location, so try to copy the previously-selected
9485 : directory structure for the core html pages.
9486 case "$sitehtml1dir" in
9487 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9488 *) dflt=$sitehtml1dir ;;
9491 ''|' ') dflt=none ;;
9494 rp='Pathname where the site-specific html pages should be installed?'
9496 prefixvar=sitehtml1dir
9499 : determine where add-on library html pages go
9500 : There is no standard location, so try to copy the previously-selected
9501 : directory structure for the core html pages.
9502 case "$sitehtml3dir" in
9503 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9504 *) dflt=$sitehtml3dir ;;
9507 ''|' ') dflt=none ;;
9510 rp='Pathname where the site-specific library html pages should be installed?'
9512 prefixvar=sitehtml3dir
9515 : determine where add-on manual pages go
9516 case "$siteman1dir" in
9517 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9518 *) dflt=$siteman1dir ;;
9521 ''|' ') dflt=none ;;
9524 rp='Pathname where the site-specific manual pages should be installed?'
9526 prefixvar=siteman1dir
9529 : determine where add-on library man pages go
9530 case "$siteman3dir" in
9531 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9532 *) dflt=$siteman3dir ;;
9535 ''|' ') dflt=none ;;
9538 rp='Pathname where the site-specific library manual pages should be installed?'
9540 prefixvar=siteman3dir
9543 : determine where add-on public executable scripts go
9544 case "$sitescript" in
9545 '') dflt=$siteprefix/script
9546 $test -d $dflt || dflt=$sitebin ;;
9547 *) dflt="$sitescript" ;;
9550 rp='Pathname where add-on public executable scripts should be installed?'
9552 prefixvar=sitescript
9555 : see if backtrace exists
9556 set backtrace d_backtrace
9559 : add flags if using c backtrace
9560 case "$usecbacktrace" in
9561 "") usecbacktrace=$undef ;;
9563 case "$d_backtrace" in
9565 case " $ccflags " in
9566 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9567 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9571 echo "This system does not support backtrace" >&4
9572 usecbacktrace=$undef
9578 : Check if faststdio is requested and available
9579 case "$usefaststdio" in
9580 $define|true|[yY]*|'')
9581 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9591 Perl can be built to use 'fast stdio', which means using the stdio
9592 library but also directly manipulating the stdio buffers to enable
9593 faster I/O. Using stdio is better for backward compatibility (especially
9594 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9595 interface has been preferred instead of stdio.
9597 If this doesn't make any sense to you, just accept the default '$dflt'.
9599 rp='Use the "fast stdio" if available?'
9602 y|Y) val="$define" ;;
9609 : define an is-a-typedef? function
9610 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9612 "") inclist="sys/types.h";;
9614 eval "varval=\$$var";
9618 for inc in $inclist; do
9619 echo "#include <$inc>" >>temp.c;
9621 echo "#ifdef $type" >> temp.c;
9622 echo "printf(\"We have $type\");" >> temp.c;
9623 echo "#endif" >> temp.c;
9624 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9625 if $contains $type temp.E >/dev/null 2>&1; then
9631 *) eval "$var=\$varval";;
9634 : define an is-a-typedef? function that prompts if the type is not available.
9635 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9637 "") inclist="sys/types.h";;
9639 eval "varval=\$$var";
9643 for inc in $inclist; do
9644 echo "#include <$inc>" >>temp.c;
9646 echo "#ifdef $type" >> temp.c;
9647 echo "printf(\"We have $type\");" >> temp.c;
9648 echo "#endif" >> temp.c;
9649 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9651 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9652 if $contains $type temp.E >/dev/null 2>&1; then
9653 echo "$type found." >&4;
9656 echo "$type NOT found." >&4;
9662 *) eval "$var=\$varval";;
9665 : see what type lseek is declared as in the kernel
9666 rp="What is the type used for lseek's offset on this system?"
9667 set off_t lseektype long stdio.h sys/types.h
9671 echo "Checking to see how big your file offsets are..." >&4
9673 #include <sys/types.h>
9677 printf("%d\n", (int)sizeof($lseektype));
9682 if eval $compile_ok; then
9683 lseeksize=`$run ./try`
9684 echo "Your file offsets are $lseeksize bytes long."
9688 echo "(I can't seem to compile the test program. Guessing...)"
9689 rp="What is the size of your file offsets (in bytes)?"
9695 : see what type file positions are declared as in the library
9696 rp="What is the type for file position used by fsetpos()?"
9697 set fpos_t fpostype long stdio.h sys/types.h
9700 : Check size for Fpos_t
9703 *_t) zzz="$fpostype" ;;
9706 echo "Checking the size of $zzz..." >&4
9708 #include <sys/types.h>
9715 printf("%d\n", (int)sizeof($fpostype));
9720 if eval $compile_ok; then
9724 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9727 echo "Your $zzz is $fpossize bytes long."
9733 echo "(I can't compile the test program. Guessing...)" >&4
9734 rp="What is the size of your file positions (in bytes)?"
9739 : Check for large file support
9740 # Backward compatibility (uselfs is deprecated).
9742 "$define"|true|[yY]*)
9745 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9747 uselargefiles="$define"
9751 case "$lseeksize:$fpossize" in
9754 You can have files larger than 2 gigabytes.
9757 *) case "$uselargefiles" in
9758 "$undef"|false|[nN]*) dflt='n' ;;
9763 Perl can be built to understand large files (files larger than 2 gigabytes)
9764 on some systems. To do so, Configure can be run with -Duselargefiles.
9766 If this doesn't make any sense to you, just accept the default '$dflt'.
9768 rp='Try to understand large files, if available?'
9771 y|Y) val="$define" ;;
9778 : Look for a hint-file generated 'call-back-unit'. If the
9779 : user has specified that a large files perl is to be built,
9780 : we may need to set or change some other defaults.
9781 if $test -f uselargefiles.cbu; then
9782 echo "Your platform has some specific hints regarding large file builds, using them..."
9783 . ./uselargefiles.cbu
9785 case "$uselargefiles" in
9787 if $test -f uselargefiles.cbu; then
9789 echo "Rechecking to see how big your file offsets are..." >&4
9791 #include <sys/types.h>
9795 printf("%d\n", (int)sizeof($lseektype));
9800 if eval $compile_ok; then
9801 lseeksize=`$run ./try`
9802 $echo "Your file offsets are now $lseeksize bytes long."
9806 echo "(I can't seem to compile the test program. Guessing...)"
9807 rp="What is the size of your file offsets (in bytes)?"
9812 *_t) zzz="$fpostype" ;;
9815 $echo $n "Rechecking the size of $zzz...$c" >&4
9817 #include <sys/types.h>
9824 printf("%d\n", (int)sizeof($fpostype));
9829 if eval $compile_ok; then
9834 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9837 echo " $fpossize bytes." >&4
9843 echo "(I can't compile the test program. Guessing...)" >&4
9844 rp="What is the size of your file positions (in bytes)?"
9853 : Check if we want perlio
9856 : Set the vendorbin variables
9857 case "$vendorprefix" in
9858 '') d_vendorbin="$undef"
9862 *) d_vendorbin="$define"
9863 : determine where vendor-supplied executables go.
9864 case "$vendorbin" in
9865 '') dflt=$vendorprefix/bin ;;
9866 *) dflt="$vendorbin" ;;
9869 rp='Pathname for the vendor-supplied executables directory?'
9872 vendorbinexp="$ansexp"
9878 : Set the vendorhtml1dir variables
9879 case "$vendorprefix" in
9880 '') vendorhtml1dir=''
9881 vendorhtml1direxp=''
9883 *) : determine where vendor-supplied html pages go.
9884 : There is no standard location, so try to copy the previously-selected
9885 : directory structure for the core html pages.
9886 : XXX Better default suggestions would be welcome.
9887 case "$vendorhtml1dir" in
9888 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9889 *) dflt=$vendorhtml1dir ;;
9892 ''|' ') dflt=none ;;
9895 rp='Pathname for the vendor-supplied html pages?'
9897 vendorhtml1dir="$ans"
9898 vendorhtml1direxp="$ansexp"
9901 : Use ' ' for none so value is preserved next time through Configure
9902 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9903 prefixvar=vendorhtml1dir
9906 : Set the vendorhtml3dir variables
9907 case "$vendorprefix" in
9908 '') vendorhtml3dir=''
9909 vendorhtml3direxp=''
9911 *) : determine where vendor-supplied module html pages go.
9912 : There is no standard location, so try to copy the previously-selected
9913 : directory structure for the core html pages.
9914 : XXX Better default suggestions would be welcome.
9915 case "$vendorhtml3dir" in
9916 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9917 *) dflt=$vendorhtml3dir ;;
9920 ''|' ') dflt=none ;;
9923 rp='Pathname for the vendor-supplied html pages?'
9925 vendorhtml3dir="$ans"
9926 vendorhtml3direxp="$ansexp"
9929 : Use ' ' for none so value is preserved next time through Configure
9930 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9931 prefixvar=vendorhtml3dir
9934 : Set the vendorman1dir variables
9935 case "$vendorprefix" in
9936 '') vendorman1dir=''
9939 *) : determine where vendor-supplied manual pages go.
9940 case "$vendorman1dir" in
9941 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9942 *) dflt=$vendorman1dir ;;
9945 ''|' ') dflt=none ;;
9948 rp='Pathname for the vendor-supplied manual section 1 pages?'
9950 vendorman1dir="$ans"
9951 vendorman1direxp="$ansexp"
9954 : Use ' ' for none so value is preserved next time through Configure
9955 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9956 prefixvar=vendorman1dir
9959 : Set the vendorman3dir variables
9960 case "$vendorprefix" in
9961 '') vendorman3dir=''
9964 *) : determine where vendor-supplied module manual pages go.
9965 case "$vendorman3dir" in
9966 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9967 *) dflt=$vendorman3dir ;;
9970 ''|' ') dflt=none ;;
9973 rp='Pathname for the vendor-supplied manual section 3 pages?'
9975 vendorman3dir="$ans"
9976 vendorman3direxp="$ansexp"
9979 : Use ' ' for none so value is preserved next time through Configure
9980 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9981 prefixvar=vendorman3dir
9984 : Set the vendorscript variables
9985 case "$vendorprefix" in
9986 '') d_vendorscript="$undef"
9990 *) d_vendorscript="$define"
9991 : determine where vendor-supplied scripts go.
9992 case "$vendorscript" in
9993 '') dflt=$vendorprefix/script
9994 $test -d $dflt || dflt=$vendorbin ;;
9995 *) dflt="$vendorscript" ;;
9999 The installation process will create a directory for
10000 vendor-supplied scripts.
10004 rp='Pathname for the vendor-supplied scripts directory?'
10006 vendorscript="$ans"
10007 vendorscriptexp="$ansexp"
10010 prefixvar=vendorscript
10013 : script used to emit important warnings
10016 if test \$# -gt 0; then
10021 echo "*** WARNING:" >&4
10022 sed -e 's/^/*** /' <msg >&4
10024 cat msg >>config.msg
10025 echo " " >>config.msg
10031 : see which of string.h or strings.h is needed
10033 strings=`./findhdr string.h`
10034 if $test "$strings" && $test -r "$strings"; then
10035 echo "Using <string.h> instead of <strings.h>." >&4
10039 strings=`./findhdr strings.h`
10040 if $test "$strings" && $test -r "$strings"; then
10041 echo "Using <strings.h> instead of <string.h>." >&4
10043 ./warn "No string header found -- You'll surely have problems."
10048 case "$i_string" in
10049 "$undef") strings=`./findhdr strings.h`;;
10050 *) strings=`./findhdr string.h`;;
10053 : see if qgcvt exists
10057 : Check what kind of doubles your system has
10058 $echo "Checking the kind of doubles you have..." >&4
10060 #$i_stdlib I_STDLIB
10061 #define DOUBLESIZE $doublesize
10063 #include <stdlib.h>
10066 static const double d = -0.1;
10068 unsigned const char* b = (unsigned const char*)(&d);
10069 #if DOUBLESIZE == 4
10070 if (b[0] == 0xCD && b[3] == 0xBD) {
10071 /* IEEE 754 32-bit little-endian */
10075 if (b[0] == 0xBD && b[3] == 0xCD) {
10076 /* IEEE 754 32-bit big-endian */
10081 #if DOUBLESIZE == 8
10082 if (b[0] == 0x9A && b[7] == 0xBF) {
10083 /* IEEE 754 64-bit little-endian */
10087 if (b[0] == 0xBF && b[7] == 0x9A) {
10088 /* IEEE 754 64-bit big-endian */
10092 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10093 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10094 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10095 * 99 99 b9 bf 9a 99 99 99 */
10099 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10100 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10101 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10102 * 99 99 99 9a bf b9 99 99 */
10107 #if DOUBLESIZE == 16
10108 if (b[0] == 0x9A && b[15] == 0xBF) {
10109 /* IEEE 754 128-bit little-endian */
10113 if (b[0] == 0xBF && b[15] == 0x9A) {
10114 /* IEEE 754 128-bit big-endian */
10119 /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY.
10120 * Whether those environments can still build Perl is debatable. */
10121 printf("-1\n"); /* unknown */
10126 if eval $compile; then
10127 doublekind=`$run ./try`
10131 case "$doublekind" in
10132 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10133 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10134 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10135 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10136 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10137 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10138 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10139 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10140 *) echo "Cannot figure out your double. You VAX, or something?" >&4 ;;
10144 : Check print/scan long double stuff
10147 if $test X"$d_longdbl" = X"$define"; then
10149 echo "Checking how to print long doubles..." >&4
10151 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10152 $cat >try.c <<'EOCP'
10153 #include <sys/types.h>
10156 double d = 123.456;
10157 printf("%.3f\n", d);
10161 if eval $compile; then
10165 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10166 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10167 echo "We will use %f."
10173 if $test X"$sPRIfldbl" = X; then
10174 $cat >try.c <<'EOCP'
10175 #include <sys/types.h>
10178 long double d = 123.456;
10179 printf("%.3Lf\n", d);
10183 if eval $compile; then
10187 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10188 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10189 echo "We will use %Lf."
10195 if $test X"$sPRIfldbl" = X; then
10196 $cat >try.c <<'EOCP'
10197 #include <sys/types.h>
10200 long double d = 123.456;
10201 printf("%.3llf\n", d);
10205 if eval $compile; then
10209 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10210 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10211 echo "We will use %llf."
10217 if $test X"$sPRIfldbl" = X; then
10218 $cat >try.c <<'EOCP'
10219 #include <sys/types.h>
10222 long double d = 123.456;
10223 printf("%.3lf\n", d);
10227 if eval $compile; then
10231 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10232 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10233 echo "We will use %lf."
10239 if $test X"$sPRIfldbl" = X; then
10240 echo "Cannot figure out how to print long doubles." >&4
10242 sSCNfldbl=$sPRIfldbl # expect consistency
10249 case "$sPRIfldbl" in
10250 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10251 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10252 d_SCNfldbl="$undef";
10254 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10255 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10256 d_SCNfldbl="$define";
10260 : Before committing on uselongdouble, see whether that looks sane.
10261 if $test "$uselongdouble" = "$define"; then
10264 echo "Checking if your long double math functions work right..." >&4
10269 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10272 case "$osname:$gccversion" in
10273 aix:) saveccflags="$ccflags"
10274 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10277 if eval $compile_ok; then
10281 3) echo "Your long double math functions are working correctly." >&4 ;;
10282 *) echo "Your long double math functions are broken, not using long doubles." >&4
10283 uselongdouble=$undef
10287 case "$osname:$gccversion" in
10288 aix:) ccflags="$saveccflags" ;; # restore
10292 : Check how to convert floats to strings.
10294 if test "X$d_Gconvert" = X; then
10297 echo "Checking for an efficient way to convert floats to strings."
10299 case "$uselongdouble" in
10300 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10302 case "$d_longdbl" in
10303 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10305 case "$d_PRIgldbl" in
10306 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10309 #ifdef TRY_gconvert
10310 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10311 char *myname = "gconvert";
10314 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10315 char *myname = "gcvt";
10318 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10319 char *myname = "qgcvt";
10320 #define DOUBLETYPE long double
10323 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10324 #ifdef HAS_PRIgldbl
10325 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10327 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10330 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10332 char *myname = "sprintf";
10336 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10337 #define DOUBLETYPE long double
10339 #define DOUBLETYPE double
10345 #$i_stdlib I_STDLIB
10347 #include <stdlib.h>
10349 #$i_string I_STRING
10351 # include <string.h>
10353 # include <strings.h>
10356 int checkit(char *expect, char *got)
10358 if (strcmp(expect, got)) {
10359 printf("%s oddity: Expected %s, got %s\n",
10360 myname, expect, got);
10370 /* This must be 1st test on (which?) platform */
10371 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10372 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10373 checkit("0.1", buf);
10375 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10376 checkit("0.01", buf);
10378 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10379 checkit("0.001", buf);
10381 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10382 checkit("0.0001", buf);
10384 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10385 if (strlen(buf) > 5)
10386 checkit("9e-005", buf); /* for Microsoft ?? */
10388 checkit("9e-05", buf);
10390 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10393 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10394 checkit("1.1", buf);
10396 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10397 checkit("1.01", buf);
10399 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10400 checkit("1.001", buf);
10402 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10403 checkit("1.0001", buf);
10405 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10406 checkit("1.00001", buf);
10408 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10409 checkit("1.000001", buf);
10411 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10414 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10415 checkit("-1", buf);
10417 /* Some Linux gcvt's give 1.e+5 here. */
10418 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10419 checkit("100000", buf);
10421 /* Some Linux gcvt's give -1.e+5 here. */
10422 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10423 checkit("-100000", buf);
10425 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10426 checkit("123.456", buf);
10428 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10429 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10430 /* 34 should be enough to scare even long double
10431 * places into using the e notation. */
10432 if (strlen(buf) > 5)
10433 checkit("1e+034", buf); /* for Microsoft */
10435 checkit("1e+34", buf);
10437 /* For Perl, if you add additional tests here, also add them to
10438 * t/base/num.t for benefit of platforms not using Configure or
10439 * overriding d_Gconvert */
10444 : first add preferred functions to our list
10446 for xxx_convert in $gconvert_preference; do
10447 case $xxx_convert in
10448 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10449 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10452 : then add any others
10453 for xxx_convert in gconvert gcvt sprintf; do
10454 case "$xxx_list" in
10456 *) xxx_list="$xxx_list $xxx_convert" ;;
10460 case "$d_longdbl$uselongdouble" in
10462 : again, add preferred functions to our list first
10464 for xxx_convert in $gconvert_ld_preference; do
10465 case $xxx_convert in
10466 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10467 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10470 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10471 for xxx_convert in qgcvt sprintf $xxx_list; do
10472 case "$xxx_ld_list" in
10473 $xxx_convert*|*" $xxx_convert"*) ;;
10474 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10477 : if sprintf cannot do long doubles, move it to the end
10478 if test "$d_PRIgldbl" != "$define"; then
10479 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10481 : if no qgcvt, remove it
10482 if test "$d_qgcvt" != "$define"; then
10483 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10486 xxx_list="$xxx_ld_list"
10490 for xxx_convert in $xxx_list; do
10491 echo "Trying $xxx_convert..."
10492 $rm -f try try$_o core
10493 set try -DTRY_$xxx_convert
10494 if eval $compile; then
10495 echo "$xxx_convert() found." >&4
10496 if $run ./try; then
10497 echo "I'll use $xxx_convert to convert floats into a string." >&4
10500 echo "...But $xxx_convert didn't work as I expected."
10504 echo "$xxx_convert NOT found." >&4
10508 if test X$xxx_convert = X; then
10509 echo "*** WHOA THERE!!! ***" >&4
10510 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10511 xxx_convert=sprintf
10514 case "$xxx_convert" in
10515 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10516 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10517 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10518 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10519 "$define$define$define")
10520 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10521 "$define$define$undef")
10522 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10523 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10531 : see if _fwalk exists
10535 : Initialize h_fcntl
10538 : Initialize h_sysfile
10541 : access call always available on UNIX
10542 set access d_access
10545 : locate the flags for 'access()'
10546 case "$d_access" in
10549 $cat >access.c <<EOCP
10550 #include <sys/types.h>
10555 #include <sys/file.h>
10558 #include <unistd.h>
10560 #$i_stdlib I_STDLIB
10562 #include <stdlib.h>
10568 : check sys/file.h first, no particular reason here
10569 if $test `./findhdr sys/file.h` && \
10570 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10572 echo "<sys/file.h> defines the *_OK access constants." >&4
10573 elif $test `./findhdr fcntl.h` && \
10574 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10576 echo "<fcntl.h> defines the *_OK access constants." >&4
10577 elif $test `./findhdr unistd.h` && \
10578 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10579 echo "<unistd.h> defines the *_OK access constants." >&4
10581 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10587 : see if accessx exists
10588 set accessx d_accessx
10591 : see if acosh exists
10595 : see if aintl exists
10599 : see if alarm exists
10603 : see if 64bit time functions exists
10605 set ctime64 d_ctime64
10608 set localtime64 d_localtime64
10611 set gmtime64 d_gmtime64
10614 set mktime64 d_mktime64
10617 set difftime64 d_difftime64
10620 set asctime64 d_asctime64
10623 : see if POSIX threads are available
10624 set pthread.h i_pthread
10627 : define a function to check prototypes
10628 $cat > protochk <<EOSH
10631 optimize="$optimize"
10633 prototype="$prototype"
10636 usethreads=$usethreads
10637 i_pthread=$i_pthread
10638 pthread_h_first=$pthread_h_first
10641 $cat >> protochk <<'EOSH'
10646 while test $# -ge 2; do
10648 $define) echo "#include <$2>" >> try.c ;;
10649 literal) echo "$2" >> try.c ;;
10651 # Extra magic for the benefit of systems that need pthread.h
10652 # to be included early to correctly detect threadsafe functions.
10653 # Such functions must guarantee themselves, though, that the usethreads
10654 # and i_pthread have been defined, before calling protochk.
10655 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10656 echo "#include <pthread.h>" >> try.c
10661 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10662 cat >> try.c <<'EOCP'
10663 #ifdef CAN_PROTOTYPE
10664 #define _(args) args
10669 echo "$foo" >> try.c
10670 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10671 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10677 $eunicefix protochk
10679 : Define hasproto macro for Configure internal use
10680 hasproto='varname=$1; func=$2; shift; shift;
10681 while $test $# -ge 2; do
10683 $define) echo "#include <$2>";;
10687 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10688 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10689 echo "$func() prototype found.";
10692 echo "$func() prototype NOT found.";
10699 : see if sys/types.h has to be included
10700 set sys/types.h i_systypes
10703 : see if sys/select.h has to be included
10704 set sys/select.h i_sysselct
10707 : Define hasfield macro for Configure internal use
10708 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10709 while $test $# -ge 2; do
10711 $define) echo "#include <$2>";;
10715 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10717 if eval $compile; then
10726 : see if we should include time.h, sys/time.h, or both
10728 if test "X$timeincl" = X; then
10729 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10730 $echo $n "I'm now running the test program...$c"
10732 #include <sys/types.h>
10737 #ifdef SYSTIMEKERNEL
10740 #include <sys/time.h>
10743 #include <sys/select.h>
10745 #$i_stdlib I_STDLIB
10747 #include <stdlib.h>
10753 struct timeval bar;
10756 struct timezone tzp;
10758 if (foo.tm_sec == foo.tm_sec)
10761 if (bar.tv_sec == bar.tv_sec)
10768 for s_timezone in '-DS_TIMEZONE' ''; do
10770 for s_timeval in '-DS_TIMEVAL' ''; do
10771 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10772 for i_time in '' '-DI_TIME'; do
10773 for i_systime in '-DI_SYSTIME' ''; do
10776 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10777 if eval $compile; then
10778 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10782 $echo $n "Succeeded with $flags$c"
10794 *SYSTIMEKERNEL*) i_systimek="$define"
10795 timeincl=`./findhdr sys/time.h`
10796 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10797 *) i_systimek="$undef";;
10800 *I_TIME*) i_time="$define"
10801 timeincl=`./findhdr time.h`" $timeincl"
10802 echo "We'll include <time.h>." >&4;;
10803 *) i_time="$undef";;
10806 *I_SYSTIME*) i_systime="$define"
10807 timeincl=`./findhdr sys/time.h`" $timeincl"
10808 echo "We'll include <sys/time.h>." >&4;;
10809 *) i_systime="$undef";;
10813 : see if struct tm knows about tm_zone
10814 case "$i_systime$i_time" in
10817 echo "Checking to see if your struct tm has tm_zone field..." >&4
10818 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10826 case "$d_tm_tm_zone" in
10827 "$define") echo "Yes, it does." ;;
10828 *) echo "No, it doesn't." ;;
10830 : see if struct tm knows about tm_gmtoff
10831 case "$i_systime$i_time" in
10834 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10835 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10843 case "$d_tm_tm_gmtoff" in
10844 "$define") echo "Yes, it does." ;;
10845 *) echo "No, it doesn't." ;;
10848 : see if asctime_r exists
10849 set asctime_r d_asctime_r
10851 case "$d_asctime_r" in
10853 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10854 case "$d_asctime_r_proto:$usethreads" in
10855 ":define") d_asctime_r_proto=define
10856 set d_asctime_r_proto asctime_r $hdrs
10860 case "$d_asctime_r_proto" in
10862 case "$asctime_r_proto" in
10863 ''|0) try='char* asctime_r(const struct tm*, char*);'
10864 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10866 case "$asctime_r_proto" in
10867 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10868 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10870 case "$asctime_r_proto" in
10871 ''|0) try='int asctime_r(const struct tm*, char*);'
10872 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10874 case "$asctime_r_proto" in
10875 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10876 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10878 case "$asctime_r_proto" in
10879 ''|0) d_asctime_r=undef
10881 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10882 * ) case "$asctime_r_proto" in
10883 REENTRANT_PROTO*) ;;
10884 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10886 echo "Prototype: $try" ;;
10889 *) case "$usethreads" in
10890 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10897 *) asctime_r_proto=0
10901 : see if asinh exists
10905 : see if atanh exists
10909 : see if atolf exists
10913 : see if atoll exists
10917 : Look for GCC-style attribute format
10918 case "$d_attribute_format" in
10921 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10922 $cat >attrib.c <<'EOCP'
10924 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10926 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10927 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10928 echo "Your C compiler doesn't support __attribute__((format))."
10931 echo "Your C compiler supports __attribute__((format))."
10935 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10939 *) val="$d_attribute_format" ;;
10941 set d_attribute_format
10945 : Look for GCC-style attribute format with null format allowed
10946 case "$d_printf_format_null" in
10947 '') case "$d_attribute_format" in
10950 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10951 $cat >attrib.c <<EOCP
10953 #$i_stdlib I_STDLIB
10955 #include <stdlib.h>
10957 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10958 int null_printf (char* pat,...) { return (int)pat; }
10959 int main () { exit(null_printf(NULL)); }
10961 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10962 : run the executable in case it produces a run-time warning
10963 if $run ./attrib >>attrib.out 2>&1; then
10964 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10965 echo "Your C compiler doesn't allow __printf__ format to be null."
10968 echo "Your C compiler allows __printf__ format to be null."
10972 echo "Your C compiler executable failed with __printf__ format null."
10976 echo "Your C compiler fails with __printf__ format null."
10983 *) val="$d_printf_format_null" ;;
10985 set d_printf_format_null
10989 : Look for GCC-style attribute malloc
10990 case "$d_attribute_malloc" in
10993 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10994 $cat >attrib.c <<'EOCP'
10996 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10998 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10999 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11000 echo "Your C compiler doesn't support __attribute__((malloc))."
11003 echo "Your C compiler supports __attribute__((malloc))."
11007 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11011 *) val="$d_attribute_malloc" ;;
11013 set d_attribute_malloc
11017 : Look for GCC-style attribute nonnull
11018 case "$d_attribute_nonnull" in
11021 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11022 $cat >attrib.c <<'EOCP'
11024 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11026 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11027 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11028 echo "Your C compiler doesn't support __attribute__((nonnull))."
11031 echo "Your C compiler supports __attribute__((nonnull))."
11035 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11039 *) val="$d_attribute_nonnull" ;;
11041 set d_attribute_nonnull
11045 : Look for GCC-style attribute noreturn
11046 case "$d_attribute_noreturn" in
11049 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11050 $cat >attrib.c <<'EOCP'
11052 void fall_over_dead( void ) __attribute__((noreturn));
11054 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11055 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11056 echo "Your C compiler doesn't support __attribute__((noreturn))."
11059 echo "Your C compiler supports __attribute__((noreturn))."
11063 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11067 *) val="$d_attribute_noreturn" ;;
11069 set d_attribute_noreturn
11073 : Look for GCC-style attribute pure
11074 case "$d_attribute_pure" in
11077 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11078 $cat >attrib.c <<'EOCP'
11080 int square( int n ) __attribute__((pure));
11082 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11083 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11084 echo "Your C compiler doesn't support __attribute__((pure))."
11087 echo "Your C compiler supports __attribute__((pure))."
11091 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11095 *) val="$d_attribute_pure" ;;
11097 set d_attribute_pure
11101 : Look for GCC-style attribute unused
11102 case "$d_attribute_unused" in
11105 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11106 $cat >attrib.c <<'EOCP'
11108 int do_something( int dummy __attribute__((unused)), int n );
11110 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11111 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11112 echo "Your C compiler doesn't support __attribute__((unused))."
11115 echo "Your C compiler supports __attribute__((unused))."
11119 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11123 *) val="$d_attribute_unused" ;;
11125 set d_attribute_unused
11129 : Look for GCC-style attribute deprecated
11130 case "$d_attribute_deprecated" in
11133 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11134 $cat >attrib.c <<'EOCP'
11136 int I_am_deprecated(void) __attribute__((deprecated));
11138 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11139 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11140 echo "Your C compiler doesn't support __attribute__((deprecated))."
11143 echo "Your C compiler supports __attribute__((deprecated))."
11147 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11151 *) val="$d_attribute_deprecated" ;;
11153 set d_attribute_deprecated
11157 : Look for GCC-style attribute warn_unused_result
11158 case "$d_attribute_warn_unused_result" in
11161 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11162 $cat >attrib.c <<'EOCP'
11164 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11166 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11167 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11168 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11171 echo "Your C compiler supports __attribute__((warn_unused_result))."
11175 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11179 *) val="$d_attribute_warn_unused_result" ;;
11181 set d_attribute_warn_unused_result
11185 : see if bcmp exists
11189 : see if bcopy exists
11193 : see if getpgrp exists
11194 set getpgrp d_getpgrp
11197 case "$d_getpgrp" in
11200 echo "Checking to see which flavor of getpgrp is in use..."
11202 #$i_unistd I_UNISTD
11203 #include <sys/types.h>
11205 # include <unistd.h>
11207 #$i_stdlib I_STDLIB
11209 #include <stdlib.h>
11213 if (getuid() == 0) {
11214 printf("(I see you are running Configure as super-user...)\n");
11217 #ifdef TRY_BSD_PGRP
11218 if (getpgrp(1) == 0)
11227 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11228 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11230 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11231 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11234 echo "I can't seem to compile and run the test program."
11236 xxx="a USG one, i.e. you use getpgrp()."
11238 # SVR4 systems can appear rather BSD-ish.
11239 case "$i_unistd" in
11241 xxx="a BSD one, i.e. you use getpgrp(pid)."
11245 xxx="probably a USG one, i.e. you use getpgrp()."
11250 echo "Assuming your getpgrp is $xxx" >&4
11259 : see if setpgrp exists
11260 set setpgrp d_setpgrp
11263 case "$d_setpgrp" in
11266 echo "Checking to see which flavor of setpgrp is in use..."
11268 #$i_unistd I_UNISTD
11269 #include <sys/types.h>
11271 # include <unistd.h>
11273 #$i_stdlib I_STDLIB
11275 #include <stdlib.h>
11279 if (getuid() == 0) {
11280 printf("(I see you are running Configure as super-user...)\n");
11283 #ifdef TRY_BSD_PGRP
11284 if (-1 == setpgrp(1, 1))
11287 if (setpgrp() != -1)
11293 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11294 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11296 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11297 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11300 echo "(I can't seem to compile and run the test program.)"
11302 xxx="a USG one, i.e. you use setpgrp()."
11304 # SVR4 systems can appear rather BSD-ish.
11305 case "$i_unistd" in
11307 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11311 xxx="probably a USG one, i.e. you use setpgrp()."
11316 echo "Assuming your setpgrp is $xxx" >&4
11325 : Look for GCC-style __builtin_choose_expr
11326 case "$d_builtin_choose_expr" in
11329 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11330 $cat >try.c <<'EOCP'
11331 #include <assert.h>
11332 #include <stdlib.h>
11335 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11338 assert( SYRINX(1) == 2112 );
11339 assert( SYRINX(1) != 5150 );
11340 assert( SYRINX(0) == 5150 );
11341 assert( SYRINX(0) != 2112 );
11342 puts( "All good!" );
11348 if eval $compile && $run ./try; then
11349 echo "Your C compiler supports __builtin_choose_expr."
11352 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11356 *) val="$d_builtin_choose_expr" ;;
11359 set d_builtin_choose_expr
11363 : Look for GCC-style __builtin_expect
11364 case "$d_builtin_expect" in
11367 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11368 $cat >try.c <<'EOCP'
11371 if ( __builtin_expect(n, 0) ) n = 1;
11372 /* Remember shell exit code truth is 0, C truth is non-zero */
11377 if eval $compile && $run ./try; then
11378 echo "Your C compiler supports __builtin_expect."
11381 echo "Your C compiler doesn't seem to understand __builtin_expect."
11385 *) val="$d_builtin_expect" ;;
11388 set d_builtin_expect
11392 : see if bzero exists
11396 : see if stdarg is available
11398 if $test `./findhdr stdarg.h`; then
11399 echo "<stdarg.h> found." >&4
11402 echo "<stdarg.h> NOT found." >&4
11406 : see if varargs is available
11408 if $test `./findhdr varargs.h`; then
11409 echo "<varargs.h> found." >&4
11411 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11414 : set up the varargs testing programs
11415 $cat > varargs.c <<EOP
11417 #include <stdarg.h>
11420 #include <varargs.h>
11424 int f(char *p, ...)
11438 p = va_arg(ap, char *);
11444 $cat > varargs <<EOP
11446 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11455 : now check which varargs header should be included
11461 if `./varargs I_STDARG`; then
11463 elif `./varargs I_VARARGS`; then
11468 if `./varargs I_VARARGS`; then
11476 echo "*** WHOA THERE!!! ***" >&4
11477 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11478 case "$knowitall" in
11480 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11484 echo "I could not find the definition for va_dcl... You have problems..." >&4
11485 val="$undef"; set i_stdarg; eval $setvar
11486 val="$undef"; set i_varargs; eval $setvar
11491 case "$i_varhdr" in
11493 val="$define"; set i_stdarg; eval $setvar
11494 val="$undef"; set i_varargs; eval $setvar
11497 val="$undef"; set i_stdarg; eval $setvar
11498 val="$define"; set i_varargs; eval $setvar
11501 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11505 : see if the Compiler supports C99 variadic macros
11506 case "$i_stdarg$i_stdlib" in
11508 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11511 #include <stdarg.h>
11513 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11517 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11523 if eval $compile && $run ./try 2>&1 >/dev/null; then
11524 case "`$run ./try`" in
11526 echo "You have C99 variadic macros." >&4
11527 d_c99_variadic_macros="$define"
11530 echo "You don't have functional C99 variadic macros." >&4
11531 d_c99_variadic_macros="$undef"
11535 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11536 d_c99_variadic_macros="$undef"
11541 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11542 d_c99_variadic_macros="$undef"
11546 : see if signal is declared as pointer to function returning int or void
11548 xxx=`./findhdr signal.h`
11549 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11550 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11551 echo "You have int (*signal())() instead of void." >&4
11553 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11554 echo "You have void (*signal())()." >&4
11556 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11557 echo "You have int (*signal())() instead of void." >&4
11559 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11560 echo "You have void (*signal())()." >&4
11563 case "$d_voidsig" in
11565 echo "I can't determine whether signal handler returns void or int..." >&4
11567 rp="What type does your signal handler return?"
11570 v*) val="$define";;
11574 echo "As you already told me, signal handler returns void." >&4
11577 *) echo "As you already told me, signal handler returns int." >&4
11584 case "$d_voidsig" in
11585 "$define") signal_t="void";;
11586 *) signal_t="int";;
11590 : check for ability to cast large floats to 32-bit ints.
11592 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11593 if $test "$intsize" -ge 4; then
11600 #$i_stdlib I_STDLIB
11602 #include <stdlib.h>
11604 #include <sys/types.h>
11605 #include <signal.h>
11606 $signal_t blech(int s) { exit(3); }
11613 signal(SIGFPE, blech);
11615 /* Don't let compiler optimize the test away. Store the number
11616 in a writable string for gcc to pass to sscanf under HP-UX.
11618 sprintf(str, "2147483647");
11619 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11623 /* x86 processors will probably give 0x8000 0000, which is a
11624 sign change. We don't want that. We want to mimic SPARC
11625 behavior here, which is to preserve the sign and give
11628 if (i32 != ($xxx) f)
11634 if eval $compile_ok; then
11635 $run ./try 2>/dev/null
11638 echo "(I can't seem to compile the test program--assuming it can't)"
11643 echo "Yup, it can."
11646 echo "Nope, it can't."
11653 : check for ability to cast negative floats to unsigned
11655 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11658 #$i_stdlib I_STDLIB
11660 #include <stdlib.h>
11662 #include <sys/types.h>
11663 #include <signal.h>
11664 $signal_t blech(int s) { exit(7); }
11665 $signal_t blech_in_list(int s) { exit(4); }
11666 unsigned long dummy_long(unsigned long p) { return p; }
11667 unsigned int dummy_int(unsigned int p) { return p; }
11668 unsigned short dummy_short(unsigned short p) { return p; }
11672 unsigned long along;
11674 unsigned short ashort;
11678 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11679 a direct f = -123. assignment. gcc-2.8.0 reportedly
11680 optimized the whole file away
11682 /* Store the number in a writable string for gcc to pass to
11683 sscanf under HP-UX.
11685 sprintf(str, "-123");
11686 sscanf(str, "%lf", &f); /* f = -123.; */
11688 signal(SIGFPE, blech);
11689 along = (unsigned long)f;
11690 aint = (unsigned int)f;
11691 ashort = (unsigned short)f;
11692 if (along != (unsigned long)-123)
11694 if (aint != (unsigned int)-123)
11696 if (ashort != (unsigned short)-123)
11698 sprintf(str, "1073741824.");
11699 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11702 along = (unsigned long)f;
11703 if (along != 0x80000000)
11707 along = (unsigned long)f;
11708 if (along != 0x7fffffff)
11712 along = (unsigned long)f;
11713 if (along != 0x80000001)
11717 signal(SIGFPE, blech_in_list);
11718 sprintf(str, "123.");
11719 sscanf(str, "%lf", &f); /* f = 123.; */
11720 along = dummy_long((unsigned long)f);
11721 aint = dummy_int((unsigned int)f);
11722 ashort = dummy_short((unsigned short)f);
11723 if (along != (unsigned long)123)
11725 if (aint != (unsigned int)123)
11727 if (ashort != (unsigned short)123)
11734 if eval $compile_ok; then
11735 $run ./try 2>/dev/null
11738 echo "(I can't seem to compile the test program--assuming it can't)"
11741 case "$castflags" in
11743 echo "Yup, it can."
11746 echo "Nope, it can't."
11753 : see if cbrt exists
11757 : see if vprintf exists
11759 if set vprintf val -f d_vprintf; eval $csym; $val; then
11760 echo 'vprintf() found.' >&4
11763 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11764 #$i_varargs I_VARARGS
11766 #$i_stdlib I_STDLIB
11767 #$i_unistd I_UNISTD
11770 # include <stdarg.h>
11771 #else /* I_VARARGS */
11772 # include <varargs.h>
11776 # include <unistd.h>
11780 # include <stdlib.h>
11783 #include <stdio.h> /* vsprintf prototype */
11786 void xxx(int n, ...)
11791 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11793 int main() { xxx(1, "foo"); }
11795 #else /* I_VARARGS */
11803 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11805 int main() { xxx("foo"); }
11811 if eval $compile_ok; then
11812 if $run ./try; then
11813 echo "Your vsprintf() returns (int)." >&4
11816 echo "Your vsprintf() returns (char*)." >&4
11820 echo 'I am unable to compile the vsprintf() test program.' >&4
11821 # We shouldn't get here. If we do, assume the standard signature,
11822 # not the old BSD one.
11823 echo 'Guessing that vsprintf() returns (int).' >&4
11827 echo 'vprintf() NOT found.' >&4
11838 : see if chown exists
11842 : see if chroot exists
11843 set chroot d_chroot
11846 : see if chsize exists
11847 set chsize d_chsize
11850 : see if class exists
11854 : see if clearenv exists
11855 set clearenv d_clearenv
11858 : Define hasstruct macro for Configure internal use
11859 hasstruct='varname=$1; struct=$2; shift; shift;
11860 while $test $# -ge 2; do
11862 $define) echo "#include <$2>";;
11866 echo "int main () { struct $struct foo; }" >> try.c;
11868 if eval $compile; then
11877 : see whether socket exists
11881 $echo $n "Hmm... $c" >&4
11882 if set socket val -f d_socket; eval $csym; $val; then
11883 echo "Looks like you have Berkeley networking support." >&4
11885 if set setsockopt val -f; eval $csym; $val; then
11888 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11889 d_oldsock="$define"
11892 if $contains socklib libc.list >/dev/null 2>&1; then
11893 echo "Looks like you have Berkeley networking support." >&4
11895 : we will have to assume that it supports the 4.2 BSD interface
11898 echo "You don't have Berkeley networking in libc$_a..." >&4
11899 if test "X$d_socket" = "X$define"; then
11900 echo "...but you seem to believe that you have sockets." >&4
11902 for net in net socket
11904 if test -f $sysroot/usr/lib/lib$net$_a; then
11905 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11906 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11907 if $contains socket libc.list >/dev/null 2>&1; then
11912 echo "...but the Wollongong group seems to have hacked it in." >&4
11913 sockethdr="-I$sysroot/usr/netinclude"
11916 echo "Found Berkeley sockets interface in lib$net." >&4
11917 if $contains setsockopt libc.list >/dev/null 2>&1; then
11920 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11921 d_oldsock="$define"
11927 if test "X$d_socket" != "X$define"; then
11928 echo "or anywhere else I see." >&4
11936 : see if socketpair exists
11937 set socketpair d_sockpair
11942 echo "Checking the availability sa_len in the sock struct ..." >&4
11944 #include <sys/types.h>
11945 #include <sys/socket.h>
11947 struct sockaddr sa;
11948 return (sa.sa_len);
11952 set try; if eval $compile; then
11955 set d_sockaddr_sa_len; eval $setvar
11959 echo "Checking the availability struct sockaddr_in6 ..." >&4
11961 #include <sys/types.h>
11962 #include <sys/socket.h>
11963 #include <netinet/in.h>
11965 struct sockaddr_in6 sin6;
11966 return (sin6.sin6_family);
11970 set try; if eval $compile; then
11973 set d_sockaddr_in6; eval $setvar
11977 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11979 #include <sys/types.h>
11980 #include <sys/socket.h>
11981 #include <netinet/in.h>
11983 struct sockaddr_in6 sin6;
11984 return (sin6.sin6_scope_id);
11988 set try; if eval $compile; then
11991 set d_sin6_scope_id; eval $setvar
11995 echo "Checking the availability struct ip_mreq ..." >&4
11997 #include <sys/types.h>
11998 #include <sys/socket.h>
11999 #include <netinet/in.h>
12001 struct ip_mreq mreq;
12002 return (mreq.imr_multiaddr.s_addr);
12006 set try; if eval $compile; then
12009 set d_ip_mreq; eval $setvar
12013 echo "Checking the availability struct ip_mreq_source ..." >&4
12015 #include <sys/types.h>
12016 #include <sys/socket.h>
12017 #include <netinet/in.h>
12019 struct ip_mreq_source mreq;
12020 return (mreq.imr_multiaddr.s_addr);
12024 set try; if eval $compile; then
12027 set d_ip_mreq_source; eval $setvar
12031 echo "Checking the availability struct ipv6_mreq ..." >&4
12033 #include <sys/types.h>
12034 #include <sys/socket.h>
12035 #include <netinet/in.h>
12037 struct ipv6_mreq mreq;
12038 return (mreq.ipv6mr_interface);
12042 set try; if eval $compile; then
12045 set d_ipv6_mreq; eval $setvar
12049 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12051 #include <sys/types.h>
12052 #include <sys/socket.h>
12053 #include <netinet/in.h>
12055 struct ipv6_mreq_source mreq;
12056 return (mreq.imr_multiaddr.s_addr);
12060 set try; if eval $compile; then
12063 set d_ipv6_mreq_source; eval $setvar
12067 echo "Checking the availability of certain socket constants..." >&4
12068 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12069 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12071 #include <sys/types.h>
12072 #include <sys/socket.h>
12078 set try; if eval $compile; then
12081 set d_${enum}; eval $setvar
12085 : see if this is a sys/uio.h system
12086 set sys/uio.h i_sysuio
12089 : Check for cmsghdr support
12091 echo "Checking to see if your system supports struct cmsghdr..." >&4
12092 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12094 case "$d_cmsghdr_s" in
12095 "$define") echo "Yes, it does." ;;
12096 *) echo "No, it doesn't." ;;
12100 : check for const keyword
12102 echo 'Checking to see if your C compiler knows about "const"...' >&4
12103 $cat >const.c <<'EOCP'
12104 typedef struct spug { int drokk; } spug;
12108 const spug y = { 0 };
12111 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12113 echo "Yup, it does."
12116 echo "Nope, it doesn't."
12121 : see if copysign exists
12122 set copysign d_copysign
12125 : see if copysignl exists
12126 set copysignl d_copysignl
12129 : see if crypt exists
12134 $define) cryptlib='' ;;
12135 *) if set crypt val -f d_crypt; eval $csym; $val; then
12136 echo 'crypt() found.' >&4
12140 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12141 if $test -z "$cryptlib"; then
12142 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12146 if $test -z "$cryptlib"; then
12147 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12151 if $test -z "$cryptlib"; then
12152 cryptlib=`./loc libcrypt$_a "" $libpth`
12156 if $test -z "$cryptlib"; then
12157 echo 'crypt() NOT found.' >&4
12168 : see if this is a crypt.h system
12169 set crypt.h i_crypt
12172 : see if crypt_r exists
12173 set crypt_r d_crypt_r
12175 case "$d_crypt_r" in
12177 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12178 case "$d_crypt_r_proto:$usethreads" in
12179 ":define") d_crypt_r_proto=define
12180 set d_crypt_r_proto crypt_r $hdrs
12184 case "$d_crypt_r_proto" in
12186 case "$crypt_r_proto" in
12187 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12188 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12190 case "$crypt_r_proto" in
12191 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12192 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12194 case "$crypt_r_proto" in
12195 ''|0) d_crypt_r=undef
12197 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12198 * ) case "$crypt_r_proto" in
12199 REENTRANT_PROTO*) ;;
12200 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12202 echo "Prototype: $try" ;;
12205 *) case "$usethreads" in
12206 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12217 : get csh whereabouts
12219 'csh') val="$undef" ;;
12220 *) val="$define" ;;
12224 : Respect a hint or command line value for full_csh.
12225 case "$full_csh" in
12226 '') full_csh=$csh ;;
12229 : see if ctermid exists
12230 set ctermid d_ctermid
12233 : see if ctermid_r exists
12234 set ctermid_r d_ctermid_r
12236 case "$d_ctermid_r" in
12238 hdrs="$i_systypes sys/types.h define stdio.h "
12239 case "$d_ctermid_r_proto:$usethreads" in
12240 ":define") d_ctermid_r_proto=define
12241 set d_ctermid_r_proto ctermid_r $hdrs
12245 case "$d_ctermid_r_proto" in
12247 case "$ctermid_r_proto" in
12248 ''|0) try='char* ctermid_r(char*);'
12249 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12251 case "$ctermid_r_proto" in
12252 ''|0) d_ctermid_r=undef
12254 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12255 * ) case "$ctermid_r_proto" in
12256 REENTRANT_PROTO*) ;;
12257 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12259 echo "Prototype: $try" ;;
12262 *) case "$usethreads" in
12263 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12270 *) ctermid_r_proto=0
12274 : see if ctime_r exists
12275 set ctime_r d_ctime_r
12277 case "$d_ctime_r" in
12279 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12280 case "$d_ctime_r_proto:$usethreads" in
12281 ":define") d_ctime_r_proto=define
12282 set d_ctime_r_proto ctime_r $hdrs
12286 case "$d_ctime_r_proto" in
12288 case "$ctime_r_proto" in
12289 ''|0) try='char* ctime_r(const time_t*, char*);'
12290 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12292 case "$ctime_r_proto" in
12293 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12294 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12296 case "$ctime_r_proto" in
12297 ''|0) try='int ctime_r(const time_t*, char*);'
12298 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12300 case "$ctime_r_proto" in
12301 ''|0) try='int ctime_r(const time_t*, char*, int);'
12302 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12304 case "$ctime_r_proto" in
12305 ''|0) d_ctime_r=undef
12307 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12308 * ) case "$ctime_r_proto" in
12309 REENTRANT_PROTO*) ;;
12310 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12312 echo "Prototype: $try" ;;
12315 *) case "$usethreads" in
12316 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12327 : see if cuserid exists
12328 set cuserid d_cuserid
12331 : see if this is a limits.h system
12332 set limits.h i_limits
12335 : See if number of significant digits in a double precision number is known
12337 $cat >dbl_dig.c <<EOM
12338 #$i_limits I_LIMITS
12341 #include <limits.h>
12347 printf("Contains DBL_DIG");
12350 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12351 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12352 echo "DBL_DIG found." >&4
12355 echo "DBL_DIG NOT found." >&4
12362 : see if dbm.h is available
12363 : see if dbmclose exists
12364 set dbmclose d_dbmclose
12367 case "$d_dbmclose" in
12377 *) set rpcsvc/dbm.h i_rpcsvcdbm
12382 *) echo "We won't be including <dbm.h>"
12392 : see if prototype for dbminit is available
12394 set d_dbminitproto dbminit $i_dbm dbm.h
12397 : see if difftime exists
12398 set difftime d_difftime
12401 : see if this is a dirent system
12403 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12405 echo "<dirent.h> found." >&4
12408 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12409 echo "<sys/dir.h> found." >&4
12412 xinc=`./findhdr sys/ndir.h`
12414 echo "<dirent.h> NOT found." >&4
12419 : Look for type of directory structure.
12421 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12423 case "$direntrytype" in
12425 case "$i_dirent" in
12426 $define) guess1='struct dirent' ;;
12427 *) guess1='struct direct' ;;
12430 *) guess1="$direntrytype"
12435 'struct dirent') guess2='struct direct' ;;
12436 *) guess2='struct dirent' ;;
12439 if $contains "$guess1" try.c >/dev/null 2>&1; then
12440 direntrytype="$guess1"
12441 echo "Your directory entries are $direntrytype." >&4
12442 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12443 direntrytype="$guess2"
12444 echo "Your directory entries seem to be $direntrytype." >&4
12446 echo "I don't recognize your system's directory entries." >&4
12447 rp="What type is used for directory entries on this system?"
12450 direntrytype="$ans"
12454 : see if the directory entry stores field length
12456 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12457 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12458 echo "Good, your directory entry keeps length information in d_namlen." >&4
12461 echo "Your directory entry does not know about the d_namlen field." >&4
12468 : Look for DIR.dd_fd
12469 case "$i_dirent" in
12471 echo "Checking to see if DIR has a dd_fd member variable" >&4
12473 #$i_stdlib I_STDLIB
12475 #include <stdlib.h>
12477 #include <dirent.h>
12487 if eval $compile; then
12488 echo "Yes, it does."
12491 echo "No, it does not."
12496 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12504 : see if this is an sysdir system
12505 set sys/dir.h i_sysdir
12508 : see if this is an sysndir system
12509 set sys/ndir.h i_sysndir
12514 $cat >dirfd.c <<EOM
12516 #$i_stdlib I_STDLIB
12518 #include <stdlib.h>
12520 #$i_dirent I_DIRENT /**/
12521 #$i_sysdir I_SYS_DIR /**/
12522 #$i_sysndir I_SYS_NDIR /**/
12523 #$i_systypes I_SYS_TYPES /**/
12524 #if defined(I_SYS_TYPES)
12525 #include <sys/types.h>
12527 #if defined(I_DIRENT)
12528 #include <dirent.h>
12531 #include <sys/ndir.h>
12535 #include <ndir.h> /* may be wrong in the future */
12537 #include <sys/dir.h>
12543 DIR *dirp = opendir(".");
12544 if (dirfd(dirp) >= 0)
12552 if eval $compile; then
12556 $define) echo "dirfd() found." >&4 ;;
12557 *) echo "dirfd() NOT found." >&4 ;;
12563 : see if dladdr exists
12564 set dladdr d_dladdr
12567 : see if dlerror exists
12570 set dlerror d_dlerror
12574 : see if dlfcn is available
12575 set dlfcn.h i_dlfcn
12578 : Check what extension to use for shared libs
12583 On a few systems, the dynamically loaded modules that perl generates and uses
12584 will need a different extension than shared libs. The default will probably
12590 *) dflt="$dlext" ;;
12592 rp='What is the extension of dynamically loaded modules'
12601 : Check if dlsym need a leading underscore
12607 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12608 $cat >dyna.c <<'EOM'
12615 #$i_stdlib I_STDLIB
12617 #include <stdlib.h>
12621 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12623 #include <sys/types.h>
12628 extern int fred() ;
12637 int mode = RTLD_LAZY ;
12639 handle = dlopen("./dyna.$dlext", mode) ;
12640 if (handle == NULL) {
12645 symbol = dlsym(handle, "fred") ;
12646 if (symbol == NULL) {
12647 /* try putting a leading underscore */
12648 symbol = dlsym(handle, "_fred") ;
12649 if (symbol == NULL) {
12662 : Call the object file tmp-dyna.o in case dlext=o.
12663 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12664 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12665 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12666 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12669 1) echo "Test program failed using dlopen." >&4
12670 echo "Perhaps you should not use dynamic loading." >&4;;
12671 2) echo "Test program failed using dlsym." >&4
12672 echo "Perhaps you should not use dynamic loading." >&4;;
12673 3) echo "dlsym needs a leading underscore" >&4
12675 4) echo "dlsym doesn't need a leading underscore." >&4;;
12678 echo "I can't compile and run the test program." >&4
12679 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12684 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12689 : see if drand48_r exists
12690 set drand48_r d_drand48_r
12692 case "$d_drand48_r" in
12694 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12695 case "$d_drand48_r_proto:$usethreads" in
12696 ":define") d_drand48_r_proto=define
12697 set d_drand48_r_proto drand48_r $hdrs
12701 case "$d_drand48_r_proto" in
12703 case "$drand48_r_proto" in
12704 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12705 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12707 case "$drand48_r_proto" in
12708 ''|0) d_drand48_r=undef
12710 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12711 * ) case "$drand48_r_proto" in
12712 REENTRANT_PROTO*) ;;
12713 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12715 echo "Prototype: $try" ;;
12718 *) case "$usethreads" in
12719 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12726 *) drand48_r_proto=0
12730 : see if prototype for drand48 is available
12732 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12735 : see if dup2 exists
12739 : see if eaccess exists
12740 set eaccess d_eaccess
12743 : see if endgrent exists
12744 set endgrent d_endgrent
12747 : see if this is an grp system
12753 xxx=`./findhdr grp.h`
12754 $cppstdin $cppflags $cppminus < $xxx >$$.h
12756 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12768 set d_grpasswd; eval $setvar
12772 : see if endgrent_r exists
12773 set endgrent_r d_endgrent_r
12775 case "$d_endgrent_r" in
12777 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12778 case "$d_endgrent_r_proto:$usethreads" in
12779 ":define") d_endgrent_r_proto=define
12780 set d_endgrent_r_proto endgrent_r $hdrs
12784 case "$d_endgrent_r_proto" in
12786 case "$endgrent_r_proto" in
12787 ''|0) try='int endgrent_r(FILE**);'
12788 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12790 case "$endgrent_r_proto" in
12791 ''|0) try='void endgrent_r(FILE**);'
12792 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12794 case "$endgrent_r_proto" in
12795 ''|0) d_endgrent_r=undef
12797 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12798 * ) case "$endgrent_r_proto" in
12799 REENTRANT_PROTO*) ;;
12800 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12802 echo "Prototype: $try" ;;
12805 *) case "$usethreads" in
12806 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12813 *) endgrent_r_proto=0
12817 : see if endhostent exists
12818 set endhostent d_endhent
12821 : see if this is a netdb.h system
12822 set netdb.h i_netdb
12825 : see if endhostent_r exists
12826 set endhostent_r d_endhostent_r
12828 case "$d_endhostent_r" in
12830 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12831 case "$d_endhostent_r_proto:$usethreads" in
12832 ":define") d_endhostent_r_proto=define
12833 set d_endhostent_r_proto endhostent_r $hdrs
12837 case "$d_endhostent_r_proto" in
12839 case "$endhostent_r_proto" in
12840 ''|0) try='int endhostent_r(struct hostent_data*);'
12841 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12843 case "$endhostent_r_proto" in
12844 ''|0) try='void endhostent_r(struct hostent_data*);'
12845 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12847 case "$endhostent_r_proto" in
12848 ''|0) d_endhostent_r=undef
12849 endhostent_r_proto=0
12850 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12851 * ) case "$endhostent_r_proto" in
12852 REENTRANT_PROTO*) ;;
12853 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12855 echo "Prototype: $try" ;;
12858 *) case "$usethreads" in
12859 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12861 d_endhostent_r=undef
12862 endhostent_r_proto=0
12866 *) endhostent_r_proto=0
12870 : see if endnetent exists
12871 set endnetent d_endnent
12874 : see if endnetent_r exists
12875 set endnetent_r d_endnetent_r
12877 case "$d_endnetent_r" in
12879 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12880 case "$d_endnetent_r_proto:$usethreads" in
12881 ":define") d_endnetent_r_proto=define
12882 set d_endnetent_r_proto endnetent_r $hdrs
12886 case "$d_endnetent_r_proto" in
12888 case "$endnetent_r_proto" in
12889 ''|0) try='int endnetent_r(struct netent_data*);'
12890 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12892 case "$endnetent_r_proto" in
12893 ''|0) try='void endnetent_r(struct netent_data*);'
12894 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12896 case "$endnetent_r_proto" in
12897 ''|0) d_endnetent_r=undef
12898 endnetent_r_proto=0
12899 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12900 * ) case "$endnetent_r_proto" in
12901 REENTRANT_PROTO*) ;;
12902 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12904 echo "Prototype: $try" ;;
12907 *) case "$usethreads" in
12908 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12910 d_endnetent_r=undef
12911 endnetent_r_proto=0
12915 *) endnetent_r_proto=0
12919 : see if endprotoent exists
12920 set endprotoent d_endpent
12923 : see if endprotoent_r exists
12924 set endprotoent_r d_endprotoent_r
12926 case "$d_endprotoent_r" in
12928 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12929 case "$d_endprotoent_r_proto:$usethreads" in
12930 ":define") d_endprotoent_r_proto=define
12931 set d_endprotoent_r_proto endprotoent_r $hdrs
12935 case "$d_endprotoent_r_proto" in
12937 case "$endprotoent_r_proto" in
12938 ''|0) try='int endprotoent_r(struct protoent_data*);'
12939 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12941 case "$endprotoent_r_proto" in
12942 ''|0) try='void endprotoent_r(struct protoent_data*);'
12943 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12945 case "$endprotoent_r_proto" in
12946 ''|0) d_endprotoent_r=undef
12947 endprotoent_r_proto=0
12948 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12949 * ) case "$endprotoent_r_proto" in
12950 REENTRANT_PROTO*) ;;
12951 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12953 echo "Prototype: $try" ;;
12956 *) case "$usethreads" in
12957 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12959 d_endprotoent_r=undef
12960 endprotoent_r_proto=0
12964 *) endprotoent_r_proto=0
12968 : see if endpwent exists
12969 set endpwent d_endpwent
12972 : see if this is a pwd.h system
12978 xxx=`./findhdr pwd.h`
12979 $cppstdin $cppflags $cppminus < $xxx >$$.h
12981 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12989 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12997 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13005 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13013 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13021 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13029 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13037 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13049 set d_pwquota; eval $setvar
13050 set d_pwage; eval $setvar
13051 set d_pwchange; eval $setvar
13052 set d_pwclass; eval $setvar
13053 set d_pwexpire; eval $setvar
13054 set d_pwcomment; eval $setvar
13055 set d_pwgecos; eval $setvar
13056 set d_pwpasswd; eval $setvar
13060 : see if endpwent_r exists
13061 set endpwent_r d_endpwent_r
13063 case "$d_endpwent_r" in
13065 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13066 case "$d_endpwent_r_proto:$usethreads" in
13067 ":define") d_endpwent_r_proto=define
13068 set d_endpwent_r_proto endpwent_r $hdrs
13072 case "$d_endpwent_r_proto" in
13074 case "$endpwent_r_proto" in
13075 ''|0) try='int endpwent_r(FILE**);'
13076 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13078 case "$endpwent_r_proto" in
13079 ''|0) try='void endpwent_r(FILE**);'
13080 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13082 case "$endpwent_r_proto" in
13083 ''|0) d_endpwent_r=undef
13085 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13086 * ) case "$endpwent_r_proto" in
13087 REENTRANT_PROTO*) ;;
13088 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13090 echo "Prototype: $try" ;;
13093 *) case "$usethreads" in
13094 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13101 *) endpwent_r_proto=0
13105 : see if endservent exists
13106 set endservent d_endsent
13109 : see if endservent_r exists
13110 set endservent_r d_endservent_r
13112 case "$d_endservent_r" in
13114 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13115 case "$d_endservent_r_proto:$usethreads" in
13116 ":define") d_endservent_r_proto=define
13117 set d_endservent_r_proto endservent_r $hdrs
13121 case "$d_endservent_r_proto" in
13123 case "$endservent_r_proto" in
13124 ''|0) try='int endservent_r(struct servent_data*);'
13125 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13127 case "$endservent_r_proto" in
13128 ''|0) try='void endservent_r(struct servent_data*);'
13129 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13131 case "$endservent_r_proto" in
13132 ''|0) d_endservent_r=undef
13133 endservent_r_proto=0
13134 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13135 * ) case "$endservent_r_proto" in
13136 REENTRANT_PROTO*) ;;
13137 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13139 echo "Prototype: $try" ;;
13142 *) case "$usethreads" in
13143 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13145 d_endservent_r=undef
13146 endservent_r_proto=0
13150 *) endservent_r_proto=0
13154 : Locate the flags for 'open()'
13157 #include <sys/types.h>
13162 #include <sys/file.h>
13164 #$i_stdlib I_STDLIB
13166 #include <stdlib.h>
13177 : check sys/file.h first to get FREAD on Sun
13178 if $test `./findhdr sys/file.h` && \
13179 set try -DI_SYS_FILE && eval $compile; then
13181 echo "<sys/file.h> defines the O_* constants..." >&4
13182 if $run ./try; then
13183 echo "and you have the 3 argument form of open()." >&4
13186 echo "but not the 3 argument form of open(). Oh, well." >&4
13189 elif $test `./findhdr fcntl.h` && \
13190 set try -DI_FCNTL && eval $compile; then
13192 echo "<fcntl.h> defines the O_* constants..." >&4
13193 if $run ./try; then
13194 echo "and you have the 3 argument form of open()." >&4
13197 echo "but not the 3 argument form of open(). Oh, well." >&4
13202 echo "I can't find the O_* constant definitions! You got problems." >&4
13208 : see if this is a sys/file.h system
13213 : do we need to include sys/file.h ?
13217 if $h_sysfile; then
13219 echo "We'll be including <sys/file.h>." >&4
13222 echo "We won't be including <sys/file.h>." >&4
13232 : see if fcntl.h is there
13237 : see if we can include fcntl.h
13243 echo "We'll be including <fcntl.h>." >&4
13246 if $h_sysfile; then
13247 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13249 echo "We won't be including <fcntl.h>." >&4
13261 : see if fork exists
13265 : see if pipe exists
13269 : check for non-blocking I/O stuff
13270 case "$h_sysfile" in
13271 true) echo "#include <sys/file.h>" > head.c;;
13274 true) echo "#include <fcntl.h>" > head.c;;
13275 *) echo "#include <sys/fcntl.h>" > head.c;;
13280 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13281 case "$o_nonblock" in
13283 $cat head.c > try.c
13284 $cat >>try.c <<EOCP
13286 #$i_stdlib I_STDLIB
13288 #include <stdlib.h>
13296 printf("O_NONBLOCK\n");
13300 printf("O_NDELAY\n");
13304 printf("FNDELAY\n");
13311 if eval $compile_ok; then
13312 o_nonblock=`$run ./try`
13313 case "$o_nonblock" in
13314 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13315 *) echo "Seems like we can use $o_nonblock.";;
13318 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13321 *) echo "Using $hint value $o_nonblock.";;
13326 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13329 case "$d_fork:$d_pipe:$d_alarm" in
13331 $cat head.c > try.c
13332 $cat >>try.c <<EOCP
13334 #include <sys/types.h>
13335 #include <signal.h>
13337 #$i_stdlib I_STDLIB
13339 #include <stdlib.h>
13345 #define MY_O_NONBLOCK $o_nonblock
13346 #ifndef errno /* XXX need better Configure test */
13349 #$i_unistd I_UNISTD
13351 #include <unistd.h>
13353 #$i_string I_STRING
13355 #include <string.h>
13357 #include <strings.h>
13359 $signal_t blech(int x) { exit(3); }
13361 $cat >> try.c <<'EOCP'
13370 ret = pipe(pd); /* Down: child -> parent */
13373 ret = pipe(pu); /* Up: parent -> child */
13377 close(pd[1]); /* Parent reads from pd[0] */
13378 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13380 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13385 signal(SIGALRM, blech);
13387 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13389 sprintf(string, "%d\n", ret);
13390 ret = write(2, string, strlen(string));
13391 if (ret != strlen(string))
13395 if (errno == EAGAIN) {
13396 printf("EAGAIN\n");
13401 if (errno == EWOULDBLOCK)
13402 printf("EWOULDBLOCK\n");
13405 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13408 sleep(2); /* Give it time to close our pipe */
13410 ret = read(pd[0], buf, 1); /* Should read EOF */
13412 sprintf(string, "%d\n", ret);
13413 ret = write(4, string, strlen(string));
13414 if (ret != strlen(string))
13419 close(pd[0]); /* We write to pd[1] */
13420 close(pu[1]); /* We read from pu[0] */
13421 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13424 close(pd[1]); /* Pipe pd is now fully closed! */
13425 exit(0); /* Bye bye, thank you for playing! */
13429 if eval $compile_ok; then
13430 echo "$startsh" >mtry
13431 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13433 $run ./mtry >/dev/null 2>&1
13435 0) eagain=`$cat try.out`;;
13436 1) echo "Could not perform non-blocking setting!";;
13437 2) echo "I did a successful read() for something that was not there!";;
13438 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13439 4) echo "Could not find F_SETFL!";;
13440 *) echo "Something terribly wrong happened during testing.";;
13442 rd_nodata=`$cat try.ret`
13443 echo "A read() system call with no data present returns $rd_nodata."
13444 case "$rd_nodata" in
13447 echo "(That's peculiar, fixing that to be -1.)"
13453 echo "Forcing errno EAGAIN on read() with no data available."
13457 echo "Your read() sets errno to $eagain when no data is available."
13460 status=`$cat try.err`
13462 0) echo "And it correctly returns 0 to signal EOF.";;
13463 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13464 *) echo "However, your read() returns '$status' on EOF??";;
13467 if test "$status" = "$rd_nodata"; then
13468 echo "WARNING: you can't distinguish between EOF and no data!"
13472 echo "I can't compile the test program--assuming errno EAGAIN will do."
13476 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13485 echo "Using $hint value $eagain."
13486 echo "Your read() returns $rd_nodata when no data is present."
13487 case "$d_eofnblk" in
13488 "$define") echo "And you can see EOF because read() returns 0.";;
13489 "$undef") echo "But you can't see EOF status from read() returned value.";;
13491 echo "(Assuming you can't see EOF status from read anyway.)"
13497 $rm_try head.c mtry
13499 : see if erf exists
13503 : see if erfc exists
13507 : see if exp2 exists
13511 : see if expm1 exists
13515 : see if _ptr and _cnt from stdio act std
13518 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13519 echo "(Looks like you have stdio.h from BSD.)"
13520 case "$stdio_ptr" in
13521 '') stdio_ptr='((fp)->_p)'
13524 *) ptr_lval=$d_stdio_ptr_lval;;
13526 case "$stdio_cnt" in
13527 '') stdio_cnt='((fp)->_r)'
13530 *) cnt_lval=$d_stdio_cnt_lval;;
13532 case "$stdio_base" in
13533 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13535 case "$stdio_bufsiz" in
13536 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13538 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13539 echo "(Looks like you have stdio.h from Linux.)"
13540 case "$stdio_ptr" in
13541 '') stdio_ptr='((fp)->_IO_read_ptr)'
13544 *) ptr_lval=$d_stdio_ptr_lval;;
13546 case "$stdio_cnt" in
13547 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13550 *) cnt_lval=$d_stdio_cnt_lval;;
13552 case "$stdio_base" in
13553 '') stdio_base='((fp)->_IO_read_base)';;
13555 case "$stdio_bufsiz" in
13556 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13559 case "$stdio_ptr" in
13560 '') stdio_ptr='((fp)->_ptr)'
13563 *) ptr_lval=$d_stdio_ptr_lval;;
13565 case "$stdio_cnt" in
13566 '') stdio_cnt='((fp)->_cnt)'
13569 *) cnt_lval=$d_stdio_cnt_lval;;
13571 case "$stdio_base" in
13572 '') stdio_base='((fp)->_base)';;
13574 case "$stdio_bufsiz" in
13575 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13579 : test whether _ptr and _cnt really work
13580 echo "Checking how std your stdio is..." >&4
13583 #$i_stdlib I_STDLIB
13585 #include <stdlib.h>
13587 #define FILE_ptr(fp) $stdio_ptr
13588 #define FILE_cnt(fp) $stdio_cnt
13590 FILE *fp = fopen("try.c", "r");
13593 18 <= FILE_cnt(fp) &&
13594 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13602 if eval $compile && $to try.c; then
13603 if $run ./try; then
13604 echo "Your stdio acts pretty std."
13607 echo "Your stdio isn't very std."
13610 echo "Your stdio doesn't appear very std."
13614 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13615 # direct buffer manipulation no longer works. The Configure tests
13616 # should be changed to correctly detect this, but until then,
13617 # the following check should at least let perl compile and run.
13618 # (This quick fix should be updated before 5.8.1.)
13619 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13620 # A. Dougherty, June 3, 2002.
13621 case "$d_gnulibc" in
13623 case "$gnulibc_version" in
13627 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13636 : Can _ptr be used as an lvalue?
13637 case "$d_stdstdio$ptr_lval" in
13638 $define$define) val=$define ;;
13641 set d_stdio_ptr_lval
13644 : Can _cnt be used as an lvalue?
13645 case "$d_stdstdio$cnt_lval" in
13646 $define$define) val=$define ;;
13649 set d_stdio_cnt_lval
13653 : test whether setting _ptr sets _cnt as a side effect
13654 d_stdio_ptr_lval_sets_cnt="$undef"
13655 d_stdio_ptr_lval_nochange_cnt="$undef"
13656 case "$d_stdio_ptr_lval$d_stdstdio" in
13658 echo "Checking to see what happens if we set the stdio ptr..." >&4
13661 /* Can we scream? */
13662 /* Eat dust sed :-) */
13663 /* In the buffer space, no one can hear you scream. */
13664 #$i_stdlib I_STDLIB
13666 #include <stdlib.h>
13668 #define FILE_ptr(fp) $stdio_ptr
13669 #define FILE_cnt(fp) $stdio_cnt
13670 #include <sys/types.h>
13672 FILE *fp = fopen("try.c", "r");
13677 puts("Fail even to read");
13680 c = getc(fp); /* Read away the first # */
13682 puts("Fail even to read");
13686 18 <= FILE_cnt(fp) &&
13687 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13689 puts("Fail even to read");
13692 ptr = (char*) FILE_ptr(fp);
13693 cnt = (size_t)FILE_cnt(fp);
13695 FILE_ptr(fp) += 42;
13697 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13698 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13701 if (FILE_cnt(fp) <= 20) {
13702 printf ("Fail (<20 chars to test)");
13705 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13706 puts("Fail compare");
13709 if (cnt == FILE_cnt(fp)) {
13710 puts("Pass_unchanged");
13713 if (FILE_cnt(fp) == (cnt - 42)) {
13714 puts("Pass_changed");
13717 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13723 if eval $compile && $to try.c; then
13724 case `$run ./try` in
13726 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13727 d_stdio_ptr_lval_sets_cnt="$define" ;;
13729 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13730 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13732 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13734 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13737 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13743 : see if _base is also standard
13745 case "$d_stdstdio" in
13749 #$i_stdlib I_STDLIB
13751 #include <stdlib.h>
13753 #define FILE_base(fp) $stdio_base
13754 #define FILE_bufsiz(fp) $stdio_bufsiz
13756 FILE *fp = fopen("try.c", "r");
13759 19 <= FILE_bufsiz(fp) &&
13760 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13767 if eval $compile && $to try.c; then
13768 if $run ./try; then
13769 echo "And its _base field acts std."
13772 echo "But its _base field isn't std."
13775 echo "However, it seems to be lacking the _base field."
13783 : see if fast_stdio exists
13785 case "$d_stdstdio:$d_stdio_ptr_lval" in
13787 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13789 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13800 : see if fchdir exists
13801 set fchdir d_fchdir
13804 : see if fchmod exists
13805 set fchmod d_fchmod
13808 : see if fchown exists
13809 set fchown d_fchown
13812 : see if this is an fcntl system
13816 : See if fcntl-based locking works.
13819 #$i_stdlib I_STDLIB
13821 #include <stdlib.h>
13823 #include <unistd.h>
13825 #include <signal.h>
13826 $signal_t blech(int x) { exit(3); }
13828 #if defined(F_SETLK) && defined(F_SETLKW)
13829 struct flock flock;
13831 fd = open("try.c", O_RDONLY);
13832 flock.l_type = F_RDLCK;
13833 flock.l_whence = SEEK_SET;
13834 flock.l_start = flock.l_len = 0;
13835 signal(SIGALRM, blech);
13837 retval = fcntl(fd, F_SETLK, &flock);
13839 (retval < 0 ? exit(2) : exit(0));
13845 echo "Checking if fcntl-based file locking works... "
13849 if eval $compile_ok; then
13850 if $run ./try; then
13851 echo "Yes, it seems to work."
13854 echo "Nope, it didn't work."
13859 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13860 *** This is (almost) impossible.
13861 *** If your NFS lock daemons are not feeling well, something like
13862 *** this may happen, please investigate. Cannot continue, aborting.
13870 echo "I'm unable to compile the test program, so I'll assume not."
13875 echo "Nope, since you don't even have fcntl()."
13878 set d_fcntl_can_lock
13882 : check for fd_set items
13885 Checking to see how well your C compiler handles fd_set and friends ...
13888 #$i_stdlib I_STDLIB
13890 #include <stdlib.h>
13892 #$i_systime I_SYS_TIME
13893 #$i_sysselct I_SYS_SELECT
13894 #$d_socket HAS_SOCKET
13895 #include <sys/types.h>
13897 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13900 #include <sys/time.h>
13902 #ifdef I_SYS_SELECT
13903 #include <sys/select.h>
13912 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13920 if eval $compile; then
13921 d_fds_bits="$define"
13923 echo "Well, your system knows about the normal fd_set typedef..." >&4
13924 if $run ./try; then
13925 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13926 d_fd_macros="$define"
13929 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13931 d_fd_macros="$undef"
13935 Hmm, your compiler has some difficulty with fd_set. Checking further...
13938 if eval $compile; then
13939 d_fds_bits="$undef"
13941 echo "Well, your system has some sort of fd_set available..." >&4
13942 if $run ./try; then
13943 echo "and you have the normal fd_set macros." >&4
13944 d_fd_macros="$define"
13947 but not the normal fd_set macros! Gross! More work for me...
13949 d_fd_macros="$undef"
13952 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13954 d_fds_bits="$undef"
13955 d_fd_macros="$undef"
13960 : see if fdim exists
13964 : see if fegetround exists
13965 set fegetround d_fegetround
13968 : see if fgetpos exists
13969 set fgetpos d_fgetpos
13972 : see if finite exists
13973 set finite d_finite
13976 : see if finitel exists
13977 set finitel d_finitel
13980 : see if flock exists
13984 : see if prototype for flock is available
13986 set d_flockproto flock $i_sysfile sys/file.h
13989 : see if fma exists
13993 : see if fmax exists
13997 : see if fmin exists
14001 : see if fp_class exists
14002 set fp_class d_fp_class
14005 : see if this is a math.h system
14009 : check for fpclassify
14010 echo "Checking to see if you have fpclassify..." >&4
14016 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14019 if eval $compile; then
14021 echo "You have fpclassify."
14024 echo "You do not have fpclassify."
14030 : see if fp_classify exists
14031 set fp_classify d_fp_classify
14034 : see if fp_classl exists
14035 set fp_classl d_fp_classl
14038 : see if pathconf exists
14039 set pathconf d_pathconf
14042 : see if fpathconf exists
14043 set fpathconf d_fpathconf
14046 : see if fpclass exists
14047 set fpclass d_fpclass
14050 : see if fpclassl exists
14051 set fpclassl d_fpclassl
14054 : see if fpgetround exists
14055 set fpgetround d_fpgetround
14058 : check for fpos64_t
14060 echo "Checking to see if you have fpos64_t..." >&4
14063 int main() { fpos64_t x = 7; }
14066 if eval $compile; then
14068 echo "You have fpos64_t."
14071 echo "You do not have fpos64_t."
14072 case "$fpossize" in
14073 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14080 : see if frexpl exists
14081 set frexpl d_frexpl
14084 : see if this is a sys/param system
14085 set sys/param.h i_sysparam
14088 : see if this is a sys/mount.h system
14089 set sys/mount.h i_sysmount
14092 : Check for fs_data_s
14094 echo "Checking to see if your system supports struct fs_data..." >&4
14095 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14097 case "$d_fs_data_s" in
14098 "$define") echo "Yes, it does." ;;
14099 *) echo "No, it doesn't." ;;
14102 : see if fseeko exists
14103 set fseeko d_fseeko
14105 case "$longsize" in
14106 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14109 : see if fsetpos exists
14110 set fsetpos d_fsetpos
14113 : see if fstatfs exists
14114 set fstatfs d_fstatfs
14117 : see if statvfs exists
14118 set statvfs d_statvfs
14121 : see if fstatvfs exists
14122 set fstatvfs d_fstatvfs
14126 : see if fsync exists
14130 : see if ftello exists
14131 set ftello d_ftello
14133 case "$longsize" in
14134 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14137 : check for a working futimes
14140 echo "Checking if you have a working futimes()" >&4
14143 #include <sys/time.h>
14150 fd = open ("try.c", O_RDWR);
14151 if (-1 == fd) exit (1);
14152 rv = futimes (fd, NULL);
14153 exit (rv == -1 ? errno : 0);
14157 if eval $compile; then
14161 0) echo "Yes, you have" >&4
14162 d_futimes="$define"
14164 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14168 echo "No, it does not (probably harmless)" >&4
14172 : see if ndbm.h is available
14175 : Compatibility location for RedHat 7.1
14176 set gdbm/ndbm.h i_gdbmndbm
14178 : Compatibility location for Debian 4.0
14179 set gdbm-ndbm.h i_gdbm_ndbm
14183 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14184 : see if dbm_open exists
14185 set dbm_open d_dbm_open
14187 case "$d_dbm_open" in
14190 i_gdbmndbm="$undef"
14191 i_gdbm_ndbm="$undef"
14192 echo "We won't be including <ndbm.h>"
14202 ndbm_hdr_protochk='name=$1; hdr=$2;
14203 eval "ihdr=\$""i_$name";
14205 if $test "$ihdr" = "$define"; then
14206 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14207 case "$d_cplusplus" in
14208 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14209 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14212 $define) $echo "Your <$hdr> seems to have prototypes";;
14213 *) $echo "Your <$hdr> does not seem to have prototypes";;
14216 set "d_${name}_h_uses_prototypes";
14220 eval $ndbm_hdr_protochk
14221 set gdbmndbm gdbm/ndbm.h
14222 eval $ndbm_hdr_protochk
14223 set gdbm_ndbm gdbm-ndbm.h
14224 eval $ndbm_hdr_protochk
14226 : see if getaddrinfo exists
14227 set getaddrinfo d_getaddrinfo
14230 : see if getcwd exists
14231 set getcwd d_getcwd
14234 : see if getespwnam exists
14235 set getespwnam d_getespwnam
14238 : see if getfsstat exists
14239 set getfsstat d_getfsstat
14242 : see if getgrent exists
14243 set getgrent d_getgrent
14246 : see if getgrent_r exists
14247 set getgrent_r d_getgrent_r
14249 case "$d_getgrent_r" in
14251 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14252 case "$d_getgrent_r_proto:$usethreads" in
14253 ":define") d_getgrent_r_proto=define
14254 set d_getgrent_r_proto getgrent_r $hdrs
14258 case "$d_getgrent_r_proto" in
14260 case "$getgrent_r_proto" in
14261 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14262 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14264 case "$getgrent_r_proto" in
14265 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14266 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14268 case "$getgrent_r_proto" in
14269 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14270 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14272 case "$getgrent_r_proto" in
14273 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14274 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14276 case "$getgrent_r_proto" in
14277 ''|0) try='int getgrent_r(struct group*, char*, int);'
14278 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14280 case "$getgrent_r_proto" in
14281 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14282 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14284 case "$getgrent_r_proto" in
14285 ''|0) d_getgrent_r=undef
14287 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14288 * ) case "$getgrent_r_proto" in
14289 REENTRANT_PROTO*) ;;
14290 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14292 echo "Prototype: $try" ;;
14295 *) case "$usethreads" in
14296 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14303 *) getgrent_r_proto=0
14307 : see if getgrgid_r exists
14308 set getgrgid_r d_getgrgid_r
14310 case "$d_getgrgid_r" in
14312 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14313 case "$d_getgrgid_r_proto:$usethreads" in
14314 ":define") d_getgrgid_r_proto=define
14315 set d_getgrgid_r_proto getgrgid_r $hdrs
14319 case "$d_getgrgid_r_proto" in
14321 case "$getgrgid_r_proto" in
14322 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14323 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14325 case "$getgrgid_r_proto" in
14326 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14327 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14329 case "$getgrgid_r_proto" in
14330 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14331 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14333 case "$getgrgid_r_proto" in
14334 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14335 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14337 case "$getgrgid_r_proto" in
14338 ''|0) d_getgrgid_r=undef
14340 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14341 * ) case "$getgrgid_r_proto" in
14342 REENTRANT_PROTO*) ;;
14343 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14345 echo "Prototype: $try" ;;
14348 *) case "$usethreads" in
14349 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14356 *) getgrgid_r_proto=0
14360 : see if getgrnam_r exists
14361 set getgrnam_r d_getgrnam_r
14363 case "$d_getgrnam_r" in
14365 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14366 case "$d_getgrnam_r_proto:$usethreads" in
14367 ":define") d_getgrnam_r_proto=define
14368 set d_getgrnam_r_proto getgrnam_r $hdrs
14372 case "$d_getgrnam_r_proto" in
14374 case "$getgrnam_r_proto" in
14375 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14376 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14378 case "$getgrnam_r_proto" in
14379 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14380 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14382 case "$getgrnam_r_proto" in
14383 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14384 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14386 case "$getgrnam_r_proto" in
14387 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14388 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14390 case "$getgrnam_r_proto" in
14391 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14392 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14394 case "$getgrnam_r_proto" in
14395 ''|0) d_getgrnam_r=undef
14397 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14398 * ) case "$getgrnam_r_proto" in
14399 REENTRANT_PROTO*) ;;
14400 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14402 echo "Prototype: $try" ;;
14405 *) case "$usethreads" in
14406 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14413 *) getgrnam_r_proto=0
14417 : see if gethostbyaddr exists
14418 set gethostbyaddr d_gethbyaddr
14421 : see if gethostbyname exists
14422 set gethostbyname d_gethbyname
14425 : see if gethostent exists
14426 set gethostent d_gethent
14429 : see how we will look up host name
14432 if set gethostname val -f d_gethname; eval $csym; $val; then
14433 echo 'gethostname() found.' >&4
14434 d_gethname="$define"
14437 if set uname val -f d_uname; eval $csym; $val; then
14440 uname() was found, but you're running xenix, and older versions of xenix
14441 have a broken uname(). If you don't really know whether your xenix is old
14442 enough to have a broken system call, use the default answer.
14447 "$define") dflt=n;;
14449 rp='Is your uname() broken?'
14452 n*) d_uname="$define"; call=uname;;
14455 echo 'uname() found.' >&4
14462 case "$d_gethname" in
14463 '') d_gethname="$undef";;
14466 '') d_uname="$undef";;
14468 case "$d_uname$d_gethname" in
14473 Every now and then someone has a $call() that lies about the hostname
14474 but can't be fixed for political or economic reasons. If you wish, I can
14475 pretend $call() isn't there and maybe compute hostname at run-time
14476 thanks to the '$phostname' command.
14479 rp="Shall I ignore $call() from now on?"
14482 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14485 case "$phostname" in
14486 '') aphostname='';;
14487 *) case "$aphostname" in
14489 *) set X $phostname
14493 file=`./loc $file $file $pth`
14494 aphostname=`echo $file $*`
14499 case "$d_uname$d_gethname" in
14502 case "$phostname" in
14504 echo "There will be no way for $package to get your hostname." >&4;;
14506 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14510 case "$d_phostname" in
14511 '') d_phostname="$undef";;
14514 : see if gethostbyaddr_r exists
14515 set gethostbyaddr_r d_gethostbyaddr_r
14517 case "$d_gethostbyaddr_r" in
14519 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14520 case "$d_gethostbyaddr_r_proto:$usethreads" in
14521 ":define") d_gethostbyaddr_r_proto=define
14522 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14526 case "$d_gethostbyaddr_r_proto" in
14528 case "$gethostbyaddr_r_proto" in
14529 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14530 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14532 case "$gethostbyaddr_r_proto" in
14533 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14534 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14536 case "$gethostbyaddr_r_proto" in
14537 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14538 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14540 case "$gethostbyaddr_r_proto" in
14541 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14542 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14544 case "$gethostbyaddr_r_proto" in
14545 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14546 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14548 case "$gethostbyaddr_r_proto" in
14549 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14550 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14552 case "$gethostbyaddr_r_proto" in
14553 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14554 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14556 case "$gethostbyaddr_r_proto" in
14557 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14558 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14560 case "$gethostbyaddr_r_proto" in
14561 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14562 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14564 case "$gethostbyaddr_r_proto" in
14565 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14566 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14568 case "$gethostbyaddr_r_proto" in
14569 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14570 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14572 case "$gethostbyaddr_r_proto" in
14573 ''|0) d_gethostbyaddr_r=undef
14574 gethostbyaddr_r_proto=0
14575 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14576 * ) case "$gethostbyaddr_r_proto" in
14577 REENTRANT_PROTO*) ;;
14578 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14580 echo "Prototype: $try" ;;
14583 *) case "$usethreads" in
14584 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14586 d_gethostbyaddr_r=undef
14587 gethostbyaddr_r_proto=0
14591 *) gethostbyaddr_r_proto=0
14595 : see if gethostbyname_r exists
14596 set gethostbyname_r d_gethostbyname_r
14598 case "$d_gethostbyname_r" in
14600 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14601 case "$d_gethostbyname_r_proto:$usethreads" in
14602 ":define") d_gethostbyname_r_proto=define
14603 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14607 case "$d_gethostbyname_r_proto" in
14609 case "$gethostbyname_r_proto" in
14610 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14611 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14613 case "$gethostbyname_r_proto" in
14614 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14615 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14617 case "$gethostbyname_r_proto" in
14618 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14619 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14621 case "$gethostbyname_r_proto" in
14622 ''|0) d_gethostbyname_r=undef
14623 gethostbyname_r_proto=0
14624 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14625 * ) case "$gethostbyname_r_proto" in
14626 REENTRANT_PROTO*) ;;
14627 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14629 echo "Prototype: $try" ;;
14632 *) case "$usethreads" in
14633 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14635 d_gethostbyname_r=undef
14636 gethostbyname_r_proto=0
14640 *) gethostbyname_r_proto=0
14644 : see if gethostent_r exists
14645 set gethostent_r d_gethostent_r
14647 case "$d_gethostent_r" in
14649 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14650 case "$d_gethostent_r_proto:$usethreads" in
14651 ":define") d_gethostent_r_proto=define
14652 set d_gethostent_r_proto gethostent_r $hdrs
14656 case "$d_gethostent_r_proto" in
14658 case "$gethostent_r_proto" in
14659 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14660 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14662 case "$gethostent_r_proto" in
14663 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14664 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14666 case "$gethostent_r_proto" in
14667 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14668 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14670 case "$gethostent_r_proto" in
14671 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14672 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14674 case "$gethostent_r_proto" in
14675 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14676 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14678 case "$gethostent_r_proto" in
14679 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14680 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14682 case "$gethostent_r_proto" in
14683 ''|0) d_gethostent_r=undef
14684 gethostent_r_proto=0
14685 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14686 * ) case "$gethostent_r_proto" in
14687 REENTRANT_PROTO*) ;;
14688 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14690 echo "Prototype: $try" ;;
14693 *) case "$usethreads" in
14694 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14696 d_gethostent_r=undef
14697 gethostent_r_proto=0
14701 *) gethostent_r_proto=0
14705 : see if prototypes for various gethostxxx netdb.h functions are available
14707 set d_gethostprotos gethostent $i_netdb netdb.h
14710 : see if getitimer exists
14711 set getitimer d_getitimer
14714 : see if getlogin exists
14715 set getlogin d_getlogin
14718 : see if getlogin_r exists
14719 set getlogin_r d_getlogin_r
14721 case "$d_getlogin_r" in
14723 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14724 case "$d_getlogin_r_proto:$usethreads" in
14725 ":define") d_getlogin_r_proto=define
14726 set d_getlogin_r_proto getlogin_r $hdrs
14730 case "$d_getlogin_r_proto" in
14732 case "$getlogin_r_proto" in
14733 ''|0) try='int getlogin_r(char*, size_t);'
14734 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14736 case "$getlogin_r_proto" in
14737 ''|0) try='int getlogin_r(char*, int);'
14738 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14740 case "$getlogin_r_proto" in
14741 ''|0) try='char* getlogin_r(char*, size_t);'
14742 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14744 case "$getlogin_r_proto" in
14745 ''|0) try='char* getlogin_r(char*, int);'
14746 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14748 case "$getlogin_r_proto" in
14749 ''|0) d_getlogin_r=undef
14751 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14752 * ) case "$getlogin_r_proto" in
14753 REENTRANT_PROTO*) ;;
14754 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14756 echo "Prototype: $try" ;;
14759 *) case "$usethreads" in
14760 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14767 *) getlogin_r_proto=0
14771 : see if getmnt exists
14772 set getmnt d_getmnt
14775 : see if getmntent exists
14776 set getmntent d_getmntent
14779 : see if getnameinfo exists
14780 set getnameinfo d_getnameinfo
14783 : see if getnetbyaddr exists
14784 set getnetbyaddr d_getnbyaddr
14787 : see if getnetbyname exists
14788 set getnetbyname d_getnbyname
14791 : see if getnetent exists
14792 set getnetent d_getnent
14795 : see if getnetbyaddr_r exists
14796 set getnetbyaddr_r d_getnetbyaddr_r
14798 case "$d_getnetbyaddr_r" in
14800 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14801 case "$d_getnetbyaddr_r_proto:$usethreads" in
14802 ":define") d_getnetbyaddr_r_proto=define
14803 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14807 case "$d_getnetbyaddr_r_proto" in
14809 case "$getnetbyaddr_r_proto" in
14810 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14811 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14813 case "$getnetbyaddr_r_proto" in
14814 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14815 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14817 case "$getnetbyaddr_r_proto" in
14818 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14819 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14821 case "$getnetbyaddr_r_proto" in
14822 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14823 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14825 case "$getnetbyaddr_r_proto" in
14826 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14827 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14829 case "$getnetbyaddr_r_proto" in
14830 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14831 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14833 case "$getnetbyaddr_r_proto" in
14834 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14835 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14837 case "$getnetbyaddr_r_proto" in
14838 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14839 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14841 case "$getnetbyaddr_r_proto" in
14842 ''|0) d_getnetbyaddr_r=undef
14843 getnetbyaddr_r_proto=0
14844 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14845 * ) case "$getnetbyaddr_r_proto" in
14846 REENTRANT_PROTO*) ;;
14847 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14849 echo "Prototype: $try" ;;
14852 *) case "$usethreads" in
14853 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14855 d_getnetbyaddr_r=undef
14856 getnetbyaddr_r_proto=0
14860 *) getnetbyaddr_r_proto=0
14864 : see if getnetbyname_r exists
14865 set getnetbyname_r d_getnetbyname_r
14867 case "$d_getnetbyname_r" in
14869 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14870 case "$d_getnetbyname_r_proto:$usethreads" in
14871 ":define") d_getnetbyname_r_proto=define
14872 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14876 case "$d_getnetbyname_r_proto" in
14878 case "$getnetbyname_r_proto" in
14879 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14880 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14882 case "$getnetbyname_r_proto" in
14883 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14884 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14886 case "$getnetbyname_r_proto" in
14887 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14888 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14890 case "$getnetbyname_r_proto" in
14891 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14892 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14894 case "$getnetbyname_r_proto" in
14895 ''|0) d_getnetbyname_r=undef
14896 getnetbyname_r_proto=0
14897 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14898 * ) case "$getnetbyname_r_proto" in
14899 REENTRANT_PROTO*) ;;
14900 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14902 echo "Prototype: $try" ;;
14905 *) case "$usethreads" in
14906 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14908 d_getnetbyname_r=undef
14909 getnetbyname_r_proto=0
14913 *) getnetbyname_r_proto=0
14917 : see if getnetent_r exists
14918 set getnetent_r d_getnetent_r
14920 case "$d_getnetent_r" in
14922 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14923 case "$d_getnetent_r_proto:$usethreads" in
14924 ":define") d_getnetent_r_proto=define
14925 set d_getnetent_r_proto getnetent_r $hdrs
14929 case "$d_getnetent_r_proto" in
14931 case "$getnetent_r_proto" in
14932 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14933 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14935 case "$getnetent_r_proto" in
14936 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14937 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14939 case "$getnetent_r_proto" in
14940 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14941 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14943 case "$getnetent_r_proto" in
14944 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14945 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14947 case "$getnetent_r_proto" in
14948 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14949 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14951 case "$getnetent_r_proto" in
14952 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14953 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14955 case "$getnetent_r_proto" in
14956 ''|0) d_getnetent_r=undef
14957 getnetent_r_proto=0
14958 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14959 * ) case "$getnetent_r_proto" in
14960 REENTRANT_PROTO*) ;;
14961 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14963 echo "Prototype: $try" ;;
14966 *) case "$usethreads" in
14967 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14969 d_getnetent_r=undef
14970 getnetent_r_proto=0
14974 *) getnetent_r_proto=0
14978 : see if prototypes for various getnetxxx netdb.h functions are available
14980 set d_getnetprotos getnetent $i_netdb netdb.h
14983 : see if getpagesize exists
14984 set getpagesize d_getpagsz
14987 : Optional checks for getprotobyname and getprotobynumber
14989 : see if getprotobyname exists
14990 set getprotobyname d_getpbyname
14993 : see if getprotobynumber exists
14994 set getprotobynumber d_getpbynumber
14997 : see if getprotoent exists
14998 set getprotoent d_getpent
15001 : see if getpgid exists
15002 set getpgid d_getpgid
15005 : see if getpgrp2 exists
15006 set getpgrp2 d_getpgrp2
15009 : see if getppid exists
15010 set getppid d_getppid
15013 : see if getpriority exists
15014 set getpriority d_getprior
15017 : see if getprotobyname_r exists
15018 set getprotobyname_r d_getprotobyname_r
15020 case "$d_getprotobyname_r" in
15022 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15023 case "$d_getprotobyname_r_proto:$usethreads" in
15024 ":define") d_getprotobyname_r_proto=define
15025 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15029 case "$d_getprotobyname_r_proto" in
15031 case "$getprotobyname_r_proto" in
15032 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15033 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15035 case "$getprotobyname_r_proto" in
15036 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15037 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15039 case "$getprotobyname_r_proto" in
15040 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15041 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15043 case "$getprotobyname_r_proto" in
15044 ''|0) d_getprotobyname_r=undef
15045 getprotobyname_r_proto=0
15046 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15047 * ) case "$getprotobyname_r_proto" in
15048 REENTRANT_PROTO*) ;;
15049 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15051 echo "Prototype: $try" ;;
15054 *) case "$usethreads" in
15055 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15057 d_getprotobyname_r=undef
15058 getprotobyname_r_proto=0
15062 *) getprotobyname_r_proto=0
15066 : see if getprotobynumber_r exists
15067 set getprotobynumber_r d_getprotobynumber_r
15069 case "$d_getprotobynumber_r" in
15071 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15072 case "$d_getprotobynumber_r_proto:$usethreads" in
15073 ":define") d_getprotobynumber_r_proto=define
15074 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15078 case "$d_getprotobynumber_r_proto" in
15080 case "$getprotobynumber_r_proto" in
15081 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15082 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15084 case "$getprotobynumber_r_proto" in
15085 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15086 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15088 case "$getprotobynumber_r_proto" in
15089 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15090 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15092 case "$getprotobynumber_r_proto" in
15093 ''|0) d_getprotobynumber_r=undef
15094 getprotobynumber_r_proto=0
15095 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15096 * ) case "$getprotobynumber_r_proto" in
15097 REENTRANT_PROTO*) ;;
15098 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15100 echo "Prototype: $try" ;;
15103 *) case "$usethreads" in
15104 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15106 d_getprotobynumber_r=undef
15107 getprotobynumber_r_proto=0
15111 *) getprotobynumber_r_proto=0
15115 : see if getprotoent_r exists
15116 set getprotoent_r d_getprotoent_r
15118 case "$d_getprotoent_r" in
15120 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15121 case "$d_getprotoent_r_proto:$usethreads" in
15122 ":define") d_getprotoent_r_proto=define
15123 set d_getprotoent_r_proto getprotoent_r $hdrs
15127 case "$d_getprotoent_r_proto" in
15129 case "$getprotoent_r_proto" in
15130 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15131 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15133 case "$getprotoent_r_proto" in
15134 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15135 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15137 case "$getprotoent_r_proto" in
15138 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15139 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15141 case "$getprotoent_r_proto" in
15142 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15143 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15145 case "$getprotoent_r_proto" in
15146 ''|0) d_getprotoent_r=undef
15147 getprotoent_r_proto=0
15148 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15149 * ) case "$getprotoent_r_proto" in
15150 REENTRANT_PROTO*) ;;
15151 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15153 echo "Prototype: $try" ;;
15156 *) case "$usethreads" in
15157 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15159 d_getprotoent_r=undef
15160 getprotoent_r_proto=0
15164 *) getprotoent_r_proto=0
15168 : see if prototypes for various getprotoxxx netdb.h functions are available
15170 set d_getprotoprotos getprotoent $i_netdb netdb.h
15173 : see if getprpwnam exists
15174 set getprpwnam d_getprpwnam
15177 : see if getpwent exists
15178 set getpwent d_getpwent
15181 : see if getpwent_r exists
15182 set getpwent_r d_getpwent_r
15184 case "$d_getpwent_r" in
15186 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15187 case "$d_getpwent_r_proto:$usethreads" in
15188 ":define") d_getpwent_r_proto=define
15189 set d_getpwent_r_proto getpwent_r $hdrs
15193 case "$d_getpwent_r_proto" in
15195 case "$getpwent_r_proto" in
15196 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15197 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15199 case "$getpwent_r_proto" in
15200 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15201 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15203 case "$getpwent_r_proto" in
15204 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15205 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15207 case "$getpwent_r_proto" in
15208 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15209 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15211 case "$getpwent_r_proto" in
15212 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15213 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15215 case "$getpwent_r_proto" in
15216 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15217 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15219 case "$getpwent_r_proto" in
15220 ''|0) d_getpwent_r=undef
15222 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15223 * ) case "$getpwent_r_proto" in
15224 REENTRANT_PROTO*) ;;
15225 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15227 echo "Prototype: $try" ;;
15230 *) case "$usethreads" in
15231 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15238 *) getpwent_r_proto=0
15242 : see if getpwnam_r exists
15243 set getpwnam_r d_getpwnam_r
15245 case "$d_getpwnam_r" in
15247 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15248 case "$d_getpwnam_r_proto:$usethreads" in
15249 ":define") d_getpwnam_r_proto=define
15250 set d_getpwnam_r_proto getpwnam_r $hdrs
15254 case "$d_getpwnam_r_proto" in
15256 case "$getpwnam_r_proto" in
15257 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15258 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15260 case "$getpwnam_r_proto" in
15261 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15262 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15264 case "$getpwnam_r_proto" in
15265 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15266 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15268 case "$getpwnam_r_proto" in
15269 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15270 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15272 case "$getpwnam_r_proto" in
15273 ''|0) d_getpwnam_r=undef
15275 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15276 * ) case "$getpwnam_r_proto" in
15277 REENTRANT_PROTO*) ;;
15278 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15280 echo "Prototype: $try" ;;
15283 *) case "$usethreads" in
15284 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15291 *) getpwnam_r_proto=0
15295 : see if getpwuid_r exists
15296 set getpwuid_r d_getpwuid_r
15298 case "$d_getpwuid_r" in
15300 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15301 case "$d_getpwuid_r_proto:$usethreads" in
15302 ":define") d_getpwuid_r_proto=define
15303 set d_getpwuid_r_proto getpwuid_r $hdrs
15307 case "$d_getpwuid_r_proto" in
15309 case "$getpwuid_r_proto" in
15310 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15311 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15313 case "$getpwuid_r_proto" in
15314 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15315 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15317 case "$getpwuid_r_proto" in
15318 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15319 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15321 case "$getpwuid_r_proto" in
15322 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15323 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15325 case "$getpwuid_r_proto" in
15326 ''|0) d_getpwuid_r=undef
15328 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15329 * ) case "$getpwuid_r_proto" in
15330 REENTRANT_PROTO*) ;;
15331 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15333 echo "Prototype: $try" ;;
15336 *) case "$usethreads" in
15337 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15344 *) getpwuid_r_proto=0
15348 : Optional checks for getsbyname and getsbyport
15350 : see if getservbyname exists
15351 set getservbyname d_getsbyname
15354 : see if getservbyport exists
15355 set getservbyport d_getsbyport
15358 : see if getservent exists
15359 set getservent d_getsent
15362 : see if getservbyname_r exists
15363 set getservbyname_r d_getservbyname_r
15365 case "$d_getservbyname_r" in
15367 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15368 case "$d_getservbyname_r_proto:$usethreads" in
15369 ":define") d_getservbyname_r_proto=define
15370 set d_getservbyname_r_proto getservbyname_r $hdrs
15374 case "$d_getservbyname_r_proto" in
15376 case "$getservbyname_r_proto" in
15377 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15378 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15380 case "$getservbyname_r_proto" in
15381 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15382 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15384 case "$getservbyname_r_proto" in
15385 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15386 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15388 case "$getservbyname_r_proto" in
15389 ''|0) d_getservbyname_r=undef
15390 getservbyname_r_proto=0
15391 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15392 * ) case "$getservbyname_r_proto" in
15393 REENTRANT_PROTO*) ;;
15394 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15396 echo "Prototype: $try" ;;
15399 *) case "$usethreads" in
15400 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15402 d_getservbyname_r=undef
15403 getservbyname_r_proto=0
15407 *) getservbyname_r_proto=0
15411 : see if getservbyport_r exists
15412 set getservbyport_r d_getservbyport_r
15414 case "$d_getservbyport_r" in
15416 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15417 case "$d_getservbyport_r_proto:$usethreads" in
15418 ":define") d_getservbyport_r_proto=define
15419 set d_getservbyport_r_proto getservbyport_r $hdrs
15423 case "$d_getservbyport_r_proto" in
15425 case "$getservbyport_r_proto" in
15426 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15427 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15429 case "$getservbyport_r_proto" in
15430 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15431 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15433 case "$getservbyport_r_proto" in
15434 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15435 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15437 case "$getservbyport_r_proto" in
15438 ''|0) d_getservbyport_r=undef
15439 getservbyport_r_proto=0
15440 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15441 * ) case "$getservbyport_r_proto" in
15442 REENTRANT_PROTO*) ;;
15443 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15445 echo "Prototype: $try" ;;
15448 *) case "$usethreads" in
15449 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15451 d_getservbyport_r=undef
15452 getservbyport_r_proto=0
15456 *) getservbyport_r_proto=0
15460 : see if getservent_r exists
15461 set getservent_r d_getservent_r
15463 case "$d_getservent_r" in
15465 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15466 case "$d_getservent_r_proto:$usethreads" in
15467 ":define") d_getservent_r_proto=define
15468 set d_getservent_r_proto getservent_r $hdrs
15472 case "$d_getservent_r_proto" in
15474 case "$getservent_r_proto" in
15475 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15476 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15478 case "$getservent_r_proto" in
15479 ''|0) try='int getservent_r(struct servent*, char*, int);'
15480 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15482 case "$getservent_r_proto" in
15483 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15484 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15486 case "$getservent_r_proto" in
15487 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15488 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15490 case "$getservent_r_proto" in
15491 ''|0) d_getservent_r=undef
15492 getservent_r_proto=0
15493 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15494 * ) case "$getservent_r_proto" in
15495 REENTRANT_PROTO*) ;;
15496 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15498 echo "Prototype: $try" ;;
15501 *) case "$usethreads" in
15502 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15504 d_getservent_r=undef
15505 getservent_r_proto=0
15509 *) getservent_r_proto=0
15513 : see if prototypes for various getservxxx netdb.h functions are available
15515 set d_getservprotos getservent $i_netdb netdb.h
15518 : see if getspnam exists
15519 set getspnam d_getspnam
15522 : see if this is a shadow.h system
15523 set shadow.h i_shadow
15526 : see if getspnam_r exists
15527 set getspnam_r d_getspnam_r
15529 case "$d_getspnam_r" in
15531 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15532 case "$d_getspnam_r_proto:$usethreads" in
15533 ":define") d_getspnam_r_proto=define
15534 set d_getspnam_r_proto getspnam_r $hdrs
15538 case "$d_getspnam_r_proto" in
15540 case "$getspnam_r_proto" in
15541 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15542 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15544 case "$getspnam_r_proto" in
15545 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15546 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15548 case "$getspnam_r_proto" in
15549 ''|0) d_getspnam_r=undef
15551 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15552 * ) case "$getspnam_r_proto" in
15553 REENTRANT_PROTO*) ;;
15554 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15556 echo "Prototype: $try" ;;
15559 *) case "$usethreads" in
15560 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15567 *) getspnam_r_proto=0
15571 : see if gettimeofday or ftime exists
15572 set gettimeofday d_gettimeod
15574 case "$d_gettimeod" in
15580 val="$undef"; set d_ftime; eval $setvar
15583 case "$d_gettimeod$d_ftime" in
15586 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15590 : see if gmtime_r exists
15591 set gmtime_r d_gmtime_r
15593 case "$d_gmtime_r" in
15595 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15596 case "$d_gmtime_r_proto:$usethreads" in
15597 ":define") d_gmtime_r_proto=define
15598 set d_gmtime_r_proto gmtime_r $hdrs
15602 case "$d_gmtime_r_proto" in
15604 case "$gmtime_r_proto" in
15605 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15606 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15608 case "$gmtime_r_proto" in
15609 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15610 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15612 case "$gmtime_r_proto" in
15613 ''|0) d_gmtime_r=undef
15615 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15616 * ) case "$gmtime_r_proto" in
15617 REENTRANT_PROTO*) ;;
15618 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15620 echo "Prototype: $try" ;;
15623 *) case "$usethreads" in
15624 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15631 *) gmtime_r_proto=0
15635 : see if hasmntopt exists
15636 set hasmntopt d_hasmntopt
15639 : see if this is a netinet/in.h or sys/in.h system
15640 set netinet/in.h i_niin sys/in.h i_sysin
15643 : see if arpa/inet.h has to be included
15644 set arpa/inet.h i_arpainet
15647 : see if htonl --and friends-- exists
15652 : Maybe they are macros.
15655 $cat >htonl.c <<EOM
15657 #include <sys/types.h>
15658 #$i_niin I_NETINET_IN
15660 #$i_arpainet I_ARPA_INET
15661 #ifdef I_NETINET_IN
15662 #include <netinet/in.h>
15665 #include <sys/in.h>
15668 #include <arpa/inet.h>
15671 printf("Defined as a macro.");
15674 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15675 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15677 echo "But it seems to be defined as a macro." >&4
15685 : see if hypot exists
15689 : see if ilogb exists
15693 : see if ilogbl exists
15694 set ilogbl d_ilogbl
15699 if set index val -f; eval $csym; $val; then
15700 if set strchr val -f d_strchr; eval $csym; $val; then
15701 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15704 echo "strchr() found." >&4
15708 echo "index() found." >&4
15713 echo "index() found." >&4
15716 if set strchr val -f d_strchr; eval $csym; $val; then
15719 echo "strchr() found." >&4
15721 echo "No index() or strchr() found!" >&4
15726 set d_strchr; eval $setvar
15728 set d_index; eval $setvar
15730 : check whether inet_aton exists
15731 set inet_aton d_inetaton
15734 : see if inet_ntop exists
15735 set inet_ntop d_inetntop
15738 : see if inet_pton exists
15739 set inet_pton d_inetpton
15744 $cat >isascii.c <<EOCP
15747 #$i_stdlib I_STDLIB
15749 #include <stdlib.h>
15760 if eval $compile; then
15761 echo "isascii() found." >&4
15764 echo "isascii() NOT found." >&4
15773 $cat >isblank.c <<'EOCP'
15784 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15785 echo "isblank() found." >&4
15788 echo "isblank() NOT found." >&4
15795 : check for isfinite
15796 echo "Checking to see if you have isfinite..." >&4
15802 int main() { return isfinite(0.0); }
15805 if eval $compile; then
15807 echo "You have isfinite."
15810 echo "You do not have isfinite."
15816 : see if isfinitel exists
15817 set isfinitel d_isfinitel
15821 echo "Checking to see if you have isinf..." >&4
15827 int main() { return isinf(0.0); }
15830 if eval $compile; then
15832 echo "You have isinf."
15835 echo "You do not have isinf."
15841 : see if isinfl exists
15842 set isinfl d_isinfl
15846 echo "Checking to see if you have isless..." >&4
15852 int main() { return isless(0.0); }
15855 if eval $compile; then
15857 echo "You have isless."
15860 echo "You do not have isless."
15867 echo "Checking to see if you have isnan..." >&4
15873 int main() { return isnan(0.0); }
15876 if eval $compile; then
15878 echo "You have isnan."
15881 echo "You do not have isnan."
15887 : see if isnanl exists
15888 set isnanl d_isnanl
15891 : check for isnormal
15892 echo "Checking to see if you have isnormal..." >&4
15898 int main() { return isnormal(0.0); }
15901 if eval $compile; then
15903 echo "You have isnormal."
15906 echo "You do not have isnormal."
15916 : see if j0l exists
15920 : see if killpg exists
15921 set killpg d_killpg
15924 : see if localeconv exists
15925 set localeconv d_locconv
15928 : see if libc has the POSIX.1-2008 currency locale rules
15929 case "$d_locconv:$d_lc_monetary_2008" in
15932 #include <locale.h>
15934 struct lconv *lc = localeconv();
15935 char int_p_cs_precedes = lc->int_p_cs_precedes;
15940 if eval $compile; then
15941 d_lc_monetary_2008="$define"
15943 d_lc_monetary_2008="$undef"
15949 : see if lchown exists
15951 $cat > try.c <<'EOCP'
15952 /* System header to define __stub macros and hopefully few prototypes,
15953 which can conflict with char lchown(); below. */
15954 #include <assert.h>
15955 /* Override any gcc2 internal prototype to avoid an error. */
15956 /* We use char because int might match the return type of a gcc2
15957 builtin and then its argument prototype would still apply. */
15960 /* The GNU C library defines this for functions which it implements
15961 to always fail with ENOSYS. Some functions are actually named
15962 something starting with __ and the normal name is an alias. */
15963 #if defined (__stub_lchown) || defined (__stub___lchown)
15971 if eval $compile; then
15972 $echo "lchown() found." >&4
15975 $echo "lchown() NOT found." >&4
15981 : See if number of significant digits in a double precision number is known
15983 $cat >ldbl_dig.c <<EOM
15984 #$i_limits I_LIMITS
15987 #include <limits.h>
15993 printf("Contains LDBL_DIG");
15996 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15997 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15998 echo "LDBL_DIG found." >&4
16001 echo "LDBL_DIG NOT found." >&4
16008 : see if lgamma exists
16009 set lgamma d_lgamma
16012 : see if lgamma_r exists
16013 set lgamma_r d_lgamma_r
16016 : check to see if math.h defines _LIB_VERSION
16017 d_libm_lib_version="$undef"
16021 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16023 #include <unistd.h>
16025 int main (int argc, char *argv[])
16027 printf ("%d\n", _LIB_VERSION);
16032 if eval $compile; then
16034 echo "Yes, it does ($foo)" >&4
16035 d_libm_lib_version="$define"
16037 echo "No, it does not (probably harmless)" >&4
16044 : see if link exists
16048 : see if llrint exists
16049 set llrint d_llrint
16052 : see if llrintl exists
16053 set llrintl d_llrintl
16056 : see if llround exists
16057 set llround d_llround
16060 : see if llroundl exists
16061 set llroundl d_llroundl
16064 : see if localtime_r exists
16065 set localtime_r d_localtime_r
16067 case "$d_localtime_r" in
16069 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16070 case "$d_localtime_r_proto:$usethreads" in
16071 ":define") d_localtime_r_proto=define
16072 set d_localtime_r_proto localtime_r $hdrs
16076 case "$d_localtime_r_proto" in
16078 case "$localtime_r_proto" in
16079 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16080 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16082 case "$localtime_r_proto" in
16083 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16084 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16086 case "$localtime_r_proto" in
16087 ''|0) d_localtime_r=undef
16088 localtime_r_proto=0
16089 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16090 * ) case "$localtime_r_proto" in
16091 REENTRANT_PROTO*) ;;
16092 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16094 echo "Prototype: $try" ;;
16097 *) case "$usethreads" in
16098 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16100 d_localtime_r=undef
16101 localtime_r_proto=0
16105 *) localtime_r_proto=0
16109 : see if localtime_r calls tzset
16110 case "$localtime_r_proto" in
16113 /* Does our libc's localtime_r call tzset ?
16114 * return 0 if so, 1 otherwise.
16116 #$i_systypes I_SYS_TYPES
16117 #$i_unistd I_UNISTD
16119 #$i_stdlib I_STDLIB
16120 #$i_string I_STRING
16121 #$i_malloc I_MALLOC
16123 # include <sys/types.h>
16126 # include <unistd.h>
16132 #include <stdlib.h>
16135 # include <string.h>
16137 # include <strings.h>
16140 # include <malloc.h>
16144 time_t t = time(0L);
16145 char w_tz[]="TZ" "=GMT+5",
16146 e_tz[]="TZ" "=GMT-5",
16147 *tz_e = (char*)malloc(16),
16148 *tz_w = (char*)malloc(16);
16149 struct tm tm_e, tm_w;
16150 memset(&tm_e,'\0',sizeof(struct tm));
16151 memset(&tm_w,'\0',sizeof(struct tm));
16156 localtime_r(&t, &tm_e);
16159 localtime_r(&t, &tm_w);
16161 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16167 if eval $compile; then
16168 if $run ./try; then
16169 d_localtime_r_needs_tzset=undef;
16171 d_localtime_r_needs_tzset=define;
16174 d_localtime_r_needs_tzset=undef;
16178 d_localtime_r_needs_tzset=undef;
16183 : see if lockf exists
16187 : see if log1p exists
16191 : see if log2 exists
16195 : see if logb exists
16199 : see if lrint exists
16203 : see if lrintl exists
16204 set lrintl d_lrintl
16207 : see if lround exists
16208 set lround d_lround
16211 : see if lroundl exists
16212 set lroundl d_lroundl
16215 : see if prototype for lseek is available
16217 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16220 : see if lstat exists
16224 : see if madvise exists
16225 set madvise d_madvise
16228 : see if malloc_size exists
16229 set malloc_size d_malloc_size
16232 : see if malloc_size_good exists
16233 set malloc_good_size d_malloc_good_size
16236 : see if mblen exists
16240 : see if mbstowcs exists
16241 set mbstowcs d_mbstowcs
16244 : see if mbtowc exists
16245 set mbtowc d_mbtowc
16248 : see if memchr exists
16249 set memchr d_memchr
16252 : see if memcmp exists
16253 set memcmp d_memcmp
16256 : see if memcpy exists
16257 set memcpy d_memcpy
16260 : see if memmove exists
16261 set memmove d_memmove
16264 : see if memset exists
16265 set memset d_memset
16268 : see if mkdir exists
16272 : see if mkdtemp exists
16273 set mkdtemp d_mkdtemp
16276 : see if mkfifo exists
16277 set mkfifo d_mkfifo
16280 : see if mkstemp exists
16281 set mkstemp d_mkstemp
16284 : see if mkstemps exists
16285 set mkstemps d_mkstemps
16288 : see if mktime exists
16289 set mktime d_mktime
16292 : see if this is a sys/mman.h system
16293 set sys/mman.h i_sysmman
16296 : see if mmap exists
16299 : see what shmat returns
16300 : default to something harmless
16302 case "$i_sysmman$d_mmap" in
16304 $cat >mmap.c <<'END'
16305 #include <sys/mman.h>
16308 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16313 echo "and it returns ($mmaptype)." >&4
16319 : see if sqrtl exists
16323 : see if scalbnl exists
16324 set scalbnl d_scalbnl
16327 : see if truncl exists
16328 set truncl d_truncl
16331 : see if modfl exists
16335 : see if prototype for modfl is available
16337 set d_modflproto modfl $i_math math.h
16340 d_modfl_pow32_bug="$undef"
16342 case "$d_longdbl$d_modfl" in
16345 Checking to see whether your modfl() is okay for large values...
16351 if $test "X$d_modflproto" != "X$define"; then
16352 $cat >>try.c <<EOCP
16353 /* Sigh. many current glibcs provide the function, but do not prototype it. */
16354 long double modfl (long double, long double *);
16357 $cat >>try.c <<EOCP
16359 long double nv = 4294967303.15;
16365 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
16369 case "$osname:$gccversion" in
16370 aix:) saveccflags="$ccflags"
16371 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
16374 if eval $compile; then
16377 *" 4294967303.150000 1.150000 4294967302.000000")
16378 echo >&4 "Your modfl() is broken for large values."
16379 d_modfl_pow32_bug="$define"
16381 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
16385 *" 4294967303.150000 0.150000 4294967303.000000")
16386 echo >&4 "Your modfl() seems okay for large values."
16388 *) echo >&4 "I don't understand your modfl() at all."
16394 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
16397 case "$osname:$gccversion" in
16398 aix:) ccflags="$saveccflags" ;; # restore
16403 if $test "$uselongdouble" = "$define"; then
16405 if $test "$d_sqrtl" != "$define"; then
16406 message="$message sqrtl"
16408 if $test "$d_modfl" != "$define"; then
16409 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16410 echo "You have both truncl and copysignl, so I can emulate modfl."
16412 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16413 echo "You have both aintl and copysignl, so I can emulate modfl."
16415 message="$message modfl"
16419 if $test "$d_frexpl" != "$define"; then
16420 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16421 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16423 message="$message frexpl"
16426 if $test "$d_ldexpl" != "$define"; then
16427 message="$message ldexpl"
16430 if $test "$message" != ""; then
16433 *** You requested the use of long doubles but you do not seem to have
16434 *** the following mathematical functions needed for long double support:
16436 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16437 *** Cannot continue, aborting.
16445 : see if mprotect exists
16446 set mprotect d_mprotect
16449 : see if msgctl exists
16450 set msgctl d_msgctl
16453 : see if msgget exists
16454 set msgget d_msgget
16457 : see if msgsnd exists
16458 set msgsnd d_msgsnd
16461 : see if msgrcv exists
16462 set msgrcv d_msgrcv
16465 : see how much of the 'msg*(2)' library is present.
16468 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16469 *"$undef"*) h_msg=false;;
16473 case "`ipcs 2>&1`" in
16474 "SVID messages"*"not configured"*)
16475 echo "Your $osname does not have the msg*(2) configured." >&4
16478 set msgctl d_msgctl
16480 set msgget d_msgget
16482 set msgsnd d_msgsnd
16484 set msgrcv d_msgrcv
16490 : we could also check for sys/ipc.h ...
16491 if $h_msg && $test `./findhdr sys/msg.h`; then
16492 echo "You have the full msg*(2) library." >&4
16495 echo "You don't have the full msg*(2) library." >&4
16501 : Check for msghdr_s
16503 echo "Checking to see if your system supports struct msghdr..." >&4
16504 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16506 case "$d_msghdr_s" in
16507 "$define") echo "Yes, it does." ;;
16508 *) echo "No, it doesn't." ;;
16512 : see if msync exists
16516 : see if munmap exists
16517 set munmap d_munmap
16520 : see if nan exists
16524 : see if nearbyint exists
16525 set nearbyint d_nearbyint
16528 : see if nextafter exists
16529 set nextafter d_nextafter
16532 : see if nexttoward exists
16533 set nexttoward d_nexttoward
16536 : see if nice exists
16540 : see if this is a langinfo.h system
16541 set langinfo.h i_langinfo
16544 : see if nl_langinfo exists
16545 set nl_langinfo d_nl_langinfo
16548 : see if this is a quadmath.h system
16549 set quadmath.h i_quadmath
16552 : check for volatile keyword
16554 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16555 $cat >try.c <<'EOCP'
16558 typedef struct _goo_struct goo_struct;
16559 goo_struct * volatile goo = ((goo_struct *)0);
16560 struct _goo_struct {
16565 typedef unsigned short foo_t;
16566 char *volatile foo;
16568 volatile foo_t blech;
16572 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16574 echo "Yup, it does."
16577 echo "Nope, it doesn't."
16583 : Check basic sizes
16585 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16587 case "$use64bitint:$d_quad:$quadtype" in
16590 uvtype="$uquadtype"
16595 uvtype="unsigned long"
16601 case "$uselongdouble:$d_longdbl" in
16603 nvtype="long double"
16604 nvsize=$longdblsize
16611 case "$usequadmath:$i_quadmath" in
16613 nvtype="__float128"
16619 *** You requested the use of the quadmath library, but you
16620 *** do not seem to have the quadmath library installed.
16621 *** Cannot continue, aborting.
16627 define:*) $cat <<EOM >&4
16629 *** You requested the use of the quadmath library, but you
16630 *** do not seem to have the required header, <quadmath.h>.
16632 case "$gccversion" in
16635 *** Your gcc looks a bit old:
16641 *** You are not running a gcc.
16646 *** For the quadmath library you need at least gcc 4.6.
16647 *** Cannot continue, aborting.
16653 $echo "(IV will be "$ivtype", $ivsize bytes)"
16654 $echo "(UV will be "$uvtype", $uvsize bytes)"
16655 $echo "(NV will be "$nvtype", $nvsize bytes)"
16658 #$i_inttypes I_INTTYPES
16660 #include <inttypes.h>
16665 int8_t i = INT8_MAX;
16666 uint8_t u = UINT8_MAX;
16667 printf("int8_t\n");
16670 int16_t i = INT16_MAX;
16671 uint16_t u = UINT16_MAX;
16672 printf("int16_t\n");
16675 int32_t i = INT32_MAX;
16676 uint32_t u = UINT32_MAX;
16677 printf("int32_t\n");
16682 i8type="signed char"
16683 u8type="unsigned char"
16688 '') case "$shortsize" in
16690 u16type="unsigned short"
16698 '') set try -DINT16
16699 if eval $compile; then
16700 case "`$run ./try`" in
16712 '') if $test $shortsize -ge 2; then
16714 u16type="unsigned short"
16722 '') case "$longsize" in
16724 u32type="unsigned long"
16728 *) case "$intsize" in
16730 u32type="unsigned int"
16740 '') set try -DINT32
16741 if eval $compile; then
16742 case "`$run ./try`" in
16754 '') if $test $intsize -ge 4; then
16756 u32type="unsigned int"
16764 '') case "$d_quad:$quadtype" in
16766 i64type="$quadtype"
16767 u64type="$uquadtype"
16775 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16776 : volatile so that the compiler has to store it out to memory.
16777 if test X"$d_volatile" = X"$define"; then
16782 #$i_stdlib I_STDLIB
16784 #include <stdlib.h>
16786 #include <sys/types.h>
16787 #include <signal.h>
16789 $volatile int bletched = 0;
16790 $signal_t blech(int s) { bletched = 1; }
16795 int n = 8 * $uvsize;
16798 signal(SIGFPE, blech);
16801 for (i = 0; i < n; i++) {
16802 u = u << 1 | ($uvtype)1;
16804 if (($uvtype)d != u)
16808 d = ($nvtype)(u - 1);
16809 if (($uvtype)d != (u - 1))
16816 printf("%d\n", ((i == n) ? -n : i));
16822 d_nv_preserves_uv="$undef"
16823 if eval $compile; then
16824 nv_preserves_uv_bits="`$run ./try`"
16826 case "$nv_preserves_uv_bits" in
16828 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16829 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16830 d_nv_preserves_uv="$define"
16832 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16833 d_nv_preserves_uv="$undef" ;;
16834 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16835 nv_preserves_uv_bits="0" ;;
16839 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16840 : volatile so that the compiler has to store it out to memory.
16841 if test X"$d_volatile" = X"$define"; then
16847 typedef $nvtype NV;
16854 while(count < 256) {
16855 $volatile NV up = value + 1.0;
16856 $volatile NV negated = -value;
16857 $volatile NV down = negated - 1.0;
16858 $volatile NV got_up = up - value;
16859 int up_good = got_up == 1.0;
16860 int got_down = down - negated;
16861 int down_good = got_down == -1.0;
16863 if (down_good != up_good) {
16865 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16866 up_good, (double) got_up, down_good, (double) got_down,
16867 count, (double) value);
16874 fputs("256.0", stdout);
16877 fputs("2.0", stdout);
16883 fputs("*", stdout);
16889 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16890 count, (double) value);
16896 nv_overflows_integers_at='0'
16897 if eval $compile; then
16903 The largest integer your NVs can preserve is equal to $xxx
16905 nv_overflows_integers_at="$xxx"
16908 Cannot determine the largest integer value your NVs can hold, unexpected output
16915 Cannot determine the largest integer value your NVs can hold
16922 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16923 : volatile so that the compiler has to store it out to memory.
16924 if test X"$d_volatile" = X"$define"; then
16929 #$i_stdlib I_STDLIB
16931 #include <stdlib.h>
16933 #$i_string I_STRING
16935 # include <string.h>
16937 # include <strings.h>
16939 #include <sys/types.h>
16940 #include <signal.h>
16942 $volatile int bletched = 0;
16943 $signal_t blech(int s) { bletched = 1; }
16946 int checkit($nvtype d, char *where) {
16947 unsigned char *p = (char *)&d;
16948 unsigned char *end = p + sizeof(d);
16958 printf("No - %s: 0x", where);
16960 printf ("%02X", *p++);
16965 int main(int argc, char **argv) {
16968 fail += checkit(d, "0.0");
16970 /* The compiler shouldn't be assuming that bletched is 0 */
16973 fail += checkit(d, "bleched");
16976 signal(SIGFPE, blech);
16979 /* Paranoia - the compiler should have no way of knowing that ANSI says
16980 that argv[argc] will always be NULL. Actually, if it did assume this it
16981 would be buggy, as this is C and main() can be called from elsewhere in
16983 d = argv[argc] ? 1 : 0;
16986 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16989 fail += checkit(d, "ternary");
16991 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16994 printf("No - memset doesn't give 0.0\n");
16995 /* This might just blow up: */
16996 printf("(gives %g)\n", d);
17002 printf("No - something bleched\n");
17007 printf("No - %d fail(s)\n", fail);
17016 d_nv_zero_is_allbits_zero="$undef"
17017 if eval $compile; then
17023 0.0 is represented as all bits zero in memory
17025 d_nv_zero_is_allbits_zero="$define"
17028 0.0 is not represented as all bits zero in memory
17030 d_nv_zero_is_allbits_zero="$undef"
17035 0.0 is not represented as all bits zero in memory
17037 d_nv_zero_is_allbits_zero="$undef"
17043 : check for off64_t
17045 echo "Checking to see if you have off64_t..." >&4
17047 #include <sys/types.h>
17048 #include <unistd.h>
17049 int main() { off64_t x = 7; }
17052 if eval $compile; then
17054 echo "You have off64_t."
17057 echo "You do not have off64_t."
17058 case "$lseeksize" in
17059 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17066 : how to create joinable pthreads
17067 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17069 echo "Checking what constant to use for creating joinable pthreads..." >&4
17070 $cat >try.c <<'EOCP'
17071 #include <pthread.h>
17073 int detachstate = JOINABLE;
17076 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17077 if eval $compile; then
17078 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17079 val="$undef" # Yes, undef.
17080 set d_old_pthread_create_joinable
17083 set old_pthread_create_joinable
17086 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17087 if eval $compile; then
17088 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17090 set d_old_pthread_create_joinable
17092 val=PTHREAD_CREATE_UNDETACHED
17093 set old_pthread_create_joinable
17096 set try -DJOINABLE=__UNDETACHED
17097 if eval $compile; then
17098 echo "You seem to use __UNDETACHED." >&4
17100 set d_old_pthread_create_joinable
17103 set old_pthread_create_joinable
17106 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17108 set d_old_pthread_create_joinable
17111 set old_pthread_create_joinable
17118 d_old_pthread_create_joinable="$undef"
17119 old_pthread_create_joinable=""
17122 : see if pause exists
17126 : see if poll exists
17130 : see if prctl exists
17134 : see if prctl supports PR_SET_NAME
17135 d_prctl_set_name=$undef
17140 #include <unistd.h>
17142 #include <sys/prctl.h>
17144 int main (int argc, char *argv[])
17146 return (prctl (PR_SET_NAME, "Test"));
17150 if eval $compile_ok && $run ./try; then
17151 echo "Your prctl (PR_SET_NAME, ...) works"
17152 d_prctl_set_name=$define
17158 : see if readlink exists
17159 set readlink d_readlink
17162 : Check if exe is symlink to abs path of executing program
17166 case "$d_procselfexe" in
17168 case "$d_readlink" in
17170 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
17171 : more tidy to avoid an extra level of symlink
17172 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17173 while test $# -gt 0; do
17176 if $issymlink $try; then
17177 $ls -l $try > reflect
17178 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17179 echo "You have $type-like $try."
17180 procselfexe='"'$try'"'
17182 : This will break out of the loop
17195 : backward compatibility for d_hvfork
17196 if test X$d_hvfork != X; then
17197 d_vfork="$d_hvfork"
17200 : see if there is a vfork
17205 d_pseudofork=$undef
17207 : Ok, but do we want to use it. vfork is reportedly unreliable in
17208 : perl on Solaris 2.x, and probably elsewhere.
17212 case "$usevfork" in
17218 Perl can only use a vfork() that doesn't suffer from strict
17219 restrictions on calling functions or modifying global data in
17220 the child. For example, glibc-2.1 contains such a vfork()
17221 that is unsuitable. If your system provides a proper fork()
17222 call, chances are that you do NOT want perl to use vfork().
17225 rp="Do you still want to use vfork()?"
17230 echo "Ok, we won't use vfork()."
17239 $define) usevfork='true';;
17240 *) usevfork='false';;
17243 : see whether the pthread_atfork exists
17245 #include <pthread.h>
17248 #ifdef PTHREAD_ATFORK
17249 pthread_atfork(NULL,NULL,NULL);
17254 : see if pthread_atfork exists
17255 set try -DPTHREAD_ATFORK
17256 if eval $compile; then
17261 case "$usethreads" in
17264 $define) echo 'pthread_atfork found.' >&4 ;;
17265 *) echo 'pthread_atfork NOT found.' >&4 ;;
17268 set d_pthread_atfork
17271 : see if pthread_attr_setscope exists
17272 set pthread_attr_setscope d_pthread_attr_setscope
17275 : see whether the various POSIXish _yields exist
17277 #include <pthread.h>
17283 #ifdef PTHREAD_YIELD
17286 #ifdef PTHREAD_YIELD_NULL
17287 pthread_yield(NULL);
17293 : see if sched_yield exists
17294 set try -DSCHED_YIELD
17295 if eval $compile; then
17297 sched_yield='sched_yield()'
17301 case "$usethreads" in
17304 $define) echo 'sched_yield() found.' >&4 ;;
17305 *) echo 'sched_yield() NOT found.' >&4 ;;
17311 : see if pthread_yield exists
17312 set try -DPTHREAD_YIELD
17313 if eval $compile; then
17315 case "$sched_yield" in
17316 '') sched_yield='pthread_yield()' ;;
17319 set try -DPTHREAD_YIELD_NULL
17320 if eval $compile; then
17322 case "$sched_yield" in
17323 '') sched_yield='pthread_yield(NULL)' ;;
17329 case "$usethreads" in
17332 $define) echo 'pthread_yield() found.' >&4 ;;
17333 *) echo 'pthread_yield() NOT found.' >&4 ;;
17337 set d_pthread_yield
17339 case "$sched_yield" in
17340 '') sched_yield=undef ;;
17344 : check for ptrdiff_t
17346 echo "Checking to see if you have ptrdiff_t..." >&4
17348 #include <stddef.h>
17349 int main() { ptrdiff_t x = 7; }
17352 if eval $compile; then
17354 echo "You have ptrdiff_t."
17357 echo "You do not have ptrdiff_t."
17363 : see if random_r exists
17364 set random_r d_random_r
17366 case "$d_random_r" in
17368 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17369 case "$d_random_r_proto:$usethreads" in
17370 ":define") d_random_r_proto=define
17371 set d_random_r_proto random_r $hdrs
17375 case "$d_random_r_proto" in
17377 case "$random_r_proto" in
17378 ''|0) try='int random_r(int*, struct random_data*);'
17379 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17381 case "$random_r_proto" in
17382 ''|0) try='int random_r(long*, struct random_data*);'
17383 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17385 case "$random_r_proto" in
17386 ''|0) try='int random_r(struct random_data*, int32_t*);'
17387 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17389 case "$random_r_proto" in
17390 ''|0) d_random_r=undef
17392 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17393 * ) case "$random_r_proto" in
17394 REENTRANT_PROTO*) ;;
17395 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17397 echo "Prototype: $try" ;;
17400 *) case "$usethreads" in
17401 define) echo "random_r has no prototype, not using it." >&4 ;;
17408 *) random_r_proto=0
17412 : see if readdir and friends exist
17413 set readdir d_readdir
17415 set seekdir d_seekdir
17417 set telldir d_telldir
17419 set rewinddir d_rewinddir
17422 : see if readdir64_r exists
17423 set readdir64_r d_readdir64_r
17425 case "$d_readdir64_r" in
17427 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17428 case "$d_readdir64_r_proto:$usethreads" in
17429 ":define") d_readdir64_r_proto=define
17430 set d_readdir64_r_proto readdir64_r $hdrs
17434 case "$d_readdir64_r_proto" in
17436 case "$readdir64_r_proto" in
17437 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17438 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17440 case "$readdir64_r_proto" in
17441 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17442 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17444 case "$readdir64_r_proto" in
17445 ''|0) d_readdir64_r=undef
17446 readdir64_r_proto=0
17447 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17448 * ) case "$readdir64_r_proto" in
17449 REENTRANT_PROTO*) ;;
17450 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17452 echo "Prototype: $try" ;;
17455 *) case "$usethreads" in
17456 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17458 d_readdir64_r=undef
17459 readdir64_r_proto=0
17463 *) readdir64_r_proto=0
17467 : see if readdir_r exists
17468 set readdir_r d_readdir_r
17470 case "$d_readdir_r" in
17472 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17473 case "$d_readdir_r_proto:$usethreads" in
17474 ":define") d_readdir_r_proto=define
17475 set d_readdir_r_proto readdir_r $hdrs
17479 case "$d_readdir_r_proto" in
17481 case "$readdir_r_proto" in
17482 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17483 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17485 case "$readdir_r_proto" in
17486 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17487 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17489 case "$readdir_r_proto" in
17490 ''|0) d_readdir_r=undef
17492 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17493 * ) case "$readdir_r_proto" in
17494 REENTRANT_PROTO*) ;;
17495 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17497 echo "Prototype: $try" ;;
17500 *) case "$usethreads" in
17501 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17508 *) readdir_r_proto=0
17512 : see if readv exists
17516 : see if recvmsg exists
17517 set recvmsg d_recvmsg
17520 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17522 if set regcomp val -f d_regcomp; eval $csym; $val; then
17523 echo 'regcomp() found.' >&4
17524 d_regcomp="$define"
17527 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17528 echo 'regcmp() found.' >&4
17532 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17533 echo 're_comp() found, assuming re_exec() also exists.' >&4
17534 d_re_comp="$define"
17539 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17546 : see if remainder exists
17547 set remainder d_remainder
17550 : see if remquo exists
17551 set remquo d_remquo
17554 : see if rename exists
17555 set rename d_rename
17558 : see if rint exists
17562 : see if rmdir exists
17566 : see if round exists
17570 : see if memory.h is available.
17575 : See if it conflicts with string.h
17581 $cppstdin $cppflags $cppminus < $strings > mem.h
17582 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17584 echo "We won't be including <memory.h>."
17594 : can bcopy handle overlapping blocks?
17597 case "$d_memmove" in
17598 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17599 *) case "$d_bcopy" in
17601 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17603 #$i_memory I_MEMORY
17604 #$i_stdlib I_STDLIB
17605 #$i_string I_STRING
17606 #$i_unistd I_UNISTD
17608 $cat >>try.c <<'EOCP'
17611 # include <memory.h>
17614 # include <stdlib.h>
17617 # include <string.h>
17619 # include <strings.h>
17622 # include <unistd.h> /* Needed for NetBSD */
17626 char buf[128], abc[128];
17632 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17633 try to store the string in read-only memory. */
17634 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17636 for (align = 7; align >= 0; align--) {
17637 for (len = 36; len; len--) {
17639 bcopy(abc, b, len);
17640 for (off = 1; off <= len; off++) {
17641 bcopy(b, b+off, len);
17642 bcopy(b+off, b, len);
17643 if (bcmp(b, abc, len))
17652 if eval $compile_ok; then
17653 if $run ./try 2>/dev/null; then
17654 echo "Yes, it can."
17657 echo "It can't, sorry."
17660 echo "(I can't compile the test program, so we'll assume not...)"
17670 : can memcpy handle overlapping blocks?
17673 case "$d_memmove" in
17674 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17675 *) case "$d_memcpy" in
17677 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17679 #$i_memory I_MEMORY
17680 #$i_stdlib I_STDLIB
17681 #$i_string I_STRING
17682 #$i_unistd I_UNISTD
17684 $cat >>try.c <<'EOCP'
17687 # include <memory.h>
17690 # include <stdlib.h>
17693 # include <string.h>
17695 # include <strings.h>
17698 # include <unistd.h> /* Needed for NetBSD */
17702 char buf[128], abc[128];
17708 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17709 try to store the string in read-only memory. */
17710 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17712 for (align = 7; align >= 0; align--) {
17713 for (len = 36; len; len--) {
17715 memcpy(b, abc, len);
17716 for (off = 1; off <= len; off++) {
17717 memcpy(b+off, b, len);
17718 memcpy(b, b+off, len);
17719 if (memcmp(b, abc, len))
17728 if eval $compile_ok; then
17729 if $run ./try 2>/dev/null; then
17730 echo "Yes, it can."
17733 echo "It can't, sorry."
17736 echo "(I can't compile the test program, so we'll assume not...)"
17746 : can memcmp be trusted to compare relative magnitude?
17748 case "$d_memcmp" in
17751 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17753 #$i_memory I_MEMORY
17754 #$i_stdlib I_STDLIB
17755 #$i_string I_STRING
17756 #$i_unistd I_UNISTD
17758 $cat >>try.c <<'EOCP'
17761 # include <memory.h>
17764 # include <stdlib.h>
17767 # include <string.h>
17769 # include <strings.h>
17772 # include <unistd.h> /* Needed for NetBSD */
17778 if ((a < b) && memcmp(&a, &b, 1) < 0)
17784 if eval $compile_ok; then
17785 if $run ./try 2>/dev/null; then
17786 echo "Yes, it can."
17789 echo "No, it can't (it uses signed chars)."
17792 echo "(I can't compile the test program, so we'll assume not...)"
17800 : see if prototype for sbrk is available
17802 set d_sbrkproto sbrk $i_unistd unistd.h
17805 : see if scalbn exists
17806 set scalbn d_scalbn
17809 : see if select exists
17810 set select d_select
17813 : see if semctl exists
17814 set semctl d_semctl
17817 : see if semget exists
17818 set semget d_semget
17821 : see if semop exists
17825 : see how much of the 'sem*(2)' library is present.
17828 case "$d_semctl$d_semget$d_semop" in
17829 *"$undef"*) h_sem=false;;
17833 case "`ipcs 2>&1`" in
17834 "SVID messages"*"not configured"*)
17835 echo "Your $osname does not have the sem*(2) configured." >&4
17838 set semctl d_semctl
17840 set semget d_semget
17848 : we could also check for sys/ipc.h ...
17849 if $h_sem && $test `./findhdr sys/sem.h`; then
17850 echo "You have the full sem*(2) library." >&4
17853 echo "You don't have the full sem*(2) library." >&4
17859 : see whether sys/sem.h defines union semun
17861 $cat > try.c <<'END'
17862 #include <sys/types.h>
17863 #include <sys/ipc.h>
17864 #include <sys/sem.h>
17865 int main () { union semun semun; semun.buf = 0; }
17868 if eval $compile; then
17869 echo "You have union semun in <sys/sem.h>." >&4
17872 echo "You do not have union semun in <sys/sem.h>." >&4
17879 : see how to do semctl IPC_STAT
17883 $cat > tryh.h <<END
17886 # define S_IRUSR S_IREAD
17887 # define S_IWUSR S_IWRITE
17888 # define S_IXUSR S_IEXEC
17890 # define S_IRUSR 0400
17891 # define S_IWUSR 0200
17892 # define S_IXUSR 0100
17894 # define S_IRGRP (S_IRUSR>>3)
17895 # define S_IWGRP (S_IWUSR>>3)
17896 # define S_IXGRP (S_IXUSR>>3)
17897 # define S_IROTH (S_IRUSR>>6)
17898 # define S_IWOTH (S_IWUSR>>6)
17899 # define S_IXOTH (S_IXUSR>>6)
17902 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17903 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17904 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17907 : see whether semctl IPC_STAT can use union semun
17908 case "$d_semctl_semun" in
17912 #include <sys/types.h>
17913 #include <sys/ipc.h>
17914 #include <sys/sem.h>
17915 #include <sys/stat.h>
17922 #$d_union_semun HAS_UNION_SEMUN
17925 #ifndef HAS_UNION_SEMUN
17928 struct semid_ds *buf;
17929 unsigned short *array;
17935 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17936 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17938 struct semid_ds argbuf;
17941 st = semctl(sem, 0, IPC_STAT, arg);
17945 # endif /* IPC_STAT */
17946 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17948 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17949 # endif /* IPC_RMID */
17950 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17952 #endif /* IPC_PRIVATE && ... */
17953 printf("semget failed: errno = %d\n", errno);
17958 if eval $compile; then
17961 semun) val="$define" ;;
17969 case "$d_semctl_semun" in
17971 echo "You can use union semun for semctl IPC_STAT." >&4
17974 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17979 : see whether semctl IPC_STAT can use struct semid_ds pointer
17980 case "$d_semctl_semid_ds" in
17983 $cat > try.c <<'END'
17984 #include <sys/types.h>
17985 #include <sys/ipc.h>
17986 #include <sys/sem.h>
17987 #include <sys/stat.h>
17995 struct semid_ds arg;
17998 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17999 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18002 st = semctl(sem, 0, IPC_STAT, &arg);
18004 printf("semid_ds\n");
18006 # endif /* IPC_STAT */
18007 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18009 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
18010 # endif /* IPC_RMID */
18011 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18013 #endif /* IPC_PRIVATE && ... */
18014 printf("semget failed: errno = %d\n", errno);
18020 if eval $compile; then
18023 semid_ds) val="$define" ;;
18027 set d_semctl_semid_ds
18031 case "$d_semctl_semid_ds" in
18033 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18035 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18041 # We do not have the full sem*(2) library, so assume we can not
18047 set d_semctl_semid_ds
18053 : see if sendmsg exists
18054 set sendmsg d_sendmsg
18057 : see if setegid exists
18058 set setegid d_setegid
18061 : see if seteuid exists
18062 set seteuid d_seteuid
18065 : see if setgrent exists
18066 set setgrent d_setgrent
18069 : see if setgrent_r exists
18070 set setgrent_r d_setgrent_r
18072 case "$d_setgrent_r" in
18074 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18075 case "$d_setgrent_r_proto:$usethreads" in
18076 ":define") d_setgrent_r_proto=define
18077 set d_setgrent_r_proto setgrent_r $hdrs
18081 case "$d_setgrent_r_proto" in
18083 case "$setgrent_r_proto" in
18084 ''|0) try='int setgrent_r(FILE**);'
18085 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18087 case "$setgrent_r_proto" in
18088 ''|0) try='void setgrent_r(FILE**);'
18089 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18091 case "$setgrent_r_proto" in
18092 ''|0) d_setgrent_r=undef
18094 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18095 * ) case "$setgrent_r_proto" in
18096 REENTRANT_PROTO*) ;;
18097 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18099 echo "Prototype: $try" ;;
18102 *) case "$usethreads" in
18103 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18110 *) setgrent_r_proto=0
18114 : see if sethostent exists
18115 set sethostent d_sethent
18118 : see if sethostent_r exists
18119 set sethostent_r d_sethostent_r
18121 case "$d_sethostent_r" in
18123 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18124 case "$d_sethostent_r_proto:$usethreads" in
18125 ":define") d_sethostent_r_proto=define
18126 set d_sethostent_r_proto sethostent_r $hdrs
18130 case "$d_sethostent_r_proto" in
18132 case "$sethostent_r_proto" in
18133 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18134 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18136 case "$sethostent_r_proto" in
18137 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18138 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18140 case "$sethostent_r_proto" in
18141 ''|0) d_sethostent_r=undef
18142 sethostent_r_proto=0
18143 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18144 * ) case "$sethostent_r_proto" in
18145 REENTRANT_PROTO*) ;;
18146 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18148 echo "Prototype: $try" ;;
18151 *) case "$usethreads" in
18152 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18154 d_sethostent_r=undef
18155 sethostent_r_proto=0
18159 *) sethostent_r_proto=0
18163 : see if setitimer exists
18164 set setitimer d_setitimer
18167 : see if setlinebuf exists
18168 set setlinebuf d_setlinebuf
18171 : see if setlocale exists
18172 set setlocale d_setlocale
18175 : see if locale.h is available
18176 set locale.h i_locale
18179 : see if setlocale_r exists
18180 set setlocale_r d_setlocale_r
18182 case "$d_setlocale_r" in
18184 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18185 case "$d_setlocale_r_proto:$usethreads" in
18186 ":define") d_setlocale_r_proto=define
18187 set d_setlocale_r_proto setlocale_r $hdrs
18191 case "$d_setlocale_r_proto" in
18193 case "$setlocale_r_proto" in
18194 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18195 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18197 case "$setlocale_r_proto" in
18198 ''|0) d_setlocale_r=undef
18199 setlocale_r_proto=0
18200 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18201 * ) case "$setlocale_r_proto" in
18202 REENTRANT_PROTO*) ;;
18203 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18205 echo "Prototype: $try" ;;
18208 *) case "$usethreads" in
18209 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18211 d_setlocale_r=undef
18212 setlocale_r_proto=0
18216 *) setlocale_r_proto=0
18220 : see if setnetent exists
18221 set setnetent d_setnent
18224 : see if setnetent_r exists
18225 set setnetent_r d_setnetent_r
18227 case "$d_setnetent_r" in
18229 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18230 case "$d_setnetent_r_proto:$usethreads" in
18231 ":define") d_setnetent_r_proto=define
18232 set d_setnetent_r_proto setnetent_r $hdrs
18236 case "$d_setnetent_r_proto" in
18238 case "$setnetent_r_proto" in
18239 ''|0) try='int setnetent_r(int, struct netent_data*);'
18240 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18242 case "$setnetent_r_proto" in
18243 ''|0) try='void setnetent_r(int, struct netent_data*);'
18244 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18246 case "$setnetent_r_proto" in
18247 ''|0) d_setnetent_r=undef
18248 setnetent_r_proto=0
18249 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18250 * ) case "$setnetent_r_proto" in
18251 REENTRANT_PROTO*) ;;
18252 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18254 echo "Prototype: $try" ;;
18257 *) case "$usethreads" in
18258 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18260 d_setnetent_r=undef
18261 setnetent_r_proto=0
18265 *) setnetent_r_proto=0
18269 : see if setprotoent exists
18270 set setprotoent d_setpent
18273 : see if setpgid exists
18274 set setpgid d_setpgid
18277 : see if setpgrp2 exists
18278 set setpgrp2 d_setpgrp2
18281 : see if setpriority exists
18282 set setpriority d_setprior
18285 : see if setproctitle exists
18286 set setproctitle d_setproctitle
18289 : see if setprotoent_r exists
18290 set setprotoent_r d_setprotoent_r
18292 case "$d_setprotoent_r" in
18294 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18295 case "$d_setprotoent_r_proto:$usethreads" in
18296 ":define") d_setprotoent_r_proto=define
18297 set d_setprotoent_r_proto setprotoent_r $hdrs
18301 case "$d_setprotoent_r_proto" in
18303 case "$setprotoent_r_proto" in
18304 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18305 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18307 case "$setprotoent_r_proto" in
18308 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18309 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18311 case "$setprotoent_r_proto" in
18312 ''|0) d_setprotoent_r=undef
18313 setprotoent_r_proto=0
18314 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18315 * ) case "$setprotoent_r_proto" in
18316 REENTRANT_PROTO*) ;;
18317 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18319 echo "Prototype: $try" ;;
18322 *) case "$usethreads" in
18323 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18325 d_setprotoent_r=undef
18326 setprotoent_r_proto=0
18330 *) setprotoent_r_proto=0
18334 : see if setpwent exists
18335 set setpwent d_setpwent
18338 : see if setpwent_r exists
18339 set setpwent_r d_setpwent_r
18341 case "$d_setpwent_r" in
18343 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18344 case "$d_setpwent_r_proto:$usethreads" in
18345 ":define") d_setpwent_r_proto=define
18346 set d_setpwent_r_proto setpwent_r $hdrs
18350 case "$d_setpwent_r_proto" in
18352 case "$setpwent_r_proto" in
18353 ''|0) try='int setpwent_r(FILE**);'
18354 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18356 case "$setpwent_r_proto" in
18357 ''|0) try='void setpwent_r(FILE**);'
18358 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18360 case "$setpwent_r_proto" in
18361 ''|0) d_setpwent_r=undef
18363 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18364 * ) case "$setpwent_r_proto" in
18365 REENTRANT_PROTO*) ;;
18366 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18368 echo "Prototype: $try" ;;
18371 *) case "$usethreads" in
18372 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18379 *) setpwent_r_proto=0
18383 : see if setregid exists
18384 set setregid d_setregid
18386 set setresgid d_setresgid
18389 : see if setreuid exists
18390 set setreuid d_setreuid
18392 set setresuid d_setresuid
18395 : see if setrgid exists
18396 set setrgid d_setrgid
18399 : see if setruid exists
18400 set setruid d_setruid
18403 : see if setservent exists
18404 set setservent d_setsent
18407 : see if setservent_r exists
18408 set setservent_r d_setservent_r
18410 case "$d_setservent_r" in
18412 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18413 case "$d_setservent_r_proto:$usethreads" in
18414 ":define") d_setservent_r_proto=define
18415 set d_setservent_r_proto setservent_r $hdrs
18419 case "$d_setservent_r_proto" in
18421 case "$setservent_r_proto" in
18422 ''|0) try='int setservent_r(int, struct servent_data*);'
18423 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18425 case "$setservent_r_proto" in
18426 ''|0) try='void setservent_r(int, struct servent_data*);'
18427 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18429 case "$setservent_r_proto" in
18430 ''|0) d_setservent_r=undef
18431 setservent_r_proto=0
18432 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18433 * ) case "$setservent_r_proto" in
18434 REENTRANT_PROTO*) ;;
18435 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18437 echo "Prototype: $try" ;;
18440 *) case "$usethreads" in
18441 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18443 d_setservent_r=undef
18444 setservent_r_proto=0
18448 *) setservent_r_proto=0
18452 : see if setsid exists
18453 set setsid d_setsid
18456 : see if setvbuf exists
18457 set setvbuf d_setvbuf
18460 : see if shmctl exists
18461 set shmctl d_shmctl
18464 : see if shmget exists
18465 set shmget d_shmget
18468 : see if shmat exists
18471 : see what shmat returns
18474 $cat >shmat.c <<'END'
18475 #include <sys/shm.h>
18478 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18483 echo "and it returns ($shmattype)." >&4
18484 : see if a prototype for shmat is available
18485 xxx=`./findhdr sys/shm.h`
18486 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18487 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18498 set d_shmatprototype
18501 : see if shmdt exists
18505 : see how much of the 'shm*(2)' library is present.
18508 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18509 *"$undef"*) h_shm=false;;
18513 case "`ipcs 2>&1`" in
18514 "SVID shared memory"*"not configured"*)
18515 echo "Your $osname does not have the shm*(2) configured." >&4
18518 set shmctl d_shmctl
18520 set shmget d_shmget
18530 : we could also check for sys/ipc.h ...
18531 if $h_shm && $test `./findhdr sys/shm.h`; then
18532 echo "You have the full shm*(2) library." >&4
18535 echo "You don't have the full shm*(2) library." >&4
18541 : see if we have sigaction
18543 if set sigaction val -f d_sigaction; eval $csym; $val; then
18544 echo 'sigaction() found.' >&4
18547 #include <sys/types.h>
18548 #include <signal.h>
18549 #$i_stdlib I_STDLIB
18551 #include <stdlib.h>
18555 struct sigaction act, oact;
18557 oact.sa_handler = 0;
18558 /* so that act and oact are used */
18559 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18563 if eval $compile_ok; then
18566 echo "But you don't seem to have a usable struct sigaction." >&4
18570 echo 'sigaction NOT found.' >&4
18573 set d_sigaction; eval $setvar
18576 : see if this is a sunmath.h system
18577 set sunmath.h i_sunmath
18580 : see if signbit exists
18581 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18584 #$i_sunmath I_SUNMATH
18588 #ifdef I_SUNMATH /* Solaris special math library */
18589 # include <sunmath.h>
18592 int main(int argc, char **argv)
18596 if ((signbit(x) == 0) && (signbit(y) != 0))
18604 if eval $compile; then
18605 if $run ./try; then
18609 $echo "Signbit seems to be available, but doesn't work as I expected."
18610 $echo "I won't use it." >&4
18621 : see if sigprocmask exists
18622 set sigprocmask d_sigprocmask
18625 : see if sigsetjmp exists
18627 case "$d_sigsetjmp" in
18630 #include <setjmp.h>
18631 #$i_stdlib I_STDLIB
18633 #include <stdlib.h>
18639 if (sigsetjmp(env,1))
18642 siglongjmp(env, 1);
18647 if eval $compile; then
18648 if $run ./try >/dev/null 2>&1; then
18649 echo "POSIX sigsetjmp found." >&4
18653 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18659 echo "sigsetjmp not found." >&4
18663 *) val="$d_sigsetjmp"
18664 case "$d_sigsetjmp" in
18665 $define) echo "POSIX sigsetjmp found." >&4;;
18666 $undef) echo "sigsetjmp not found." >&4;;
18674 : see if snprintf exists
18675 set snprintf d_snprintf
18678 : see if vsnprintf exists
18679 set vsnprintf d_vsnprintf
18682 case "$d_snprintf-$d_vsnprintf" in
18685 Checking whether your snprintf() and vsnprintf() work okay...
18687 $cat >try.c <<'EOCP'
18688 /* v?snprintf testing logic courtesy of Russ Allbery.
18689 * According to C99:
18690 * - if the buffer is too short it still must be \0-terminated
18691 * - if the buffer is too short the potentially required length
18692 * must be returned and not -1
18693 * - if the buffer is NULL the potentially required length
18694 * must be returned and not -1 or core dump
18697 #include <stdarg.h>
18701 int test (char *format, ...)
18706 va_start (args, format);
18707 count = vsnprintf (buf, sizeof buf, format, args);
18714 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18715 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18719 if eval $compile; then
18722 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18724 Your snprintf() and snprintf() don't seem to be working okay.
18726 d_snprintf="$undef"
18727 d_vsnprintf="$undef"
18731 echo "(I can't seem to compile the test program--assuming they don't)"
18732 d_snprintf="$undef"
18733 d_vsnprintf="$undef"
18739 : see if sockatmark exists
18740 set sockatmark d_sockatmark
18743 : see if prototype for sockatmark is available
18745 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18748 : see if socks5_init exists
18749 set socks5_init d_socks5_init
18752 : see if sprintf returns the length of the string in the buffer as per ANSI
18753 $echo "Checking whether sprintf returns the length of the string..." >&4
18756 #$i_stdlib I_STDLIB
18758 #include <stdlib.h>
18760 #$i_string I_STRING
18762 # include <string.h>
18764 # include <strings.h>
18773 int check (size_t expect, int test) {
18774 size_t got = strlen(buffer);
18778 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18783 int main(int argc, char **argv) {
18786 check(sprintf(buffer, ""), ++test);
18787 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18788 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18795 if eval $compile; then
18799 sprintf returns the length of the string (as ANSI says it should)
18801 d_sprintf_returns_strlen="$define"
18804 sprintf does not return the length of the string (how old is this system?)
18806 d_sprintf_returns_strlen="$undef"
18810 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18811 d_sprintf_returns_strlen="$undef"
18815 : see if srand48_r exists
18816 set srand48_r d_srand48_r
18818 case "$d_srand48_r" in
18820 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18821 case "$d_srand48_r_proto:$usethreads" in
18822 ":define") d_srand48_r_proto=define
18823 set d_srand48_r_proto srand48_r $hdrs
18827 case "$d_srand48_r_proto" in
18829 case "$srand48_r_proto" in
18830 ''|0) try='int srand48_r(long, struct drand48_data*);'
18831 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18833 case "$srand48_r_proto" in
18834 ''|0) d_srand48_r=undef
18836 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18837 * ) case "$srand48_r_proto" in
18838 REENTRANT_PROTO*) ;;
18839 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18841 echo "Prototype: $try" ;;
18844 *) case "$usethreads" in
18845 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18852 *) srand48_r_proto=0
18856 : see if srandom_r exists
18857 set srandom_r d_srandom_r
18859 case "$d_srandom_r" in
18861 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18862 case "$d_srandom_r_proto:$usethreads" in
18863 ":define") d_srandom_r_proto=define
18864 set d_srandom_r_proto srandom_r $hdrs
18868 case "$d_srandom_r_proto" in
18870 case "$srandom_r_proto" in
18871 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18872 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18874 case "$srandom_r_proto" in
18875 ''|0) d_srandom_r=undef
18877 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18878 * ) case "$srandom_r_proto" in
18879 REENTRANT_PROTO*) ;;
18880 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18882 echo "Prototype: $try" ;;
18885 *) case "$usethreads" in
18886 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18893 *) srandom_r_proto=0
18897 : see if prototype for setresgid is available
18899 set d_sresgproto setresgid $i_unistd unistd.h
18902 : see if prototype for setresuid is available
18904 set d_sresuproto setresuid $i_unistd unistd.h
18907 : see if stat exists
18911 : see if sys/stat.h is available
18912 set sys/stat.h i_sysstat
18915 : see if stat knows about block sizes
18917 echo "Checking to see if your struct stat has st_blocks field..." >&4
18918 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18921 : see if this is a sys/vfs.h system
18922 set sys/vfs.h i_sysvfs
18925 : see if this is a sys/statfs.h system
18926 set sys/statfs.h i_sysstatfs
18929 : Check for statfs_s
18931 echo "Checking to see if your system supports struct statfs..." >&4
18932 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
18934 case "$d_statfs_s" in
18935 "$define") echo "Yes, it does." ;;
18936 *) echo "No, it doesn't." ;;
18940 : see if struct statfs knows about f_flags
18941 case "$d_statfs_s" in
18944 echo "Checking to see if your struct statfs has f_flags field..." >&4
18945 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
18949 set d_statfs_f_flags
18953 case "$d_statfs_f_flags" in
18954 "$define") echo "Yes, it does." ;;
18955 *) echo "No, it doesn't." ;;
18958 : see what flavor, if any, of static inline is supported
18960 echo "Checking to see if your system supports static inline..."
18961 $cat > try.c <<'EOCP'
18962 #include <stdlib.h>
18963 extern int f_via_a(int x);
18964 extern int f_via_b(int x);
18965 int main(int argc, char **argv)
18974 return EXIT_SUCCESS;
18977 return EXIT_FAILURE;
18981 $cat > a.c <<'EOCP'
18982 static INLINE int f(int x) {
18993 $cat > b.c <<'EOCP'
18994 extern int f(int x);
19002 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19003 case "$perl_static_inline" in
19004 '') # Check the various possibilities, and break out on success.
19005 # For gcc, prefer __inline__, which will still permit
19006 # cflags.SH to add in -ansi.
19007 case "$gccversion" in
19008 '') xxx="inline __inline__ __inline _inline";;
19009 *) xxx="__inline__ inline __inline _inline";;
19011 for inline in $xxx; do
19012 set try -DINLINE=$inline a.c
19013 if eval $compile && $run ./try; then
19014 # Now make sure there is no external linkage of static
19016 set try -DINLINE=$inline -DUSE_B a.c b.c
19017 if eval $compile && $run ./try; then
19018 $echo "Your compiler supports static $inline, " >&4
19019 $echo "but it also creates an external definition," >&4
19020 $echo "so I won't use it." >&4
19023 $echo "Your compiler supports static $inline." >&4
19025 perl_static_inline="static $inline";
19029 $echo "Your compiler does NOT support static $inline." >&4
19034 *inline*) # Some variant of inline exists.
19035 echo "Keeping your $hint value of $perl_static_inline."
19038 static) # No inline capabilities
19039 echo "Keeping your $hint value of $perl_static_inline."
19042 *) # Unrecognized previous value -- blindly trust the supplied
19043 # value and hope it makes sense. Use old value for
19044 # d_static_inline, if there is one.
19045 echo "Keeping your $hint value of $perl_static_inline."
19046 case "$d_static_inline" in
19048 *) val=$d_static_inline ;;
19052 # Fallback to plain 'static' if nothing worked.
19053 case "$perl_static_inline" in
19055 perl_static_inline="static"
19059 set d_static_inline
19061 $rm -f a.[co] b.[co]
19064 : Check stream access
19066 Checking how to access stdio streams by file descriptor number...
19068 case "$stdio_stream_array" in
19069 '') $cat >try.c <<EOCP
19072 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19076 for s in _iob __iob __sF
19078 set try -DSTDIO_STREAM_ARRAY=$s
19079 if eval $compile; then
19080 case "`$run ./try`" in
19081 yes) stdio_stream_array=$s; break ;;
19087 case "$stdio_stream_array" in
19089 I can't figure out how to access stdio streams by file descriptor number.
19091 d_stdio_stream_array="$undef"
19094 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19096 d_stdio_stream_array="$define"
19100 : see if strcoll exists
19101 set strcoll d_strcoll
19104 : check for structure copying
19106 echo "Checking to see if your C compiler can copy structs..." >&4
19107 $cat >try.c <<'EOCP'
19117 if $cc -c try.c >/dev/null 2>&1 ; then
19119 echo "Yup, it can."
19122 echo "Nope, it can't."
19128 : see if strerror and/or sys_errlist[] exist
19130 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19131 if set strerror val -f d_strerror; eval $csym; $val; then
19132 echo 'strerror() found.' >&4
19133 d_strerror="$define"
19134 d_strerrm='strerror(e)'
19135 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19136 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19137 d_syserrlst="$define"
19139 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19140 d_syserrlst="$undef"
19142 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19143 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19144 echo 'strerror() found in string header.' >&4
19145 d_strerror="$define"
19146 d_strerrm='strerror(e)'
19147 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19148 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19149 d_syserrlst="$define"
19151 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19152 d_syserrlst="$undef"
19154 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19155 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19156 d_strerror="$undef"
19157 d_syserrlst="$define"
19158 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19160 echo 'strerror() and sys_errlist[] NOT found.' >&4
19161 d_strerror="$undef"
19162 d_syserrlst="$undef"
19163 d_strerrm='"unknown"'
19167 : see if strerror_r exists
19168 set strerror_r d_strerror_r
19170 case "$d_strerror_r" in
19172 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19173 case "$d_strerror_r_proto:$usethreads" in
19174 ":define") d_strerror_r_proto=define
19175 set d_strerror_r_proto strerror_r $hdrs
19179 case "$d_strerror_r_proto" in
19181 case "$strerror_r_proto" in
19182 ''|0) try='int strerror_r(int, char*, size_t);'
19183 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19185 case "$strerror_r_proto" in
19186 ''|0) try='int strerror_r(int, char*, int);'
19187 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19189 case "$strerror_r_proto" in
19190 ''|0) try='char* strerror_r(int, char*, size_t);'
19191 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19193 case "$strerror_r_proto" in
19194 ''|0) d_strerror_r=undef
19196 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19197 * ) case "$strerror_r_proto" in
19198 REENTRANT_PROTO*) ;;
19199 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19201 echo "Prototype: $try" ;;
19204 *) case "$usethreads" in
19205 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19212 *) strerror_r_proto=0
19216 : see if strftime exists
19217 set strftime d_strftime
19220 : see if strlcat exists
19221 set strlcat d_strlcat
19224 : see if strlcpy exists
19225 set strlcpy d_strlcpy
19228 : see if strtod exists
19229 set strtod d_strtod
19232 : see if strtol exists
19233 set strtol d_strtol
19236 : see if strtold exists
19237 set strtold d_strtold
19240 : see if strtoll exists
19241 set strtoll d_strtoll
19244 case "$d_longlong-$d_strtoll" in
19247 Checking whether your strtoll() works okay...
19249 $cat >try.c <<'EOCP'
19252 #define strtoll __strtoll
19255 #define strtoll _strtoll
19258 extern long long int strtoll(char *s, char **, int);
19259 static int bad = 0;
19260 int check(char *s, long long ell, int een) {
19263 gll = strtoll(s, 0, 10);
19264 if (!((gll == ell) && (errno == een)))
19268 check(" 1", 1LL, 0);
19269 check(" 0", 0LL, 0);
19270 check("-1", -1LL, 0);
19271 check("-9223372036854775808", -9223372036854775808LL, 0);
19272 check("-9223372036854775808", -9223372036854775808LL, 0);
19273 check(" 9223372036854775807", 9223372036854775807LL, 0);
19274 check("-9223372036854775808", -9223372036854775808LL, 0);
19275 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19276 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19282 if eval $compile; then
19285 ok) echo "Your strtoll() seems to be working okay." ;;
19287 Your strtoll() doesn't seem to be working okay.
19293 echo "(I can't seem to compile the test program--assuming it doesn't)"
19299 : see if strtoq exists
19300 set strtoq d_strtoq
19303 : see if strtoul exists
19304 set strtoul d_strtoul
19307 case "$d_strtoul" in
19310 Checking whether your strtoul() works okay...
19312 $cat >try.c <<'EOCP'
19315 extern unsigned long int strtoul(char *s, char **, int);
19316 static int bad = 0;
19317 void check(char *s, unsigned long eul, int een) {
19320 gul = strtoul(s, 0, 10);
19321 if (!((gul == eul) && (errno == een)))
19325 check(" 1", 1L, 0);
19326 check(" 0", 0L, 0);
19328 case "$longsize" in
19330 $cat >>try.c <<'EOCP'
19331 check("18446744073709551615", 18446744073709551615UL, 0);
19332 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19333 #if 0 /* strtoul() for /^-/ strings is undefined. */
19334 check("-1", 18446744073709551615UL, 0);
19335 check("-18446744073709551614", 2, 0);
19336 check("-18446744073709551615", 1, 0);
19337 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19338 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19343 $cat >>try.c <<'EOCP'
19344 check("4294967295", 4294967295UL, 0);
19345 check("4294967296", 4294967295UL, ERANGE);
19346 #if 0 /* strtoul() for /^-/ strings is undefined. */
19347 check("-1", 4294967295UL, 0);
19348 check("-4294967294", 2, 0);
19349 check("-4294967295", 1, 0);
19350 check("-4294967296", 4294967295UL, ERANGE);
19351 check("-4294967297", 4294967295UL, ERANGE);
19356 : Should we write these tests to be more portable by sprintf-ing
19357 : ~0 and then manipulating that char string as input for strtol?
19360 $cat >>try.c <<'EOCP'
19367 if eval $compile; then
19368 case "`$run ./try`" in
19369 ok) echo "Your strtoul() seems to be working okay." ;;
19371 Your strtoul() doesn't seem to be working okay.
19377 echo "(I can't seem to compile the test program--assuming it doesn't)"
19383 : see if strtoull exists
19384 set strtoull d_strtoull
19387 case "$d_longlong-$d_strtoull" in
19390 Checking whether your strtoull() works okay...
19392 $cat >try.c <<'EOCP'
19395 #define strtoull __strtoull
19398 extern unsigned long long int strtoull(char *s, char **, int);
19399 static int bad = 0;
19400 int check(char *s, long long eull, int een) {
19403 gull = strtoull(s, 0, 10);
19404 if (!((gull == eull) && (errno == een)))
19408 check(" 1", 1LL, 0);
19409 check(" 0", 0LL, 0);
19410 check("18446744073709551615", 18446744073709551615ULL, 0);
19411 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19412 #if 0 /* strtoull() for /^-/ strings is undefined. */
19413 check("-1", 18446744073709551615ULL, 0);
19414 check("-18446744073709551614", 2LL, 0);
19415 check("-18446744073709551615", 1LL, 0);
19416 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19417 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19424 if eval $compile; then
19425 case "`$run ./try`" in
19426 ok) echo "Your strtoull() seems to be working okay." ;;
19428 Your strtoull() doesn't seem to be working okay.
19430 d_strtoull="$undef"
19434 echo "(I can't seem to compile the test program--assuming it doesn't)"
19435 d_strtoull="$undef"
19440 : see if strtouq exists
19441 set strtouq d_strtouq
19444 case "$d_strtouq" in
19447 Checking whether your strtouq() works okay...
19449 $cat >try.c <<'EOCP'
19452 extern unsigned long long int strtouq(char *s, char **, int);
19453 static int bad = 0;
19454 void check(char *s, unsigned long long eull, int een) {
19455 unsigned long long gull;
19457 gull = strtouq(s, 0, 10);
19458 if (!((gull == eull) && (errno == een)))
19462 check(" 1", 1LL, 0);
19463 check(" 0", 0LL, 0);
19464 check("18446744073709551615", 18446744073709551615ULL, 0);
19465 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19466 #if 0 /* strtouq() for /^-/ strings is undefined. */
19467 check("-1", 18446744073709551615ULL, 0);
19468 check("-18446744073709551614", 2LL, 0);
19469 check("-18446744073709551615", 1LL, 0);
19470 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19471 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19479 if eval $compile; then
19480 case "`$run ./try`" in
19481 ok) echo "Your strtouq() seems to be working okay." ;;
19483 Your strtouq() doesn't seem to be working okay.
19489 echo "(I can't seem to compile the test program--assuming it doesn't)"
19495 : see if strxfrm exists
19496 set strxfrm d_strxfrm
19499 : see if symlink exists
19500 set symlink d_symlink
19503 : see if syscall exists
19504 set syscall d_syscall
19507 : see if prototype for syscall is available
19509 set d_syscallproto syscall $i_unistd unistd.h
19512 : see if sysconf exists
19513 set sysconf d_sysconf
19516 : see if system exists
19517 set system d_system
19520 : see if tcgetpgrp exists
19521 set tcgetpgrp d_tcgetpgrp
19524 : see if tcsetpgrp exists
19525 set tcsetpgrp d_tcsetpgrp
19528 : see if prototype for telldir is available
19530 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19533 : see if tgamma exists
19534 set tgamma d_tgamma
19537 : see if time exists
19539 if test "X$d_time" = X -o X"$timetype" = X; then
19540 if set time val -f d_time; eval $csym; $val; then
19541 echo 'time() found.' >&4
19543 rp="What is the type returned by time() on this system?"
19544 set time_t timetype long stdio.h sys/types.h
19547 echo 'time() not found, hope that will do.' >&4
19555 : see if timegm exists
19556 set timegm d_timegm
19559 : see if this is a sys/times.h system
19560 set sys/times.h i_systimes
19563 : see if times exists
19565 if set times val -f d_times; eval $csym; $val; then
19566 echo 'times() found.' >&4
19569 case "$i_systimes" in
19570 "$define") inc='sys/times.h';;
19572 rp="What is the type returned by times() on this system?"
19573 set clock_t clocktype long stdio.h sys/types.h $inc
19576 echo 'times() NOT found, hope that will do.' >&4
19581 : see if tmpnam_r exists
19582 set tmpnam_r d_tmpnam_r
19584 case "$d_tmpnam_r" in
19586 hdrs="$i_systypes sys/types.h define stdio.h "
19587 case "$d_tmpnam_r_proto:$usethreads" in
19588 ":define") d_tmpnam_r_proto=define
19589 set d_tmpnam_r_proto tmpnam_r $hdrs
19593 case "$d_tmpnam_r_proto" in
19595 case "$tmpnam_r_proto" in
19596 ''|0) try='char* tmpnam_r(char*);'
19597 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19599 case "$tmpnam_r_proto" in
19600 ''|0) d_tmpnam_r=undef
19602 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19603 * ) case "$tmpnam_r_proto" in
19604 REENTRANT_PROTO*) ;;
19605 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19607 echo "Prototype: $try" ;;
19610 *) case "$usethreads" in
19611 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19618 *) tmpnam_r_proto=0
19622 : see if trunc exists
19626 : see if truncate exists
19627 set truncate d_truncate
19630 : see if ttyname_r exists
19631 set ttyname_r d_ttyname_r
19633 case "$d_ttyname_r" in
19635 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19636 case "$d_ttyname_r_proto:$usethreads" in
19637 ":define") d_ttyname_r_proto=define
19638 set d_ttyname_r_proto ttyname_r $hdrs
19642 case "$d_ttyname_r_proto" in
19644 case "$ttyname_r_proto" in
19645 ''|0) try='int ttyname_r(int, char*, size_t);'
19646 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19648 case "$ttyname_r_proto" in
19649 ''|0) try='int ttyname_r(int, char*, int);'
19650 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19652 case "$ttyname_r_proto" in
19653 ''|0) try='char* ttyname_r(int, char*, int);'
19654 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19656 case "$ttyname_r_proto" in
19657 ''|0) d_ttyname_r=undef
19659 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19660 * ) case "$ttyname_r_proto" in
19661 REENTRANT_PROTO*) ;;
19662 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19664 echo "Prototype: $try" ;;
19667 *) case "$usethreads" in
19668 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19675 *) ttyname_r_proto=0
19679 : see if tzname[] exists
19681 if set tzname val -a d_tzname; eval $csym; $val; then
19683 echo 'tzname[] found.' >&4
19686 echo 'tzname[] NOT found.' >&4
19691 : Check if is a multiplatform env
19693 darwin) multiarch="$define" ;;
19695 case "$multiarch" in
19696 ''|[nN]*) multiarch="$undef" ;;
19699 : check for ordering of bytes in a UV
19701 case "$multiarch" in
19704 You seem to be doing a multiarchitecture build,
19705 skipping the byteorder check.
19711 case "$byteorder" in
19714 In the following, larger digits indicate more significance. A big-endian
19715 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19716 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19717 machines may have weird orders like 3412. A Cray will report 87654321,
19718 an Alpha will report 12345678. If the test program works the default is
19720 I'm now running the test program...
19724 #$i_stdlib I_STDLIB
19726 #include <stdlib.h>
19728 #include <sys/types.h>
19729 typedef $uvtype UV;
19739 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19741 u.l = (UV)0x04030201;
19742 for (i = 0; i < $uvsize; i++)
19743 printf("%c", u.c[i]+'0');
19750 if eval $compile && $run ./try > /dev/null; then
19753 [1-4][1-4][1-4][1-4]|12345678|87654321)
19754 echo "(The test program ran ok.)"
19755 echo "byteorder=$dflt"
19758 ????|????????) echo "(The test program ran ok.)" ;;
19759 *) echo "(The test program didn't run right for some reason.)" ;;
19764 (I can't seem to compile the test program. Guessing big-endian...)
19767 case "$xxx_prompt" in
19769 rp="What is the order of bytes in $uvtype?"
19782 : Checking 32bit alignedness
19785 Checking to see whether you can access character data unalignedly...
19787 case "$d_u32align" in
19788 '') $cat >try.c <<EOCP
19790 #$i_stdlib I_STDLIB
19792 #include <stdlib.h>
19794 #define U32 $u32type
19795 #define BYTEORDER 0x$byteorder
19797 #include <signal.h>
19799 $signal_t bletch(int s) { exit(4); }
19802 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19803 volatile U8 buf[8];
19807 if (sizeof(U32) != 4) {
19808 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19815 signal(SIGBUS, bletch);
19827 for (i = 0; i < 4; i++) {
19828 up = (U32*)(buf + i);
19829 if (! ((*up == 1 << (8*i)) || /* big-endian */
19830 (*up == 1 << (8*(3-i))) /* little-endian */
19834 printf("read failed (%x)\n", *up);
19840 for (i = 0; i < 4; i++) {
19841 up = (U32*)(buf + i);
19843 if (*up != 0xBeef) {
19844 printf("write failed (%x)\n", *up);
19858 if eval $compile_ok; then
19859 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19860 $run ./try 2>&1 >/dev/null
19863 You can access character data pretty unalignedly.
19865 d_u32align="$undef"
19868 It seems that you must access character data in an aligned manner.
19870 d_u32align="$define"
19874 rp='Can you access character data at unaligned addresses?'
19878 [yY]*) d_u32align="$undef" ;;
19879 *) d_u32align="$define" ;;
19886 : see if ualarm exists
19887 set ualarm d_ualarm
19890 : see if umask exists
19894 : see if unordered exists
19895 set unordered d_unordered
19898 : see if unsetenv exists
19899 set unsetenv d_unsetenv
19902 : see if usleep exists
19903 set usleep d_usleep
19906 : see if prototype for usleep is available
19908 set d_usleepproto usleep $i_unistd unistd.h
19911 : see if ustat exists
19915 : see if closedir exists
19916 set closedir d_closedir
19919 case "$d_closedir" in
19922 echo "Checking whether closedir() returns a status..." >&4
19924 #$i_dirent I_DIRENT /**/
19925 #$i_sysdir I_SYS_DIR /**/
19926 #$i_sysndir I_SYS_NDIR /**/
19927 #$i_systypes I_SYS_TYPES /**/
19929 #if defined(I_SYS_TYPES)
19930 #include <sys/types.h>
19932 #if defined(I_DIRENT)
19933 #include <dirent.h>
19936 #include <sys/ndir.h>
19940 #include <ndir.h> /* may be wrong in the future */
19942 #include <sys/dir.h>
19947 int main() { return closedir(opendir(".")); }
19950 if eval $compile_ok; then
19951 if $run ./try > /dev/null 2>&1 ; then
19952 echo "Yes, it does."
19955 echo "No, it doesn't."
19959 echo "(I can't seem to compile the test program--assuming it doesn't)"
19967 set d_void_closedir
19971 : see if there is a wait4
19975 : see if waitpid exists
19976 set waitpid d_waitpid
19981 $cat >try.c <<'EOCP'
19987 return (wcscmp (s, s) ? 1 : 0);
19992 if eval $compile; then
19995 0) echo "A working wcscmp() found." >&4
19997 *) echo "wcscmp() found, but it doesn't work" >&4
20001 echo "wcscmp() NOT found." >&4
20007 : see if wcstombs exists
20008 set wcstombs d_wcstombs
20013 $cat >try.c <<'EOCP'
20018 wchar_t dst[4], *src = L" ";
20020 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20025 if eval $compile; then
20028 0) echo "A working wcsxfrm() found." >&4
20030 *) echo "wcsxfrm() found, but it doesn't work" >&4
20034 echo "wcsxfrm() NOT found." >&4
20040 : see if wctomb exists
20041 set wctomb d_wctomb
20044 : see if writev exists
20045 set writev d_writev
20048 : check for alignment requirements
20050 case "$alignbytes" in
20051 '') echo "Checking alignment constraints..." >&4
20052 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
20053 $cat >try.c <<'EOCP'
20054 typedef long double NV;
20057 $cat >try.c <<'EOCP'
20061 $cat >>try.c <<'EOCP'
20069 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20074 if eval $compile_ok; then
20078 echo "(I can't seem to compile the test program...)"
20080 case "$multiarch" in
20082 : The usual safe value is 8, but Darwin with -Duselongdouble
20083 : needs 16. Hence, we will take 8 as a minimum, but allow
20084 : Configure to pick a larger value if needed.
20085 if $test "$dflt" -lt 8; then
20087 echo "Setting alignment to 8 for multiarch support.">&4
20092 *) dflt="$alignbytes"
20095 rp="Doubles must be aligned on a how-many-byte boundary?"
20100 : set the base revision
20103 : length of character in bytes. Is always 1, otherwise it is not C
20104 : This used to be a test using sizeof
20107 : Check for the number of bits in a character
20108 case "$charbits" in
20109 '') echo "Checking how long a character is (in bits)..." >&4
20116 for (c = 1, n = 0; c; c <<= 1, n++) ;
20117 printf ("%d\n", n);
20122 if eval $compile_ok; then
20126 echo "(I can't seem to compile the test program. Guessing...)"
20133 rp="What is the length of a character (in bits)?"
20137 case "$charbits" in
20140 Your system has an unsigned character size of $charbits bits, which
20141 is rather unusual (normally it is 8 bits). Perl likely will not work
20142 correctly on your system, with subtle bugs in various places.
20144 rp='Do you really want to continue?'
20148 [yY]) echo >&4 "Okay, continuing." ;;
20153 : how do we concatenate cpp tokens here?
20155 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20156 $cat >cpp_stuff.c <<'EOCP'
20157 #define RCAT(a,b)a/**/b
20158 #define ACAT(a,b)a ## b
20162 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20163 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20164 echo "Oh! Smells like ANSI's been here." >&4
20165 echo "We can catify or stringify, separately or together!"
20167 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20168 echo "Ah, yes! The good old days!" >&4
20169 echo "However, in the good old days we don't know how to stringify and"
20170 echo "catify at the same time."
20174 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20175 You're going to have to edit the values of CAT[2-5] in config.h...
20177 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20181 : see if this is a db.h system
20187 : Check db version.
20189 echo "Checking Berkeley DB version ..." >&4
20195 #include <sys/types.h>
20197 #$i_stdlib I_STDLIB
20199 #include <stdlib.h>
20202 int main(int argc, char *argv[])
20204 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20205 int Major, Minor, Patch ;
20206 unsigned long Version ;
20207 (void)db_version(&Major, &Minor, &Patch) ;
20209 printf("%d %d %d %d %d %d\n",
20210 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20211 Major, Minor, Patch);
20214 printf("You have Berkeley DB Version 2 or greater.\n");
20216 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20217 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20218 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20219 Major, Minor, Patch) ;
20221 /* check that db.h & libdb are compatible */
20222 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20223 printf("db.h and libdb are incompatible.\n") ;
20227 printf("db.h and libdb are compatible.\n") ;
20229 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20230 + DB_VERSION_PATCH ;
20232 /* needs to be >= 2.3.4 */
20233 if (Version < 2003004) {
20234 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20235 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20241 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20246 printf("You have Berkeley DB Version 1.\n");
20247 exit(0); /* DB version < 2: the coast is clear. */
20249 exit(1); /* <db.h> not Berkeley DB? */
20255 if eval $compile_ok && $run ./try; then
20256 echo 'Looks OK.' >&4
20258 db_version_major=$1
20259 db_version_minor=$2
20260 db_version_patch=$3
20262 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20266 : Remove db from list of libraries to use
20267 echo "Removing unusable -ldb from library list" >&4
20268 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20271 echo "libs = $libs" >&4
20281 : Check the return type needed for hash
20283 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20289 #include <sys/types.h>
20292 #ifndef DB_VERSION_MAJOR
20293 u_int32_t hash_cb (const void* ptr, size_t size)
20299 info.hash = hash_cb;
20303 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20304 if $contains warning try.out >>/dev/null 2>&1 ; then
20307 db_hashtype='u_int32_t'
20310 : XXX Maybe we should just give up here.
20311 db_hashtype=u_int32_t
20313 echo "Help: I can't seem to compile the db test program." >&4
20314 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20317 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20319 *) db_hashtype=u_int32_t
20324 : Check the return type needed for prefix
20326 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20332 #include <sys/types.h>
20335 #ifndef DB_VERSION_MAJOR
20336 size_t prefix_cb (const DBT *key1, const DBT *key2)
20342 info.prefix = prefix_cb;
20346 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20347 if $contains warning try.out >>/dev/null 2>&1 ; then
20348 db_prefixtype='int'
20350 db_prefixtype='size_t'
20353 db_prefixtype='size_t'
20354 : XXX Maybe we should just give up here.
20356 echo "Help: I can't seem to compile the db test program." >&4
20357 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20360 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20362 *) db_prefixtype='size_t'
20366 : Check what kind of inf/nan your system has
20367 $echo "Checking the kind of infinities and nans you have..." >&4
20369 #define DOUBLESIZE $doublesize
20370 #$d_longdbl HAS_LONG_DOUBLE
20371 #ifdef HAS_LONG_DOUBLE
20372 #define LONGDBLSIZE $longdblsize
20373 #define LONGDBLKIND $longdblkind
20380 /* Note that whether the sign bit is on or off
20381 * for NaN depends on the CPU/FPU, and possibly
20382 * can be affected by the build toolchain.
20384 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20385 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20386 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20387 * (respectively) as opposed to the more usual
20388 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20390 static void bytes(unsigned char *p, unsigned int n) {
20392 for (i = 0; i < n; i++) {
20393 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20396 int main(int argc, char *argv[]) {
20397 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20398 * because some compilers are 'smart' and not only warn but refuse to
20399 * compile such 'illegal' values. */
20400 double dinf = exp(1e9);
20401 double dnan = sqrt(-1.0);
20402 #ifdef HAS_LONG_DOUBLE
20403 long double ldinf = (long double)exp(1e9);
20404 long double ldnan = (long double)sqrt(-1.0);
20407 switch (argv[1][0]) {
20408 case '1': bytes(&dinf, sizeof(dinf)); break;
20409 case '2': bytes(&dnan, sizeof(dnan)); break;
20410 #ifdef HAS_LONG_DOUBLE
20411 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20412 /* the 80-bit long doubles might have garbage in their excess bytes */
20413 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20415 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20416 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20424 if eval $compile; then
20425 doubleinfbytes=`$run ./try 1`
20426 doublenanbytes=`$run ./try 2`
20427 case "$d_longdbl" in
20429 longdblinfbytes=`$run ./try 3`
20430 longdblnanbytes=`$run ./try 4`
20434 # Defaults in case the above test program failed.
20435 case "$doublekind" in
20436 1) # IEEE 754 32-bit LE
20437 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20438 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20440 2) # IEEE 754 32-bit BE
20441 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20442 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20444 3) # IEEE 754 64-bit LE
20445 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20446 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20448 4) # IEEE 754 64-bit BE
20449 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20450 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20452 5) # IEEE 754 128-bit LE
20453 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20454 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20456 6) # IEEE 754 128-bit BE
20457 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20458 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20460 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20461 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20462 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20464 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20465 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20466 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20469 doubleinfbytes=$undef
20470 doublenanbytes=$undef
20473 case "$longdblkind" in
20474 1) # IEEE 754 128-bit LE
20475 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20476 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20478 2) # IEEE 754 128-bit BE
20479 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20480 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20482 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20483 case "$longdblsize" in
20484 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20485 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20486 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20489 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20490 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20493 longdblinfbytes=$undef
20494 longdblnanbytes=$undef
20498 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20499 case "$longdblsize" in
20500 12) # 32-bit system
20501 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20502 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20504 16) # 64-bit system
20505 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20506 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20509 longdblinfbytes=$undef
20510 longdblnanbytes=$undef
20514 5) # 128-bit LE "double double"
20515 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20516 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20518 6) # 128-bit BE "double double"
20519 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20520 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20523 longdblinfbytes=$undef
20524 longdblnanbytes=$undef
20530 : Check the length of the double mantissa
20531 $echo "Checking how many mantissa bits your doubles have..." >&4
20534 #$i_sunmath I_SUNMATH
20536 # include <float.h>
20539 # include <sunmath.h>
20541 #ifdef DBL_MANT_DIG
20542 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20545 int main(int argc, char *argv[]) {
20547 printf("%d\n", BITS);
20553 if eval $compile; then
20554 doublemantbits=`$run ./try`
20556 doublemantbits="$undef"
20560 : Check the length of the longdouble mantissa
20561 $echo "Checking how many mantissa bits your long doubles have..." >&4
20564 #$i_sunmath I_SUNMATH
20566 # include <float.h>
20569 # include <sunmath.h>
20571 #$d_longdbl HAS_LONG_DOUBLE
20572 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20573 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20574 /* This format has no implicit bit. Beware, however, that for
20575 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20576 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20577 * and the top bit must have been one since 387, zero is plain invalid.
20578 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20579 # define BITS LDBL_MANT_DIG
20580 # elif ($longdblkind == 5 || $longdblkind == 6) /* double double */
20581 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20582 * reason e.g. Irix thinks 107. But in any case, we want only
20583 * the number of real bits, the implicit bits are of no interest. */
20584 # define BITS 2 * (DBL_MANT_DIG - 1)
20586 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20590 int main(int argc, char *argv[]) {
20592 printf("%d\n", BITS);
20598 if eval $compile; then
20599 longdblmantbits=`$run ./try`
20601 longdblmantbits="$undef"
20605 : Check the length of the NV mantissa
20606 $echo "Checking how many mantissa bits your NVs have..." >&4
20607 if test "X$usequadmath" = "X$define"; then
20608 nvmantbits=112 # 128-1-15
20610 if test "X$nvsize" = "X$doublesize"; then
20611 nvmantbits="$doublemantbits"
20613 if test "X$nvsize" = "X$longdblsize"; then
20614 nvmantbits="$longdblmantbits"
20616 nvmantbits="$undef"
20621 : How can we generate normalized random numbers ?
20623 echo "Using our internal random number implementation..." >&4
20626 *-Dmy_rand=*|*-Dmy_srand=*)
20627 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20628 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20629 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20630 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20634 randfunc=Perl_drand48
20635 drand01="Perl_drand48()"
20636 seedfunc="Perl_drand48_init"
20640 : Determine if this is an EBCDIC system
20642 echo "Determining whether or not we are on an EBCDIC system..." >&4
20643 $cat >try.c <<'EOM'
20646 if ('M'==0xd4) return 0;
20653 if eval $compile_ok; then
20654 if $run ./try; then
20655 echo "You seem to speak EBCDIC." >&4
20658 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20661 echo "I'm unable to compile the test program." >&4
20662 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20668 : Check how to flush
20671 Checking how to flush all pending stdio output...
20673 # I only know how to find the first 32 possibly open files on SunOS.
20674 # See also hints/sunos_4_1.sh and util.c --AD
20676 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20678 $cat >>try.c <<EOCP
20680 #$i_stdlib I_STDLIB
20682 #include <stdlib.h>
20684 #$i_unistd I_UNISTD
20686 # include <unistd.h>
20688 #$d_sysconf HAS_SYSCONF
20689 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20690 #ifdef HAS_STDIO_STREAM_ARRAY
20691 # define STDIO_STREAM_ARRAY $stdio_stream_array
20696 p = fopen("try.out", "w");
20700 # ifdef TRY_FPRINTF
20704 #ifdef TRY_FFLUSH_NULL
20707 #ifdef TRY_FFLUSH_ALL
20709 long open_max = -1;
20710 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20711 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20713 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20714 open_max = sysconf(_SC_OPEN_MAX);
20717 open_max = FOPEN_MAX;
20720 open_max = OPEN_MAX;
20729 # ifdef HAS_STDIO_STREAM_ARRAY
20730 if (open_max > 0) {
20732 for (i = 0; i < open_max; i++)
20733 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20734 STDIO_STREAM_ARRAY[i]._file < open_max &&
20735 STDIO_STREAM_ARRAY[i]._flag)
20736 fflush(&STDIO_STREAM_ARRAY[i]);
20744 : first we have to find out how _not_ to flush
20746 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20748 set try -DTRY_FPUTC
20749 if eval $compile; then
20750 $run ./try 2>/dev/null
20753 if $test ! -s try.out -a "X$code" = X42; then
20759 set try -DTRY_FPRINTF
20760 if eval $compile; then
20761 $run ./try 2>/dev/null
20764 if $test ! -s try.out -a "X$code" = X42; then
20765 output=-DTRY_FPRINTF
20771 : check for fflush NULL behavior
20772 case "$fflushNULL" in
20773 '') set try -DTRY_FFLUSH_NULL $output
20774 if eval $compile; then
20775 $run ./try 2>/dev/null
20778 if $test -s try.out -a "X$code" = X42; then
20779 fflushNULL="`$cat try.out`"
20781 if $test "X$code" != X42; then
20783 (If this test failed, don't worry, we'll try another method shortly.)
20788 $rm -f core try.core core.try.*
20789 case "$fflushNULL" in
20791 Your fflush(NULL) works okay for output streams.
20792 Let's see if it clobbers input pipes...
20794 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20795 # bug that improperly flushes the input end of pipes. So we avoid the
20796 # autoflush on fork/system/exec support for now. :-(
20797 $cat >tryp.c <<EOCP
20800 main(int argc, char **argv)
20806 while ((i = getc(stdin)) != -1
20807 && (*bp++ = i) != '\n'
20808 && bp < &buf[1024])
20811 fprintf(stdout, "%s", buf);
20819 fflushNULL="$define"
20821 if eval $compile; then
20823 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20824 if $test "X$targethost" != X; then
20827 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20829 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20831 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20833 fflush(NULL) seems to behave okay with input streams.
20835 fflushNULL="$define"
20838 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20840 fflushNULL="$undef"
20843 $rm -f core tryp.c tryp.core core.tryp.*
20846 Your fflush(NULL) isn't working (contrary to ANSI C).
20848 fflushNULL="$undef"
20851 Cannot figure out whether your fflush(NULL) works or not.
20852 I'm assuming it doesn't (contrary to ANSI C).
20854 fflushNULL="$undef"
20858 $define|true|[yY]*)
20859 fflushNULL="$define"
20862 fflushNULL="$undef"
20865 : check explicit looping only if NULL did not work, and if the pipe
20866 : bug does not show up on an explicit flush too
20867 case "$fflushNULL" in
20869 $cat >tryp.c <<EOCP
20872 main(int argc, char **argv)
20878 while ((i = getc(stdin)) != -1
20879 && (*bp++ = i) != '\n'
20880 && bp < &buf[1024])
20883 fprintf(stdout, "%s", buf);
20892 if eval $compile; then
20894 if $test "X$targethost" != X; then
20897 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20899 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20901 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20903 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20905 : now check for fflushall behaviour
20906 case "$fflushall" in
20907 '') set try -DTRY_FFLUSH_ALL $output
20908 if eval $compile; then
20910 (Now testing the other method--but note that this also may fail.)
20912 $run ./try 2>/dev/null
20915 if $test -s try.out -a "X$code" = X42; then
20916 fflushall="`$cat try.out`"
20920 case "$fflushall" in
20922 Whew. Flushing explicitly all the stdio streams works.
20924 fflushall="$define"
20927 Sigh. Flushing explicitly all the stdio streams doesn't work.
20932 Cannot figure out whether flushing stdio streams explicitly works or not.
20933 I'm assuming it doesn't.
20939 "$define"|true|[yY]*)
20940 fflushall="$define"
20948 All is futile. Even fflush(stdin) clobbers input pipes!
20955 $rm -f core tryp.c tryp.core core.tryp.*
20957 *) fflushall="$undef"
20961 case "$fflushNULL$fflushall" in
20964 OK, I give up. I cannot figure out how to flush pending stdio output.
20965 We won't be flushing handles at all before fork/exec/popen.
20971 : Store the full pathname to the ar program for use in the C program
20972 : Respect a hint or command line value for full_ar.
20977 : Store the full pathname to the sed program for use in the C program
20980 : see what type gids are declared as in the kernel
20982 echo "Looking for the type for group ids returned by getgid()."
20983 set gid_t gidtype xxx stdio.h sys/types.h
20987 xxx=`./findhdr sys/user.h`
20988 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20990 unsigned) dflt="$1 $2" ;;
20994 *) dflt="$gidtype";;
20997 gid_t) echo "gid_t found." ;;
20998 *) rp="What is the type for group ids returned by getgid()?"
21004 : Check the size of GID
21007 *_t) zzz="$gidtype" ;;
21010 echo "Checking the size of $zzz..." >&4
21012 #include <sys/types.h>
21014 #$i_stdlib I_STDLIB
21016 #include <stdlib.h>
21019 printf("%d\n", (int)sizeof($gidtype));
21024 if eval $compile_ok; then
21028 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21031 echo "Your $zzz is $gidsize bytes long."
21036 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21040 : Check if GID is signed
21043 *_t) zzz="$gidtype" ;;
21046 echo "Checking the sign of $zzz..." >&4
21048 #include <sys/types.h>
21059 if eval $compile; then
21063 echo "(I can't execute the test program--guessing unsigned.)" >&4
21067 1) echo "Your $zzz is unsigned." ;;
21068 -1) echo "Your $zzz is signed." ;;
21074 echo "(I can't compile the test program--guessing unsigned.)" >&4
21078 : Check 64bit sizes
21081 if $test X"$quadtype" != X; then
21083 echo "Checking how to print 64-bit integers..." >&4
21085 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21086 $cat >try.c <<'EOCP'
21087 #include <sys/types.h>
21090 int q = 12345678901;
21091 printf("%ld\n", q);
21095 if eval $compile; then
21099 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21100 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21101 echo "We will use %d."
21107 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21108 $cat >try.c <<'EOCP'
21109 #include <sys/types.h>
21112 long q = 12345678901;
21113 printf("%ld\n", q);
21117 if eval $compile; then
21121 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21122 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21123 echo "We will use %ld."
21129 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21130 $cat >try.c <<'EOCP'
21131 #include <sys/types.h>
21132 #include <inttypes.h>
21135 int64_t q = 12345678901;
21136 printf("%" PRId64 "\n", q);
21140 if eval $compile; then
21144 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21145 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21146 echo "We will use the C9X style."
21152 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21154 #include <sys/types.h>
21157 $quadtype q = 12345678901;
21158 printf("%Ld\n", q);
21162 if eval $compile; then
21166 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21167 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21168 echo "We will use %Ld."
21174 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21175 $cat >try.c <<'EOCP'
21176 #include <sys/types.h>
21179 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21180 printf("%lld\n", q);
21184 if eval $compile; then
21188 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21189 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21190 echo "We will use the %lld style."
21196 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21198 #include <sys/types.h>
21201 $quadtype q = 12345678901;
21202 printf("%qd\n", q);
21206 if eval $compile; then
21210 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21211 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21212 echo "We will use %qd."
21218 if $test X"$sPRId64" = X; then
21219 echo "Cannot figure out how to print 64-bit integers." >&4
21226 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21227 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21229 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21230 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21234 : Check format strings for internal types
21236 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21238 if $test X"$ivsize" = X8; then
21239 ivdformat="$sPRId64"
21240 uvuformat="$sPRIu64"
21241 uvoformat="$sPRIo64"
21242 uvxformat="$sPRIx64"
21243 uvXUformat="$sPRIXU64"
21245 if $test X"$ivsize" = X"$longsize"; then
21252 if $test X"$ivsize" = X"$intsize"; then
21260 if $test X"$ivsize" = X"$shortsize"; then
21271 if $test X"$usequadmath" = X"$define"; then
21279 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21280 nveformat="$sPRIeldbl"
21281 nvfformat="$sPRIfldbl"
21282 nvgformat="$sPRIgldbl"
21283 nvEUformat="$sPRIEUldbl"
21284 nvFUformat="$sPRIFUldbl"
21285 nvGUformat="$sPRIGUldbl"
21296 case "$ivdformat" in
21297 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21302 : Check format string for GID
21305 $echo "Checking the format string to be used for gids..." >&4
21308 -1) if $test X"$gidsize" = X"$ivsize"; then
21309 gidformat="$ivdformat"
21311 if $test X"$gidsize" = X"$longsize"; then
21314 if $test X"$gidsize" = X"$intsize"; then
21317 if $test X"$gidsize" = X"$shortsize"; then
21324 *) if $test X"$gidsize" = X"$uvsize"; then
21325 gidformat="$uvuformat"
21327 if $test X"$gidsize" = X"$longsize"; then
21330 if $test X"$gidsize" = X"$intsize"; then
21333 if $test X"$gidsize" = X"$shortsize"; then
21342 : see if getgroups exists
21343 set getgroups d_getgrps
21346 : see if setgroups exists
21347 set setgroups d_setgrps
21350 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21352 case "$d_getgrps$d_setgrps" in
21354 case "$groupstype" in
21355 '') dflt="$gidtype" ;;
21356 *) dflt="$groupstype" ;;
21359 What type of pointer is the second argument to getgroups() and setgroups()?
21360 Usually this is the same as group ids, $gidtype, but not always.
21363 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21367 *) groupstype="$gidtype";;
21370 : check whether make sets MAKE
21372 echo "Checking if your $make program sets \$(MAKE)..." >&4
21373 case "$make_set_make" in
21375 $sed 's/^X //' > testmake.mak << 'EOF'
21377 X @echo 'maketemp="$(MAKE)"'
21379 case "`$make -f testmake.mak 2>/dev/null`" in
21380 *maketemp=*) make_set_make='#' ;;
21381 *) make_set_make="MAKE=$make" ;;
21383 $rm -f testmake.mak
21386 case "$make_set_make" in
21387 '#') echo "Yup, it does.";;
21388 *) echo "Nope, it doesn't.";;
21391 : see what type is used for mode_t
21392 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21393 set mode_t modetype int stdio.h sys/types.h
21396 : see if we need va_copy
21398 case "$i_stdarg" in
21401 #include <stdarg.h>
21403 #$i_stdlib I_STDLIB
21405 #include <stdlib.h>
21407 #include <signal.h>
21410 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21412 return vfprintf(f, fmt, *valp);
21416 myvfprintf(FILE *f, const char *fmt, va_list val)
21418 return ivfprintf(f, fmt, &val);
21422 myprintf(char *fmt, ...)
21425 va_start(val, fmt);
21426 return myvfprintf(stdout, fmt, val);
21430 main(int ac, char **av)
21432 signal(SIGSEGV, exit);
21434 myprintf("%s%cs all right, then\n", "that", '\'');
21439 if eval $compile && $run ./try 2>&1 >/dev/null; then
21440 case "`$run ./try`" in
21441 "that's all right, then")
21447 yes) echo "It seems that you don't need va_copy()." >&4
21448 need_va_copy="$undef"
21450 *) echo "It seems that va_copy() or similar will be needed." >&4
21451 need_va_copy="$define"
21456 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21457 need_va_copy="$undef"
21461 : see what type is used for size_t
21462 rp="What is the type used for the length parameter for string functions?"
21463 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21466 : check for type of arguments to gethostbyaddr.
21467 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21468 case "$d_gethbyaddr" in
21472 Checking to see what type of arguments are accepted by gethostbyaddr().
21474 hdrs="$define sys/types.h
21475 $d_socket sys/socket.h
21476 $i_niin netinet/in.h
21478 $i_unistd unistd.h"
21479 : The first arg can 'char *' or 'void *'
21480 : The second arg is some of integral type
21481 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21482 for yyy in size_t long int; do
21483 case "$netdb_host_type" in
21484 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21485 if ./protochk "$try" $hdrs; then
21486 echo "Your system accepts $xxx for the first arg."
21487 echo "...and $yyy for the second arg."
21488 netdb_host_type="$xxx"
21489 netdb_hlen_type="$yyy"
21495 : In case none of those worked, prompt the user.
21496 case "$netdb_host_type" in
21497 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21500 netdb_host_type=$ans
21501 rp='What is the type for the 2nd argument to gethostbyaddr?'
21504 netdb_hlen_type=$ans
21508 *) : no gethostbyaddr, so pick harmless defaults
21509 netdb_host_type='char *'
21510 netdb_hlen_type="$sizetype"
21513 # Remove the "const" if needed. -- but then we'll have a
21515 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21518 : check for type of argument to gethostbyname.
21519 if test "X$netdb_name_type" = X ; then
21520 case "$d_gethbyname" in
21524 Checking to see what type of argument is accepted by gethostbyname().
21526 hdrs="$define sys/types.h
21527 $d_socket sys/socket.h
21528 $i_niin netinet/in.h
21530 $i_unistd unistd.h"
21531 for xxx in "const char *" "char *"; do
21532 case "$netdb_name_type" in
21533 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21534 if ./protochk "$try" $hdrs; then
21535 echo "Your system accepts $xxx."
21536 netdb_name_type="$xxx"
21541 : In case none of those worked, prompt the user.
21542 case "$netdb_name_type" in
21543 '') rp='What is the type for the 1st argument to gethostbyname?'
21546 netdb_name_type=$ans
21550 *) : no gethostbyname, so pick harmless default
21551 netdb_name_type='char *'
21556 : check for type of 1st argument to getnetbyaddr.
21557 if test "X$netdb_net_type" = X ; then
21558 case "$d_getnbyaddr" in
21562 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21564 hdrs="$define sys/types.h
21565 $d_socket sys/socket.h
21566 $i_niin netinet/in.h
21568 $i_unistd unistd.h"
21569 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21570 case "$netdb_net_type" in
21571 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21572 if ./protochk "$try" $hdrs; then
21573 echo "Your system accepts $xxx."
21574 netdb_net_type="$xxx"
21579 : In case none of those worked, prompt the user.
21580 case "$netdb_net_type" in
21581 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21584 netdb_net_type=$ans
21588 *) : no getnetbyaddr, so pick harmless default
21589 netdb_net_type='long'
21593 : locate the preferred pager for this system
21600 [a-zA-Z]:/*) dflt=$pg;;
21604 [a-zA-Z]:/*) dflt=$more;;
21608 [a-zA-Z]:/*) dflt=$less;;
21611 '') dflt=/usr/ucb/more;;
21619 rp='What pager is used on your system?'
21623 : see what type pids are declared as in the kernel
21624 rp="What is the type of process ids on this system?"
21625 set pid_t pidtype int stdio.h sys/types.h
21628 : see if ar generates random libraries by itself
21630 echo "Checking how to generate random libraries on your machine..." >&4
21631 echo 'int bar1() { return bar2(); }' > bar1.c
21632 echo 'int bar2() { return 2; }' > bar2.c
21634 #$i_stdlib I_STDLIB
21636 #include <stdlib.h>
21638 int main() { printf("%d\n", bar1()); exit(0); }
21640 $cc $ccflags -c bar1.c >/dev/null 2>&1
21641 $cc $ccflags -c bar2.c >/dev/null 2>&1
21642 $cc $ccflags -c foo.c >/dev/null 2>&1
21643 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21644 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21645 $run ./foobar >/dev/null 2>&1; then
21646 echo "$ar appears to generate random libraries itself."
21648 if [ "X$ranlib" = "X" ]; then
21651 elif $ar s bar$_a >/dev/null 2>&1 &&
21652 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21653 $run ./foobar >/dev/null 2>&1; then
21654 echo "a table of contents needs to be added with '$ar s'."
21657 elif $ar ts bar$_a >/dev/null 2>&1 &&
21658 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21659 $run ./foobar >/dev/null 2>&1; then
21660 echo "a table of contents needs to be added with '$ar ts'."
21667 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21668 $test -f $ranlib || ranlib=''
21671 if $test -n "$ranlib"; then
21672 echo "your system has '$ranlib'; we'll use that."
21675 echo "your system doesn't seem to support random libraries"
21676 echo "so we'll use lorder and tsort to order the libraries."
21683 : see if this is a values.h system
21684 set values.h i_values
21687 : Check the max offset that gmtime and localtime accept
21688 echo "Checking max offsets that gmtime () accepts"
21691 define) yyy="#include <values.h>" ;;
21695 case "$sGMTIME_min/$sGMTIME_max" in
21698 #include <sys/types.h>
21707 void gm_check (time_t t, int min_year, int max_year)
21710 if ( tmp == NULL ||
21711 /* Check tm_year overflow */
21712 tmp->tm_year < min_year || tmp->tm_year > max_year)
21723 gm_check (MAXLONG, 69, 0x7fffffff);
21725 if (tmp == NULL || tmp->tm_year < 0) {
21726 for (i = 63; i >= 0; i--) {
21727 time_t x = pt | ((time_t)1 << i);
21728 if (x < 0 || x < pt) continue;
21729 gm_check (x, 69, 0x7fffffff);
21732 printf ("sGMTIME_max=%ld\n", pt);
21741 gm_check (MINLONG, -1900, 70);
21744 for (i = 36; i >= 0; i--) {
21745 time_t x = pt - ((time_t)1 << i);
21746 if (x > 0) continue;
21747 gm_check (x, -1900, 70);
21750 printf ("sGMTIME_min=%ld\n", pt);
21754 int main (int argc, char *argv[])
21756 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21763 if eval $compile; then
21764 eval `$run ./try 2>/dev/null`
21766 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21772 echo "Checking max offsets that localtime () accepts"
21774 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21777 #include <sys/types.h>
21786 void local_check (time_t t, int min_year, int max_year)
21788 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21791 tmp = localtime (&t);
21792 if ( tmp == NULL ||
21793 /* Check tm_year overflow */
21794 tmp->tm_year < min_year || tmp->tm_year > max_year)
21798 } /* local_check */
21805 local_check (MAXLONG, 69, 0x7fffffff);
21807 if (tmp == NULL || tmp->tm_year < 0) {
21808 for (i = 63; i >= 0; i--) {
21809 time_t x = pt | ((time_t)1 << i);
21810 if (x < 0 || x < pt) continue;
21811 local_check (x, 69, 0x7fffffff);
21814 printf ("sLOCALTIME_max=%ld\n", pt);
21823 local_check (MINLONG, -1900, 70);
21826 for (i = 36; i >= 0; i--) {
21827 time_t x = pt - ((time_t)1 << i);
21828 if (x > 0) continue;
21829 local_check (x, -1900, 70);
21832 printf ("sLOCALTIME_min=%ld\n", pt);
21836 int main (int argc, char *argv[])
21844 if eval $compile; then
21845 eval `$run ./try 2>/dev/null`
21847 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21853 : check for type of arguments to select.
21854 case "$selecttype" in
21855 '') case "$d_select" in
21859 Checking to see what type of arguments are accepted by select().
21861 hdrs="$define sys/types.h
21862 $i_systime sys/time.h
21863 $i_sysselct sys/select.h
21864 $d_socket sys/socket.h"
21865 : The first arg can be int, unsigned, or size_t
21866 : The last arg may or may not be 'const'
21868 : void pointer has been seen but using that
21869 : breaks the selectminbits test
21870 for xxx in 'fd_set *' 'int *'; do
21871 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21872 for tmo in 'struct timeval *' 'const struct timeval *'; do
21874 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21875 if ./protochk "$try" $hdrs; then
21876 echo "Your system accepts $xxx."
21885 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21886 case "$d_fd_set" in
21887 $define) dflt="fd_set *" ;;
21896 *) : no select, so pick a harmless default
21903 : check for the select 'width'
21904 case "$selectminbits" in
21905 '') safebits=`expr $ptrsize \* 8`
21906 case "$d_select" in
21910 Checking to see on how many bits at a time your select() operates...
21913 #include <sys/types.h>
21915 #$i_systime I_SYS_TIME
21916 #$i_systimek I_SYS_TIME_KERNEL
21921 # ifdef I_SYS_TIME_KERNEL
21924 # include <sys/time.h>
21925 # ifdef I_SYS_TIME_KERNEL
21929 #$i_sysselct I_SYS_SELECT
21930 #ifdef I_SYS_SELECT
21931 #include <sys/select.h>
21933 #$d_socket HAS_SOCKET
21935 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21938 #$i_stdlib I_STDLIB
21940 #include <stdlib.h>
21943 #define S sizeof(*(b))
21945 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21946 #define NBITS (NBYTES * 8)
21948 char *s = (char *)malloc(NBYTES);
21957 fp = fopen("try.c", "r");
21963 b = ($selecttype)s;
21964 for (i = 0; i < NBITS; i++)
21968 select(fd + 1, b, 0, 0, &t);
21969 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21971 printf("%d\n", i + 1);
21976 if eval $compile_ok; then
21977 selectminbits=`$run ./try 2>/dev/null`
21978 case "$selectminbits" in
21980 Cannot figure out on how many bits at a time your select() operates.
21981 I'll play safe and guess it is $safebits bits.
21983 selectminbits=$safebits
21984 bits="$safebits bits"
21987 *) bits="$selectminbits bits" ;;
21989 echo "Your select() operates on $bits at a time." >&4
21991 rp='What is the minimum number of bits your select() operates on?'
21992 case "$byteorder" in
21993 12345678) dflt=64 ;;
21999 selectminbits="$val"
22003 *) : no select, so pick a harmless default
22004 selectminbits=$safebits
22010 : Trace out the files included by signal.h, then look for SIGxxx names.
22011 case "$sig_num_init" in
22013 if [ "X$fieldn" = X ]; then
22014 : Just make some guesses. We check them later.
22015 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22017 xxx=`echo '#include <signal.h>' |
22018 $cppstdin $cppminus $cppflags 2>/dev/null |
22019 $grep '^[ ]*#.*include' |
22020 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22021 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22024 for xx in $xxx /dev/null ; do
22025 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22027 case "$xxxfiles" in
22028 '') xxxfiles=`./findhdr signal.h` ;;
22031 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22032 print substr($2, 4, 20)
22034 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22035 print substr($3, 4, 20)
22037 : Append some common names just in case the awk scan failed.
22038 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22039 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22040 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22041 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22042 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22044 : generate a few handy files for later
22045 $cat > signal.c <<EOCP
22046 #include <sys/types.h>
22047 #include <signal.h>
22048 #$i_stdlib I_STDLIB
22050 #include <stdlib.h>
22055 /* Strange style to avoid deeply-nested #if/#else/#endif */
22058 # define NSIG (_NSIG)
22064 # define NSIG (SIGMAX+1)
22070 # define NSIG (SIG_MAX+1)
22076 # define NSIG (_SIG_MAX+1)
22082 # define NSIG (MAXSIG+1)
22088 # define NSIG (MAX_SIG+1)
22093 # ifdef SIGARRAYSIZE
22094 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22100 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22104 /* Default to some arbitrary number that's big enough to get most
22105 of the common signals.
22111 printf("NSIG %d\n", NSIG);
22117 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22119 printf "#ifdef SIG"; printf $1; printf "\n"
22120 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22121 printf $1; printf ");\n"
22125 printf "#endif /* JUST_NSIG */\n";
22126 printf "exit(0);\n}\n";
22129 $cat >signal.awk <<'EOP'
22130 BEGIN { ndups = 0 }
22131 $1 ~ /^NSIG$/ { nsig = $2 }
22132 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22133 if ($2 > maxsig) { maxsig = $2 }
22134 if (sig_name[$2]) {
22135 dup_name[ndups] = $1
22136 dup_num[ndups] = $2
22148 printf("NSIG %d\n", nsig);
22149 for (n = 1; n < nsig; n++) {
22151 printf("%s %d\n", sig_name[n], sig_num[n])
22154 printf("NUM%d %d\n", n, n)
22157 for (n = 0; n < ndups; n++) {
22158 printf("%s %d\n", dup_name[n], dup_num[n])
22162 $cat >signal_cmd <<EOS
22164 if $test -s signal.lst; then
22165 echo "Using your existing signal.lst file"
22170 $cat >>signal_cmd <<'EOS'
22173 if eval $compile_ok; then
22174 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22175 $uniq | $awk -f signal.awk >signal.lst
22177 echo "(I can't seem be able to compile the whole test program)" >&4
22178 echo "(I'll try it in little pieces.)" >&4
22179 set signal -DJUST_NSIG
22180 if eval $compile_ok; then
22181 $run ./signal$_exe > signal.nsg
22184 echo "I can't seem to figure out how many signals you have." >&4
22185 echo "Guessing 50." >&4
22186 echo 'NSIG 50' > signal.nsg
22188 : Now look at all the signal names, one at a time.
22189 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22190 $cat > signal.c <<EOCP
22191 #include <sys/types.h>
22192 #include <signal.h>
22195 printf("$xx %d\n", SIG${xx});
22200 if eval $compile; then
22201 echo "SIG${xx} found."
22202 $run ./signal$_exe >> signal.ls1
22204 echo "SIG${xx} NOT found."
22207 if $test -s signal.ls1; then
22208 $cat signal.nsg signal.ls1 |
22209 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22213 if $test -s signal.lst; then
22216 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22217 echo 'kill -l' >signal
22218 set X `csh -f <signal`
22222 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22224 echo $@ | $tr ' ' $trnl | \
22225 $awk '{ printf "%s %d\n", $1, ++s; }
22226 END { printf "NSIG %d\n", ++s }' >signal.lst
22228 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22230 chmod a+x signal_cmd
22231 $eunicefix signal_cmd
22233 : generate list of signal names
22235 case "$sig_name_init" in
22237 *) case "$sig_num_init" in
22238 ''|*,*) doinit=yes ;;
22243 echo "Generating a list of signal names and numbers..." >&4
22245 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22246 sig_name=`$awk 'BEGIN { printf "ZERO " }
22247 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22248 sig_num=`$awk 'BEGIN { printf "0 " }
22249 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22250 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22251 !/^NSIG/ { printf "\"%s\", ", $1 }
22252 END { printf "0\n" }' signal.lst`
22253 sig_num_init=`$awk 'BEGIN { printf "0, " }
22254 !/^NSIG/ { printf "%d, ", $2}
22255 END { printf "0\n"}' signal.lst`
22258 echo "The following $sig_count signals are available:"
22260 echo $sig_name | $awk \
22261 'BEGIN { linelen = 0 }
22263 for (i = 1; i <= NF; i++) {
22264 name = "SIG" $i " "
22265 linelen = linelen + length(name)
22266 if (linelen > 70) {
22268 linelen = length(name)
22274 sig_size=`echo $sig_name | awk '{print NF}'`
22275 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22279 : Check size of size
22281 case "$sizetype" in
22282 *_t) zzz="$sizetype" ;;
22283 *) zzz="filesize" ;;
22285 echo "Checking the size of $zzz..." >&4
22287 #include <sys/types.h>
22289 #$i_stdlib I_STDLIB
22291 #include <stdlib.h>
22294 printf("%d\n", (int)sizeof($sizetype));
22299 if eval $compile_ok; then
22303 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22306 echo "Your $zzz size is $sizesize bytes."
22311 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22315 : check for socklen_t
22317 echo "Checking to see if you have socklen_t..." >&4
22319 #include <sys/types.h>
22320 #$d_socket HAS_SOCKET
22322 #include <sys/socket.h>
22324 int main() { socklen_t x = 16; }
22327 if eval $compile; then
22329 echo "You have socklen_t."
22332 echo "You do not have socklen_t."
22333 case "$sizetype" in
22334 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22341 : see if this is a socks.h system
22342 set socks.h i_socks
22345 : check for type of the size argument to socket calls
22346 case "$d_socket" in
22350 Checking to see what type is the last argument of accept().
22353 case "$d_socklen_t" in
22354 "$define") yyy="$yyy socklen_t"
22356 yyy="$yyy $sizetype int long unsigned"
22357 for xxx in $yyy; do
22358 case "$socksizetype" in
22359 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22360 case "$usesocks" in
22362 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22363 echo "Your system accepts '$xxx *' for the last argument of accept()."
22364 socksizetype="$xxx"
22367 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22368 echo "Your system accepts '$xxx *' for the last argument of accept()."
22369 socksizetype="$xxx"
22376 : In case none of those worked, prompt the user.
22377 case "$socksizetype" in
22378 '') rp='What is the type for socket address structure sizes?'
22385 *) : no sockets, so pick relatively harmless default
22390 : see what type is used for signed size_t
22391 set ssize_t ssizetype int stdio.h sys/types.h
22396 #$i_stdlib I_STDLIB
22398 #include <stdlib.h>
22400 #include <sys/types.h>
22401 #define Size_t $sizetype
22402 #define SSize_t $dflt
22405 if (sizeof(Size_t) == sizeof(SSize_t))
22407 else if (sizeof(Size_t) == sizeof(int))
22416 if eval $compile_ok && $run ./try > /dev/null; then
22417 ssizetype=`$run ./try`
22418 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22421 Help! I can't compile and run the ssize_t test program: please enlighten me!
22422 (This is probably a misconfiguration in your system or libraries, and
22423 you really ought to fix it. Still, I'll try anyway.)
22425 I need a type that is the same size as $sizetype, but is guaranteed to
22426 be signed. Common values are ssize_t, int and long.
22429 rp="What signed type is the same size as $sizetype?"
22435 : Check the size of st_ino
22437 $echo "Checking the size of st_ino..." >&4
22438 $cat > try.c <<EOCP
22439 #include <sys/stat.h>
22441 #$i_stdlib I_STDLIB
22443 #include <stdlib.h>
22447 printf("%d\n", (int)sizeof(st.st_ino));
22452 if eval $compile_ok; then
22456 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22458 *) st_ino_size=$val
22459 $echo "Your st_ino is $st_ino_size bytes long."
22464 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22468 : Check if st_ino is signed
22470 $echo "Checking the sign of st_ino..." >&4
22471 $cat > try.c <<EOCP
22472 #include <sys/stat.h>
22477 if (foo.st_ino < 0)
22484 if eval $compile; then
22488 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22490 *) st_ino_sign=$val
22491 case "$st_ino_sign" in
22492 1) $echo "Your st_ino is unsigned." ;;
22493 -1) $echo "Your st_ino is signed." ;;
22499 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22503 : see what type of char stdio uses.
22505 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22506 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22507 echo "Your stdio uses unsigned chars." >&4
22508 stdchar="unsigned char"
22510 echo "Your stdio uses signed chars." >&4
22515 : see what type uids are declared as in the kernel
22517 echo "Looking for the type for user ids returned by getuid()."
22518 set uid_t uidtype xxx stdio.h sys/types.h
22522 xxx=`./findhdr sys/user.h`
22523 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
22525 unsigned) dflt="$1 $2" ;;
22529 *) dflt="$uidtype";;
22532 uid_t) echo "uid_t found." ;;
22533 *) rp="What is the type for user ids returned by getuid()?"
22539 : Check size of UID
22542 *_t) zzz="$uidtype" ;;
22545 echo "Checking the size of $zzz..." >&4
22547 #include <sys/types.h>
22549 #$i_stdlib I_STDLIB
22551 #include <stdlib.h>
22554 printf("%d\n", (int)sizeof($uidtype));
22559 if eval $compile_ok; then
22563 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22566 echo "Your $zzz is $uidsize bytes long."
22571 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22574 : Check if UID is signed
22577 *_t) zzz="$uidtype" ;;
22580 echo "Checking the sign of $zzz..." >&4
22582 #include <sys/types.h>
22593 if eval $compile; then
22597 echo "(I can't execute the test program--guessing unsigned.)" >&4
22601 1) echo "Your $zzz is unsigned." ;;
22602 -1) echo "Your $zzz is signed." ;;
22608 echo "(I can't compile the test program--guessing unsigned.)" >&4
22612 : Check format string for UID
22614 $echo "Checking the format string to be used for uids..." >&4
22617 -1) if $test X"$uidsize" = X"$ivsize"; then
22618 uidformat="$ivdformat"
22620 if $test X"$uidsize" = X"$longsize"; then
22623 if $test X"$uidsize" = X"$intsize"; then
22626 if $test X"$uidsize" = X"$shortsize"; then
22633 *) if $test X"$uidsize" = X"$uvsize"; then
22634 uidformat="$uvuformat"
22636 if $test X"$uidsize" = X"$longsize"; then
22639 if $test X"$uidsize" = X"$intsize"; then
22642 if $test X"$uidsize" = X"$shortsize"; then
22651 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22653 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22654 $cat >try.c <<'EOM'
22655 /* Intentionally a long probe as I'd like to sanity check that the exact
22656 approach is going to work, as thinking it will work, but only having it
22657 part working at runtime is worse than not having it. */
22659 #include <sys/types.h>
22660 #include <sys/sysctl.h>
22661 #include <sys/param.h>
22663 #include <string.h>
22664 #include <stdlib.h>
22665 #include <unistd.h>
22668 main(int argc, char **argv) {
22670 char *argv_leaf = strrchr(argv[0], '/');
22676 mib[1] = KERN_PROC;
22677 mib[2] = KERN_PROC_PATHNAME;
22681 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22685 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22690 if (size < strlen(argv_leaf) + 1) {
22691 fprintf(stderr, "size %lu is too short for a path\n",
22692 (unsigned long) size);
22696 if (size > MAXPATHLEN * MAXPATHLEN) {
22697 fprintf(stderr, "size %lu is too long for a path\n",
22698 (unsigned long) size);
22702 buffer = malloc(size);
22708 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22713 if (strlen(buffer) + 1 != size) {
22714 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22715 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22720 if (*buffer != '/') {
22721 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22725 if (strstr(buffer, "/./")) {
22726 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22730 if (strstr(buffer, "/../")) {
22731 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22735 buffer_leaf = strrchr(buffer, '/');
22736 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22737 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22749 if eval $compile; then
22750 if $run ./try; then
22751 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22754 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22758 echo "I'm unable to compile the test program." >&4
22759 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22763 set usekernprocpathname
22766 : Determine if we can use _NSGetExecutablePath to find executing program
22768 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22769 $cat >try.c <<'EOM'
22770 /* Intentionally a long probe as I'd like to sanity check that the exact
22771 approach is going to work, as thinking it will work, but only having it
22772 part working at runtime is worse than not having it. */
22773 #include <mach-o/dyld.h>
22775 #include <stdlib.h>
22776 #include <sys/param.h>
22777 #include <string.h>
22780 main(int argc, char **argv) {
22782 uint32_t size = sizeof(buf);
22786 char *argv_leaf = strrchr(argv[0], '/');
22790 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22794 _NSGetExecutablePath(buf, &size);
22795 if (size > MAXPATHLEN * MAXPATHLEN) {
22796 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22797 (unsigned int) size);
22801 buffer = malloc(size);
22807 result = _NSGetExecutablePath(buffer, &size);
22809 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22810 result, (unsigned int) size);
22814 tidied = realpath(buffer, NULL);
22816 perror("realpath");
22822 if (*tidied != '/') {
22823 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22827 if (strstr(tidied, "/./")) {
22828 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22832 if (strstr(tidied, "/../")) {
22833 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22837 tidied_leaf = strrchr(tidied, '/');
22838 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22839 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22851 if eval $compile; then
22852 if $run ./try; then
22853 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22856 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22859 echo "I'm unable to compile the test program." >&4
22860 echo "I'll assume no _NSGetExecutablePath here." >&4
22863 set usensgetexecutablepath
22866 : Check if site customization support was requested
22867 case "$usesitecustomize" in
22868 $define|true|[Yy]*)
22869 usesitecustomize="$define"
22872 usesitecustomize="$undef"
22876 : see if prototypes support variable argument declarations
22878 case "$prototype$i_stdarg" in
22880 echo "It appears we'll be able to prototype varargs functions." >&4
22884 echo "Too bad... We won't be using prototyped varargs functions..." >&4
22891 : determine compiler compiler
22900 if $test -f "$byacc$_exe"; then
22902 comp="byacc or $comp"
22904 if $test -f "$bison$_exe"; then
22905 comp="$comp or bison -y"
22907 rp="Which compiler compiler ($comp) shall I use?"
22916 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22922 : see if this is a assert.h system
22923 set assert.h i_assert
22926 : see if this is a bfd.h system
22930 : see if this is an execinfo.h system
22931 set execinfo.h i_execinfo
22934 : see if this is a fenv.h system
22938 : see if this is a fp.h system
22942 : see if this is a fp_class.h system
22943 set fp_class.h i_fp_class
22946 : see if gdbm.h is available
22951 : see if gdbm_open exists
22952 set gdbm_open d_gdbm_open
22954 case "$d_gdbm_open" in
22957 echo "We won't be including <gdbm.h>"
22966 : see if this is a ieeefp.h system
22967 case "$i_ieeefp" in
22968 '' ) set ieeefp.h i_ieeefp
22973 : see if this is a libutil.h system
22974 set libutil.h i_libutil
22977 : see if mach cthreads are available
22978 if test "X$usethreads" = "X$define"; then
22979 set mach/cthreads.h i_machcthr
22982 i_machcthr="$undef"
22985 : see if this is a mntent.h system
22986 set mntent.h i_mntent
22989 : see if net/errno.h is available
22991 set net/errno.h val
22994 : Unfortunately, it causes problems on some systems. Arrgh.
22997 cat > try.c <<'EOM'
23000 #include <net/errno.h>
23006 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23007 echo "We'll be including <net/errno.h>." >&4
23009 echo "We won't be including <net/errno.h>." >&4
23018 : see if netinet/tcp.h is available
23019 set netinet/tcp.h i_netinettcp
23022 : see if this is a poll.h system
23026 : see if this is a prot.h system
23030 : Preprocessor symbols
23032 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23033 $cat <<'EOSH' > Cppsym.know
23034 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23035 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23036 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23037 arch_pwr ardent ARM ARM32 atarist att386 att3b
23038 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23039 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23040 byteorder byte_order
23041 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23042 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23043 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23044 ELF encore EPI EXTENSIONS
23045 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23046 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23047 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23048 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23049 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23050 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23051 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23052 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23053 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23055 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23056 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23057 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23059 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23060 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23061 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23062 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23063 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23064 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23065 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23066 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23067 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23068 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23069 ns32000 ns32016 ns32332 ns32k nsc32000
23070 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23071 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23072 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23073 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23075 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23076 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23077 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23078 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23079 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23080 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23081 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23082 SYSV4 SYSV5 sysV68 sysV88
23083 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23084 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23085 tower32_800 tower32_850 tss
23086 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23087 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23088 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23089 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23090 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23091 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23093 vax venix VMESA vms
23094 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23095 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23098 # Maybe put other stuff here too.
23099 ./tr '-' '_' <<EOSH >>Cppsym.know
23102 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23103 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23104 $cat Cppsym.know > Cppsym.c
23105 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23106 $rm -f Cppsym.a Cppsym.b Cppsym.c
23107 cat <<EOSH > Cppsym
23109 if $test \$# -gt 0; then
23110 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23111 if $test -s Cppsym.got; then
23118 $tr " " "$trnl" | ./Cppsym.try
23124 cat <<EOSH > Cppsym.try
23126 cat <<'EOCP' > try.c
23129 #define STRINGIFY(a) "a"
23131 #if cpp_stuff == 42
23132 #define StGiFy(a) #a
23133 #define STRINGIFY(a) StGiFy(a)
23135 #if $cpp_stuff != 1 && $cpp_stuff != 42
23136 # include "Bletch: How does this C preprocessor stringify macros?"
23142 cat <<'EOSH' >> Cppsym.try
23144 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23145 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23146 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23147 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23149 echo 'return 0;}' >> try.c
23151 cat <<EOSH >> Cppsym.try
23153 case "$osname-$gccversion" in
23154 irix-) ccflags="\$ccflags -woff 1178" ;;
23155 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23157 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
23159 chmod +x Cppsym.try
23160 $eunicefix Cppsym.try
23161 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23162 : Add in any Linux cpp "predefined macros":
23163 case "$osname::$gccversion" in
23164 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23166 rm -f $tHdrH'.h' $tHdrH
23168 # Filter out macro arguments, such as Linux's __INT8_C(c)
23169 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23170 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23171 if [ -s $tHdrH'_cppsym.real' ]; then
23172 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23175 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23178 : now check the C compiler for additional symbols
23179 postprocess_cc_v=''
23181 aix) postprocess_cc_v="|$tr , ' '" ;;
23188 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23191 -D*) echo "\$i" | $sed 's/^-D//';;
23192 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23197 postprocess_cc_v=''
23200 ./ccsym > ccsym1.raw
23201 if $test -s ccsym1.raw; then
23202 $sort ccsym1.raw | $uniq >ccsym.raw
23204 mv ccsym1.raw ccsym.raw
23207 $awk '/\=/ { print $0; next }
23208 { print $0"=1" }' ccsym.raw >ccsym.list
23209 $comm -13 Cppsym.true ccsym.list >ccsym.own
23210 $comm -12 Cppsym.true ccsym.list >ccsym.com
23211 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23213 if $test -z ccsym.raw; then
23214 echo "Your C compiler doesn't seem to define any symbols!" >&4
23216 echo "However, your C preprocessor defines the following symbols:"
23219 cppsymbols=`$cat Cppsym.true`
23220 cppsymbols=`echo $cppsymbols`
23221 cppccsymbols="$cppsymbols"
23223 if $test -s ccsym.com; then
23224 echo "Your C compiler and pre-processor define these symbols:"
23225 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23228 cppccsymbols=`$cat ccsym.com`
23229 cppccsymbols=`echo $cppccsymbols`
23230 $test "$silent" || sleep 1
23232 if $test -s ccsym.cpp; then
23233 $test "$also" && echo " "
23234 echo "Your C pre-processor ${also}defines the following symbols:"
23235 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23237 cppsymbols=`$cat ccsym.cpp`
23238 cppsymbols=`echo $cppsymbols`
23239 $test "$silent" || sleep 1
23241 if $test -s ccsym.own; then
23242 $test "$also" && echo " "
23243 echo "Your C compiler ${also}defines the following cpp symbols:"
23244 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23245 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23246 ccsymbols=`$cat ccsym.own`
23247 ccsymbols=`echo $ccsymbols`
23248 $test "$silent" || sleep 1
23252 : add -D_FORTIFY_SOURCE if feasible and not already there
23253 case "$gccversion" in
23254 4.*) case "$optimize$ccflags" in
23255 *-O*) case "$ccflags$cppsymbols" in
23256 *_FORTIFY_SOURCE=*) # Don't add it again.
23257 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23259 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23260 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23264 *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23268 *) echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4
23272 : see if this is a termio system
23276 if $test `./findhdr termios.h`; then
23277 set tcsetattr i_termios
23283 "$define") echo "You have POSIX termios.h... good!" >&4;;
23284 *) if ./Cppsym pyr; then
23285 case "`$run /bin/universe`" in
23286 ucb) if $test `./findhdr sgtty.h`; then
23288 echo "<sgtty.h> found." >&4
23290 echo "System is pyramid with BSD universe."
23291 ./warn "<sgtty.h> not found--you could have problems."
23293 *) if $test `./findhdr termio.h`; then
23295 echo "<termio.h> found." >&4
23297 echo "System is pyramid with USG universe."
23298 ./warn "<termio.h> not found--you could have problems."
23302 if $test `./findhdr termio.h`; then
23303 echo "<termio.h> found." >&4
23305 elif $test `./findhdr sgtty.h`; then
23306 echo "<sgtty.h> found." >&4
23309 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23312 if $test `./findhdr sgtty.h`; then
23313 echo "<sgtty.h> found." >&4
23315 elif $test `./findhdr termio.h`; then
23316 echo "<termio.h> found." >&4
23319 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23323 set i_termio; eval $setvar
23324 val=$val2; set i_sgtty; eval $setvar
23325 val=$val3; set i_termios; eval $setvar
23327 : see if stdbool is available
23328 : we want a real compile instead of Inhdr because some Solaris systems
23329 : have stdbool.h, but it can only be used if the compiler indicates it
23330 : is sufficiently c99-compliant.
23334 #include <stdbool.h>
23339 int main(int argc, char **argv)
23345 if eval $compile; then
23346 echo "<stdbool.h> found." >&4
23349 echo "<stdbool.h> NOT found." >&4
23356 : see if stddef is available
23357 set stddef.h i_stddef
23360 : see if stdint is available
23361 set stdint.h i_stdint
23364 : see if sys/access.h is available
23365 set sys/access.h i_sysaccess
23368 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23369 set sys/filio.h i_sysfilio
23372 if $test `./findhdr sys/ioctl.h`; then
23374 echo '<sys/ioctl.h> found.' >&4
23377 if $test $i_sysfilio = "$define"; then
23378 echo '<sys/ioctl.h> NOT found.' >&4
23380 $test $i_sgtty = "$define" && xxx="sgtty.h"
23381 $test $i_termio = "$define" && xxx="termio.h"
23382 $test $i_termios = "$define" && xxx="termios.h"
23383 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23389 : see if socket ioctl defs are in sys/sockio.h
23391 xxx=`./findhdr sys/sockio.h`
23392 if $test "$xxx"; then
23393 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23395 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23398 echo "No socket ioctls found in <sys/sockio.h>." >&4
23403 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23409 : see if this is a syslog.h system
23410 set syslog.h i_syslog
23413 : see if this is a sys/mode.h system
23414 set sys/mode.h i_sysmode
23417 : see if there is a sys/poll.h file
23418 set sys/poll.h i_syspoll
23421 : see if sys/resource.h has to be included
23422 set sys/resource.h i_sysresrc
23425 : see if sys/security.h is available
23426 set sys/security.h i_syssecrt
23429 : see if this is a sys/statvfs.h system
23430 set sys/statvfs.h i_sysstatvfs
23433 : see if this is a sys/un.h system
23434 set sys/un.h i_sysun
23437 : see if this is a sys/utsname.h system
23438 set sys/utsname.h i_sysutsname
23441 : see if this is a syswait system
23442 set sys/wait.h i_syswait
23445 : see if this is a ustat.h system
23446 set ustat.h i_ustat
23449 : see if this is an utime system
23450 set utime.h i_utime
23453 : see if this is a vfork system
23456 set vfork.h i_vfork
23466 echo "Looking for extensions..." >&4
23467 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23468 : contain old or inaccurate or duplicate values.
23469 nonxs_extensions=''
23471 : We do not use find because it might not be available.
23472 : We do not just use MANIFEST because the user may have dropped
23473 : some additional extensions into the source tree and expect them
23476 : Function to recursively find available extensions, ignoring DynaLoader
23477 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23478 : In 5.10.1 and later, extensions are stored in directories
23479 : like File-Glob instead of the older File/Glob/.
23483 DynaLoader|dynaload) ;;
23485 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23486 case "$this_ext" in
23487 Scalar/List/Utils) this_ext="List/Util" ;;
23488 PathTools) this_ext="Cwd" ;;
23490 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23491 if $contains " $this_ext " "$tdir/$$.tmp"; then
23493 echo "Duplicate directories detected for extension $xxx" >&4;
23494 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23495 case "$knowitall" in
23503 echo "Ok. Stopping Configure." >&4;
23504 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23507 echo "Ok. You will need to correct config.sh before running make." >&4;
23509 $ls -1 "$xxx" > "$tdir/$$.tmp";
23510 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23511 xs_extensions="$xs_extensions $this_ext";
23512 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23513 xs_extensions="$xs_extensions $this_ext";
23514 elif $test -d "$xxx"; then
23515 nonxs_extensions="$nonxs_extensions $this_ext";
23517 $rm -f "$tdir/$$.tmp";
23525 eval $find_extensions
23529 eval $find_extensions
23533 eval $find_extensions
23534 set X $xs_extensions
23536 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23537 set X $nonxs_extensions
23539 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23541 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23543 : Now see which are supported on this system.
23545 for xxx in $xs_extensions ; do
23549 amigaos) avail_ext="$avail_ext $xxx" ;;
23554 $define) avail_ext="$avail_ext $xxx" ;;
23557 GDBM_File|gdbm_fil)
23559 $define) avail_ext="$avail_ext $xxx" ;;
23562 I18N/Langinfo|i18n_lan)
23563 case "$i_langinfo$d_nl_langinfo" in
23564 $define$define) avail_ext="$avail_ext $xxx" ;;
23568 : XXX Do we need a useipcsysv variable here
23569 case "${d_msg}${d_sem}${d_shm}" in
23570 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23573 NDBM_File|ndbm_fil)
23576 case "$osname-$use64bitint" in
23579 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23582 *) avail_ext="$avail_ext $xxx" ;;
23587 ODBM_File|odbm_fil)
23588 case "${i_dbm}${i_rpcsvcdbm}" in
23590 case "$d_cplusplus" in
23591 define) ;; # delete as a function name will not work
23592 *) case "$osname-$use64bitint" in
23595 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23598 *) avail_ext="$avail_ext $xxx" ;;
23606 case "$useopcode" in
23607 true|define|y) avail_ext="$avail_ext $xxx" ;;
23611 case "$useposix" in
23612 true|define|y) avail_ext="$avail_ext $xxx" ;;
23616 case "$d_socket" in
23617 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23620 Sys/Syslog|sys/syslog)
23621 : XXX syslog requires socket
23622 case "$d_socket" in
23623 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23627 case "$usethreads" in
23629 case "$use5005threads" in
23630 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23634 threads|threads/shared)
23635 # threads and threads::shared are special cases.
23636 # To stop people from asking "Perl 5.8.0 was supposed
23637 # to have this new fancy threads implementation but my
23638 # perl doesn't have it" and from people trying to
23639 # (re)install the threads module using CPAN.pm and
23640 # CPAN.pm then offering to reinstall Perl 5.8.0,
23641 # the threads.pm and threads/shared.pm will always be
23642 # there, croaking informatively ("you need to rebuild
23643 # all of Perl with threads, sorry") when threads haven't
23644 # been compiled in.
23646 avail_ext="$avail_ext $xxx"
23652 cygwin) avail_ext="$avail_ext $xxx" ;;
23655 XS/APItest|xs/apitest)
23656 # This is just for testing. Skip it unless we have dynamic loading.
23659 $define) avail_ext="$avail_ext $xxx" ;;
23662 XS/Typemap|xs/typemap)
23663 # This is just for testing. Skip it unless we have dynamic loading.
23665 $define) avail_ext="$avail_ext $xxx" ;;
23668 *) avail_ext="$avail_ext $xxx"
23677 case "$onlyextensions" in
23679 *) keepextensions=''
23680 echo "You have requested that only certain extensions be included..." >&4
23681 for i in $onlyextensions; do
23682 case " $avail_ext " in
23684 echo "Keeping extension $i."
23685 keepextensions="$keepextensions $i"
23687 *) echo "Ignoring extension $i." ;;
23690 avail_ext="$keepextensions"
23694 case "$noextensions" in
23696 *) keepextensions=''
23697 echo "You have requested that certain extensions be ignored..." >&4
23698 for i in $avail_ext; do
23699 case " $noextensions " in
23700 *" $i "*) echo "Ignoring extension $i." ;;
23701 *) echo "Keeping extension $i.";
23702 keepextensions="$keepextensions $i"
23706 avail_ext="$keepextensions"
23710 : Now see which nonxs extensions are supported on this system.
23711 : For now assume all are.
23713 for xxx in $nonxs_extensions ; do
23717 *) nonxs_ext="$nonxs_ext $xxx"
23729 A number of extensions are supplied with $package. You may choose to
23730 compile these extensions for dynamic loading (the default), compile
23731 them into the $package executable (static loading), or not include
23732 them at all. Answer "none" to include no extensions.
23733 Note that DynaLoader is always built and need not be mentioned here.
23736 case "$dynamic_ext" in
23738 : Exclude those listed in static_ext
23740 for xxx in $avail_ext; do
23741 case " $static_ext " in
23743 *) dflt="$dflt $xxx" ;;
23750 *) dflt="$dynamic_ext"
23751 # Perhaps we are reusing an old out-of-date config.sh.
23754 if test X"$dynamic_ext" != X"$avail_ext"; then
23756 NOTICE: Your previous config.sh list may be incorrect.
23757 The extensions now available to you are
23759 but the default list from your previous config.sh is
23771 rp="What extensions do you wish to load dynamically?"
23774 none) dynamic_ext=' ' ;;
23775 *) dynamic_ext="$ans" ;;
23778 case "$static_ext" in
23780 : Exclude those already listed in dynamic linking
23782 for xxx in $avail_ext; do
23783 case " $dynamic_ext " in
23785 *) dflt="$dflt $xxx" ;;
23792 *) dflt="$static_ext"
23799 rp="What extensions do you wish to load statically?"
23802 none) static_ext=' ' ;;
23803 *) static_ext="$ans" ;;
23808 A number of extensions are supplied with $package. Answer "none"
23809 to include no extensions.
23810 Note that DynaLoader is always built and need not be mentioned here.
23813 case "$static_ext" in
23814 '') dflt="$avail_ext" ;;
23815 *) dflt="$static_ext"
23816 # Perhaps we are reusing an old out-of-date config.sh.
23819 if test X"$static_ext" != X"$avail_ext"; then
23821 NOTICE: Your previous config.sh list may be incorrect.
23822 The extensions now available to you are
23824 but the default list from your previous config.sh is
23833 : Exclude those that are not xs extensions
23837 rp="What extensions do you wish to include?"
23840 none) static_ext=' ' ;;
23841 *) static_ext="$ans" ;;
23846 # Encode is a special case. If we are building Encode as a static
23847 # extension, we need to explicitly list its subextensions as well.
23848 # For other nested extensions, this is handled automatically by
23849 # the appropriate Makefile.PL.
23850 case " $static_ext " in
23851 *" Encode "*) # Add the subextensions of Encode
23853 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23854 static_ext="$static_ext Encode/$xxx"
23855 known_extensions="$known_extensions Encode/$xxx"
23861 set X $dynamic_ext $static_ext $nonxs_ext
23865 # Sanity check: We require an extension suitable for use with
23866 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23867 # should show up as failures in the test suite, but it's helpful to
23868 # catch them now.) The 'extensions' list is normally sorted
23869 # alphabetically, so we need to accept either
23870 # DB_File ... Fcntl ... IO ....
23871 # or something like
23872 # Fcntl ... NDBM_File ... IO ....
23873 case " $extensions" in
23874 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23875 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23876 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23877 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23878 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23882 : Remove libraries needed only for extensions
23883 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23884 : The exception is SunOS 4.x, which needs them.
23885 case "${osname}X${osvers}" in
23889 *) case "$usedl" in
23890 $define|true|[yY]*)
23891 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23895 *) perllibs="$libs"
23901 : Remove build directory name from cppstdin so it can be used from
23902 : either the present location or the final installed location.
23904 : Get out of the UU directory to get correct path name.
23906 case "$cppstdin" in
23908 echo "Stripping down cppstdin path name"
23914 : end of configuration questions
23916 echo "End of configuration questions."
23919 : back to where it started
23920 if test -d ../UU; then
23924 : configuration may be unconditionally patched via a 'config.arch' file
23925 if $test -f config.arch; then
23926 echo "I see a config.arch file, loading it." >&4
23930 : configuration may be patched via a 'config.over' file
23931 if $test -f config.over; then
23934 rp='I see a config.over file. Do you wish to load it?'
23937 n*) echo "OK, I'll ignore it.";;
23939 echo "Configuration override changes have been loaded."
23944 : in case they want portability, strip down executable paths
23945 case "$d_portable" in
23948 echo "Stripping down executable paths..." >&4
23949 for file in $loclist $trylist; do
23951 eval $file=`basename $temp`
23956 : create config.sh file
23958 echo "Creating config.sh..." >&4
23959 $spitshell <<EOT >config.sh
23962 # This file was produced by running the Configure script. It holds all the
23963 # definitions figured out by Configure. Should you modify one of these values,
23964 # do not forget to propagate your changes by running "Configure -der". You may
23965 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23968 # Package name : $package
23969 # Source directory : $src
23970 # Configuration time: $cf_time
23971 # Configured by : $cf_by
23972 # Target system : $myuname
23975 : Add in command line options if available
23976 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23978 $spitshell <<EOT >>config.sh
23987 Revision='$Revision'
23995 alignbytes='$alignbytes'
23996 ansi2knr='$ansi2knr'
23997 aphostname='$aphostname'
23998 api_revision='$api_revision'
23999 api_subversion='$api_subversion'
24000 api_version='$api_version'
24001 api_versionstring='$api_versionstring'
24004 archlibexp='$archlibexp'
24005 archname64='$archname64'
24006 archname='$archname'
24007 archobjs='$archobjs'
24008 asctime_r_proto='$asctime_r_proto'
24017 byteorder='$byteorder'
24019 castflags='$castflags'
24022 cccdlflags='$cccdlflags'
24023 ccdlflags='$ccdlflags'
24025 ccflags_uselargefiles='$ccflags_uselargefiles'
24027 ccsymbols='$ccsymbols'
24028 ccversion='$ccversion'
24030 cf_email='$cf_email'
24032 charbits='$charbits'
24033 charsize='$charsize'
24037 clocktype='$clocktype'
24039 compress='$compress'
24040 contains='$contains'
24044 cpp_stuff='$cpp_stuff'
24045 cppccsymbols='$cppccsymbols'
24046 cppflags='$cppflags'
24048 cppminus='$cppminus'
24050 cppstdin='$cppstdin'
24051 cppsymbols='$cppsymbols'
24052 crypt_r_proto='$crypt_r_proto'
24053 cryptlib='$cryptlib'
24055 ctermid_r_proto='$ctermid_r_proto'
24056 ctime_r_proto='$ctime_r_proto'
24057 d_Gconvert='$d_Gconvert'
24058 d_PRIEUldbl='$d_PRIEUldbl'
24059 d_PRIFUldbl='$d_PRIFUldbl'
24060 d_PRIGUldbl='$d_PRIGUldbl'
24061 d_PRIXU64='$d_PRIXU64'
24062 d_PRId64='$d_PRId64'
24063 d_PRIeldbl='$d_PRIeldbl'
24064 d_PRIfldbl='$d_PRIfldbl'
24065 d_PRIgldbl='$d_PRIgldbl'
24066 d_PRIi64='$d_PRIi64'
24067 d_PRIo64='$d_PRIo64'
24068 d_PRIu64='$d_PRIu64'
24069 d_PRIx64='$d_PRIx64'
24070 d_SCNfldbl='$d_SCNfldbl'
24071 d__fwalk='$d__fwalk'
24072 d_access='$d_access'
24073 d_accessx='$d_accessx'
24077 d_archlib='$d_archlib'
24078 d_asctime64='$d_asctime64'
24079 d_asctime_r='$d_asctime_r'
24084 d_attribute_deprecated='$d_attribute_deprecated'
24085 d_attribute_format='$d_attribute_format'
24086 d_attribute_malloc='$d_attribute_malloc'
24087 d_attribute_nonnull='$d_attribute_nonnull'
24088 d_attribute_noreturn='$d_attribute_noreturn'
24089 d_attribute_pure='$d_attribute_pure'
24090 d_attribute_unused='$d_attribute_unused'
24091 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24092 d_backtrace='$d_backtrace'
24096 d_bsdgetpgrp='$d_bsdgetpgrp'
24097 d_bsdsetpgrp='$d_bsdsetpgrp'
24098 d_builtin_choose_expr='$d_builtin_choose_expr'
24099 d_builtin_expect='$d_builtin_expect'
24101 d_c99_variadic_macros='$d_c99_variadic_macros'
24102 d_casti32='$d_casti32'
24103 d_castneg='$d_castneg'
24105 d_charvspr='$d_charvspr'
24107 d_chroot='$d_chroot'
24108 d_chsize='$d_chsize'
24110 d_clearenv='$d_clearenv'
24111 d_closedir='$d_closedir'
24112 d_cmsghdr_s='$d_cmsghdr_s'
24114 d_copysign='$d_copysign'
24115 d_copysignl='$d_copysignl'
24116 d_cplusplus='$d_cplusplus'
24118 d_crypt_r='$d_crypt_r'
24120 d_ctermid='$d_ctermid'
24121 d_ctermid_r='$d_ctermid_r'
24122 d_ctime64='$d_ctime64'
24123 d_ctime_r='$d_ctime_r'
24124 d_cuserid='$d_cuserid'
24125 d_dbl_dig='$d_dbl_dig'
24126 d_dbminitproto='$d_dbminitproto'
24127 d_difftime64='$d_difftime64'
24128 d_difftime='$d_difftime'
24129 d_dir_dd_fd='$d_dir_dd_fd'
24131 d_dirnamlen='$d_dirnamlen'
24132 d_dladdr='$d_dladdr'
24133 d_dlerror='$d_dlerror'
24134 d_dlopen='$d_dlopen'
24135 d_dlsymun='$d_dlsymun'
24136 d_dosuid='$d_dosuid'
24137 d_drand48_r='$d_drand48_r'
24138 d_drand48proto='$d_drand48proto'
24140 d_eaccess='$d_eaccess'
24141 d_endgrent='$d_endgrent'
24142 d_endgrent_r='$d_endgrent_r'
24143 d_endhent='$d_endhent'
24144 d_endhostent_r='$d_endhostent_r'
24145 d_endnent='$d_endnent'
24146 d_endnetent_r='$d_endnetent_r'
24147 d_endpent='$d_endpent'
24148 d_endprotoent_r='$d_endprotoent_r'
24149 d_endpwent='$d_endpwent'
24150 d_endpwent_r='$d_endpwent_r'
24151 d_endsent='$d_endsent'
24152 d_endservent_r='$d_endservent_r'
24153 d_eofnblk='$d_eofnblk'
24156 d_eunice='$d_eunice'
24159 d_faststdio='$d_faststdio'
24160 d_fchdir='$d_fchdir'
24161 d_fchmod='$d_fchmod'
24162 d_fchown='$d_fchown'
24164 d_fcntl_can_lock='$d_fcntl_can_lock'
24165 d_fd_macros='$d_fd_macros'
24166 d_fd_set='$d_fd_set'
24168 d_fds_bits='$d_fds_bits'
24169 d_fegetround='$d_fegetround'
24170 d_fgetpos='$d_fgetpos'
24171 d_finite='$d_finite'
24172 d_finitel='$d_finitel'
24173 d_flexfnam='$d_flexfnam'
24175 d_flockproto='$d_flockproto'
24180 d_fp_class='$d_fp_class'
24181 d_fp_classify='$d_fp_classify'
24182 d_fp_classl='$d_fp_classl'
24183 d_fpathconf='$d_fpathconf'
24184 d_fpclass='$d_fpclass'
24185 d_fpclassify='$d_fpclassify'
24186 d_fpclassl='$d_fpclassl'
24187 d_fpgetround='$d_fpgetround'
24188 d_fpos64_t='$d_fpos64_t'
24189 d_frexpl='$d_frexpl'
24190 d_fs_data_s='$d_fs_data_s'
24191 d_fseeko='$d_fseeko'
24192 d_fsetpos='$d_fsetpos'
24193 d_fstatfs='$d_fstatfs'
24194 d_fstatvfs='$d_fstatvfs'
24196 d_ftello='$d_ftello'
24198 d_futimes='$d_futimes'
24199 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24200 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24201 d_getaddrinfo='$d_getaddrinfo'
24202 d_getcwd='$d_getcwd'
24203 d_getespwnam='$d_getespwnam'
24204 d_getfsstat='$d_getfsstat'
24205 d_getgrent='$d_getgrent'
24206 d_getgrent_r='$d_getgrent_r'
24207 d_getgrgid_r='$d_getgrgid_r'
24208 d_getgrnam_r='$d_getgrnam_r'
24209 d_getgrps='$d_getgrps'
24210 d_gethbyaddr='$d_gethbyaddr'
24211 d_gethbyname='$d_gethbyname'
24212 d_gethent='$d_gethent'
24213 d_gethname='$d_gethname'
24214 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24215 d_gethostbyname_r='$d_gethostbyname_r'
24216 d_gethostent_r='$d_gethostent_r'
24217 d_gethostprotos='$d_gethostprotos'
24218 d_getitimer='$d_getitimer'
24219 d_getlogin='$d_getlogin'
24220 d_getlogin_r='$d_getlogin_r'
24221 d_getmnt='$d_getmnt'
24222 d_getmntent='$d_getmntent'
24223 d_getnameinfo='$d_getnameinfo'
24224 d_getnbyaddr='$d_getnbyaddr'
24225 d_getnbyname='$d_getnbyname'
24226 d_getnent='$d_getnent'
24227 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24228 d_getnetbyname_r='$d_getnetbyname_r'
24229 d_getnetent_r='$d_getnetent_r'
24230 d_getnetprotos='$d_getnetprotos'
24231 d_getpagsz='$d_getpagsz'
24232 d_getpbyname='$d_getpbyname'
24233 d_getpbynumber='$d_getpbynumber'
24234 d_getpent='$d_getpent'
24235 d_getpgid='$d_getpgid'
24236 d_getpgrp2='$d_getpgrp2'
24237 d_getpgrp='$d_getpgrp'
24238 d_getppid='$d_getppid'
24239 d_getprior='$d_getprior'
24240 d_getprotobyname_r='$d_getprotobyname_r'
24241 d_getprotobynumber_r='$d_getprotobynumber_r'
24242 d_getprotoent_r='$d_getprotoent_r'
24243 d_getprotoprotos='$d_getprotoprotos'
24244 d_getprpwnam='$d_getprpwnam'
24245 d_getpwent='$d_getpwent'
24246 d_getpwent_r='$d_getpwent_r'
24247 d_getpwnam_r='$d_getpwnam_r'
24248 d_getpwuid_r='$d_getpwuid_r'
24249 d_getsbyname='$d_getsbyname'
24250 d_getsbyport='$d_getsbyport'
24251 d_getsent='$d_getsent'
24252 d_getservbyname_r='$d_getservbyname_r'
24253 d_getservbyport_r='$d_getservbyport_r'
24254 d_getservent_r='$d_getservent_r'
24255 d_getservprotos='$d_getservprotos'
24256 d_getspnam='$d_getspnam'
24257 d_getspnam_r='$d_getspnam_r'
24258 d_gettimeod='$d_gettimeod'
24259 d_gmtime64='$d_gmtime64'
24260 d_gmtime_r='$d_gmtime_r'
24261 d_gnulibc='$d_gnulibc'
24262 d_grpasswd='$d_grpasswd'
24263 d_hasmntopt='$d_hasmntopt'
24267 d_ilogbl='$d_ilogbl'
24268 d_inc_version_list='$d_inc_version_list'
24270 d_inetaton='$d_inetaton'
24271 d_inetntop='$d_inetntop'
24272 d_inetpton='$d_inetpton'
24273 d_int64_t='$d_int64_t'
24274 d_ip_mreq='$d_ip_mreq'
24275 d_ip_mreq_source='$d_ip_mreq_source'
24276 d_ipv6_mreq='$d_ipv6_mreq'
24277 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24278 d_isascii='$d_isascii'
24279 d_isblank='$d_isblank'
24280 d_isfinite='$d_isfinite'
24281 d_isfinitel='$d_isfinitel'
24283 d_isinfl='$d_isinfl'
24284 d_isless='$d_isless'
24286 d_isnanl='$d_isnanl'
24287 d_isnormal='$d_isnormal'
24290 d_killpg='$d_killpg'
24291 d_lc_monetary_2008='$d_lc_monetary_2008'
24292 d_lchown='$d_lchown'
24293 d_ldbl_dig='$d_ldbl_dig'
24294 d_ldexpl='$d_ldexpl'
24295 d_lgamma='$d_lgamma'
24296 d_lgamma_r='$d_lgamma_r'
24297 d_libm_lib_version='$d_libm_lib_version'
24298 d_libname_unique='$d_libname_unique'
24300 d_llrint='$d_llrint'
24301 d_llrintl='$d_llrintl'
24302 d_llround='$d_llround'
24303 d_llroundl='$d_llroundl'
24304 d_localtime64='$d_localtime64'
24305 d_localtime_r='$d_localtime_r'
24306 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24307 d_locconv='$d_locconv'
24312 d_longdbl='$d_longdbl'
24313 d_longlong='$d_longlong'
24315 d_lrintl='$d_lrintl'
24316 d_lround='$d_lround'
24317 d_lroundl='$d_lroundl'
24318 d_lseekproto='$d_lseekproto'
24320 d_madvise='$d_madvise'
24321 d_malloc_good_size='$d_malloc_good_size'
24322 d_malloc_size='$d_malloc_size'
24324 d_mbstowcs='$d_mbstowcs'
24325 d_mbtowc='$d_mbtowc'
24326 d_memchr='$d_memchr'
24327 d_memcmp='$d_memcmp'
24328 d_memcpy='$d_memcpy'
24329 d_memmove='$d_memmove'
24330 d_memset='$d_memset'
24332 d_mkdtemp='$d_mkdtemp'
24333 d_mkfifo='$d_mkfifo'
24334 d_mkstemp='$d_mkstemp'
24335 d_mkstemps='$d_mkstemps'
24336 d_mktime64='$d_mktime64'
24337 d_mktime='$d_mktime'
24340 d_modfl_pow32_bug='$d_modfl_pow32_bug'
24341 d_modflproto='$d_modflproto'
24342 d_mprotect='$d_mprotect'
24344 d_msg_ctrunc='$d_msg_ctrunc'
24345 d_msg_dontroute='$d_msg_dontroute'
24346 d_msg_oob='$d_msg_oob'
24347 d_msg_peek='$d_msg_peek'
24348 d_msg_proxy='$d_msg_proxy'
24349 d_msgctl='$d_msgctl'
24350 d_msgget='$d_msgget'
24351 d_msghdr_s='$d_msghdr_s'
24352 d_msgrcv='$d_msgrcv'
24353 d_msgsnd='$d_msgsnd'
24355 d_munmap='$d_munmap'
24356 d_mymalloc='$d_mymalloc'
24359 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24360 d_nearbyint='$d_nearbyint'
24361 d_nextafter='$d_nextafter'
24362 d_nexttoward='$d_nexttoward'
24364 d_nl_langinfo='$d_nl_langinfo'
24365 d_nv_preserves_uv='$d_nv_preserves_uv'
24366 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24367 d_off64_t='$d_off64_t'
24368 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24369 d_oldpthreads='$d_oldpthreads'
24370 d_oldsock='$d_oldsock'
24372 d_pathconf='$d_pathconf'
24374 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24375 d_phostname='$d_phostname'
24378 d_portable='$d_portable'
24380 d_prctl_set_name='$d_prctl_set_name'
24381 d_printf_format_null='$d_printf_format_null'
24382 d_procselfexe='$d_procselfexe'
24383 d_pseudofork='$d_pseudofork'
24384 d_pthread_atfork='$d_pthread_atfork'
24385 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24386 d_pthread_yield='$d_pthread_yield'
24387 d_ptrdiff_t='$d_ptrdiff_t'
24389 d_pwchange='$d_pwchange'
24390 d_pwclass='$d_pwclass'
24391 d_pwcomment='$d_pwcomment'
24392 d_pwexpire='$d_pwexpire'
24393 d_pwgecos='$d_pwgecos'
24394 d_pwpasswd='$d_pwpasswd'
24395 d_pwquota='$d_pwquota'
24398 d_random_r='$d_random_r'
24399 d_re_comp='$d_re_comp'
24400 d_readdir64_r='$d_readdir64_r'
24401 d_readdir='$d_readdir'
24402 d_readdir_r='$d_readdir_r'
24403 d_readlink='$d_readlink'
24405 d_recvmsg='$d_recvmsg'
24406 d_regcmp='$d_regcmp'
24407 d_regcomp='$d_regcomp'
24408 d_remainder='$d_remainder'
24409 d_remquo='$d_remquo'
24410 d_rename='$d_rename'
24411 d_rewinddir='$d_rewinddir'
24415 d_safebcpy='$d_safebcpy'
24416 d_safemcpy='$d_safemcpy'
24417 d_sanemcmp='$d_sanemcmp'
24418 d_sbrkproto='$d_sbrkproto'
24419 d_scalbn='$d_scalbn'
24420 d_scalbnl='$d_scalbnl'
24421 d_sched_yield='$d_sched_yield'
24422 d_scm_rights='$d_scm_rights'
24423 d_seekdir='$d_seekdir'
24424 d_select='$d_select'
24426 d_semctl='$d_semctl'
24427 d_semctl_semid_ds='$d_semctl_semid_ds'
24428 d_semctl_semun='$d_semctl_semun'
24429 d_semget='$d_semget'
24431 d_sendmsg='$d_sendmsg'
24432 d_setegid='$d_setegid'
24433 d_seteuid='$d_seteuid'
24434 d_setgrent='$d_setgrent'
24435 d_setgrent_r='$d_setgrent_r'
24436 d_setgrps='$d_setgrps'
24437 d_sethent='$d_sethent'
24438 d_sethostent_r='$d_sethostent_r'
24439 d_setitimer='$d_setitimer'
24440 d_setlinebuf='$d_setlinebuf'
24441 d_setlocale='$d_setlocale'
24442 d_setlocale_r='$d_setlocale_r'
24443 d_setnent='$d_setnent'
24444 d_setnetent_r='$d_setnetent_r'
24445 d_setpent='$d_setpent'
24446 d_setpgid='$d_setpgid'
24447 d_setpgrp2='$d_setpgrp2'
24448 d_setpgrp='$d_setpgrp'
24449 d_setprior='$d_setprior'
24450 d_setproctitle='$d_setproctitle'
24451 d_setprotoent_r='$d_setprotoent_r'
24452 d_setpwent='$d_setpwent'
24453 d_setpwent_r='$d_setpwent_r'
24454 d_setregid='$d_setregid'
24455 d_setresgid='$d_setresgid'
24456 d_setresuid='$d_setresuid'
24457 d_setreuid='$d_setreuid'
24458 d_setrgid='$d_setrgid'
24459 d_setruid='$d_setruid'
24460 d_setsent='$d_setsent'
24461 d_setservent_r='$d_setservent_r'
24462 d_setsid='$d_setsid'
24463 d_setvbuf='$d_setvbuf'
24466 d_shmatprototype='$d_shmatprototype'
24467 d_shmctl='$d_shmctl'
24469 d_shmget='$d_shmget'
24470 d_sigaction='$d_sigaction'
24471 d_signbit='$d_signbit'
24472 d_sigprocmask='$d_sigprocmask'
24473 d_sigsetjmp='$d_sigsetjmp'
24474 d_sin6_scope_id='$d_sin6_scope_id'
24475 d_sitearch='$d_sitearch'
24476 d_snprintf='$d_snprintf'
24477 d_sockaddr_in6='$d_sockaddr_in6'
24478 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24479 d_sockatmark='$d_sockatmark'
24480 d_sockatmarkproto='$d_sockatmarkproto'
24481 d_socket='$d_socket'
24482 d_socklen_t='$d_socklen_t'
24483 d_sockpair='$d_sockpair'
24484 d_socks5_init='$d_socks5_init'
24485 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24487 d_srand48_r='$d_srand48_r'
24488 d_srandom_r='$d_srandom_r'
24489 d_sresgproto='$d_sresgproto'
24490 d_sresuproto='$d_sresuproto'
24492 d_statblks='$d_statblks'
24493 d_statfs_f_flags='$d_statfs_f_flags'
24494 d_statfs_s='$d_statfs_s'
24495 d_static_inline='$d_static_inline'
24496 d_statvfs='$d_statvfs'
24497 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24498 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24499 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24500 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24501 d_stdio_stream_array='$d_stdio_stream_array'
24502 d_stdiobase='$d_stdiobase'
24503 d_stdstdio='$d_stdstdio'
24504 d_strchr='$d_strchr'
24505 d_strcoll='$d_strcoll'
24506 d_strctcpy='$d_strctcpy'
24507 d_strerrm='$d_strerrm'
24508 d_strerror='$d_strerror'
24509 d_strerror_r='$d_strerror_r'
24510 d_strftime='$d_strftime'
24511 d_strlcat='$d_strlcat'
24512 d_strlcpy='$d_strlcpy'
24513 d_strtod='$d_strtod'
24514 d_strtol='$d_strtol'
24515 d_strtold='$d_strtold'
24516 d_strtoll='$d_strtoll'
24517 d_strtoq='$d_strtoq'
24518 d_strtoul='$d_strtoul'
24519 d_strtoull='$d_strtoull'
24520 d_strtouq='$d_strtouq'
24521 d_strxfrm='$d_strxfrm'
24522 d_suidsafe='$d_suidsafe'
24523 d_symlink='$d_symlink'
24524 d_syscall='$d_syscall'
24525 d_syscallproto='$d_syscallproto'
24526 d_sysconf='$d_sysconf'
24527 d_sysernlst='$d_sysernlst'
24528 d_syserrlst='$d_syserrlst'
24529 d_system='$d_system'
24530 d_tcgetpgrp='$d_tcgetpgrp'
24531 d_tcsetpgrp='$d_tcsetpgrp'
24532 d_telldir='$d_telldir'
24533 d_telldirproto='$d_telldirproto'
24534 d_tgamma='$d_tgamma'
24536 d_timegm='$d_timegm'
24538 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24539 d_tm_tm_zone='$d_tm_tm_zone'
24540 d_tmpnam_r='$d_tmpnam_r'
24542 d_truncate='$d_truncate'
24543 d_truncl='$d_truncl'
24544 d_ttyname_r='$d_ttyname_r'
24545 d_tzname='$d_tzname'
24546 d_u32align='$d_u32align'
24547 d_ualarm='$d_ualarm'
24550 d_union_semun='$d_union_semun'
24551 d_unordered='$d_unordered'
24552 d_unsetenv='$d_unsetenv'
24553 d_usleep='$d_usleep'
24554 d_usleepproto='$d_usleepproto'
24556 d_vendorarch='$d_vendorarch'
24557 d_vendorbin='$d_vendorbin'
24558 d_vendorlib='$d_vendorlib'
24559 d_vendorscript='$d_vendorscript'
24561 d_void_closedir='$d_void_closedir'
24562 d_voidsig='$d_voidsig'
24563 d_voidtty='$d_voidtty'
24564 d_volatile='$d_volatile'
24565 d_vprintf='$d_vprintf'
24566 d_vsnprintf='$d_vsnprintf'
24568 d_waitpid='$d_waitpid'
24569 d_wcscmp='$d_wcscmp'
24570 d_wcstombs='$d_wcstombs'
24571 d_wcsxfrm='$d_wcsxfrm'
24572 d_wctomb='$d_wctomb'
24573 d_writev='$d_writev'
24576 db_hashtype='$db_hashtype'
24577 db_prefixtype='$db_prefixtype'
24578 db_version_major='$db_version_major'
24579 db_version_minor='$db_version_minor'
24580 db_version_patch='$db_version_patch'
24581 direntrytype='$direntrytype'
24584 doubleinfbytes='$doubleinfbytes'
24585 doublekind='$doublekind'
24586 doublemantbits='$doublemantbits'
24587 doublenanbytes='$doublenanbytes'
24588 doublesize='$doublesize'
24590 drand48_r_proto='$drand48_r_proto'
24592 dynamic_ext='$dynamic_ext'
24598 endgrent_r_proto='$endgrent_r_proto'
24599 endhostent_r_proto='$endhostent_r_proto'
24600 endnetent_r_proto='$endnetent_r_proto'
24601 endprotoent_r_proto='$endprotoent_r_proto'
24602 endpwent_r_proto='$endpwent_r_proto'
24603 endservent_r_proto='$endservent_r_proto'
24604 eunicefix='$eunicefix'
24607 extensions='$extensions'
24608 extern_C='$extern_C'
24610 fflushNULL='$fflushNULL'
24611 fflushall='$fflushall'
24613 firstmakefile='$firstmakefile'
24615 fpossize='$fpossize'
24616 fpostype='$fpostype'
24617 freetype='$freetype'
24620 full_csh='$full_csh'
24621 full_sed='$full_sed'
24622 gccansipedantic='$gccansipedantic'
24623 gccosandvers='$gccosandvers'
24624 gccversion='$gccversion'
24625 getgrent_r_proto='$getgrent_r_proto'
24626 getgrgid_r_proto='$getgrgid_r_proto'
24627 getgrnam_r_proto='$getgrnam_r_proto'
24628 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24629 gethostbyname_r_proto='$gethostbyname_r_proto'
24630 gethostent_r_proto='$gethostent_r_proto'
24631 getlogin_r_proto='$getlogin_r_proto'
24632 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24633 getnetbyname_r_proto='$getnetbyname_r_proto'
24634 getnetent_r_proto='$getnetent_r_proto'
24635 getprotobyname_r_proto='$getprotobyname_r_proto'
24636 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24637 getprotoent_r_proto='$getprotoent_r_proto'
24638 getpwent_r_proto='$getpwent_r_proto'
24639 getpwnam_r_proto='$getpwnam_r_proto'
24640 getpwuid_r_proto='$getpwuid_r_proto'
24641 getservbyname_r_proto='$getservbyname_r_proto'
24642 getservbyport_r_proto='$getservbyport_r_proto'
24643 getservent_r_proto='$getservent_r_proto'
24644 getspnam_r_proto='$getspnam_r_proto'
24645 gidformat='$gidformat'
24651 gmtime_r_proto='$gmtime_r_proto'
24652 gnulibc_version='$gnulibc_version'
24654 groupcat='$groupcat'
24655 groupstype='$groupstype'
24658 h_sysfile='$h_sysfile'
24661 hostgenerate='$hostgenerate'
24662 hostosname='$hostosname'
24663 hostperl='$hostperl'
24664 html1dir='$html1dir'
24665 html1direxp='$html1direxp'
24666 html3dir='$html3dir'
24667 html3direxp='$html3direxp'
24676 i_arpainet='$i_arpainet'
24677 i_assert='$i_assert'
24679 i_bsdioctl='$i_bsdioctl'
24683 i_dirent='$i_dirent'
24685 i_execinfo='$i_execinfo'
24690 i_fp_class='$i_fp_class'
24692 i_gdbm_ndbm='$i_gdbm_ndbm'
24693 i_gdbmndbm='$i_gdbmndbm'
24695 i_ieeefp='$i_ieeefp'
24696 i_inttypes='$i_inttypes'
24697 i_langinfo='$i_langinfo'
24698 i_libutil='$i_libutil'
24699 i_limits='$i_limits'
24700 i_locale='$i_locale'
24701 i_machcthr='$i_machcthr'
24702 i_malloc='$i_malloc'
24703 i_mallocmalloc='$i_mallocmalloc'
24705 i_memory='$i_memory'
24706 i_mntent='$i_mntent'
24709 i_neterrno='$i_neterrno'
24710 i_netinettcp='$i_netinettcp'
24714 i_pthread='$i_pthread'
24716 i_quadmath='$i_quadmath'
24717 i_rpcsvcdbm='$i_rpcsvcdbm'
24719 i_shadow='$i_shadow'
24721 i_stdarg='$i_stdarg'
24722 i_stdbool='$i_stdbool'
24723 i_stddef='$i_stddef'
24724 i_stdint='$i_stdint'
24725 i_stdlib='$i_stdlib'
24726 i_string='$i_string'
24727 i_sunmath='$i_sunmath'
24728 i_sysaccess='$i_sysaccess'
24729 i_sysdir='$i_sysdir'
24730 i_sysfile='$i_sysfile'
24731 i_sysfilio='$i_sysfilio'
24733 i_sysioctl='$i_sysioctl'
24734 i_syslog='$i_syslog'
24735 i_sysmman='$i_sysmman'
24736 i_sysmode='$i_sysmode'
24737 i_sysmount='$i_sysmount'
24738 i_sysndir='$i_sysndir'
24739 i_sysparam='$i_sysparam'
24740 i_syspoll='$i_syspoll'
24741 i_sysresrc='$i_sysresrc'
24742 i_syssecrt='$i_syssecrt'
24743 i_sysselct='$i_sysselct'
24744 i_syssockio='$i_syssockio'
24745 i_sysstat='$i_sysstat'
24746 i_sysstatfs='$i_sysstatfs'
24747 i_sysstatvfs='$i_sysstatvfs'
24748 i_systime='$i_systime'
24749 i_systimek='$i_systimek'
24750 i_systimes='$i_systimes'
24751 i_systypes='$i_systypes'
24752 i_sysuio='$i_sysuio'
24754 i_sysutsname='$i_sysutsname'
24755 i_sysvfs='$i_sysvfs'
24756 i_syswait='$i_syswait'
24757 i_termio='$i_termio'
24758 i_termios='$i_termios'
24760 i_unistd='$i_unistd'
24763 i_values='$i_values'
24764 i_varargs='$i_varargs'
24765 i_varhdr='$i_varhdr'
24767 ignore_versioned_solibs='$ignore_versioned_solibs'
24768 inc_version_list='$inc_version_list'
24769 inc_version_list_init='$inc_version_list_init'
24773 initialinstalllocation='$initialinstalllocation'
24774 installarchlib='$installarchlib'
24775 installbin='$installbin'
24776 installhtml1dir='$installhtml1dir'
24777 installhtml3dir='$installhtml3dir'
24778 installman1dir='$installman1dir'
24779 installman3dir='$installman3dir'
24780 installprefix='$installprefix'
24781 installprefixexp='$installprefixexp'
24782 installprivlib='$installprivlib'
24783 installscript='$installscript'
24784 installsitearch='$installsitearch'
24785 installsitebin='$installsitebin'
24786 installsitehtml1dir='$installsitehtml1dir'
24787 installsitehtml3dir='$installsitehtml3dir'
24788 installsitelib='$installsitelib'
24789 installsiteman1dir='$installsiteman1dir'
24790 installsiteman3dir='$installsiteman3dir'
24791 installsitescript='$installsitescript'
24792 installstyle='$installstyle'
24793 installusrbinperl='$installusrbinperl'
24794 installvendorarch='$installvendorarch'
24795 installvendorbin='$installvendorbin'
24796 installvendorhtml1dir='$installvendorhtml1dir'
24797 installvendorhtml3dir='$installvendorhtml3dir'
24798 installvendorlib='$installvendorlib'
24799 installvendorman1dir='$installvendorman1dir'
24800 installvendorman3dir='$installvendorman3dir'
24801 installvendorscript='$installvendorscript'
24803 issymlink='$issymlink'
24804 ivdformat='$ivdformat'
24807 known_extensions='$known_extensions'
24810 ld_can_script='$ld_can_script'
24811 lddlflags='$lddlflags'
24813 ldflags_uselargefiles='$ldflags_uselargefiles'
24814 ldlibpthname='$ldlibpthname'
24821 libsdirs='$libsdirs'
24822 libsfiles='$libsfiles'
24823 libsfound='$libsfound'
24824 libspath='$libspath'
24825 libswanted='$libswanted'
24826 libswanted_uselargefiles='$libswanted_uselargefiles'
24832 localtime_r_proto='$localtime_r_proto'
24833 locincpth='$locincpth'
24834 loclibpth='$loclibpth'
24835 longdblinfbytes='$longdblinfbytes'
24836 longdblkind='$longdblkind'
24837 longdblmantbits='$longdblmantbits'
24838 longdblnanbytes='$longdblnanbytes'
24839 longdblsize='$longdblsize'
24840 longlongsize='$longlongsize'
24841 longsize='$longsize'
24845 lseeksize='$lseeksize'
24846 lseektype='$lseektype'
24850 make_set_make='$make_set_make'
24851 mallocobj='$mallocobj'
24852 mallocsrc='$mallocsrc'
24853 malloctype='$malloctype'
24855 man1direxp='$man1direxp'
24858 man3direxp='$man3direxp'
24860 mips_type='$mips_type'
24861 mistrustnm='$mistrustnm'
24863 mmaptype='$mmaptype'
24864 modetype='$modetype'
24866 multiarch='$multiarch'
24868 myarchname='$myarchname'
24869 mydomain='$mydomain'
24870 myhostname='$myhostname'
24873 need_va_copy='$need_va_copy'
24874 netdb_hlen_type='$netdb_hlen_type'
24875 netdb_host_type='$netdb_host_type'
24876 netdb_name_type='$netdb_name_type'
24877 netdb_net_type='$netdb_net_type'
24880 nm_so_opt='$nm_so_opt'
24881 nonxs_ext='$nonxs_ext'
24883 nvEUformat='$nvEUformat'
24884 nvFUformat='$nvFUformat'
24885 nvGUformat='$nvGUformat'
24886 nv_overflows_integers_at='$nv_overflows_integers_at'
24887 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24888 nveformat='$nveformat'
24889 nvfformat='$nvfformat'
24890 nvgformat='$nvgformat'
24891 nvmantbits='$nvmantbits'
24894 o_nonblock='$o_nonblock'
24896 old_pthread_create_joinable='$old_pthread_create_joinable'
24897 optimize='$optimize'
24898 orderlib='$orderlib'
24901 otherlibdirs='$otherlibdirs'
24905 patchlevel='$patchlevel'
24906 path_sep='$path_sep'
24909 perl_patchlevel='$perl_patchlevel'
24910 perl_static_inline='$perl_static_inline'
24911 perladmin='$perladmin'
24912 perllibs='$perllibs'
24913 perlpath='$perlpath'
24915 phostname='$phostname'
24921 prefixexp='$prefixexp'
24923 privlibexp='$privlibexp'
24924 procselfexe='$procselfexe'
24925 prototype='$prototype'
24927 quadkind='$quadkind'
24928 quadtype='$quadtype'
24929 randbits='$randbits'
24930 randfunc='$randfunc'
24931 random_r_proto='$random_r_proto'
24932 randseedtype='$randseedtype'
24934 rd_nodata='$rd_nodata'
24935 readdir64_r_proto='$readdir64_r_proto'
24936 readdir_r_proto='$readdir_r_proto'
24937 revision='$revision'
24943 sGMTIME_max='$sGMTIME_max'
24944 sGMTIME_min='$sGMTIME_min'
24945 sLOCALTIME_max='$sLOCALTIME_max'
24946 sLOCALTIME_min='$sLOCALTIME_min'
24947 sPRIEUldbl='$sPRIEUldbl'
24948 sPRIFUldbl='$sPRIFUldbl'
24949 sPRIGUldbl='$sPRIGUldbl'
24950 sPRIXU64='$sPRIXU64'
24952 sPRIeldbl='$sPRIeldbl'
24953 sPRIfldbl='$sPRIfldbl'
24954 sPRIgldbl='$sPRIgldbl'
24959 sSCNfldbl='$sSCNfldbl'
24960 sched_yield='$sched_yield'
24961 scriptdir='$scriptdir'
24962 scriptdirexp='$scriptdirexp'
24964 seedfunc='$seedfunc'
24965 selectminbits='$selectminbits'
24966 selecttype='$selecttype'
24967 sendmail='$sendmail'
24968 setgrent_r_proto='$setgrent_r_proto'
24969 sethostent_r_proto='$sethostent_r_proto'
24970 setlocale_r_proto='$setlocale_r_proto'
24971 setnetent_r_proto='$setnetent_r_proto'
24972 setprotoent_r_proto='$setprotoent_r_proto'
24973 setpwent_r_proto='$setpwent_r_proto'
24974 setservent_r_proto='$setservent_r_proto'
24977 sharpbang='$sharpbang'
24978 shmattype='$shmattype'
24979 shortsize='$shortsize'
24982 sig_count='$sig_count'
24983 sig_name='$sig_name'
24984 sig_name_init='$sig_name_init'
24986 sig_num_init='$sig_num_init'
24987 sig_size='$sig_size'
24988 signal_t='$signal_t'
24989 sitearch='$sitearch'
24990 sitearchexp='$sitearchexp'
24992 sitebinexp='$sitebinexp'
24993 sitehtml1dir='$sitehtml1dir'
24994 sitehtml1direxp='$sitehtml1direxp'
24995 sitehtml3dir='$sitehtml3dir'
24996 sitehtml3direxp='$sitehtml3direxp'
24998 sitelib_stem='$sitelib_stem'
24999 sitelibexp='$sitelibexp'
25000 siteman1dir='$siteman1dir'
25001 siteman1direxp='$siteman1direxp'
25002 siteman3dir='$siteman3dir'
25003 siteman3direxp='$siteman3direxp'
25004 siteprefix='$siteprefix'
25005 siteprefixexp='$siteprefixexp'
25006 sitescript='$sitescript'
25007 sitescriptexp='$sitescriptexp'
25008 sizesize='$sizesize'
25009 sizetype='$sizetype'
25013 sockethdr='$sockethdr'
25014 socketlib='$socketlib'
25015 socksizetype='$socksizetype'
25017 spackage='$spackage'
25018 spitshell='$spitshell'
25019 srand48_r_proto='$srand48_r_proto'
25020 srandom_r_proto='$srandom_r_proto'
25022 ssizetype='$ssizetype'
25023 st_ino_sign='$st_ino_sign'
25024 st_ino_size='$st_ino_size'
25025 startperl='$startperl'
25027 static_ext='$static_ext'
25029 stdio_base='$stdio_base'
25030 stdio_bufsiz='$stdio_bufsiz'
25031 stdio_cnt='$stdio_cnt'
25032 stdio_filbuf='$stdio_filbuf'
25033 stdio_ptr='$stdio_ptr'
25034 stdio_stream_array='$stdio_stream_array'
25035 strerror_r_proto='$strerror_r_proto'
25038 subversion='$subversion'
25043 targetarch='$targetarch'
25044 targetdir='$targetdir'
25045 targetenv='$targetenv'
25046 targethost='$targethost'
25047 targetmkdir='$targetmkdir'
25048 targetport='$targetport'
25049 targetsh='$targetsh'
25053 timeincl='$timeincl'
25054 timetype='$timetype'
25055 tmpnam_r_proto='$tmpnam_r_proto'
25061 ttyname_r_proto='$ttyname_r_proto'
25070 uidformat='$uidformat'
25076 uquadtype='$uquadtype'
25077 use5005threads='$use5005threads'
25078 use64bitall='$use64bitall'
25079 use64bitint='$use64bitint'
25080 usecbacktrace='$usecbacktrace'
25081 usecrosscompile='$usecrosscompile'
25082 usedevel='$usedevel'
25084 usedtrace='$usedtrace'
25085 usefaststdio='$usefaststdio'
25086 useithreads='$useithreads'
25087 usekernprocpathname='$usekernprocpathname'
25088 uselargefiles='$uselargefiles'
25089 uselongdouble='$uselongdouble'
25090 usemallocwrap='$usemallocwrap'
25091 usemorebits='$usemorebits'
25092 usemultiplicity='$usemultiplicity'
25093 usemymalloc='$usemymalloc'
25095 usensgetexecutablepath='$usensgetexecutablepath'
25096 useopcode='$useopcode'
25097 useperlio='$useperlio'
25098 useposix='$useposix'
25099 usequadmath='$usequadmath'
25100 usereentrant='$usereentrant'
25101 userelocatableinc='$userelocatableinc'
25102 useshrplib='$useshrplib'
25103 usesitecustomize='$usesitecustomize'
25104 usesocks='$usesocks'
25105 usethreads='$usethreads'
25106 usevendorprefix='$usevendorprefix'
25107 useversionedarchname='$useversionedarchname'
25108 usevfork='$usevfork'
25111 uvXUformat='$uvXUformat'
25112 uvoformat='$uvoformat'
25115 uvuformat='$uvuformat'
25116 uvxformat='$uvxformat'
25118 vendorarch='$vendorarch'
25119 vendorarchexp='$vendorarchexp'
25120 vendorbin='$vendorbin'
25121 vendorbinexp='$vendorbinexp'
25122 vendorhtml1dir='$vendorhtml1dir'
25123 vendorhtml1direxp='$vendorhtml1direxp'
25124 vendorhtml3dir='$vendorhtml3dir'
25125 vendorhtml3direxp='$vendorhtml3direxp'
25126 vendorlib='$vendorlib'
25127 vendorlib_stem='$vendorlib_stem'
25128 vendorlibexp='$vendorlibexp'
25129 vendorman1dir='$vendorman1dir'
25130 vendorman1direxp='$vendorman1direxp'
25131 vendorman3dir='$vendorman3dir'
25132 vendorman3direxp='$vendorman3direxp'
25133 vendorprefix='$vendorprefix'
25134 vendorprefixexp='$vendorprefixexp'
25135 vendorscript='$vendorscript'
25136 vendorscriptexp='$vendorscriptexp'
25138 version_patchlevel_string='$version_patchlevel_string'
25139 versiononly='$versiononly'
25143 yaccflags='$yaccflags'
25148 : add special variables
25149 $test -f $src/patchlevel.h && \
25150 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25151 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25152 echo "PERL_CONFIG_SH=true" >>config.sh
25154 : propagate old symbols
25155 if $test -f UU/config.sh; then
25156 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25157 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25158 config.sh config.sh UU/oldconfig.sh |\
25159 $sort | $uniq -u >UU/oldsyms
25160 set X `$cat UU/oldsyms`
25166 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25168 echo ": Variables propagated from previous config.sh file." >>config.sh
25169 for sym in `$cat UU/oldsyms`; do
25170 echo " Propagating $hint variable "'$'"$sym..."
25171 eval 'tmp="$'"${sym}"'"'
25173 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25179 : preserve RCS keywords in files with variable substitution, grrr
25182 : Finish up by extracting the .SH files
25186 echo "Extraction done."
25196 If you'd like to make any changes to the config.sh file before I begin
25197 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25200 rp="Press return or use a shell escape to edit config.sh:"
25205 *) : in case they cannot read
25206 sh 1>&4 -c "$ans";;
25211 : if this fails, just run all the .SH files by hand
25220 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25227 Now you need to generate make dependencies by running "$make depend".
25228 You might prefer to run it in background: "$make depend > makedepend.out &"
25229 It can take a while, so you might not want to run it right now.
25234 rp="Run $make depend now?"
25238 $make depend && echo "Now you must run '$make'."
25241 echo "You must run '$make depend' then '$make'."
25244 elif test -f [Mm]akefile; then
25246 echo "Now you must run a $make."
25248 echo "Configure done."
25251 if $test -f Policy.sh; then
25254 If you compile $package on a different machine or from a different object
25255 directory, copy the Policy.sh file from this object directory to the
25256 new one before you run Configure -- this will help you with most of
25257 the policy defaults.
25261 if $test -f config.msg; then
25262 echo "Hmm. I also noted the following information while running:"
25264 $cat config.msg >&4
25267 $rm -f kit*isdone ark*isdone